/* ============================================================
   ALFABETO DEGLI ANIMALI — stile locale
   Carica prima css/kids-base.css (variabili, header, footer).
   ============================================================ */

/* ---------- Layout principale ---------- */
.game-container {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 160px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vw, 36px) 12px 48px;
    overflow: hidden;
    color: var(--ink);
    font-family: var(--kids-font-body);
    background:
        radial-gradient(620px 320px at 6% -40px, rgba(249, 115, 22, .12), transparent 60%),
        radial-gradient(720px 420px at 104% 104%, rgba(45, 212, 191, .14), transparent 60%),
        linear-gradient(180deg, #fffbeb 0%, #f0fdfa 100%);
}

/* Lettere che galleggiano sullo sfondo */
.bg-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-decor span {
    position: absolute;
    opacity: .13;
    line-height: 1;
    font-family: var(--kids-font-title);
    font-weight: 700;
    animation: decorFloat 9s ease-in-out infinite alternate;
}

@keyframes decorFloat {
    from { transform: translateY(-12px) rotate(-8deg); }
    to   { transform: translateY(14px) rotate(10deg); }
}

/* ---------- Schermate ---------- */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 760px;
    padding: 0.5rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.screen.active {
    display: flex;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Schermata iniziale ---------- */
.hero-tiles {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 2vw, 14px);
    margin-bottom: 0.9rem;
    min-height: 96px;
}

.hero-tile {
    width: clamp(62px, 12vw, 88px);
    aspect-ratio: 1;
    border-radius: 20px;
    background: #fff;
    border: 3px solid var(--tile, #f59e0b);
    box-shadow: 0 6px 0 var(--tile-dark, #b45309), var(--kids-shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    animation: heroBob 2.6s ease-in-out infinite;
}

.hero-tile:nth-child(2) { animation-delay: .35s; }
.hero-tile:nth-child(3) { animation-delay: .7s; }
.hero-tile:nth-child(4) { animation-delay: 1.05s; }

.hero-tile .tile-animal { width: 62%; }
.hero-tile .tile-animal i { font-size: clamp(1.6rem, 4.6vw, 2.2rem); }

.hero-tile b.tile-letter {
    font-family: var(--kids-font-title);
    font-size: clamp(1rem, 3vw, 1.35rem);
    line-height: 1;
    color: var(--tile, #f59e0b);
    margin-top: 2px;
}

@keyframes heroBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

.game-title {
    font-family: var(--kids-font-title);
    font-size: clamp(1.9rem, 5.4vw, 3rem);
    font-weight: 700;
    color: var(--brand);
    margin: 0 0 0.4rem;
    text-shadow: 0 3px 0 rgba(10, 91, 99, .12);
}

.game-subtitle {
    font-size: clamp(1.05rem, 3vw, 1.35rem);
    color: var(--ink-2);
    font-weight: 700;
    margin: 0 0 1.8rem;
}

.choose-label {
    font-family: var(--kids-font-title);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--brand);
    margin: 0 0 1rem;
    text-transform: uppercase;
    letter-spacing: .6px;
}

/* Card delle modalità */
.level-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 300px));
    gap: clamp(12px, 2.5vw, 22px);
    justify-content: center;
    width: 100%;
}

.level-card {
    --lvl: #f59e0b;
    --lvl-dark: #b45309;
    --lvl-soft: #fffbeb;
    appearance: none;
    border: 3px solid var(--lvl);
    background: #fff;
    border-radius: var(--kids-radius);
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 7px 0 var(--lvl-dark), var(--kids-shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    font-family: var(--kids-font-body);
}

.level-card:hover {
    transform: translateY(-4px);
    background: var(--lvl-soft);
    box-shadow: 0 11px 0 var(--lvl-dark), var(--kids-shadow);
}

.level-card:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--lvl-dark);
}

.level-card.explore     { --lvl: #0ea5e9; --lvl-dark: #0369a1; --lvl-soft: #f0f9ff; }
.level-card.find-letter { --lvl: #8b5cf6; --lvl-dark: #6d28d9; --lvl-soft: #f5f3ff; }

.level-card.wide { grid-column: 1 / -1; }

.level-icon { font-size: 2.2rem; line-height: 1; flex-shrink: 0; }

.level-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

.level-name {
    font-family: var(--kids-font-title);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
}

.level-desc {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ink-2);
}

/* ---------- Scheda informativa per adulti ---------- */
.info-box {
    background: #fff;
    border: 2px dashed #cfe2e2;
    border-radius: 18px;
    padding: 1.3rem 1.4rem;
    margin-top: 2.2rem;
    width: 100%;
    text-align: left;
    color: #3b4a4a;
    font-size: 0.95rem;
    line-height: 1.6;
}

.info-box h2 {
    font-family: var(--kids-font-title);
    font-size: 1.15rem;
    color: var(--brand);
    margin: 0 0 0.7rem;
}

.info-box h3 {
    font-family: var(--kids-font-title);
    font-size: 1rem;
    color: var(--brand);
    margin: 1.1rem 0 0.4rem;
}

.info-box p { margin: 0 0 0.55rem; }
.info-box ul { margin: 0 0 0.55rem; padding-left: 1.2rem; }
.info-box li { margin-bottom: 0.35rem; }

.info-box .info-tip {
    margin-top: 0.9rem;
    background: #f0fdfa;
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
}

.info-box .info-crediti {
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.info-box .info-crediti a { color: var(--brand); }

/* ---------- HUD ---------- */
.hud {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 1rem;
}

.hud-pill {
    background: #fff;
    border: 2px solid #ffe1a6;
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-family: var(--kids-font-title);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    box-shadow: var(--kids-shadow-sm);
    white-space: nowrap;
}

.explore-pill {
    border-color: #bae6fd;
    font-size: 1.05rem;
    margin-right: auto;
}

.score-pill.bump { animation: scoreBump .45s ease; }

@keyframes scoreBump {
    30% { transform: scale(1.22); }
}

.hud-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.progress-track {
    flex: 1;
    height: 16px;
    background: #eee7dc;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(10, 91, 99, .12);
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #fbbf24, #2dd4bf);
    transition: width .5s cubic-bezier(.22, 1, .36, 1);
}

.progress-label {
    font-family: var(--kids-font-title);
    font-weight: 600;
    color: var(--brand);
    font-size: 1rem;
    white-space: nowrap;
}

.hud-right { display: flex; gap: 8px; }

.hud-btn {
    appearance: none;
    border: 2px solid #d7efec;
    background: #fff;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--kids-shadow-sm);
    transition: transform .15s ease, background .15s ease;
    padding: 0;
    line-height: 1;
}

.hud-btn:hover { transform: translateY(-2px); background: #f0fdfa; }
.hud-btn.home { border-color: var(--brand); background: #f0fdfa; }
.hud-btn.home:hover { background: #ccfbf1; }

/* ---------- Alfabetiere ---------- */
.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: clamp(6px, 1.6vw, 12px);
    width: 100%;
    margin-bottom: 0.6rem;
}

.letter-tile {
    appearance: none;
    aspect-ratio: 1;
    border-radius: 16px;
    background: #fff;
    border: 3px solid var(--tile, #f59e0b);
    box-shadow: 0 5px 0 var(--tile-dark, #b45309);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 2px;
    -webkit-tap-highlight-color: transparent;
    transition: transform .15s ease, box-shadow .15s ease;
    animation: tileIn .3s cubic-bezier(.34, 1.56, .64, 1) backwards;
}

@keyframes tileIn {
    from { opacity: 0; transform: scale(.6); }
}

/* L'animale è il protagonista: grande, su un disco del colore della
   lettera. La lettera resta sotto, come un'etichetta. */
.tile-animal {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68%;
    aspect-ratio: 1;
    border-radius: 50%;
}

.tile-animal::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--tile, #f59e0b);
    opacity: .16;
}

/* Le illustrazioni (img/*.svg) al posto delle emoji di sistema: stessa
   resa su ogni dispositivo, e nitide a qualsiasi ingrandimento */
.animal-art {
    position: relative;   /* sopra il disco */
    width: 74%;
    height: 74%;
    object-fit: contain;
    filter: drop-shadow(0 2px 2px rgba(15, 23, 42, .18));
}

.animal-art-big {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 3px 4px rgba(15, 23, 42, .16));
}

/* Riserva: se un file non arrivasse, torna l'emoji di sistema */
i.ripiego {
    position: relative;
    font-style: normal;
    line-height: 1;
    font-size: clamp(1.4rem, 5.6vw, 2.2rem);
}

i.ripiego.animal-art-big { font-size: clamp(2.4rem, 11vw, 4rem); }

.letter-tile b.tile-letter {
    font-family: var(--kids-font-title);
    font-size: clamp(.85rem, 3.2vw, 1.2rem);
    font-weight: 700;
    line-height: 1;
    color: var(--tile, #f59e0b);
    margin-top: 3px;
    letter-spacing: .5px;
}

.letter-tile:hover { transform: translateY(-4px); }
.letter-tile:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--tile-dark, #b45309); }

/* ---------- Carta grande (modale) ---------- */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
    z-index: 70;
    padding: 20px;
}

.modal.show { display: flex; animation: fadeIn .25s ease-out; }

.modal-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: min(340px, 92vw);
}

.modal-close {
    position: absolute;
    top: -14px;
    right: -6px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--ink);
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--kids-shadow);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* La carta si gira: davanti la lettera, dietro l'animale */
.flip-card {
    width: 100%;
    aspect-ratio: 1;
    perspective: 1200px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform .6s cubic-bezier(.4, 1.4, .6, 1);
}

.flip-card.flipped .flip-inner { transform: rotateY(180deg); }

.flip-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 28px;
    background: #fff;
    border: 5px solid var(--tile, #f59e0b);
    box-shadow: 0 10px 0 var(--tile-dark, #b45309), var(--kids-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.flip-front span {
    font-family: var(--kids-font-title);
    font-size: clamp(5rem, 26vw, 9rem);
    font-weight: 700;
    line-height: 1;
    color: var(--tile, #f59e0b);
}

.flip-back { transform: rotateY(180deg); }

/* Contenitori dell'illustrazione: prima davano la misura al testo-emoji,
   ora devono darla all'immagine, quindi hanno larghezza e altezza vere */
.modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(3.6rem, 18vw, 6rem);
    height: clamp(3.6rem, 18vw, 6rem);
    line-height: 1;
}

.modal-name {
    font-family: var(--kids-font-title);
    font-size: clamp(1.3rem, 6vw, 2rem);
    font-weight: 700;
    color: var(--ink);
}

.modal-say {
    appearance: none;
    border: none;
    background: #fff;
    color: var(--brand);
    font-family: var(--kids-font-title);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.7rem 1.6rem;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 5px 0 rgba(10, 91, 99, .25);
}

.modal-say:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(10, 91, 99, .25); }

/* ---------- Domanda del gioco ---------- */
.prompt-card {
    position: relative;
    background: #fff;
    border: 3px solid #ffe1a6;
    border-radius: var(--kids-radius);
    box-shadow: var(--kids-shadow-sm);
    padding: 1rem 3.6rem 1rem 1.4rem;
    width: 100%;
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.say-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #ffe1a6;
    background: #fff8ec;
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: var(--kids-shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: transform .15s ease;
}

.say-btn:hover { transform: scale(1.1); }
.say-btn:active { transform: scale(0.9); }

/* La lettera o l'animale di cui si parla */
.prompt-body {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.prompt-letter {
    font-family: var(--kids-font-title);
    font-size: clamp(3.4rem, 14vw, 5rem);
    font-weight: 700;
    line-height: 1;
    color: var(--tile, #f59e0b);
    animation: promptPop .4s cubic-bezier(.34, 1.56, .64, 1);
}

.prompt-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(4rem, 17vw, 5.6rem);
    height: clamp(4rem, 17vw, 5.6rem);
    line-height: 1;
    animation: promptPop .4s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes promptPop {
    from { transform: scale(.5); opacity: 0; }
}

.prompt-text {
    font-family: var(--kids-font-title);
    font-size: clamp(1.05rem, 3.4vw, 1.5rem);
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}

.prompt-text strong { color: var(--brand); }

/* ---------- Opzioni ---------- */
.options-grid {
    display: grid;
    gap: clamp(10px, 2.4vw, 18px);
    justify-content: center;
    width: 100%;
    margin-bottom: 0.4rem;
}

.options-grid.n3 { grid-template-columns: repeat(3, minmax(0, 170px)); }
.options-grid.n4 { grid-template-columns: repeat(4, minmax(0, 140px)); }

.option-btn {
    appearance: none;
    position: relative;
    aspect-ratio: 1;
    background: #fff;
    border: 3px solid #e6f2f0;
    border-radius: var(--kids-radius);
    box-shadow: 0 5px 0 rgba(10, 91, 99, .10), var(--kids-shadow-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    -webkit-tap-highlight-color: transparent;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease, opacity .3s ease;
    animation: tileIn .35s cubic-bezier(.34, 1.56, .64, 1) backwards;
    overflow: hidden;
}

/* L'illustrazione riempie la card: prima era grande come il testo-emoji
   e lasciava troppo bianco intorno */
.option-btn .opt-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 78%;
    height: 78%;
    line-height: 1;
}

.option-btn .opt-letter {
    font-family: var(--kids-font-title);
    font-size: clamp(2.4rem, 11vw, 4rem);
    font-weight: 700;
    line-height: 1;
    color: var(--tile, #0f766e);
}

.option-btn:hover {
    transform: translateY(-6px) scale(1.03);
    border-color: #bfe6e0;
    box-shadow: 0 10px 0 rgba(10, 91, 99, .10), var(--kids-shadow);
}

.option-btn:active { transform: scale(.94); box-shadow: 0 2px 0 rgba(10, 91, 99, .10); }

.option-btn.correct {
    border-color: #22c55e;
    background: #f0fdf4;
    animation: popCorrect .5s ease;
    z-index: 2;
}

@keyframes popCorrect {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.12) rotate(-3deg); }
    70%  { transform: scale(.97) rotate(2deg); }
    100% { transform: scale(1); }
}

.option-btn.wrong {
    border-color: #ef4444;
    background: #fef2f2;
    animation: shakeCard .5s ease;
}

@keyframes shakeCard {
    20%, 60% { transform: translateX(-9px); }
    40%, 80% { transform: translateX(9px); }
}

.option-btn.reveal {
    border-color: #22c55e;
    background: #f0fdf4;
    animation: revealPulse 1s ease infinite;
}

@keyframes revealPulse {
    0%, 100% { box-shadow: 0 5px 0 rgba(34, 197, 94, .35), 0 0 0 0 rgba(34, 197, 94, .45); }
    50%      { box-shadow: 0 5px 0 rgba(34, 197, 94, .35), 0 0 0 12px rgba(34, 197, 94, 0); }
}

.option-btn.locked { pointer-events: none; }

/* La scelta sbagliata si spegne e resta li' a vedersi: il bambino ricorda
   che l'ha gia' provata, ma la risposta giusta non gliela dice nessuno.
   `.reveal` e `.dim` restano definite piu' sopra ma non le usa piu'
   nessuno: erano la dottrina vecchia. */
.option-btn.fuori {
    opacity: .3;
    pointer-events: none;
    filter: grayscale(1);
    animation: none;
}
.option-btn.dim { opacity: .35; pointer-events: none; }

/* Scintille sulla risposta giusta */
.sparkle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    animation: sparkleFly .65s ease-out forwards;
    z-index: 3;
}

@keyframes sparkleFly {
    from { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    to   { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.1); opacity: 0; }
}

/* ---------- Feedback ---------- */
.feedback-msg {
    min-height: 3.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--kids-font-title);
    font-size: clamp(1.1rem, 3.4vw, 1.45rem);
    font-weight: 600;
    text-align: center;
    padding: 0 4px;
}

.feedback-msg span {
    display: inline-block;
    padding: 0.35rem 1.2rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--kids-shadow-sm);
    animation: toastIn .35s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes toastIn {
    from { opacity: 0; transform: scale(.6) translateY(8px); }
}

.feedback-msg.correct span {
    color: #15803d;
    border: 2px solid #bbf7d0;
    background: #f0fdf4;
}

.feedback-msg.wrong span {
    color: #b91c1c;
    border: 2px solid #fecaca;
    background: #fef2f2;
}

/* Badge serie di risposte giuste */
.streak-badge {
    position: fixed;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f97316, #fbbf24);
    color: #fff;
    font-family: var(--kids-font-title);
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.5rem 1.6rem;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(249, 115, 22, .4);
    opacity: 0;
    pointer-events: none;
    z-index: 40;
}

.streak-badge.show { animation: badgePop 1.4s ease forwards; }

@keyframes badgePop {
    0%   { opacity: 0; transform: translateX(-50%) scale(.4); }
    15%  { opacity: 1; transform: translateX(-50%) scale(1.15); }
    25%  { transform: translateX(-50%) scale(1); }
    80%  { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) scale(.9) translateY(-18px); }
}

/* ---------- Schermata finale ---------- */
.result-content {
    background: #fff;
    border: 3px solid #ffe1a6;
    color: var(--ink);
    padding: clamp(1.6rem, 5vw, 3rem);
    border-radius: 28px;
    text-align: center;
    width: min(480px, 94%);
    box-shadow: var(--kids-shadow);
}

.stars-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: clamp(2.4rem, 8vw, 3.4rem);
    margin-bottom: 0.4rem;
    min-height: 1.2em;
}

.stars-row .star { filter: grayscale(1) opacity(.35); }

.stars-row .star.earned {
    filter: none;
    animation: starPop .5s cubic-bezier(.34, 1.56, .64, 1) backwards;
}

@keyframes starPop {
    from { transform: scale(0) rotate(-40deg); }
}

.end-icon {
    font-size: clamp(3rem, 9vw, 4.2rem);
    margin-bottom: 0.6rem;
    animation: heroBob 2.4s ease-in-out infinite;
}

#end-title {
    font-family: var(--kids-font-title);
    font-size: clamp(1.8rem, 5.5vw, 2.4rem);
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: var(--brand);
}

.final-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink-2);
    margin: 0 0 1.6rem;
}

.final-score span {
    color: var(--accent);
    font-family: var(--kids-font-title);
    font-size: 1.45rem;
}

.action-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.btn-big {
    appearance: none;
    font-family: var(--kids-font-title);
    font-size: 1.15rem;
    font-weight: 600;
    padding: 0.8rem 1.6rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .15s ease, box-shadow .15s ease;
}

.btn-big.primary { background: var(--brand); color: #fff; box-shadow: 0 5px 0 #063d42; }
.btn-big.secondary { background: var(--accent); color: #4a3200; box-shadow: 0 5px 0 #b97b00; }
.btn-big.ghost { background: #fff; color: var(--brand); border: 2px solid var(--brand); box-shadow: 0 5px 0 rgba(10, 91, 99, .25); }

.btn-big:hover { transform: translateY(-2px); }
.btn-big:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }

/* ---------- Coriandoli ---------- */
.confetti-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 80;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -5vh;
    width: 10px;
    height: 15px;
    border-radius: 3px;
    animation: confettiFall linear forwards;
}

.confetti-piece.round { height: 10px; border-radius: 50%; }

@keyframes confettiFall {
    to { top: 108vh; transform: translateX(var(--drift)) rotate(var(--spin)); }
}

/* ---------- Header (bottone "Torna alle App") ---------- */
.site-header .btn {
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 14px;
    box-shadow: none;
}

/* ---------- Touch ----------
   kids-base.css impone min-height:44px a tutti i button sugli schermi
   touch: sui pulsanti tondi alzava solo l'altezza, schiacciandoli in
   ovali. Il minimo va imposto anche in larghezza. */
@media (pointer: coarse) {
    .hud-btn,
    .say-btn,
    .modal-close { min-width: 44px; min-height: 44px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .level-grid { grid-template-columns: minmax(200px, 340px); }

    .level-icon { font-size: 2rem; }
    .level-name { font-size: 1.15rem; }
    .level-desc { font-size: 0.85rem; }

    .hud { flex-wrap: wrap; gap: 8px; }
    .hud-progress { order: 3; width: 100%; flex-basis: 100%; }
    .hud-right { margin-left: auto; }
    .hud-pill { font-size: 1rem; padding: 0.4rem 0.8rem; }

    /* Alfabetiere: 5 lettere per riga, così restano grandi da toccare */
    .alphabet-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

    .prompt-card { padding: 0.9rem 3.2rem 0.9rem 1rem; }
    .say-btn { top: 0.6rem; right: 0.6rem; }

    .options-grid.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .options-grid.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .option-btn { border-width: 2px; }
}

/* Telefoni stretti */
@media (max-width: 380px) {
    .alphabet-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Meno animazioni se richiesto dal sistema */
@media (prefers-reduced-motion: reduce) {
    .hero-tile,
    .bg-decor span,
    .end-icon,
    .letter-tile,
    .option-btn,
    .prompt-letter,
    .prompt-emoji,
    .screen.active {
        animation: none !important;
    }
}

/* ---------- Pulsante dell'audio ----------
   Sta nell'HUD accanto al 🏠: si spegne mentre si gioca. Da spento
   resta ben visibile che è spento, altrimenti un adulto pensa che
   l'app sia rotta. */
.hud-btn.audio-btn { border-color: #ffe1a6; background: #fff8ec; }
.hud-btn.audio-btn.spento { border-color: #fecaca; background: #fef2f2; opacity: .85; }

/* ---------- I pulsanti restano della loro forma anche col fuoco ----------
   kids-base.css dà a ogni button:focus-visible un bordo arrotondato di 6px,
   e pesa più delle classi di questa pagina: giocando con la tastiera (Tab o
   frecce) la tessera, la risposta o il pulsante tondo col fuoco diventava
   un quadrato. Qui si rimette la forma di ognuno; l'anello del fuoco resta
   e la segue. Stesso difetto e stessa cura di tastiera-magica. */
.letter-tile:focus-visible { border-radius: 16px; }
.option-btn:focus-visible,
.level-card:focus-visible { border-radius: var(--kids-radius); }
.hud-btn:focus-visible,
.say-btn:focus-visible,
.modal-close:focus-visible { border-radius: 50%; }
.modal-say:focus-visible,
.btn-big:focus-visible { border-radius: 999px; }
