/* =====================================================
   KidzTeachKids.com — Main Stylesheet
   Theme switching is done via CSS custom properties.
   js/theme.js writes these values on every page load.
   ===================================================== */

/* ── Default (Space) theme variables ─────────────────
   These are the fallback values used before JS loads.
   js/theme.js overwrites them for other themes.       */
:root {
    --bg:           #050520;
    --bg2:          #0a0a35;
    --primary:      #ffd700;
    --accent:       #4fc3f7;
    --success:      #38ef7d;
    --error:        #ff6b8a;
    --card:         rgba(255,255,255,0.05);
    --card-border:  rgba(79,195,247,0.25);
    --nav-bg:       rgba(5,5,40,0.92);
    --nav-border:   rgba(79,195,247,0.4);
    --hero-grad:    radial-gradient(ellipse at top, #1a0a4e 0%, #050520 100%);
    --text-muted:   #9ab8d8;
    --text-soft:    #b0d4ff;
    --level-bar:    linear-gradient(90deg,#667eea,#764ba2);
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

/* ── Base ────────────────────────────────────────────── */
body {
    font-family: 'Segoe UI', 'Comic Sans MS', cursive, sans-serif;
    background: var(--bg);
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.5s ease;
}

/* ── Star background ─────────────────────────────────── */
#stars-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle var(--duration, 3s) ease-in-out var(--delay, 0s) infinite;
}

@keyframes twinkle {
    0%,100% { opacity: 0.2; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.6); }
}

/* ── Navigation ──────────────────────────────────────── */
#ktk-nav { position: relative; z-index: 100; }

nav#ktk-main-nav {
    background: var(--nav-bg);
    padding: 0 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
    border-bottom: 2px solid var(--nav-border);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.5s, border-color 0.5s;
    gap: 10px;
}

.nav-logo {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
    text-shadow: 0 0 14px var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.5s, text-shadow 0.5s;
}

nav#ktk-main-nav ul.nav-links {
    list-style: none;
    display: flex;
    gap: 4px;
    align-items: center;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

nav#ktk-main-nav ul.nav-links li a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.88em;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 20px;
    transition: all 0.25s;
    border: 2px solid transparent;
    white-space: nowrap;
    display: block;
}

nav#ktk-main-nav ul.nav-links li a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
    border-color: rgba(255,255,255,0.2);
}

nav#ktk-main-nav ul.nav-links li a.active {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: #000;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 3px 14px rgba(255,215,0,0.3);
}

/* Profile button in nav */
.ktk-nav-right { flex-shrink: 0; }

.ktk-profile-btn {
    background: rgba(255,255,255,0.08);
    border: 2px solid var(--card-border);
    border-radius: 25px;
    color: white;
    padding: 5px 12px 5px 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.88em;
    font-weight: 600;
    transition: all 0.25s;
    white-space: nowrap;
}

.ktk-profile-btn:hover {
    background: rgba(255,255,255,0.14);
    border-color: var(--primary);
    transform: scale(1.03);
}

.ktk-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.95em;
    color: white;
    flex-shrink: 0;
}

.ktk-profile-label {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ktk-join-btn {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: #000 !important;
    border-color: transparent !important;
    font-weight: 700;
    padding: 7px 16px;
    box-shadow: 0 3px 14px rgba(255,215,0,0.3);
}

/* Log In button — shown when not logged in */
.ktk-login-btn {
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.2);
    color: var(--text-soft);
    padding: 6px 14px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.ktk-login-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: var(--primary);
    color: #fff;
}

/* Hamburger (mobile) */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    flex-shrink: 0;
}

/* ── Page content wrapper ─────────────────────────────── */
.page-content { position: relative; z-index: 1; }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 65px 20px 50px;
    background: var(--hero-grad);
    position: relative;
    z-index: 1;
    transition: background 0.5s;
}

.hero-emoji {
    font-size: 4.5em;
    display: block;
    margin-bottom: 18px;
    animation: float 3s ease-in-out infinite;
}

.hero h1 {
    font-size: 2.8em;
    color: var(--primary);
    text-shadow: 0 0 28px var(--primary);
    margin-bottom: 14px;
    animation: glow-pulse 2.5s ease-in-out infinite;
    line-height: 1.2;
    transition: color 0.5s;
}

.hero p {
    font-size: 1.18em;
    color: var(--text-soft);
    max-width: 650px;
    margin: 0 auto 28px;
    line-height: 1.75;
    transition: color 0.5s;
}

@keyframes glow-pulse {
    0%,100% { text-shadow: 0 0 14px var(--primary); }
    50%      { text-shadow: 0 0 40px var(--primary), 0 0 70px var(--accent); }
}

@keyframes float {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-18px); }
}

/* ── Section title ────────────────────────────────────── */
.section-title {
    text-align: center;
    font-size: 1.9em;
    color: var(--primary);
    margin: 48px 0 22px;
    text-shadow: 0 0 14px color-mix(in srgb, var(--primary) 50%, transparent);
    position: relative;
    transition: color 0.5s;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--primary), var(--accent));
    margin: 9px auto 0;
    border-radius: 2px;
}

/* ── Cards ────────────────────────────────────────────── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    padding: 15px 35px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: var(--card);
    border-radius: 20px;
    padding: 26px 20px;
    text-align: center;
    border: 2px solid var(--card-border);
    backdrop-filter: blur(10px);
    transition: all 0.35s;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 14px 40px rgba(0,0,0,0.35);
    background: rgba(255,255,255,0.08);
}

.card-emoji { font-size: 2.6em; display: block; margin-bottom: 14px; }
.card h3    { color: var(--accent); margin-bottom: 9px; font-size: 1.15em; transition: color 0.5s; }
.card p     { color: var(--text-muted); font-size: 0.93em; line-height: 1.6; transition: color 0.5s; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: #000;
    border: none;
    padding: 12px 26px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    margin: 7px;
    display: inline-block;
    text-decoration: none;
    letter-spacing: 0.3px;
}

.btn:hover {
    transform: scale(1.07);
    box-shadow: 0 6px 22px rgba(255,215,0,0.4);
}

.btn-outline {
    background: rgba(255,255,255,0.08);
    color: white;
    border: 2px solid rgba(255,255,255,0.25);
}
.btn-outline:hover { border-color: var(--primary); box-shadow: none; }

/* ── Fun fact box ─────────────────────────────────────── */
.fun-fact-box {
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 2px solid var(--card-border);
    border-radius: 20px;
    padding: 24px 32px;
    max-width: 820px;
    margin: 18px auto 38px;
    text-align: center;
}

.fun-fact-box h3 { color: var(--primary); font-size: 1.25em; margin-bottom: 12px; transition: color 0.5s; }
.fun-fact-box p  { color: var(--text-soft); font-size: 1.02em; line-height: 1.75; transition: color 0.5s; }

/* ── Divider ──────────────────────────────────────────── */
.divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--card-border), transparent);
    margin: 28px 0;
}

/* ── Theme Selector (homepage) ────────────────────────── */
.theme-selector-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 30px 40px;
}

.theme-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.theme-select-card {
    background: var(--card);
    border: 2px solid var(--card-border);
    border-radius: 20px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    font-family: inherit;
}

.theme-select-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 10px 28px rgba(0,0,0,0.3);
}

.theme-select-card.selected {
    border-color: var(--primary);
    background: rgba(255,215,0,0.1);
    box-shadow: 0 0 0 4px rgba(255,215,0,0.15);
}

.theme-card-emoji { font-size: 2.8em; display: block; margin-bottom: 10px; }
.theme-card-name  { font-size: 1em; font-weight: 700; color: var(--primary); margin-bottom: 6px; transition: color 0.5s; }
.theme-card-desc  { font-size: 0.8em; color: var(--text-muted); line-height: 1.5; transition: color 0.5s; }

/* Sport sub-selection */
.sport-subpicker {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 14px;
    padding: 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    animation: ktk-fade 0.3s ease;
}

.sport-subpicker.visible { display: grid; }

.sport-sub-btn {
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    padding: 14px 8px;
    cursor: pointer;
    color: white;
    font-family: inherit;
    font-size: 0.85em;
    font-weight: 600;
    text-align: center;
    transition: all 0.25s;
}

.sport-sub-btn:hover, .sport-sub-btn.selected {
    border-color: var(--primary);
    background: rgba(255,215,0,0.1);
    transform: scale(1.04);
}

.sport-sub-btn span { font-size: 2em; display: block; margin-bottom: 6px; }

/* ── Classes page ─────────────────────────────────────── */
.class-section { max-width: 1100px; margin: 28px auto 48px; padding: 0 28px; }

.class-header {
    background: var(--card);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 22px;
    border: 2px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: background 0.5s, border-color 0.5s;
}

.class-header-emoji { font-size: 3.8em; flex-shrink: 0; }
.class-header h2    { color: var(--primary); font-size: 1.75em; margin-bottom: 7px; transition: color 0.5s; }
.class-header p     { color: var(--text-soft); font-size: 1.02em; line-height: 1.65; transition: color 0.5s; }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px; }

.topic-card {
    background: var(--card);
    border: 2px solid var(--card-border);
    border-radius: 18px;
    padding: 20px 16px;
    transition: all 0.3s;
}

.topic-card:hover {
    border-color: var(--primary);
    background: rgba(255,255,255,0.07);
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.topic-emoji    { font-size: 2em; display: block; margin-bottom: 9px; }
.topic-card h4  { color: var(--primary); font-size: 1.05em; margin-bottom: 7px; transition: color 0.5s; }
.topic-card p   { color: var(--text-muted); font-size: 0.87em; line-height: 1.6; transition: color 0.5s; }

.example-box {
    background: rgba(255,255,255,0.05);
    border-left: 3px solid var(--primary);
    border-radius: 8px;
    padding: 8px 11px;
    margin-top: 10px;
    font-size: 0.83em;
    color: var(--primary);
    font-style: italic;
    transition: border-color 0.5s, color 0.5s;
}

/* Times table */
#times-table { width: 100%; border-collapse: collapse; text-align: center; font-size: 0.88em; }
#times-table th { padding: 7px; background: rgba(255,255,255,0.06); color: var(--primary); border-radius: 6px; }
#times-table td { padding: 7px; border-radius: 6px; color: white; font-weight: 600; cursor: default; transition: all 0.2s; }

/* ── Games page ───────────────────────────────────────── */
.games-header { text-align: center; padding: 45px 20px 15px; }
.games-header h1 { font-size: 2.6em; color: var(--primary); animation: glow-pulse 2.5s ease-in-out infinite; margin-bottom: 10px; transition: color 0.5s; }
.games-header p  { color: var(--text-soft); font-size: 1.1em; max-width: 580px; margin: 0 auto; transition: color 0.5s; }

/* Level selector */
.level-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px 0;
    flex-wrap: wrap;
}

.level-btn {
    background: var(--card);
    border: 2px solid var(--card-border);
    border-radius: 14px;
    padding: 12px 16px;
    cursor: pointer;
    color: white;
    font-family: inherit;
    font-size: 0.88em;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s;
    min-width: 95px;
    position: relative;
}

.level-btn:hover:not(.locked) {
    border-color: var(--primary);
    background: rgba(255,255,255,0.08);
    transform: translateY(-3px);
}

.level-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: #000;
    border-color: transparent;
    box-shadow: 0 4px 18px rgba(255,215,0,0.35);
}

.level-btn.completed::after {
    content: '⭐';
    position: absolute;
    top: -8px;
    right: -6px;
    font-size: 0.9em;
}

.level-btn.locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.level-btn-emoji { font-size: 1.3em; display: block; margin-bottom: 3px; }
.level-btn-name  { font-size: 0.78em; display: block; opacity: 0.85; }

/* Game selector */
.game-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 18px 20px 8px;
    max-width: 880px;
    margin: 0 auto;
}

.game-select-btn {
    background: var(--card);
    border: 2px solid var(--card-border);
    border-radius: 14px;
    padding: 13px 16px;
    cursor: pointer;
    color: white;
    font-family: inherit;
    font-size: 0.88em;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
    min-width: 120px;
}

.game-select-btn:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.35); }

.game-select-btn.active {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
    box-shadow: 0 4px 18px rgba(255,215,0,0.2);
}

.game-btn-emoji { font-size: 1.7em; display: block; margin-bottom: 4px; }

/* Game area */
.game-area {
    display: none;
    max-width: 670px;
    margin: 10px auto 50px;
    background: var(--card);
    border-radius: 24px;
    padding: 32px 28px;
    border: 2px solid var(--card-border);
    text-align: center;
    backdrop-filter: blur(10px);
    animation: ktk-fade 0.4s ease;
    transition: background 0.5s, border-color 0.5s;
}

.game-area.active { display: block; }

.game-title { font-size: 1.65em; color: var(--primary); margin-bottom: 7px; transition: color 0.5s; }
.game-desc  { color: var(--text-muted); font-size: 0.92em; margin-bottom: 18px; transition: color 0.5s; }

/* Scoreboard */
.scoreboard { display: flex; justify-content: center; gap: 24px; margin-bottom: 18px; flex-wrap: wrap; }

.score-item {
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 9px 18px;
    text-align: center;
    min-width: 70px;
}

.score-label { font-size: 0.75em; color: var(--text-muted); display: block; margin-bottom: 2px; transition: color 0.5s; }
.score-value { font-size: 1.55em; font-weight: bold; color: var(--primary); transition: color 0.5s; }

/* Progress bar */
.progress-bar  { width: 100%; height: 17px; background: rgba(255,255,255,0.07); border-radius: 9px; overflow: hidden; margin: 10px 0; }
.progress-fill { height: 100%; background: var(--level-bar); border-radius: 9px; transition: width 0.4s ease; }

/* Question box */
.question-box {
    background: rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 22px 18px;
    margin: 18px 0;
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    border: 1px solid rgba(255,255,255,0.09);
    line-height: 1.5;
}

/* Answer input */
.answer-row { display: flex; justify-content: center; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0; }

.answer-input {
    background: rgba(255,255,255,0.07);
    border: 2px solid var(--accent);
    border-radius: 12px;
    color: white;
    font-size: 1.45em;
    padding: 10px 15px;
    width: 135px;
    text-align: center;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.answer-input:focus { border-color: var(--primary); box-shadow: 0 0 12px rgba(255,215,0,0.25); }

/* Feedback */
.feedback-msg { font-size: 1.2em; min-height: 42px; margin: 12px 0; font-weight: bold; transition: all 0.3s; }
.msg-correct  { color: var(--success); }
.msg-wrong    { color: var(--error); }
.msg-info     { color: var(--accent); }

/* Lives */
.lives-display { font-size: 1.45em; margin: 7px 0; letter-spacing: 4px; }

/* Choices grid */
.choices-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 18px 0; }

.choice-btn {
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    color: white;
    font-size: 1.12em;
    font-weight: 600;
    padding: 17px 10px;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
}

.choice-btn:hover:not(:disabled) { background: rgba(255,255,255,0.12); border-color: var(--accent); transform: scale(1.03); }
.choice-btn:disabled { cursor: default; }
.choice-btn.choice-correct { background: rgba(56,239,125,0.22); border-color: var(--success); color: var(--success); }
.choice-btn.choice-wrong   { background: rgba(255,107,138,0.18); border-color: var(--error); color: var(--error); }

/* Rocket */
.rocket-display { font-size: 4.8em; margin: 8px 0; display: block; transition: all 0.5s; }

@keyframes launch { 0%{transform:translateY(0) scale(1);opacity:1} 100%{transform:translateY(-160px) scale(0.5);opacity:0} }
.launching { animation: launch 0.75s forwards; }

/* Alien grid */
.alien-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 14px 0; }

.alien-card {
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    padding: 9px 5px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.alien-card:hover:not(.blasted) { border-color: var(--error); background: rgba(255,107,138,0.1); transform: scale(1.05); }
.alien-card .alien-face     { font-size: 1.75em; display: block; }
.alien-card .alien-question { color: var(--primary); font-weight: bold; font-size: 0.88em; transition: color 0.5s; }
.alien-card.blasted  { opacity: 0.28; transform: scale(0.8); cursor: default; }
.alien-card.selected { border-color: var(--accent); background: rgba(79,195,247,0.12); }

/* Sequence row */
.sequence-row { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin: 18px 0; }

.seq-num {
    background: rgba(102,126,234,0.18);
    border: 2px solid rgba(102,126,234,0.4);
    border-radius: 12px;
    width: 58px; height: 58px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35em;
    font-weight: bold;
    color: var(--text-soft);
    transition: color 0.5s;
}

.seq-blank { background: rgba(255,215,0,0.08); border: 2px dashed var(--primary); color: var(--primary); }

/* Result screen */
.result-screen { text-align: center; padding: 18px; display: none; }
.result-screen.show { display: block; animation: ktk-fade 0.4s ease; }
.result-emoji  { font-size: 4.8em; display: block; margin-bottom: 14px; }
.result-score  { font-size: 2.8em; font-weight: bold; color: var(--primary); margin-bottom: 9px; transition: color 0.5s; }
.result-msg    { font-size: 1.1em; color: var(--text-soft); margin-bottom: 22px; line-height: 1.6; transition: color 0.5s; }

/* Timer bar */
.timer-bar  { width: 100%; height: 10px; background: rgba(255,255,255,0.07); border-radius: 5px; overflow: hidden; margin: 8px 0; }
.timer-fill { height: 100%; background: linear-gradient(90deg, var(--error), var(--primary)); border-radius: 5px; transition: width 1s linear; }

/* ── Trophy Room ──────────────────────────────────────── */
.trophy-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 20px;
    flex-wrap: wrap;
}

.trophy-stat {
    background: var(--card);
    border: 2px solid var(--card-border);
    border-radius: 18px;
    padding: 20px 30px;
    text-align: center;
    min-width: 130px;
    transition: background 0.5s, border-color 0.5s;
}

.trophy-stat-num   { font-size: 2.5em; font-weight: bold; color: var(--primary); transition: color 0.5s; }
.trophy-stat-label { font-size: 0.88em; color: var(--text-muted); margin-top: 4px; transition: color 0.5s; }

/* Theme tabs */
.tab-row {
    display: flex;
    justify-content: center;
    gap: 9px;
    padding: 10px 20px 18px;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--card);
    border: 2px solid var(--card-border);
    border-radius: 20px;
    padding: 9px 18px;
    cursor: pointer;
    color: white;
    font-family: inherit;
    font-size: 0.88em;
    font-weight: 600;
    transition: all 0.25s;
}

.tab-btn:hover { border-color: var(--primary); background: rgba(255,255,255,0.07); }
.tab-btn.active { background: linear-gradient(135deg, var(--accent), var(--primary)); color: #000; border-color: transparent; }

/* Trophy grid */
.trophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 16px;
    padding: 10px 28px 50px;
    max-width: 1100px;
    margin: 0 auto;
}

.trophy-card {
    background: var(--card);
    border: 2px solid var(--card-border);
    border-radius: 18px;
    padding: 22px 14px;
    text-align: center;
    transition: all 0.35s;
    position: relative;
    overflow: hidden;
}

.trophy-card.earned {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(255,215,0,0.08), rgba(255,255,255,0.04));
    box-shadow: 0 0 20px rgba(255,215,0,0.15);
    cursor: pointer;
}

.trophy-card.earned:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 12px 32px rgba(255,215,0,0.25); }

.trophy-card.locked { opacity: 0.38; filter: grayscale(0.7); }

.trophy-emoji { font-size: 3.2em; display: block; margin-bottom: 10px; }
.trophy-name  { font-size: 0.9em; font-weight: bold; color: var(--primary); margin-bottom: 5px; transition: color 0.5s; }
.trophy-theme { font-size: 0.78em; color: var(--text-muted); margin-bottom: 4px; transition: color 0.5s; }
.trophy-level { font-size: 0.75em; color: var(--accent); transition: color 0.5s; }

.trophy-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.1em;
}

/* ── About page ───────────────────────────────────────── */
.about-section { max-width: 860px; margin: 0 auto; padding: 0 28px 50px; }

.about-card {
    background: var(--card);
    border: 2px solid var(--card-border);
    border-radius: 22px;
    padding: 32px 28px;
    margin-bottom: 24px;
    transition: background 0.5s, border-color 0.5s;
}

.about-card h2 { color: var(--primary); font-size: 1.5em; margin-bottom: 14px; transition: color 0.5s; }
.about-card p  { color: var(--text-soft); line-height: 1.85; font-size: 1.02em; margin-bottom: 12px; transition: color 0.5s; }

/* Timeline */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content:''; position:absolute; left:9px; top:0; bottom:0; width:2px; background:var(--card-border); }

.timeline-item { position: relative; margin-bottom: 22px; }
.timeline-dot  { position:absolute; left:-24px; top:4px; width:14px; height:14px; border-radius:50%; background:var(--primary); border:2px solid var(--bg); transition: background 0.5s, border-color 0.5s; }
.timeline-item h4 { color: var(--primary); margin-bottom: 4px; transition: color 0.5s; }
.timeline-item p  { color: var(--text-muted); font-size: 0.93em; line-height: 1.6; transition: color 0.5s; }

/* ── Scrolling formula strip ──────────────────────────── */
.formula-strip { overflow: hidden; white-space: nowrap; padding: 13px 0; background: rgba(255,255,255,0.03); border-top: 1px solid var(--card-border); border-bottom: 1px solid var(--card-border); margin: 28px 0; }
.formula-strip-inner { display: inline-block; animation: scrollLeft 22s linear infinite; color: var(--accent); font-size: 1.05em; letter-spacing: 3px; opacity: 0.7; transition: color 0.5s; }
@keyframes scrollLeft { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }

/* ── Planet showcase ──────────────────────────────────── */
.planet-showcase { display:flex; justify-content:center; align-items:flex-end; gap:18px; padding:26px 18px; flex-wrap:wrap; }
.planet-item { text-align:center; transition:all 0.3s; }
.planet-item:hover { transform:translateY(-10px); }
.planet-circle { border-radius:50%; margin:0 auto 8px; display:flex; align-items:center; justify-content:center; font-size:2.2em; animation:float var(--float-dur,3s) ease-in-out var(--float-delay,0s) infinite; }
.planet-item span { font-size:0.85em; color:var(--text-muted); display:block; transition:color 0.5s; }

/* ── Fact carousel ────────────────────────────────────── */
.facts-container { max-width: 700px; margin: 0 auto 46px; padding: 0 18px; }
.fact-card { background: var(--card); border: 2px solid var(--card-border); border-radius: 20px; padding: 24px 28px; margin: 14px 0; display: none; animation: ktk-fade 0.5s ease; transition: background 0.5s, border-color 0.5s; }
.fact-card.show { display: block; }
.fact-card h4 { color: var(--primary); font-size: 1.12em; margin-bottom: 9px; transition: color 0.5s; }
.fact-card p  { color: var(--text-soft); line-height: 1.75; font-size: 0.98em; transition: color 0.5s; }
.fact-nav { text-align: center; margin-top: 14px; }

/* ── Teacher cards ────────────────────────────────────── */
.teacher-card { background: var(--card); border: 2px solid var(--card-border); border-radius: 20px; padding: 26px; text-align: center; transition: all 0.3s; }
.teacher-card:hover { transform: translateY(-7px); border-color: var(--accent); box-shadow: 0 12px 28px rgba(0,0,0,0.3); }
.teacher-avatar { font-size: 3.8em; margin-bottom: 14px; display: block; animation: float 4s ease-in-out infinite; }
.teacher-card h3     { color: var(--primary); font-size: 1.15em; margin-bottom: 4px; transition: color 0.5s; }
.teacher-card .subj  { color: var(--accent); font-size: 0.88em; margin-bottom: 10px; transition: color 0.5s; }
.teacher-card p      { color: var(--text-muted); font-size: 0.9em; line-height: 1.6; transition: color 0.5s; }

/* ── CTA section ──────────────────────────────────────── */
.cta-section { text-align:center; padding:55px 20px; background:var(--card); margin:38px 0 0; border-top:2px solid var(--card-border); transition:background 0.5s,border-color 0.5s; }
.cta-section h2 { font-size:2em; color:var(--primary); margin-bottom:14px; transition:color 0.5s; }
.cta-section p  { color:var(--text-soft); font-size:1.08em; margin-bottom:22px; transition:color 0.5s; }

/* ── Footer ───────────────────────────────────────────── */
footer { text-align:center; padding:32px 20px; background:rgba(0,0,0,0.3); border-top:2px solid var(--card-border); color:var(--text-muted); font-size:0.92em; position:relative; z-index:1; transition:border-color 0.5s,color 0.5s; }
footer span { color:var(--primary); transition:color 0.5s; }
footer .safe-note { margin-top:7px; font-size:0.82em; opacity:0.7; }

/* ── Shared modal animations ──────────────────────────── */
@keyframes ktk-fade { from{opacity:0} to{opacity:1} }
@keyframes ktk-pop  { 0%{transform:scale(0.5);opacity:0} 70%{transform:scale(1.05)} 100%{transform:scale(1);opacity:1} }
@keyframes ktk-up   { from{transform:translateX(-50%) translateY(30px);opacity:0} to{transform:translateX(-50%) translateY(0);opacity:1} }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 650px) {
    .nav-hamburger { display: block; }

    nav#ktk-main-nav ul.nav-links {
        display: none;
        position: absolute;
        top: 62px; left: 0; right: 0;
        background: var(--nav-bg);
        flex-direction: column;
        gap: 4px;
        padding: 12px;
        border-bottom: 2px solid var(--nav-border);
        backdrop-filter: blur(16px);
        z-index: 99;
    }

    nav#ktk-main-nav ul.nav-links.open { display: flex; }
    nav#ktk-main-nav ul.nav-links li a { font-size: 1em; padding: 10px 16px; }

    .ktk-profile-label { display: none; }
    .hero h1           { font-size: 1.9em; }
    .hero-emoji        { font-size: 3.2em; }
    .card-grid         { padding: 12px; gap: 12px; }
    .alien-grid        { grid-template-columns: repeat(3, 1fr); }
    .choices-grid      { grid-template-columns: 1fr; }
    .game-area         { padding: 20px 14px; }
    .class-header      { flex-direction: column; text-align: center; }
    .sport-subpicker   { grid-template-columns: 1fr; }
    .trophy-grid       { padding: 8px 14px 40px; }
    .theme-cards-grid  { grid-template-columns: 1fr 1fr; }
}
