/* SpotOn — light "paper atlas" theme */
:root {
  --paper: #faf6ee;
  --card: #fffdf8;
  --ink: #16231f;
  --muted: #68736d;
  --line: #e6dfcf;
  --saffron: #f26b1d;
  --saffron-d: #d4560e;
  --saffron-soft: #fde6d6;
  --teal: #0e7a6b;
  --teal-soft: #d9efe9;
  --sun: #f2b53a;
  --red: #d64545;
  --green: #1f9d55;
  --lime: #7bbf3a;
  --ocean: #d6e9ef;
  --land: #f7edd6;
  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 0 rgba(22,35,31,.04), 0 8px 24px -12px rgba(22,35,31,.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); }
button { font-family: inherit; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 20px;
  background: rgba(250,246,238,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none;
}
.logo svg { width: 24px; height: 28px; }
.logo em { font-style: normal; color: var(--saffron); }
.top nav { display: flex; gap: 4px; margin-left: auto; }
.top nav a {
  padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 500;
  color: var(--muted); text-decoration: none; white-space: nowrap;
}
.top nav a:hover { color: var(--ink); background: #f0e9d9; }
.top nav a.active { background: var(--ink); color: #fff; }
.top .date {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--saffron-d); background: var(--saffron-soft); padding: 5px 11px; border-radius: 999px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; text-decoration: none;
  background: var(--saffron); color: #fff; font-weight: 700; font-size: 15px;
  padding: 13px 24px; border-radius: 14px;
  box-shadow: 0 3px 0 var(--saffron-d);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--saffron-d); }
.btn.dark { background: var(--ink); box-shadow: 0 3px 0 #000; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.btn.small { padding: 9px 16px; font-size: 14px; border-radius: 12px; }
.btn.block { width: 100%; }

/* ---------- landing ---------- */
body.home { position: relative; }
body.home::before {
  content: ""; position: absolute; z-index: 0; top: 56px; right: 0; width: min(56vw, 820px); height: 600px;
  background: url(../img/cricket-bg.svg) right center / contain no-repeat; pointer-events: none;
}
.landing, .steps { position: relative; z-index: 1; }
.landing {
  max-width: 1120px; margin: 0 auto; padding: 72px 20px 80px; min-height: 560px;
  display: flex; align-items: center;
}
.landing section { max-width: 560px; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--teal); background: var(--teal-soft); padding: 6px 12px; border-radius: 999px;
}
.landing h1 {
  font-family: var(--display); font-weight: 800; font-size: clamp(42px, 7vw, 76px);
  line-height: .98; letter-spacing: -.035em; margin: 18px 0 16px;
}
.landing h1 span { color: var(--saffron); }
.landing .lede { font-size: 18px; color: #3d4a44; max-width: 480px; margin: 0 0 26px; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.streak-chip { margin-top: 18px; font-weight: 700; color: var(--saffron-d); min-height: 24px; }
.facts { display: flex; gap: 28px; margin-top: 26px; flex-wrap: wrap; }
.facts b { display: block; font-family: var(--display); font-size: 28px; line-height: 1; }
.facts span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.steps {
  max-width: 1120px; margin: 0 auto; padding: 0 20px 80px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.step { background: var(--card); border: 1.5px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.step i {
  font-style: normal; font-family: var(--display); font-weight: 800; font-size: 14px;
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--sun); margin-bottom: 10px;
}
.step h3 { margin: 0 0 4px; font-family: var(--display); font-size: 18px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- game ---------- */
body.game { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.game .top { flex: none; padding: 9px 16px; }
.arena { flex: 1; min-height: 0; display: grid; grid-template-columns: 380px 1fr; }
.panel {
  display: flex; flex-direction: column; gap: 14px; padding: 18px;
  background: var(--card); border-right: 1.5px solid var(--line); overflow-y: auto;
}
.pips { display: flex; align-items: center; gap: 6px; }
.pip {
  flex: 1; height: 9px; border-radius: 99px; background: var(--line); position: relative;
}
.pip.done { background: var(--teal); }
.pip.now { background: var(--saffron); }
.pip-meta { display: flex; justify-content: space-between; align-items: baseline; }
.qnum { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mult {
  font-size: 12px; font-weight: 800; color: var(--saffron-d); background: var(--saffron-soft);
  padding: 2px 9px; border-radius: 99px;
}
.qtext { font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.22; letter-spacing: -.01em; margin: 0; }
.scorebox { display: flex; align-items: baseline; gap: 8px; }
.scorebox strong { font-family: var(--display); font-size: 30px; line-height: 1; }
.scorebox span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }


.toggles { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: #3d4a44; }
.toggles label { display: flex; gap: 9px; align-items: center; cursor: pointer; }
.toggles input { accent-color: var(--saffron); width: 16px; height: 16px; }

.result {
  border: 1.5px solid var(--ink); border-radius: 16px; padding: 14px; background: #fff;
  display: flex; flex-direction: column; gap: 10px; box-shadow: 4px 4px 0 var(--ink);
}
.result .head { display: flex; align-items: center; gap: 10px; }
.result .pts { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1; }
.result .dist { color: var(--muted); font-size: 14px; }
.result .answer { font-weight: 700; }

.stage { position: relative; min-height: 0; background: radial-gradient(circle at 50% 45%, #fffaf0, #efe6d1); touch-action: none; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; display: block; }
.stage .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; }
.zoombtns { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; }
.zoombtns button {
  width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--ink); background: var(--card);
  font-size: 20px; font-weight: 700; cursor: pointer; line-height: 1;
}
.zoombtns button:active { background: var(--saffron-soft); }

/* ---------- content pages ---------- */
.page { max-width: 600px; margin: 0 auto; padding: 28px 20px 70px; }
.page h1 { font-family: var(--display); font-size: 36px; letter-spacing: -.03em; line-height: 1.05; margin: 6px 0 4px; }
.page h2 {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  margin: 32px 0 12px; font-weight: 700;
}
.page p, .page li { color: #3d4a44; }
.page ul { padding-left: 20px; }
.page li { margin: 4px 0; }

.ticket {
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 22px; padding: 22px;
  box-shadow: 6px 6px 0 var(--ink); margin-top: 8px;
}
.bigscore { font-family: var(--display); font-weight: 800; font-size: 72px; letter-spacing: -.04em; line-height: 1; color: var(--saffron); }
.bigscore small { font-size: 22px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.pipdots { display: flex; gap: 8px; margin: 14px 0 4px; }
.pipdots .dot { width: 26px; height: 26px; }
.rows { border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.row:last-child { border-bottom: 0; }
.row .q { flex: 1; min-width: 0; color: #3d4a44; }
.row .q b { color: var(--ink); display: block; }
.row .n { font-weight: 800; font-family: var(--display); }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; display: inline-block; }
.dot.t4 { background: var(--green); box-shadow: 0 0 0 3px #c4e8d1; }
.dot.t3 { background: var(--lime); }
.dot.t2 { background: var(--sun); }
.dot.t1 { background: var(--red); }
.dot.t0 { background: #b9b6ad; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

.share { margin-top: 26px; }
.share h2 { margin-top: 0; }
.sharebtns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sbtn {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px;
  border: 1.5px solid var(--ink); border-radius: 16px; background: var(--card); cursor: pointer;
  font-weight: 700; font-size: 14px; color: var(--ink); box-shadow: 0 3px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.sbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.sbtn svg { width: 26px; height: 26px; }
.sbtn.wa svg { color: #1faa59; }
.sbtn.ig svg { color: #c13584; }
.sbtn.x svg { color: #000; }
.share .hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 8px; text-align: center; background: var(--card); }
.stat b { display: block; font-family: var(--display); font-size: 30px; line-height: 1.1; color: var(--saffron); }
.stat span { font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding: 16px 14px 12px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 11px; color: var(--muted); gap: 4px; }
.bar i { display: block; width: 100%; border-radius: 6px 6px 0 0; min-height: 3px; }
.bar i.t4 { background: var(--green); }
.bar i.t3 { background: var(--lime); }
.bar i.t2 { background: var(--sun); }
.bar i.t1 { background: var(--red); }
.bar i.t0 { background: #d7d3c6; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: 90vw; text-align: center;
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 14px; z-index: 60;
}

/* ---------- responsive ---------- */
/* tablet: art stays vivid, steps stay in a row */
@media (max-width: 900px) {
  body.home::before { width: 52vw; opacity: .95; }
  .landing { padding-top: 56px; }
  .steps { gap: 12px; }
  .step { padding: 16px; }

  /* game: map on top, panel as a bottom sheet (phones and iPad portrait) */
  .arena { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .panel {
    order: 2; border-right: 0; border-top: 1.5px solid var(--ink); max-height: 44dvh; gap: 10px; padding: 14px 18px 16px;
    border-radius: 20px 20px 0 0; box-shadow: 0 -8px 24px -14px rgba(22,35,31,.4);
  }
  .stage { order: 1; }
  /* keep "Next question" reachable even when the sheet has to scroll */
  .result #next { position: sticky; bottom: 0; }
  .toggles { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
}
/* phone */
@media (max-width: 640px) {
  .top { gap: 6px 12px; padding: 10px 14px; }
  .top nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; gap: 0; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { padding: 6px 10px; font-size: 13px; }
  .top .date { margin-left: auto; }
  .game .top nav { display: none; }
  body.home::before { width: 100%; height: 460px; opacity: .14; top: 100px; }
  .steps { grid-template-columns: 1fr; }
  .panel { padding: 12px 14px 14px; }
  .qtext { font-size: 17px; }
  .scorebox strong { font-size: 24px; }
  .toggles { gap: 6px 16px; font-size: 13px; }
  .bigscore { font-size: 60px; }
  .stats3 { gap: 8px; }
  .ticket { box-shadow: 4px 4px 0 var(--ink); padding: 18px; }
}
/* phone held sideways: keep the map big, shrink the side panel */
@media (max-height: 520px) and (orientation: landscape) {
  .arena { grid-template-columns: 300px 1fr; grid-template-rows: none; }
  .panel { order: 0; max-height: none; border-radius: 0; border-top: 0; border-right: 1.5px solid var(--line); box-shadow: none; gap: 8px; padding: 10px 14px; }
  .stage { order: 0; }
  .qtext { font-size: 16px; }
  .game .top { padding: 6px 14px; }
  .game .top nav { display: none; }
  body.home::before { display: none; }
}

/* ---------- ads ---------- */
.ad { max-width: 728px; margin: 36px auto 0; padding: 0 20px 40px; text-align: center; min-height: 120px; }
.ad-label { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }   /* no ad available: no empty box */

/* ---------- footer ---------- */
.foot {
  max-width: 1120px; margin: 0 auto; padding: 22px 20px 40px; border-top: 1px solid var(--line);
  display: flex; gap: 8px 22px; flex-wrap: wrap; justify-content: center; font-size: 13px; color: var(--muted);
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
