/* ==========================================================================
   EDUPLAY - MODERN DESIGN SYSTEM & STYLESHEET
   Design Theme: Vibrant EdTech Gamification (Cosmic Glassmorphism)
   Typography: Outfit (Headings) & Plus Jakarta Sans (Body)
   ========================================================================== */

:root {
    /* Palette Màu Nền & Bề Mặt */
    --bg-main: #0b0c16;
    --bg-card: #141729;
    --bg-card-hover: #1c2038;
    --bg-subtle: #212644;
    --bg-glass: rgba(20, 23, 41, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(140, 82, 255, 0.45);

    /* Màu Chữ */
    --text-primary: #ffffff;
    --text-secondary: #a3adc4;
    --text-muted: #67718e;

    /* Tông Màu Chủ Đạo & Accent */
    --primary: #8c52ff;
    --primary-light: #b085ff;
    --primary-glow: rgba(140, 82, 255, 0.4);
    --accent: #00d2d3;
    --accent-glow: rgba(0, 210, 211, 0.35);

    /* Màu Môn Học & Trạng Thái */
    --math-color: #8c52ff;
    --english-color: #00d2d3;
    --science-color: #2ed573;
    --logic-color: #ffa502;
    --gold-money: #ffd32a;
    --red-wrong: #ff4757;

    /* 4 Màu Đáp Án Arcade */
    --ans-red: #ff385c;
    --ans-blue: #1389fe;
    --ans-yellow: #ffa502;
    --ans-green: #2ed573;

    /* Typography - Sử dụng 1 font chữ duy nhất Outfit cho toàn bộ hệ thống */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Bo Góc */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 25px rgba(140, 82, 255, 0.35);
    --shadow-btn: 0 4px 0 rgba(0, 0, 0, 0.3);
}

/* Reset Cơ Bản */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(140, 82, 255, 0.14) 0%, transparent 45%),
        radial-gradient(circle at 85% 75%, rgba(0, 210, 211, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 211, 42, 0.05) 0%, transparent 60%);
    background-attachment: fixed;
    line-height: 1.5;
}

/* Canvas Confetti */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

/* Bố cục chính */
.app-wrapper {
    max-width: 1380px;
    margin: 0 auto;
    width: 100%;
    padding: 0.85rem 1.25rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    gap: 0.6rem;
    z-index: 100;
    position: relative;
    max-width: 100%;
    box-sizing: border-box;
}

/* Brand */
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    flex-shrink: 0;
}

.brand-icon-wrapper {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), #5e17eb);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 4px 14px var(--primary-glow);
    transition: transform 0.25s ease;
}

.header-brand:hover .brand-icon-wrapper {
    transform: scale(1.08) rotate(-4deg);
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
    line-height: 1.1;
}

.brand-highlight {
    color: var(--accent);
    text-shadow: 0 0 12px var(--accent-glow);
}

.brand-slogan {
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Main Nav */
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.18rem;
    background: rgba(12, 14, 25, 0.7);
    padding: 0.2rem 0.3rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 1;
    min-width: 0;
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.35rem 0.55rem;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-badge {
    background: var(--accent);
    color: #0b0c16;
    font-size: 0.58rem;
    font-weight: 800;
    padding: 0.05rem 0.3rem;
    border-radius: var(--radius-full);
    line-height: 1.2;
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    max-width: 100%;
}

.player-pill {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--bg-subtle);
    padding: 0.25rem 0.6rem 0.25rem 0.35rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.player-pill:hover {
    border-color: var(--border-highlight);
    background: var(--bg-card-hover);
}

.pill-avatar {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.pill-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pill-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 115px;
}

.pill-level-bar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pill-level-badge {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--gold-money);
    white-space: nowrap;
}

.pill-xp-track {
    width: 32px;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
    overflow: hidden;
    flex-shrink: 0;
}

.pill-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.pill-streak {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    background: rgba(255, 71, 87, 0.15);
    color: #ff6b81;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.btn-icon-subtle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-icon-subtle:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

/* ==========================================================================
   SCREENS DISPLAY LOGIC
   ========================================================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.screen-view {
    display: none;
    flex-direction: column;
    gap: 1.75rem;
    animation: fadeInScreen 0.3s ease forwards;
}

.screen-view.active {
    display: flex;
}

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

/* ==========================================================================
   1. HERO BANNER & DASHBOARD (SCREEN HOME)
   ========================================================================== */
.hero-card {
    display: grid;
    grid-template-columns: 1.25fr 0.85fr;
    background: linear-gradient(135deg, rgba(20, 23, 41, 0.9), rgba(30, 25, 60, 0.7));
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    gap: 1.5rem;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    pointer-events: none;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(140, 82, 255, 0.15);
    border: 1px solid rgba(140, 82, 255, 0.3);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--primary-light);
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.hero-heading {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1.18;
    margin-bottom: 1rem;
    color: #ffffff;
}

.gradient-text {
    background: linear-gradient(135deg, #00d2d3 0%, #8c52ff 50%, #ffd32a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.75rem;
    max-width: 580px;
}

.hero-description strong {
    color: #fff;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Nút bấm chủ đạo */
.btn-primary-glow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: linear-gradient(135deg, var(--primary), #6c2bd9);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    padding: 0.85rem 1.65rem;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px var(--primary-glow), var(--shadow-btn);
    transition: all 0.25s ease;
}

.btn-primary-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(140, 82, 255, 0.6), var(--shadow-btn);
}

.btn-primary-glow:active {
    transform: translateY(2px);
    box-shadow: 0 2px 10px var(--primary-glow);
}

.btn-secondary-glass {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.85rem 1.45rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
}

.btn-secondary-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* Đồ họa tương tác bên phải Hero */
.hero-graphic {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.hero-center-circle {
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, var(--bg-card) 60%, rgba(140, 82, 255, 0.3) 100%);
    border: 2px solid var(--primary-light);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    z-index: 2;
    text-align: center;
    padding: 0.5rem;
    animation: pulseRing 3s infinite ease-in-out;
}

@keyframes pulseRing {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.04);
    }
}

.center-emoji {
    font-size: 2.8rem;
    margin-bottom: 0.2rem;
}

.center-text {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
}

.floating-badge {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    animation: floatAnim 4s ease-in-out infinite;
}

.badge-math { top: 10px; left: 10px; color: var(--math-color); animation-delay: 0s; }
.badge-english { top: 15px; right: 10px; color: var(--english-color); animation-delay: 0.8s; }
.badge-science { bottom: 20px; left: 20px; color: var(--science-color); animation-delay: 1.6s; }
.badge-logic { bottom: 25px; right: 15px; color: var(--logic-color); animation-delay: 2.4s; }
.badge-money { top: 48%; left: -10px; color: var(--gold-money); animation-delay: 3.2s; }

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

/* ==========================================================================
   DASHBOARD GRID (HỒ SƠ + THỬ THÁCH HÔM NAY)
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.profile-card, .daily-challenge-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title-group h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.level-indicator {
    background: rgba(255, 211, 42, 0.15);
    color: var(--gold-money);
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}

.streak-pill {
    background: rgba(255, 71, 87, 0.15);
    color: #ff6b81;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}

/* Customizer trong Profile Card */
.profile-customizer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.picker-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}

.avatar-grid {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    border: 2px solid transparent;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.avatar-btn:hover {
    background: var(--bg-card-hover);
    transform: scale(1.1);
}

.avatar-btn.selected {
    border-color: var(--primary);
    background: rgba(140, 82, 255, 0.25);
    box-shadow: 0 0 10px var(--primary-glow);
}

.input-glow-box {
    display: flex;
    align-items: center;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.4rem 0.75rem;
    gap: 0.5rem;
    transition: border-color 0.2s ease;
}

.input-glow-box:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 12px var(--primary-glow);
}

.input-glow-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
}

.btn-micro {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-micro:hover {
    background: var(--primary-light);
}

/* XP Progress Block */
.xp-progress-block {
    background: rgba(0, 0, 0, 0.25);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.xp-text-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.xp-current-level {
    color: var(--accent);
}

.xp-points {
    color: var(--gold-money);
}

.xp-bar-outer {
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.65rem;
}

.xp-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary), var(--gold-money));
    border-radius: var(--radius-full);
    transition: width 0.5s ease-out;
}

.xp-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Challenge List */
.challenge-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.challenge-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--bg-subtle);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.challenge-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.challenge-item.completed {
    border-color: rgba(46, 213, 115, 0.4);
    background: rgba(46, 213, 115, 0.08);
}

.challenge-check {
    font-size: 1.2rem;
}

.challenge-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.challenge-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.challenge-reward {
    font-size: 0.75rem;
    color: var(--gold-money);
}

.btn-challenge-action {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-challenge-action:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.daily-reward-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(255, 211, 42, 0.1), rgba(255, 159, 26, 0.15));
    border: 1px solid rgba(255, 211, 42, 0.3);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
}

.box-icon {
    font-size: 1.8rem;
}

.box-text {
    display: flex;
    flex-direction: column;
    font-size: 0.82rem;
}

.box-text strong {
    color: var(--gold-money);
}

.box-text span {
    color: var(--text-secondary);
}

/* ==========================================================================
   GAME CARDS GRID (FEATURED GAMES)
   ========================================================================== */
.section-title-wrap {
    text-align: center;
    max-width: 650px;
    margin: 1.5rem auto 1.25rem;
}

.section-title-badge {
    display: inline-block;
    background: rgba(0, 210, 211, 0.12);
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 800;
    padding: 0.25rem 0.85rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.section-heading {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.45rem;
}

.section-sub {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.game-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
}

.game-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-highlight);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 15px var(--primary-glow);
}

.game-card-badge {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
}

.game-card-icon {
    width: 58px;
    height: 58px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    margin-bottom: 1.15rem;
    box-shadow: var(--shadow-sm);
}

.game-card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
}

.game-card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.25rem;
    flex: 1;
}

.game-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.game-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.btn-game-play {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: none;
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-card:hover .btn-game-play {
    background: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Highlight Card Money Master */
.highlight-card {
    border-color: rgba(255, 211, 42, 0.35);
    background: linear-gradient(135deg, rgba(20, 23, 41, 0.95), rgba(40, 32, 10, 0.5));
}

.btn-gold {
    background: var(--gold-money) !important;
    color: #0b0c16 !important;
}

.highlight-card:hover .btn-gold {
    box-shadow: 0 4px 15px rgba(255, 211, 42, 0.5) !important;
}

/* Impact Mini Banner */
.impact-mini-banner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(20, 23, 41, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1rem;
    backdrop-filter: blur(12px);
    flex-wrap: wrap;
    gap: 1rem;
}

.impact-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent);
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.impact-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
}

/* ==========================================================================
   2. GAME HUB (SẢNH CHỜ DANH MỤC TRÒ CHƠI)
   ========================================================================== */
.game-hub-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.hub-game-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hub-item {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    gap: 1.25rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.hub-item:hover {
    transform: translateX(6px);
    border-color: var(--border-highlight);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
}

.hub-item-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.hub-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.hub-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hub-item-header h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
}

.tag-pill {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
}

.tag-gold {
    background: rgba(255, 211, 42, 0.2);
    color: var(--gold-money);
}

.hub-item-content p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.hub-item-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.hub-item-tags span {
    font-size: 0.75rem;
    color: var(--primary-light);
    font-weight: 600;
}

.btn-hub-start {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.65rem 1.35rem;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.hub-item:hover .btn-hub-start {
    box-shadow: 0 4px 15px var(--primary-glow);
    transform: scale(1.05);
}

.special-hub-item {
    border-color: rgba(255, 211, 42, 0.3);
}

/* ==========================================================================
   3. GAMEPLAY SCREEN (MÀN HÌNH CHƠI QUIZ)
   ========================================================================== */
.gameplay-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1.25rem;
}

.btn-back-hub {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-back-hub:hover {
    background: rgba(255, 255, 255, 0.16);
}

.gameplay-title-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.gameplay-badge {
    background: rgba(140, 82, 255, 0.2);
    color: var(--primary-light);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
}

.gameplay-deck-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
}

.gameplay-stats-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.streak-badge-active {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 71, 87, 0.18);
    color: #ff6b81;
    border: 1px solid rgba(255, 71, 87, 0.35);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 800;
    animation: streakGlow 1.2s infinite alternate;
}

@keyframes streakGlow {
    from { box-shadow: 0 0 5px rgba(255, 71, 87, 0.3); }
    to { box-shadow: 0 0 15px rgba(255, 71, 87, 0.7); }
}

.game-score-box {
    background: var(--bg-subtle);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
}

.score-num {
    color: var(--gold-money);
    font-size: 1rem;
    margin-left: 0.3rem;
}

/* Timer Bar */
.gameplay-timer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.5rem;
}

.progress-info {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.progress-info strong {
    color: var(--accent);
    font-size: 1.1rem;
}

/* SVG Circular Timer */
.circular-timer-wrapper {
    position: relative;
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg-circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.timer-progress-circle {
    fill: none;
    stroke: var(--accent);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 264;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.timer-seconds-text {
    position: absolute;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
}

/* Nút AI Hint */
.btn-ai-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 211, 42, 0.15);
    border: 1px solid rgba(255, 211, 42, 0.4);
    color: var(--gold-money);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ai-hint:hover {
    background: rgba(255, 211, 42, 0.25);
    box-shadow: 0 0 15px rgba(255, 211, 42, 0.3);
    transform: scale(1.03);
}

/* Bong Bóng AI Hint */
.ai-hint-bubble {
    background: linear-gradient(135deg, rgba(30, 26, 60, 0.95), rgba(20, 23, 41, 0.95));
    border: 1px solid rgba(140, 82, 255, 0.5);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: fadeInScreen 0.25s ease;
}

.bubble-header {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--primary-light);
    font-size: 0.85rem;
    margin-bottom: 0.45rem;
}

.btn-close-bubble {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
}

.bubble-content {
    font-size: 0.92rem;
    color: #e2e8f0;
    line-height: 1.5;
}

/* Câu Hỏi Container */
.question-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.question-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.45;
    color: #ffffff;
}

/* Answers Grid (4 Ô Đáp Án Kahoot / Quizizz Style) */
.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem;
}

.ans-btn,
.tug-ans-btn {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.4rem;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff !important;
    box-shadow: var(--shadow-sm), var(--shadow-btn);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
    text-align: left;
    width: 100%;
}

.ans-btn.ans-0, .ans-0, .tug-ans-0 {
    background: #ff385c !important;
    background: linear-gradient(135deg, #ff4757, #b81736) !important;
    color: #ffffff !important;
    border-color: rgba(255, 71, 87, 0.4);
}
.ans-btn.ans-1, .ans-1, .tug-ans-1 {
    background: #1389fe !important;
    background: linear-gradient(135deg, #2e86de, #0a56a3) !important;
    color: #ffffff !important;
    border-color: rgba(46, 134, 222, 0.4);
}
.ans-btn.ans-2, .ans-2, .tug-ans-2 {
    background: #ffa502 !important;
    background: linear-gradient(135deg, #ffa502, #b87400) !important;
    color: #1e272e !important;
    border-color: rgba(255, 165, 2, 0.4);
}
.ans-btn.ans-2 .ans-key, .tug-ans-2 .ans-key {
    background: rgba(0, 0, 0, 0.18) !important;
    color: #1e272e !important;
}
.ans-btn.ans-3, .ans-3, .tug-ans-3 {
    background: #2ed573 !important;
    background: linear-gradient(135deg, #2ed573, #1e8e4c) !important;
    color: #ffffff !important;
    border-color: rgba(46, 213, 115, 0.4);
}

.ans-btn:hover,
.tug-ans-btn:hover {
    transform: translateY(-4px);
    filter: brightness(1.1);
}

.ans-btn:active,
.tug-ans-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}

.ans-shape {
    font-size: 1.4rem;
    margin-right: 0.9rem;
}

.ans-label {
    flex: 1;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    line-height: 1.35;
}

.ans-key {
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 800;
}

/* Trạng Thái Đúng / Sai Khi Đã Chọn */
.ans-btn.correct-glow,
.tug-ans-btn.correct-glow {
    border-color: #ffffff !important;
    animation: correctPulse 0.4s ease forwards;
    filter: brightness(1.2);
}

.ans-btn.wrong-shake,
.tug-ans-btn.wrong-shake {
    animation: shakeAnim 0.4s ease forwards;
    opacity: 0.6;
}

.ans-btn.dimmed,
.tug-ans-btn.dimmed {
    opacity: 0.35;
    pointer-events: none;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shakeAnim {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* Feedback Banner Dưới Cùng */
.gameplay-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.5rem;
    gap: 1rem;
    animation: fadeInScreen 0.25s ease;
}

.feedback-banner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
}

.feedback-icon {
    font-size: 2rem;
}

.feedback-text strong {
    font-size: 1.05rem;
    color: #fff;
    display: block;
}

.feedback-text p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.btn-next-question {
    background: linear-gradient(135deg, var(--accent), #0984e3);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 210, 211, 0.4);
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-next-question:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 210, 211, 0.6);
}

/* ==========================================================================
   4. MONEY MASTER SIMULATOR SCREEN
   ========================================================================== */
.money-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.money-stats-board {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.money-stat-pill {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-full);
}

.money-stat-pill .stat-icon {
    font-size: 1.3rem;
}

.stat-text-col {
    display: flex;
    flex-direction: column;
}

.stat-small {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
}

.stat-val {
    font-size: 0.92rem;
    color: #fff;
}

.highlight-pill {
    border-color: rgba(255, 211, 42, 0.4);
    background: rgba(255, 211, 42, 0.1);
}

.highlight-pill .stat-val {
    color: var(--gold-money);
}

.money-scenario-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 211, 42, 0.3);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    max-width: 850px;
    margin: 0 auto;
    width: 100%;
}

.scenario-badge {
    display: inline-block;
    background: rgba(255, 211, 42, 0.15);
    color: var(--gold-money);
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.25rem 0.85rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.75rem;
}

.scenario-title {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.85rem;
}

.scenario-desc {
    font-size: 1.05rem;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.choices-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.money-choice-btn {
    background: var(--bg-subtle);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.85rem;
}

.money-choice-btn:hover {
    border-color: var(--gold-money);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.choice-text {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
}

.choice-cost-badge {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    color: var(--gold-money);
    font-size: 0.82rem;
    font-weight: 800;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
}

.money-feedback-box {
    margin-top: 1.75rem;
    background: rgba(255, 211, 42, 0.1);
    border: 1px solid rgba(255, 211, 42, 0.3);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    animation: fadeInScreen 0.25s ease;
}

.feedback-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gold-money);
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

#money-feedback-text {
    font-size: 0.95rem;
    color: #f1f2f6;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   5. SUMMARY SCREEN (MÀN HÌNH TỔNG KẾT)
   ========================================================================== */
.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.celebrate-emoji {
    font-size: 3.5rem;
    display: inline-block;
    margin-bottom: 0.5rem;
    animation: bounceEmoji 1s infinite alternate;
}

@keyframes bounceEmoji {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.summary-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.35rem;
}

.summary-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.summary-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.box-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
}

.box-value {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: #fff;
}

.highlight-score { color: var(--accent); }
.highlight-xp { color: var(--gold-money); }

/* BẠN VỪA HỌC ĐƯỢC GÌ CONTAINER */
.takeaways-container {
    background: rgba(140, 82, 255, 0.08);
    border: 1px solid rgba(140, 82, 255, 0.25);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: left;
    margin-bottom: 2rem;
}

.takeaways-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.takeaways-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-light);
}

.takeaways-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.takeaway-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.92rem;
    color: #e2e8f0;
    line-height: 1.5;
}

.takeaway-bullet {
    color: var(--accent);
    font-size: 1.1rem;
    line-height: 1;
}

/* New Badge Unlocked */
.new-badge-unlocked {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(255, 211, 42, 0.15), rgba(255, 159, 26, 0.2));
    border: 1px solid var(--gold-money);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
    animation: pulseRing 2s infinite ease-in-out;
}

.unlocked-icon {
    font-size: 2.2rem;
}

.unlocked-text strong {
    color: var(--gold-money);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.unlocked-text p {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
}

.summary-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-pill-subtle {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.85rem 1.4rem;
    border-radius: var(--radius-full);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-pill-subtle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ==========================================================================
   6. KNOWLEDGE CORNER (FLASHCARDS GRID)
   ========================================================================== */
.knowledge-filter-bar {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

.filter-pill {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1.15rem;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.flashcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.35rem;
}

.flashcard {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.25s ease;
}

.flashcard:hover {
    border-color: var(--border-highlight);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.flashcard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flashcard-subject {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
}

.flashcard-icon {
    font-size: 1.5rem;
}

.flashcard-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
}

.flashcard-concept {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.flashcard-formula-box {
    background: var(--bg-main);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    font-family: monospace;
    font-size: 0.88rem;
    color: var(--accent);
    font-weight: 700;
}

.flashcard-example {
    font-size: 0.85rem;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-light);
}

.flashcard-protip {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: var(--gold-money);
    line-height: 1.4;
}

/* ==========================================================================
   7. ACHIEVEMENTS SCREEN (THÀNH TÍCH & HUY HIỆU)
   ========================================================================== */
.achieve-overview-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.user-hero-badge {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.user-big-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    box-shadow: var(--shadow-glow);
}

.user-big-info h3 {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.25rem;
}

.user-rank-title {
    color: var(--gold-money);
    font-size: 0.95rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
}

.user-xp-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Ladder Steps */
.ladder-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.85rem;
}

.ladder-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    gap: 0.5rem;
}

.ladder-step {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
}

.ladder-step.current-step {
    border-color: var(--gold-money);
    background: rgba(255, 211, 42, 0.15);
    box-shadow: 0 0 15px rgba(255, 211, 42, 0.3);
}

.ladder-step.passed-step {
    border-color: rgba(46, 213, 115, 0.35);
    background: rgba(46, 213, 115, 0.08);
}

.step-lvl {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--accent);
}

.step-icon {
    font-size: 1.3rem;
}

.step-name {
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

/* Badges Grid */
.badges-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.badges-heading {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.1rem;
}

.badge-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.55rem;
    transition: all 0.25s ease;
}

.badge-card.unlocked {
    border-color: rgba(255, 211, 42, 0.4);
    background: linear-gradient(135deg, var(--bg-card), rgba(255, 211, 42, 0.05));
    box-shadow: 0 0 15px rgba(255, 211, 42, 0.15);
}

.badge-card.locked {
    opacity: 0.45;
    filter: grayscale(0.8);
}

.badge-card:hover {
    transform: translateY(-4px);
    opacity: 1;
}

.badge-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.badge-card.unlocked .badge-icon-box {
    background: linear-gradient(135deg, rgba(255, 211, 42, 0.2), rgba(255, 159, 26, 0.3));
    box-shadow: 0 0 15px rgba(255, 211, 42, 0.4);
}

.badge-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}

.badge-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.badge-condition {
    font-size: 0.72rem;
    color: var(--primary-light);
    font-weight: 700;
    margin-top: 0.3rem;
}

/* ==========================================================================
   8. SOCIAL IMPACT & USER RESEARCH SCREEN
   ========================================================================== */
.social-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.social-left-col, .social-right-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mission-card, .roadmap-card, .survey-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.mission-icon {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.mission-card h3, .roadmap-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.75rem;
}

.mission-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.roadmap-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1rem;
}

.roadmap-steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.roadmap-steps .step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.roadmap-steps li.step-done .step-num {
    background: var(--science-color);
    color: #0b0c16;
}

.roadmap-steps li.step-active .step-num {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 10px var(--primary-glow);
}

.roadmap-steps li strong {
    color: #fff;
}

/* Survey Form */
.survey-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.survey-icon {
    font-size: 2rem;
}

.survey-header h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
}

.survey-header p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.survey-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e2e8f0;
}

.form-select, .form-textarea {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-select:focus, .form-textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 10px var(--primary-glow);
}

.radio-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip-label {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
}

.chip-label:hover {
    background: var(--bg-card-hover);
}

.btn-full-width {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
}

.survey-thankyou {
    text-align: center;
    padding: 2rem 1rem;
    animation: fadeInScreen 0.3s ease;
}

.ty-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.survey-thankyou h4 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--accent);
    margin-bottom: 0.45rem;
}

.survey-thankyou p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==========================================================================
   AI ASSISTANT MODAL (POPUP GỢI Ý KHI SAI)
   ========================================================================== */
.ai-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 12, 22, 0.75);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 10000;
    animation: fadeInScreen 0.2s ease;
}

.ai-modal-box {
    background: linear-gradient(135deg, #181b30, #131526);
    border: 2px solid rgba(140, 82, 255, 0.6);
    border-radius: var(--radius-lg);
    max-width: 540px;
    width: 100%;
    padding: 1.85rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), var(--shadow-glow);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ai-modal-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.ai-avatar-glow {
    width: 48px;
    height: 48px;
    background: radial-gradient(circle, var(--primary) 0%, #4c1d95 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 0 15px var(--primary-glow);
}

.ai-header-title h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
}

.ai-header-title span {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.ai-modal-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s;
}

.ai-modal-close:hover {
    color: #fff;
}

.ai-encouragement-tag {
    display: inline-block;
    background: rgba(255, 211, 42, 0.15);
    color: var(--gold-money);
    font-size: 0.82rem;
    font-weight: 800;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.75rem;
}

.ai-modal-explanation {
    font-size: 1rem;
    color: #e2e8f0;
    line-height: 1.6;
}

.ai-modal-footer {
    display: flex;
    justify-content: flex-end;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0 0.5rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    font-size: 0.82rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-left strong {
    color: #fff;
    margin-right: 0.5rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLETS & MOBILE)
   ========================================================================== */
@media (max-width: 1340px) {
    .app-header {
        flex-wrap: wrap;
        row-gap: 0.65rem;
        padding: 0.65rem 0.85rem;
    }
    .header-brand {
        order: 1;
    }
    .header-right {
        order: 2;
        margin-left: auto;
    }
    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        overflow-x: auto;
        padding: 0.3rem 0.5rem;
        background: rgba(12, 14, 25, 0.85);
    }
}

@media (max-width: 960px) {
    .hero-card {
        grid-template-columns: 1fr;
    }
    .hero-graphic {
        display: none;
    }
    .dashboard-grid, .social-grid {
        grid-template-columns: 1fr;
    }
    .summary-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 0.5rem 0.65rem;
        gap: 0.5rem;
    }
    .main-nav {
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-md);
    }
    .pill-details, .h-user-info {
        display: none;
    }
    .pill-streak {
        display: none;
    }
    .btn-header-auth {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 640px) {
    .app-wrapper {
        padding: 0.75rem 0.85rem;
    }
    .hero-heading {
        font-size: 1.85rem;
    }
    .answers-grid {
        grid-template-columns: 1fr;
    }
    .choices-container {
        grid-template-columns: 1fr;
    }
    .gameplay-top-bar {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    .gameplay-stats-group {
        width: 100%;
        justify-content: space-between;
    }
    .money-stats-board {
        width: 100%;
    }
}

/* ==========================================================================
   BỔ SUNG: KÉO CO KIẾN THỨC, LẬT MẢNH GHÉP & VÒNG QUAY MAY MẮN
   (Lấy cảm hứng & phát triển vượt bậc từ giaoviendoimoi.com)
   ========================================================================== */

/* Thẻ Highlight Cho Game Mới */
.highlight-card-red {
    border-color: rgba(255, 71, 87, 0.4) !important;
    background: linear-gradient(135deg, rgba(20, 23, 41, 0.95), rgba(45, 15, 25, 0.5)) !important;
}

.highlight-card-red:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 71, 87, 0.4) !important;
}

.btn-red {
    background: #ff4757 !important;
    color: #fff !important;
}

.highlight-card-blue {
    border-color: rgba(46, 213, 115, 0.4) !important;
    background: linear-gradient(135deg, rgba(20, 23, 41, 0.95), rgba(10, 40, 25, 0.5)) !important;
}

.highlight-card-blue:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(46, 213, 115, 0.4) !important;
}

.btn-green {
    background: #2ed573 !important;
    color: #0b0c16 !important;
    font-weight: 800 !important;
}

/* --------------------------------------------------------------------------
   1. KÉO CO KIẾN THỨC (TUG OF WAR)
   -------------------------------------------------------------------------- */
.tug-arena-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 71, 87, 0.35);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tug-teams-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.tug-team {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    flex: 1;
}

.team-player {
    border-color: rgba(0, 210, 211, 0.4);
    background: rgba(0, 210, 211, 0.08);
}

.team-bot {
    border-color: rgba(255, 71, 87, 0.4);
    background: rgba(255, 71, 87, 0.08);
    flex-direction: row-reverse;
    text-align: right;
}

.team-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
}

.team-meta {
    display: flex;
    flex-direction: column;
}

.team-name {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
}

.team-pull-score {
    font-size: 0.82rem;
    color: var(--gold-money);
    font-weight: 700;
}

.tug-vs-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4757, #ffa502);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 900;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.5);
    flex-shrink: 0;
}

/* Sân Kéo Co & Dây Thừng */
.tug-rope-track-container {
    background: rgba(0, 0, 0, 0.35);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tug-track-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 800;
}

.win-player { color: var(--accent); }
.win-bot { color: #ff6b81; }
.track-label-mid { color: var(--text-muted); }

.tug-rope-track {
    position: relative;
    height: 44px;
    background: linear-gradient(90deg, rgba(0, 210, 211, 0.15) 0%, rgba(20, 23, 41, 0.9) 50%, rgba(255, 71, 87, 0.15) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.tug-center-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ffffff;
    box-shadow: 0 0 8px #fff;
    transform: translateX(-50%);
    z-index: 2;
}

.tug-marker {
    position: absolute;
    top: 20%;
    bottom: 20%;
    width: 2px;
    background: rgba(255, 255, 255, 0.25);
    z-index: 1;
}

.marker-left-1 { left: 35%; }
.marker-left-2 { left: 20%; }
.marker-left-3 { left: 8%; background: var(--accent); width: 3px; }
.marker-right-1 { right: 35%; }
.marker-right-2 { right: 20%; }
.marker-right-3 { right: 8%; background: #ff4757; width: 3px; }

/* Dây Thừng Kéo */
.tug-rope {
    position: absolute;
    left: 0;
    right: 0;
    height: 12px;
    background: repeating-linear-gradient(45deg, #d97706, #d97706 10px, #b45309 10px, #b45309 20px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 3;
}

.rope-flag {
    font-size: 1.8rem;
    transform: translateY(-8px);
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
}

.tug-status-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 600;
}

/* Question Box Kéo Co */
.tug-question-box {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.tug-timer-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.tug-timer-badge {
    background: rgba(255, 71, 87, 0.2);
    color: #ff6b81;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    padding: 0.4rem 0.95rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.tug-q-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.4;
    flex: 1;
}

/* ----------------------------------------------------------
   2. LẬT MẢNH GHÉP BÍ ẨN (MYSTERY PUZZLE)
   ---------------------------------------------------------- */
.puzzle-arena-card {
    background: var(--bg-card);
    border: 1px solid rgba(46, 213, 115, 0.35);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 850px;
    margin: 0 auto;
    width: 100%;
}

.btn-guess-secret {
    background: linear-gradient(135deg, #2ed573, #10ac84) !important;
    color: #0b0c16 !important;
    font-weight: 800 !important;
}

.puzzle-clue-bar {
    background: rgba(46, 213, 115, 0.1);
    border: 1px solid rgba(46, 213, 115, 0.25);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    color: #e2e8f0;
    font-size: 0.95rem;
}

.puzzle-clue-bar strong {
    color: var(--accent);
}

.puzzle-stage {
    position: relative;
    width: 100%;
    min-height: 320px;
    background: #0f172a;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.puzzle-hidden-art {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.puzzle-svg-art {
    width: 100%;
    height: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
}

.puzzle-pieces-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 6px;
    padding: 6px;
    z-index: 10;
}

.puzzle-piece-btn {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    gap: 0.25rem;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
    user-select: none;
}

.puzzle-piece-btn:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, #334155, #1e293b);
    transform: scale(0.97);
}

.puzzle-piece-btn.revealed {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8) rotate(6deg);
    filter: blur(4px);
}

.piece-icon {
    font-size: 1.6rem;
}

.puzzle-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--text-secondary);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.puzzle-hint-guide {
    color: var(--gold-money);
    font-weight: 600;
}

/* Modal Popup Lật Mảnh Ghép & Đoán Từ Khóa */
.puzzle-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 12, 22, 0.78);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 10001;
    animation: fadeInScreen 0.2s ease;
}

.puzzle-modal-box {
    background: linear-gradient(135deg, #1e2238, #131627);
    border: 2px solid rgba(46, 213, 115, 0.6);
    border-radius: var(--radius-lg);
    max-width: 550px;
    width: 100%;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 20px rgba(46, 213, 115, 0.3);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.puzzle-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.puzzle-modal-badge {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}

.puzzle-modal-q {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.4;
}

/* ----------------------------------------------------------
   3. VÒNG QUAY MAY MẮN (LUCKY WHEEL MODAL)
   ---------------------------------------------------------- */
.lucky-wheel-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 12, 22, 0.82);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 10002;
    animation: fadeInScreen 0.25s ease;
}

.wheel-modal-box {
    background: linear-gradient(135deg, #1c1d33, #121324);
    border: 2px solid rgba(255, 211, 42, 0.6);
    border-radius: var(--radius-lg);
    max-width: 440px;
    width: 100%;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 211, 42, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
}

.wheel-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.wheel-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.wheel-canvas-container {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem 0;
}

.wheel-pointer {
    position: absolute;
    top: -12px;
    font-size: 2rem;
    z-index: 5;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

#lucky-wheel-canvas {
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 211, 42, 0.4);
    transition: transform 4s cubic-bezier(0.12, 0.8, 0.15, 1);
}

.wheel-action-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
}

.btn-spin-wheel {
    background: linear-gradient(135deg, #ffd32a, #ff9f1a) !important;
    color: #0b0c16 !important;
    font-weight: 900 !important;
    font-size: 1.05rem !important;
    padding: 0.85rem 2rem !important;
    width: 100%;
    justify-content: center;
}

.wheel-result-text {
    font-size: 0.88rem;
    color: #f1f2f6;
    font-weight: 600;
}

/* ==========================================================================
   ĐẤU TRƯỜNG PHÁO THỦ TRÍ TUỆ (CANNON DUEL: TARGET CLASH)
   ========================================================================== */
.cannon-round-pill {
    background: rgba(255, 165, 2, 0.15);
    border: 1px solid rgba(255, 165, 2, 0.4);
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    color: var(--gold-money);
    font-weight: 700;
}

/* Bảng điểm 4 đội */
.cannon-scoreboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.team-score-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    position: relative;
    transition: all 0.25s ease;
}

.team-score-card.active-turn {
    box-shadow: 0 0 15px rgba(255, 211, 42, 0.4);
    border-color: var(--gold-money);
}

.team-score-card.winner-turn {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.2), rgba(20, 23, 41, 0.95)) !important;
    border-color: #2ed573 !important;
    animation: correctPulse 0.5s ease;
}

.team-player {
    border-color: rgba(0, 210, 211, 0.5);
    background: linear-gradient(135deg, rgba(0, 210, 211, 0.1), var(--bg-card));
}

.team-bot1 {
    border-color: rgba(255, 71, 87, 0.35);
}

.team-bot2 {
    border-color: rgba(255, 211, 42, 0.35);
}

.team-bot3 {
    border-color: rgba(46, 213, 115, 0.35);
}

.team-avatar {
    font-size: 1.6rem;
    line-height: 1;
}

.team-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.team-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-player .team-name {
    color: var(--accent);
}

.team-pts {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
}

.team-status-tag {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.team-player .team-status-tag {
    background: rgba(0, 210, 211, 0.2);
    color: var(--accent);
}

/* Đấu Trường Canvas */
.cannon-arena-wrapper {
    background: var(--bg-card);
    border: 1px solid rgba(255, 165, 2, 0.3);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    flex-direction: column;
}

.cannon-arena-banner {
    background: linear-gradient(90deg, rgba(255, 165, 2, 0.18), rgba(255, 71, 87, 0.18));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.65rem 1.25rem;
    font-size: 0.92rem;
    text-align: center;
    color: #f1f2f6;
    animation: fadeInScreen 0.3s ease;
}

.cannon-arena-banner strong {
    color: var(--gold-money);
}

#cannon-canvas {
    width: 100%;
    height: 400px;
    display: block;
    cursor: crosshair;
    background: linear-gradient(180deg, #070913 0%, #101426 65%, #182038 100%);
}

/* Bảng Điều Khiển Dưới Đáy */
.cannon-controls-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    background: rgba(14, 16, 30, 0.95);
    border-top: 1px solid var(--border-color);
    padding: 0.9rem 1.5rem;
    flex-wrap: wrap;
}

.ctrl-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #cbd5e1;
    font-size: 0.88rem;
    font-weight: 700;
}

.ctrl-group input[type="range"] {
    accent-color: var(--accent);
    cursor: pointer;
    width: 130px;
}

.btn-ctrl-adjust {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-ctrl-adjust:hover {
    background: var(--primary);
}

.ctrl-val-badge {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--gold-money);
    min-width: 44px;
    text-align: center;
}

.btn-fire-cannon {
    background: linear-gradient(135deg, #ff4757, #ff6b81, #ffa502);
    background-size: 200% 200%;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 900;
    padding: 0.85rem 2rem;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 71, 87, 0.45);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    animation: fireButtonPulse 2s infinite ease-in-out;
}

.btn-fire-cannon:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 25px rgba(255, 71, 87, 0.7);
}

.btn-fire-cannon:active {
    transform: translateY(2px) scale(0.98);
}

.btn-fire-cannon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@keyframes fireButtonPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 71, 87, 0.4); }
    50% { box-shadow: 0 0 28px rgba(255, 165, 2, 0.7); }
}

/* Modal Câu Hỏi Cannon */
.cannon-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 7, 15, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1.5rem;
    animation: fadeInScreen 0.25s ease;
}

.cannon-modal-box {
    background: var(--bg-card);
    border: 2px solid rgba(255, 211, 42, 0.45);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 680px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 211, 42, 0.25);
    animation: scaleModalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cannon-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.cannon-winner-badge {
    background: linear-gradient(135deg, rgba(255, 211, 42, 0.2), rgba(255, 159, 26, 0.25));
    border: 1px solid rgba(255, 211, 42, 0.5);
    color: var(--gold-money);
    font-size: 0.85rem;
    font-weight: 800;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
}

.cannon-q-timer {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: #ff4757;
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.4);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
}

.cannon-target-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border-left: 4px solid var(--gold-money);
}

.preview-icon {
    font-size: 1.8rem;
}

.cannon-question-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: #ffffff;
    line-height: 1.45;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Modal Kết Quả Podium */
.results-box {
    text-align: center;
}

.results-trophy-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 0.5rem;
    animation: correctPulse 1.2s infinite ease-in-out;
}

.results-heading {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.35rem;
}

.results-sub {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.podium-rank-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.podium-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    transition: transform 0.2s;
}

.podium-item.rank-1 {
    background: linear-gradient(135deg, rgba(255, 211, 42, 0.18), rgba(20, 23, 41, 0.95));
    border-color: rgba(255, 211, 42, 0.5);
    transform: scale(1.02);
}

.podium-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.podium-medal {
    font-size: 1.6rem;
}

.podium-team-name {
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
}

.podium-item.rank-1 .podium-team-name {
    color: var(--gold-money);
}

.podium-score {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 900;
    color: #fff;
}

.cannon-results-reward {
    background: rgba(0, 210, 211, 0.12);
    border: 1px dashed rgba(0, 210, 211, 0.4);
    padding: 0.85rem;
    border-radius: var(--radius-md);
    color: var(--accent);
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .cannon-scoreboard {
        grid-template-columns: repeat(2, 1fr);
    }
    .cannon-controls-panel {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-fire-cannon {
        justify-content: center;
    }
}

/* ========================================================================== */
/* MULTIPLAYER ROOM & LOBBY SYSTEM (REAL-TIME WEBRTC / P2P)                   */
/* ========================================================================== */

.nav-item-multiplayer {
    position: relative;
    border: 1px solid rgba(0, 210, 211, 0.35) !important;
    background: rgba(0, 210, 211, 0.08) !important;
}

.nav-item-multiplayer:hover {
    background: rgba(0, 210, 211, 0.18) !important;
    box-shadow: 0 0 16px rgba(0, 210, 211, 0.3);
}

.pulse-badge {
    background: linear-gradient(135deg, #ff4757, #ff6b81) !important;
    color: #fff !important;
    animation: liveBadgePulse 1.8s infinite;
}

@keyframes liveBadgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 71, 87, 0);
        transform: scale(1.08);
    }
}

/* Banner Trang Chủ */
.multiplayer-banner-home {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    margin: 1.75rem 0;
    background: linear-gradient(135deg, rgba(20, 24, 45, 0.9), rgba(15, 30, 60, 0.9));
    border: 2px solid rgba(0, 210, 211, 0.45);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 25px rgba(0, 210, 211, 0.2);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.multiplayer-banner-home:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 210, 211, 0.85);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 35px rgba(0, 210, 211, 0.35);
}

.mp-banner-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 210, 211, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.mp-banner-icon {
    font-size: 2.8rem;
    background: linear-gradient(135deg, #00d2d3, #8c52ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 12px rgba(0, 210, 211, 0.6));
    flex-shrink: 0;
}

.mp-banner-text {
    flex: 1;
}

.mp-pill-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: rgba(0, 210, 211, 0.18);
    color: #00d2d3;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    margin-bottom: 0.4rem;
}

.mp-banner-text h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.3rem;
}

.mp-banner-text p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.mp-banner-btn {
    flex-shrink: 0;
}

/* Tabs Bar */
.mp-tabs-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.75rem;
}

.mp-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mp-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.mp-tab-btn.active {
    background: linear-gradient(135deg, rgba(0, 210, 211, 0.2), rgba(140, 82, 255, 0.2));
    border-color: #00d2d3;
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 210, 211, 0.25);
}

.mp-panel {
    display: none;
    animation: fadeInScreen 0.3s ease;
}

.mp-panel.active {
    display: block;
}

/* Setup Card */
.mp-setup-box {
    background: rgba(18, 22, 40, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 680px;
    margin: 0 auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.mp-setup-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mp-header-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #00d2d3, #8c52ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 0 18px rgba(0, 210, 211, 0.4);
}

.mp-setup-header h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 0.25rem;
}

.mp-setup-header p {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.mp-form-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.mp-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mp-form-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
}

.mp-input, .mp-select {
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-md);
    background: rgba(10, 14, 28, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mp-input:focus, .mp-select:focus {
    border-color: #00d2d3;
    box-shadow: 0 0 12px rgba(0, 210, 211, 0.3);
}

.pin-input-large {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    text-align: center;
    letter-spacing: 8px;
    color: #00d2d3;
}

.mp-avatar-picker {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
}

.mp-avatar-btn {
    height: 48px;
    font-size: 1.4rem;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mp-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.mp-avatar-btn.selected {
    border-color: #00d2d3;
    background: rgba(0, 210, 211, 0.2);
    box-shadow: 0 0 12px rgba(0, 210, 211, 0.35);
}

/* Active Room Box */
.mp-active-room-box {
    background: rgba(18, 22, 40, 0.85);
    border: 1px solid rgba(0, 210, 211, 0.35);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 210, 211, 0.15);
}

.mp-room-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(10, 14, 28, 0.85), rgba(15, 25, 45, 0.85));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.mp-pin-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.pin-tag {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 1.5px;
}

.pin-digits-box {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 8px;
    color: #fff;
    text-shadow: 0 0 20px rgba(0, 210, 211, 0.6);
}

.pin-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mp-room-game-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1.1rem;
    background: rgba(0, 210, 211, 0.12);
    border: 1px solid rgba(0, 210, 211, 0.35);
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #00d2d3;
    margin-top: 0.6rem;
    box-shadow: 0 4px 15px rgba(0, 210, 211, 0.15);
    animation: pulseBorder 3s infinite ease-in-out;
}

.mp-pill-dot {
    opacity: 0.5;
    margin: 0 0.1rem;
}

.mp-tag-divider {
    color: rgba(255, 255, 255, 0.25);
    margin: 0 0.6rem;
}

/* Floating Live Multiplayer HUD */
.mp-live-hud {
    position: fixed;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    background: rgba(12, 17, 34, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 210, 211, 0.35);
    border-radius: 999px;
    padding: 0.45rem 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 210, 211, 0.25);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    max-width: 95vw;
    animation: slideDownFade 0.35s ease-out;
}

.mp-hud-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 800;
    color: #00d2d3;
    white-space: nowrap;
}

.mp-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ed573;
    box-shadow: 0 0 8px #2ed573;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

.mp-hud-players {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    overflow-x: auto;
    max-width: 550px;
    padding: 2px 4px;
}

.mp-hud-player-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    transition: transform 0.2s ease;
}

.mp-hud-player-item.is-me {
    border-color: #00d2d3;
    background: rgba(0, 210, 211, 0.2);
    color: #fff;
}

.mp-hud-player-item .hud-score {
    color: #ffd32a;
    font-weight: 800;
}

.mp-share-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-share {
    padding: 0.65rem 1.15rem;
    font-size: 0.88rem;
    font-weight: 700;
}

.btn-bots {
    border-color: rgba(255, 211, 42, 0.4) !important;
    color: #ffd32a !important;
}

.btn-bots:hover {
    background: rgba(255, 211, 42, 0.15) !important;
}

/* Lobby Section & Players Grid */
.mp-lobby-section {
    margin-bottom: 2rem;
}

.mp-lobby-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.mp-lobby-head h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: #fff;
}

.mp-ready-status {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2ed573;
}

.mp-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.mp-player-card {
    background: rgba(10, 14, 28, 0.75);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1.15rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
    animation: fadeInCard 0.3s ease;
}

.mp-player-card:hover {
    transform: translateY(-3px);
}

.mp-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid var(--player-color, #00d2d3);
    box-shadow: 0 0 15px rgba(var(--player-color-rgb, 0, 210, 211), 0.35);
}

.mp-card-name {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-card-badge {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(0, 210, 211, 0.15);
    color: #00d2d3;
}

.mp-card-badge.host {
    background: rgba(255, 211, 42, 0.2);
    color: #ffd32a;
}

.mp-card-badge.bot {
    background: rgba(165, 94, 234, 0.2);
    color: #a55eea;
}

/* Host Bottom Bar */
.mp-host-bottom-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mp-hint-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.88rem;
    text-align: center;
    max-width: 580px;
}

.btn-fire-match {
    padding: 1.1rem 2.5rem !important;
    font-size: 1.15rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.5px;
    animation: fireMatchPulse 2s infinite;
}

@keyframes fireMatchPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 210, 211, 0.5);
    }
    50% {
        box-shadow: 0 0 35px rgba(0, 210, 211, 0.85);
    }
}

/* Client Waiting Card */
.mp-waiting-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(135deg, rgba(10, 14, 28, 0.8), rgba(20, 25, 45, 0.8));
    border: 1px solid rgba(0, 210, 211, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.radar-pulse-icon {
    font-size: 3.5rem;
    display: inline-block;
    margin-bottom: 0.75rem;
    animation: radarFloat 2.5s infinite ease-in-out;
}

@keyframes radarFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.1); }
}

.mp-waiting-card h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.waiting-room-tag {
    display: inline-block;
    padding: 0.35rem 1.25rem;
    border-radius: 999px;
    background: rgba(0, 210, 211, 0.15);
    border: 1px solid rgba(0, 210, 211, 0.35);
    color: #00d2d3;
    font-size: 0.95rem;
    margin-bottom: 0.85rem;
}

.waiting-instruction {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 480px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .multiplayer-banner-home {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 1.25rem;
    }
    .mp-banner-icon {
        margin: 0 auto;
    }
    .mp-room-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 1.25rem;
    }
    .mp-share-actions {
        flex-direction: column;
    }
    .mp-avatar-picker {
        grid-template-columns: repeat(4, 1fr);
    }
    .mp-tabs-bar {
        flex-direction: column;
    }
}

/* ========================================================================== */
/* 2.5. HEAD TILT QUIZ (NGHIÊNG ĐẦU CHỌN ĐÁP ÁN - CAMERA AI)                  */
/* ========================================================================== */

#screen-head-tilt {
    min-height: calc(100vh - 120px);
    display: none;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeInScreen 0.3s ease;
}

#screen-head-tilt.active {
    display: flex;
}

/* Top Status Bar */
.head-tilt-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: rgba(18, 22, 40, 0.7);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.head-tilt-progress-badge {
    background: linear-gradient(135deg, #0984e3, #6c5ce7);
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(9, 132, 227, 0.4);
}

.head-tilt-hint-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 700;
    padding: 0.4rem 1.25rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.head-tilt-controls-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-head-tilt-cam {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 210, 211, 0.15);
    border: 1px solid rgba(0, 210, 211, 0.4);
    color: #00d2d3;
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-head-tilt-cam:hover {
    background: rgba(0, 210, 211, 0.25);
    box-shadow: 0 0 12px rgba(0, 210, 211, 0.35);
}

.btn-head-tilt-sens {
    background: rgba(255, 159, 67, 0.15);
    border-color: rgba(255, 159, 67, 0.45);
    color: #ff9f43;
}

.btn-head-tilt-sens:hover {
    background: rgba(255, 159, 67, 0.28);
    box-shadow: 0 0 12px rgba(255, 159, 67, 0.4);
}

.score-pill-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.score-pill-correct, .score-pill-wrong {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 800;
}

.score-pill-correct {
    background: rgba(46, 213, 115, 0.15);
    border: 1px solid rgba(46, 213, 115, 0.4);
    color: #2ed573;
}

.score-pill-wrong {
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.4);
    color: #ff4757;
}

/* Question Wrapper & Card */
.head-tilt-question-wrapper {
    display: flex;
    justify-content: center;
    margin: 0.75rem 0;
}

.head-tilt-question-card {
    background: #ffffff;
    color: #2d3436;
    padding: 1.75rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(255, 255, 255, 0.2);
    max-width: 900px;
    width: 100%;
    text-align: center;
    border: 3px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.2s ease;
}

.head-tilt-question-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1.35;
    color: #1e272e;
    letter-spacing: -0.3px;
}

/* Arena Layout: 3 Columns */
.head-tilt-arena {
    display: grid;
    grid-template-columns: 1fr 280px 1fr;
    gap: 2rem;
    align-items: center;
    max-width: 1100px;
    margin: 1rem auto;
    width: 100%;
    padding: 0 1rem;
}

/* Answer Cards (Left Blue & Right Orange) */
.head-tilt-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    height: 240px;
    border-radius: 28px;
    cursor: pointer;
    overflow: hidden;
    color: #fff;
    padding: 1.5rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s, border-color 0.25s;
    user-select: none;
}

.head-tilt-card.card-left {
    background: linear-gradient(135deg, #0984e3, #00a8ff);
    border: 4px solid rgba(255, 255, 255, 0.25);
}

.head-tilt-card.card-right {
    background: linear-gradient(135deg, #e17055, #ff7675);
    border: 4px solid rgba(255, 255, 255, 0.25);
}

.head-tilt-card:hover {
    transform: translateY(-4px) scale(1.02);
}

.head-tilt-card.card-left:hover {
    box-shadow: 0 16px 40px rgba(9, 132, 227, 0.5), 0 0 25px rgba(0, 168, 255, 0.4);
}

.head-tilt-card.card-right:hover {
    box-shadow: 0 16px 40px rgba(225, 112, 85, 0.5), 0 0 25px rgba(255, 118, 117, 0.4);
}

/* Tilting / Active State */
.head-tilt-card.is-tilting {
    transform: scale(1.04);
}

.head-tilt-card.card-left.is-tilting {
    border-color: #ffffff;
    box-shadow: 0 0 35px rgba(0, 168, 255, 0.8), 0 0 15px #fff;
}

.head-tilt-card.card-right.is-tilting {
    border-color: #ffffff;
    box-shadow: 0 0 35px rgba(255, 118, 117, 0.8), 0 0 15px #fff;
}

/* Hold Progress Bar */
.choice-hold-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: rgba(0, 0, 0, 0.15);
}

.choice-hold-bar {
    height: 100%;
    width: 0%;
    background: #ffffff;
    transition: width 0.08s linear;
    box-shadow: 0 0 8px #fff;
}

.choice-finger-icon {
    font-size: 3.2rem;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
    transition: transform 0.2s;
}

.head-tilt-card:hover .choice-finger-icon {
    transform: scale(1.15);
}

.choice-text {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    text-align: center;
    color: #ffffff;
    letter-spacing: -0.2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    max-width: 90%;
    word-break: break-word;
}

.choice-key-hint {
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.choice-selected-indicator {
    display: none;
    position: absolute;
    bottom: 12px;
    font-size: 0.82rem;
    font-weight: 900;
    background: #ffffff;
    color: #1e272e;
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.head-tilt-card.selected .choice-selected-indicator {
    display: block;
    animation: popIndicator 0.2s ease;
}

@keyframes popIndicator {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Correct / Wrong Animation States */
.head-tilt-card.card-correct {
    background: linear-gradient(135deg, #10ac84, #1dd1a1) !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 40px rgba(46, 213, 115, 0.9) !important;
    animation: correctPulse 0.5s ease;
}

.head-tilt-card.card-wrong {
    background: linear-gradient(135deg, #ee5253, #ff6b6b) !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 40px rgba(255, 71, 87, 0.9) !important;
    animation: wrongShake 0.4s ease;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

/* Center Webcam Column */
.head-tilt-center-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.webcam-circle-wrapper {
    position: relative;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    overflow: hidden;
    background: #0f1423;
    border: 5px solid #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 210, 211, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.25s, border-color 0.25s;
}

.webcam-circle-wrapper.tilt-left {
    border-color: #00a8ff;
    box-shadow: 0 0 35px rgba(9, 132, 227, 0.8), -15px 0 25px rgba(9, 132, 227, 0.4);
}

.webcam-circle-wrapper.tilt-right {
    border-color: #ff7675;
    box-shadow: 0 0 35px rgba(225, 112, 85, 0.8), 15px 0 25px rgba(225, 112, 85, 0.4);
}

#head-tilt-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Selfie mirror mode */
    border-radius: 50%;
}

#head-tilt-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform: scaleX(-1);
}

.webcam-fallback-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #1e2746 0%, #0c1020 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    color: #fff;
    z-index: 5;
    border-radius: 50%;
}

.fallback-avatar {
    font-size: 3.5rem;
    animation: avatarBob 2s infinite ease-in-out;
}

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

.fallback-text {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.tilt-arrow-indicator {
    background: rgba(10, 14, 28, 0.92);
    border: 1px solid rgba(0, 210, 211, 0.45);
    color: #00d2d3;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 800;
    padding: 0.4rem 1.25rem;
    border-radius: 999px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55), 0 0 15px rgba(0, 210, 211, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    z-index: 10;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.head-tilt-cam-actions {
    text-align: center;
}

.btn-subtle-cam-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.btn-subtle-cam-link:hover {
    color: #00d2d3;
}

/* Explanation Banner */
.head-tilt-explanation-banner {
    background: rgba(18, 22, 40, 0.95);
    border: 2px solid #00d2d3;
    border-radius: var(--radius-md);
    padding: 1rem 1.75rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 210, 211, 0.25);
    animation: slideUpBanner 0.25s ease;
}

@keyframes slideUpBanner {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.explanation-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
}

.explanation-content strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: #00d2d3;
    margin-bottom: 0.2rem;
}

.explanation-content p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

/* Head Tilt Results Modal */
.head-tilt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 10, 20, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1.5rem;
    animation: fadeInScreen 0.2s ease;
}

.head-tilt-modal-box {
    background: linear-gradient(135deg, #151a30, #0f1325);
    border: 2px solid rgba(0, 210, 211, 0.4);
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 100%;
    padding: 2.5rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 210, 211, 0.2);
}

.head-tilt-score-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 210, 211, 0.15) 0%, rgba(140, 82, 255, 0.15) 100%);
    border: 3px solid #00d2d3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 25px rgba(0, 210, 211, 0.35);
}

.circle-score-val {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.circle-score-sub {
    font-size: 0.75rem;
    color: #00d2d3;
    font-weight: 700;
    margin-top: 0.35rem;
}

.head-tilt-rewards-box {
    background: rgba(0, 210, 211, 0.1);
    border: 1px dashed rgba(0, 210, 211, 0.35);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    color: var(--accent);
    font-size: 0.95rem;
}

.head-tilt-modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

@media (max-width: 860px) {
    .head-tilt-arena {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .head-tilt-card {
        height: 150px;
    }
    .webcam-circle-wrapper {
        width: 190px;
        height: 190px;
    }
    .head-tilt-question-title {
        font-size: 1.35rem;
    }
}

/* ==========================================================================
   2.6. DÒ MÌN KIẾN THỨC (MINESWEEPER QUIZ)
   ========================================================================== */
#screen-minesweeper {
    display: none;
    flex-direction: column;
    min-height: calc(100vh - 80px);
    padding: 1.5rem 2rem 3rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

#screen-minesweeper.active {
    display: flex;
}

.minesweeper-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.minesweeper-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.minesweeper-badge {
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: rgba(235, 59, 90, 0.18);
    color: #eb3b5a;
    border: 1px solid rgba(235, 59, 90, 0.35);
}

.minesweeper-heading {
    font-size: 1.65rem;
    font-weight: 900;
    margin: 0;
    background: linear-gradient(135deg, #ffffff, #dcdde1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.minesweeper-stats-cluster {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stat-pill-lives,
.stat-pill-flags,
.stat-pill-score,
.stat-pill-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.stat-pill-lives {
    color: #ff4757;
    border-color: rgba(255, 71, 87, 0.3);
}

.stat-pill-flags {
    color: #ffa502;
    border-color: rgba(255, 165, 2, 0.3);
}

.stat-pill-score {
    color: #2ed573;
    border-color: rgba(46, 213, 115, 0.3);
}

.stat-pill-timer {
    color: #00d2d3;
    border-color: rgba(0, 210, 211, 0.3);
}

/* Toolbar Controls */
.minesweeper-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(15, 20, 35, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    backdrop-filter: blur(12px);
}

.ms-difficulty-selector,
.ms-action-modes {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ms-tool-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.btn-diff-level {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-diff-level.active,
.btn-diff-level:hover {
    background: rgba(0, 210, 211, 0.2);
    border-color: #00d2d3;
    color: #00d2d3;
    box-shadow: 0 0 10px rgba(0, 210, 211, 0.25);
}

.btn-ms-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ms-mode.active {
    background: linear-gradient(135deg, #0984e3, #00d2d3);
    border-color: #00d2d3;
    box-shadow: 0 0 12px rgba(0, 210, 211, 0.4);
}

.btn-ms-radar {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(165, 94, 234, 0.18);
    border: 1px solid rgba(165, 94, 234, 0.45);
    color: #a55eea;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ms-radar:hover {
    background: rgba(165, 94, 234, 0.3);
    box-shadow: 0 0 14px rgba(165, 94, 234, 0.35);
}

.btn-ms-restart {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ms-restart:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* Arena & Grid */
.minesweeper-arena-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.minesweeper-board-card {
    background: radial-gradient(circle at center, #1e272e, #0f1423);
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(0, 0, 0, 0.5);
    max-width: 650px;
    width: 100%;
}

.minesweeper-grid {
    display: grid;
    gap: 8px;
    width: 100%;
    aspect-ratio: 1 / 1;
    user-select: none;
}

.ms-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #2f3640, #1e272e);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

.ms-cell:hover:not(.revealed) {
    transform: translateY(-2px);
    border-color: rgba(0, 210, 211, 0.6);
    box-shadow: 0 6px 12px rgba(0, 210, 211, 0.25);
}

.ms-cell:active:not(.revealed) {
    transform: translateY(1px);
}

/* Revealed Cell */
.ms-cell.revealed {
    background: #0d131f;
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.6);
    cursor: default;
    transform: none;
}

.ms-cell.flagged {
    background: linear-gradient(145deg, #353b48, #272c35);
    border-color: rgba(255, 165, 2, 0.5);
    color: #ffa502;
    animation: flagPop 0.2s ease-out;
}

@keyframes flagPop {
    0% { transform: scale(0.7); }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.ms-cell.defused {
    background: rgba(46, 213, 115, 0.15);
    border-color: #2ed573;
    color: #2ed573;
    animation: defuseGlow 1.5s infinite alternate;
}

@keyframes defuseGlow {
    from { box-shadow: inset 0 0 8px rgba(46, 213, 115, 0.3); }
    to { box-shadow: inset 0 0 16px rgba(46, 213, 115, 0.7); }
}

.ms-cell.exploded {
    background: rgba(255, 71, 87, 0.35);
    border-color: #ff4757;
    animation: cellExplode 0.4s ease-out;
}

@keyframes cellExplode {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Number Colors */
.ms-num-1 { color: #00d2d3; }
.ms-num-2 { color: #2ed573; }
.ms-num-3 { color: #ff4757; }
.ms-num-4 { color: #a55eea; }
.ms-num-5 { color: #ffa502; }
.ms-num-6 { color: #ff6b81; }
.ms-num-7 { color: #eccc68; }
.ms-num-8 { color: #ffffff; }

/* Emergency Defuse Modal */
.ms-defuse-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease-out;
}

.ms-defuse-card {
    background: #111422;
    border: 2px solid #ff4757;
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 0 50px rgba(255, 71, 87, 0.45);
    animation: alarmPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@keyframes alarmPop {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.defuse-alarm-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(255, 71, 87, 0.2);
    border: 1px solid rgba(255, 71, 87, 0.5);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    animation: alarmPulse 1s infinite alternate;
}

@keyframes alarmPulse {
    from { background: rgba(255, 71, 87, 0.15); box-shadow: 0 0 10px rgba(255, 71, 87, 0.2); }
    to { background: rgba(255, 71, 87, 0.35); box-shadow: 0 0 25px rgba(255, 71, 87, 0.6); }
}

.alarm-title {
    color: #ff4757;
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-align: center;
}

.defuse-countdown-bar {
    position: relative;
    height: 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.defuse-countdown-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff4757, #ffa502);
    transition: width 0.1s linear;
}

.defuse-countdown-text {
    position: absolute;
    right: 8px;
    top: -24px;
    font-size: 0.95rem;
    font-weight: 900;
    color: #ff4757;
}

.defuse-question-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.defuse-q-text {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 0;
    color: #fff;
    text-align: center;
}

.defuse-wires-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.btn-wire-choice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.btn-wire-choice:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.35);
}

.wire-choice-0 { border-color: rgba(255, 71, 87, 0.5); }
.wire-choice-0:hover { background: rgba(255, 71, 87, 0.2); border-color: #ff4757; }

.wire-choice-1 { border-color: rgba(0, 210, 211, 0.5); }
.wire-choice-1:hover { background: rgba(0, 210, 211, 0.2); border-color: #00d2d3; }

.wire-choice-2 { border-color: rgba(255, 165, 2, 0.5); }
.wire-choice-2:hover { background: rgba(255, 165, 2, 0.2); border-color: #ffa502; }

.wire-choice-3 { border-color: rgba(46, 213, 115, 0.5); }
.wire-choice-3:hover { background: rgba(46, 213, 115, 0.2); border-color: #2ed573; }

.wire-lead-icon {
    font-size: 1.25rem;
}

.defuse-hint-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
}

/* Result Modal */
.ms-result-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1.5rem;
    animation: fadeIn 0.25s ease-out;
}

.ms-result-card {
    background: #111424;
    border: 2px solid rgba(0, 210, 211, 0.4);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    max-width: 520px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 60px rgba(0, 210, 211, 0.3);
}

.ms-result-icon {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: bounceIcon 1s infinite alternate;
}

@keyframes bounceIcon {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

.ms-result-title {
    font-size: 1.75rem;
    font-weight: 900;
    margin: 0 0 0.5rem;
    color: #fff;
}

.ms-result-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0 0 1.5rem;
}

.ms-result-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.ms-stat-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ms-stat-val {
    font-size: 1.6rem;
    font-weight: 900;
    color: #00d2d3;
    font-family: var(--font-heading);
}

.ms-stat-lbl {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
}

.ms-result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-ms-play-again {
    background: linear-gradient(135deg, #0984e3, #00d2d3);
    border: none;
    color: #fff;
    padding: 0.85rem 1.6rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 210, 211, 0.4);
    transition: transform 0.2s;
}

.btn-ms-play-again:hover {
    transform: translateY(-2px);
}

.btn-ms-back-hub {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.85rem 1.4rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ms-back-hub:hover {
    background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 650px) {
    .minesweeper-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .defuse-wires-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   TEACHER STUDIO & QUESTION CREATOR PORTAL
   ========================================================================== */

.teacher-nav-badge {
    background: linear-gradient(135deg, #10ac84, #1dd1a1);
    color: #0b0c16;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 9999px;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(29, 209, 161, 0.5);
}

/* Thống kê nhanh */
.teacher-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.t-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.t-stat-card:hover {
    border-color: rgba(29, 209, 161, 0.35);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.t-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.t-stat-info {
    display: flex;
    flex-direction: column;
}

.t-stat-number {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.t-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Thanh công cụ Giảng Viên */
.teacher-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
}

.teacher-toolbar-left,
.teacher-toolbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Bố cục Studio 2 cột */
.teacher-studio-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Cột trái: Bộ đề */
.t-decks-column {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
}

.t-column-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    min-width: 0;
}

.t-column-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.t-badge-count {
    background: rgba(140, 82, 255, 0.2);
    color: var(--primary-light);
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 700;
}

.t-search-box input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    color: #fff;
    font-size: 0.88rem;
    outline: none;
    transition: all 0.2s;
}

.t-search-box input:focus {
    border-color: var(--primary);
    background: rgba(140, 82, 255, 0.08);
}

.t-decks-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: calc(100vh - 340px);
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(140, 82, 255, 0.35) rgba(0, 0, 0, 0.15);
}

.t-decks-list::-webkit-scrollbar {
    width: 6px;
}
.t-decks-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 999px;
}
.t-decks-list::-webkit-scrollbar-thumb {
    background: rgba(140, 82, 255, 0.35);
    border-radius: 999px;
}
.t-decks-list::-webkit-scrollbar-thumb:hover {
    background: rgba(140, 82, 255, 0.65);
}

.t-deck-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.95rem 1rem;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    min-height: fit-content;
    box-sizing: border-box;
}

.t-deck-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.t-deck-item.active {
    background: rgba(140, 82, 255, 0.12);
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(140, 82, 255, 0.25);
}

.t-deck-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
}

.t-deck-item-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.t-deck-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.t-deck-main-info {
    flex: 1;
    min-width: 0;
}

.t-deck-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.98rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.t-deck-meta-line {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.t-deck-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.t-deck-tag {
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 9999px;
    font-weight: 600;
}

.t-deck-q-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffd32a;
    margin-left: auto;
}

.t-deck-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

/* Cột phải: Câu hỏi */
.t-questions-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.t-selected-deck-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.t-deck-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.t-deck-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.t-deck-header-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: rgba(140, 82, 255, 0.2);
    border: 1px solid rgba(140, 82, 255, 0.35);
    flex-shrink: 0;
}

.t-deck-header-title {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.t-deck-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.t-deck-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.t-deck-desc-text {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 0.5rem;
}

/* Danh sách câu hỏi */
.t-questions-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.t-question-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s;
    position: relative;
}

.t-question-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-md);
}

.t-q-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.t-q-num-badge {
    background: rgba(140, 82, 255, 0.2);
    color: var(--primary-light);
    font-size: 0.82rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 9999px;
    border: 1px solid rgba(140, 82, 255, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.t-q-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.t-q-title {
    font-size: 1.12rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.t-q-answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.t-q-ans-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.93rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.t-q-ans-pill.correct-pill {
    background: rgba(46, 213, 115, 0.15);
    border-color: rgba(46, 213, 115, 0.5);
    color: #2ed573;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(46, 213, 115, 0.2);
}

.t-ans-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.ans-letter-a { background: rgba(255, 56, 92, 0.25); color: #ff385c; }
.ans-letter-b { background: rgba(19, 137, 254, 0.25); color: #1389fe; }
.ans-letter-c { background: rgba(255, 165, 2, 0.25); color: #ffa502; }
.ans-letter-d { background: rgba(46, 213, 115, 0.25); color: #2ed573; }

.t-q-details-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.t-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.t-detail-label {
    font-weight: 700;
    white-space: nowrap;
}

/* Empty State */
.t-empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: var(--bg-card);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
}

.t-empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.t-empty-state h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.t-empty-state p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    max-width: 480px;
    margin: 0 auto 1.5rem auto;
}

/* Modals */
.teacher-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 12, 22, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1.5rem;
}

.teacher-modal-box {
    background: #141729;
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), var(--shadow-glow);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.teacher-modal-box.modal-lg {
    max-width: 780px;
}

.teacher-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.t-modal-title-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.t-modal-icon {
    font-size: 1.6rem;
}

.t-modal-title-group h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.t-modal-subtitle {
    font-size: 0.8rem;
    color: var(--accent);
}

.teacher-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.teacher-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* Form Styles */
.t-form-group {
    margin-bottom: 1.25rem;
}

.t-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.t-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
    color: #fff;
}

.t-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: normal;
}

.t-input,
.t-select,
.t-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.t-input:focus,
.t-select:focus,
.t-textarea:focus {
    border-color: var(--primary);
    background: rgba(140, 82, 255, 0.08);
    box-shadow: 0 0 10px rgba(140, 82, 255, 0.25);
}

.t-select option {
    background: #141729;
    color: #fff;
}

/* Options Grid in Question Modal */
.t-options-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.t-options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.t-hint-badge {
    font-size: 0.78rem;
    color: #ffd32a;
    background: rgba(255, 211, 42, 0.1);
    padding: 3px 8px;
    border-radius: 9999px;
}

.t-options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.t-option-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.85rem;
    transition: all 0.2s;
}

.t-option-item.selected-correct {
    border-color: #2ed573;
    background: rgba(46, 213, 115, 0.08);
    box-shadow: 0 0 12px rgba(46, 213, 115, 0.15);
}

.t-opt-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.t-opt-left input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #2ed573;
}

.t-opt-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
}

.t-opt-input-wrap {
    flex: 1;
}

.t-opt-input-wrap input {
    border: none;
    background: transparent;
    padding: 0.4rem 0.5rem;
}

.t-opt-input-wrap input:focus {
    box-shadow: none;
    border-bottom: 1px solid var(--primary);
}

.t-correct-tag {
    font-size: 0.75rem;
    font-weight: 800;
    color: #2ed573;
    background: rgba(46, 213, 115, 0.2);
    padding: 4px 8px;
    border-radius: 9999px;
    white-space: nowrap;
}

.t-extra-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.t-icon-picker-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.t-quick-icons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Bulk Import Styles */
.t-bulk-guide {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.t-bulk-guide-title {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.t-bulk-sample-code {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: #a3adc4;
    overflow-x: auto;
    font-family: monospace;
    white-space: pre-wrap;
    margin: 0;
}

.t-bulk-preview-wrap {
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.t-bulk-preview-header {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.t-bulk-preview-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.t-preview-item {
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    border-left: 3px solid #1dd1a1;
}

.t-preview-item-title {
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.t-preview-item-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Kho Game Section for Teacher Decks */
.teacher-hub-section {
    margin-bottom: 2rem;
}

.teacher-hub-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(16, 172, 132, 0.15), rgba(140, 82, 255, 0.15));
    border: 1px solid rgba(29, 209, 161, 0.35);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.teacher-hub-pill {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    color: #1dd1a1;
    background: rgba(29, 209, 161, 0.15);
    padding: 3px 8px;
    border-radius: 9999px;
    margin-bottom: 4px;
}

.teacher-hub-banner-info h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: #fff;
    margin: 0 0 4px 0;
}

.teacher-hub-banner-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.hub-section-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 2rem 0 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.hub-section-divider::before,
.hub-section-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-section-divider span {
    padding: 0 1rem;
}

/* Responsive */
@media (max-width: 900px) {
    .teacher-studio-grid {
        grid-template-columns: 1fr;
    }
    .t-extra-fields-grid {
        grid-template-columns: 1fr;
    }
    .t-form-row-2 {
        grid-template-columns: 1fr;
    }
}

/* In-Game Teacher Deck Selector Pills */
.game-deck-selector-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.game-deck-selector-wrap:hover {
    border-color: #8c52ff;
    background: rgba(140, 82, 255, 0.12);
    box-shadow: 0 0 15px rgba(140, 82, 255, 0.3);
}

.game-deck-icon {
    font-size: 1rem;
    line-height: 1;
}

.game-topbar-select {
    background: transparent;
    color: #fff;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    max-width: 210px;
    padding-right: 0.25rem;
}

.game-topbar-select option,
.game-topbar-select optgroup {
    background: #141729;
    color: #f1f2f6;
    font-weight: 500;
    padding: 6px;
}

.game-topbar-select optgroup {
    color: #ffd32a;
    font-weight: 800;
}

/* Button to choose correct answer in Teacher Question Modal */
.btn-toggle-correct {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.btn-toggle-correct:hover {
    border-color: #2ed573;
    color: #2ed573;
    background: rgba(46, 213, 115, 0.12);
    transform: translateY(-1px);
}

.btn-toggle-correct.active {
    background: linear-gradient(135deg, #2ed573, #1dd1a1);
    color: #0b0c16;
    border-color: #2ed573;
    font-weight: 800;
    box-shadow: 0 0 16px rgba(46, 213, 115, 0.45);
}

/* ========================================================================== */
/* CÔNG THỨC TOÁN HỌC - 1 FONT CHỮ DUY NHẤT OUTFIT ĐỒNG BỘ 100%                */
/* ========================================================================== */
.math-frac-wrap {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin: 0 0.18em;
    line-height: 1;
    font-family: inherit !important;
}

.math-sign {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15em;
    font-weight: 700;
    margin-right: 0.12em;
    line-height: 1;
    font-family: inherit !important;
}

.math-paren {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45em;
    font-weight: 300;
    line-height: 1;
    padding: 0 1.5px;
    font-family: inherit !important;
}

.math-frac {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 0.85em;
    line-height: 1;
    font-family: inherit !important;
}

.math-frac-num {
    border-bottom: 2px solid currentColor;
    padding: 0 0.25em 2px 0.25em;
    line-height: 1.1;
    display: block;
    font-family: inherit !important;
}

.math-frac-den {
    padding: 2px 0.25em 0 0.25em;
    line-height: 1.1;
    display: block;
    font-family: inherit !important;
}

.math-op {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.3em;
    font-weight: 700;
    color: #ffd32a;
    vertical-align: middle;
    line-height: 1;
    font-family: inherit !important;
}

.math-sup {
    font-size: 0.72em;
    vertical-align: super;
    line-height: 0;
    font-weight: 700;
    font-family: inherit !important;
}

.math-sub {
    font-size: 0.72em;
    vertical-align: sub;
    line-height: 0;
    font-family: inherit !important;
}

.math-sqrt {
    display: inline-flex;
    align-items: baseline;
    font-family: inherit !important;
}

.math-rendered-text {
    font-family: inherit !important;
}

.math-preview-box {
    margin-top: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: rgba(140, 82, 255, 0.08);
    border: 1px dashed rgba(140, 82, 255, 0.35);
    border-radius: 8px;
    font-size: 0.92rem;
    color: #00d2d3;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.math-preview-tag {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(0, 210, 211, 0.2);
    color: #00d2d3;
    padding: 2px 7px;
    border-radius: 4px;
}

/* ========================================================================== */
/* THẺ CÂU HỎI XEM TRƯỚC VÀ CHỈNH SỬA TRỰC QUAN (BULK IMPORT PREVIEW)        */
/* ========================================================================== */
.t-bulk-item-card {
    background: rgba(20, 23, 41, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    transition: border-color 0.25s, box-shadow 0.25s;
    position: relative;
}

.t-bulk-item-card:hover {
    border-color: rgba(0, 210, 211, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.t-bulk-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.t-bulk-badge-num {
    background: linear-gradient(135deg, #8c52ff, #5f27cd);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.t-bulk-type-tag {
    font-size: 0.75rem;
    color: #ffd32a;
    background: rgba(255, 211, 42, 0.12);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.btn-bulk-item-del {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-bulk-item-del:hover {
    background: #ff4757;
    color: #fff;
}

.t-bulk-item-q-input {
    width: 100%;
    background: rgba(11, 12, 22, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    font-family: inherit;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}

.t-bulk-item-q-input:focus {
    outline: none;
    border-color: #00d2d3;
    box-shadow: 0 0 10px rgba(0, 210, 211, 0.25);
}

.t-bulk-opts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

@media (max-width: 680px) {
    .t-bulk-opts-grid {
        grid-template-columns: 1fr;
    }
}

.t-bulk-opt-cell {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    transition: all 0.2s;
}

.t-bulk-opt-cell.is-correct {
    border-color: #2ed573;
    background: rgba(46, 213, 115, 0.08);
}

.t-bulk-opt-tag {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.t-bulk-opt-cell.is-correct .t-bulk-opt-tag {
    background: #2ed573;
    color: #0b0c16;
}

.t-bulk-opt-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #f1f2f6;
    font-size: 0.9rem;
    font-family: inherit;
    padding: 4px;
}

.t-bulk-opt-input:focus {
    outline: none;
}

.btn-bulk-pick-correct {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 3px 6px;
    border-radius: 4px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.t-bulk-opt-cell.is-correct .btn-bulk-pick-correct {
    color: #2ed573;
    font-weight: 800;
}

.t-bulk-empty-hint {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

/* ========================================================================== */
/* MODAL CHỌN GAME THỬ NGHIỆM BỘ ĐỀ (TEACHER TEST GAME PICKER)               */
/* ========================================================================== */
.t-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
    padding: 0.25rem;
}

.t-picker-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    position: relative;
    overflow: hidden;
}

.t-picker-card:hover {
    background: rgba(140, 82, 255, 0.12);
    border-color: rgba(140, 82, 255, 0.55);
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(140, 82, 255, 0.25);
}

.t-picker-card.recommended {
    border-color: rgba(46, 213, 115, 0.5);
    background: rgba(46, 213, 115, 0.06);
}

.t-picker-card.recommended:hover {
    border-color: #2ed573;
    box-shadow: 0 10px 28px rgba(46, 213, 115, 0.3);
}

.t-picker-card-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.t-picker-card-icon {
    font-size: 1.85rem;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.t-picker-card-info {
    flex: 1;
    min-width: 0;
}

.t-picker-card-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
}

.t-picker-card-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    display: inline-block;
    background: rgba(140, 82, 255, 0.25);
    color: #c471ed;
    border: 1px solid rgba(140, 82, 255, 0.35);
}

.t-picker-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    flex: 1;
}

.t-picker-card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 700;
    color: #00d2d3;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.t-picker-card:hover .t-picker-card-action {
    color: #fff;
}

/* ========================================================================== */
/* AUTHENTICATION & HEADER USER BADGE                                         */
/* ========================================================================== */
.header-auth-container {
    display: flex;
    align-items: center;
}

.btn-header-auth {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(140, 82, 255, 0.25), rgba(0, 210, 211, 0.25));
    border: 1px solid rgba(140, 82, 255, 0.5);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 0 12px rgba(140, 82, 255, 0.2);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-header-auth:hover {
    background: linear-gradient(135deg, #8c52ff, #00d2d3);
    border-color: #8c52ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(140, 82, 255, 0.4);
}

.header-user-badge {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.22rem 0.55rem 0.22rem 0.35rem;
    border-radius: 999px;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.header-user-badge:hover {
    border-color: rgba(140, 82, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.h-user-avatar {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8c52ff, #5e17eb);
    border-radius: 50%;
    font-size: 1rem;
    flex-shrink: 0;
}

.h-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.h-user-name {
    font-weight: 800;
    font-size: 0.78rem;
    color: #fff;
    max-width: 115px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.h-user-role {
    font-size: 0.64rem;
    color: #1dd1a1;
    font-weight: 700;
    white-space: nowrap;
}

.btn-header-action-admin {
    background: rgba(255, 211, 42, 0.15);
    border: 1px solid rgba(255, 211, 42, 0.4);
    color: #ffd32a;
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 0.15rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-header-action-admin:hover {
    background: #ffd32a;
    color: #0b0c16;
    transform: scale(1.05);
}

.btn-header-logout {
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.35);
    color: #ff4757;
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 700;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-header-logout:hover {
    background: #ff4757;
    color: #fff;
    transform: scale(1.05);
}

/* ========================================================================== */
/* TEACHER DECK VIEW TABS & TOOLBAR                                           */
/* ========================================================================== */
.t-view-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.3rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.t-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.52rem 0.45rem;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.t-tab-btn span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.t-tab-count {
    flex-shrink: 0;
}

.t-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.t-tab-btn.active {
    background: linear-gradient(135deg, rgba(140, 82, 255, 0.3), rgba(0, 210, 211, 0.3));
    color: #fff;
    border: 1px solid rgba(0, 210, 211, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.t-tab-count {
    background: rgba(0, 0, 0, 0.35);
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #00d2d3;
}

.t-tab-btn.active .t-tab-count {
    background: #00d2d3;
    color: #0b0c16;
}

.t-toolbar-user-info {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: rgba(140, 82, 255, 0.12);
    border: 1px solid rgba(140, 82, 255, 0.3);
    border-radius: 999px;
    font-size: 0.82rem;
    color: #c471ed;
    font-weight: 700;
}

/* ========================================================================== */
/* QUICK LOGIN CARDS & ADMIN MODAL STYLES                                     */
/* ========================================================================== */
.btn-quick-account {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.btn-quick-account:hover {
    background: rgba(140, 82, 255, 0.15);
    border-color: rgba(140, 82, 255, 0.5);
    transform: translateX(4px);
}

.qa-icon {
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    flex-shrink: 0;
}

.qa-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.qa-info strong {
    color: #fff;
    font-size: 0.88rem;
}

.qa-info span {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.qa-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
}

.auth-notice-box {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 165, 2, 0.12);
    border: 1px solid rgba(255, 165, 2, 0.35);
    border-radius: 10px;
    color: #ffa502;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Admin Panel Styles */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-stat-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.as-icon {
    font-size: 1.75rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.as-info {
    display: flex;
    flex-direction: column;
}

.as-info strong {
    font-size: 1.35rem;
    font-weight: 900;
    color: #00d2d3;
}

.as-info span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.admin-box-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    color: #fff;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.btn-action-micro {
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s;
    margin-left: 4px;
}

.btn-action-micro:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* ==========================================================================
   BỔ SUNG NÂNG CẤP: GOOGLE AUTH, TRIAL MODE, GRADE FILTERS, PDF & MOTIVATION
   ========================================================================== */

/* 1. Header Trial Badge */
.header-trial-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, rgba(255, 211, 42, 0.15), rgba(255, 165, 2, 0.25));
    border: 1px solid rgba(255, 211, 42, 0.4);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffd32a;
    cursor: pointer;
    transition: all 0.25s ease;
}
.header-trial-badge:hover {
    background: linear-gradient(135deg, rgba(255, 211, 42, 0.3), rgba(255, 165, 2, 0.4));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 211, 42, 0.25);
}
.trial-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffd32a;
    box-shadow: 0 0 8px #ffd32a;
    animation: pulse 1.8s infinite;
}

/* 2. Google Auth & Login Enhancements */
.google-auth-section {
    margin-bottom: 1.25rem;
}
.btn-google-login {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #ffffff;
    color: #2c3e50;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transition: all 0.25s ease;
}
.btn-google-login:hover {
    background: #f1f2f6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.35);
}
.btn-trial-continue {
    width: 100%;
    margin-top: 0.65rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    color: #00d2d3;
    border: 1px dashed rgba(0, 210, 211, 0.5);
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-trial-continue:hover {
    background: rgba(0, 210, 211, 0.15);
    border-color: #00d2d3;
    transform: translateY(-1px);
}
.auth-divider {
    position: relative;
    text-align: center;
    margin: 1.2rem 0;
}
.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}
.auth-divider span {
    position: relative;
    background: #1b1e38;
    padding: 0 0.8rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.05em;
}
.auth-tab-switch {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 4px;
    border-radius: 10px;
}
.auth-tab-btn {
    flex: 1;
    padding: 0.55rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.auth-tab-btn.active {
    background: rgba(140, 82, 255, 0.35);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(140, 82, 255, 0.25);
}

/* 3. Daily AI Motivation Banner */
.daily-motivation-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, rgba(140, 82, 255, 0.15), rgba(0, 210, 211, 0.15));
    border: 1px solid rgba(140, 82, 255, 0.3);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}
.daily-motivation-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: linear-gradient(to bottom, #8c52ff, #00d2d3);
}
.motivation-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 211, 42, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.motivation-content {
    flex: 1;
}
.motivation-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    color: #ffd32a;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}
.motivation-quote {
    font-size: 0.92rem;
    color: #f1f2f6;
    line-height: 1.45;
    font-style: italic;
    margin: 0;
}
.btn-refresh-quote {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.45rem 0.8rem;
    border-radius: 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-refresh-quote:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

/* 4. Channel Follow Banner */
.channel-follow-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 71, 87, 0.1);
    border: 1px dashed rgba(255, 71, 87, 0.4);
    border-radius: 14px;
    font-size: 0.88rem;
    flex-wrap: wrap;
}
.channel-icon {
    font-size: 1.4rem;
}
.channel-text {
    flex: 1;
    color: #dfe4ea;
    line-height: 1.4;
}
.channel-text strong {
    color: #ff6b81;
}
.btn-channel-sub {
    padding: 0.5rem 1rem;
    background: #ff4757;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.35);
    transition: all 0.25s ease;
}
.btn-channel-sub:hover {
    background: #ff6b81;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 71, 87, 0.5);
}

/* 5. Grade Filter Bar (Lớp 1 đến Lớp 12) */
.knowledge-grade-bar {
    margin: 0.85rem 0 1.5rem 0;
    background: rgba(20, 23, 41, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 0.85rem 1.2rem;
}
.grade-group-pills {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.filter-group-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 0.25rem;
}
.grade-pill {
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #dfe4ea;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.grade-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}
.grade-pill.active {
    background: linear-gradient(135deg, #00d2d3, #54a0ff);
    color: #141729;
    font-weight: 800;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 210, 211, 0.3);
}
.grade-individual-pills {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.filter-sub-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 0.2rem;
}
.grade-num-pill {
    padding: 0.3rem 0.65rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #ced6e0;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.grade-num-pill:hover {
    background: rgba(140, 82, 255, 0.2);
    border-color: #8c52ff;
    color: #fff;
    transform: translateY(-1px);
}
.grade-num-pill.active {
    background: #8c52ff;
    border-color: #8c52ff;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(140, 82, 255, 0.4);
}
.flashcard-grade-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255, 211, 42, 0.2);
    color: #ffd32a;
    border: 1px solid rgba(255, 211, 42, 0.35);
    margin-left: 0.4rem;
}

/* 6. Multiplayer QR Code Connection */
.mp-qr-connect-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.2rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(0, 210, 211, 0.3);
    border-radius: 16px;
    margin: 1rem 0;
}
.qr-image-wrapper {
    background: #fff;
    padding: 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.mp-qr-img {
    border-radius: 6px;
    display: block;
}
.qr-card-info {
    flex: 1;
}
.qr-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    color: #00d2d3;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.qr-hint {
    font-size: 0.85rem;
    color: #a4b0be;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}
.btn-project-qr {
    background: rgba(0, 210, 211, 0.15) !important;
    color: #00d2d3 !important;
    border: 1px solid rgba(0, 210, 211, 0.4) !important;
    font-weight: 700 !important;
}
.projector-qr-container {
    background: #ffffff;
    display: inline-block;
    padding: 16px;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    margin: 0.5rem auto;
}
.projector-qr-image {
    display: block;
}
.projector-pin-code {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    color: #00d2d3;
    font-family: 'Outfit', monospace;
    margin-top: 0.25rem;
    text-shadow: 0 0 15px rgba(0, 210, 211, 0.4);
}

/* 7. PDF Exam Printable Sheet & KaTeX layout */
.pdf-modal-actions-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.btn-print-pdf, .btn-print-cert {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}
.printable-exam-sheet {
    background: #ffffff;
    color: #1a1a1a;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    line-height: 1.6;
}
.exam-header-grid {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #222;
    padding-bottom: 1.2rem;
    margin-bottom: 1.8rem;
}
.exam-header-left, .exam-header-right {
    flex: 1;
}
.exam-header-right {
    text-align: right;
}
.exam-school-name {
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #333;
}
.exam-main-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #000;
    margin: 0.35rem 0;
    text-transform: uppercase;
}
.exam-meta-line {
    font-size: 0.85rem;
    color: #555;
    font-style: italic;
}
.exam-instructions {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-left: 4px solid #8c52ff;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #495057;
    margin-bottom: 1.8rem;
    border-radius: 4px;
}
.exam-questions-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.exam-q-item {
    page-break-inside: avoid;
    border-bottom: 1px dotted #ccc;
    padding-bottom: 1.2rem;
}
.exam-q-prompt {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 0.65rem;
}
.exam-q-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem 1.2rem;
}
.exam-opt-item {
    font-size: 0.92rem;
    color: #333;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}
.exam-opt-letter {
    font-weight: 700;
    color: #111;
}
.exam-answer-table-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px dashed #444;
    page-break-before: always;
}
.exam-answer-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.8rem;
    font-size: 0.9rem;
}
.exam-answer-table th, .exam-answer-table td {
    border: 1px solid #333;
    padding: 6px 10px;
    text-align: center;
}
.exam-answer-table th {
    background: #f1f2f6;
    font-weight: 700;
}

/* 8. Certificate Sheet & Prestigious Styling */
.btn-certificate-gold {
    align-self: center;
    padding: 0.65rem 1.2rem;
    background: linear-gradient(135deg, #ffd32a, #ffa502);
    color: #141729;
    font-weight: 800;
    font-size: 0.88rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 211, 42, 0.4);
    transition: all 0.25s ease;
}
.btn-certificate-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 211, 42, 0.6);
}
.certificate-sheet {
    background: #fffdf7;
    color: #2c3e50;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.35);
    font-family: 'Plus Jakarta Sans', serif;
}
.cert-outer-border {
    border: 6px double #d4af37;
    padding: 1rem;
    border-radius: 8px;
    background: radial-gradient(circle at center, #ffffff 60%, #faf6e9 100%);
}
.cert-inner-border {
    border: 2px solid #b8860b;
    padding: 2rem 2.5rem;
    border-radius: 4px;
    position: relative;
    text-align: center;
}
.cert-corner-decor {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid #d4af37;
}
.cert-corner-decor.tl { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.cert-corner-decor.tr { top: 6px; right: 6px; border-left: none; border-bottom: none; }
.cert-corner-decor.bl { bottom: 6px; left: 6px; border-right: none; border-top: none; }
.cert-corner-decor.br { bottom: 6px; right: 6px; border-left: none; border-top: none; }

.cert-emblem {
    font-size: 2.8rem;
    margin-bottom: 0.2rem;
}
.cert-nation {
    display: block;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #8b0000;
}
.cert-motto {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 1.2rem;
    font-style: italic;
}
.cert-main-title {
    font-size: 2.2rem;
    font-weight: 900;
    color: #b8860b;
    letter-spacing: 0.08em;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(184, 134, 11, 0.2);
}
.cert-sub-title {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}
.cert-intro {
    font-size: 1rem;
    font-style: italic;
    color: #4b6584;
    margin-bottom: 0.5rem;
}
.cert-student-name {
    font-size: 2.2rem;
    font-weight: 900;
    color: #1e3799;
    margin: 0.4rem 0 0.8rem 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: underline;
    text-decoration-color: #d4af37;
    text-underline-offset: 6px;
}
.cert-reason {
    font-size: 1rem;
    line-height: 1.6;
    color: #2f3640;
    max-width: 620px;
    margin: 0 auto 1.8rem auto;
}
.cert-stats-row {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.cert-stat-badge {
    background: #fdfaf0;
    border: 1px solid #d4af37;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
}
.c-stat-label {
    display: block;
    font-size: 0.72rem;
    color: #777;
    font-weight: 700;
}
.c-stat-val {
    font-size: 1.1rem;
    color: #b8860b;
    font-weight: 800;
}
.cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid #e0d0a0;
}
.cert-date-col, .cert-signature-col {
    flex: 1;
}
.cert-date-col {
    text-align: left;
    font-size: 0.85rem;
    color: #555;
    font-style: italic;
}
.cert-verify-code {
    display: block;
    font-size: 0.72rem;
    color: #888;
    font-style: normal;
    margin-top: 0.3rem;
    font-family: monospace;
}
.cert-golden-seal {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffd700 0%, #b8860b 80%, #996515 100%);
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 3px dashed #fff;
}
.seal-star {
    font-size: 1.2rem;
    line-height: 1;
}
.seal-text {
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-align: center;
    line-height: 1.1;
    margin-top: 2px;
}
.cert-signature-col {
    text-align: right;
}
.cert-sign-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    display: block;
}
.cert-signature-font {
    font-family: 'Brush Script MT', cursive, sans-serif;
    font-size: 1.8rem;
    color: #1e3799;
    margin: 0.4rem 0;
}
.cert-sign-name {
    font-size: 0.82rem;
    font-style: italic;
    color: #666;
    display: block;
}

/* 9. Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast-message {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-radius: 14px;
    background: rgba(20, 23, 41, 0.95);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.3s ease;
    max-width: 380px;
}
.toast-message.toast-success {
    border-color: rgba(46, 213, 115, 0.4);
    background: linear-gradient(135deg, rgba(20, 23, 41, 0.95), rgba(46, 213, 115, 0.25));
}
.toast-message.toast-error {
    border-color: rgba(255, 71, 87, 0.4);
    background: linear-gradient(135deg, rgba(20, 23, 41, 0.95), rgba(255, 71, 87, 0.25));
}
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 10. Print Optimization: Hỗ trợ Xuất Đề và In Giấy Khen chuẩn A4 */
@media print {
    body * {
        visibility: hidden;
    }
    .printable-exam-sheet, .printable-exam-sheet *,
    .certificate-sheet, .certificate-sheet * {
        visibility: visible !important;
    }
    .teacher-modal-overlay {
        background: transparent !important;
        position: static !important;
        display: block !important;
    }
    .teacher-modal-box {
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .teacher-modal-header, .teacher-modal-footer, .pdf-modal-actions-bar {
        display: none !important;
    }
    .printable-exam-sheet {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    .certificate-sheet {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        box-shadow: none !important;
    }
}

/* ==========================================================================
   MODERN 2026 UI/UX ENHANCEMENTS & DESIGN POLISH
   ========================================================================== */

/* 1. Dynamic Ambient Aurora Lighting */
body {
    background-color: #070811 !important;
    background-image: 
        radial-gradient(ellipse 90% 55% at 50% -25%, rgba(140, 82, 255, 0.25), transparent 70%),
        radial-gradient(circle at 8% 28%, rgba(0, 210, 211, 0.16) 0%, transparent 45%),
        radial-gradient(circle at 92% 72%, rgba(255, 71, 87, 0.14) 0%, transparent 50%),
        radial-gradient(circle at 50% 92%, rgba(255, 211, 42, 0.09) 0%, transparent 55%) !important;
    background-attachment: fixed !important;
}

/* 2. Elevated Header & Frosted Dock Navigation */
.app-header {
    background: rgba(13, 16, 32, 0.82) !important;
    backdrop-filter: blur(28px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.48), inset 0 1px 1px rgba(255, 255, 255, 0.22) !important;
    border-radius: 20px !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-icon-wrapper {
    background: linear-gradient(135deg, #8c52ff 0%, #00d2d3 100%) !important;
    box-shadow: 0 4px 18px rgba(140, 82, 255, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.35) !important;
    border-radius: 12px !important;
}

.main-nav {
    background: rgba(8, 10, 22, 0.82) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5) !important;
    padding: 0.26rem 0.36rem !important;
    border-radius: 9999px !important;
}

.nav-item {
    font-weight: 700 !important;
    letter-spacing: 0.2px !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border-radius: 9999px !important;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.11) !important;
    transform: translateY(-1px);
    color: #ffffff !important;
}

.nav-item.active {
    background: linear-gradient(135deg, #8c52ff, #5e17eb) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(140, 82, 255, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.35) !important;
}

.pulse-badge {
    animation: liveBadgePulse 1.8s infinite ease-in-out !important;
}

@keyframes liveBadgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 71, 87, 0);
        transform: scale(1.05);
    }
}

/* 3. Hero Card 2.0 with Dual Glass Depth */
.hero-card {
    background: linear-gradient(135deg, rgba(18, 22, 44, 0.88), rgba(26, 22, 56, 0.82)) !important;
    backdrop-filter: blur(28px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
    border: 1px solid rgba(140, 82, 255, 0.28) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 0 35px rgba(140, 82, 255, 0.15) !important;
    border-radius: 26px !important;
}

.hero-heading {
    letter-spacing: -0.8px !important;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4) !important;
}

.gradient-text {
    background: linear-gradient(135deg, #00d2d3 0%, #a26bfe 45%, #ffd32a 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    filter: drop-shadow(0 2px 14px rgba(140, 82, 255, 0.38));
}

/* 4. Futuristic Button Shimmer Effect */
.btn-primary-glow {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #8c52ff, #5e17eb) !important;
    box-shadow: 0 8px 24px rgba(140, 82, 255, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.35) !important;
    border-radius: 9999px !important;
    font-weight: 800 !important;
    letter-spacing: 0.3px;
}

.btn-primary-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -70%;
    width: 45%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: rotate(25deg);
    pointer-events: none;
    transition: none;
}

.btn-primary-glow:hover::after {
    left: 140%;
    transition: left 0.75s ease-in-out;
}

.btn-secondary-glass {
    border-radius: 9999px !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12) !important;
}

.btn-secondary-glass:hover {
    border-color: rgba(0, 210, 211, 0.5) !important;
    background: rgba(255, 255, 255, 0.14) !important;
}

/* 5. Modern Game Cards with 3D Depth */
.game-card {
    background: rgba(18, 22, 42, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 22px !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
    transition: all 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.game-card:hover {
    transform: translateY(-8px) scale(1.018) !important;
    border-color: rgba(0, 210, 211, 0.5) !important;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55), 0 0 30px rgba(0, 210, 211, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.3) !important;
}

/* 6. Modern Gameplay Quiz & Arcade Options */
.question-card {
    background: linear-gradient(135deg, rgba(20, 24, 46, 0.92), rgba(30, 25, 60, 0.88)) !important;
    backdrop-filter: blur(26px) !important;
    -webkit-backdrop-filter: blur(26px) !important;
    border: 1px solid rgba(140, 82, 255, 0.35) !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 32px rgba(140, 82, 255, 0.18) !important;
    border-radius: 24px !important;
}

.ans-btn, .tug-ans-btn {
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38), inset 0 1px 1px rgba(255, 255, 255, 0.32) !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    position: relative;
    overflow: hidden;
}

.ans-btn:hover, .tug-ans-btn:hover {
    transform: translateY(-4px) scale(1.014) !important;
    filter: brightness(1.15) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.48), inset 0 1px 1px rgba(255, 255, 255, 0.45) !important;
}

.ans-key {
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32) !important;
    font-weight: 900 !important;
}

/* 7. Modern Slim Cyberpunk Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(7, 8, 17, 0.95);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8c52ff, #00d2d3);
    border-radius: 9999px;
    border: 2px solid rgba(7, 8, 17, 0.95);
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a26bfe, #2ed573);
}

/* ========================================================================== */
/* BASIC QUIZ SUBJECT PICKER MODAL STYLING                                    */
/* ========================================================================== */
.basic-quiz-option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.15rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md, 12px);
    cursor: pointer;
    transition: all 0.22s ease;
    text-align: left;
    user-select: none;
}

.basic-quiz-option-btn:hover {
    background: rgba(140, 82, 255, 0.16);
    border-color: rgba(140, 82, 255, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(140, 82, 255, 0.25);
}

.basic-quiz-option-btn.highlight-opt {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.15), rgba(238, 82, 83, 0.15));
    border-color: rgba(255, 159, 67, 0.4);
}

.basic-quiz-option-btn.highlight-opt:hover {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.25), rgba(238, 82, 83, 0.25));
    border-color: rgba(255, 159, 67, 0.7);
    box-shadow: 0 6px 24px rgba(255, 159, 67, 0.3);
}

.b-opt-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.b-opt-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.b-opt-text strong {
    font-size: 0.98rem;
    color: #ffffff;
    font-weight: 700;
}

.b-opt-text span {
    font-size: 0.82rem;
    color: #a4b0be;
    line-height: 1.35;
}

.b-opt-arrow {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.2s ease, color 0.2s ease;
}

.basic-quiz-option-btn:hover .b-opt-arrow {
    color: #00d2d3;
    transform: translateX(4px);
}

