/* Page-specific CSS for mode-atlas-reverse-page.css. Shared repeated rules moved to mode-atlas-page-shared.css and mode-atlas-study-shared.css. */

:root {
        --ma-active-rgb: 102,168,255;
        --ma-active-text: #d8e8ff;
  --ma-font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ma-font-display: Sora, Inter, ui-sans-serif, system-ui, sans-serif;
  --ma-font-jp: "Noto Sans JP", Inter, ui-sans-serif, system-ui, sans-serif;
}

:root {
        --bg-1: #0d0d0d;
        --panel: #171717;
        --panel-2: #111111;
        --border: #3a3a3a;
        --text: #f3f3f3;
        --muted: #8e8e8e;
        --green: #2e7d32;
        --writing-accent: #66a8ff;
        --writing-accent-strong: #7db5ff;
        --writing-bg: var(--writing-bg);
        --writing-border: var(--writing-border);
        --writing-soft: rgba(102,168,255,0.14);
        --red: #b23b3b;
        --yellow: #9a8c25;
        --neutral: #555;
        --card-bg-top: #1c1c1c;
        --card-bg-bottom: #151515;
    }

body {
        margin: 0;
        min-height: 100vh;
        font-family: Arial, sans-serif;
        color: var(--text);
        background:
            radial-gradient(circle at top, rgba(102,168,255,0.22) 0%, transparent 34%),
            radial-gradient(circle at top, #242424 0%, var(--bg-1) 55%);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 24px;
    }

.main {
        width: min(540px, calc(100vw - 32px));
        background: linear-gradient(180deg, var(--card-bg-top), var(--card-bg-bottom));
        border: 1px solid rgba(102,168,255,0.16);
        border-radius: 20px;
        box-shadow: 0 20px 60px rgba(0,0,0,0.45);
        padding: 24px 30px 145px;
        text-align: center;
        position: relative;
    }

h1 {
        text-shadow: 0 0 22px rgba(102,168,255,0.12);
        margin: 0 0 10px;
        font-size: 28px;
        font-weight: 700;
    }

.subline {
        color: #d8e8ff;
        color: #cccccc;
        font-size: 15px;
        margin-bottom: 20px;
    }

.score-pill {
        background: linear-gradient(180deg, rgba(102,168,255,0.08), rgba(255,255,255,0.02));
        border: 1px solid rgba(102,168,255,0.12);
        border-radius: 999px;
        padding: 8px 14px;
    }

input[type="text"]:focus,
    input[type="number"]:focus,
    textarea:focus {
        border-color: var(--writing-border);
        box-shadow: 0 0 0 3px rgba(102,168,255,0.10);
    }

.btn:hover {
        border-color: #66a8ff;
        box-shadow: 0 0 0 1px rgba(102,168,255,0.25);
    }

.btn.active,
    .btn:active {
        background: #1f2f47;
        border-color: #36527c;
        color: #d8e8ff;
        box-shadow: inset 0 0 0 1px rgba(102,168,255,0.20);
    }

.btn-start {
        background: #1f2f47;
        border-color: #36527c;
        color: #d8e8ff;
        font-weight: 700;
        box-shadow: inset 0 0 0 1px rgba(102,168,255,0.20);
    }

.btn-start:hover {
        background: #294061;
        border-color: #66a8ff;
    }

.btn-secondary {
        background: #1f2f47;
        border-color: #36527c;
        color: #d8e8ff;
        box-shadow: inset 0 0 0 1px rgba(102,168,255,0.20);
    }

.btn-secondary:hover {
        background: #294061;
        border-color: #66a8ff;
    }

.side-panel {
        position: fixed;
        top: 12px;
        width: 248px;
        max-height: calc(100vh - 110px);
        background: linear-gradient(180deg, rgba(23,29,38,0.96), rgba(17,19,23,0.96));
        border: 1px solid var(--border);
        border-radius: 14px;
        overflow: hidden;
        box-shadow: 0 12px 32px rgba(0,0,0,0.28);
        z-index: 5;
        display: flex;
        flex-direction: column;
    }

.panel-header {
        background: var(--panel-2);
        border-bottom: 1px solid var(--border);
        padding: 10px 12px;
        cursor: pointer;
        user-select: none;
        font-weight: 700;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-shrink: 0;
    }

.cell:hover { outline: 2px solid rgba(102,168,255,0.24); }

.score-block {
        background: #222;
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 12px;
    }

.score-row {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        padding: 4px 0;
        border-bottom: 1px solid rgba(102,168,255,0.10);
        font-size: 14px;
    }

.popup {
        position: fixed;
        display: none;
        z-index: 50;
        background: #202020;
        border: 1px solid #555;
        border-radius: 12px;
        padding: 10px 12px;
        min-width: 160px;
        box-shadow: 0 12px 28px rgba(0,0,0,0.35);
        font-size: 14px;
        line-height: 1.45;
    }

.bottom-shell {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 20;
        background: var(--panel-2);
        border-top: 1px solid var(--border);
    }

.tab-button.active {
        background: #1f2f47;
        color: #d8e8ff;
        box-shadow: inset 0 -1px 0 0 rgba(102,168,255,0.20);
    }

.drawer-content {
        display: none;
        padding: 14px 16px 16px;
        background: #141414;
        border-top: 1px solid rgba(255,255,255,0.04);
        width: 100%;
        min-height: 360px;
        max-height: 50vh;
        overflow-y: auto;
    }

.toggle-btn {
        background: #252525;
        border: 1px solid #3a3a3a;
        border-radius: 10px;
        padding: 11px 12px;
        text-align: center;
        cursor: pointer;
        user-select: none;
        font-size: 15px;
        font-weight: 600;
        color: var(--text);
        transition: all 0.15s ease;
    }

.toggle-btn:hover {
        border-color: #66a8ff;
        box-shadow: 0 0 0 1px rgba(102,168,255,0.25);
    }

.toggle-btn.active {
        background: #1f2f47;
        border-color: #36527c;
        color: #d8e8ff;
        box-shadow: inset 0 0 0 1px rgba(102,168,255,0.20);
    }

.session-list-item {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 4px 0;
        border-bottom: 1px solid rgba(102,168,255,0.10);
    }

.prompt-wrap {
        min-height: 162px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin-bottom: 12px;
    }

.prompt {
        font-size: 96px;
        line-height: 1;
        transition: color 0.2s ease, transform 0.2s ease, text-shadow 0.2s ease;
        text-shadow: 0 0 18px rgba(255,255,255,0.08);
        font-weight: 700;
    }

.prompt-small {
        font-size: 74px;
    }

.choice-grid {
        display: grid;
        gap: 10px;
        margin: 0 auto 10px;
        width: min(380px, 100%);
    }

.choice-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.choice-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.choice-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.choice-btn {
        appearance: none;
        border: 1px solid var(--border);
        background: #252525;
        color: var(--text);
        border-radius: 14px;
        padding: 18px 8px;
        cursor: pointer;
        font-size: 38px;
        line-height: 1;
        min-height: 74px;
        transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
    }

.choice-btn.choice-combo {
        font-size: 28px;
        letter-spacing: 2px;
        padding: 18px 10px;
    }

.choice-btn:hover { background: #2d2d2d; transform: translateY(-1px); }

.choice-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.choice-btn.correct { background: #224a29; border-color: #3e7f48; }

.choice-btn.wrong { background: #472323; border-color: #6c3030; }

.choice-availability-toast {
        position: fixed;
        left: 50%;
        top: calc(env(safe-area-inset-top, 0px) + 14px);
        z-index: 10000;
        max-width: min(360px, calc(100vw - 32px));
        padding: 10px 14px;
        border-radius: 999px;
        background: rgba(18, 18, 18, 0.94);
        border: 1px solid rgba(255, 255, 255, 0.12);
        color: #f3f3f3;
        box-shadow: 0 16px 36px rgba(0,0,0,0.34);
        font-size: 13px;
        font-weight: 800;
        line-height: 1.35;
        opacity: 0;
        transform: translate(-50%, -8px);
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

.choice-availability-toast.show {
        opacity: 1;
        transform: translate(-50%, 0);
    }

.keyboard-wrap { margin-top: 8px; }

.keyboard-note {
        margin-top: 8px;
        color: var(--muted);
        font-size: 13px;
    }

.button-grid.tight {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 8px;
    }

@media (max-width: 760px) {
        .choice-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
    }

body.mobile-mode .prompt { font-size: 88px; }

body.mobile-mode .prompt-small { font-size: 64px; }

body.test-mode-active .main {
        border-color: #3f73c8;
        box-shadow: 0 20px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(102, 168, 255, 0.16);
    }

body.test-mode-active {
        background: radial-gradient(circle at top, #13233c 0%, var(--bg-1) 58%);
    }

.study-link.active {
        border-color: #66a8ff;
        background: rgba(255,255,255,0.05);
        color: #fff;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 0 0 1px #66a8ff;
    }

.profile-overlay {
        position: fixed;
        inset: 0;
        z-index: 10000;
        background: rgba(0,0,0,0.52);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease;
    }

.bottom-shell.ma-modifiers-only .toggle-btn.active,
.bottom-shell.ma-modifiers-only .btn.active{background:linear-gradient(180deg, rgba(102,168,255,.24), rgba(102,168,255,.12)) !important;border-color:rgba(102,168,255,.72) !important;color:#d8e8ff !important;box-shadow:inset 0 0 0 1px rgba(102,168,255,.22), 0 0 0 1px rgba(102,168,255,.14), 0 10px 24px rgba(102,168,255,.10) !important;}
