:root {
  --gold: #f5b942;
  --ink: #f4efe6;
  --glass: rgba(18, 20, 19, 0.72);
  --line: rgba(255, 255, 255, 0.09);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0f0e; color: var(--ink); font-family: var(--font); }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.hud { position: fixed; inset: 0; pointer-events: none; text-align: center; }
.hud .num { font-weight: 900; line-height: 0.9; letter-spacing: -0.02em; text-shadow: 0 4px 24px rgba(0,0,0,0.55); font-variant-numeric: tabular-nums; transition: transform .12s ease-out; }
.hud .lbl { color: var(--gold); font-weight: 800; letter-spacing: 0.08em; text-shadow: 0 2px 12px rgba(0,0,0,0.6); }
.hud-top { position: absolute; top: 4.5vh; left: 0; right: 0; }
.hud-top .num { font-size: clamp(56px, 9vw, 110px); }
.hud-top .lbl { font-size: clamp(16px, 2vw, 26px); margin-top: 2px; }
.hud-bottom { position: absolute; bottom: 5vh; left: 0; right: 0; }
.hud-bottom .num { font-size: clamp(34px, 5vw, 64px); }
.hud-bottom .lbl { font-size: clamp(13px, 1.4vw, 18px); }
.num.pop { transform: scale(1.14); }

.brand { position: fixed; top: 18px; left: 22px; font-weight: 900; font-size: 20px; letter-spacing: -0.01em; opacity: .9; }
.brand span { color: var(--gold); }

.loader { position: fixed; inset: 0; display: grid; place-items: center; font-weight: 700; color: #bbb; background: #0d0f0e; transition: opacity .4s; z-index: 5; }
.loader.hide { opacity: 0; pointer-events: none; }

.panel {
  position: fixed; left: 22px; top: 50%; transform: translateY(-50%);
  width: 320px; padding: 16px; border-radius: 20px;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  display: flex; flex-direction: column; gap: 12px; z-index: 3;
}
.search { display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.06); color: var(--ink); font: 600 15px var(--font); outline: none;
}
.search input:focus { border-color: var(--gold); background: rgba(255,255,255,0.09); }
button { font-family: var(--font); cursor: pointer; border: 0; color: var(--ink); }
.load { height: 44px; padding: 0 14px; border-radius: 12px; background: rgba(255,255,255,0.12); font-weight: 700; }
.load:hover { background: rgba(255,255,255,0.2); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 118px; overflow-y: auto; }
.chip { padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip:hover { background: rgba(255,255,255,0.13); }
.chip.on { background: var(--gold); color: #1b1407; border-color: var(--gold); }

.row-label { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #9b968c; margin-bottom: -4px; }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,0.05); }
.seg button { height: 38px; border-radius: 9px; background: transparent; font-weight: 800; font-size: 15px; color: #cfc9be; }
.seg button.on { background: var(--ink); color: #121212; }

.actions { display: flex; gap: 8px; }
.play {
  flex: 1; height: 52px; border-radius: 14px; font-size: 18px; font-weight: 900;
  background: linear-gradient(180deg, #ffcd5c, #f0a52a); color: #221603;
  box-shadow: 0 8px 24px rgba(245,185,66,0.35), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform .08s, filter .2s;
}
.play:active { transform: scale(0.97); }
.play.busy { filter: grayscale(0.4) brightness(0.85); }
.ghost { width: 52px; height: 52px; border-radius: 14px; background: rgba(255,255,255,0.08); border: 1px solid var(--line); font-size: 18px; font-weight: 800; }
.ghost:hover { background: rgba(255,255,255,0.15); }
.status { font-size: 13px; color: #a9a397; min-height: 18px; }
.status b { color: var(--ink); }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .brand { top: 12px; left: 14px; font-size: 16px; }
  .hud-top { top: 3vh; }
  .hud-top .num { font-size: 64px; }
  .hud-bottom { bottom: auto; top: calc(3vh + 96px); }
  .hud-bottom .num { font-size: 26px; display: inline; }
  .hud-bottom .lbl { display: inline; margin-left: 6px; }
  .panel {
    left: 8px; right: 8px; top: auto; bottom: max(8px, env(safe-area-inset-bottom)); transform: none;
    width: auto; padding: 12px; gap: 9px; border-radius: 18px;
  }
  .chips { flex-wrap: nowrap; overflow-x: auto; max-height: none; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .row-label { display: none; }
  .seg button { height: 34px; }
  .play { height: 48px; }
  .ghost { width: 48px; height: 48px; }
  .status { font-size: 12px; min-height: 0; }
}
