/**
 * /public/games/reading_adventure_2/assets/css/style.css
 * Last edited: 2026-03-24 10:08: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);

    --green:#22c55e;
    --green-soft:#eaf8ef;
    --red:#ef4444;
    --red-soft:#fef2f2;
    --tile:#f8fafc;
    --tile-blue:#eef4ff;
}

*{
    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;
}

.dashboard-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin-bottom:12px;
}

.info-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(--accent);
}

.green-dot{
    background:var(--green);
}

.progress-track{
    width:100%;
    height:12px;
    background:#e5e7eb;
    border-radius:999px;
    overflow:hidden;
    margin-bottom:14px;
}

.progress-bar{
    width:0%;
    height:100%;
    background:var(--accent);
    border-radius:999px;
    transition:width 0.25s ease;
}

.nav-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin-bottom:16px;
}

.nav-btn{
    border:none;
    border-radius:12px;
    background:#fff;
    border:1px solid #bfd7ff;
    color:var(--accent);
    min-height:46px;
    font-size:14px;
    font-weight:700;
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
}

.nav-btn.active{
    background:var(--accent);
    color:#fff;
    border-color:var(--accent);
}

.game-stack{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.game-area.hidden{
    display:none;
}

.section-card{
    border-radius:16px;
    border:1px solid var(--border);
    background:#fbfdff;
    padding:16px;
    display:flex;
    flex-direction:column;
    gap:12px;
}

.section-title{
    font-size:24px;
    line-height:1.2;
}

.section-copy{
    font-size:14px;
    color:var(--muted);
    line-height:1.45;
}

.hero-box{
    min-height:140px;
    border-radius:16px;
    background:var(--tile-blue);
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    gap:8px;
    padding:16px;
}

.hero-image{
    font-size:52px;
    line-height:1;
}

.hero-word{
    font-size:28px;
    font-weight:800;
    color:#1d4ed8;
    word-break:break-word;
}

.options-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}

.option{
    min-height:56px;
    border-radius:14px;
    border:1px solid var(--border);
    background:#fff;
    font-size:16px;
    font-weight:700;
    color:#111827;
    cursor:pointer;
    padding:10px 12px;
    -webkit-tap-highlight-color:transparent;
}

.option:disabled{
    opacity:0.7;
    cursor:default;
}

.option.correct-answer{
    background:var(--green-soft);
    border-color:#86efac;
    color:#166534;
}

.option.wrong-answer{
    background:var(--red-soft);
    border-color:#fca5a5;
    color:#991b1b;
}

.feedback{
    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;
}

.feedback.correct{
    background:var(--green-soft);
    border-color:#bbf7d0;
    color:#166534;
}

.feedback.incorrect{
    background:var(--red-soft);
    border-color:#fecaca;
    color:#991b1b;
}

.sentence-area{
    min-height:100px;
    border-radius:14px;
    border:1px dashed #bfd7ff;
    background:#f8fbff;
    padding:12px;
    display:flex;
    align-items:flex-start;
    align-content:flex-start;
    flex-wrap:wrap;
    gap:8px;
}

.word-bank{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

.word-tile{
    border:none;
    border-radius:999px;
    background:var(--accent-soft);
    color:var(--accent);
    font-size:14px;
    font-weight:700;
    padding:10px 14px;
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
}

.actions-row{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.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;
    padding:0 14px;
}

.btn-control-secondary{
    background:#fff;
    color:var(--accent);
    border:1px solid #bfd7ff;
}

.story-box{
    border-radius:14px;
    background:#eff6ff;
    padding:14px;
    font-size:15px;
    line-height:1.6;
    color:#1f2937;
}

.question{
    display:flex;
    flex-direction:column;
    gap:8px;
    padding:12px;
    border-radius:14px;
    border:1px solid var(--border);
    background:#fff;
}

.question h3{
    font-size:16px;
    line-height:1.45;
}

.question-option{
    border-radius:12px;
    border:1px solid var(--border);
    background:#fff;
    padding:10px 12px;
    font-size:15px;
    font-weight:600;
    text-align:left;
    color:#111827;
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
}

.question-option.selected{
    border-color:#93c5fd;
    background:#eff6ff;
}

.question-option.correct-answer{
    background:var(--green-soft);
    border-color:#86efac;
    color:#166534;
}

.question-option.wrong-answer{
    background:var(--red-soft);
    border-color:#fca5a5;
    color:#991b1b;
}

.stats-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}

.stat-box{
    border-radius:14px;
    border:1px solid var(--border);
    background:#fff;
    padding:14px 12px;
    text-align:center;
}

.stat-label{
    font-size:13px;
    color:var(--muted);
    margin-bottom:6px;
}

.stat-value{
    font-size:24px;
    font-weight:800;
    color:#111827;
}

@media (max-width:600px){
    .page{
        padding-top:16px;
    }

    .dashboard-grid,
    .nav-grid,
    .options-grid,
    .stats-grid{
        grid-template-columns:1fr;
    }

    .hero-word{
        font-size:24px;
    }
}