:root {
  --bg: #0E0B14;
  --bg2: #161120;
  --card: #1E1830;
  --line: rgba(255, 255, 255, .1);
  --text: #fff;
  --dim: rgba(255, 255, 255, .68);
  --mute: rgba(255, 255, 255, .45);
  --v: #6A2BFF;
  --p: #FF2D78;
  --gold: #FFD23F;
  --grad: linear-gradient(135deg, #6A2BFF, #FF2D78);
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.45; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; font-size: 22px; }
.brand img { width: 34px; height: 34px; }
.brand i, .gt { font-style: normal; background: linear-gradient(90deg, #A27BFF, #FF2D78); -webkit-background-clip: text; background-clip: text; color: transparent; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 999px; font-weight: 700; font-size: 15px; white-space: nowrap; transition: transform .12s, filter .12s; }
.btn.primary { background: var(--grad); color: #fff; }
.btn.gold { background: var(--gold); color: #2A1B00; }
.btn.ghost { background: rgba(255, 255, 255, .12); }
.btn.sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: default; filter: none; transform: none; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); font-weight: 700; font-size: 14px; }
.coin { display: inline-block; width: 1em; height: 1em; border-radius: 50%; background: var(--gold); box-shadow: inset 0 0 0 .14em #E0A800; vertical-align: -.12em; flex: none; }

.poster { position: relative; display: flex; align-items: flex-end; width: 100%; aspect-ratio: 2/3; padding: .8em; border-radius: 14px; overflow: hidden; isolation: isolate; text-align: left; }
.poster::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 76% 20%, rgba(255, 255, 255, .42), transparent 32%), radial-gradient(circle at 12% 68%, rgba(0, 0, 0, .35), transparent 55%), linear-gradient(transparent 40%, rgba(0, 0, 0, .6)); }
.poster b { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 1.12em; line-height: 1.08; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.badge { position: absolute; top: 8px; left: 8px; font-style: normal; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: var(--gold); color: #2A1B00; }

.card { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; }
.card .poster { margin-bottom: 6px; transition: transform .2s; }
.card:hover .poster { transform: translateY(-4px); }
.card .t { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .s { font-size: 12px; color: var(--mute); }
.rank { position: absolute; z-index: 2; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: var(--grad); font-size: 12px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; height: 36px; padding: 0 15px; border-radius: 99px; background: rgba(255, 255, 255, .08); font-size: 13px; font-weight: 600; color: var(--dim); }
.chips .on { background: #fff; color: #14101F; }

.stage { position: relative; overflow: hidden; isolation: isolate; }
.stage .art { position: absolute; inset: -15%; z-index: -1; background: radial-gradient(circle at 70% 28%, rgba(255, 255, 255, .42), transparent 28%), radial-gradient(circle at 22% 72%, rgba(0, 0, 0, .45), transparent 52%); animation: drift 9s ease-in-out infinite alternate paused; }
.stage.on:not(.paused) .art { animation-play-state: running; }
.stage::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(0, 0, 0, .35), transparent 22%, transparent 50%, rgba(0, 0, 0, .78)); }
.stage .epbig { position: absolute; top: 34%; left: 0; right: 0; text-align: center; font: italic 700 54px var(--serif); text-shadow: 0 4px 24px rgba(0, 0, 0, .4); }
.stage .tap { position: absolute; inset: 0; width: 100%; }
.stage .pausei { position: absolute; top: 50%; left: 50%; width: 72px; height: 72px; margin: -36px; border-radius: 50%; background: rgba(0, 0, 0, .5); display: none; place-items: center; pointer-events: none; }
.stage .pausei svg { width: 34px; height: 34px; }
.stage.paused .pausei { display: grid; }
.stage .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .25); }
.stage .bar i { display: block; height: 100%; width: 0; background: var(--gold); }
.stage.on .bar i { animation: prog 12s linear forwards; }
.stage.paused .bar i { animation-play-state: paused; }
.stage .locked { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 0 36px; text-align: center; background: rgba(10, 6, 20, .74); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.stage .locked > svg { width: 40px; height: 40px; color: var(--gold); }
.stage .locked h3 { font-size: 18px; margin: 0; }
.stage .locked p { font-size: 13px; color: var(--dim); margin-bottom: 8px; }
@keyframes drift { to { transform: translate(6%, -5%) scale(1.15); } }
@keyframes prog { to { width: 100%; } }

.epg { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.epg button { position: relative; height: 44px; border-radius: 10px; background: rgba(255, 255, 255, .08); font-weight: 700; font-size: 14px; }
.epg button:hover { background: rgba(255, 255, 255, .16); }
.epg .cur { background: var(--grad); }
.epg .lk { color: var(--mute); }
.epg .lk svg { position: absolute; top: 3px; right: 3px; width: 11px; height: 11px; color: var(--gold); }

#toast { position: fixed; left: 50%; bottom: 88px; z-index: 99; max-width: min(86vw, 400px); padding: 10px 16px; border-radius: 99px; background: #fff; color: #14101F; font-size: 13px; font-weight: 600; text-align: center; opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: .2s; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .stage .art { animation: none; }
  .card .poster, .btn { transition: none; }
}
