:root { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: #26394b; background: #fff9ec; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; min-width: 64px; min-height: 64px; border: 2px solid #63758a; border-radius: 22px; background: #fff; touch-action: manipulation; }
button:focus-visible, [tabindex="-1"]:focus-visible { outline: 4px solid #733daf; outline-offset: 4px; }
button:hover { border-color: #26394b; }
button:active { transform: scale(.98); }
button:disabled { cursor: default; opacity: 1; }
[hidden] { display: none !important; }
main { width: min(100%, 760px); margin: auto; padding: 20px 16px; }
h1, p { margin: 0; }
h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.5; }
p { font-size: 20px; line-height: 1.7; }
.welcome, .finish { text-align: center; padding-top: 30px; }
.eyebrow { font-size: 18px; color: #536445; margin-bottom: 8px; }
.welcome > p { margin: 12px 0 24px; }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.mode { display: flex; align-items: center; flex-direction: column; padding: 22px 10px; box-shadow: 0 6px 0 #d9d0bb; }
.mode svg { width: 112px; height: 112px; }
.mode span { font-size: 32px; font-weight: 800; }
.mode small { font-size: 20px; margin-top: 12px; letter-spacing: 6px; }
.colors { background: #fff0da; }
.shapes { background: #e9f1ff; }
.welcome .footnote { font-size: 14px; margin-top: 32px; }
header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.home-control { padding: 8px 16px; font-size: 20px; }
.mode-name { font-size: 24px; font-weight: 700; }
.dots { display: flex; justify-content: center; gap: 16px; margin: 16px 0; }
.dot { width: 22px; height: 22px; border: 2px solid #657386; border-radius: 50%; background: white; font-size: 15px; font-weight: bold; display: grid; place-items: center; }
.dot.filled { background: #286645; border-color: #286645; color: #fff; }
.prompt { text-align: center; font-size: 26px; }
.target { width: 144px; height: 144px; padding: 10px; margin: 12px auto 20px; border: 2px dashed #8a795b; border-radius: 28px; background: #fffdf7; }
svg { width: 100%; height: 100%; display: block; }
.answers { display: grid; grid-template-columns: repeat(3, minmax(96px, 1fr)); gap: 16px; }
.answer { min-width: 96px; min-height: 96px; height: clamp(96px, 17vw, 130px); padding: 12px; box-shadow: 0 4px 0 #d9d0bb; }
.feedback-area { min-height: 124px; text-align: center; padding-top: 16px; }
#feedback { min-height: 36px; font-weight: 800; font-size: 24px; }
.primary { background: #263f70; color: #fff; border-color: #263f70; font-size: 24px; font-weight: 700; padding: 10px 28px; }
#next { margin-top: 8px; min-width: 160px; }
.celebration { width: 150px; height: 150px; margin: 0 auto 16px; }
.finish-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 28px; }
.finish-actions button { min-height: 80px; min-width: 180px; }
@media (max-height: 500px) and (orientation: landscape) {
  main { padding-top: 12px; padding-bottom: 12px; }
  .game { display: grid; grid-template-columns: 150px minmax(0, 1fr); column-gap: 20px; }
  header { grid-column: 1 / -1; }
  .dots { grid-column: 2; grid-row: 2; margin: 12px 0; }
  .prompt { grid-column: 1; grid-row: 2; font-size: 20px; align-self: center; }
  .target { grid-column: 1; grid-row: 3; width: 120px; height: 120px; margin: 0 auto; }
  .answers { grid-column: 2; grid-row: 3; align-self: center; }
  .answer { height: 96px; }
  .feedback-area { grid-column: 1 / -1; min-height: 72px; display: flex; justify-content: center; align-items: center; gap: 16px; padding-top: 12px; }
  #next { margin-top: 0; }
  .welcome, .finish { padding-top: 0; }
  .mode { flex-direction: row; justify-content: center; gap: 16px; padding: 12px; }
  .mode svg { width: 72px; height: 72px; }
  .mode small { display: none; }
  .celebration { width: 80px; height: 80px; margin-bottom: 0; }
  .finish-actions { margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } button:active { transform: none; } }

/* sound tools, feedback animations */
.sound-tools { display: flex; gap: 10px; }
.sound-control { min-width: 56px; min-height: 56px; border-radius: 28px; font-size: 26px; padding: 4px 10px; }
.answer.sparkle { animation: cs-pop .6s ease; box-shadow: 0 0 0 6px #ffd044, 0 0 24px 8px #fff6; }
.answer.wobble { animation: cs-wob .45s ease; }
@keyframes cs-pop { 0% { transform: scale(1); } 40% { transform: scale(1.15) rotate(-3deg); } 100% { transform: scale(1); } }
@keyframes cs-wob { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .answer.sparkle, .answer.wobble { animation: none; } }
