:root {
  color-scheme: light;
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  background: #f3f1ff;
  color: #292558;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100dvh; margin: 0; background: linear-gradient(150deg, #f6d66f, #f4f1ff 41%, #a7e5d7); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 4px solid #e95872; outline-offset: 3px; }
[hidden] { display: none !important; }

.app-shell { width: min(100%, 560px); min-height: 100dvh; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.app-header { text-align: center; }
.eyebrow { margin: 0 0 2px; color: #5a49c7; font-size: .75rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.65rem, 7vw, 2.35rem); letter-spacing: -.04em; }
.scoreboard { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; color: #4d4879; font-size: .83rem; font-weight: 800; }
.scoreboard span { padding: 3px 8px; border-radius: 99px; background: rgb(255 255 255 / 68%); }

.mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 16px 0 3px; }
.mode-tab { min-height: 42px; padding: 7px 3px; border: 2px solid #292558; border-radius: 14px; background: #fff; color: #292558; font-weight: 800; font-size: .86rem; cursor: pointer; }
.mode-tab.is-active { background: #5a49c7; color: #fff; box-shadow: 0 3px 0 #32277d; transform: translateY(-2px); }

.mode-panel { flex: 1; min-height: 0; }
.study-area { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 0; }
.hint { margin: 0 0 9px; text-align: center; color: #4f4976; font-size: .88rem; font-weight: 800; }
.flashcard { width: min(100%, calc(53dvh * .707), 350px); aspect-ratio: .707; padding: 0; border: 0; border-radius: 24px; background: transparent; cursor: pointer; perspective: 1000px; }
.card-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 420ms cubic-bezier(.2, .75, .25, 1); }
.flashcard.is-flipped .card-inner { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; border: 3px solid #292558; border-radius: 24px; backface-visibility: hidden; box-shadow: 0 8px 0 #b4aee4, 0 16px 25px rgb(44 36 96 / 18%); }
.card-picture { background: #fff; }
.card-word { padding: 20px; background: #fff; transform: rotateY(180deg); }
.picture, .practice-picture { position: relative; display: block; background-image: url("images/wheres-the-spot-vocabulary-sheet.png"); background-repeat: no-repeat; background-size: 312% 312%; background-position: var(--x, 1.6%) var(--y, 1.6%); }
.picture { width: 100%; height: 100%; clip-path: inset(14px); }
.picture::after, .practice-picture::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 22%; background: #fff; }
.word-label { max-width: 100%; overflow-wrap: anywhere; color: #292558; font-family: "Arial Rounded MT Bold", "Avenir Next", sans-serif; font-size: clamp(2.7rem, 16vw, 5.5rem); font-weight: 900; letter-spacing: -.06em; line-height: 1; }
.side-picker { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 15px; color: #423c72; font-size: .83rem; font-weight: 800; }
.side-button, .listen-button { min-height: 36px; border: 2px solid #292558; border-radius: 999px; background: #fff; color: #292558; font-weight: 800; cursor: pointer; }
.side-button { padding: 4px 10px; }
.side-button.is-selected { background: #a7e5d7; }
.listen-button { padding: 4px 12px; background: #f6d66f; }

.practice-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 12px 0; }
h2 { margin: 0 0 12px; font-size: clamp(1.4rem, 6.4vw, 1.9rem); }
.practice-picture { width: min(68vw, 235px); aspect-ratio: .707; overflow: hidden; border: 3px solid #292558; border-radius: 22px; background-color: #fff; box-shadow: 0 7px 0 #b4aee4; }
.answer-options { display: grid; width: min(100%, 420px); grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }
.answer-button, .check-button, .next-question { min-height: 53px; border: 3px solid #292558; border-radius: 16px; color: #292558; font-weight: 900; cursor: pointer; }
.answer-button { padding: 8px; background: #fff; font-size: clamp(1rem, 4.7vw, 1.2rem); }
.answer-button.correct { background: #9ee5bd; }
.answer-button.wrong { background: #ffb4bf; }
.answer-button:disabled { opacity: 1; cursor: default; }
.feedback { min-height: 1.45em; margin: 13px 0 0; color: #403967; font-weight: 900; text-align: center; }
.feedback.is-correct { color: #14623f; }
.feedback.is-wrong { color: #a12b45; }
.spell-form { display: flex; width: min(100%, 420px); gap: 9px; margin-top: 18px; }
.spell-form input { min-width: 0; flex: 1; min-height: 54px; padding: 8px 12px; border: 3px solid #292558; border-radius: 16px; background: #fff; color: #292558; font-size: 1.05rem; font-weight: 800; }
.check-button { flex: 0 0 92px; background: #a7e5d7; }
.controls { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 9px; padding-top: 10px; }
.control-button { min-height: 57px; padding: 8px 4px; border: 3px solid #292558; border-radius: 17px; color: #292558; font-size: clamp(.82rem, 3.5vw, 1rem); font-weight: 900; cursor: pointer; }
.secondary { background: #fff; }.shuffle { background: #f6d66f; }.primary { background: #a7e5d7; }
.next-question { width: min(100%, 420px); margin: 12px auto 0; padding: 8px 14px; background: #f6d66f; font-size: 1rem; }
.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; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media (max-height: 700px) { .app-shell { padding-top: max(10px, env(safe-area-inset-top)); }.mode-tabs { margin-top: 8px; }.flashcard { width: min(100%, calc(46dvh * .707), 310px); }.study-area { padding: 3px 0; }.hint { margin-bottom: 5px; }.side-picker { margin-top: 8px; }.practice-picture { width: min(52vw, 180px); }.practice-panel { padding: 5px 0; } }
