/* Override hub.css body — prevents touch events being swallowed on mobile */
body {
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
}

.game-container {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 40px;
    padding: 4vw;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2), inset 0 0 0 6px rgba(255, 107, 107, 0.3);
    max-width: 900px;
    width: 95%;
    text-align: center;
    border: 6px solid #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 400px;
    margin-top: 60px;
}

header h1 {
    font-size: 3rem;
    font-weight: 900;
    color: #ff4757;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
    letter-spacing: -1px;
}

.game-area {
    width: 100%;
}

.stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.lives-display {
    font-size: 1.6rem;
    letter-spacing: 4px;
}

.score-box, .found-box {
    background: white;
    border-radius: 20px;
    padding: 6px 18px;
    font-weight: 900;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.scene-label {
    font-size: 1.3rem;
    font-weight: 700;
    color: #57606f;
    text-align: center;
    margin-bottom: 15px;
}

.scenes-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.scene-panel {
    flex: 1;
}

.panel-title {
    font-size: 1.3rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 10px;
    color: #2f3542;
}

.scene-divider {
    width: 4px;
    background: #dfe4ea;
    border-radius: 4px;
    align-self: stretch;
    min-height: 200px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.emoji-cell {
    font-size: 2.5rem;
    text-align: center;
    padding: 10px 4px;
    border-radius: 12px;
    cursor: pointer;
    background: rgba(241, 242, 246, 0.5);
    border: 3px solid transparent;
    transition: transform 0.1s, border-color 0.2s, background 0.2s;
    user-select: none;
    touch-action: manipulation;   /* eliminates 300ms tap delay on all touch browsers */
}

.emoji-cell:hover {
    transform: scale(1.1);
    background: rgba(241, 242, 246, 0.9);
}

.emoji-cell.found {
    border-color: #2ed573;
    background: rgba(46, 213, 115, 0.2);
    animation: foundPulse 0.4s ease-out;
    cursor: default;
}

.emoji-cell.wrong {
    animation: shake 0.4s;
}

.highlight {
    color: #ff4757;
    font-weight: 900;
}

/* Buttons */
.btn {
    background-color: #ff4757;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1.3rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 0 #d93846, 0 15px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.15s, box-shadow 0.15s;
    letter-spacing: 1px;
    margin-top: 20px;
    outline: none;
    font-family: inherit;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 0 #d93846, 0 18px 25px rgba(0, 0, 0, 0.15); }
.btn:active { transform: translateY(6px); box-shadow: 0 2px 0 #d93846; }
.btn.hidden { display: none; }
.btn-large { font-size: 1.5rem; padding: 18px 40px; }


/* Confetti */


/* Keyframes */
@keyframes foundPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

/* Tablet (601px – 899px) */
@media (min-width: 601px) and (max-width: 899px) {
    .game-container  { margin-top: 50px; }
    .stats-row       { gap: 15px; }
    .emoji-cell      { font-size: 2rem; padding: 8px 4px; }
}

/* Phone (≤ 600px) */
@media (max-width: 600px) {
    .game-container  { margin-top: 50px; padding: 3vw; }
    header h1        { font-size: 1.8rem; }
    .stats-row       { gap: 8px; }
    .lives-display   { font-size: 1.3rem; letter-spacing: 2px; }
    .score-box,
    .found-box       { font-size: 0.9rem; padding: 4px 10px; }
    .scene-label     { font-size: 1rem; margin-bottom: 8px; }
    .panel-title     { font-size: 1rem; }

    /* Stack the two game scenes vertically instead of squeezing them side-by-side */
    .scenes-wrapper {
        flex-direction: column;
        gap: 16px;
    }

    /* Turn the vertical divider into a thin horizontal rule */
    .scene-divider {
        width: 100%;
        height: 3px;
        min-height: unset;
        align-self: auto;
    }

    .emoji-grid      { gap: 6px; }

    /* Cells are now full-width — use a larger, panel-relative size */
    .emoji-cell {
        font-size: clamp(1.6rem, 11vw, 2.2rem);
        padding: 8px 4px;
        min-height: 48px;   /* Apple HIG minimum touch target */
    }

    .modal-content        { padding: 20px; border-radius: 24px; }
    .modal-content h2     { font-size: 1.8rem; }
    .modal-content p      { font-size: 1rem; }
}
