/* W.A.G.E. Radio — near-black #0A0B0D + blaze orange #FF7A1A. Mobile first. */
:root {
  --bg: #0A0B0D;
  --card: #131417;
  --card2: #1a1b1f;
  --line: #26282c;
  --ink: #f2f0ec;
  --dim: #a09a92;
  --hot: #FF7A1A;
  --hot-hover: #ff8f3d;
  --hot-soft: rgba(255, 122, 26, .14);
  --hot-line: rgba(255, 122, 26, .55);
  --c1: #22e1ff;   /* challenger — matches the stream overlay */
  --c2: #ffc23d;   /* champion / defender */
  --paid: #b6ff3b;
  --ok: #5de38a;
  --bad: #ff5a3c;
  --display: Bahnschrift, "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
[hidden] { display: none !important; }
a { color: var(--hot); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; }
h2 { font-size: 26px; letter-spacing: .01em; }
h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); font-weight: 700; margin-bottom: 10px; }
p { margin: 0 0 10px; }
.muted { color: var(--dim); }
.small { font-size: 13px; }
.grow { flex: 1; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
code, .mono { font: 14px Consolas, ui-monospace, monospace; }
code { background: var(--card2); padding: 2px 7px; border-radius: 6px; }

/* ── buttons & inputs ── */
button, select, input, .btn {
  font: inherit; color: var(--ink); background: var(--card2);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; min-height: 42px;
}
input, select { width: 100%; }
button, .btn { cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
button:hover, .btn:hover { border-color: var(--hot-line); }
button:focus-visible, input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--hot); outline-offset: 2px; }
.hot { background: var(--hot); border-color: var(--hot); color: #0A0B0D; font-weight: 700; }
.hot:hover { background: var(--hot-hover); border-color: var(--hot-hover); }
.ghost { background: transparent; }
.small-btn { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.big { min-height: 54px; padding: 12px 22px; font-size: 18px; border-radius: 14px; }
button:disabled { opacity: .45; cursor: default; }

/* ── pills ── */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--card2); color: var(--dim); white-space: nowrap; }
.pill.on { background: rgba(93, 227, 138, .15); color: var(--ok); }
.pill.off, .pill.err { background: rgba(255, 90, 60, .15); color: var(--bad); }
.pill.warn { background: var(--hot-soft); color: var(--hot); }
.pill.skip, .pill.superskip, .pill.paid { background: var(--paid); color: #0b1400; }
.pill.throne { background: var(--hot); color: #0A0B0D; }
.pill.battle { background: var(--hot-soft); color: var(--hot); }
.pill.admin { background: #2b2f3a; color: #cfe3ff; }
.pill.test { color: var(--c2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.on .dot { animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grid { display: grid; gap: 14px; }
@media (min-width: 820px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }

/* ── top bar ── */
.top { position: sticky; top: 0; z-index: 5; background: rgba(10, 11, 13, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 10px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; letter-spacing: .06em; font-size: 20px; color: var(--ink); text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 2px var(--hot); }
.brand b { color: var(--hot); }
.corner { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.avatar { width: 28px; height: 28px; border-radius: 50%; }

/* ── landing ── */
.hero { padding: 28px 0 8px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; width: 520px; height: 520px; left: -160px; top: -220px; border-radius: 50%; background: rgba(255, 122, 26, .22); filter: blur(90px); pointer-events: none; }
.hero h1 { font-size: clamp(40px, 11vw, 76px); font-weight: 800; letter-spacing: .01em; }
.hero h1 b { color: var(--hot); }
.hero .lede { font-size: 19px; color: #d8d3cc; max-width: 34em; margin: 12px 0 18px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.cta .btn { flex: 1 1 220px; }
.status-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 0; }

section.block { padding: 26px 0; border-top: 1px solid var(--line); }
section.block > .wrap > h2 { margin-bottom: 6px; }
section.block > .wrap > .sub { color: var(--dim); margin-bottom: 16px; }
.emote { width: 56px; height: 56px; object-fit: contain; float: right; margin: -6px 0 0 10px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.5)); }

.now-title { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.now-sub { color: var(--dim); margin-top: 2px; overflow-wrap: anywhere; }
.bar { height: 6px; border-radius: 6px; background: var(--card2); overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--hot), #ffb066); transition: width .9s linear; }
.times { display: flex; justify-content: space-between; font-size: 13px; color: var(--dim); margin-top: 6px; font-variant-numeric: tabular-nums; }

.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; }
.vs .n { font-family: var(--display); font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.vs .s1 .t { color: var(--c1); } .vs .s2 .t { color: var(--c2); }
.vs .s2 { text-align: right; }
.vs .t { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.15; overflow-wrap: anywhere; }
.vs .x { color: var(--hot); font-weight: 800; font-style: italic; font-family: var(--display); font-size: 24px; padding-top: 2px; }
.tug { display: flex; height: 14px; border-radius: 14px; overflow: hidden; background: var(--card2); margin-top: 12px; }
.tug i { transition: width .6s ease; }
.tug .a { background: var(--c1); } .tug .b { background: var(--c2); }
.key { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 7px; font-weight: 800; color: #0A0B0D; padding: 0 6px; }
.key.k1 { background: var(--c1); } .key.k2 { background: var(--c2); }

.lane { margin-bottom: 14px; }
.lane > .k { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.it { display: flex; gap: 10px; align-items: center; padding: 9px 11px; border-radius: 11px; background: var(--card2); margin-bottom: 6px; border-left: 3px solid transparent; }
.it.paid { border-left-color: var(--paid); }
.it.throne { border-left-color: var(--hot); }
.it.admin { border-left-color: #8fb6ff; }
.it .meta { flex: 1; min-width: 0; }
.it .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it .s { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.empty { color: var(--dim); padding: 6px 0; }

.tiers { display: grid; gap: 10px; }
@media (min-width: 700px) { .tiers { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .tiers { grid-template-columns: repeat(4, 1fr); } }
.tier { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.tier .name { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.tier .name b { font-family: var(--display); font-size: 20px; }
.tier .price { font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--hot); white-space: nowrap; }
.tier.throne { border-color: var(--hot-line); background: linear-gradient(180deg, rgba(255,122,26,.12), var(--card)); }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 12px 52px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 8px; background: var(--hot); color: #0A0B0D; font-weight: 800; display: grid; place-items: center; }
.cmds { display: grid; gap: 8px; }
.cmd { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }

.links { display: grid; gap: 10px; }
@media (min-width: 700px) { .links { grid-template-columns: repeat(2, 1fr); } }
.link { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.link:hover { border-color: var(--hot-line); }
.link .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-family: var(--display); flex: none; }
.link .lt { font-weight: 700; }
.link .ls { font-size: 13px; color: var(--dim); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.socials a { padding: 8px 12px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; }
.socials a:hover { border-color: var(--hot-line); }

details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; margin-bottom: 8px; }
details summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details summary::after { content: "+"; color: var(--hot); font-weight: 800; }
details[open] summary::after { content: "–"; }
details > div { padding: 0 0 14px; color: #d6d1ca; }

footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--dim); font-size: 14px; }
.notice { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--hot-soft); border: 1px solid var(--hot-line); }

/* ── dashboard ── */
.dash { padding: 14px 0 40px; display: grid; gap: 14px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.warnbar { padding: 10px 14px; border-radius: 10px; background: var(--hot-soft); border: 1px solid var(--hot-line); }
.feed .ev { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); }
.feed .ev:last-child { border-bottom: 0; }
.feed .when { color: var(--dim); font-size: 12px; min-width: 64px; font-variant-numeric: tabular-nums; }
.feed .what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.amt { color: var(--hot); font-weight: 700; }
pre { margin: 0; max-height: 360px; overflow: auto; font: 12px/1.5 Consolas, ui-monospace, monospace; color: #cfcac3; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; }
.preview img { width: 96px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--card2); flex: none; }
.preview .fields { flex: 1; display: grid; gap: 8px; min-width: 0; }
.choice { display: grid; gap: 8px; margin-top: 12px; }
.choice label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); cursor: pointer; }
.choice label:has(input:checked) { border-color: var(--hot-line); background: var(--hot-soft); }
.choice input[type=radio], .choice input[type=checkbox], .perm input { width: auto; min-height: 0; margin-top: 3px; accent-color: var(--hot); }
.perms { display: grid; gap: 6px; }
.perm { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
table.users { width: 100%; border-collapse: collapse; font-size: 14px; }
table.users td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.users td:first-child { overflow-wrap: anywhere; }
dialog { background: var(--card); color: var(--ink); border: 1px solid var(--hot-line); border-radius: 14px; max-width: min(480px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .7); }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--card2); border: 1px solid var(--hot-line); padding: 10px 16px; border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100vw - 32px); z-index: 9; }
#toast.on { opacity: 1; }
#toast.bad { border-color: var(--bad); }

/* ── radio manager ───────────────────────────────── */
.tracks { list-style: none; margin: 8px 0 0; padding: 0; max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.tracks.lib { max-height: 300px; }
.tracks li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); font-size: 14px; background: transparent; }
.tracks li:last-child { border-bottom: 0; }
.tracks li .grip { cursor: grab; color: var(--dim); user-select: none; padding: 0 2px; }
.tracks li .n { width: 26px; color: var(--dim); font-variant-numeric: tabular-nums; text-align: right; }
.tracks li .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracks li .acts { display: flex; gap: 4px; flex: none; }
.tracks li .acts button { min-height: 28px; padding: 2px 8px; font-size: 12px; }
.tracks li.dragging { opacity: .4; }
.tracks li.drop-above { box-shadow: inset 0 2px 0 var(--hot); }
.tracks li.drop-below { box-shadow: inset 0 -2px 0 var(--hot); }
.tracks li.is-next { background: var(--hot-soft); }
.tracks li.out { opacity: .5; }
.tracks .emptyrow { color: var(--dim); padding: 10px; font-size: 13px; }
.row.wrap { flex-wrap: wrap; }
/* Phones: the name gets the whole first line and the buttons (↑↓ included, since
   drag-and-drop doesn't work by touch) sit on a line of their own under it. */
@media (max-width: 640px) {
  .tracks li { flex-wrap: wrap; row-gap: 6px; padding: 8px; }
  .tracks li .t { flex: 1 1 0; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .tracks li .acts { flex: 1 0 100%; justify-content: flex-end; flex-wrap: wrap; }
  .tracks li .acts button { min-height: 34px; padding: 4px 10px; font-size: 13px; }
  .tracks li .grip { display: none; }
  .tracks li .n:empty { display: none; }
}
/* Queue gets a real column; the playlist takes the rest. Stacks on narrow screens. */
#radioCard .grid.two { grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); }
#radioCard .grid.two > div { min-width: 0; }
@media (max-width: 900px) { #radioCard .grid.two { grid-template-columns: 1fr; } }

/* ── phone: native-app layout (app-shell.js adds .app under 820px) ─────────
   The page never scrolls — no pull-to-refresh, no rubber band. Header on top,
   tab bar at the bottom, each tab a panel that scrolls on its own. */
html.app, body.app { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.app {
  position: fixed; inset: 0; width: 100%; height: var(--app-h, 100dvh);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
body.app .top { position: relative; flex: none; }
body.app .top .wrap { min-height: 52px; }
body.app main, body.app > footer { display: none; } /* emptied into the panels */
#appPanels { flex: 1 1 auto; position: relative; min-height: 0; }
.app-panel {
  position: absolute; inset: 0; display: none;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 4px 0 20px;
}
.app-panel.on { display: block; }
.app-panel > footer { display: block; padding: 16px 0 8px; }
.app-panel .wrap.dash, .app-panel > .card, .app-panel > .grid, .app-panel > .row, .app-panel > section.card { margin-left: 12px; margin-right: 12px; }
.app-panel .grid.two { grid-template-columns: 1fr; }
.app-panel .hero { padding-top: 14px; }
.app-panel .block { padding-top: 14px; }
.app-tabs {
  flex: none; display: flex; background: rgba(10, 11, 13, .97); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); user-select: none; -webkit-user-select: none;
}
.app-tabs button {
  flex: 1; min-height: 58px; border: 0; border-radius: 0; background: none; padding: 6px 2px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--dim);
}
.app-tabs button.on { color: var(--hot); }
.app-tabs button:focus-visible { outline: 2px solid var(--hot); outline-offset: -4px; }
/* iOS zooms into inputs under 16px; a native app doesn't. */
body.app input, body.app select, body.app textarea { font-size: 16px; }
/* Dashboard: until sign-in says who you are (or if you have no role), only the gate shows. */
body.app:has(#app[hidden]) #appPanels .app-panel > :not(#gate) { display: none; }
body.app:has(#app[hidden]) .app-tabs { display: none; }
.app-panel { scrollbar-width: none; }
.app-panel::-webkit-scrollbar { display: none; }
/* Phone dashboard header: logo, role, avatar and Sign out on one line; the email is dropped (the avatar says who). */
body.app .top .wrap { gap: 8px; }
body.app .brand { font-size: 16px; gap: 8px; white-space: nowrap; flex: none; }
body.app .brand img { width: 30px; height: 30px; }
body.app #role { font-size: 10px; padding: 3px 7px; white-space: nowrap; flex: none; }
body.app #who { display: none; }
body.app .corner { gap: 6px; flex: none; }
body.app .corner .avatar { width: 28px; height: 28px; }
/* iPhone: one-time "Add to Home Screen" tip above the tab bar (Safari can't go full screen). */
body.app .a2hs { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--hot-soft); border-top: 1px solid var(--line); font-size: 13px; }
body.app .a2hs span { flex: 1; }
body.app .a2hs button { min-height: 28px; padding: 2px 10px; background: transparent; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; }
body.app .a2hs .go { background: var(--hot); color: #111; border-color: var(--hot); font-weight: 700; white-space: nowrap; }
.a2hs-sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; }
.a2hs-sheet[hidden] { display: none; }
.a2hs-card { width: 100%; background: var(--card, #111317); border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; max-height: 85%; overflow: auto; }
.a2hs-card ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; font-size: 16px; line-height: 1.4; }
.a2hs-card p { margin: 0; }
.a2hs-card .btn { width: 100%; text-align: center; justify-content: center; }
#getApp { background: var(--hot); color: #111; border-color: var(--hot); font-weight: 700; }
