/* Lions × Dragons soundboard — mobile first */

@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("../assets/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("../assets/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-style: normal; font-display: swap; src: url("../assets/fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-style: italic; font-display: swap; src: url("../assets/fonts/barlow-condensed-latin-800-italic.woff2") format("woff2"); }

:root {
  --bg: #060d1c;
  --navy: #0a1730;
  --navy-2: #102449;
  --blue: #1d5fb8;
  --blue-bright: #4a95f5;
  --yellow: #ffd60a;
  --yellow-hi: #ffe766;
  --yellow-lo: #f0b400;
  --ink: #f4f7ff;
  --ink-navy: #071226;
  --muted: rgba(220, 230, 255, 0.62);
  --line: rgba(140, 170, 255, 0.16);
  --danger: #ff5d6c;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --gutter: 16px;
  --dock-h: 104px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); overscroll-behavior-y: none; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  padding-bottom: calc(var(--dock-h) + var(--safe-b) + 24px);
  overflow-x: hidden;
}
body.has-now { --dock-h: 196px; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- Backdrop ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(29, 95, 184, 0.28), transparent 60%),
    linear-gradient(to bottom, rgba(6, 13, 28, 0.25) 0%, rgba(6, 13, 28, 0.7) 26%, rgba(6, 13, 28, 0.93) 48%, var(--bg) 70%),
    url("../assets/arena.jpg") center top / cover no-repeat;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(29, 95, 184, 0.28), transparent 60%),
    linear-gradient(to bottom, rgba(6, 13, 28, 0.25) 0%, rgba(6, 13, 28, 0.7) 26%, rgba(6, 13, 28, 0.93) 48%, var(--bg) 70%),
    image-set(url("../assets/arena.webp") type("image/webp"), url("../assets/arena.jpg") type("image/jpeg")) center top / cover no-repeat;
}

/* ---------- Header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(var(--safe-t) + 14px) var(--gutter) 6px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logos { display: flex; align-items: center; flex: none; }
.brand-logos img { height: 50px; width: auto; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.55)); }
.brand-logos .dragon { height: 52px; margin-left: 2px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--display); font-weight: 800; font-style: italic;
  font-size: 25px; line-height: 0.95; text-transform: uppercase; letter-spacing: 0.01em;
  white-space: nowrap; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.brand-name b { color: var(--yellow); font-weight: 800; padding: 0 1px; }
.brand-sub {
  margin-top: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--muted);
}

.offline-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px 0 10px; border-radius: 999px;
  background: rgba(10, 23, 48, 0.55); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 12px; font-weight: 650; letter-spacing: 0.02em; color: var(--ink);
}
.offline-chip svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.offline-chip.is-ready { color: var(--yellow); border-color: rgba(255, 214, 10, 0.4); }
.offline-chip.is-busy { color: var(--blue-bright); }

/* ---------- Tabs ---------- */
.tabs {
  position: sticky; top: var(--safe-t); z-index: 10;
  padding: 10px var(--gutter);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.tabs::before { /* covers the status bar area when the tabs are stuck (home-screen app) */
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: var(--safe-t);
  background: rgba(6, 13, 28, 0.94); opacity: 0; transition: opacity 0.2s ease;
}
.tabs.is-stuck {
  background: rgba(6, 13, 28, 0.86);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.tabs.is-stuck::before { opacity: 1; }
.tabs-track {
  position: relative; display: grid; grid-template-columns: repeat(var(--n, 3), 1fr);
  padding: 4px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
}
.tab-indicator {
  position: absolute; top: 4px; left: 4px; bottom: 4px;
  width: calc((100% - 8px) / var(--n, 3)); border-radius: 10px;
  background: linear-gradient(180deg, var(--yellow-hi), var(--yellow) 60%, var(--yellow-lo));
  box-shadow: 0 4px 14px rgba(255, 200, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform 0.32s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.tab {
  position: relative; z-index: 1; height: 40px; border: 0; background: none;
  font-family: var(--display); font-weight: 700; font-size: 17px;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
  transition: color 0.2s;
}
.tab.is-active { color: var(--ink-navy); }

/* ---------- Panels ---------- */
.panel-head { padding: 14px var(--gutter) 12px; }
.panel-head h2 {
  margin: 0; font-family: var(--display); font-weight: 800; font-style: italic;
  font-size: 34px; line-height: 1; text-transform: uppercase; letter-spacing: 0.01em;
}
.panel-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.panel.is-active { animation: panelIn 0.28s ease both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Pads ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 var(--gutter) 8px; }

.pad {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 96px; padding: 10px 13px 14px; border-radius: 16px;
  display: flex; flex-direction: column; justify-content: flex-start; text-align: left;
  border: 1px solid rgba(120, 160, 255, 0.2);
  background: linear-gradient(155deg, rgba(37, 88, 172, 0.62) 0%, rgba(16, 36, 73, 0.9) 55%, rgba(9, 21, 44, 0.95) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 20px rgba(0, 0, 0, 0.28);
  transition: transform 0.12s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.pad::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(90% 70% at 100% 0%, rgba(74, 149, 245, 0.25), transparent 60%);
}
.pad:active { transform: scale(0.965); }
.pad-num {
  display: block; height: 16px; margin-bottom: auto; padding-bottom: 8px; box-sizing: content-box;
  font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.08em;
  color: rgba(220, 230, 255, 0.38);
}
.pad-title {
  font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.02;
  text-transform: uppercase; letter-spacing: 0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pad-artist {
  margin-top: 3px; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pad-time {
  position: absolute; top: 9px; right: 12px;
  font-family: var(--display); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
  opacity: 0;
}
.pad .eq { position: absolute; top: 12px; left: 13px; opacity: 0; }
.pad-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(7, 18, 38, 0.22); opacity: 0; }
.pad-bar span { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--ink-navy); }

.pad.is-playing {
  color: var(--ink-navy);
  border-color: rgba(255, 240, 160, 0.9);
  background: linear-gradient(170deg, var(--yellow-hi) 0%, var(--yellow) 55%, var(--yellow-lo) 100%);
  box-shadow: 0 0 0 1px rgba(255, 214, 10, 0.35), 0 10px 28px rgba(255, 196, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.pad.is-playing::before { opacity: 0; }
.pad.is-playing .pad-artist { color: rgba(7, 18, 38, 0.68); }
.pad.is-playing .pad-num { visibility: hidden; }
.pad.is-playing .eq, .pad.is-playing .pad-time, .pad.is-playing .pad-bar { opacity: 1; }
.pad.is-fading { filter: saturate(0.6) brightness(0.92); }


/* ---------- List (full songs) ---------- */
.list { display: flex; flex-direction: column; gap: 8px; padding: 0 var(--gutter) 8px; }
.row {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 100%; min-height: 64px; padding: 10px 14px 10px 12px; text-align: left;
  border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(23, 52, 104, 0.55), rgba(10, 23, 48, 0.75));
  transition: transform 0.12s ease, background 0.25s ease, border-color 0.25s ease;
}
.row:active { transform: scale(0.985); }
.row-icon {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid rgba(255, 214, 10, 0.55); color: var(--yellow);
}
.row-icon svg { width: 16px; height: 16px; fill: currentColor; margin-left: 2px; }
.row-icon .eq { display: none; }
.row-text { min-width: 0; }
.row-title {
  display: block; font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.1;
  text-transform: uppercase; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-artist { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { font-family: var(--display); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--muted); }
.row-meta .saved { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); opacity: 0.8; vertical-align: middle; }
.row-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--p, 0) * 100%); background: var(--yellow); opacity: 0; }

.row.is-playing { border-color: rgba(255, 214, 10, 0.6); background: linear-gradient(100deg, rgba(255, 214, 10, 0.16), rgba(10, 23, 48, 0.8)); }
.row.is-playing .row-icon { background: var(--yellow); border-color: var(--yellow); color: var(--ink-navy); }
.row.is-playing .row-icon svg { display: none; }
.row.is-playing .row-icon .eq { display: inline-flex; }
.row.is-playing .row-meta { color: var(--yellow); }
.row.is-playing .row-bar { opacity: 1; }

/* ---------- Equalizer glyph ---------- */
.eq { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 14px; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform-origin: bottom; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; animation-duration: 0.7s; }
.eq i:nth-child(3) { animation-delay: -0.55s; animation-duration: 1.1s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.25); } 50% { transform: scaleY(1); } }
.is-fading .eq i { animation-play-state: paused; }

/* ---------- Dock ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 12px calc(var(--safe-b) + 12px);
  background: linear-gradient(to top, var(--bg) 0%, rgba(6, 13, 28, 0.94) 60%, rgba(6, 13, 28, 0));
  pointer-events: none;
}
.dock > * { pointer-events: auto; }

.now {
  padding: 10px 10px 10px 14px; border-radius: 18px;
  background: rgba(16, 34, 70, 0.86); border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  animation: nowIn 0.25s ease both;
}
@keyframes nowIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.now-main { display: flex; align-items: center; gap: 10px; }
.now .eq { color: var(--yellow); flex: none; }
.now-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.now-title { font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.05; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-artist { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctl {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.08);
  font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 0.05em; text-transform: uppercase;
  transition: transform 0.1s ease, background 0.2s ease;
}
.ctl:active { transform: scale(0.94); }
.ctl svg { width: 19px; height: 19px; }
.ctl--fade { padding: 0 12px 0 10px; }
.ctl--fade svg { fill: currentColor; }
.ctl--fade svg .w { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ctl--stop { width: 42px; color: #fff; background: rgba(255, 93, 108, 0.2); border-color: rgba(255, 93, 108, 0.45); }
.ctl--stop svg { fill: currentColor; }
.now.is-fading .ctl--fade { color: var(--yellow); border-color: rgba(255, 214, 10, 0.5); background: rgba(255, 214, 10, 0.12); }
.now-progress { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.time { flex: none; width: 38px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.time:last-child { text-align: right; }
.bar { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.bar span { display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: inherit; background: linear-gradient(90deg, var(--yellow-lo), var(--yellow)); }

/* ---------- Score buttons (permanent) ---------- */
.scorebar { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 8px; }
.score {
  position: relative; overflow: hidden; isolation: isolate;
  height: 84px; border: 0; border-radius: 22px; padding: 0 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: transform 0.08s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.score:active { transform: translateY(2px) scale(0.985); }
.score-label {
  font-family: var(--display); font-weight: 800; font-style: italic;
  line-height: 0.82; letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap;
}
.score-sub { margin-top: 6px; font-size: 10.5px; font-weight: 750; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.score-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; opacity: 0; }
.score-progress span { display: block; height: 100%; width: calc(var(--p, 0) * 100%); }
.score.is-playing .score-progress { opacity: 1; }

.score--us {
  color: var(--ink-navy);
  background: linear-gradient(180deg, var(--yellow-hi) 0%, var(--yellow) 52%, var(--yellow-lo) 100%);
  box-shadow: 0 14px 34px rgba(255, 190, 0, 0.3), 0 2px 0 rgba(255, 255, 255, 0.25) inset, 0 -5px 0 rgba(120, 80, 0, 0.22) inset;
}
.score--us .score-label { font-size: 50px; text-shadow: 0 2px 0 rgba(255, 255, 255, 0.45); }
.score--us .score-progress { background: rgba(7, 18, 38, 0.18); }
.score--us .score-progress span { background: var(--ink-navy); }
.score--us.is-playing { animation: pulseUs 1.1s ease-in-out infinite; }

.score--them {
  color: #fff;
  background: linear-gradient(180deg, #3a7fe0 0%, #1d5fb8 48%, #133f82 100%);
  box-shadow: 0 12px 28px rgba(18, 63, 130, 0.45), 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 -5px 0 rgba(0, 0, 0, 0.22) inset;
}
.score--them .score-label { font-size: clamp(21px, 6.9vw, 30px); }
.score--them .score-sub { opacity: 0.8; }
.score--them .score-progress { background: rgba(0, 0, 0, 0.25); }
.score--them .score-progress span { background: #fff; }
.score--them.is-playing { animation: pulseThem 1.1s ease-in-out infinite; }

.score-shine {
  position: absolute; top: 0; bottom: 0; left: -45%; width: 35%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  transform: skewX(-22deg); animation: shine 5s ease-in-out 1.5s infinite;
}
@keyframes shine { 0% { left: -45%; } 22%, 100% { left: 130%; } }
@keyframes pulseUs {
  0%, 100% { box-shadow: 0 14px 34px rgba(255, 190, 0, 0.3), 0 0 0 0 rgba(255, 214, 10, 0.55); }
  50% { box-shadow: 0 14px 34px rgba(255, 190, 0, 0.45), 0 0 0 9px rgba(255, 214, 10, 0); }
}
@keyframes pulseThem {
  0%, 100% { box-shadow: 0 12px 28px rgba(18, 63, 130, 0.45), 0 0 0 0 rgba(74, 149, 245, 0.6); }
  50% { box-shadow: 0 12px 28px rgba(18, 63, 130, 0.55), 0 0 0 9px rgba(74, 149, 245, 0); }
}

/* ---------- Goal celebration ---------- */
.celebrate { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; align-content: center; gap: 4px; pointer-events: none; opacity: 0; visibility: hidden; }
.celebrate.is-on { visibility: visible; animation: celebrate 2.1s ease forwards; }
.celebrate-burst {
  position: absolute; inset: -30%;
  background:
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 214, 10, 0.16) 0deg 8deg, transparent 8deg 22deg),
    radial-gradient(circle at 50% 50%, rgba(255, 230, 102, 0.95) 0%, rgba(255, 214, 10, 0.7) 14%, rgba(29, 95, 184, 0.8) 38%, rgba(6, 13, 28, 0.94) 66%);
}
.celebrate.is-on .celebrate-burst { animation: burst 2.1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.celebrate::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; }
.celebrate.is-on::after { animation: flash 0.35s ease-out; }
.celebrate-row { position: relative; display: flex; gap: 18px; }
.celebrate-row img { height: clamp(84px, 26vw, 140px); width: auto; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55)); }
.celebrate.is-on .celebrate-row img:first-child { animation: fromLeft 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) 0.08s both; }
.celebrate.is-on .celebrate-row img:last-child { animation: fromRight 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) 0.08s both; }
.celebrate-word {
  position: relative; font-family: var(--display); font-weight: 800; font-style: italic;
  font-size: clamp(96px, 34vw, 190px); line-height: 0.85; text-transform: uppercase; letter-spacing: 0.01em;
  color: #fff; text-shadow: 0 6px 0 #0b2a5c, 0 0 46px rgba(255, 214, 10, 0.9);
}
.celebrate.is-on .celebrate-word { animation: word 2.1s cubic-bezier(0.2, 0.9, 0.2, 1) forwards; }
@keyframes celebrate { 0% { opacity: 0; } 6% { opacity: 1; } 76% { opacity: 1; } 100% { opacity: 0; } }
@keyframes flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }
@keyframes burst { 0% { transform: scale(0.35) rotate(-20deg); } 100% { transform: scale(1.15) rotate(25deg); } }
@keyframes word {
  0% { transform: scale(2.8) skewX(-10deg); opacity: 0; }
  16% { transform: scale(0.9) skewX(-8deg); opacity: 1; }
  26% { transform: scale(1.06) skewX(-8deg); }
  36%, 100% { transform: scale(1) skewX(-8deg); }
}
@keyframes fromLeft { from { transform: translateX(-70vw) rotate(-25deg); } to { transform: none; } }
@keyframes fromRight { from { transform: translateX(70vw) rotate(25deg); } to { transform: none; } }

/* ---------- Sheet ---------- */
.sheet-scrim { position: fixed; inset: 0; z-index: 59; background: rgba(2, 6, 14, 0.6); opacity: 0; transition: opacity 0.25s ease; }
.sheet-scrim.is-open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-width: 560px; margin: 0 auto;
  padding: 10px 20px calc(var(--safe-b) + 18px);
  border-radius: 24px 24px 0 0; border: 1px solid var(--line); border-bottom: 0;
  background: linear-gradient(180deg, #13284f, #0b1730);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.5);
  transform: translateY(105%); transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet.is-open { transform: none; }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); margin: 0 auto 14px; }
.sheet h3 { margin: 0; font-family: var(--display); font-weight: 800; font-style: italic; font-size: 28px; text-transform: uppercase; }
.sheet-lead { margin: 6px 0 16px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.sheet-stat { display: flex; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.sheet-stat b { font-family: var(--display); font-size: 18px; font-variant-numeric: tabular-nums; }
.sheet-progress { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin: 8px 0 4px; }
.sheet-progress span { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--yellow); transition: width 0.2s ease; }
.sheet-btn {
  width: 100%; height: 52px; margin-top: 12px; border: 0; border-radius: 14px;
  background: var(--yellow); color: var(--ink-navy);
  font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: 0.03em; text-transform: uppercase;
}
.sheet-btn:disabled { opacity: 0.55; }
.sheet-note { margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.sheet-note b { color: var(--ink); font-weight: 650; }
.sheet-close { width: 100%; height: 44px; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: transparent; font-weight: 600; font-size: 15px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); z-index: 70;
  transform: translate(-50%, -140%); transition: transform 0.3s ease;
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px;
  background: #2a0f18; border: 1px solid rgba(255, 93, 108, 0.5); color: #ffd7dc; font-size: 13.5px;
}
.toast.is-on { transform: translate(-50%, 0); }

/* ---------- Larger screens ---------- */
@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dock { padding-left: max(12px, calc((100% - 720px) / 2)); padding-right: max(12px, calc((100% - 720px) / 2)); }
}
@media (min-width: 900px) {
  .top, .tabs, .panels { max-width: 1040px; margin-left: auto; margin-right: auto; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pad { min-height: 110px; }
}
@media (max-width: 389px) {
  .brand { gap: 8px; }
  .brand-name { font-size: 22px; }
  .brand-logos img { height: 42px; }
  .brand-logos .dragon { height: 44px; }
  .brand-sub { letter-spacing: 0.24em; }
  .offline-chip { padding: 0 9px; }
  .offline-chip span { display: none; }
  .tab { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .celebrate.is-on { animation: celebrate 1.6s linear forwards !important; }
}
