/* ─── Játék: egy képernyő, óriás betűk, megbízható érintés ─── */

html.game-body-root,
body.game-body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

body.game-body {
    margin: 0;
    background: #fff;
    color: #0a0a0a;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.game-viewport {
    height: 100dvh;
    max-height: 100dvh;
    width: 100%;
    max-width: 36rem;
    margin: 0 auto;
    padding: clamp(0.35rem, 2vw, 0.75rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.game-task-area {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.game-screen {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    gap: clamp(0.35rem, 1.5vh, 0.65rem);
    overflow: hidden;
    height: 100%;
}

.game-screen--yesno,
.game-screen--read,
.game-screen--sentence,
.game-screen--odd {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
}

.game-screen--memory {
    grid-template-rows: auto auto auto minmax(0, 1fr);
}

.game-progress {
    font-size: clamp(1.1rem, 3.8vw, 1.35rem);
    color: #374151;
    text-align: center;
    font-weight: 700;
}

.game-instruction {
    font-size: clamp(1.25rem, 4.5vw, 1.65rem);
    color: #111827;
    text-align: center;
    line-height: 1.3;
    font-weight: 700;
    padding: 0 0.25rem;
}

.game-prompt {
    font-size: clamp(2.25rem, 9vw, 3.75rem);
    font-weight: 900;
    text-align: center;
    line-height: 1.1;
    color: #000;
    letter-spacing: -0.02em;
}

.game-prompt-hidden {
    font-size: clamp(2rem, 8vw, 3rem);
    color: #6b7280;
}

.game-prompt-statement {
    font-size: clamp(1.5rem, 5.5vw, 2.25rem);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    line-height: 1.25;
}

.game-prompt-sentence {
    font-size: clamp(1.35rem, 5vw, 2rem);
    font-weight: 800;
    line-height: 1.35;
}

.game-prompt-sentence .blank {
    display: inline-block;
    min-width: 3rem;
    border-bottom: 4px solid #1d4ed8;
    color: #1d4ed8;
    margin: 0 0.15rem;
}

.game-prompt-read {
    font-size: clamp(2rem, 8vw, 3.5rem);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.game-prompt-memory {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
}

.game-media {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.game-photo {
    max-height: min(32vh, 220px);
    max-width: 100%;
    width: auto;
    object-fit: contain;
    border-radius: 1rem;
    border: 4px solid #111827;
}

.game-photo.img-fallback {
    min-height: 8rem;
    background: #e5e7eb;
}

.game-images-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(0.5rem, 2vw, 0.85rem);
    width: 100%;
    height: 100%;
    align-content: center;
}

.game-images-row--3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Háttérképes gomb – a kép NEM nyeli el az érintést */
.game-image-btn {
    display: block;
    width: 100%;
    min-height: clamp(5.5rem, 22vh, 9rem);
    max-height: 30vh;
    padding: 0;
    border: none;
    border-radius: 1rem;
    background: #e5e7eb;
    cursor: pointer;
    overflow: hidden;
    box-shadow: inset 0 0 0 4px #111827;
    -webkit-tap-highlight-color: transparent;
}

.game-image-btn img {
    pointer-events: none;
    width: 100%;
    height: 100%;
    min-height: clamp(5.5rem, 22vh, 9rem);
    max-height: 30vh;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.game-image-btn:active {
    transform: scale(0.98);
}

.game-image-btn.selected-correct {
    box-shadow: inset 0 0 0 5px #16a34a, 0 0 0 4px #86efac;
}

.game-image-btn.selected-wrong {
    box-shadow: inset 0 0 0 5px #dc2626, 0 0 0 4px #fca5a5;
}

.game-memory-card {
    min-height: clamp(6rem, 26vh, 10rem);
    max-height: 32vh;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: inset 0 0 0 4px #1d4ed8;
    background: #e5e7eb;
}

.game-memory-card img {
    width: 100%;
    height: 100%;
    min-height: clamp(6rem, 26vh, 10rem);
    max-height: 32vh;
    object-fit: cover;
    pointer-events: none;
    display: block;
}

.game-speak-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}

.game-actions {
    display: flex;
    flex-direction: column;
    gap: clamp(0.4rem, 1.5vh, 0.65rem);
    width: 100%;
    flex-shrink: 0;
}

.game-actions--row {
    flex-direction: row;
}

.game-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(4.25rem, 14vh, 5.75rem);
    font-size: clamp(1.45rem, 5.5vw, 2rem);
    font-weight: 800;
    line-height: 1.15;
    border-radius: 1.1rem;
    border: 4px solid transparent;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    flex: 1;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.game-btn:active {
    transform: scale(0.97);
}

.game-btn-speak {
    background: #6d28d9;
    color: #fff;
    border-color: #4c1d95;
    min-height: clamp(3.5rem, 11vh, 4.5rem);
    font-size: clamp(1.2rem, 4.2vw, 1.5rem);
}

.game-btn-speak-sm {
    background: #ede9fe;
    color: #4c1d95;
    border-color: #7c3aed;
    min-height: clamp(3rem, 10vh, 3.75rem);
    font-size: clamp(1.15rem, 4vw, 1.4rem);
    flex: 1 1 auto;
    min-width: 40%;
}

.game-btn-word {
    background: #fff;
    color: #000;
    border-color: #111827;
    box-shadow: 0 4px 0 #111827;
}

.game-btn-word.selected-correct {
    border-color: #16a34a;
    box-shadow: 0 0 0 4px #86efac;
}

.game-btn-word.selected-wrong {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px #fca5a5;
}

.game-btn-yes {
    background: #16a34a;
    color: #fff;
    border-color: #14532d;
}

.game-btn-no {
    background: #dc2626;
    color: #fff;
    border-color: #7f1d1d;
}

.game-btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #1e3a8a;
}

.feedback-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    z-index: 40;
    pointer-events: none;
}

.feedback-overlay.hidden {
    display: none;
}

.feedback-emoji {
    font-size: clamp(5rem, 28vw, 8rem);
}

.game-finish {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: #fff;
    z-index: 30;
    text-align: center;
}

.game-finish.hidden {
    display: none;
}

.game-finish-title {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
    font-weight: 900;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.game-finish-xp {
    font-size: clamp(1.35rem, 5vw, 1.85rem);
    color: #15803d;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.game-finish-note {
    font-size: clamp(1.15rem, 4vw, 1.45rem);
    color: #374151;
    margin-bottom: 1.25rem;
}

.game-btn-finish {
    width: 100%;
    max-width: 22rem;
}

/* Auth oldalak */
.btn-huge {
    min-height: 4.75rem;
    font-size: 1.65rem;
}

.btn-mega {
    min-height: 5.75rem;
    font-size: 1.9rem;
}

@keyframes confetti-fall {
    0%   { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0.3; }
}

.confetti-piece {
    position: fixed;
    top: -20px;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    animation: confetti-fall linear forwards;
    pointer-events: none;
    z-index: 50;
}

@keyframes check-bounce {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}

.correct-check {
    animation: check-bounce 0.45s ease-in-out;
}

@media (orientation: landscape) and (max-height: 520px) {
    .game-prompt {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .game-image-btn,
    .game-memory-card {
        max-height: 40vh;
        min-height: 5rem;
    }

    .game-btn {
        min-height: 3.5rem;
        font-size: 1.25rem;
    }
}
