/* MyJP Radio — the house's look (/login/ui.css tokens, the games page's lockup), one screen that
 * scrolls as a document (IOS.md §15: no fixed layer, no locked root). The accent is the station's
 * own — "radio" under the wordmark wears it, so does Play.
 * IOS.md §1: the glass offset once, on the sticky header, through --top. */
:root {
  --bg:      #f2f2f7;
  --panel:   #ffffff;
  --panel-2: #f6f6f9;
  --line:    rgba(60, 60, 67, .16);
  --ink:     #000000;
  --ink-2:   #3c3c43;
  --dim:     #8a8a8e;
  --dim-2:   #b0b0b6;
  --pill:    #efeff0;
  --good:    #1a9e4b;
  --warn:    #b8730a;
  --bad:     #e5322b;
  --link:    #007aff;
  --radio:   #e8481f;
  --on-radio: #ffffff;
  --shadow:  0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.05);
  --r-card: 20px; --r-mid: 13px; --r-tile: 10px;
  --font: -apple-system, BlinkMacSystemFont, system-ui, "SF Pro Text", "Helvetica Neue", sans-serif;
  --font-round: "SF Pro Rounded", ui-rounded, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --glass-t: 20px;
  /* IOS.md §19: in Safari's own window on iOS 26 (not installed) the page runs under the status bar and the
     address pill while env(safe-area-inset-top) reads 0 — app.js sets --ios-chrome-t there; it is 0 everywhere else */
  --ios-chrome-t: 0px;
  --top: calc(max(var(--safe-t), var(--ios-chrome-t)) + var(--glass-t));
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --panel: #1c1c1e; --panel-2: #2c2c2e; --line: rgba(84, 84, 88, .48);
    --ink: #ffffff; --ink-2: #d7d7db; --dim: #98989f; --dim-2: #6c6c70; --pill: #2c2c2e;
    --good: #30d158; --warn: #ffd60a; --bad: #ff453a; --link: #0a84ff; --radio: #ff6a3d; --shadow: none;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100%; }
body { font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; padding-bottom: calc(24px + var(--safe-b)); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-decoration: none; }
img { display: block; }
.dim { color: var(--dim); }
.small { font-size: 13px; }

/* ── the header: the lockup, sticky, glass ─────────────────────────────── */
.top { position: sticky; top: 0; z-index: 30;
       padding: calc(6px + var(--top)) 16px 10px;
       background: color-mix(in srgb, var(--bg) 84%, transparent);
       backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
       border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--line); }
.topin, #main { max-width: 560px; margin: 0 auto; }
.topin { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.wordmark { font-family: var(--font-round); font-weight: 700; font-size: 30px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.wordmark .dim-ca { color: var(--dim); }
.lockup { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.lockup .sub { font-size: .46em; font-weight: 700; letter-spacing: .02em; color: var(--radio); margin-top: -.12em; margin-right: .04em; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--radio); margin-bottom: 6px; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--radio); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ── cards ─────────────────────────────────────────────────────────────── */
#main { padding: 12px 16px 0; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--panel); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 18px; border: 1px solid var(--line); }
.card h2 { font-size: 13px; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 10px; }

/* ── on now ────────────────────────────────────────────────────────────── */
.now { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 18px; }
.artwrap { display: flex; justify-content: center; }
.art { width: min(100%, 320px); aspect-ratio: 1; height: auto; border-radius: var(--r-mid); box-shadow: 0 10px 30px rgba(0,0,0,.18); object-fit: cover; background: var(--panel-2); }
.noart { display: grid; place-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--radio) 70%, var(--panel)), var(--radio)); }
.noart::after { content: ""; width: 42%; aspect-ratio: 1; border-radius: 50%; border: 10px solid rgba(255,255,255,.75); }
.nowtext { text-align: center; min-width: 0; }
.nowtext h1 { font-size: 22px; letter-spacing: -.02em; margin: 0; line-height: 1.2; overflow-wrap: anywhere; }
.artist { margin: 4px 0 0; color: var(--ink-2); font-size: 16px; }
.nowtext .small { margin: 4px 0 0; }
.by { display: inline-block; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--radio); background: color-mix(in srgb, var(--radio) 12%, var(--panel)); padding: 4px 10px; border-radius: 999px; }
.controls { display: flex; align-items: center; justify-content: center; gap: 18px; }
.playbtn { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--radio); color: var(--on-radio); display: grid; place-items: center; box-shadow: 0 6px 18px color-mix(in srgb, var(--radio) 40%, transparent); }
.playbtn:active { transform: scale(.96); }
.playbtn svg { width: 34px; height: 34px; fill: currentColor; }
.playbtn .ico-pause { display: none; }
.playbtn.on .ico-play { display: none; }
.playbtn.on .ico-pause { display: block; }
.playbtn.busy { opacity: .7; }
.playbtn:disabled { opacity: .35; }
.roundbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--pill); color: var(--ink); display: grid; place-items: center; }
.roundbtn svg { width: 22px; height: 22px; fill: currentColor; }
.state { text-align: center; margin: 0; min-height: 1.3em; }

/* ── a mash on now: the second song's cover, the version, the votes ─────── */
.artwrap { position: relative; }
.art2 { position: absolute; width: 30%; max-width: 104px; aspect-ratio: 1; height: auto; right: max(0px, calc(50% - 160px - 10px)); bottom: -10px;
        border-radius: var(--r-tile); border: 3px solid var(--panel); box-shadow: 0 6px 18px rgba(0,0,0,.22); object-fit: cover; background: var(--panel-2); }
.ver { display: inline-block; vertical-align: 4px; margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--radio);
       background: color-mix(in srgb, var(--radio) 12%, var(--panel)); padding: 2px 8px; border-radius: 999px; }
.why { display: block; margin-top: 6px; font-size: 12.5px; color: var(--dim); }
.mash { display: flex; flex-direction: column; gap: 12px; }
.bar { display: flex; gap: 3px; }
.seg { flex: 1; min-width: 0; height: 30px; padding: 12px 0; border: 0; background: none; display: block; }   /* a 30px target, a 6px bar */
.seg i { display: block; height: 6px; border-radius: 3px; background: var(--pill); }
.seg.guest i { background: color-mix(in srgb, var(--radio) 22%, var(--pill)); }
.seg.on i { background: var(--radio); }
.seg.sel { padding: 10px 0; }
.seg.sel i { height: 10px; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--ink); }
.seg.down i { background-image: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--bad) 55%, transparent) 4px 6px); }
.part { background: var(--panel-2); border-radius: var(--r-mid); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.parthead { font-size: 14px; }
.partwhat { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.partwhat .lbl { display: inline-block; min-width: 46px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); }
.partvote { display: flex; flex-wrap: wrap; gap: 8px; }
.linkish { border: 0; background: none; color: var(--link); padding: 0 0 0 6px; font-size: 13px; }
.thumbs { display: flex; justify-content: center; gap: 18px; }
.thumb { min-width: 92px; height: 48px; border-radius: 999px; border: 0; background: var(--pill); font-size: 22px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.thumb small { font-size: 14px; color: var(--dim); font-variant-numeric: tabular-nums; }
.thumb.mine { background: var(--radio); }
.thumb.mine small { color: var(--on-radio); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 13px; font-size: 13.5px; color: var(--ink); }
.chip.mine { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.mash .msg { text-align: center; margin: 0; }
.judges { display: flex; flex-direction: column; gap: 8px; }
.judge { display: flex; align-items: center; gap: 8px; }
.judge span { flex: 1; font-size: 15px; color: var(--ink-2); }
.judge.main span { font-weight: 600; color: var(--ink); font-size: 16px; }
.tb { min-width: 66px; height: 38px; border-radius: 999px; border: 0; background: var(--pill); font-size: 17px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.judge.main .tb { min-width: 80px; height: 46px; font-size: 21px; }
.tb small { font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.tb.mine { background: var(--radio); }
.tb.mine small { color: var(--on-radio); }
.judges .chips { justify-content: flex-start; margin: -2px 0 4px; }

/* ── how the mashes are made: how.html, and the same cards folded into the station page (app.js) ── */
.how h1 { font-size: 24px; letter-spacing: -.02em; margin: 0 0 6px; }
.how p, .how li { color: var(--ink-2); }
.how .card p:last-child { margin-bottom: 0; }
.how table { width: 100%; border-collapse: collapse; font-size: 14px; }
.how td, .how th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.how th { color: var(--dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.how tr:last-child td { border-bottom: 0; }
.how code, .how .mono { font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.how .scroll { overflow-x: auto; }
.how details { border-bottom: 1px solid var(--line); padding: 8px 0; }
.how details:last-child { border-bottom: 0; }
.how summary { cursor: pointer; }
.how pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--panel-2); padding: 10px; border-radius: var(--r-tile); margin: 8px 0 0; }
.howfold { display: flex; flex-direction: column; gap: 14px; }
.howfold .closebar { display: flex; justify-content: space-between; align-items: center; }

/* ── lists ─────────────────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; }
.list p { margin: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row:first-child { padding-top: 0; }
.row .n { width: 22px; flex: none; color: var(--dim-2); font-variant-numeric: tabular-nums; font-size: 13px; }
.row img { width: 40px; height: 40px; border-radius: 8px; flex: none; background: var(--panel-2); }
.row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.row .txt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .txt span { color: var(--dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .when { flex: none; color: var(--dim-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tag { flex: none; font-size: 12px; font-weight: 600; color: var(--radio); }

/* ── requests ──────────────────────────────────────────────────────────── */
.note { color: var(--ink-2); margin: 0 0 12px; }
.btn { display: inline-block; border: 0; border-radius: 999px; background: var(--ink); color: var(--panel); font-weight: 600; padding: 11px 20px; font-size: 15px; }
.btn.accent { background: var(--radio); color: var(--on-radio); }
.btn.quiet { background: var(--pill); color: var(--ink); }
.btn.tiny { padding: 7px 13px; font-size: 13px; }
.btn.danger { background: var(--bad); color: #fff; }
.btn:disabled { opacity: .45; }
.search { width: 100%; padding: 11px 14px; border-radius: var(--r-mid); border: 1px solid var(--line); background: var(--panel-2); font-size: 16px; -webkit-appearance: none; }
.search:focus { outline: 2px solid var(--radio); outline-offset: -1px; }
.msg { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
.msg.bad { color: var(--bad); }
.msg.good { color: var(--good); }
.mine { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-mid); background: color-mix(in srgb, var(--radio) 10%, var(--panel)); }
.mine .txt { flex: 1; min-width: 0; }
.mine b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine span { color: var(--ink-2); font-size: 13px; }
.quota { margin: 10px 0 0; font-size: 12.5px; color: var(--dim); }

/* ── the foot (contract point 5) ───────────────────────────────────────── */
.foot { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.group h3 { font-size: 13px; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 6px 14px; }
.group .cells { background: var(--panel); border-radius: var(--r-card); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.cell { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; color: var(--ink); font-size: 15px; }
.cell:last-child { border-bottom: 0; }
.cell small { color: var(--dim); font-size: 14px; text-align: right; }
.cell.danger { color: var(--bad); justify-content: center; }
.cell.link { color: var(--link); }
details.tech summary { list-style: none; cursor: pointer; }
details.tech summary::-webkit-details-marker { display: none; }
details.tech summary::after { content: "›"; color: var(--dim-2); font-size: 20px; line-height: 1; transition: transform .15s; }
details.tech[open] summary::after { transform: rotate(90deg); }
details.tech .cell.note-cell { color: var(--dim); font-size: 13px; line-height: 1.4; }
.gamesrow { display: flex; align-items: center; gap: 12px; }
.gamesrow .lockup { flex: none; align-items: flex-start; }
.gamesrow .lockup .mark { font-family: var(--font-round); font-weight: 700; font-size: 17px; color: var(--ink); }
.gamesrow .lockup .sub { color: #c48a12; font-size: 9px; }
@media (prefers-color-scheme: dark) { .gamesrow .lockup .sub { color: #f2b93a; } }
.address { text-align: center; color: var(--dim-2); font-size: 12.5px; margin: 6px 0 0; }

/* the install card (install.js styles itself from tokens; the plate is the station's) */
.pwa-gate .pwa-primary, .pwa-gate .pwa-icon { background: var(--radio); color: var(--on-radio); }
.pwa-gate .pwa-card { box-shadow: var(--shadow); }

@media (min-width: 640px) {
  .now { grid-template-columns: 240px 1fr; align-items: center; column-gap: 22px; }
  .artwrap { grid-row: 1 / span 4; }
  .art2 { right: -8px; }
  .chips, .thumbs { justify-content: flex-start; }
  .mash .msg { text-align: left; }
  .nowtext { text-align: left; }
  .controls { justify-content: flex-start; }
  .state { text-align: left; }
}
