/* The game is usable without animation; scene.js owns the ball and keeper transforms. */
:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #e9f1e8;
  color: #18342c;
  font-synthesis: none;
  line-height: 1.45;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .7; }
:focus-visible { outline: 3px solid #9b4200; outline-offset: 3px; }
.intro-card :focus-visible { outline-color: #ffdd72; }
h1, h2, h3, p { margin-top: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.28rem, 5vw, 1.7rem); line-height: 1.15; margin: 0; }
h2 { font-size: clamp(1.65rem, 7vw, 2.3rem); line-height: 1.18; margin-bottom: .7rem; }
h3 { font-size: 1.25rem; line-height: 1.25; margin-bottom: .5rem; }

.app-shell { width: min(100%, 750px); margin-inline: auto; padding: 0 clamp(.75rem, 3vw, 1.5rem) 2.5rem; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: 1.1rem 0 1.3rem; }
.site-header > * { max-width: 100%; }
.brand { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; min-width: 0; }
.brand-mark { display: block; width: 1.65rem; height: 1.65rem; flex: none; }
.sound-toggle { min-height: 44px; min-width: 44px; border: 2px solid #bfd5ca; border-radius: 999px; background: #fff; color: #153e30; padding: .55rem .85rem; font-size: .85rem; font-weight: 750; flex: 0 1 auto; overflow-wrap: anywhere; }
.sound-toggle[aria-pressed="true"] { background: #d5f2d7; border-color: #186c45; }
.screen { display: grid; gap: 1rem; min-width: 0; }
.screen > * { min-width: 0; }
.intro-card, .selection-card, .question-card, .results-card, .review-card { background: #fff; border-radius: 1.3rem; padding: clamp(1rem, 4vw, 1.6rem); box-shadow: 0 4px 18px #123d2410; }
.intro-card { background: #153d2c; color: #fff; padding-block: 1.7rem; }
.intro-card p:last-child { margin-bottom: 0; color: #e2f3e6; }
.eyebrow { text-transform: uppercase; font-size: .77rem; font-weight: 800; letter-spacing: .09em; color: #246849; margin-bottom: .5rem; }
.intro-card .eyebrow { color: #b9ee70; }

fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
legend { font-weight: 800; font-size: 1.12rem; margin-bottom: .85rem; }
.table-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.table-choice { position: relative; display: block; min-width: 0; }
.table-choice input { position: absolute; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.table-choice span { display: grid; place-items: center; min-height: 52px; border: 2px solid #adc8b9; border-radius: .8rem; background: #f4f8f4; color: #163c2d; font-size: 1.2rem; font-weight: 800; }
.table-choice input:checked + span { background: #17663e; color: #fff; border-color: #17663e; }
.table-choice input:focus-visible + span { outline: 3px solid #9b4200; outline-offset: 3px; }
.helper-text { color: #405d50; margin: .85rem 0 1rem; font-size: .94rem; }
.error-text { color: #a02720; font-weight: 700; margin: -.35rem 0 1rem; }
.button { display: inline-flex; justify-content: center; align-items: center; min-width: 0; min-height: 48px; width: 100%; border-radius: .85rem; border: 2px solid transparent; padding: .65rem 1rem; font-weight: 800; text-align: center; line-height: 1.25; overflow-wrap: anywhere; }
.button-primary { background: #f4c432; color: #263313; border-color: #cb9915; }
.button-primary:hover:not(:disabled) { background: #ffda5e; }
.button-secondary { background: #e8f5e4; color: #17472f; border-color: #81bb83; }
.button-quiet { background: transparent; color: #174b35; border-color: #7aab8c; }

.scoreboard { background: #102e28; color: #fff; border-radius: 1.3rem; padding: 1rem 1.2rem; }
.scoreboard-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem; }
.scoreboard-top p { min-width: 0; margin-bottom: .6rem; }
.mode-label { font-weight: 800; color: #d7f39c; }
.goals-label, .streak-label { font-weight: 650; }
.goals-label strong { font-size: 1.55rem; color: #ffdb69; margin-left: .3rem; }
#progress-label { display: block; font-weight: 700; margin-bottom: .25rem; }
#match-progress { display: block; width: 100%; height: 14px; border: 0; border-radius: 999px; overflow: hidden; background: #547468; accent-color: #e4c241; }
#match-progress::-webkit-progress-bar { background: #547468; border-radius: 999px; }
#match-progress::-webkit-progress-value { background: #f4c432; border-radius: 999px; }
#match-progress::-moz-progress-bar { background: #f4c432; border-radius: 999px; }
.streak-label { margin: .65rem 0 0; font-size: .92rem; }
.streak-label strong { color: #ffdb69; }

.pitch-card { background: #d7ecdc; border-radius: 1.3rem; padding: .55rem .55rem .75rem; text-align: center; overflow: hidden; }
.scene { display: block; width: 100%; height: auto; max-height: 290px; border-radius: .9rem; }
#scene-ball, #scene-keeper { transform-box: fill-box; transform-origin: center; }
.scene[data-outcome="goal"] #scene-ball { transform: translate(110px, -155px) scale(.65); }
.scene[data-outcome="goal"] #scene-keeper { transform: translate(-95px, 10px) rotate(-18deg); }
.scene[data-outcome="save"] #scene-ball { transform: translate(-35px, -55px); }
.scene[data-outcome="save"] #scene-keeper { transform: translate(10px, 20px); }
.scene[data-outcome="goal"] { outline: 5px solid #ffd447; outline-offset: -5px; }
.scene[data-outcome="save"] { outline: 5px solid #f8a65c; outline-offset: -5px; }
.scene-caption { font-weight: 750; margin: .55rem .4rem 0; overflow-wrap: anywhere; }
.celebration { color: #165934; font-weight: 850; margin: .3rem .4rem 0; }
.question-card .eyebrow { margin-bottom: .3rem; }
.question-card h2 { margin-bottom: 1rem; }
.answer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, max(6rem, calc((100% - .7rem) / 2))), 1fr)); gap: .7rem; }
.answer-button { min-width: 0; min-height: 72px; padding: .5rem; border: 2px solid #94bba5; border-radius: 1rem; background: #f3f9f3; color: #123d2a; font-size: clamp(1.55rem, 7vw, 2.25rem); font-weight: 850; line-height: 1.1; }
.answer-button:hover:not(:disabled) { background: #ddf2df; border-color: #17663e; }
.answer-button.is-correct, .answer-button.is-correct:disabled { border-color: #0f6338; background: #d4f3d8; color: #10422b; opacity: 1; }
.answer-button.is-incorrect, .answer-button.is-incorrect:disabled { border-color: #ae3931; background: #ffe3dd; color: #852b25; opacity: 1; }
.feedback-panel { margin-top: 1rem; padding: 1rem; background: #eef5e8; border-left: 5px solid #2d7b48; border-radius: .7rem; overflow-wrap: anywhere; }
.feedback-panel p { margin-bottom: .65rem; }
.feedback-panel p:empty { display: none; }
.feedback-panel .button { margin-top: .4rem; }

.results-summary { font-size: clamp(1.4rem, 6vw, 2rem); font-weight: 850; color: #175a38; margin-bottom: .5rem; }
.results-badge { display: inline-block; padding: .65rem 1rem; border-radius: 999px; background: #ffe592; color: #413009; font-weight: 850; font-size: 1.2rem; }
.results-message { font-weight: 700; }
.results-record { margin: .8rem 0 0; font-weight: 750; color: #175a38; }
.results-streak { margin-bottom: 0; }
.review-card ul { padding-left: 1.4rem; margin: .75rem 0 1rem; overflow-wrap: anywhere; }
.review-card li + li { margin-top: .45rem; }
.results-actions { display: grid; gap: .65rem; }
.noscript { background: #fff6db; border-radius: .8rem; padding: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 480px) {
  .site-header { align-items: flex-start; }
  .sound-toggle { white-space: normal; padding: .4rem .5rem; }
  .table-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 4rem), 1fr)); gap: .35rem; }
  .table-choice span { min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
