/* Sticker Pop theme: lilac ground, ink outlines, hard offset shadows. */
:root {
  --ground: #EEE7FF;
  --card: #FFFFFF;
  --ink: #141218;
  --ink-soft: #4A4458;
  --orange: #FF7A1A;
  --cyan: #4CC9F0;
  --lime: #B9F227;
  --pink: #FF5CA8;
  --wrong: #FF8A8A;
  --display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 16px;
  --line: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  -webkit-tap-highlight-color: transparent;
}

#app {
  min-height: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

h1, h2 { margin: 0; font-family: var(--display); font-weight: 400; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }

.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; }
.muted { color: var(--ink-soft); }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }

/* Stickers and cards */
.sticker {
  display: inline-block;
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 4px 14px;
  font-family: var(--display);
}
.card {
  background: var(--card);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 12px 14px;
}

.wordmark { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 8px; }
.wordmark .sticker { font-size: 44px; line-height: 1.1; }
.wordmark .a { background: var(--orange); transform: rotate(-3deg); }
.wordmark .b { background: var(--card); transform: rotate(2deg); margin-left: 40px; }

.badge {
  width: 40px; height: 40px; flex: none;
  border: var(--line); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 19px;
}
.tilt-0 { transform: rotate(-6deg); }
.tilt-1 { transform: rotate(5deg); }
.tilt-2 { transform: rotate(-4deg); }
.tilt-3 { transform: rotate(6deg); }

.player-name { flex: 1; font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.player-main { flex: 1; min-width: 0; }
.player-age { font-size: 14px; font-weight: 700; }
.level-select { width: auto; min-width: 118px; min-height: 40px; padding: 4px 8px; font-size: 15px; font-weight: 700; }
.age-pill { font-size: 14px; font-weight: 700; background: var(--ground); border-radius: 8px; padding: 3px 8px; }

/* Buttons */
button, .btn {
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.btn {
  min-height: 64px;
  width: 100%;
  border: var(--line);
  border-radius: var(--radius);
  background: var(--orange);
  box-shadow: var(--shadow);
  font-family: var(--display);
  font-size: 26px;
  text-transform: uppercase;
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.btn:active, .choice:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn.secondary { background: var(--card); font-size: 20px; min-height: 52px; }
.btn.good { background: var(--lime); }
.btn.bad { background: var(--wrong); }
.btn:disabled { opacity: 0.5; cursor: default; }
.link-btn {
  background: none; border: none; padding: 8px; font-weight: 700; text-decoration: underline;
  text-underline-offset: 3px; align-self: center; min-height: 44px;
}
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

/* Question screen */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chip { border: var(--line); border-radius: 12px; padding: 5px 12px; font-weight: 800; font-size: 15px; }
.timer {
  width: 56px; height: 56px; flex: none; border-radius: 50%;
  border: var(--line); background: var(--card); box-shadow: 3px 3px 0 var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums;
}
.timer.low { background: var(--wrong); }
.question {
  background: var(--card); border: var(--line); border-radius: 20px; box-shadow: 6px 6px 0 var(--ink);
  padding: 28px 22px; min-height: 170px; display: flex; align-items: center;
  font-family: var(--body); font-size: 27px; font-weight: 800; line-height: 1.22; overflow-wrap: anywhere;
}
.choices { display: flex; flex-direction: column; gap: 12px; }
.choice {
  min-height: 58px; width: 100%; padding: 10px 16px;
  border: var(--line); border-radius: 14px; background: var(--card); box-shadow: 4px 4px 0 var(--ink);
  font-size: 20px; font-weight: 800; text-align: center;
}
.choice.picked { background: var(--cyan); }
.choice.correct { background: var(--lime); }
.choice.wrong { background: var(--wrong); }
.choice:disabled { cursor: default; }
.answer-reveal { font-size: 22px; font-weight: 800; }

/* Round setup */
.setup { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grade { display: inline-flex; gap: 4px; }
.grade i { width: 10px; height: 10px; border-radius: 3px; border: 2px solid var(--ink); background: var(--card); }
.grade i.on { background: var(--orange); }

/* Pass screen */
.pass { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; }
.pass .badge { width: 96px; height: 96px; border-radius: 22px; font-size: 48px; }
.pass h1 { font-size: 44px; }

/* Scoreboard */
.leader { display: flex; align-items: center; gap: 12px; }
.leader .rank { font-family: var(--display); font-size: 24px; width: 28px; }
.leader .score { font-family: var(--display); font-size: 28px; font-variant-numeric: tabular-nums; }
.leader.first { background: var(--lime); box-shadow: var(--shadow); padding: 14px; }

/* Settings */
label { font-weight: 700; font-size: 15px; }
input, select {
  font: inherit; width: 100%; min-height: 48px; padding: 8px 12px;
  border: var(--line); border-radius: 12px; background: var(--card); color: var(--ink);
}
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 10px; align-items: center; }
.player-edit { display: grid; grid-template-columns: 40px minmax(0, 1fr) 110px; gap: 10px; align-items: center; }
.notice { background: var(--card); border: var(--line); border-radius: 12px; padding: 10px 12px; font-size: 15px; }
.notice.error { background: var(--wrong); }

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

/* Home: how to play */
.mode { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 16px; }
.mode:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.mode-dot { width: 22px; height: 22px; flex: none; border: var(--line); border-radius: 50%; }
.mode-title { font-family: var(--display); font-size: 24px; }
.mode-text { font-size: 15px; font-weight: 600; }

/* Judging a spoken answer */
.judge-q { font-weight: 800; text-align: center; }
.judge { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.judge-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 120px; border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  font-family: var(--display); font-size: 26px; color: var(--ink); cursor: pointer;
}
.judge-btn small { font-family: var(--body); font-size: 14px; font-weight: 700; }
.judge-btn .judge-icon { font-size: 44px; line-height: 1; }
.judge-btn.yes { background: #3DDC84; }
.judge-btn.no { background: #FF5C5C; }
.judge-btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.judge-btn:disabled { opacity: 0.5; }

/* Penalty shootout */
.goal {
  display: grid; grid-template-columns: repeat(3, 1fr); height: 140px;
  border: 6px solid var(--ink); border-bottom: none; border-radius: 10px 10px 0 0;
  background: repeating-linear-gradient(45deg, #fff 0 8px, #e9e3f7 8px 16px);
}
.goal-zone {
  border: none; border-right: 2px dashed rgba(20, 18, 24, 0.25); background: transparent;
  font-size: 44px; cursor: pointer; color: var(--ink);
}
.goal-zone:last-child { border-right: none; }
.goal-zone:active { background: rgba(76, 201, 240, 0.35); }
.goal-zone.scored { background: rgba(61, 220, 132, 0.45); }
.goal-zone.saved { background: rgba(255, 92, 92, 0.45); }
.goal-zone:disabled { cursor: default; }
.goal.ready { box-shadow: 0 0 0 4px var(--lime); }
.ready-line { font-weight: 800; margin: 0; }
.penalty-spot { text-align: center; font-size: 34px; height: 40px; margin: -6px 0 0; }
.kick-tally { display: flex; gap: 10px; font-size: 28px; margin: 0; }

/* 1v1 challenges */
.duel-card { border-color: var(--ink); background: #FFF4D6; }
.duel-vs { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: center; }
.duel-vs > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.duel-vs .kick-tally { font-size: 22px; gap: 6px; }
.duel-x { font-family: var(--display); font-size: 28px; color: var(--pink); }
.duel-chip { background: var(--pink); color: #fff; }
.zap-chip { background: var(--orange); }
.zap-card { background: #FFF4D6; }
.challenge-chip { background: var(--card); cursor: pointer; font: inherit; font-weight: 800; }

/* Basketball */
.hoop-bar { position: relative; height: 56px; border: var(--line); border-radius: 28px; background: var(--card); overflow: hidden; }
.hoop-zone { position: absolute; left: 40%; width: 20%; top: 0; bottom: 0; background: rgba(61, 220, 132, 0.55); }
.hoop-ball { position: absolute; top: 50%; font-size: 34px; transform: translate(-50%, -50%); }

/* Whack-a-mole */
.moles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mole-hole {
  aspect-ratio: 1; border: var(--line); border-radius: 50%; background: #5B3A29; overflow: hidden;
  font-size: 40px; cursor: pointer; padding: 0; touch-action: manipulation;
}
.mole-hole span { display: inline-block; transform: translateY(200%); transition: transform 0.08s; }
.mole-hole.up span { transform: translateY(0); }

/* Prize wheel */
.wheel-wrap { position: relative; width: 240px; height: 240px; align-self: center; margin-top: 14px; }
.wheel {
  width: 100%; height: 100%; border-radius: 50%; border: 6px solid var(--ink); position: relative;
  transition: transform 3s cubic-bezier(0.15, 0.8, 0.2, 1);
}
.wheel span {
  position: absolute; left: 50%; top: 50%; width: 30px; margin: -15px 0 0 -15px; text-align: center;
  font-family: var(--display); font-size: 26px;
}
.wheel-pointer { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 30px; z-index: 1; }
.duel-score { font-family: var(--display); font-size: 30px; }

/* Picture questions */
.pic { border: var(--line); border-radius: 16px; overflow: hidden; background: var(--card); aspect-ratio: 4 / 3; box-shadow: 4px 4px 0 var(--ink); }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hum-card { background: #E4F9FF; }
.check-row { display: flex; gap: 12px; align-items: center; font-weight: 800; }
.check-row input { width: 26px; height: 26px; accent-color: var(--orange); }
.my-score { background: var(--card); margin-left: auto; margin-right: 8px; }
.my-score b { font-family: var(--display); font-size: 17px; }
.my-score { white-space: normal; text-align: right; max-width: 70%; }
.my-score span { white-space: nowrap; }
.my-score .me { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--lime); }

.remove-btn { flex: none; width: 36px; height: 36px; border: var(--line); border-radius: 50%; background: var(--card); font-weight: 800; cursor: pointer; }
.player-add { display: grid; grid-template-columns: 40px minmax(0, 1fr) 92px auto; gap: 8px; align-items: center; }
.player-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.player-picks select { min-height: 44px; padding: 4px 8px; font-size: 15px; font-weight: 700; }
.player-picks select:nth-child(2) { grid-column: 2; }
.player-picks select:last-child { grid-column: 1 / -1; }
