/* Pre-reader (Get Ready to Read) game styling.
   pr-* : the pre-reader JS engine's game-specific UI (rhyme audio options, find-the-mark sentence,
          first-sound picture/audio options). The shared kid-game shell (ap-* / pg-*) and its token
          layer live in phonics-games.css, which ActivityPlayer links alongside this file, so the
          shell, audio prompt, feedback, and done screens are styled there and reused here.

   In-brand: unQbd blue #00B4FF, orange #FFAA00, with brighter kid-friendly accents. All colour comes
   from the shared --pg-* tokens (light :root + the dark body.dark-mode block in phonics-games.css),
   so these rules stay token-driven with no stray hex, and dark mode re-themes for free. Dark mode is
   gated on the body.dark-mode class (the in-app theme switch), NEVER the OS-level colour-scheme media
   query -- see KidsDarkModeCssWiringTests. Large tap targets, rounded shapes, no streak-loss pressure. */

/* A calm helper line above the choices. */
.pr-pick-label {
    margin: 0.25rem 0 1rem;
    text-align: center;
    color: var(--pg-muted);
    font-size: 1rem;
}

/* ---------- rhyme-match + first-sound: audio option rows ---------- */
.pr-audio-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 30rem;
    margin: 0 auto;
}

.pr-audio-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--pg-card);
    border: 2px solid var(--pg-line);
    border-radius: 16px;
    box-shadow: var(--pg-shadow-sm);
}

.pr-audio-option.is-correct {
    border-color: var(--pg-green);
    background: var(--pg-green-tint);
}

.pr-audio-option.is-wrong {
    border-color: var(--pg-red-line);
    background: var(--pg-red-tint);
}

/* The big round "play this one" speaker. */
.pr-audio-play {
    flex: 0 0 auto;
    width: 3.25rem;
    height: 3.25rem;
    border: none;
    border-radius: 50%;
    background: var(--pg-blue);
    color: var(--pg-on-accent);
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--pg-blue-glow);
}

.pr-audio-play:hover {
    background: var(--pg-blue-light);
}

.pr-audio-play:focus-visible {
    outline: none;
    box-shadow: var(--pg-focus-ring);
}

/* The word, shown only when speech is unavailable (the audio fallback's visual cue). */
.pr-audio-word {
    flex: 1 1 auto;
    text-align: center;
    color: var(--pg-ink);
    font-size: 1.15rem;
    font-weight: 600;
}

/* The "pick this one" pill. */
.pr-audio-pick {
    flex: 0 0 auto;
    min-width: 4.5rem;
    min-height: 2.75rem;
    padding: 0 1.1rem;
    border: none;
    border-radius: 999px;
    background: var(--pg-orange);
    color: var(--pg-on-accent);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--pg-orange-glow);
}

.pr-audio-pick:hover {
    background: var(--pg-orange-light);
}

.pr-audio-pick:focus-visible {
    outline: none;
    box-shadow: var(--pg-focus-ring);
}

.pr-audio-pick:disabled {
    opacity: 0.55;
    cursor: default;
    box-shadow: none;
}

/* ---------- find-the-mark ---------- */
.pr-mark-goal {
    text-align: center;
    margin-bottom: 1.25rem;
}

.pr-mark-goal-row {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

/* The target mark, shown big so the child matches the symbol (a print concept, not reading). */
.pr-mark-target {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.5rem;
    height: 3.5rem;
    padding: 0 0.75rem;
    background: var(--pg-blue-tint);
    color: var(--pg-blue-deep);
    border-radius: 16px;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

/* The sentence: large readable text with each mark a tappable tile. */
.pr-sentence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    max-width: 32rem;
    margin: 0 auto;
    font-size: 1.6rem;
    line-height: 1.6;
}

.pr-sentence-text {
    color: var(--pg-ink);
}

/* A tappable punctuation mark inside the sentence. */
.pr-mark-tile {
    min-width: 2.25rem;
    min-height: 2.75rem;
    padding: 0 0.4rem;
    margin: 0 0.1rem;
    border: 2px solid var(--pg-line);
    border-radius: 10px;
    background: var(--pg-soft);
    color: var(--pg-blue-deep);
    font-size: 1.7rem;
    font-weight: 800;
    cursor: pointer;
    vertical-align: middle;
}

.pr-mark-tile:hover {
    border-color: var(--pg-blue);
}

.pr-mark-tile:focus-visible {
    outline: none;
    box-shadow: var(--pg-focus-ring);
}

.pr-mark-tile.is-correct {
    border-color: var(--pg-green);
    background: var(--pg-green-tint);
    color: var(--pg-green-deep);
}

.pr-mark-tile.is-wrong {
    border-color: var(--pg-red-line);
    background: var(--pg-red-tint);
    color: var(--pg-red);
}

/* ---------- first-sound: picture options ---------- */
.pr-pic-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.pr-pic-option {
    width: 8rem;
    height: 8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: var(--pg-card);
    border: 2px solid var(--pg-line);
    border-radius: 18px;
    box-shadow: var(--pg-shadow-sm);
    cursor: pointer;
}

.pr-pic-option:hover {
    border-color: var(--pg-blue);
}

.pr-pic-option:focus-visible {
    outline: none;
    box-shadow: var(--pg-focus-ring);
}

.pr-pic-option.is-correct {
    border-color: var(--pg-green);
    background: var(--pg-green-tint);
}

.pr-pic-option.is-wrong {
    border-color: var(--pg-red-line);
    background: var(--pg-red-tint);
}

.pr-pic-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pr-pic-fallback {
    color: var(--pg-ink);
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
}

/* ---------- dark mode (body.dark-mode only; tokens above already re-theme via phonics-games.css) ---------- */
/* The shared --pg-* tokens carry most of the dark theme; these are the pre-reader-only refinements:
   a soft edge on picture tiles so a light illustration still reads on the dark card, and a slightly
   stronger sentence-mark contrast. */
body.dark-mode .pr-pic-img {
    border-radius: 10px;
    box-shadow: 0 0 0 1px var(--pg-line);
}

body.dark-mode .pr-mark-tile {
    background: var(--pg-card);
}
