/* =========================================================
   TILBILIM — 1-8 sinf o'quvchilari uchun til bilish darajasini
   tekshirish va o'rgatish tizimi
   ---------------------------------------------------------
   DIZAYN TOKENLARI
   Rang:
     --ink        #1B2140  (asosiy matn)
     --blue       #2D5BFF  (asosiy brend rangi)
     --blue-deep  #1B3FCC  (hover/chuqur)
     --gold       #FFB020  (yutuq/yulduz aksenti)
     --green      #16A672  (o'zlashtirilgan)
     --coral      #FF5D5D  (ogohlantirish/xato)
     --paper      #F3F6FF  (fon)
     --white      #FFFFFF
   Shrift:
     Display: 'Comfortaa'  (yumaloq, do'stona sarlavhalar)
     Body:    'Nunito'     (mos, kirill harflarni qo'llab-quvvatlaydi)
   Signature:
     "Yutuq yo'li" — 1 dan 8 sinfgacha bo'lgan yumaloq bekatlar bilan
     chizilgan yo'l, o'quvchining bosqichini ko'rsatadi.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;600;700&family=Nunito:wght@400;600;700;800&display=swap');

:root {
    --ink: #1B2140;
    --ink-soft: #565D82;
    --blue: #2D5BFF;
    --blue-deep: #1B3FCC;
    --blue-pale: #E7ECFF;
    --gold: #FFB020;
    --gold-pale: #FFF3DC;
    --green: #16A672;
    --green-pale: #E1F7EF;
    --coral: #FF5D5D;
    --coral-pale: #FFE9E9;
    --paper: #F3F6FF;
    --white: #FFFFFF;
    --line: #DCE3F7;
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 8px;
    --shadow-card: 0 8px 24px rgba(27, 33, 64, 0.08);
    --shadow-pop: 0 14px 34px rgba(45, 91, 255, 0.18);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
    font-family: 'Comfortaa', 'Nunito', sans-serif;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 0.4em;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; display: block; }

/* ---------- Layout shells ---------- */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Comfortaa', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--blue);
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--blue), var(--blue-deep));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-weight: 600;
    font-size: 0.95rem;
}

.header-nav .student-chip {
    background: var(--blue-pale);
    color: var(--blue-deep);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
}

.page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.page-narrow {
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.eyebrow {
    display: inline-block;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--blue);
    background: var(--blue-pale);
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 14px;
}

/* ---------- Auth (split screen) ---------- */

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
}

@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
}

.auth-visual {
    background: linear-gradient(160deg, var(--blue) 0%, var(--blue-deep) 100%);
    color: var(--white);
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-visual h1 {
    color: var(--white);
    font-size: 2.3rem;
    max-width: 420px;
}

.auth-visual p {
    color: #D7E1FF;
    max-width: 380px;
    font-size: 1.05rem;
}

.auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-card .brand { margin-bottom: 28px; }

/* ---------- Forms ---------- */

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--ink);
}

.field input,
.field select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    background: var(--white);
    color: var(--ink);
    transition: border-color 0.15s ease;
}

.field input:focus,
.field select:focus {
    outline: 3px solid var(--blue-pale);
    border-color: var(--blue);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: 999px;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 0.98rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.btn-primary {
    background: var(--blue);
    color: var(--white);
    box-shadow: var(--shadow-pop);
}
.btn-primary:hover { background: var(--blue-deep); transform: translateY(-1px); }

.btn-secondary {
    background: var(--white);
    color: var(--blue-deep);
    border: 2px solid var(--blue-pale);
}
.btn-secondary:hover { border-color: var(--blue); }

.btn-gold {
    background: var(--gold);
    color: #4A2E00;
    box-shadow: 0 10px 24px rgba(255, 176, 32, 0.28);
}
.btn-gold:hover { transform: translateY(-1px); }

.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Alerts ---------- */

.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 18px;
}
.alert-error { background: var(--coral-pale); color: #A61E1E; }
.alert-success { background: var(--green-pale); color: #0E6B4E; }
.alert-info { background: var(--blue-pale); color: var(--blue-deep); }

/* ---------- Cards ---------- */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 26px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 28px 0;
}

@media (max-width: 720px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
}

.stat-card .num {
    font-family: 'Comfortaa', sans-serif;
    font-size: 1.9rem;
    font-weight: 700;
}

.stat-card .label {
    font-size: 0.85rem;
    color: var(--ink-soft);
    font-weight: 700;
}

.stat-mastered .num { color: var(--green); }
.stat-review .num { color: var(--coral); }
.stat-new .num { color: var(--blue); }
.stat-total .num { color: var(--ink); }

/* ---------- Selector pills (til/sinf tanlash) ---------- */

.pill-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.pill {
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--white);
    border: 2px solid var(--line);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--ink-soft);
    cursor: pointer;
}

.pill.active {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
}

/* =========================================================
   SIGNATURE ELEMENT — "Yutuq yo'li" (Achievement road)
   1-8 sinflarni yumaloq bekatlar bilan bog'laydigan yo'l
   ========================================================= */

.road-wrap {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 30px 20px 10px;
    margin: 28px 0;
    overflow-x: auto;
}

.road {
    display: flex;
    align-items: flex-end;
    gap: 0;
    min-width: 640px;
    position: relative;
    padding-bottom: 10px;
}

.road-station {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.road-station::before {
    content: '';
    position: absolute;
    top: 22px;
    left: -50%;
    width: 100%;
    height: 4px;
    background: var(--line);
    z-index: 0;
}

.road-station:first-child::before { display: none; }

.road-station.is-complete::before,
.road-station.is-current::before {
    background: var(--gold);
}

.road-dot {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--white);
    border: 4px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Comfortaa', sans-serif;
    font-weight: 700;
    color: var(--ink-soft);
    z-index: 1;
    font-size: 1rem;
}

.road-station.is-complete .road-dot {
    background: var(--gold);
    border-color: var(--gold);
    color: #4A2E00;
}

.road-station.is-current .road-dot {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
    box-shadow: 0 0 0 6px var(--blue-pale);
}

.road-label {
    margin-top: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-soft);
    text-align: center;
}

.road-station.is-current .road-label { color: var(--blue-deep); }

/* ---------- Flashcards (lesson) ---------- */

.flash-deck {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.flashcard {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 20px;
    border-top: none;
}

.flashcard .word {
    font-family: 'Comfortaa', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--blue-deep);
}

.flashcard .translation {
    font-weight: 800;
    color: var(--ink);
    margin-top: 4px;
}

.flashcard .example {
    margin-top: 10px;
    font-size: 0.88rem;
    color: var(--ink-soft);
    font-style: italic;
    border-top: 1px dashed var(--line);
    padding-top: 10px;
}

/* ---------- Quiz ---------- */

.quiz-progress {
    font-weight: 800;
    color: var(--blue-deep);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.progress-bar-track {
    background: var(--blue-pale);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 30px;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--blue), var(--gold));
    height: 100%;
    border-radius: 999px;
}

.quiz-question {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 28px;
    margin-bottom: 20px;
}

.quiz-question .qword {
    font-family: 'Comfortaa', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--blue-deep);
    margin-bottom: 4px;
}

.quiz-question .qhint {
    color: var(--ink-soft);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.option-list {
    display: grid;
    gap: 10px;
}

.option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--line);
    background: var(--white);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.98rem;
}

.option input { accent-color: var(--blue); width: 18px; height: 18px; }
.option:hover { border-color: var(--blue); background: var(--blue-pale); }

/* ---------- Result summary ---------- */

.result-hero {
    text-align: center;
    padding: 40px 24px;
    border-radius: var(--radius-lg);
    background: linear-gradient(160deg, var(--blue), var(--blue-deep));
    color: var(--white);
    margin-bottom: 26px;
}

.result-hero .score {
    font-family: 'Comfortaa', sans-serif;
    font-size: 3rem;
    font-weight: 700;
}

.result-hero p { color: #D7E1FF; }

.answer-review {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.answer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--white);
    box-shadow: var(--shadow-card);
    font-weight: 700;
}

.answer-row.wrong { border-left: 5px solid var(--coral); }
.answer-row.correct { border-left: 5px solid var(--green); }

.tag {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
}
.tag-wrong { background: var(--coral-pale); color: #A61E1E; }
.tag-correct { background: var(--green-pale); color: #0E6B4E; }

/* ---------- Table (admin/history) ---------- */

table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

table.data-table th,
table.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}

table.data-table th {
    background: var(--blue-pale);
    color: var(--blue-deep);
    font-weight: 800;
}

table.data-table tr:last-child td { border-bottom: none; }

/* ---------- Empty state ---------- */

.empty-state {
    text-align: center;
    padding: 50px 24px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.empty-state .icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gold-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.6rem;
}

/* ---------- Footer ---------- */

.site-footer {
    text-align: center;
    padding: 24px;
    color: var(--ink-soft);
    font-size: 0.85rem;
}

/* ---------- Accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* =========================================================
   YANGILANISH — Ball (XP) tizimi va interaktiv o'yinlar
   ========================================================= */

.xp-chip {
    background: linear-gradient(120deg, var(--gold-pale), #FFE29A);
    color: #8A5A00;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 800;
}

/* ---------- Card hover polish ---------- */

.card, .stat-card, .flashcard, .quiz-question {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(27, 33, 64, 0.12);
}

/* ---------- Flip flashcards (modernized lesson) ---------- */

.flip-deck {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    margin: 24px 0;
}

.flip-card {
    background: transparent;
    height: 190px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.flip-face {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    animation: card-pop 0.2s ease;
}

.flip-back { display: none; }
.flip-card.is-flipped .flip-front { display: none; }
.flip-card.is-flipped .flip-back { display: flex; }

@keyframes card-pop {
    from { transform: scale(0.94); opacity: 0.5; }
    to { transform: scale(1); opacity: 1; }
}

.flip-front {
    background: var(--white);
    align-items: center;
    text-align: center;
}

.flip-front .word {
    font-family: 'Comfortaa', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--blue-deep);
}

.flip-front .tap-hint {
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--ink-soft);
    font-weight: 700;
}

.flip-back {
    background: linear-gradient(150deg, var(--blue), var(--blue-deep));
    color: var(--white);
}

.flip-back .translation {
    font-family: 'Comfortaa', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.flip-back .example {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #D7E1FF;
    font-style: italic;
}

.flip-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--blue-deep);
    font-size: 0.9rem;
    margin: 6px 0 18px;
}

.flip-progress .dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--line);
}
.flip-progress .dot.done { background: var(--gold); }

/* ---------- Gap tuzish o'yini (sentence builder) ---------- */

.game-shell {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 30px;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.game-score {
    font-weight: 800;
    color: var(--gold);
    background: var(--gold-pale);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
}

.game-translation-hint {
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.95rem;
    margin-bottom: 18px;
}

.sentence-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 60px;
    padding: 14px;
    background: var(--paper);
    border: 2px dashed var(--line);
    border-radius: var(--radius-md);
    margin-bottom: 22px;
    align-items: flex-start;
}

.sentence-slots.is-correct {
    border-color: var(--green);
    background: var(--green-pale);
}

.sentence-slots.is-wrong {
    border-color: var(--coral);
    background: var(--coral-pale);
    animation: shake 0.35s ease;
}

.tile-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.word-tile {
    background: var(--blue);
    color: var(--white);
    border: none;
    padding: 11px 18px;
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(45, 91, 255, 0.22);
    transition: transform 0.12s ease;
}

.word-tile:hover { transform: translateY(-2px); }

.word-tile.placed {
    background: var(--white);
    color: var(--ink);
    border: 2px solid var(--line);
    box-shadow: none;
}

.game-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.game-feedback {
    margin-top: 16px;
    font-weight: 800;
    text-align: center;
    font-size: 1rem;
}

.game-feedback.correct { color: var(--green); }
.game-feedback.wrong { color: var(--coral); }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* ---------- Confetti (yutuq animatsiyasi) ---------- */

.confetti-piece {
    position: fixed;
    top: -12px;
    width: 9px;
    height: 14px;
    opacity: 0.9;
    z-index: 999;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(105vh) rotate(540deg);
        opacity: 0.3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .flip-face { animation: none; }
    .confetti-piece { display: none; }
    .sentence-slots.is-wrong { animation: none; }
}

/* =========================================================
   v3 — Reyting, seriya, darajalar, nishonlar, yangi o'yinlar
   ========================================================= */

/* ---------- Streak banner ---------- */

.streak-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(120deg, #FFF3DC, #FFE1B0);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin: 18px 0;
    font-weight: 800;
    color: #8A5A00;
}

.streak-banner .flame { font-size: 1.6rem; }

/* ---------- Level progress ---------- */

.level-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 18px 22px;
    margin: 18px 0;
}

.level-card .level-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.level-card .level-title {
    font-family: 'Comfortaa', sans-serif;
    font-weight: 700;
    color: var(--blue-deep);
    font-size: 1.05rem;
}

.level-card .level-next {
    font-size: 0.82rem;
    color: var(--ink-soft);
    font-weight: 700;
}

.level-track {
    background: var(--blue-pale);
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
}

.level-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--gold));
    border-radius: 999px;
}

/* ---------- Leaderboard ---------- */

.leaderboard-list {
    display: grid;
    gap: 10px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: var(--shadow-card);
}

.leaderboard-row.is-me {
    border: 2px solid var(--blue);
    background: var(--blue-pale);
}

.leaderboard-rank {
    font-family: 'Comfortaa', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--ink-soft);
    width: 34px;
    text-align: center;
}

.leaderboard-row:nth-child(1) .leaderboard-rank { color: #D4A017; }
.leaderboard-row:nth-child(2) .leaderboard-rank { color: #9AA5B1; }
.leaderboard-row:nth-child(3) .leaderboard-rank { color: #B5651D; }

.leaderboard-name {
    flex: 1;
    font-weight: 800;
}

.leaderboard-points {
    font-weight: 800;
    color: var(--gold);
}

.leaderboard-streak {
    font-size: 0.82rem;
    color: var(--ink-soft);
    font-weight: 700;
}

/* ---------- Badges ---------- */

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.badge-tile {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 20px 14px;
    text-align: center;
}

.badge-tile.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.badge-tile .badge-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.badge-tile .badge-name {
    font-weight: 800;
    font-size: 0.9rem;
}

.badge-tile .badge-desc {
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin-top: 4px;
}

.badge-toast {
    position: fixed;
    top: 18px;
    right: 18px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 40px rgba(27, 33, 64, 0.22);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    animation: toast-in 0.3s ease;
    max-width: 320px;
}

@keyframes toast-in {
    from { transform: translateY(-14px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ---------- So'z-rasm (emoji) o'yini ---------- */

.image-option-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 20px 0;
}

.image-option {
    background: var(--white);
    border: 3px solid var(--line);
    border-radius: var(--radius-md);
    padding: 26px 10px;
    font-size: 2.6rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.image-option:hover { transform: translateY(-3px); border-color: var(--blue); }
.image-option.is-correct { border-color: var(--green); background: var(--green-pale); }
.image-option.is-wrong { border-color: var(--coral); background: var(--coral-pale); }

/* ---------- So'z topish (word search) ---------- */

.wordsearch-wrap {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.wordsearch-grid {
    display: grid;
    gap: 3px;
    user-select: none;
    background: var(--line);
    padding: 3px;
    border-radius: var(--radius-sm);
}

.ws-cell {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    font-weight: 800;
    font-family: 'Comfortaa', sans-serif;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.95rem;
}

.ws-cell.selected { background: var(--blue-pale); color: var(--blue-deep); }
.ws-cell.found { background: var(--green); color: var(--white); }

.ws-word-list {
    min-width: 200px;
    display: grid;
    gap: 8px;
}

.ws-word-item {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--white);
    box-shadow: var(--shadow-card);
    font-weight: 700;
}

.ws-word-item.found {
    text-decoration: line-through;
    color: var(--green);
    background: var(--green-pale);
}

/* ---------- Timed challenge ---------- */

.timer-bar-track {
    background: var(--blue-pale);
    border-radius: 999px;
    height: 14px;
    overflow: hidden;
    margin-bottom: 22px;
}

.timer-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--gold), var(--coral));
    transition: width 1s linear;
}

.timed-score {
    text-align: center;
    font-family: 'Comfortaa', sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--blue-deep);
}

/* ---------- Teacher panel filters ---------- */

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.filter-bar select {
    padding: 9px 14px;
    border-radius: 999px;
    border: 2px solid var(--line);
    font-weight: 700;
    background: var(--white);
}

/* ---------- Mobil moslashuv (kengaytirilgan) ---------- */

@media (max-width: 640px) {
    .site-header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px 16px;
    }
    .header-nav {
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        justify-content: flex-start;
    }
    h1 { font-size: 1.6rem; }
    .page, .page-narrow { padding: 24px 16px 60px; }
    .btn { padding: 13px 18px; font-size: 0.95rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .flip-deck, .flash-deck { grid-template-columns: 1fr 1fr; }
    .image-option-grid { grid-template-columns: 1fr 1fr; }
    .ws-cell { width: 26px; height: 26px; font-size: 0.8rem; }
    .wordsearch-wrap { gap: 16px; }
    .option { padding: 15px 16px; } /* kattaroq teginish maydoni */
    .word-tile { padding: 13px 18px; }
}


