/**
 * /public/games/reading_adventure/assets/css/style.css
 * Last edited: 2026-03-24 09:52:00 -0400
 */

:root{
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);

    --bg:#f3f4f6;
    --card:#ffffff;
    --text:#111827;
    --muted:#6b7280;
    --accent:#2563eb;
    --accent-soft:#dbeafe;
    --border:#e5e7eb;
    --shadow:0 18px 40px rgba(15,23,42,0.16);

    --blue:#2563eb;
    --green:#22c55e;
    --green-soft:#e8f7ee;
    --red:#ef4444;
    --red-soft:#fef2f2;
    --tile:#f8fafc;
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html, body{
    min-height:100%;
}

body{
    font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",system-ui,sans-serif;
    background:var(--bg);
    color:var(--text);
    padding-top:calc(12px + var(--safe-area-top));
    padding-bottom:calc(24px + var(--safe-area-bottom));
    -webkit-text-size-adjust:100%;
}

.page{
    max-width:560px;
    margin:0 auto;
    padding:20px 16px 40px;
}

.top-bar{
    display:flex;
    align-items:center;
    margin-bottom:18px;
}

.btn-back{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:8px 14px;
    border-radius:999px;
    background:var(--accent-soft);
    color:var(--accent);
    text-decoration:none;
    font-size:14px;
    font-weight:600;
}

.title-block{
    margin-top:10px;
}

.title{
    font-size:26px;
    font-weight:700;
    margin-bottom:6px;
}

.subtitle{
    font-size:15px;
    color:var(--muted);
}

.card{
    margin-top:20px;
    background:var(--card);
    border-radius:18px;
    box-shadow:var(--shadow);
    padding:16px;
}

.game-shell{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.game-top{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.player-strip{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
}

.player-chip{
    min-height:44px;
    border-radius:12px;
    border:1px solid var(--border);
    padding:10px 12px;
    display:flex;
    align-items:center;
    gap:8px;
    font-size:14px;
    font-weight:600;
    background:#fff;
}

.dot{
    width:12px;
    height:12px;
    border-radius:50%;
    flex:0 0 auto;
}

.blue-dot{
    background:var(--blue);
}

.progress-dot{
    background:var(--green);
}

.game-info{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.turn-indicator{
    min-height:52px;
    border-radius:12px;
    background:#eef4ff;
    color:#1d4ed8;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:700;
    padding:12px 14px;
    text-align:center;
    font-size:18px;
    line-height:1.35;
}

.progress-track{
    width:100%;
    height:12px;
    background:#e5e7eb;
    border-radius:999px;
    overflow:hidden;
}

.progress-bar{
    width:0%;
    height:100%;
    background:var(--accent);
    border-radius:999px;
    transition:width 0.25s ease;
}

.status-bar{
    min-height:46px;
    border-radius:12px;
    background:#f8fafc;
    border:1px solid var(--border);
    color:#374151;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    padding:10px 12px;
    font-size:14px;
    line-height:1.4;
}

.status-bar.correct{
    background:var(--green-soft);
    border-color:#bbf7d0;
    color:#166534;
}

.status-bar.incorrect{
    background:var(--red-soft);
    border-color:#fecaca;
    color:#991b1b;
}

.game-screen{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.options-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
}

.option{
    min-height:130px;
    border-radius:18px;
    border:1px solid var(--border);
    background:var(--tile);
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:14px 10px;
    cursor:pointer;
    user-select:none;
    -webkit-tap-highlight-color:transparent;
    transition:transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    box-shadow:0 6px 16px rgba(15,23,42,0.06);
}

.option:active{
    transform:scale(0.985);
}

.option-icon{
    font-size:46px;
    line-height:1;
}

.option-label{
    font-size:15px;
    font-weight:700;
    color:#1f2937;
    text-align:center;
}

.option.is-correct{
    background:var(--green-soft);
    border-color:#86efac;
}

.option.is-wrong{
    background:var(--red-soft);
    border-color:#fca5a5;
}

.game-controls{
    display:flex;
    gap:8px;
}

.btn-control{
    flex:1;
    border:none;
    border-radius:12px;
    background:var(--accent);
    color:#fff;
    min-height:46px;
    font-size:15px;
    font-weight:700;
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
}

.btn-control:disabled{
    opacity:0.5;
    cursor:default;
}

.btn-control-secondary{
    background:#fff;
    color:var(--accent);
    border:1px solid #bfd7ff;
}

.results-screen[hidden]{
    display:none !important;
}

.result-card{
    border-radius:16px;
    border:1px solid var(--border);
    background:#fbfdff;
    padding:18px 16px;
    display:flex;
    flex-direction:column;
    gap:12px;
    text-align:center;
}

.result-title{
    font-size:24px;
    line-height:1.2;
}

.result-copy{
    font-size:16px;
    color:#374151;
}

.gift-message{
    border-radius:12px;
    background:#eef4ff;
    color:#1d4ed8;
    padding:12px;
    font-weight:700;
}

.gift-message[hidden]{
    display:none !important;
}

.confetti{
    position:absolute;
    top:-16px;
    width:10px;
    height:10px;
    opacity:0.95;
    animation:confetti-fall linear forwards;
    pointer-events:none;
}

@keyframes confetti-fall{
    0%{
        transform:translateY(0) rotate(0deg);
        opacity:1;
    }
    100%{
        transform:translateY(520px) rotate(540deg);
        opacity:0;
    }
}

@media (max-width:600px){
    .page{
        padding-top:16px;
    }

    .player-strip{
        grid-template-columns:1fr;
    }

    .options-grid{
        grid-template-columns:1fr 1fr;
    }

    .option{
        min-height:118px;
    }

    .option-icon{
        font-size:40px;
    }

    .game-controls{
        flex-wrap:wrap;
    }

    .btn-control{
        min-width:120px;
    }
}