:root {
  --cream: #f4efe4;
  --cream-deep: #e7dcc8;
  --paper: #fffaf3;
  --ink: #17261f;
  --forest: #1b4332;
  --forest-soft: #2c5a44;
  --clay: #c4623a;
  --clay-deep: #8e3e24;
  --line: #f7f3ea;
  --red-ball: #e24b3b;
  --orange-ball: #ef7d2a;
  --green-ball: #3f8f4c;
  --yellow-ball: #d6e35c;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Liberation Serif", serif;
  --sans: "Avenir Next", "Segoe UI", "Liberation Sans", "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 16px 36px rgba(23, 38, 31, 0.14);
  --app-h: 100dvh;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  height: 100%;
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(255, 252, 245, 0.95), transparent 56%),
    linear-gradient(180deg, #f7f3ea 0%, #ebe2d2 100%);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--sans);
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button, input { font: inherit; }

a { color: var(--clay-deep); }

img { max-width: 100%; }

h1, h2, p { margin: 0; }

.escape {
  display: none;
}

html.is-framed .escape {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 40px;
  margin: 0 0 8px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--cream);
  text-decoration: none;
  font: 700 12px/1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.escape:focus-visible,
.brand a:focus-visible,
.pick:focus-visible,
.answer:focus-visible,
.serve:focus-visible,
.mute:focus-visible,
.ghost:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--clay);
  outline-offset: 2px;
}

.app {
  width: min(520px, 100%);
  margin: 0 auto;
  padding:
    max(12px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
}

.letterhead {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 64px;
  height: 64px;
  flex: none;
  display: block;
}

.brand-name {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--forest-soft);
  font-weight: 750;
  text-decoration: none;
}

.brand-sub,
.letterhead h1,
.quiz-title {
  font-family: var(--serif);
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--forest);
  line-height: 0.95;
}

.brand-sub { font-size: clamp(28px, 6vw, 36px); }
.letterhead h1 { font-size: clamp(20px, 4.8vw, 30px); }

.scoreboard {
  text-align: right;
  min-width: 72px;
  flex: none;
}

.score-kicker,
.best-line {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--forest-soft);
}

.score-num {
  font-family: var(--serif);
  font-size: clamp(36px, 8vw, 56px);
  line-height: 0.82;
  color: var(--forest);
  font-variant-numeric: tabular-nums;
}

.score-num.pop { animation: pop 220ms ease-out; }

.best-line strong {
  color: var(--clay-deep);
  font-variant-numeric: tabular-nums;
}

.best-line strong.fresh { color: var(--clay); }

.lives {
  margin-top: 2px;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--clay);
  line-height: 1;
}

body.hotshots {
  --clay: #C15A26;
  --clay-deep: #9a3e16;
  --forest: #2A4A38;
  --forest-soft: #3d6550;
  --cream: #f4efe4;
}

body.hotshots .stage {
  background: #f4efe4;
  box-shadow: 0 0 0 2px #2A4A38, 0 0 0 7px #C15A26, var(--shadow);
}

.mute {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--forest);
  background: transparent;
  color: var(--forest);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.mute .slash { display: none; }
.mute[aria-pressed="true"] { background: var(--forest); color: var(--cream); }
.mute[aria-pressed="true"] .waves { display: none; }
.mute[aria-pressed="true"] .slash { display: inline; }

.lede {
  margin: 8px 0 0;
  max-width: 38ch;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
}

.section-label {
  margin: 22px 0 8px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--clay-deep);
}

.section-lead {
  margin: -2px 0 10px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--forest-soft);
  max-width: 42ch;
}

.stack { display: grid; gap: 10px; }

.pick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 104px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 250, 243, 0.92);
  border: 1.5px solid var(--forest);
  box-shadow: 0 8px 20px rgba(23, 38, 31, 0.06);
  color: inherit;
  text-decoration: none;
}

.pick:active { transform: translateY(1px); }

.pip {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  box-shadow: inset 0 -6px 0 rgba(23, 38, 31, 0.15), 0 0 0 2px rgba(255, 248, 240, 0.7);
}

.pip-red { background: radial-gradient(circle at 35% 35%, #ffb1a8, var(--red-ball) 55%, #a72c22); }
.pip-orange { background: radial-gradient(circle at 35% 35%, #ffd0a4, var(--orange-ball) 55%, #b55212); }
.pip-green { background: radial-gradient(circle at 35% 35%, #c6e6b4, var(--green-ball) 55%, #215c30); }
.pip-match { background: radial-gradient(circle at 35% 35%, #f7f8c9, var(--yellow-ball) 55%, #8ea332); }
.pip-rally, .pip-serve, .pip-bounce, .pip-baseline {
  background:
    radial-gradient(circle at 50% 45%, transparent 0 42%, rgba(244, 239, 228, 0.95) 43% 48%, transparent 49%),
    linear-gradient(180deg, #2f6a4c, #1b4332);
  box-shadow: inset 0 0 0 2px var(--clay), 0 0 0 2px var(--forest);
}
.pip-volley {
  background: linear-gradient(90deg, #c4623a 0 50%, #1b4332 50% 100%);
  box-shadow: inset 0 0 0 2px #f4efe4, 0 0 0 2px var(--forest);
}
.pip-return {
  background: linear-gradient(180deg, #d6e35c 0 42%, #1b4332 42% 100%);
  box-shadow: inset 0 0 0 2px #f4efe4, 0 0 0 2px var(--forest);
}
.pip-hotshots {
  background:
    radial-gradient(circle at 50% 46%, #f4efe4 0 16%, transparent 17%),
    conic-gradient(from 210deg, #C15A26, #2A4A38 45%, #C15A26 80%, #2A4A38);
  box-shadow: inset 0 0 0 3px #f4efe4, 0 0 0 2px #2A4A38;
}

.pip-crawl {
  background:
    radial-gradient(circle at 50% 30%, #17261f 0 6px, transparent 7px),
    linear-gradient(#2A4A38, #2A4A38) 34% 72% / 7px 18px no-repeat,
    linear-gradient(#2A4A38, #2A4A38) 62% 72% / 7px 18px no-repeat,
    linear-gradient(#C15A26, #C15A26) 50% 52% / 16px 16px no-repeat,
    #f4efe4;
  box-shadow: inset 0 0 0 2px #2A4A38, 0 0 0 2px #C15A26;
}

.pip-dash {
  background:
    linear-gradient(#f4efe4, #f4efe4) 22% 78% / 4px 46% no-repeat,
    linear-gradient(#f4efe4, #f4efe4) 50% 78% / 4px 46% no-repeat,
    linear-gradient(#f4efe4, #f4efe4) 78% 78% / 4px 46% no-repeat,
    linear-gradient(#d6e35c, #d6e35c) 50% 42% / 8px 8px no-repeat,
    linear-gradient(180deg, #d5e3da 0 46%, #C15A26 46% 100%);
  box-shadow: inset 0 0 0 2px #2A4A38, 0 0 0 2px #C15A26;
}

.pick-kicker {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest-soft);
  font-weight: 750;
}

.pick-title {
  display: block;
  margin-top: 1px;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--forest);
}

.pick-blurb {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink);
}

.pick-best {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clay-deep);
  font-weight: 750;
}

.foot {
  margin-top: 22px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--forest-soft);
}

.foot a { color: var(--clay-deep); }

body.hub { overflow: auto; }

html.is-framed body.hub,
html.is-framed body.play,
html.is-framed body.quiz {
  height: var(--app-h);
  max-height: 100%;
  overflow: hidden;
}

html.is-framed body.hub .app,
html.is-framed body.play .app,
html.is-framed body.quiz .app {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: max(8px, env(safe-area-inset-top));
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

html.is-framed .brand img { width: 40px; height: 40px; }
html.is-framed .letterhead h1,
html.is-framed .brand-sub { font-size: 24px; }
html.is-framed .lede,
html.is-framed .pick-blurb,
html.is-framed .pick-kicker,
html.is-framed .section-lead { display: none; }
html.is-framed .section-label { margin: 4px 0; font-size: 16px; }
html.is-framed .pick {
  min-height: 68px;
  padding: 8px 10px;
  gap: 10px;
  border-radius: 14px;
  align-items: center;
}
html.is-framed .pick-best { margin-top: 2px; }
html.is-framed .pip { width: 28px; height: 28px; }
html.is-framed .pick-title { font-size: 20px; margin: 0; }
html.is-framed .stack { gap: 5px; }
html.is-framed .foot { display: none; }
html.is-framed body.hub .app { overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

body.play,
body.quiz {
  height: var(--app-h);
  max-height: 100%;
  overflow: hidden;
}

body.play {
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

body.play .app,
body.quiz .app {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.pace {
  height: 4px;
  margin: 8px 0;
  border-radius: 99px;
  background: rgba(27, 67, 50, 0.12);
  overflow: hidden;
  flex: none;
}

.pace > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--forest), var(--clay));
  transition: width 160ms linear;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 180px;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--forest), 0 0 0 7px var(--clay), var(--shadow);
  background: #234e39;
  touch-action: none;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.card {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: rgba(244, 239, 228, 0.96);
  border: 1.5px solid var(--forest);
  box-shadow: var(--shadow);
  animation: rise 240ms ease-out;
}

.card[hidden] { display: none !important; }

.card-kicker,
.quiz-count,
.over-form label,
.board-form label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest-soft);
  font-weight: 750;
}

.card-title {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: clamp(30px, 8vw, 42px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--clay-deep);
}

.card-body,
.quiz-lead,
.feedback,
.board-status,
.over-note,
.board-note {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.35;
}

.card-extra {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--forest);
}

.card-extra:empty,
.over-note:empty,
.board-note:empty,
.board-status:empty,
.feedback:empty { display: none; }

.serve,
.ghost,
.board-refresh,
#board-post,
.over-row button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.serve {
  margin-top: 12px;
  width: 100%;
  min-height: 48px;
  background: var(--clay-deep);
  color: #fff8f1;
  font: 700 15px/1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.serve:active { transform: translateY(1px); }
.serve[hidden] { display: none !important; }

.ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
  background: transparent;
  color: var(--forest);
  border: 1.5px solid var(--forest);
  text-decoration: none;
  font: 700 13px/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hint {
  flex: none;
  margin: 8px 4px 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.3;
  color: var(--forest);
}

.board {
  flex: none;
  margin-top: 8px;
  border: 1.5px solid var(--forest);
  border-radius: 16px;
  background: rgba(244, 239, 228, 0.94);
  padding: 8px 12px 10px;
}

.board > summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.board > summary::-webkit-details-marker { display: none; }

.board-title {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--forest);
}

.board-count {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay-deep);
  font-weight: 750;
}

.board-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.board-kicker { font-size: 12px; color: var(--forest-soft); }

.board-refresh,
#board-post,
.over-row button {
  background: var(--forest);
  color: var(--cream);
  font: 700 12px/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 44px;
  padding: 0 12px;
}

.board-refresh {
  min-height: 32px;
  background: transparent;
  color: var(--forest);
  border: 1.5px solid var(--forest);
}

.board-list {
  list-style: none;
  margin: 8px 0;
  padding: 0;
}

.board-list li {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  padding: 4px 2px;
  font-size: 15px;
}

.board-list .rank { color: var(--clay-deep); font-weight: 750; font-variant-numeric: tabular-nums; }
.board-list .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--forest); }
.board-list .pts { font-family: var(--serif); font-variant-numeric: tabular-nums; }
.board-list li.mine { background: rgba(196, 98, 58, 0.14); border-radius: 8px; }

.desk-line { margin: 2px 0 0; font-size: 12px; color: var(--forest-soft); }

.over-form { margin-top: 10px; }
.over-form[hidden] { display: none !important; }

.over-row,
.board-row { display: flex; gap: 8px; margin-top: 6px; }

.over-row input,
.board-row input,
.desk input {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 44px;
  border: 1.5px solid var(--forest);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 600 16px/1 var(--sans);
  padding: 0 14px;
}

.over-row button:disabled,
#board-post:disabled { opacity: 0.45; cursor: default; }

html.is-framed .hint { margin-top: 4px; font-size: 12px; }
html.is-framed .score-num { font-size: 32px; }
html.is-framed .board-kicker,
html.is-framed .desk-line { display: none; }
html.is-framed .board[open] {
  max-height: 38%;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
html.is-framed .card { padding: 10px 12px; }
html.is-framed .card-title { font-size: 28px; }
html.is-framed .serve { min-height: 44px; margin-top: 8px; }

.quiz-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.quiz-panel { position: relative; animation: rise 220ms ease-out; }

.art-frame { margin: 4px 0 8px; }
.art-frame svg { display: block; width: 100%; height: auto; max-height: 180px; }

.quiz-prompt {
  font-family: var(--serif);
  font-size: clamp(22px, 5.4vw, 30px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--forest);
}

.answers { margin-top: 4px; }

.answer {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 52px;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--forest);
  background: var(--paper);
  color: var(--ink);
  font: 650 16px/1.25 var(--sans);
  cursor: pointer;
}

.answer:active { transform: translateY(1px); }
.answer.correct { background: var(--forest); color: var(--cream); border-color: var(--forest); }
.answer.wrong { background: var(--clay-deep); color: #fff8f1; border-color: var(--clay-deep); }
.answer.show-right { background: #e4f0e6; }
.answer:disabled { cursor: default; }

.feedback.good { color: var(--forest); font-weight: 650; }
.feedback.bad { color: var(--clay-deep); font-weight: 650; }

.result-score {
  font-family: var(--serif);
  font-size: 72px;
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--forest);
  font-variant-numeric: tabular-nums;
}

.result-score span {
  font-size: 0.45em;
  color: var(--clay-deep);
}

.quiz-best { margin-top: 8px; color: var(--clay-deep); font-weight: 700; }

.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: fall 980ms ease-in forwards;
}

html.is-framed .art-frame svg { max-height: 84px; }
html.is-framed .quiz-prompt { font-size: 21px; }
html.is-framed .answer { min-height: 46px; margin-top: 6px; }
html.is-framed .result-score { font-size: 56px; }

body.desk { overflow: auto; }
body.desk .app { padding-bottom: 48px; }
body.desk h1 { font-family: var(--serif); font-size: 40px; color: var(--forest); letter-spacing: -0.03em; line-height: 0.95; }
body.desk h2 { margin: 22px 0 8px; font-family: var(--serif); font-size: 22px; color: var(--forest); }
body.desk .program { margin-top: 4px; font-family: var(--serif); font-style: italic; color: var(--clay-deep); }
body.desk .game-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
body.desk .game-tabs button {
  min-height: 36px;
  border-radius: 999px;
  border: 1.5px solid var(--forest);
  background: transparent;
  color: var(--forest);
  padding: 0 12px;
  font: 700 12px/1 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
body.desk .game-tabs button.on { background: var(--forest); color: var(--cream); }
body.desk label {
  display: block;
  margin-top: 16px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest-soft);
  font-weight: 750;
}
body.desk .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
body.desk .actions .serve,
body.desk .actions .ghost { width: auto; margin-top: 0; padding: 0 14px; }
body.desk ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--forest);
  border-radius: 16px;
  background: rgba(244, 239, 228, 0.92);
}
body.desk li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(27, 67, 50, 0.12);
}
body.desk li:last-child { border-bottom: 0; }
body.desk li.empty { display: block; color: var(--forest-soft); }
body.desk li button {
  flex: none;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--clay-deep);
  color: #fff8f1;
  padding: 0 12px;
  font: 700 12px/1 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
body.desk #desk-status { min-height: 1.4em; margin-top: 12px; color: var(--forest); font-weight: 700; }

body.embed { overflow: auto; }
body.embed .app { width: min(760px, 100%); }
body.embed h1 { font-family: var(--serif); font-size: clamp(32px, 6vw, 46px); color: var(--forest); letter-spacing: -0.03em; }
body.embed h2 { margin: 26px 0 8px; font-family: var(--serif); font-size: 28px; color: var(--forest); }
body.embed p { margin-top: 8px; line-height: 1.45; }
body.embed textarea {
  width: 100%;
  margin-top: 10px;
  min-height: 180px;
  border: 1.5px solid var(--forest);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  font: 13px/1.45 ui-monospace, "SFMono-Regular", Consolas, monospace;
  padding: 12px;
  user-select: text;
}
.phone-preview {
  width: min(390px, 100%);
  margin: 14px auto 0;
  border: 2px solid var(--forest);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--forest);
}
.phone-preview iframe {
  display: block;
  width: 100%;
  height: min(70dvh, 560px);
  border: 0;
  background: var(--cream);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noscript {
  margin: 16px;
  padding: 12px 14px;
  background: var(--cream);
  border: 1.5px solid var(--forest);
  border-radius: 12px;
}

input, textarea, a, label { user-select: text; }

@media (min-width: 900px) {
  html {
    background:
      linear-gradient(90deg, rgba(27, 67, 50, 0.08), transparent 16%, transparent 84%, rgba(196, 98, 58, 0.12)),
      linear-gradient(180deg, #f7f3ea 0%, #ebe2d2 100%);
  }
}

@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); color: var(--clay-deep); }
  100% { transform: scale(1); }
}

@keyframes rise {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes fall {
  to { transform: translateY(280px) rotate(160deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .score-num.pop,
  .card,
  .quiz-panel,
  .confetti i { animation: none; }
  .pace > span { transition: none; }
}

body.crawl {
  --clay: #C15A26;
  --clay-deep: #9a3e16;
  --forest: #2A4A38;
  --forest-soft: #3d6550;
  --cream: #f4efe4;
  position: fixed;
  inset: 0;
  width: 100%;
  overscroll-behavior: none;
}

body.crawl .stage {
  background: #e7efe8;
  box-shadow: 0 0 0 2px #2A4A38, 0 0 0 7px #C15A26, var(--shadow);
  cursor: default;
}

body.crawl .crawl-field {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 8px;
}

body.crawl .stage { grid-column: 1 / -1; grid-row: 1; }

body.crawl .pad {
  appearance: none;
  border: 2px solid var(--forest);
  border-radius: 16px;
  background: rgba(255, 250, 243, 0.96);
  color: var(--forest);
  min-height: 64px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

body.crawl .pad b {
  font-family: var(--serif);
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 700;
  line-height: 0.9;
}

body.crawl .pad small {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.crawl .pad-q,
body.crawl .pad-w { border-color: #2A4A38; }
body.crawl .pad-o,
body.crawl .pad-p { border-color: #C15A26; color: #9a3e16; }

body.crawl .pad-q.is-down,
body.crawl .pad-w.is-down {
  background: #2A4A38;
  color: #f4efe4;
}

body.crawl .pad-o.is-down,
body.crawl .pad-p.is-down {
  background: #C15A26;
  color: #fff8f1;
  border-color: #C15A26;
}

body.crawl .pad-q { grid-column: 1; grid-row: 2; }
body.crawl .pad-o { grid-column: 2; grid-row: 2; }
body.crawl .pad-w { grid-column: 1; grid-row: 3; }
body.crawl .pad-p { grid-column: 2; grid-row: 3; }

body.crawl .card {
  max-height: 54%;
  overflow: auto;
}

body.crawl .card-title { font-size: clamp(26px, 7vw, 36px); }
body.crawl .card-body { margin-top: 4px; }
body.crawl .serve { margin-top: 8px; min-height: 44px; }

body.crawl .coach-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

body.crawl .coach-pick {
  appearance: none;
  border: 1.5px solid var(--forest);
  background: transparent;
  color: var(--forest);
  border-radius: 12px;
  min-height: 52px;
  padding: 6px 4px;
  cursor: pointer;
}

body.crawl .coach-pick strong {
  display: block;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

body.crawl .coach-pick span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 750;
}

body.crawl .coach-pick[data-coach="huk"].on { background: #2A4A38; color: #f4efe4; border-color: #2A4A38; }
body.crawl .coach-pick[data-coach="daiki"].on { background: #1c1c1c; color: #f4efe4; border-color: #1c1c1c; }
body.crawl .coach-pick[data-coach="rhys"].on { background: #C15A26; color: #fff8f1; border-color: #C15A26; }

body.crawl .pace > span.hot { background: var(--clay); }

body.dash {
  --clay: #C15A26;
  --clay-deep: #9a3e16;
  --forest: #2A4A38;
  --forest-soft: #3d6550;
  --cream: #f4efe4;
}

body.dash .stage {
  background: #d5e3da;
  box-shadow: 0 0 0 2px #2A4A38, 0 0 0 7px #C15A26, var(--shadow);
  cursor: default;
  touch-action: none;
}

@media (max-height: 540px) and (orientation: landscape) {
  body.crawl .app { width: 100%; }

  body.crawl .crawl-field {
    grid-template-columns: 92px minmax(0, 1fr) 92px;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }

  body.crawl .stage {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  body.crawl .pad-q { grid-column: 1; grid-row: 1; }
  body.crawl .pad-w { grid-column: 1; grid-row: 2; }
  body.crawl .pad-o { grid-column: 3; grid-row: 1; }
  body.crawl .pad-p { grid-column: 3; grid-row: 2; }
  body.crawl .pad { min-height: 0; border-radius: 14px; }
  body.crawl .card {
    left: auto;
    top: 8px;
    bottom: 8px;
    width: min(300px, 48%);
    overflow: auto;
  }
}
