/* ===== RESET & STRUCTURAL VARIABLES ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --r: 14px;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    font-size: 15px;
}

/* ===== LAYOUT ===== */
#app {
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

/* ===== TOP BAR ===== */
#topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
}

.topbar-home {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--muted);
    text-decoration: none;
    transition: all 0.18s;
    flex-shrink: 0;
}

.topbar-home:hover {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
}

#block-badge {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 3px 12px;
    border-radius: 20px;
    background: var(--red);
    color: #fff;
    white-space: nowrap;
    min-width: 130px;
    text-align: center;
    transition: background 0.35s ease;
}

#progress {
    flex: 1;
    height: 4px;
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--red), var(--gold));
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 0%;
}

#slide-num {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.font-controls { display: flex; gap: 2px; }

.fc-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fc-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ===== STAGE ===== */
#stage {
    position: relative;
    overflow: hidden;
}

/* ===== SLIDES ===== */
.slide {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 56px;
    overflow-y: auto;
}

.slide.active {
    display: flex;
    animation: fadeUp 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide.active.anim-right  { animation-name: slideRight; }
.slide.active.anim-left   { animation-name: slideLeft; }
.slide.active.anim-scale  { animation-name: fadeScale; }
.slide.active.anim-fade   { animation-name: crossFade; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeScale {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes crossFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===== BOTTOM NAV ===== */
#nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 9px 18px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.nav-btn {
    background: rgba(0,0,0,0.05);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 6px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    font-family: inherit;
}

.nav-btn:hover:not(:disabled) {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.nav-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(0,0,0,0.18);
    cursor: pointer;
    transition: all 0.22s;
    border: none;
    padding: 0;
}

.dot.on {
    background: var(--red);
    width: 16px;
    border-radius: 3px;
}

/* ===== SHARED COMPONENTS ===== */
.tag {
    display: inline-block;
    padding: 3px 13px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 12px;
}

.tag-red    { background: rgba(var(--red-rgb),0.1);    border: 1px solid rgba(var(--red-rgb),0.3);    color: var(--red); }
.tag-gold   { background: rgba(var(--gold-rgb),0.1);    border: 1px solid rgba(var(--gold-rgb),0.3);    color: var(--gold); }
.tag-teal   { background: rgba(var(--teal-rgb),0.1);   border: 1px solid rgba(var(--teal-rgb),0.3);   color: var(--teal); }
.tag-blue   { background: rgba(var(--blue-rgb),0.1);    border: 1px solid rgba(var(--blue-rgb),0.3);    color: var(--blue); }
.tag-purple { background: rgba(var(--purple-rgb),0.1);   border: 1px solid rgba(var(--purple-rgb),0.3);   color: var(--purple); }

.time-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 12px;
    background: rgba(0,0,0,0.05);
    border-radius: 20px;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 18px;
}

.h1 {
    font-size: clamp(24px, 4.2vw, 54px);
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.h2 {
    font-size: clamp(20px, 3.2vw, 38px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 8px;
}

.desc {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 22px;
    text-align: center;
}

.cn { color: var(--cn); }

.card {
    background: rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 22px;
}

.example-box {
    background: rgba(var(--cn-rgb),0.06);
    border: 1px solid rgba(var(--cn-rgb),0.18);
    border-left: 3px solid var(--cn);
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 13px;
    line-height: 1.65;
    color: rgba(0,0,0,0.65);
    margin: 14px 0;
}

.example-box strong { color: var(--cn); }

.key-line {
    padding: 10px 16px;
    background: rgba(var(--red-rgb),0.07);
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
}

.click-hint {
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    margin-top: 8px;
}

/* ===== TITLE SLIDE ===== */
.title-bg-char {
    position: absolute;
    font-size: clamp(180px, 30vw, 360px);
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    opacity: 0.06;
    color: var(--red);
}

.meta-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 12px;
}

.meta-chip {
    padding: 5px 14px;
    background: rgba(0,0,0,0.05);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--muted);
}

/* ===== TIMELINE (overview) ===== */
.tl-bar {
    width: 100%;
    display: flex;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    gap: 2px;
    margin: 20px 0;
}

.tl-seg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.92);
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    padding: 4px;
    gap: 2px;
}

.tl-sub { font-size: 10px; opacity: 0.7; }

/* ===== LESSON BLOCKS GRID ===== */
.blocks-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 860px;
}

.block-card {
    border-left: 3px solid;
    border-radius: 12px;
    padding: 15px 18px;
    background: rgba(0,0,0,0.04);
}

.block-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.block-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.block-time {
    font-size: 11px;
    color: var(--muted);
}

/* ===== VOCAB TABLE ===== */
.vocab-wrap {
    width: 100%;
    max-width: 680px;
    display: flex;
    flex-direction: column;
}

.vtable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
}

.vtable thead th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    padding: 4px 14px;
    text-align: left;
    font-weight: 600;
}

.vrow {
    cursor: pointer;
    transition: background 0.15s, transform 0.12s;
}

.vrow:hover { transform: translateX(3px); }

.vrow td {
    padding: 10px 14px;
    background: rgba(0,0,0,0.04);
    font-size: 13px;
    border-bottom: 0;
    transition: background 0.15s;
}

.vrow:hover td { background: rgba(0,0,0,0.07); }

.vrow td:first-child { border-radius: var(--r) 0 0 var(--r); }
.vrow td:last-child  { border-radius: 0 var(--r) var(--r) 0; }

.vrow .ans {
    color: var(--cn);
    font-size: 1.2em;
    font-weight: 600;
    filter: blur(7px);
    transition: filter 0.25s;
}

.vrow:hover .ans { filter: blur(2px); }

.vrow.open .ans { filter: none; }

.vrow.open td { background: rgba(var(--cn-rgb),0.07); }

.btn-reveal-all {
    align-self: flex-start;
    margin-top: 10px;
    padding: 5px 15px;
    background: transparent;
    border: 1px solid var(--red);
    color: var(--red);
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    transition: all 0.18s;
}

.btn-reveal-all:hover { background: var(--red); color: #fff; }

/* ===== DIALOGUE ===== */
.dialogue {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 540px;
}

.d-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.d-row.student { flex-direction: row-reverse; }

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.av-t { background: var(--red); color: #fff; }
.av-s { background: var(--blue); color: #fff; }
.av-o { background: var(--teal); color: #fff; }

.bubble {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 400px;
    font-size: 13px;
    line-height: 1.55;
}

.bubble.t { background: var(--bg3); border-bottom-left-radius: 3px; }
.bubble.s { background: var(--blue); color: #fff; border-bottom-right-radius: 3px; }

.bubble .cn-big {
    display: block;
    font-size: 1.45em;
    font-weight: 700;
    margin-bottom: 2px;
}

.bubble.t .cn-big { color: var(--cn); }
.bubble.s .cn-big { color: var(--blue-light); }

.bubble .hint {
    font-size: 11px;
    color: var(--muted);
    display: block;
}

.bubble.s .hint { color: rgba(255,255,255,0.6); }

/* ===== REACTION GAME ===== */
.r-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 820px;
}

.r-card {
    background: rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.18s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 78px;
}

.r-card:hover { background: rgba(var(--red-rgb),0.07); border-color: rgba(var(--red-rgb),0.35); transform: scale(1.03); }

.r-card .r-cn { font-size: 1.55em; font-weight: 700; color: var(--cn); }
.r-card .r-ua { font-size: 11px; color: var(--muted); opacity: 0; transition: opacity 0.22s; }

.r-card.open { border-color: rgba(var(--green-rgb),0.35); background: rgba(var(--green-rgb),0.07); }
.r-card.open .r-ua { opacity: 1; color: var(--green); }
.r-card.open .r-cn { color: var(--green); }

.score-row {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.score-num {
    font-size: 18px;
    font-weight: 800;
    color: var(--muted);
}

.score-num span { color: var(--gold); }

.tier {
    padding: 4px 12px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
}

.tier-g { background: rgba(var(--green-rgb),0.1);    border: 1px solid rgba(var(--green-rgb),0.3);   color: var(--green); }
.tier-y { background: rgba(var(--gold-rgb),0.1);    border: 1px solid rgba(var(--gold-rgb),0.3);   color: var(--gold); }
.tier-r { background: rgba(var(--red-rgb),0.1);    border: 1px solid rgba(var(--red-rgb),0.3);   color: var(--red); }

/* ===== AI EXPERIMENT ===== */
.ai-mock {
    width: 290px;
    min-width: 290px;
    background: var(--bg);
    border-radius: 24px;
    border: 1.5px solid rgba(0,0,0,0.1);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
}

.ai-mock-head {
    background: rgba(0,0,0,0.03);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.ai-logo {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: #10a37f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
}

.ai-mock-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 300px; }

.msg-user {
    background: rgba(0,0,0,0.06);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: rgba(0,0,0,0.7);
    line-height: 1.5;
    align-self: flex-end;
    max-width: 90%;
}

.msg-ai {
    background: rgba(var(--teal-rgb),0.08);
    border: 1px solid rgba(var(--teal-rgb),0.2);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: rgba(0,0,0,0.72);
    line-height: 1.55;
}

.msg-ai-label {
    font-size: 10px;
    color: var(--teal);
    font-weight: 700;
    margin-bottom: 5px;
}

.ai-tabs { display: flex; gap: 7px; margin: 0 0 8px; }

.ai-tab {
    padding: 5px 12px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: all 0.18s;
}

.ai-tab.on {
    background: rgba(var(--teal-rgb),0.1);
    border-color: rgba(var(--teal-rgb),0.35);
    color: var(--teal);
}

/* ===== REASONS OVERVIEW ===== */
.reasons-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 860px;
}

.reason-ov {
    border-radius: 14px;
    padding: 18px 10px;
    text-align: center;
    background: rgba(0,0,0,0.04);
    border-top: 3px solid;
    transition: transform 0.2s, background 0.2s;
}

.reason-ov:hover { transform: translateY(-4px); background: rgba(0,0,0,0.07); }

.reason-n { font-size: 2.2em; font-weight: 900; line-height: 1; }
.reason-t { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.45; }

/* ===== REASON DETAIL ===== */
.reason-detail {
    max-width: 700px;
    width: 100%;
    background: rgba(0,0,0,0.03);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 30px 34px;
    position: relative;
}

.reason-bg-num {
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 90px;
    font-weight: 900;
    line-height: 1;
    opacity: 0.07;
    pointer-events: none;
    user-select: none;
}

.reason-heading {
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
}

/* ===== PRIVACY LIST ===== */
.priv-list { display: flex; flex-direction: column; gap: 9px; width: 100%; }

.priv-row {
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(0,0,0,0.04);
    border-radius: 10px;
    padding: 10px 14px;
}

.priv-badge {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.priv-text { font-size: 13px; color: var(--muted); }
.priv-text strong { color: var(--red); }

/* ===== EXERCISE LIST ===== */
.ex-list { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 680px; }

.ex-item {
    background: rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    cursor: pointer;
    transition: border-color 0.18s;
}

.ex-item:hover { border-color: rgba(var(--teal-rgb),0.4); }
.ex-item.open  { border-color: rgba(var(--teal-rgb),0.3); background: rgba(var(--teal-rgb),0.05); }

.ex-num { font-size: 10px; color: var(--muted); margin-bottom: 4px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.ex-ua  { font-size: 14px; color: rgba(0,0,0,0.72); line-height: 1.5; }
.ex-cn  { font-size: 1.25em; color: var(--cn); margin-top: 8px; filter: blur(7px); transition: filter 0.25s; font-weight: 600; }

.ex-item.open .ex-cn { filter: none; }

/* ===== FINAL BLITZ ===== */
.blitz-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 9px;
    width: 100%;
    max-width: 800px;
}

.bl-item {
    background: rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.18s;
    text-align: center;
}

.bl-item:hover { border-color: rgba(var(--gold-rgb),0.4); transform: scale(1.03); }
.bl-item.open  { border-color: rgba(var(--gold-rgb),0.35); background: rgba(var(--gold-rgb),0.07); }

.bl-n  { font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.bl-ua { font-size: 12px; color: rgba(0,0,0,0.6); margin-bottom: 6px; line-height: 1.4; }
.bl-cn { font-size: 1.3em; color: var(--gold); font-weight: 700; filter: blur(6px); transition: filter 0.25s; }

.bl-item.open .bl-cn { filter: none; }

/* ===== SUMMARY ===== */
.sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; max-width: 820px; }

.sum-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin-bottom: 12px; }

.reason-sum-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border-radius: 10px;
    background: rgba(0,0,0,0.04);
    margin-bottom: 6px;
}

.reason-sum-n {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    flex-shrink: 0;
}

.reason-sum-t { font-size: 13px; font-weight: 500; }

.hw-item {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 11px 14px;
    background: rgba(0,0,0,0.04);
    border-radius: 11px;
    margin-bottom: 8px;
}

.hw-n {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hw-t { font-size: 13px; line-height: 1.55; }

.goodbye-block { text-align: center; }

.goodbye-cn {
    font-size: clamp(44px, 8vw, 90px);
    font-weight: 900;
    color: var(--cn);
    line-height: 1;
    margin-bottom: 6px;
}

.vocab-summary {
    background: rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 22px;
    margin-top: 20px;
    text-align: center;
}

.vocab-stat-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
}

/* ===== CHART (Bar via SVG) ===== */
.chart-svg { width: 100%; max-width: 420px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }

/* ===== ICON TINTING ===== */
.slide-icon {
    display: inline-block;
    margin-bottom: 8px;
}

.icon-red {
    filter: grayscale(1) sepia(1) hue-rotate(322deg) saturate(3) brightness(0.8);
}

.icon-gold {
    filter: grayscale(1) sepia(1) hue-rotate(354deg) saturate(3) brightness(0.85);
}

.icon-teal {
    filter: grayscale(1) sepia(1) hue-rotate(137deg) saturate(3) brightness(0.7);
}

.icon-blue {
    filter: grayscale(1) sepia(1) hue-rotate(172deg) saturate(3) brightness(0.7);
}

.icon-green {
    filter: grayscale(1) sepia(1) hue-rotate(104deg) saturate(3) brightness(0.7);
}

.icon-muted {
    filter: grayscale(1) brightness(0.5);
    opacity: 0.4;
}

/* ===== BRAIN BOXES ===== */
.brain-pair {
    display: flex;
    gap: 14px;
    width: 100%;
    max-width: 560px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 16px;
}

.brain-box {
    flex: 1;
    min-width: 200px;
    background: rgba(0,0,0,0.04);
    border-radius: 14px;
    padding: 20px 18px;
    text-align: center;
}

.brain-lbl {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 8px;
}

.brain-t {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}

.brain-t strong { color: var(--text); }

/* ===== SLIDE OVERVIEW ===== */
#overview {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(250, 250, 248, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow-y: auto;
    padding: 24px;
    display: none;
}

#overview.open { display: block; }

.ov-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto 18px;
}

.ov-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.ov-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
    font-family: inherit;
}

.ov-close:hover { background: var(--red); color: #fff; border-color: var(--red); }

.ov-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    max-width: 1200px;
    margin: 0 auto;
}

.ov-thumb {
    border: 2px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    background: var(--bg);
}

.ov-thumb:hover {
    border-color: var(--gold);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.ov-thumb.ov-current {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(var(--red-rgb),0.2);
}

.ov-preview {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    position: relative;
    background: var(--bg);
}

.ov-preview-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 1100px;
    height: 688px;
    transform: scale(var(--ov-scale, 0.2));
    transform-origin: top left;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 56px;
    overflow: hidden;
}

.ov-label {
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    border-top: 1px solid rgba(0,0,0,0.06);
}

.ov-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    border-radius: 5px;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 0 5px;
}

.ov-block-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#btn-overview {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
    flex-shrink: 0;
}

#btn-overview:hover { background: var(--red); border-color: var(--red); }
#btn-overview:hover svg { stroke: #fff; }
#btn-overview svg { stroke: var(--muted); transition: stroke 0.18s; }

/* ===== SPOILER BLOCKS ===== */
.spoiler {
    margin: 10px 0 4px;
    border: 1px dashed rgba(var(--red-rgb),0.3);
    border-radius: 9px;
    padding: 10px 14px;
    cursor: pointer;
    background: rgba(var(--red-rgb),0.04);
    transition: all 0.3s;
}

.spoiler .spoiler-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--red);
    text-align: center;
}

.spoiler .spoiler-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

.spoiler.revealed {
    border-style: solid;
    border-color: rgba(var(--teal-rgb),0.3);
    background: rgba(var(--teal-rgb),0.05);
    cursor: default;
}

.spoiler.revealed .spoiler-label { display: none; }

.spoiler.revealed .spoiler-content {
    max-height: 300px;
    opacity: 1;
    margin-top: 0;
}

/* ===== REASON POLL ===== */
.reason-ov.poll-pick {
    border-top-color: var(--red) !important;
    background: rgba(var(--red-rgb),0.08);
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(var(--red-rgb),0.15);
}

/* ===== COMPLETION BANNER ===== */
.completion-banner {
    text-align: center;
    margin-top: 14px;
    padding: 10px 20px;
    border-radius: 10px;
    background: rgba(var(--green-rgb),0.1);
    border: 1px solid rgba(var(--green-rgb),0.3);
    color: var(--green);
    font-weight: 700;
    font-size: 14px;
    animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

/* ===== TEACHER NOTES ===== */
#notes-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    background: rgba(var(--dark-surface-rgb),0.95);
    color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 14px 24px;
    font-size: 13px;
    line-height: 1.6;
    max-height: 30vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    border-top: 2px solid var(--gold);
}

#notes-panel.open { transform: translateY(0); }

#notes-panel .notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

#notes-panel .notes-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gold);
}

#notes-panel .notes-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
}

#notes-panel .notes-body { white-space: pre-line; }

/* ===== DARK MODE OVERRIDES ===== */

[data-theme="dark"] .nav-btn {
    background: rgba(255,255,255,0.06);
}

[data-theme="dark"] .nav-btn:hover {
    background: rgba(255,255,255,0.12);
}

[data-theme="dark"] .dot {
    background: rgba(255,255,255,0.15);
}

[data-theme="dark"] .dot.on {
    background: var(--teal);
}

[data-theme="dark"] .ov-thumb {
    background: var(--bg2);
    border-color: var(--border);
}

[data-theme="dark"] #overview {
    background: rgba(8, 8, 15, 0.96);
}

[data-theme="dark"] .ai-mock {
    background: var(--bg2);
}

[data-theme="dark"] .example-box {
    color: rgba(255,255,255,0.65);
}

[data-theme="dark"] .msg-user {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
}

[data-theme="dark"] .msg-ai {
    color: rgba(255,255,255,0.72);
}

[data-theme="dark"] .ex-ua {
    color: rgba(255,255,255,0.72);
}

[data-theme="dark"] .bl-ua {
    color: rgba(255,255,255,0.6);
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .slide { padding: 24px 20px; }
    .blocks-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .reasons-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .r-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .blitz-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
    .sum-grid { grid-template-columns: 1fr; gap: 16px; }
    .ov-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .brain-pair { flex-direction: column; align-items: center; }
    .brain-box { min-width: 0; width: 100%; }
    .ai-mock { min-width: 0; width: 100%; }
    .reason-detail { padding: 20px 18px; }
    .bubble { max-width: 300px; }
}

@media (max-width: 480px) {
    .slide { padding: 18px 14px; }
    .blocks-grid { grid-template-columns: 1fr 1fr; }
    .reasons-grid { grid-template-columns: repeat(2, 1fr); }
    .r-grid { grid-template-columns: repeat(2, 1fr); }
    .blitz-grid { grid-template-columns: repeat(2, 1fr); }
    .ov-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .tl-bar { height: 40px; }
    .tl-seg { font-size: 9px; }
    .vocab-wrap { max-width: 100%; }
    .vrow td { padding: 8px 10px; font-size: 12px; }
    .vrow .ans { font-size: 1.1em; }
    .reason-detail { padding: 16px 14px; }
    .dialogue { max-width: 100%; }
    .bubble { max-width: 240px; font-size: 12px; }
    #topbar { padding: 6px 12px; gap: 8px; }
    #block-badge { font-size: 9px; min-width: 90px; padding: 3px 8px; }
    .nav-btn { padding: 5px 14px; font-size: 12px; }
}
