/* Espiral Estudos — folha de estilos única */
:root {
    --bg: #f5f6fb;
    --surface: #ffffff;
    --surface-2: #f0f2f8;
    --border: #e3e6ef;
    --text: #1d2233;
    --muted: #677089;
    --primary: #4f46e5;
    --primary-2: #6366f1;
    --primary-soft: #eef0ff;
    --accent: #0ea5a4;
    --success: #16a34a;
    --success-soft: #e8f7ee;
    --warning: #c27803;
    --warning-soft: #fff6e0;
    --danger: #dc2626;
    --danger-soft: #fdecec;
    --info: #2563eb;
    --info-soft: #eaf1ff;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(20, 24, 40, .05), 0 4px 16px rgba(20, 24, 40, .05);
    --sidebar-w: 256px;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f1220; --surface: #171b2e; --surface-2: #1e2339; --border: #2a3050; --text: #e6e8f2; --muted: #9aa2bd;
        --primary: #818cf8; --primary-2: #a5b4fc; --primary-soft: #23284a; --success-soft: #12301f; --warning-soft: #33280d;
        --danger-soft: #3a1717; --info-soft: #172544; --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #0f1220; --surface: #171b2e; --surface-2: #1e2339; --border: #2a3050; --text: #e6e8f2; --muted: #9aa2bd;
    --primary: #818cf8; --primary-2: #a5b4fc; --primary-soft: #23284a; --success-soft: #12301f; --warning-soft: #33280d;
    --danger-soft: #3a1717; --info-soft: #172544; --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .8em; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .88em; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.text-success { color: var(--success); } .text-warning { color: var(--warning); } .text-danger { color: var(--danger); }
.faded { opacity: .55; }
[hidden] { display: none !important; }

/* ---------- Layout do app ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; transition: transform .2s; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; font-weight: 800; font-size: 1.05rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-ic { width: 26px; height: 26px; color: var(--primary); }
.nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; font-size: .93rem; margin-bottom: 2px; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a.locked { opacity: .6; }
.nav .lock-ic { margin-left: auto; width: 14px; height: 14px; }
.nav-title { text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; color: var(--muted); padding: 16px 12px 6px; font-weight: 700; }
.side-plan { padding: 14px 18px; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); min-height: 60px; }
.topbar-title { font-weight: 600; color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.menu-btn { display: none; }
.streak { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #ea580c; padding: 0 8px; }
.page { padding: 28px; max-width: 1240px; margin: 0 auto; }
.backdrop { display: none; }

.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dot { position: absolute; top: 3px; right: 2px; background: var(--danger); color: #fff; font-size: .62rem; font-weight: 700; border-radius: 99px; padding: 1px 5px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; }
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); min-width: 220px; padding: 6px; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-head { display: grid; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown-menu a, .dropdown-menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); text-decoration: none; }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card-accent { border-color: var(--primary); background: linear-gradient(0deg, var(--surface), var(--surface)) padding-box, var(--primary-soft); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.stack > .card:last-child { margin-bottom: 0; }
.grid { display: grid; gap: 18px; }
.grid > .card { margin-bottom: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.grid-main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: 18px; }
.stack > .card { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.center-head { justify-content: center; text-align: center; }
.actions, .actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions-row { margin: 4px 0 18px; }
.crumbs { color: var(--muted); margin-bottom: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; color: var(--text); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
:root[data-theme="dark"] .btn-primary { color: #0f1220; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-sm { padding: 6px 11px; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 600; background: var(--surface-2); color: var(--muted); vertical-align: middle; white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.badge-estudo { background: var(--primary-soft); color: var(--primary); }
.badge-revisao { background: var(--info-soft); color: var(--info); }
.badge-simulado { background: var(--warning-soft); color: var(--warning); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .84rem; cursor: pointer; margin: 3px 4px 3px 0; }
.chip.active, .chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.flash { position: relative; padding: 12px 40px 12px 16px; border-radius: 10px; margin-bottom: 14px; font-size: .92rem; border: 1px solid transparent; }
.flash-success { background: var(--success-soft); color: var(--success); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-warning { background: var(--warning-soft); color: var(--warning); }
.flash-info { background: var(--info-soft); color: var(--info); }
.flash-x { position: absolute; right: 8px; top: 6px; border: 0; background: none; color: inherit; font-size: 1.3rem; cursor: pointer; opacity: .6; }
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius); background: linear-gradient(120deg, var(--primary-soft), var(--surface)); border: 1px solid var(--border); margin-bottom: 18px; }
.banner > div { flex: 1; }
.banner .ic { color: var(--primary); width: 22px; height: 22px; }
.callout { border-radius: 12px; padding: 14px 18px; margin: 16px 0; }
.callout h3 { margin-bottom: 6px; }
.callout ul { margin: 0; padding-left: 20px; }
.callout-info { background: var(--info-soft); }
.callout-success { background: var(--success-soft); }
.callout-warning { background: var(--warning-soft); }
.explain { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--primary-soft); border-radius: 12px; font-size: .9rem; margin: 6px 0 14px; }
.explain .ic { color: var(--primary); width: 22px; height: 22px; margin-top: 2px; }

.empty-state { text-align: center; padding: 34px 20px; }
.empty-state.big { padding: 80px 20px; }
.empty-code { font-size: 4rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 10px; }
.empty-ic { width: 44px; height: 44px; color: var(--primary); margin-bottom: 10px; }

/* Formulários */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: .88rem; }
.field.narrow { max-width: 420px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: .94rem; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.row-2, .row-3, .row-4, .row-6 { display: grid; gap: 14px; align-items: end; }
.row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: .93rem; }
.check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.check.strong { font-weight: 700; }
.danger-check { color: var(--danger); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form select, .inline-form input { width: auto; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters input, .filters select { flex: 1 1 160px; width: auto; }
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: .9rem; }
.segmented input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.weekdays { display: flex; gap: 8px; flex-wrap: wrap; }
.day-chip input { position: absolute; opacity: 0; }
.day-chip span { display: inline-flex; width: 52px; height: 40px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 600; font-size: .88rem; }
.day-chip input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); }
.dropzone { display: grid; place-items: center; gap: 6px; text-align: center; padding: 28px; border: 2px dashed var(--border); border-radius: 14px; cursor: pointer; position: relative; background: var(--surface-2); }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-ic { width: 32px; height: 32px; color: var(--primary); }
.settings-heading { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 6px; }
.settings-heading:first-of-type { border: 0; padding: 0; margin: 0; }
.code-line { display: block; padding: 8px 12px; margin-bottom: 10px; word-break: break-all; }
.checklist { list-style: none; padding: 0; margin: 16px 0 0; font-size: .88rem; }
.checklist .ok { color: var(--success); } .checklist .bad { color: var(--danger); }

/* Tabelas e listas */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table tr.draft td { background: var(--warning-soft); }
.card:has(> .table) { overflow-x: auto; }
.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.simple-list li:last-child { border-bottom: 0; }
.pager { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: 0; background: none; font: inherit; font-weight: 600; font-size: .9rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab.locked { opacity: .55; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Estatísticas */
.stats-row .stat { padding: 16px 18px; }
.stat-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 600; }
.stat-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: 4px 0; }
.stat-value small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; flex: 1; }
.progress.big { height: 14px; margin-bottom: 10px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: 99px; transition: width .4s; }
.progress-bar.mid { background: var(--warning); }
.progress-bar.bad { background: var(--danger); }
.meter-row { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; gap: 12px; align-items: center; padding: 7px 0; font-size: .9rem; }
.meter-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-stack { position: relative; flex: 1; width: 100%; max-width: 26px; display: flex; align-items: flex-end; }
.bar { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 5px 5px 2px 2px; min-height: 2px; }
.bar-total { background: var(--primary-soft); }
.bar-ok { background: var(--primary); }
.bar-label { font-size: .7rem; color: var(--muted); margin-top: 4px; }
.legend { display: flex; gap: 8px; align-items: center; margin-top: 8px; color: var(--muted); }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-total { background: var(--primary-soft); } .lg-ok { background: var(--primary); }

/* Tarefas do plano */
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: 0; }
.task-list.compact .task { padding: 9px 0; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; }
.task-meta { font-size: .82rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.task-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.task-check input { position: absolute; opacity: 0; }
.task-check span { display: inline-flex; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--border); cursor: pointer; align-items: center; justify-content: center; transition: .15s; }
.task-check input:checked + span { background: var(--success); border-color: var(--success); }
.task-check input:checked + span::after { content: "✓"; color: #fff; font-weight: 800; font-size: .85rem; }
.task-check input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.day-card { padding: 14px 20px; }
.day-card.today { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.day-card.late { border-left: 4px solid var(--danger); }
.day-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* Conteúdos */
.content-card h3 { margin: 10px 0 4px; }
.content-type { display: flex; gap: 6px; flex-wrap: wrap; }
.content-nums { display: flex; gap: 14px; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.content-nums strong { color: var(--text); }
.disc-block { border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
.disc-block summary { cursor: pointer; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.disc-block[open] summary { margin-bottom: 12px; }
.disc-name { font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.topic-list { list-style: none; padding: 0; margin: 12px 0; }
.topic-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.topic-name { flex: 1; min-width: 200px; }
.topic-actions { display: flex; gap: 12px; align-items: center; font-size: .84rem; }
.bncc-stage { border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.bncc-stage summary { cursor: pointer; }
.bncc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 14px; }
.bncc-topics { display: grid; gap: 4px; padding: 6px 0 0 26px; }

/* Questões */
.quiz-wrap { max-width: 860px; margin: 0 auto; }
.quiz-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.quiz-title { font-size: 1.3rem; }
.quiz-progress { color: var(--muted); font-size: .88rem; margin-bottom: 12px; }
.quiz-card { padding: 26px 28px; min-height: 260px; }
.q-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.q-depth { background: linear-gradient(90deg, #7c3aed, var(--primary)); color: #fff; }
.base-text { background: var(--info-soft); border-left: 4px solid var(--info); padding: 14px 16px; border-radius: 10px; margin-bottom: 16px; font-size: .95rem; }
.base-text .bt-title { font-weight: 700; color: var(--info); display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.statement { font-size: 1.04rem; white-space: pre-line; margin-bottom: 18px; }
.alts { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.alt-btn { width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: .12s; }
.alt-btn:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); }
.alt-btn:disabled { cursor: default; }
.alt-letter { flex: none; display: inline-flex; width: 28px; height: 28px; border-radius: 8px; align-items: center; justify-content: center; background: var(--surface-2); font-weight: 700; font-size: .85rem; }
.alt-btn.correct, .alts li.correct { border-color: var(--success); background: var(--success-soft); }
.alt-btn.correct .alt-letter, .alts li.correct .alt-letter { background: var(--success); color: #fff; }
.alt-btn.wrong, .alts li.wrong { border-color: var(--danger); background: var(--danger-soft); }
.alt-btn.wrong .alt-letter, .alts li.wrong .alt-letter { background: var(--danger); color: #fff; }
.alts.readonly li { display: flex; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.feedback { margin-top: 18px; padding: 16px 18px; border-radius: 12px; }
.feedback.ok { background: var(--success-soft); }
.feedback.bad { background: var(--danger-soft); }
.feedback h3 { margin-bottom: 6px; }
.spiral-msg { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--primary); font-weight: 600; font-size: .92rem; }
.spiral-msg .ic { color: var(--primary); width: 22px; height: 22px; }
.quiz-next { display: flex; justify-content: flex-end; margin-top: 16px; }
.loader { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 60px 10px; color: var(--muted); text-align: center; flex-direction: column; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.review-q { border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
.review-q summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.review-q[open] summary { margin-bottom: 12px; }
.review-st { flex: 1; min-width: 200px; }
.review-mark { font-weight: 800; }
.review-q.ok .review-mark { color: var(--success); }
.review-q.bad .review-mark { color: var(--danger); }
.explanation { margin: 12px 0; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; font-size: .92rem; }

/* Resumo */
.summary { font-size: 1rem; line-height: 1.7; }
.summary section { margin-bottom: 18px; }
.summary h2 { margin-top: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.lead { font-size: 1.08rem; color: var(--muted); }

/* Mapa mental */
.mindmap { overflow: auto; border-radius: 12px; background: var(--surface-2); max-height: 72vh; }
.mindmap svg { display: block; }
.mm-node { cursor: pointer; }
.mm-node rect { stroke-width: 1.5; }
.mm-node text { font-family: Inter, system-ui, sans-serif; font-size: 13px; fill: var(--text); }
.mm-node.root text { font-weight: 800; font-size: 14px; fill: #fff; }
.mm-link { fill: none; stroke-width: 2; opacity: .55; }

/* Flashcards */
.flip { perspective: 900px; height: 180px; cursor: pointer; outline: none; }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius); border: 1px solid var(--border); padding: 18px; display: flex; flex-direction: column; justify-content: center; gap: 8px; text-align: center; overflow: auto; }
.flip-front { background: var(--surface); font-weight: 600; }
.flip-back { background: var(--primary-soft); transform: rotateY(180deg); }
.flip:focus-visible .flip-front { box-shadow: 0 0 0 3px var(--primary-soft); }
.review-wrap { max-width: 640px; margin: 0 auto; text-align: center; }
.review-card { min-height: 240px; display: flex; flex-direction: column; justify-content: center; gap: 14px; font-size: 1.08rem; }
.review-front { font-weight: 700; }
.review-back { padding-top: 14px; border-top: 1px dashed var(--border); }
.grade-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grade { flex-direction: column; gap: 0; }
.grade small { font-weight: 500; font-size: .7rem; opacity: .8; }
.g0 { background: var(--danger-soft); color: var(--danger); }
.g3 { background: var(--warning-soft); color: var(--warning); }
.g4 { background: var(--info-soft); color: var(--info); }
.g5 { background: var(--success-soft); color: var(--success); }

/* Trilha */
.trail { list-style: none; margin: 0; padding: 0 0 0 6px; position: relative; }
.trail::before { content: ""; position: absolute; left: 17px; top: 14px; bottom: 14px; width: 2px; background: var(--border); }
.trail-node { position: relative; display: flex; gap: 16px; padding: 10px 0; }
.trail-dot { position: relative; z-index: 1; flex: none; width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--border); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 800; color: #fff; margin-top: 2px; }
.trail-node.andamento .trail-dot { border-color: var(--primary); }
.trail-node.concluido .trail-dot { background: var(--success); border-color: var(--success); }
.trail-node.next .trail-dot { box-shadow: 0 0 0 5px var(--primary-soft); border-color: var(--primary); }
.trail-title { font-weight: 600; margin-bottom: 6px; }
.trail-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border); font-size: .8rem; color: var(--muted); }
.step .ic { width: 14px; height: 14px; }
.step.ok { background: var(--success-soft); border-color: transparent; color: var(--success); }

/* Ranking */
.my-rank { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.big-num { font-size: 1.6rem; color: var(--primary); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; max-width: 620px; margin: 10px auto 22px; }
.podium-col { text-align: center; }
.podium-medal { font-size: 2rem; }
.podium-name { font-weight: 700; }
.podium-bar { margin-top: 8px; border-radius: 12px 12px 4px 4px; background: linear-gradient(180deg, var(--primary), var(--primary-2)); color: #fff; display: grid; place-content: center; }
.p1 .podium-bar { height: 140px; } .p2 .podium-bar { height: 104px; opacity: .9; } .p3 .podium-bar { height: 80px; opacity: .8; }
.podium-bar strong { font-size: 1.5rem; }
.podium-col.me .podium-name { color: var(--primary); }
.rank-table tr.top td { font-weight: 600; }
.rank-table tr.top1 td { background: color-mix(in srgb, #facc15 14%, transparent); }
.rank-table tr.top2 td { background: color-mix(in srgb, #94a3b8 14%, transparent); }
.rank-table tr.top3 td { background: color-mix(in srgb, #d97706 12%, transparent); }
.rank-table tr.me td { box-shadow: inset 3px 0 0 var(--primary); background: var(--primary-soft); }

/* Alertas */
.alert-card h3 { margin: 10px 0 4px; }
.alert-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.alert-head > div { display: flex; gap: 6px; flex-wrap: wrap; }
.alert-card.status-aberto { border-left: 4px solid var(--success); }
.mini-alert, .mini-note { padding: 9px 0; border-bottom: 1px solid var(--border); }
.mini-alert:last-of-type, .mini-note:last-child { border-bottom: 0; }
.mini-note.unread strong::before { content: "● "; color: var(--primary); }
.note-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.note-row:last-child { border-bottom: 0; }
.note-row.unread { background: linear-gradient(90deg, var(--primary-soft), transparent 60%); margin: 0 -22px; padding: 14px 22px; }

/* Pomodoro */
.pomodoro { text-align: center; }
.pomo-time { font-size: 3rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pomo-presets, .pomo-actions { display: flex; gap: 6px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.pomodoro.running .pomo-time { color: var(--primary); }

/* Planos e pagamento */
.pricing { align-items: stretch; }
.price-card { position: relative; display: flex; flex-direction: column; gap: 6px; }
.price-card.highlight { border: 2px solid var(--primary); box-shadow: 0 10px 30px color-mix(in srgb, var(--primary) 18%, transparent); }
.price-card .btn { margin-top: auto; }
.ribbon { position: absolute; top: -12px; right: 16px; background: var(--primary); color: #fff; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.price { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.feature-list { list-style: none; padding: 0; margin: 6px 0 14px; display: grid; gap: 4px; font-size: .88rem; }
.feature-list .no { color: var(--muted); opacity: .7; }
.feature-list .yes::first-letter { color: var(--success); }
.checkout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 920px; margin: 0 auto; }
.checkout.single { grid-template-columns: 1fr; max-width: 720px; }
.summary-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.summary-line.total { font-weight: 800; font-size: 1.15rem; border-bottom: 0; }
.coupon-form { margin-top: 14px; }
.pay-option { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.pay-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.pix-box { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; margin: 14px 0; }
#pixqr { background: #fff; padding: 10px; border-radius: 12px; width: 220px; height: 220px; display: grid; place-items: center; }
#pixqr img, #pixqr canvas { max-width: 100%; }

/* Autenticação e páginas públicas */
.pub-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 32px; max-width: 1200px; margin: 0 auto; }
.pub-header nav { display: flex; gap: 18px; align-items: center; }
.pub-header nav a:not(.btn) { color: var(--text); font-weight: 500; }
.pub-page { max-width: 1200px; margin: 0 auto; padding: 10px 32px 60px; }
.pub-flash { max-width: 520px; margin: 10px auto; }
.pub-footer { text-align: center; padding: 30px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); }
.auth-card { max-width: 460px; margin: 30px auto; padding: 32px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; font-size: .9rem; flex-wrap: wrap; }
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; padding: 50px 0 70px; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 5px 12px; border-radius: 99px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.1; }
.grad { background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.15rem; margin: 18px 0 24px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.hero-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 22px; box-shadow: 0 30px 60px -20px rgba(79, 70, 229, .25); transform: rotate(1.2deg); }
.mock-badge { display: inline-flex; gap: 6px; align-items: center; background: linear-gradient(90deg, #7c3aed, var(--primary)); color: #fff; border-radius: 99px; padding: 3px 12px; font-size: .78rem; font-weight: 700; margin-bottom: 12px; }
.mock-base { background: var(--info-soft); border-left: 4px solid var(--info); padding: 10px 12px; border-radius: 8px; font-size: .88rem; margin-bottom: 12px; }
.mock-st { font-weight: 600; margin-bottom: 10px; }
.mock-alt { padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 7px; font-size: .9rem; }
.mock-alt.ok { border-color: var(--success); background: var(--success-soft); }
.section { padding: 30px 0; }
.section h2 { font-size: 1.8rem; margin-bottom: 26px; }
.feature-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 12px; }
.feature-ic .ic { width: 22px; height: 22px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .row-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow); }
    body.menu-open .sidebar { transform: none; }
    body.menu-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 35; }
    .main { margin-left: 0; }
    .menu-btn { display: inline-flex; }
    .grid-main, .grid-3, .grid-2, .hero, .checkout { grid-template-columns: 1fr; }
    .row-3, .row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero { padding-top: 20px; }
    .hero-card { transform: none; }
}
@media (max-width: 640px) {
    .page, .pub-page { padding: 18px 16px 40px; }
    .topbar { padding: 8px 12px; }
    .pub-header { padding: 12px 16px; }
    .pub-header nav { gap: 10px; }
    .pub-header nav .hide-sm { display: none; }
    .grid-4, .row-2, .row-3, .row-4, .row-6 { grid-template-columns: 1fr; }
    .card { padding: 16px; }
    .quiz-card { padding: 18px; }
    .task { flex-wrap: wrap; }
    .task-actions { width: 100%; padding-left: 36px; }
    .pix-box { grid-template-columns: 1fr; justify-items: center; }
    .grade-buttons { grid-template-columns: repeat(2, 1fr); }
    .meter-row { grid-template-columns: 1fr; gap: 4px; }
    .topbar-title { display: none; }
    .stat-value { font-size: 1.4rem; }
}
@media print {
    .sidebar, .topbar, .tabs, .actions, .actions-row, .page-head .actions, .flash { display: none !important; }
    .main { margin: 0; }
    .card { box-shadow: none; border: 0; }
}

/* ======================= Arena de jogos ======================= */
.arena-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 26px 28px; border-radius: 20px; margin-bottom: 18px; color: #fff; overflow: hidden; position: relative;
    background: radial-gradient(circle at 85% 20%, rgba(236,72,153,.55), transparent 45%), radial-gradient(circle at 10% 90%, rgba(14,165,164,.5), transparent 45%), linear-gradient(120deg, #1e1b4b, #4c1d95); }
.arena-hero h1 { font-size: 2rem; margin: 6px 0; }
.arena-hero p { margin: 0; opacity: .85; max-width: 560px; }
.arena-eyebrow { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; font-size: .8rem; background: rgba(255,255,255,.14); padding: 4px 12px; border-radius: 99px; }
.arena-xp { text-align: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 16px; padding: 14px 22px; backdrop-filter: blur(6px); }
.xp-num { font-size: 2rem; font-weight: 900; background: linear-gradient(90deg, #fde047, #f472b6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.xp-label { font-size: .78rem; opacity: .8; }
.arena-source { display: grid; grid-template-columns: minmax(240px, 1fr) 1.4fr; gap: 18px; align-items: end; }
.source-info { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.source-info > div:nth-child(2) { flex: 1; min-width: 180px; }
.src-badge { width: 46px; height: 46px; border-radius: 12px; background: var(--primary-soft); display: grid; place-items: center; font-size: 1.5rem; }
.arena-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-bottom: 18px; }
.game-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.game-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -18px rgba(79,70,229,.45); }
.game-card.disabled { opacity: .7; }
.gc-art { position: relative; height: 140px; display: grid; place-items: center; overflow: hidden; }
.gc-emoji { font-size: 3.6rem; position: relative; z-index: 2; filter: drop-shadow(0 8px 16px rgba(0,0,0,.4)); animation: gc-float 3s ease-in-out infinite; }
.gc-art i { position: absolute; border-radius: 50%; background: rgba(255,255,255,.7); animation: gc-twinkle 2.4s ease-in-out infinite; }
.gc-art i:nth-child(2) { width: 4px; height: 4px; top: 20%; left: 15%; }
.gc-art i:nth-child(3) { width: 3px; height: 3px; top: 70%; left: 25%; animation-delay: .6s; }
.gc-art i:nth-child(4) { width: 5px; height: 5px; top: 30%; left: 80%; animation-delay: 1.1s; }
.gc-art i:nth-child(5) { width: 3px; height: 3px; top: 75%; left: 70%; animation-delay: 1.6s; }
.gc-art i:nth-child(6) { width: 4px; height: 4px; top: 12%; left: 55%; animation-delay: .3s; }
.gc-asteroides .gc-art { background: radial-gradient(circle at 70% 30%, #c2410c 0 12%, transparent 13%), radial-gradient(circle at 30% 80%, rgba(99,102,241,.6), transparent 50%), linear-gradient(160deg, #050616, #1e1b4b); }
.gc-corrida .gc-art { background: linear-gradient(180deg, #0b0425, #3b0764 45%, #be185d 55%, #12002b 56%), #12002b; }
.gc-corrida .gc-art::after { content: ""; position: absolute; left: -10%; right: -10%; bottom: 0; height: 44%; background: repeating-linear-gradient(90deg, transparent 0 28px, rgba(236,72,153,.5) 28px 30px), repeating-linear-gradient(0deg, transparent 0 12px, rgba(236,72,153,.5) 12px 14px); transform: perspective(120px) rotateX(55deg); transform-origin: bottom; animation: gc-grid 1s linear infinite; }
.gc-memoria .gc-art { background: radial-gradient(circle at 20% 30%, rgba(124,58,237,.7), transparent 45%), radial-gradient(circle at 80% 70%, rgba(14,165,164,.6), transparent 45%), #0f0c29; }
.gc-bolhas .gc-art { background: radial-gradient(circle at 25% 70%, rgba(255,255,255,.25) 0 10%, transparent 11%), radial-gradient(circle at 75% 35%, rgba(255,255,255,.2) 0 7%, transparent 8%), linear-gradient(180deg, #0369a1, #082f49); }
.gc-enigma .gc-art { background: radial-gradient(circle at 50% 40%, #6d28d9, #1e1b4b 60%, #030712); }
.gc-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.gc-body h3 { margin: 0; font-size: 1.1rem; }
.gc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gc-tag { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); background: var(--primary-soft); padding: 2px 9px; border-radius: 99px; }
.gc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
@keyframes gc-float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }
@keyframes gc-twinkle { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes gc-grid { from { background-position: 0 0, 0 0; } to { background-position: 0 0, 0 14px; } }
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.board h3 { font-size: .95rem; }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: .88rem; }
.board li.me { color: var(--primary); font-weight: 700; }
.need-card { max-width: 640px; margin: 30px auto; }
.need-emoji { font-size: 4rem; }
.play-card .mini-games { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.mini-game { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; background: var(--surface-2); text-align: center; color: var(--text); }
.mini-game:hover { background: var(--primary-soft); text-decoration: none; transform: translateY(-2px); }
.mini-game span { font-size: 1.6rem; }
.mini-game small { font-size: .66rem; line-height: 1.2; color: var(--muted); }

/* Tela do jogo */
.game-shell { background: #070712; border-radius: 18px; overflow: hidden; box-shadow: 0 20px 50px -20px rgba(0,0,0,.6); color: #fff; }
.game-shell:fullscreen { border-radius: 0; display: flex; flex-direction: column; }
.game-shell:fullscreen .game-stage { flex: 1; height: auto; }
.game-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: linear-gradient(90deg, #0f0c29, #1e1452); border-bottom: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; }
.game-name { display: flex; gap: 10px; align-items: center; min-width: 0; }
.game-name > span { font-size: 1.6rem; }
.game-name strong { display: block; font-size: .98rem; }
.game-name small { display: block; color: #a5b4fc; font-size: .75rem; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ghud { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.ghud-score { text-align: right; line-height: 1.05; }
.ghud-score small { font-size: .62rem; letter-spacing: .12em; color: #a5b4fc; }
.ghud-score b { display: block; font-size: 1.45rem; font-weight: 900; font-variant-numeric: tabular-nums; background: linear-gradient(90deg, #fde047, #fb923c); -webkit-background-clip: text; background-clip: text; color: transparent; min-width: 70px; }
.ghud-combo { font-weight: 900; font-size: 1.1rem; color: #f0abfc; min-width: 34px; text-align: center; }
.ghud-combo.hot { color: #fde047; text-shadow: 0 0 12px rgba(253,224,71,.8); }
.ghud-combo.bump { animation: hud-bump .35s ease; }
.ghud-lives .heart { color: #f43f5e; font-style: normal; font-size: 1.15rem; margin-left: 2px; text-shadow: 0 0 10px rgba(244,63,94,.6); }
.ghud-lives .heart.off { color: #475569; text-shadow: none; }
.ghud-extra { font-weight: 700; font-size: .9rem; color: #c7d2fe; background: rgba(255,255,255,.08); padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.ghud-extra.danger { color: #fecaca; background: rgba(244,63,94,.35); animation: hud-pulse .6s infinite alternate; }
@keyframes hud-bump { 50% { transform: scale(1.5); } }
@keyframes hud-pulse { to { background: rgba(244,63,94,.6); } }
.gbar-actions { display: flex; gap: 4px; }
.gbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #fff; font-size: 1rem; cursor: pointer; text-decoration: none !important; }
.gbtn:hover { background: rgba(255,255,255,.16); }
.gbtn.off { opacity: .4; }
.game-stage { position: relative; height: clamp(440px, calc(100vh - 210px), 820px); touch-action: none; user-select: none; -webkit-user-select: none; }
.game-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.game-banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: min(94%, 860px); background: rgba(10,8,30,.78); border: 1px solid rgba(165,180,252,.28); border-radius: 14px; padding: 10px 16px; backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0,0,0,.35); pointer-events: none; z-index: 2; }
.game-banner.in { animation: banner-in .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes banner-in { from { opacity: 0; transform: translate(-50%, -14px) scale(.97); } }
.gb-label { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #a5b4fc; }
.gb-q { font-weight: 700; font-size: clamp(.92rem, 1.6vw, 1.08rem); line-height: 1.35; }
.gb-alts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: .82rem; color: #cbd5e1; }
.gb-alts b { color: #fde047; margin-right: 5px; }
.gb-lanes span { flex: 1; min-width: 120px; }
.game-toast { position: absolute; left: 50%; bottom: 18px; transform: translate(-50%, 20px); max-width: min(92%, 720px); padding: 10px 16px; border-radius: 12px; background: rgba(15,23,42,.9); border: 1px solid rgba(255,255,255,.15); font-weight: 600; font-size: .9rem; text-align: center; opacity: 0; transition: .3s; pointer-events: none; z-index: 3; }
.game-toast.show { opacity: 1; transform: translate(-50%, 0); }
.game-toast.good { border-color: rgba(74,222,128,.6); box-shadow: 0 0 24px rgba(74,222,128,.25); }
.game-toast.bad { border-color: rgba(244,63,94,.7); box-shadow: 0 0 24px rgba(244,63,94,.25); }
.game-toast.info { border-color: rgba(165,180,252,.6); }
.game-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, rgba(79,70,229,.35), rgba(3,7,18,.82)); backdrop-filter: blur(3px); z-index: 5; overflow-y: auto; padding: 16px; }
.game-overlay.in .go-card, .game-overlay.in .go-count { animation: go-in .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes go-in { from { opacity: 0; transform: scale(.8) translateY(20px); } }
.go-card { width: min(520px, 100%); text-align: center; background: linear-gradient(180deg, rgba(30,27,75,.92), rgba(15,12,41,.95)); border: 1px solid rgba(165,180,252,.25); border-radius: 22px; padding: 26px 24px; box-shadow: 0 30px 80px rgba(0,0,0,.55); max-height: 100%; overflow-y: auto; }
.go-card.small { width: min(340px, 100%); }
.go-card.result { width: min(620px, 100%); }
.go-card h2 { font-size: 1.6rem; margin: 6px 0; }
.go-emoji { font-size: 3.2rem; animation: gc-float 3s ease-in-out infinite; }
.go-sub { color: #c7d2fe; margin-bottom: 12px; }
.go-how { text-align: left; margin: 0 auto 14px; padding: 12px 16px 12px 34px; background: rgba(255,255,255,.05); border-radius: 12px; font-size: .9rem; color: #e0e7ff; }
.go-how li { margin: 4px 0; }
.go-src { font-size: .85rem; color: #a5b4fc; margin-bottom: 8px; }
.go-best { margin-bottom: 12px; color: #fde68a; }
.go-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 180px; margin: 6px 4px; padding: 13px 26px; border: 0; border-radius: 14px; font: inherit; font-weight: 800; font-size: 1.05rem; color: #1e1b4b; cursor: pointer; text-decoration: none !important;
    background: linear-gradient(90deg, #fde047, #fb923c); box-shadow: 0 8px 24px rgba(251,146,60,.4); transition: transform .12s; }
.go-btn:hover { transform: translateY(-2px) scale(1.02); }
.go-btn.ghost { background: rgba(255,255,255,.08); color: #fff; box-shadow: none; border: 1px solid rgba(255,255,255,.2); }
.go-hint { font-size: .75rem; color: #818cf8; margin-top: 8px; }
.go-count { font-size: clamp(5rem, 16vw, 9rem); font-weight: 900; color: #fde047; text-shadow: 0 0 40px rgba(253,224,71,.7), 0 6px 0 #b45309; }
.go-count.go { color: #4ade80; text-shadow: 0 0 40px rgba(74,222,128,.7), 0 6px 0 #166534; }
.go-stars { font-size: 2.6rem; letter-spacing: 6px; }
.go-stars span { color: #334155; display: inline-block; }
.go-stars span.on { color: #fde047; text-shadow: 0 0 20px rgba(253,224,71,.8); animation: star-pop .6s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes star-pop { from { transform: scale(0) rotate(-90deg); } }
.go-score { font-size: 3rem; font-weight: 900; font-variant-numeric: tabular-nums; background: linear-gradient(90deg, #fde047, #f472b6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.go-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.go-stats span { background: rgba(255,255,255,.06); border-radius: 12px; padding: 8px 4px; font-size: .72rem; color: #a5b4fc; }
.go-stats b { display: block; font-size: 1.2rem; color: #fff; }
.go-rank { font-size: .9rem; color: #c7d2fe; margin: 8px 0 12px; min-height: 1.4em; }
.go-rank .newbest { color: #fde047; }
.go-review { text-align: left; background: rgba(255,255,255,.05); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; max-height: 260px; overflow-y: auto; }
.go-review h3 { font-size: .95rem; margin-bottom: 8px; }
.rv { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: .86rem; }
.rv:last-child { border-bottom: 0; }
.rv-q { font-weight: 600; margin-bottom: 3px; }
.rv-bad { color: #fda4af; }
.rv-ok { color: #86efac; font-weight: 600; }
.rv-exp { color: #cbd5e1; font-size: .8rem; margin-top: 2px; }
.go-perfect { color: #86efac; margin: 6px 0 12px; }
@media (max-width: 920px) { .arena-source { grid-template-columns: 1fr; } .play-card .mini-games { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) {
    .arena-hero { flex-direction: column; align-items: flex-start; padding: 20px; }
    .game-shell { border-radius: 12px; margin: 0 -8px; }
    .game-bar { gap: 8px; padding: 8px 10px; }
    .game-name small, .gbar-actions [data-fullscreen] { display: none; }
    .ghud { order: 3; width: 100%; justify-content: space-between; margin-left: 0; }
    .game-stage { height: calc(100vh - 230px); min-height: 420px; }
    .go-stats { grid-template-columns: repeat(2, 1fr); }
    .gb-alts { font-size: .75rem; }
}
