:root { font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; color: #17233a; background: #f4f7fb; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select { font: inherit; }
button { min-height: 56px; border: 0; border-radius: 12px; padding: .7rem 1.1rem; background: #1769e0; color: white; font-weight: 700; cursor: pointer; }
button.secondary { background: #e4ebf7; color: #17233a; }
button.danger { background: #b53131; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, input:focus-visible { outline: 4px solid #f5a623; outline-offset: 3px; }
.app { width: min(900px, 100%); min-height: 100vh; margin: auto; padding: 24px; display: grid; align-content: center; gap: 18px; }
.card { background: white; border-radius: 20px; padding: clamp(20px, 5vw, 48px); box-shadow: 0 4px 18px #17233a18; }
.levels, .actions, .choices { display: grid; gap: 12px; }
.level { text-align: left; height: auto; min-height: 78px; }
.level small { display: block; font-weight: 400; margin-top: 4px; }
.topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hud { font-size: 1.25rem; font-weight: 800; }
.streak { color: #a34a00; }
.prompt { min-height: 10rem; display: grid; place-items: center; text-align: center; font-size: clamp(4rem, 14vw, 8rem); font-weight: 800; overflow-wrap: anywhere; }
.audio-icon { font-size: 5rem; min-height: 8rem; }
.choices button { font-size: 1.6rem; }
@media (min-width: 600px) { .choices { grid-template-columns: 1fr 1fr; } }
.answer { display: grid; gap: 12px; margin-top: 12px; }
.answer input { min-height: 62px; width: 100%; padding: .5rem .8rem; border: 2px solid #8b9ab0; border-radius: 10px; font-size: 1.8rem; }
.feedback { min-height: 1.5rem; font-weight: 700; font-size: 1.15rem; }
.correct { color: #087a3f; } .wrong, .audio-error { color: #a32727; }
.mic { font-size: 1.4rem; }
.toggle { display: flex; gap: .6rem; align-items: center; min-height: 56px; font-weight: 700; font-size: 1.2rem; cursor: pointer; }
.toggle input { width: 28px; height: 28px; }
.missed { padding-left: 1.25rem; font-size: 1.3rem; line-height: 1.6; }
@media (max-width: 500px) { .app { padding: 12px; } .card { padding: 20px; } .topline { align-items: flex-start; flex-direction: column; } }


.wide-card { width: min(1100px, 100%); }
.centered { text-align: center; display: grid; gap: 18px; justify-items: center; }
.game-title { text-align: center; font-size: clamp(2.5rem, 8vw, 5rem); margin: 0 0 1.5rem; }
.menu-card { width: min(620px, 100%); margin: auto; }
.menu-actions { display: grid; gap: 18px; margin-bottom: 18px; }
.menu-choice { min-height: 86px; font-size: clamp(1.25rem, 4vw, 2rem); }
.power-meter { color: #7b4a00; font-weight: 900; font-size: 1.25rem; text-align: center; }
.stage-label { text-align: center; color: #5c3987; font-weight: 900; letter-spacing: .08em; }
.power-meter.large { font-size: clamp(1.8rem, 6vw, 3rem); }
.power-pulse { animation: power-pulse .35s ease-out; }
.corner-button { justify-self: start; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: #10182caa; display: grid; place-items: center; padding: 20px; }
.quit-dialog { width: min(440px, 100%); background: white; border-radius: 18px; padding: 28px; box-shadow: 0 12px 50px #0006; }
.debug-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.debug-form label { display: grid; gap: 6px; font-weight: 700; }
.debug-form select, .debug-form input { min-height: 56px; padding: 8px; border: 2px solid #8b9ab0; border-radius: 10px; background: white; }
.debug-form button { grid-column: 1 / -1; }
.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; }
@keyframes power-pulse { 50% { transform: scale(1.12); } }
@media (max-width: 700px) {
  .debug-form { grid-template-columns: 1fr; }
  .debug-form button { grid-column: auto; }
}
/* A Chromebook browser window is ~635px tall: keep the menu's toggles above the fold. */
@media (max-height: 740px) {
  .app:has(> .menu-card) { padding-block: 12px; }
  .menu-card { padding-block: 24px; }
  .game-title { font-size: clamp(2.5rem, 6vw, 3.5rem); margin-bottom: 1rem; }
  .menu-actions { gap: 12px; margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .power-pulse { animation: none !important; }
}
