/* Last Over (cricket) */
:root { --page-tint: #0f3a24; --pitch: #d9c58f; --cherry: #b91c1c; }
#app { max-width: 820px; margin: 0 auto; padding: 14px 14px 40px; }

/* ---------- Menu ---------- */
.hero { text-align: center; padding: 18px 8px 8px; }
.hero h1 {
  font-family: var(--display); font-size: clamp(2.8rem, 10vw, 4.8rem);
  text-transform: uppercase; letter-spacing: 2px; margin: 8px 0 6px; text-shadow: 0 4px 0 rgba(0, 0, 0, .35);
}
.hero h1 span { color: var(--pitch); }
.hero-sub { color: var(--muted); max-width: 520px; margin: 0 auto 6px; line-height: 1.45; }
.hero-date { font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-size: .85rem; color: var(--gold); }
.led-board {
  display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 14px;
  background: #050608; border: 3px solid #2a2f38; border-radius: 8px; box-shadow: 0 0 0 2px #000, var(--shadow);
  font-family: var(--led); font-weight: 700;
}
.led-label { font-size: .7rem; letter-spacing: 2px; text-transform: uppercase; color: #9aa4b2; }
.led-num { font-size: 1.8rem; color: var(--led-amber); text-shadow: 0 0 10px rgba(255, 176, 0, .9); }

.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 18px; }
.mode-card {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; padding: 18px;
  border-radius: var(--radius); border: 2px solid rgba(255, 255, 255, .1);
  background:
    linear-gradient(90deg, transparent 46%, rgba(217, 197, 143, .16) 46% 54%, transparent 54%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .04) 0 24px, transparent 24px 48px),
    linear-gradient(160deg, #2f7d2a, #1b4f19);
  box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
@media (hover: hover) and (pointer: fine) { .mode-card:hover { transform: translateY(-3px); border-color: var(--gold); } }
.mode-card.odi { background: linear-gradient(90deg, transparent 46%, rgba(255, 255, 255, .08) 46% 54%, transparent 54%), linear-gradient(160deg, #1f3c88, #13234f); }
.mode-card.nets { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 14px), repeating-linear-gradient(-45deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 14px), linear-gradient(160deg, #3b3f4a, #1b1d23); }
.mode-card.played { opacity: .85; }
.mode-tag { font-size: .7rem; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.mode-title { font-family: var(--display); font-size: 1.6rem; letter-spacing: 1px; text-transform: uppercase; }
.mode-teaser { color: #e6efe6; font-size: .92rem; line-height: 1.4; min-height: 2.8em; }
.mode-status { margin-top: auto; font-weight: 700; color: var(--gold); }

.stats-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding: 14px 18px; border-radius: var(--radius);
  background: var(--panel); border: 2px solid rgba(255, 255, 255, .1);
}
.stats-strip span:first-child { font-weight: 700; }
.stats-strip span:last-child { color: var(--muted); }
.stats-strip strong { color: var(--gold); }

/* ---------- Match header + scoreboard ---------- */
.match-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 0 2px 8px; }
.mh-teams { font-weight: 800; display: flex; align-items: center; gap: 6px; }
.mh-v { color: var(--muted); font-weight: 600; }
.mh-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid; display: inline-block; }
.mh-venue { color: var(--muted); font-size: .85rem; }

.scoreboard {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'score need' 'target target'; align-items: center; gap: 4px 14px;
  background: #050608; border: 3px solid #2a2f38; border-radius: 10px; padding: 10px 14px;
  box-shadow: 0 0 0 2px #000, var(--shadow); font-family: var(--led); font-weight: 700;
}
.sb-score { grid-area: score; font-size: 1.6rem; color: var(--led-amber); text-shadow: 0 0 8px rgba(255, 176, 0, .8); white-space: nowrap; }
.sb-team { color: #e2e8f0; text-shadow: none; }
.sb-sep { opacity: .7; }
.sb-overs { font-size: .9rem; color: #9aa4b2; text-shadow: none; }
.sb-need { grid-area: need; text-align: right; color: #ff5a5a; text-shadow: 0 0 8px rgba(255, 59, 59, .7); font-size: 1.15rem; text-transform: uppercase; letter-spacing: 1px; }
.sb-need strong { font-size: 1.5rem; color: #ff7676; }
.sb-target { grid-area: target; color: #9aa4b2; font-size: .85rem; letter-spacing: 1px; text-transform: uppercase; }
.scoreboard.super { border-color: var(--gold); }
.scoreboard.super .sb-need { color: var(--gold); text-shadow: 0 0 8px rgba(255, 210, 63, .6); }

.this-over { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin: 10px 0; min-height: 34px; }
.chip {
  min-width: 32px; height: 32px; padding: 0 5px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .95rem; background: rgba(255, 255, 255, .12); border: 2px solid rgba(255, 255, 255, .2);
  animation: pop .3s ease-out;
}
.chip.empty { background: transparent; border-style: dashed; animation: none; }
.chip.empty.next { border-color: var(--gold); border-style: solid; animation: pulse 1s infinite; }
.chip.dot { color: var(--muted); }
.chip.run { background: rgba(255, 255, 255, .2); }
.chip.four { background: #1d4ed8; border-color: #60a5fa; }
.chip.six { background: #7c3aed; border-color: #c4b5fd; }
.chip.w { background: var(--bad); border-color: #fca5a5; }
.chip.nb { background: #a16207; border-color: #fcd34d; font-size: .8rem; }
.over-break { width: 2px; height: 26px; background: rgba(255, 255, 255, .3); margin: 0 4px; }
@keyframes pulse { 50% { filter: brightness(1.4); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Ground ---------- */
.ground-wrap { position: relative; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); border: 3px solid #1b2433; background: #141c2a; }
#ground { display: block; width: 100%; height: auto; max-height: 42vh; }
.person.celebrate { animation: jump .45s ease-out; }
@keyframes jump { 50% { opacity: .5; } }
.stumps .bails { transform-box: fill-box; transform-origin: center; }
.stumps.hit .bails { animation: bails-fly .6s ease-out forwards; }
@keyframes bails-fly { to { transform: translate(-26px, -18px) rotate(220deg); opacity: 0; } }
.stumps.hit { animation: stump-shake .3s; }
@keyframes stump-shake { 30% { transform: translateX(-2px); } 70% { transform: translateX(2px); } }

.ground-banner {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(5, 10, 20, .55); text-align: center; padding: 10px; pointer-events: none;
}
.ground-banner.gold { background: radial-gradient(circle, rgba(255, 210, 63, .25), rgba(5, 10, 20, .65) 70%); }
.ground-banner.bad { background: radial-gradient(circle, rgba(239, 68, 68, .3), rgba(30, 5, 5, .7) 70%); }
.ground-banner.pop > * { animation: pop .35s ease-out both; }
.ground-banner.pop > *:nth-child(2) { animation-delay: .1s; }
.ground-banner.pop > *:nth-child(3) { animation-delay: .2s; }
.bn-big {
  font-family: var(--display); font-size: clamp(2.6rem, 11vw, 5.4rem); color: var(--gold); letter-spacing: 3px; line-height: 1;
  text-shadow: 0 0 18px rgba(255, 210, 63, .5), 0 3px 0 #000;
}
.bn-big.sm { font-size: clamp(1.6rem, 6vw, 2.8rem); color: var(--chalk); text-shadow: 0 3px 0 rgba(0, 0, 0, .5); }
.bn-big.bad { color: #ff6b6b; text-shadow: 0 0 18px rgba(239, 68, 68, .6), 0 3px 0 #000; }
.bn-small { font-weight: 700; font-size: clamp(.85rem, 2.6vw, 1.1rem); margin: 6px 0; max-width: 520px; }
.bn-ans { font-weight: 700; color: var(--gold); margin-top: 6px; font-size: clamp(.85rem, 2.6vw, 1.05rem); }

/* ---------- Shot picker ---------- */
.shot-panel, .question-panel {
  margin-top: 12px; background: var(--panel); border-radius: var(--radius); padding: 14px 16px 16px;
  border: 1px solid rgba(255, 255, 255, .1); box-shadow: var(--shadow); animation: pop .25s ease-out;
}
.shot-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; color: var(--gold); }
.free-hit { background: var(--gold); color: #111; padding: 3px 10px; border-radius: 999px; animation: pulse 1s infinite; }
.shot-panel.free { border-color: var(--gold); }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shot {
  font: inherit; color: inherit; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 8px;
  border-radius: 12px; border: 2px solid rgba(255, 255, 255, .14); background: var(--panel-2);
  transition: transform .1s, border-color .15s;
}
.shot:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .shot:hover { border-color: var(--gold); transform: translateY(-2px); } }
.shot-name { font-family: var(--display); font-size: 1.5rem; letter-spacing: 1px; text-transform: uppercase; }
.shot-gain { font-weight: 800; color: var(--gold); }
.shot-meta { font-size: .8rem; color: var(--muted); }
.shot-risk { font-size: .78rem; color: var(--muted); }
.shot.slog .shot-risk { color: #fca5a5; font-weight: 700; }
.shot-panel.free .shot.slog .shot-risk { color: #86efac; }
.pips { letter-spacing: 1px; }
.pips.d1 { color: var(--good); } .pips.d2 { color: #facc15; } .pips.d3 { color: #f43f5e; }

/* ---------- Questions ---------- */
.q-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.q-stage { color: var(--gold); }
.q-diff { color: var(--muted); }
.timer { height: 6px; background: rgba(255, 255, 255, .12); border-radius: 3px; overflow: hidden; margin: 10px 0 4px; }
.timer-fill { height: 100%; width: 100%; background: var(--good); }
.timer-fill.warn { background: var(--bad); }
.q-text { font-size: clamp(1.05rem, 2.8vw, 1.3rem); font-weight: 700; line-height: 1.35; margin: 10px 0 14px; min-height: 2.7em; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px;
  background: var(--panel-2); border: 2px solid rgba(255, 255, 255, .12);
  transition: transform .1s, border-color .15s, background .2s;
}
@media (hover: hover) and (pointer: fine) { .answers:not(.fresh) .answer:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); } }
.answer:disabled { cursor: default; }
.answer-key {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12); font-size: .8rem; font-weight: 800;
}
.answer.correct { background: #166534; border-color: var(--good); animation: pop .3s; }
.answer.wrong { background: #7f1d1d; border-color: var(--bad); animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- Result ---------- */
.result-card {
  margin: 20px auto; max-width: 560px; text-align: center; padding: 28px 22px;
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); border: 2px solid rgba(255, 255, 255, .12);
}
.result-card.won { border-color: var(--gold); background: linear-gradient(180deg, #4a3a10, var(--panel) 60%); }
.result-emoji { font-size: 4rem; line-height: 1; animation: pop .5s ease-out both; }
.result-title { font-family: var(--display); font-size: clamp(1.9rem, 7vw, 2.8rem); text-transform: uppercase; letter-spacing: 1px; margin: 10px 0 6px; }
.won .result-title { color: var(--gold); }
.result-sub { color: #dce6f2; font-weight: 700; margin: 0 0 6px; }
.result-score { color: var(--muted); font-family: var(--led); font-weight: 700; margin: 0; }
.result-grid { font-size: 1.4rem; line-height: 1.4; margin: 14px 0; font-family: inherit; white-space: pre-wrap; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.result-next { color: var(--muted); font-size: .9rem; margin-top: 16px; }

/* ---------- Phone ---------- */
@media (max-width: 560px) {
  #app { padding: 10px 10px 32px; }
  .answers { grid-template-columns: 1fr; }
  .shots { gap: 6px; }
  .shot { padding: 10px 4px; }
  .shot-name { font-size: 1.2rem; }
  .shot-risk, .shot-meta { font-size: .7rem; }
  .sb-score { font-size: 1.25rem; }
  .sb-need { font-size: .95rem; }
  .sb-need strong { font-size: 1.2rem; }
  .chip { min-width: 28px; height: 28px; font-size: .85rem; }
  .match-head { font-size: .9rem; }
}
