/* ProDJEE Arena: prodjee.in brand system — deep-space navy glass with soft
   pastel coral, gold and mint accents, Fraunces + Manrope. */
:root {
  --bg: #0a0b14;
  --bg-2: #0d0e1c;
  --crimson: #cf7e7b;
  --crimson-hi: #d99a96;
  --crimson-deep: #9b5455;
  --crimson-soft: rgba(207, 126, 123, 0.16);
  --gold: #d9b46f;
  --gold-hi: #ebcf99;
  --gold-deep: #ba9255;
  --gold-soft: rgba(217, 180, 111, 0.14);
  --mint: #7fc6a4;
  --mint-soft: rgba(127, 198, 164, 0.14);
  --ice: #aab0d8;
  --text: #f6f6f8;
  --text-2: rgba(246, 246, 248, 0.7);
  --text-3: rgba(246, 246, 248, 0.44);
  --line: rgba(255, 255, 255, 0.1);
  --line-hi: rgba(255, 255, 255, 0.2);
  --glass: rgba(255, 255, 255, 0.05);
  --glass-2: rgba(255, 255, 255, 0.085);
  --radius: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
  --display: "Fraunces", Georgia, serif;
  --body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--body);
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; opacity: 0.38; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
img { max-width: 100%; }

/* ---------------- Ambient ---------------- */
.ambient { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(56px); will-change: transform; transition: background 0.8s, opacity 0.8s; }
/* Small, scattered colour accents on a neutral charcoal base: red, crimson, green, white */
.b1 { width: 190px; height: 190px; top: 6%;  left: -40px;  background: #cf7e7b; opacity: 0.17; animation: d1 26s ease-in-out infinite; }
.b2 { width: 150px; height: 150px; top: 18%; right: 8%;   background: #7fc6a4; opacity: 0.14;  animation: d2 30s ease-in-out infinite; }
.b3 { width: 170px; height: 170px; top: 48%; left: 22%;   background: #d9b46f; opacity: 0.14; animation: d3 34s ease-in-out infinite; }
.b4 { width: 110px; height: 110px; top: 38%; right: 30%;  background: #ffffff; opacity: 0.1;  animation: d1 38s ease-in-out infinite reverse; }
.b5 { width: 140px; height: 140px; bottom: 12%; right: -30px; background: #d9b46f; opacity: 0.13; animation: d2 28s ease-in-out infinite reverse; }
.b6 { width: 120px; height: 120px; bottom: 6%; left: 10%;  background: #7fc6a4; opacity: 0.12; animation: d3 32s ease-in-out infinite reverse; }
.b7 { width: 90px;  height: 90px;  top: 70%; right: 38%;  background: #ffffff; opacity: 0.08; animation: d1 40s ease-in-out infinite; }
.b8 { width: 130px; height: 130px; top: -30px; left: 45%; background: #cf7e7b; opacity: 0.13; animation: d2 36s ease-in-out infinite; }
.grain { position: absolute; inset: 0; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
@keyframes d1 { 50% { transform: translate(60px, 50px) scale(1.1); } }
@keyframes d2 { 50% { transform: translate(-60px, -40px) scale(1.08); } }
@keyframes d3 { 50% { transform: translate(-40px, 60px) scale(0.92); } }
body.bonus .b1, body.bonus .b5, body.bonus .b8 { background: var(--gold); opacity: 0.3; }
/* ---------------- Shell ---------------- */
.shell { position: relative; z-index: 1; min-height: 100vh; }
.app { max-width: 1080px; margin: 0 auto; padding: 14px 16px calc(var(--tabbar-h) + var(--safe-b) + 24px); touch-action: pan-y; }
body.immersive .app { padding-bottom: 32px; }
.view { animation: viewIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
.view.nav-in-next { animation: navInNext 0.18s ease-out; }
.view.nav-in-prev { animation: navInPrev 0.18s ease-out; }
.view.nav-out-next { animation: navOutNext 0.11s ease-in forwards; }
.view.nav-out-prev { animation: navOutPrev 0.11s ease-in forwards; }
@keyframes navInNext { from { opacity: 0; transform:translateX(6px); } }
@keyframes navInPrev { from { opacity: 0; transform:translateX(-6px); } }
@keyframes navOutNext { to { opacity:0; transform:translateX(-5px); } }
@keyframes navOutPrev { to { opacity:0; transform:translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .blob, .view { animation: none !important; transition: none !important; } }
.narrow { max-width: 640px; margin: 0 auto; }

/* Bottom tab bar (phones) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(14, 14, 18, 0.72); border-top: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 11px; font-weight: 600; position: relative; }
.tab svg { width: 23px; height: 23px; }
.tab.on { color: var(--text); }
.tab.on svg { color: var(--gold); filter: drop-shadow(0 0 8px rgba(255, 194, 26, 0.55)); }
.tab.on::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: linear-gradient(90deg, var(--crimson), var(--gold)); }
.tab.play-tab .play-dot {
  width: 48px; height: 48px; margin-top: 0; border-radius: 16px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--crimson-hi), var(--crimson) 50%, var(--crimson-deep));
  box-shadow: 0 10px 24px -8px rgba(255, 64, 64, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.tab.play-tab .play-dot svg { color: #fff; filter: none; }
.tab.play-tab.on::before { display: none; }
.tab .dot-badge { position: absolute; top: 8px; right: calc(50% - 20px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--crimson); color: #fff; font-size: 10px; display: grid; place-items: center; }
body.immersive .tabbar, body.immersive .sidenav { display: none; }

/* Sidebar (desktop) */
.sidenav { display: none; }
@media (min-width: 900px) {
  .tabbar { display: none; }
  .shell { display: grid; grid-template-columns: 240px 1fr; }
  body.immersive .shell { grid-template-columns: 1fr; }
  .sidenav {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; padding: 22px 14px;
    background: rgba(12, 12, 16, 0.55); border-right: 1px solid var(--line);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  }
  .sidenav .brand { padding: 4px 8px 4px; }
  /* Marks this rail as Arena's own navigation, distinct from the shared
     site nav (Home/Arena/ScoreGPS) in the bar above it. */
  .side-section-label { padding: 0 14px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; color: var(--text-2); font-weight: 600; text-align: left; position: relative; }
  .side-link svg { width: 21px; height: 21px; }
  .side-link:hover { background: var(--glass); color: var(--text); }
  .side-link.on { background: linear-gradient(135deg, rgba(255, 64, 64, 0.28), rgba(255, 64, 64, 0.08)); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 64, 64, 0.35); }
  .side-link.on svg { color: var(--gold); }
  .side-link .dot-badge { margin-left: auto; min-width: 20px; height: 20px; border-radius: 99px; background: var(--crimson); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 6px; }
  .side-foot { margin-top: auto; padding: 14px; font-size: 12px; color: var(--text-3); }
  .app { padding: 26px 32px 48px; }
}

/* ---------------- Top app bar ---------------- */
.appbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 6px 20px rgba(255, 64, 64, 0.35); }
.brand .name { font-family: var(--display); font-weight: 800; font-style: italic; font-size: 18px; letter-spacing: -0.02em; line-height: 1.05; white-space: nowrap; }
@media (max-width: 480px) { .appbar .brand .sub { display: none; } .appbar .brand .name { font-size: 16px; } .appbar .brand img { width: 36px; height: 36px; } .appbar h1 { font-size: 22px !important; } }
.brand .name span { color: var(--gold); }
.brand .sub { font-size: 10px; color: var(--text-3); letter-spacing: 0.16em; text-transform: uppercase; }
@media (min-width: 900px) { .appbar .brand { display: none; } }
.chips-row { display: flex; align-items: center; gap: 8px; }

/* ---------------- Glass ---------------- */
.glass {
  position: relative; border-radius: var(--radius); padding: 18px;
  background: linear-gradient(160deg, var(--glass-2), var(--glass) 60%);
  border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.glass.tight { padding: 14px; }
.glass.press { transition: transform 0.2s, border-color 0.2s; }
.glass.press:hover { border-color: rgba(255, 194, 26, 0.35); }
.glass.press:active { transform: scale(0.985); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; white-space: nowrap;
  background: var(--glass); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600;
}
.pill.gold { color: var(--gold); border-color: rgba(255, 194, 26, 0.35); background: var(--gold-soft); }
.pill.crimson { color: #d6929a; border-color: rgba(207, 126, 123, 0.4); background: var(--crimson-soft); }
.pill.mint { color: var(--mint); border-color: rgba(34, 229, 138, 0.35); background: var(--mint-soft); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); }
.icon-btn svg { width: 19px; height: 19px; }

/* ---------------- Type ---------------- */
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(26px, 5vw, 36px); font-weight: 800; line-height: 1.1; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); font-size: 12px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.gold-text { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 45%, var(--gold-deep)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.crimson-text { color: #cf7e88; }
.mint-text { color: var(--mint); }
.num { font-family: var(--display); font-weight: 800; font-variant-numeric: tabular-nums; }
.italic { font-style: italic; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 10px; }
.section-title h3 { font-size: 15px; }
.link { color: var(--gold); font-weight: 600; font-size: 13px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px; border-radius: 16px; font-family: var(--display); font-weight: 700;
  transition: transform 0.15s, filter 0.2s, box-shadow 0.2s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--crimson-hi), var(--crimson) 45%, var(--crimson-deep)); box-shadow: 0 14px 30px -12px rgba(255, 64, 64, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn.gold { color: #1a1204; background: linear-gradient(135deg, var(--gold-hi), var(--gold) 50%, var(--gold-deep)); box-shadow: 0 14px 30px -12px rgba(255, 194, 26, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn.mint { color: #04160c; background: linear-gradient(135deg, #a5d7bd, var(--mint)); box-shadow: 0 14px 30px -12px rgba(127, 198, 164, 0.6); }
.btn.ghost { background: var(--glass); border: 1px solid var(--line); }
.btn.ghost:hover:not(:disabled) { border-color: var(--line-hi); }
.btn.block { width: 100%; }
.btn.sm { padding: 9px 14px; font-size: 13px; border-radius: 12px; }
.btn small { font-weight: 600; opacity: 0.75; font-size: 11px; }

/* Segmented control */
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line); }
.seg button { padding: 7px 14px; border-radius: 10px; font-family: var(--display); font-weight: 800; font-size: 13px; color: var(--text-3); transition: all 0.2s; }
.seg button.on { color: #fff; background: linear-gradient(135deg, var(--crimson), var(--crimson-deep)); box-shadow: 0 6px 16px -6px rgba(255, 64, 64, 0.9); }

/* ---------------- Home ---------------- */
.greet { margin-bottom: 14px; }
.greet h1 { margin-top: 2px; }
.hero { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } }
.hero-gp { padding: 22px; overflow: hidden; }
.hero-gp::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 194, 26, 0.25), transparent 65%); }
.big-gp { font-size: clamp(44px, 9vw, 60px); line-height: 1; font-style: italic; }
.rank-bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 10px; }
.rank-bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--crimson), var(--gold)); transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.goal { display: flex; align-items: center; gap: 16px; }
.ring { position: relative; flex: none; }
.ring > svg { transform: rotate(-90deg); display: block; }
.ring .ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring circle.fg { transition: stroke-dashoffset 1.1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.week-dots { display: flex; gap: 6px; margin-top: 10px; }
.week-dots span { display: grid; place-items: center; gap: 2px; font-size: 10px; color: var(--text-3); }
.week-dots i { width: 22px; height: 22px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); display: grid; place-items: center; font-style: normal; font-size: 12px; }
.week-dots i.hit { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); box-shadow: 0 0 12px rgba(255, 194, 26, 0.45); }
.week-dots i.played { background: rgba(255, 64, 64, 0.45); }
.week-dots i.today { outline: 1.5px solid var(--gold); outline-offset: 1px; }

.cta {
  width: 100%; margin-top: 14px; display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 22px; text-align: left; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, rgba(255, 90, 120, 0.55), transparent 55%), linear-gradient(135deg, var(--crimson), var(--crimson-deep));
  box-shadow: 0 22px 44px -18px rgba(255, 64, 64, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative; overflow: hidden; transition: transform 0.15s;
}
.cta:active { transform: scale(0.985); }
.cta::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.18) 45%, transparent 60%); transform: translateX(-100%); animation: sheen 3.6s ease-in-out infinite; }
@keyframes sheen { 60%, 100% { transform: translateX(100%); } }
.cta .play-ico { width: 54px; height: 54px; flex: none; border-radius: 18px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.25); }
.cta .play-ico svg { width: 26px; height: 26px; }
.cta b { font-family: var(--display); font-size: 19px; display: block; }
.cta small { opacity: 0.8; font-size: 13px; }
.cta .arrow { margin-left: auto; font-size: 22px; opacity: 0.8; }

.subj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .subj-grid { grid-template-columns: 1fr; } }
/* minmax(0, 1fr) above stops the grid track from growing to fit a card's
   content; min-width:0 here does the same for the card's own flex/text
   children, so a long label (or a 3-digit-plus attempt count) wraps or
   truncates instead of pushing Mathematics past the visible width. */
.subj { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; min-width: 0; }
@media (min-width: 521px) { .subj { flex-direction: column; align-items: flex-start; } }
.subj .meta { min-width: 0; max-width: 100%; }
.subj .meta b { font-family: var(--display); display: block; }
.subj .meta span { font-size: 12px; color: var(--text-3); overflow-wrap: break-word; }

.tile-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mode { display: flex; gap: 14px; align-items: flex-start; text-align: left; width: 100%; }
.mode .ico { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--crimson-soft), var(--gold-soft)); border: 1px solid var(--line); }
.mode .ico svg { width: 23px; height: 23px; }
.mode h3 { margin-bottom: 3px; }
.mode p { margin: 0; color: var(--text-2); font-size: 13px; }
.mode .count { margin-left: auto; }

.badge-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.badge-strip::-webkit-scrollbar { display: none; }
.medal { width: 58px; height: 58px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: radial-gradient(circle at 35% 30%, rgba(255, 224, 122, 0.4), rgba(255, 64, 64, 0.25)); border: 1px solid rgba(255, 194, 26, 0.5); }
.medal.locked { filter: grayscale(1); opacity: 0.3; }

/* ---------------- Setup ---------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; background: var(--glass); border: 1px solid var(--line); color: var(--text-2); transition: all 0.2s; }
.chip:hover { border-color: var(--line-hi); color: var(--text); }
.chip.on { color: #fff; border-color: rgba(255, 64, 64, 0.7); background: linear-gradient(135deg, rgba(255, 64, 64, 0.5), rgba(143, 13, 39, 0.5)); }
.chip.gold.on { color: #1a1204; border-color: var(--gold); background: linear-gradient(135deg, var(--gold-hi), var(--gold)); }
.chip small { opacity: 0.7; font-weight: 500; margin-left: 4px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; font-size: 14px; }
.back svg { width: 18px; height: 18px; }
.toggle { width: 50px; height: 28px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); position: relative; transition: background 0.2s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.toggle.on { background: var(--crimson); }
.toggle.on::after { transform: translateX(22px); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.field input { width: 100%; padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); color: var(--text); font: inherit; }

/* ---------------- Game ---------------- */
.game { max-width: 680px; margin: 0 auto; padding-bottom: 250px; }
.game-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.segbar { flex: 1; display: flex; gap: 3px; }
.segbar i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); transition: background 0.3s; }
.segbar i.c { background: var(--mint); }
.segbar i.w { background: var(--crimson); }
.segbar i.s { background: #7c7c8a; }
.segbar i.now { background: var(--gold); box-shadow: 0 0 10px rgba(255, 194, 26, 0.7); }
.segbar i.b:not(.c):not(.w):not(.s):not(.now) { background: rgba(255, 194, 26, 0.3); }
.game-mid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: 6px 0 14px; }
.game-mid .l { font-size: 12px; color: var(--text-3); }
.game-mid .r { justify-self: end; text-align: right; }
.orb { position: relative; width: 124px; height: 124px; }
.orb svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.orb .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.orb .val b { font-size: 36px; line-height: 1; display: block; font-style: italic; }
.orb .val small { font-size: 9.5px; letter-spacing: 0.18em; color: var(--text-3); font-weight: 700; }
.orb.frozen .val b { color: var(--ice); -webkit-text-fill-color: var(--ice); }
.orb.low .val b { animation: pulse 0.9s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
@media (max-width: 480px) { .orb { width: 106px; height: 106px; } .orb .val b { font-size: 30px; } }
.combo { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 4px 10px; border-radius: 99px; font-family: var(--display); font-weight: 800; font-size: 13px; color: #1a1204; background: linear-gradient(135deg, var(--gold-hi), var(--gold-deep)); box-shadow: 0 0 18px rgba(255, 194, 26, 0.6); animation: pop 0.4s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }

.bonus-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin-bottom: 12px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 194, 26, 0.24), rgba(255, 64, 64, 0.3)); border: 1px solid rgba(255, 194, 26, 0.6);
  animation: glow 1.4s ease-in-out infinite;
}
@keyframes glow { 0%, 100% { box-shadow: 0 0 30px -10px rgba(255, 194, 26, 0.7); } 50% { box-shadow: 0 0 50px -6px rgba(255, 64, 64, 0.8); } }

.q-card { padding: 20px; }
.q-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.q-meta .pill { font-size: 11.5px; padding: 5px 10px; }
.q-text { font-size: 16.5px; line-height: 1.65; font-weight: 500; margin: 0 0 16px; overflow-wrap: anywhere; white-space: pre-line; }
.q-foot { margin: 14px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.q-src { font-size: 11px; color: var(--text-3); }
.q-report-btn { font-size: 11px; color: var(--text-3); background: none; border: none; cursor: pointer; padding: 4px 0; text-decoration: underline; }
.q-report-btn:hover { color: var(--text-2); }
.options { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); font-size: 15px; transition: all 0.18s; overflow-wrap: anywhere;
}
.opt:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); border-color: var(--line-hi); }
.opt .k { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 13px; background: rgba(255, 255, 255, 0.08); transition: all 0.18s; }
.opt.sel { border-color: var(--gold); background: var(--gold-soft); transform: translateX(3px); }
.opt.sel .k { background: var(--gold); color: #1a1204; }
.opt.right { border-color: var(--mint); background: var(--mint-soft); }
.opt.right .k { background: var(--mint); color: #04160c; }
.opt.wrong { border-color: var(--crimson); background: var(--crimson-soft); }
.opt.wrong .k { background: var(--crimson); color: #fff; }
.opt.dim { opacity: 0.45; }
.opt:disabled { opacity: 1; cursor: default; }
.opt:disabled.dim { opacity: 0.45; }
.opt-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.opt > span:not(.k), .opt-body > span { white-space: pre-line; }
.opt-img { display: block; max-width: 100%; height: auto; max-height: 120px; background: #fff; border-radius: 10px; padding: 4px; }
.options.img-grid { grid-template-columns: 1fr 1fr; }
.options.img-grid .opt { flex-direction: column; align-items: flex-start; }
.options.img-grid .opt-img { width: 100%; max-height: 130px; object-fit: contain; }

.num-input { width: 100%; padding: 16px; border-radius: 16px; font: 800 26px var(--display); text-align: center; letter-spacing: 0.04em; background: rgba(0, 0, 0, 0.35); color: var(--text); border: 1px solid var(--line); }
.num-input.right { border-color: var(--mint); color: var(--mint); }
.num-input.wrong { border-color: var(--crimson); color: #d6929a; }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.keypad button { padding: 13px 0; border-radius: 14px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); font: 700 18px var(--display); }
.keypad button:active { background: rgba(255, 255, 255, 0.16); }

.reveal { margin-top: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.28); animation: viewIn 0.3s ease; }
.reveal.hint { border-color: rgba(154, 164, 255, 0.45); background: rgba(154, 164, 255, 0.08); }
.reveal h4 { margin: 0 0 6px; font: 700 12px var(--display); letter-spacing: 0.12em; text-transform: uppercase; }
.reveal p { margin: 0; line-height: 1.65; }
.hint-bar { height: 4px; border-radius: 4px; background: rgba(154, 164, 255, 0.25); margin-top: 10px; overflow: hidden; }
.hint-bar i { display: block; height: 100%; background: var(--ice); animation: drain 10s linear forwards; }
@keyframes drain { from { width: 100%; } to { width: 0; } }
.grace { text-align: center; margin-top: 10px; color: #d6929a; font-weight: 700; font-size: 13px; min-height: 1em; }

/* Sticky action dock */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 16px calc(12px + var(--safe-b));
  background: linear-gradient(180deg, rgba(11, 11, 14, 0), rgba(11, 11, 14, 0.85) 30%);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.dock-inner { max-width: 680px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 10px; }

/* Result bottom sheet */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; max-height: 78vh; overflow: auto;
  padding: 10px 18px calc(18px + var(--safe-b)); border-radius: 26px 26px 0 0;
  background: rgba(20, 20, 26, 0.94); border-top: 1px solid var(--line-hi);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 -30px 60px -20px rgba(0, 0, 0, 0.8); animation: sheetUp 0.38s cubic-bezier(0.2, 0.9, 0.2, 1);
}
.sheet-inner { max-width: 680px; margin: 0 auto; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-hi); margin: 0 auto 12px; }
.sheet.good { border-top-color: rgba(34, 229, 138, 0.6); box-shadow: 0 -20px 60px -20px rgba(34, 229, 138, 0.35); }
.sheet.bad { border-top-color: rgba(255, 64, 64, 0.6); box-shadow: 0 -20px 60px -20px rgba(255, 64, 64, 0.4); }
.sheet .res { display: flex; align-items: center; gap: 12px; }
.sheet .res .emo { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-size: 24px; flex: none; }
.sheet.good .emo { background: var(--mint-soft); }
.sheet.bad .emo { background: var(--crimson-soft); }
.sheet .res b { font-family: var(--display); font-size: 20px; display: block; }
.sheet .res .delta { margin-left: auto; font-size: 26px; font-style: italic; }
.sheet .sol { margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--gold-soft); border: 1px solid rgba(255, 194, 26, 0.35); line-height: 1.65; }
.sheet .sol h4 { margin: 0 0 6px; font: 700 12px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.sheet .acts { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 14px; }
@keyframes sheetUp { from { transform: translateY(100%); } }

.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.float-gp { position: fixed; left: 50%; top: 34%; z-index: 50; pointer-events: none; font: italic 800 54px var(--display); animation: floatUp 1.3s ease forwards; text-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
.float-gp.plus { color: var(--gold); }
.float-gp.minus { color: #cf7e88; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -150%); } }

/* Confetti */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.cf { position: absolute; top: 38%; left: 50%; width: 9px; height: 14px; border-radius: 2px; animation: cf 1.25s cubic-bezier(0.1, 0.7, 0.3, 1) forwards; }
@keyframes cf { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }

/* Figures */
.q-fig { margin: 0 0 16px; padding: 12px; border-radius: 16px; background: #fff; text-align: center; cursor: zoom-in; }
.q-fig img { display: block; max-width: 100%; max-height: 280px; margin: 0 auto; }
.zoom-img { display: block; width: 100%; background: #fff; border-radius: 14px; padding: 10px; }
.katex { font-size: 1.06em; }
.q-fig .katex, .opt-img + span .katex { color: inherit; }

/* ---------------- Results & analysis ---------------- */
.res-hero { text-align: center; padding: 26px 20px; overflow: hidden; }
.res-hero .big { font-size: 64px; line-height: 1; font-style: italic; margin-top: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 560px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.stat .v { font: 800 24px/1.1 var(--display); }
.stat .l { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; margin-top: 4px; }
.bars { display: grid; gap: 12px; }
.bar-row .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.bar-row .top span:first-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .top span:last-child { color: var(--text-2); font-variant-numeric: tabular-nums; flex: none; }
.bar-track { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 99px; transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bar-track i.hi { background: linear-gradient(90deg, #17b86d, var(--mint)); }
.bar-track i.mid { background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }
.bar-track i.lo { background: linear-gradient(90deg, var(--crimson-deep), var(--crimson)); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 130px; }
.week .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.week .col i { width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--gold), var(--crimson)); min-height: 3px; }
.week .col i.goal { box-shadow: 0 0 14px rgba(255, 194, 26, 0.6); }
.week .col span { font-size: 11px; color: var(--text-3); }
.week .col b { font-size: 10px; color: var(--text-2); font-weight: 600; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .split { grid-template-columns: 1fr; } }
.chapter-list { display: grid; gap: 8px; }
.chapter-list .it { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); font-size: 13px; }
.spacer { height: 14px; }
.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { .grid.cols-2 { grid-template-columns: 1fr; } }

/* Badges / ranks */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.badge-card { text-align: center; padding: 16px 10px; border-radius: 18px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.badge-card .medal { margin: 0 auto 8px; }
.badge-card.locked { opacity: 0.4; filter: grayscale(1); }
.badge-card b { display: block; font: 700 13px var(--display); }
.badge-card span { font-size: 11px; color: var(--text-2); }
.badge-touch { cursor: pointer; transition: transform 0.18s ease, border-color 0.18s ease, filter 0.18s ease; }
.badge-touch:hover, .badge-touch:focus-visible { transform: translateY(-2px) scale(1.03); border-color: var(--gold); }
.badge-touch:active { transform: scale(0.96); }
.badge-card.badge-touch { width: 100%; color: var(--text); font-family: var(--body); }
.badge-celebration { text-align: center; padding: 8px 4px 2px; }
.badge-celebration .medal { width: 86px; height: 86px; margin: 0 auto 16px; font-size: 40px; box-shadow: 0 18px 45px -18px rgba(217, 180, 111, 0.85); }
.badge-celebration .eyebrow { color: var(--gold); margin-bottom: 4px; }
.badge-celebration h2 { margin: 0; font-size: 30px; }
.badge-celebration h3 { margin: 4px 0 8px; color: var(--gold-hi); font-size: 19px; }
.badge-celebration p { margin: 0 auto 20px; max-width: 390px; color: var(--text-2); }
.badge-celebration.locked .medal { filter: grayscale(1); opacity: 0.55; box-shadow: none; }
.ranks { display: grid; gap: 8px; }
.rank-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.rank-item.cur { border-color: var(--gold); background: var(--gold-soft); }
.rank-item.done { opacity: 0.55; }
.avatar { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; font: italic 800 28px var(--display); color: #1a1204; background: linear-gradient(135deg, var(--gold-hi), var(--gold-deep)); box-shadow: 0 10px 30px -10px rgba(255, 194, 26, 0.7); }

/* Vault list */
.vault-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.vault-item .steps { display: flex; gap: 4px; margin-left: auto; }
.vault-item .steps i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); }
.vault-item .steps i.on { background: var(--gold); }
.vault-item p { margin: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Modal (bottom sheet on phones) */
.modal-back { position: fixed; inset: 0; z-index: 40; background: rgba(5, 5, 8, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; padding: 16px; animation: fade 0.25s; }
.modal { width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; animation: viewIn 0.3s ease; }
@media (max-width: 600px) {
  .modal-back { place-items: end stretch; padding: 0; }
  .modal { max-width: none; border-radius: 26px 26px 0 0; padding-bottom: calc(20px + var(--safe-b)); animation: sheetUp 0.35s cubic-bezier(0.2, 0.9, 0.2, 1); }
}
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 64px); left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { animation: viewIn 0.3s ease; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); backdrop-filter: blur(16px); }
.note { font-size: 11px; color: var(--text-3); text-align: center; margin-top: 26px; }

/* ============ Accent: Arena gold (crimson now reserved for wrong answers / penalties) ============ */
:root { --accent-grad: linear-gradient(135deg, var(--gold-hi), var(--gold) 50%, var(--gold-deep)); --on-accent: #1a1204; }
.btn.primary { color: var(--on-accent); background: var(--accent-grad); box-shadow: 0 14px 30px -12px rgba(255, 194, 26, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.55); }
.btn.gold { color: var(--gold); background: var(--gold-soft); border: 1px solid rgba(255, 194, 26, 0.55); box-shadow: none; }
.cta { color: var(--on-accent); background: radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.45), transparent 55%), var(--accent-grad); box-shadow: 0 22px 44px -18px rgba(255, 194, 26, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.cta .play-ico { background: rgba(26, 18, 4, 0.12); border-color: rgba(26, 18, 4, 0.18); }
.cta small { opacity: 0.75; }
.tab.play-tab .play-dot { color: var(--on-accent); background: var(--accent-grad); box-shadow: 0 10px 24px -8px rgba(255, 194, 26, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.tab.play-tab .play-dot svg { color: var(--on-accent); }
.tab.on::before { background: var(--accent-grad); }
.tab .dot-badge, .side-link .dot-badge { background: var(--gold); color: var(--on-accent); }
.side-link.on { background: linear-gradient(135deg, rgba(255, 194, 26, 0.22), rgba(255, 194, 26, 0.06)); box-shadow: inset 0 0 0 1px rgba(255, 194, 26, 0.35); }

/* A selected Arena destination is a soft illuminated surface, not a solid button. */
.tab{margin:5px 3px;border-radius:16px;transition:color .18s ease,background .18s ease,box-shadow .18s ease}.tab.on{background:linear-gradient(145deg,rgba(217,180,111,.16),rgba(180,162,207,.08));box-shadow:inset 0 0 0 1px rgba(217,180,111,.18),0 0 22px rgba(217,180,111,.14)}.tab.on::before{display:none}.tab.on svg{filter:drop-shadow(0 0 6px rgba(217,180,111,.38))}.tab.play-tab .play-dot{color:var(--gold);background:rgba(217,180,111,.08);border:1px solid rgba(217,180,111,.25);box-shadow:0 9px 22px -12px rgba(217,180,111,.48),inset 0 1px 0 rgba(255,255,255,.1)}.tab.play-tab .play-dot svg{color:var(--gold)}.tab.play-tab.on .play-dot{background:linear-gradient(145deg,rgba(217,180,111,.24),rgba(180,162,207,.1));box-shadow:0 0 24px rgba(217,180,111,.2),inset 0 0 0 1px rgba(217,180,111,.18)}.side-link{transition:color .18s ease,background .18s ease,box-shadow .18s ease}.side-link.on{background:linear-gradient(135deg,rgba(217,180,111,.15),rgba(180,162,207,.07));box-shadow:inset 0 0 0 1px rgba(217,180,111,.2),0 0 22px rgba(217,180,111,.1)}
.seg button.on { color: var(--on-accent); background: var(--accent-grad); box-shadow: 0 6px 16px -6px rgba(255, 194, 26, 0.8); }
.chip.on { color: var(--on-accent); border-color: var(--gold); background: var(--accent-grad); }
.toggle.on { background: var(--gold); }
.toggle.on::after { background: #1a1204; }
.rank-bar > i { background: linear-gradient(90deg, var(--gold-deep), var(--gold-hi)); }
.brand img { box-shadow: 0 6px 20px rgba(255, 194, 26, 0.3); }
.pill.accent { color: var(--gold); border-color: rgba(255, 194, 26, 0.35); background: var(--gold-soft); }
.week-dots i.played { background: rgba(255, 194, 26, 0.3); }
.week .col i { background: linear-gradient(180deg, var(--gold-hi), var(--gold-deep)); }
.medal { background: radial-gradient(circle at 35% 30%, rgba(255, 224, 122, 0.45), rgba(245, 158, 11, 0.2)); }
.mode .ico { background: linear-gradient(135deg, var(--gold-soft), rgba(255, 255, 255, 0.04)); }
.avatar { box-shadow: 0 10px 30px -10px rgba(255, 194, 26, 0.7); }

/* anchor-styled buttons used by the results "next step" card */
a.btn { display: flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; min-height: 48px; }
