/* Quizzy — quiz-show theme: deep purple stage, white cards, yellow highlights, purple actions.
   Fast by design: system fonts, no images except three tiny SVGs, background on its own GPU layer.
   Spacing on a 4px grid. Radius: 8 controls, 12 cards, 16 popups. */

:root {
  --stage: #1b0f6b;
  --stage-deep: #0c0538;
  --yellow: #fcff07;
  --gold: #ffc400;
  --purple: #7b1fa2;
  --purple-2: #9c27b0;
  --tile: #f3ebfb;
  --ink: #1d1b2e;
  --ink-2: #4a4860;
  --muted: #8a8799;
  --line: #ece8f3;
  --lavender: #c9c1ff;
  --green: #2fb10a;
  --green-bg: #47be06;
  --red: #f33;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --app-w: 420px;
  /* same font stack as Qureka (Roboto on Android, San Francisco on iPhone, Segoe UI on Windows): no font download */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* Montserrat (SIL OFL, self-hosted, latin only, one variable file 600-800) — only the popups use it,
   so the browser downloads it the first time a popup opens, never on page load */
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 600 800; font-display: swap;
  src: url("../fonts/montserrat-latin.woff2") format("woff2");
}

* { box-sizing: border-box; }
html { background: #07031f; }
body { margin: 0; min-height: 100%; }
body {
  background: transparent; color: #fff;
  font: 400 15px/22px var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p, ul, ol { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a, button { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 8px; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* icons: a block inside a grid box always sits on the exact centre */
.i { display: block; flex: none; }
[data-icon] { display: grid; place-items: center; }

/* app column + stage background on its own fixed layer (no repaint on scroll) */
.app { position: relative; isolation: isolate; max-width: var(--app-w); min-height: 100vh; margin: 0 auto; background: var(--stage); overflow-x: hidden; }
.app::before {
  content: ""; position: fixed; top: 0; bottom: 0; z-index: -1; pointer-events: none;
  left: max(0px, calc(50% - var(--app-w) / 2)); width: min(100%, var(--app-w));
  background: var(--stage) url("../img/bg.svg") center top / cover no-repeat; transform: translateZ(0);
}
.view { min-height: 100vh; }
.page { padding: 0 15px 48px; animation: enter .2s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* coin */
.coin { display: inline-block; flex: none; width: 16px; height: 16px; vertical-align: -3px; background: url("../img/e/coin.webp") center / contain no-repeat; }
.coin-lg { width: 24px; height: 24px; vertical-align: -5px; }
.stack { display: inline-block; flex: none; width: 25px; height: 18px; vertical-align: -3px; background: url("../img/coins.svg") center / contain no-repeat; }
.stack-lg { width: 35px; height: 30px; }
.stack-xl { width: 37px; height: 30px; }

/* ---------- shared ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; height: 55px; padding: 0 15px; }
.brand-btn { display: flex; align-items: center; gap: 8px; height: 40px; padding-right: 8px; }
.brand-btn .wordmark { font-size: 18px; line-height: 22px; font-weight: 600; }
/* three thick bars, like Qureka's menu mark */
.burger { display: grid; align-content: space-between; width: 20px; height: 17px; }
.burger i { display: block; height: 3px; border-radius: 2px; background: #fff; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; transition: background-color .15s var(--ease); }
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.text-link {
  display: inline-flex; align-items: center; height: 24px; padding: 0 13px; border-radius: 19px;
  background: linear-gradient(#d8def9, #8b91ed); color: #000; font-size: 13px; font-weight: 600;
}
.accent-link { color: var(--yellow); font-weight: 600; }

.page-head { display: flex; align-items: center; gap: 8px; height: 56px; margin: 0 -4px; }
.page-head .icon-btn { width: 36px; height: 36px; background: rgba(255, 255, 255, .12); }
.page-head h1 { font-size: 19px; line-height: 24px; font-weight: 700; }

.eyebrow { font-size: 13px; line-height: 20px; color: var(--lavender); }
.title { font-size: 24px; line-height: 32px; font-weight: 700; }
.lead { font-size: 15px; line-height: 22px; color: #e4e0ff; }
.section-title { font-size: 16px; font-weight: 700; color: var(--yellow); margin: 32px 0 12px; }

.points { list-style: none; padding: 0; display: grid; gap: 8px; }
.points li { position: relative; padding-left: 16px; font-size: 13px; line-height: 20px; }
.points li::before { content: ""; position: absolute; left: 0; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); }
.made-in { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 32px; font-size: 14px; }
.made-in img { width: 32px; height: 20px; border-radius: 2px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px;
  border-radius: 8px; font-size: 16px; font-weight: 700; transition: transform .12s var(--ease), background-color .15s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(180deg, #ffe44d, #f5a800); color: #3a2400; box-shadow: 0 4px 0 #b57700; border-radius: 24px; }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #b57700; }
.btn-secondary { background: #fff; color: var(--purple); box-shadow: inset 0 0 0 1.5px var(--purple); }
.btn-secondary:hover { background: #faf5fd; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn.done { background: #fff; color: #aaa; box-shadow: inset 0 0 0 1.5px #ccc; pointer-events: none; }

/* white card + icon tile */
.card { background: #fff; color: var(--ink); border-radius: 12px; padding: 12px; box-shadow: 0 4px 16px rgba(4, 0, 30, .3); }
.icon-box { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 6px; background: #fff; color: var(--purple); box-shadow: inset 0 0 0 1px #d9d9d9; }
.icon-box img { display: block; }
.icon-box.lg { width: 100px; height: 100px; border-radius: 18px; }

/* ---------- home (sizes measured on Qureka at 412px) ---------- */
.balance { text-align: center; padding-top: 16px; }
.balance-figure { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 20px; line-height: 30px; font-weight: 400; }
.earn-btn {
  display: inline-flex; align-items: center; gap: 6px; width: 130px; height: 35px; margin-top: 10px; padding: 0 8px 0 3px;
  border-radius: 18px; border: 2px solid #fff; background: linear-gradient(180deg, #fff35a, #ffd000 55%, #ffb800);
  box-shadow: 0 0 10px rgba(255, 214, 0, .55); color: #1b1200; font-size: 12px; font-weight: 700; white-space: nowrap;
  transition: transform .12s var(--ease);
}
.earn-btn:active { transform: scale(.96); }
.earn-coin { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #ffe24a; box-shadow: inset 0 0 0 2px #e0a800; }
.earn-coin .coin { width: 17px; height: 17px; vertical-align: 0; }

.tabs { display: flex; border-bottom: 1px solid #4d4e7c; margin: 15px 0 10px; }
.tab { position: relative; flex: 1; padding: 0 0 4px; font-size: 13px; line-height: 19.5px; font-weight: 600; color: #fff; border-bottom: 4px solid transparent; margin-bottom: -1px; }
.tab.active { border-bottom-color: #fff; }
.new-badge {
  position: absolute; top: -6px; right: 0; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%;
  background: #ff3b30; color: #fff; font-size: 6px; font-weight: 800; line-height: 1; letter-spacing: -.2px; transform: rotate(-12deg);
}

.list { display: grid; gap: 10px; }
#tabContent > * { content-visibility: auto; contain-intrinsic-size: auto 125px; }

/* contest card */
.contest { position: relative; padding: 10px 20px; border-radius: 10px; border: 1px solid #ccc; background: #fff; color: #000; }
.contest-info { position: relative; min-height: 60px; margin-top: 4px; padding-left: 88px; }
.contest-info .icon-box { position: absolute; top: 3px; left: 0; }
.contest-info h5 { margin: 0 0 4px; font-size: 13px; line-height: 15.6px; font-weight: 600; }
.contest-info h3 { display: flex; align-items: center; gap: 4px; margin: 0 0 4px; font-size: 18px; line-height: 21.6px; font-weight: 700; }
.contest-info h3 .stack { margin-left: 2px; }
.contest-info h6 { margin: 0; font-size: 12px; line-height: 14.4px; font-weight: 500; color: #999; }
.contest-foot { display: flex; align-items: center; justify-content: space-between; height: 30px; margin-top: 10px; }
.entry { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: #333; }
.live { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: #6dc658; }
.live::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #6dc658; }
.play-now {
  display: inline-flex; align-items: center; justify-content: center; height: 30px; padding: 0 18px; border-radius: 7px;
  border: 1px solid #9015c5; color: #000; font-size: 9px; font-weight: 600; text-transform: uppercase; white-space: nowrap;
}
.play-now:active { background: #f6ecfb; }
.play-now.done { border-color: #ccc; color: #999; pointer-events: none; }

/* editor's choice */
.pick { display: grid; grid-template-columns: 80px 1fr 20px; gap: 12px; align-items: center; }
.pick .icon-box { width: 80px; height: 64px; border-radius: 10px; background: linear-gradient(135deg, #5b2ad6, #c33ad1); color: #fff; }
.pick p { font-size: 14px; line-height: 20px; font-weight: 600; }
.pick .eyebrow { color: var(--purple); margin-top: 4px; font-size: 12px; }
.pick > .i { color: var(--muted); }

/* fortune cookie */
/* floating badge: cookie in a white disc with FORTUNE / COOKIE lettered around it */
.fortune-btn {
  position: fixed; bottom: 16px; right: max(8px, calc(50% - var(--app-w) / 2 + 8px)); z-index: 40;
  display: grid; place-items: center; width: 96px; height: 96px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .45));
}
.fortune-btn::before { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: #fff7e6; box-shadow: inset 0 0 0 2px #f0b24a; }
.fortune-btn img { position: relative; display: block; animation: wobble 2.6s ease-in-out infinite; }
.fortune-btn .fortune-ring text { stroke-width: 6px; }

/* ---------- side menu ---------- */
.menu-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .55); opacity: 0; visibility: hidden; transition: opacity .2s var(--ease), visibility 0s linear .2s; }
/* side menu: navy profile block, then plain rows with thin grey dividers */
.sidebar {
  position: fixed; top: 0; bottom: 0; left: max(0px, calc(50% - var(--app-w) / 2)); z-index: 61;
  width: 280px; max-width: 84vw; overflow-y: auto; scrollbar-width: none; background: #fff; color: #333;
  transform: translateX(-24px); opacity: 0; visibility: hidden;
  transition: transform .3s var(--ease), opacity .3s var(--ease), visibility 0s linear .3s;
}
.menu-open .menu-backdrop { opacity: 1; visibility: visible; transition-delay: 0s; }
.menu-open .sidebar { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
.sidebar-head { position: relative; display: flex; align-items: center; gap: 16px; min-height: 145px; padding: 45px 15px 30px; background: #00004c; }
.menu-x { position: absolute; top: 8px; right: 10px; width: 28px; height: 28px; }
.menu-x::before, .menu-x::after { content: ""; position: absolute; left: 6px; top: 13px; width: 17px; height: 2.5px; border-radius: 2px; background: #fff; transform: rotate(45deg); }
.menu-x::after { transform: rotate(-45deg); }
.avatar { display: grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #fff, #dcdcec); flex: none; overflow: hidden; }
.avatar img { display: block; }
.sidebar-who { flex: 1; display: grid; gap: 8px; }
.sidebar-who b { font-size: 13px; font-weight: 700; color: #fff; }
.sidebar-who a { font-size: 14px; font-weight: 400; color: #f1be1b; text-decoration: underline; text-underline-offset: 2px; }
.sidebar-menu { list-style: none; margin: 0; padding: 0; }
.sidebar-menu li { border-bottom: 1px solid #b2b2b2; }
.sidebar-menu a { display: flex; align-items: center; gap: 10px; padding: 18px 0 18px 15px; font-size: 15px; line-height: 22px; font-weight: 600; color: #333; }
.sidebar-menu .i { width: 18px; height: 18px; color: #111; stroke-width: 2.2; }

/* ---------- intro ---------- */

/* questions */
.q-text { font-size: 20px; line-height: 28px; font-weight: 700; margin-bottom: 16px; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 8px;
  background: #fff; color: #000; box-shadow: inset 0 0 0 1px #fff;
  font-size: 16px; line-height: 22px; font-weight: 700; text-transform: uppercase; text-align: left;
  transition: background-color .15s var(--ease), color .15s var(--ease), transform .12s var(--ease);
}
.option:not(:disabled):active { transform: scale(.98); }
.option:disabled { cursor: default; }
.option > span:last-child { flex: 1; }
.bubble { order: 2; display: none; place-items: center; flex: none; width: 32px; height: 32px; }
.bubble img { display: block; animation: pop .3s var(--ease); }
.bubble .ltr { display: none; }
.option.correct { background: var(--green-bg); color: #fff; box-shadow: none; }
.option.wrong { background: var(--red); color: #fff; box-shadow: none; }
.option.correct .bubble, .option.wrong .bubble { display: grid; }
.intro-q .option { background: transparent; color: #fff; }
.intro-q .option.correct { background: var(--green-bg); }
.intro-q .option.wrong { background: var(--red); }
/* intro page: sizes matched to Qureka's sample-question page (measured at 412px wide) */
.intro-q > .ad-top { margin-bottom: 0; }
.intro-q .q-text { margin: 16px 0 10px; font-size: 18px; line-height: 22px; font-weight: 500; }
.intro-q .q-no { font-size: 20px; line-height: 24px; }
.intro-q .options { gap: 12px; }
.intro-q .option {
  min-height: 33px; padding: 5px 15px; gap: 8px;
  font-size: 14px; line-height: 21px; font-weight: 700;
}
.intro-q .bubble { width: 21px; height: 21px; }
.intro-q .bubble img { width: 21px; height: 21px; }
.intro-q .section-title { font-weight: 600; margin: 32px 0 12px; }
.intro-q .points { gap: 0; }
.intro-q .points li { font-size: 12px; line-height: 18px; padding-left: 15px; }
.intro-q .points li::before { top: 6px; }
.login-line { margin-top: 12px; text-align: right; font-size: 13px; }
.login-line .accent-link { font-weight: 400; text-decoration: underline; text-underline-offset: 2px; }
.legal-bar { margin: 32px 0 0; font-size: 13px; line-height: 18px; font-weight: 500; text-align: center; color: #fff; }
.legal-bar a { color: #fff; text-decoration: underline; }

/* intro success */
/* white card with two rounded corners (top-right, bottom-left), yellow edge, coin badge and a purple ribbon button */
.success-page { padding-top: 24px; }
.success {
  position: relative; width: 100%; max-width: 310px; min-height: 210px; margin: 0 auto 10px; padding: 16px;
  border-radius: 0 60px; background: #fff; color: #000;
}
.success::before { content: ""; position: absolute; top: 0; left: -1px; width: 6px; height: 199px; border-radius: 0 0 6px 0; background: linear-gradient(#ffe600, #ffc400); }
.success h1 { font-size: 20px; line-height: 20px; font-weight: 700; color: #9015c5; }
.your-coins {
  position: relative; height: 72px; max-width: 340px; margin: 20px auto 8px; padding: 8px 15px 8px 95px; border-radius: 8px;
  background: linear-gradient(90deg, #fff 0 18%, #f8f8f8 19% 100%);
}
.coin-badge {
  position: absolute; left: 0; top: -6px; display: grid; align-content: center; width: 85px; height: 85px; border-radius: 50%;
  background: #fff548; border: 5px solid #fecd4d; text-align: center; color: #000;
}
.coin-badge b { font-size: 26px; line-height: 26px; font-weight: 700; }
.coin-badge span { font-size: 18px; line-height: 20px; font-weight: 700; letter-spacing: -.5px; }
.your-coins p { margin: 7px 0 0; font-size: 19px; line-height: 23px; font-weight: 700; color: #3a3045; }
.your-coins p span { color: #ffae00; }
.your-coins p small { display: block; font-size: 16px; line-height: 20px; font-weight: 700; }
.ribbon-row { position: relative; display: flex; justify-content: flex-end; margin: 4px -16px 0 0; }
/* purple flag pointing left, with a darker fold on the right edge */
.ribbon-btn {
  position: relative; display: grid; place-items: center; width: 179px; height: 46px; padding-left: 22px;
  background: linear-gradient(180deg, #a52bff, #8a00f0 55%, #7300d0); color: #fff; font-size: 22px; font-weight: 700;
  clip-path: polygon(0 50%, 16% 0, 100% 0, 100% 100%, 16% 100%);
}
.ribbon-row::after { content: ""; position: absolute; right: 0; bottom: -10px; width: 16px; height: 10px; background: #4a0091; clip-path: polygon(0 0, 100% 0, 0 100%); }
/* glass effect: a glossy top half plus a bright band sweeping across the text */
.ribbon-btn::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 48%; background: linear-gradient(180deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, .06)); pointer-events: none; }
.ribbon-btn::after {
  content: ""; position: absolute; top: -10%; bottom: -10%; left: 0; width: 46px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9) 50%, transparent);
  transform: translateX(-70px) skewX(-22deg); animation: glass 2s ease-in-out infinite;
}
@keyframes glass { 0% { transform: translateX(-70px) skewX(-22deg); } 60%, 100% { transform: translateX(240px) skewX(-22deg); } }
.shine { text-shadow: 0 1px 2px rgba(60, 0, 120, .45); } /* the band (::after) paints over the text */
.bottom-text { margin: 8px 0 0; padding-left: 18px; font-size: 12px; line-height: 15px; font-weight: 600; text-align: left; }
.success-page > .points { margin-top: 30px; gap: 10px; }
.success-page > .points li { font-size: 12px; line-height: 18px; padding-left: 15px; }
.success-page > .points li::before { top: 6px; width: 5px; height: 5px; }
.success-page .made-in { margin-top: 50px; gap: 10px; font-size: 13px; }
.success-page .made-in img { width: 35px; height: 20px; }

/* ---------- contest entry ---------- */
.entry-card { margin-top: 16px; padding: 20px 14px; border-radius: 15px; background: #fff; color: #000; }
.entry-head { display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.entry-head > div { padding-left: 24px; }
.entry-head h3 { font-size: 18px; line-height: 21.6px; font-weight: 600; }
.prize-big { display: flex; align-items: center; gap: 2px; margin: 5px 0; font-size: 26px; line-height: 31px; font-weight: 600; color: #9014c5; }
.rank-link { font-size: 13px; color: #999; text-decoration: underline; text-underline-offset: 2px; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; align-items: center; gap: 7px; margin: 0 0 5px; font-size: 14px; line-height: 21px; font-weight: 600; color: #333; }
.check-list .i { color: #000; opacity: .3; }
.play-quiz {
  display: block; width: 50%; margin: 15px auto 0; padding: 11px 19px; border-radius: 7px; border: 1px solid #9014c5;
  color: #9014c5; font-size: 17px; line-height: 20px; font-weight: 600; transition: background-color .15s var(--ease);
}
.play-quiz:active { background: #f6ecfb; }
.notes { margin-top: 9px; padding: 0 2px 0 6px; gap: 0; }
.notes li { margin-top: 10px; padding-left: 19px; font-size: 13.3px; line-height: 1.5; }
.notes li::before { top: 7px; width: 7px; height: 7px; background: #9014c5; }
.rules-row { display: flex; justify-content: center; margin-top: 16px; }
.rules-row .text-link { height: auto; padding: 0; background: none; border: 0; color: #fff; text-decoration: underline; font-size: 16px; font-weight: 400; }

/* rank table */
.sheet { padding: 0; overflow: hidden; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 20px; border-bottom: 1px solid #eee; }
.rank-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.rank-table th, .rank-table td { height: 44px; padding: 0 20px; border-bottom: 1px solid #f0f0f0; text-align: left; }
.rank-table th { background: #f7f3fb; color: #555; font-size: 13px; }
.rank-table tr:last-child td { border-bottom: 0; }
.rank-table td:last-child, .rank-table th:last-child { text-align: right; font-weight: 700; }
.rank-table .coin { margin-right: 4px; }

/* ---------- quiz play ---------- */
.play-head { display: flex; align-items: center; gap: 12px; padding-top: 16px; }
.play-head .icon-box { width: 50px; height: 50px; border-radius: 8px; background: #fff; box-shadow: none; }
.play-head b { font-size: 17px; font-weight: 600; }
.play-status { display: flex; align-items: center; justify-content: space-between; margin: 48px 0; }
.q-count { font-size: 20px; line-height: 24px; font-weight: 500; }
.q-count b { font-weight: 500; }
.timer { position: relative; width: 40px; height: 40px; }
.timer svg { width: 40px; height: 40px; transform: rotate(-90deg); }
.timer .base { fill: none; stroke: #b6b6b6; stroke-width: 12; }
.timer .prog { fill: none; stroke: #e726f3; stroke-width: 12; transition: stroke .3s; }
.timer.low .prog { stroke: var(--red); }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 17px; font-weight: 400; font-variant-numeric: tabular-nums; }
/* quiz question + white answer bars (Qureka sizes) */
.play-page .q-text { margin: 0 0 15px; font-size: 26px; line-height: 31px; font-weight: 600; }
.play-page .options { gap: 12px; margin-top: 22px; }
.play-page .option {
  min-height: 0; padding: 12px 15px; border-radius: 8px; box-shadow: inset 0 0 0 1px #fff;
  font-size: 18px; line-height: 22px; font-weight: 700;
}
.play-page .bubble, .play-page .bubble img { width: 32px; height: 32px; margin: -6px 0; }
.score-line { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 48px 0 24px; font-size: 16px; font-weight: 500; }
.score-line b { font-variant-numeric: tabular-nums; }
.streak { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px 4px 8px; border-radius: 12px; background: var(--yellow); color: #3a2400; font-size: 13px; font-weight: 800; opacity: 0; transition: opacity .2s var(--ease); }
.streak.show { opacity: 1; }

/* ---------- score ---------- */
.result-card { background: rgba(40, 10, 110, .6); color: #fff; border: 1px solid #b23ad6; box-shadow: none; display: grid; gap: 12px; padding: 16px; }
.result-top { display: flex; align-items: center; gap: 12px; }
.result-top .icon-box { background: #fff; }
.result-top b { display: block; font-size: 18px; font-weight: 700; }
.result-top .eyebrow { color: #fff; font-weight: 600; }
.result-figures { display: flex; border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 12px; }
.result-figures div { flex: 1; }
.result-figures div + div { padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, .15); }
.result-figures strong { display: flex; align-items: center; gap: 8px; font-size: 28px; line-height: 36px; font-weight: 800; color: var(--yellow); font-variant-numeric: tabular-nums; }

/* ---------- results list ---------- */
.result-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; min-height: 68px; border-bottom: 1px solid #eee; }
.result-row:last-child { border-bottom: 0; }
.result-row b { display: block; font-size: 15px; }
.result-row .eyebrow { color: var(--muted); }
.result-row .won { display: flex; align-items: center; gap: 4px; font-weight: 800; font-variant-numeric: tabular-nums; }
.empty { display: grid; justify-items: center; gap: 12px; padding: 32px 16px; text-align: center; color: var(--ink-2); font-size: 14px; }

/* ---------- content pages ---------- */
.card.prose { padding: 20px 16px; display: grid; gap: 10px; }
.prose h2 { font-size: 16px; line-height: 22px; font-weight: 700; margin-top: 8px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { font-size: 14px; line-height: 22px; color: var(--ink-2); }
.prose ol { padding-left: 20px; display: grid; gap: 10px; }
.prose a { color: var(--purple); font-weight: 600; }
.contact-block { display: grid; justify-items: center; gap: 8px; text-align: center; }
.contact-block .lead { color: var(--ink-2); }
.contact-block .accent-link { color: var(--purple); }
.contact-block + .contact-block { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.card:has(.contact-block) { padding: 20px 16px; }
.foot-note { margin-top: 16px; text-align: center; font-size: 14px; }
.foot-note a { color: var(--yellow); text-decoration: underline; }
.social-row { display: flex; justify-content: center; gap: 8px; }

/* signup */
.signup { padding-top: 8px; }
.signup img.mark { float: right; width: 56px; height: 56px; }
.signup .title { color: var(--yellow); font-size: 22px; }
.signup .lead { font-size: 13px; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 272px; height: 52px; margin: 64px auto 16px;
  border-radius: 10px; background: #fff; color: #333; font-size: 17px; font-weight: 600; box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
  transition: transform .12s var(--ease);
}
.google-btn:active { transform: scale(.98); }
.fine-print { font-size: 13px; line-height: 20px; text-align: center; margin-bottom: 40px; }
.fine-print a { text-decoration: underline; }

/* 404 */
.notfound { display: grid; justify-items: center; gap: 12px; padding-top: 96px; text-align: center; }
.notfound .icon-box { width: 80px; height: 80px; border-radius: 20px; margin-bottom: 8px; }
.notfound .btn { margin-top: 12px; }

/* ---------- popups ---------- */
.modal {
  position: fixed; inset: 0; z-index: 99; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, .6); opacity: 0; visibility: hidden; transition: opacity .2s var(--ease), visibility 0s linear .2s;
}
.modal.show { opacity: 1; visibility: visible; transition-delay: 0s; }
.dialog {
  position: relative; width: min(336px, 100%); padding: 24px 20px 20px; border-radius: 16px; background: #fff; color: var(--ink);
  text-align: center; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); transform: scale(.96); transition: transform .2s var(--ease);
}
.modal.show .dialog { transform: none; }
.dialog-title { font-size: 24px; line-height: 32px; font-weight: 800; }
#halfTitle { color: #2e9e00; }
.dialog-text { margin-top: 8px; font-size: 15px; line-height: 22px; color: var(--ink-2); }
.dialog-text b { color: var(--ink); }
.dialog-actions { display: grid; gap: 8px; margin-top: 20px; }
.dialog-actions.row { grid-template-columns: 1fr 1fr; }
#lowBalanceClaim { background: linear-gradient(90deg, #6a1b9a, #b03ad1); color: #fff; box-shadow: none; border-radius: 10px; }
/* exit popup: big plain question, two flat buttons */
#exitPopup .dialog { width: min(336px, 100%); padding: 54px 24px; border-radius: 13px; }
#exitTitle { font-size: 19px; line-height: 24px; font-weight: 700; }
#exitPopup .dialog-text { display: none; }
#exitPopup .dialog-actions { margin-top: 24px; }
#exitYes { background: none; color: #000; box-shadow: none; border-radius: 6px; height: 40px; font-weight: 600; }
#exitNo { background: #8919b8; color: #fff; box-shadow: none; border-radius: 6px; height: 40px; }

/* glossy purple pill (Claim / Continue) with a small "Ad" mark */
.glossy-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 90%; height: 55px; margin: 32px auto 15px;
  border-radius: 30px; border: 2px solid #b78bff;
  background: linear-gradient(180deg, #9a4dff 0%, #7212ff 48%, #5a00e6 52%, #6b10ff 100%);
  box-shadow: 0 4px 0 #3b0096, 0 8px 18px rgba(90, 0, 230, .45);
  color: #fff; font: 800 30px/1 "Montserrat", var(--font); letter-spacing: .3px; text-shadow: 0 2px 0 rgba(40, 0, 110, .5);
  transition: transform .12s var(--ease);
}
.glossy-btn::before {
  content: ""; position: absolute; left: 8%; right: 8%; top: 5px; height: 38%; border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .08));
}
.glossy-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #3b0096, 0 4px 10px rgba(90, 0, 230, .4); }
/* "Ad" badge pinned on the top-right corner of the button */
.ad-tag::after {
  content: "Ad"; position: absolute; right: 14px; top: -9px; padding: 2px 7px; border-radius: 8px;
  background: #ffd54a; border: 1.5px solid #fff; color: #3a2400; font: 800 10px/12px var(--font); letter-spacing: .3px; text-shadow: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .35);
}
.glossy-btn.sm { width: 76%; height: 46px; margin: 4px auto 7px; font-size: 20px; }
.glossy-btn.sm.ad-tag::after { right: 8px; top: -8px; }
.tv { position: relative; width: 22px; height: 18px; border-radius: 4px; background: #ffd54a; box-shadow: inset 0 0 0 2px #b77d00; }
.tv::after { content: ""; position: absolute; left: 8px; top: 4px; border-left: 7px solid #b77d00; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.pop-close { display: block; margin: 0 auto; padding: 4px 8px; color: #fff; font: 400 17px/22px "Montserrat", var(--font); text-decoration: underline; text-underline-offset: 3px; }
.pop-close.dark { color: #000; text-decoration: none; font-size: 15px; }

/* Hurray / Oops: dark card, big picture on top, yellow headline */
.dialog.prize-pop {
  width: min(350px, 100%); padding: 0 32px 13px; border-radius: 40px; border: 2px solid rgba(255, 255, 255, .72);
  background: #111828; color: #fff; font-family: "Montserrat", var(--font); overflow: visible;
}
.prize-pop .chest { display: block; width: 240px; height: 200px; margin: -4px auto 4px; }
.prize-pop h2 { margin: 0 0 8px; font-size: 36px; line-height: 43px; font-weight: 800; color: #fed11e; }
.prize-pop h6 { margin: 0 0 8px; font-size: 18px; line-height: 22px; font-weight: 600; color: #fed11e; }
.prize-pop h4 { margin: 30px 0 15px; font-size: 24px; line-height: 22px; font-weight: 700; }
.prize-pop h4 > span { color: #fed11e; }
.prize-pop p { margin: 0 0 14px; font-size: 16px; line-height: 19px; font-weight: 600; }
.prize-pop .answer-line { margin-top: 24px; font-size: 18px; line-height: 22px; }
.prize-pop .answer-line b { color: #fed11e; }

/* small round close button (grey ring with a cross) used on the white popups */
.x-btn { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #9a9a9a; }
.x-btn::before, .x-btn::after { content: ""; position: absolute; left: 4px; top: 8.5px; width: 11px; height: 1.6px; border-radius: 1px; background: #8a8a8a; transform: rotate(45deg); }
.x-btn::after { transform: rotate(-45deg); }

/* coins won */
.dialog.reward-pop { width: min(330px, 100%); padding: 28px 16px 20px; border-radius: 10px; }
.congrats-title { display: block; width: 84%; height: auto; margin: 0 auto; }
.won-line { margin-top: 8px; font-size: 24px; line-height: 30px; font-weight: 400; letter-spacing: .2px; color: #222; }
.won-coins { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 2px; font-size: 24px; line-height: 32px; font-weight: 800; color: #222; }
.won-coins > span:nth-child(2) { color: #fe7201; }
.won-coins .dot { margin-left: -8px; }
.coin-won { width: 30px; height: 30px; vertical-align: 0; }

/* not enough coins */
.dialog.low-pop { width: min(383px, calc(100vw - 28px)); padding: 0 24px 16px; border-radius: 13px; overflow: visible; font-family: "Montserrat", var(--font); }
.oops-art { display: block; width: 50%; height: auto; margin: -55px auto 0; }
.low-title { margin-top: 9px; font-size: 19px; line-height: 23px; font-weight: 800; color: #000; }
.low-title span, .low-sub span { display: block; }
.low-sub { margin-top: 8px; font-size: 25px; line-height: 29px; font-weight: 600; color: #000; }
.watch-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px; height: 44px; margin: 16px auto 8px; padding: 0 12px 0 22px;
  border-radius: 4px; background: linear-gradient(180deg, #8b2cff, #6a00e8); box-shadow: 0 3px 0 #3f0096; transition: transform .12s var(--ease);
}
.watch-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #3f0096; }
.watch-btn.ad-tag::after { right: -12px; top: -10px; }
.watch-text {
  font: 700 18px/1 "Montserrat", var(--font);
  background: linear-gradient(90deg, #fff548 0 40%, #fff 50%, #fff548 60% 100%) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: wshine 2s linear infinite;
}
@keyframes wshine { from { background-position: 100% 0; } to { background-position: 0 0; } }
.play-dot { position: relative; width: 28px; height: 28px; border-radius: 50%; background: #ffd400; box-shadow: inset 0 0 0 2px #fff3a0; }
.play-dot::after { content: ""; position: absolute; left: 11px; top: 8px; border-left: 9px solid #4a1a9a; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }

/* simple message (e.g. "Sorry, the video is currently unavailable") */
.dialog.msg-pop { width: min(320px, 100%); padding: 30px 20px 24px; border-radius: 10px; }
.msg-pop .dialog-title { font-size: 20px; line-height: 23px; font-weight: 800; color: #8819bc; }
.msg-pop .dialog-text { font-size: 18px; line-height: 21px; color: #222; }

/* Awesome: small white card, green headline */
.dialog.awesome-pop { width: 296px; padding: 27px 24px 13px; border-radius: 13px; font-family: "Montserrat", var(--font); }
.awesome-pop h2 { font-size: 32px; line-height: 38px; font-weight: 800; color: #32ba7c; }
.awesome-pop h4 { margin: 3px 0 6px; font-size: 22px; line-height: 22px; font-weight: 800; color: #111; }
.awesome-pop p { margin: 4px 0 11px; font-size: 14px; line-height: 15px; font-weight: 600; color: #111; }
.eyebrow#fortuneLabel { color: #8a5a00; font-weight: 700; }
#fortuneModal .dialog { background: linear-gradient(160deg, #fff8dc, #ffe29a); color: #4a2a00; }
.fortune-text { margin-top: 8px; font-size: 19px; line-height: 28px; font-weight: 700; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 72px; z-index: 120; display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 24px; background: #fff; color: #14275e; font-size: 14px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; transform: translate(-50%, 8px);
  transition: opacity .2s var(--ease), transform .2s var(--ease); font-variant-numeric: tabular-nums;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- pictures + playful motion (transform only, GPU friendly) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pop { animation: pop .45s var(--ease) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } to { transform: none; } }
@keyframes wobble { 0%, 78%, 100% { transform: rotate(0); } 84% { transform: rotate(-12deg); } 90% { transform: rotate(12deg); } 95% { transform: rotate(-6deg); } }
@keyframes spin { to { transform: rotate(360deg); } }


/* fortune cookie card */
#fortuneModal { padding: 24px; }
.fortune-card {
  position: relative; width: min(318px, 100%); padding: 124px 26px 64px; border-radius: 15px;
  background:
    radial-gradient(rgba(176, 96, 32, .16) 1.2px, transparent 1.4px) 0 0 / 14px 14px,
    linear-gradient(180deg, #ffe7c4 0 38%, #f8cf98 38% 100%);
  border: 2px solid #ffeabf; box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  transform: scale(.94); transition: transform .2s var(--ease);
}
#fortuneModal.show .fortune-card { transform: none; }
.fortune-badge {
  position: absolute; left: 50%; top: -72px; width: 176px; height: 176px; margin-left: -88px;
  display: grid; place-items: center; border-radius: 50%;
}
.fortune-badge::before { content: ""; position: absolute; inset: 34px; border-radius: 50%; background: #fff; box-shadow: 0 4px 12px rgba(120, 60, 0, .25); }
.fortune-badge img { position: relative; }
.wobble { animation: wobble 2.6s ease-in-out infinite; }
.fortune-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fortune-ring text {
  font: 900 30px/1 "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif; letter-spacing: 2px;
  fill: #f39a1e; stroke: #7a3b0a; stroke-width: 5px; paint-order: stroke; stroke-linejoin: round;
}
.fortune-paper { display: grid; place-items: center; min-height: 196px; padding: 32px 18px; background: #fff; filter: drop-shadow(0 2px 2px rgba(120, 60, 0, .25)); }
.fortune-text {
  margin: 0; color: #2a1d10; text-align: center; font-size: 22px; line-height: 32px; font-weight: 700;
  font-family: "Comic Sans MS", "Chalkboard SE", "Segoe Print", "Comic Neue", cursive;
}
.fortune-x {
  position: absolute; left: 50%; bottom: -22px; width: 48px; height: 48px; margin-left: -24px; border-radius: 50%;
  display: grid; place-items: center; background: #fff1dc; color: #b5651d; box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}
.fortune-x svg { stroke-width: 3; }

/* ---------- display ad (top of page) ---------- */
/* space is reserved up front (min-height set from config) so content never jumps when an ad arrives */
.ad-slot {
  display: flex; flex-direction: column; justify-content: flex-start; margin: 0 -16px;
  contain: layout;
}
.ad-slot::after { content: "Advertisement"; display: block; order: 2; padding: 4px 0 0; text-align: center; font-size: 10px; line-height: 12px; color: rgba(255, 255, 255, .45); }
.ad-slot ins { width: 100%; text-align: center; }
/* Google puts a fixed-size box (e.g. 336x280) inside the full-width slot: keep it centred */
.ad-slot ins > div, .ad-slot ins iframe { margin-left: auto !important; margin-right: auto !important; }
/* clean gap between the top ad and the page content under it */
.ad-top { margin-bottom: 16px; }
/* no ad to show: give the space back instead of leaving an empty block */
.ad-slot:has(ins[data-ad-status="unfilled"]), .no-ads .ad-slot { display: none; }

/* loader shown while an interstitial / rewarded ad is fetched (max 3s) */
.ad-loader {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; align-content: center; gap: 12px;
  background: rgba(12, 5, 56, .92); opacity: 0; visibility: hidden; transition: opacity .15s, visibility 0s linear .15s;
}
.ad-loader.show { opacity: 1; visibility: visible; transition-delay: 0s; }
.ad-spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .2); border-top-color: var(--yellow); animation: spin .8s linear infinite; }
.ad-loader p { font-weight: 600; color: var(--yellow); }
