@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #0b0f17;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    
    /* Đội 1: Xanh Sky dịu mát thay vì Cyan chói gắt */
    --team-a-primary: #38bdf8;
    --team-a-glow: rgba(56, 189, 248, 0.15);
    --team-a-gradient: linear-gradient(135deg, #38bdf8, #0284c7);

    /* Đội 2: Hồng Rose san hô thanh lịch thay vì Neon chói */
    --team-b-primary: #fb7185;
    --team-b-glow: rgba(251, 113, 133, 0.15);
    --team-b-gradient: linear-gradient(135deg, #fb7185, #e11d48);

    /* Màu bổ trợ hài hòa, dịu mắt */
    --accent-gold: #f59e0b;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-purple: #818cf8;
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.03) 0%, transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(251, 113, 133, 0.03) 0%, transparent 45%),
        radial-gradient(circle at 50% 85%, rgba(129, 140, 248, 0.03) 0%, transparent 50%);
    background-size: 100% 100%;
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ================= HEADER ĐIỀU KHIỂN & CHUYỂN TAB ================= */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: rgba(11, 15, 23, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--bg-card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 26px;
    opacity: 0.9;
}

.logo-text-group h1 {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: #f1f5f9;
    line-height: 1.1;
}

.logo-subtext {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--text-muted);
}

/* Tabs chuyển đổi giao diện Chơi vs Cài đặt */
.nav-switch-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.nav-tab-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 8px 20px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
    position: relative;
}

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

.nav-tab-btn.active {
    background: #f1f5f9;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.nav-tab-btn.active .tab-icon {
    transform: scale(1.1);
}

.tab-badge {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.15);
    padding: 2px 7px;
    border-radius: 12px;
    font-weight: 700;
}

.nav-tab-btn:not(.active) .tab-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-gold);
}

/* Tiện ích Header */
.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-status-badge {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.8px;
}

.header-status-badge.live {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.header-status-badge.settings-mode {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.btn-header {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border: 1px solid var(--bg-card-border);
    padding: 6px 13px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.btn-header:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

/* Nút Mở Màn Chiếu Rời (Tím Indigo nhã nhặn, dịu mắt) */
.btn-header.btn-projector-glow {
    background: rgba(129, 140, 248, 0.12);
    border-color: rgba(129, 140, 248, 0.3);
    color: #c7d2fe;
}

.btn-header.btn-projector-glow:hover {
    background: rgba(129, 140, 248, 0.22);
    border-color: rgba(129, 140, 248, 0.6);
    color: #ffffff;
    transform: translateY(-1px);
}

/* ================= WRAPPER & CHUYỂN ĐỔI 2 VIEW ================= */
.views-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
}

.view-screen {
    display: none;
    width: 100%;
    flex: 1;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.view-screen.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================= */
/* 1. GIAO DIỆN CHƠI THI ĐẤU (PLAY SCREEN)                       */
/* ============================================================= */
.game-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

/* 2 Đội thi đấu đối kháng (Chess clock) */
.teams-arena {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: center;
}

.team-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: blur(16px);
    border-radius: 18px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: transparent;
    transition: background 0.3s ease;
}

/* Đội A Styles */
.team-card.team-a::before {
    background: var(--team-a-gradient);
}
.team-card.team-a.active {
    border-color: var(--team-a-primary);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.22);
    transform: translateY(-2px);
}

/* Đội B Styles */
.team-card.team-b::before {
    background: var(--team-b-gradient);
}
.team-card.team-b.active {
    border-color: var(--team-b-primary);
    box-shadow: 0 4px 20px rgba(251, 113, 133, 0.22);
    transform: translateY(-2px);
}

.team-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.team-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.team-name {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.team-status-pill {
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.45;
    transition: all 0.3s;
}

.team-card.active .team-status-pill {
    opacity: 1;
    animation: pulse 1.2s infinite ease-in-out;
}

.team-a .team-status-pill {
    background: rgba(56, 189, 248, 0.12);
    color: var(--team-a-primary);
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.team-b .team-status-pill {
    background: rgba(251, 113, 133, 0.12);
    color: var(--team-b-primary);
    border: 1px solid rgba(251, 113, 133, 0.4);
}

.team-score-badge {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}
.team-score-badge strong {
    color: #fff;
    font-size: 20px;
    font-family: var(--font-heading);
    margin-left: 2px;
}

/* Đồng hồ tròn SVG */
.clock-wrapper {
    position: relative;
    width: 92px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.clock-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 8;
}

.clock-progress {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear, stroke 0.3s ease;
}

.team-a .clock-progress {
    stroke: var(--team-a-primary);
}

.team-b .clock-progress {
    stroke: var(--team-b-primary);
}

.clock-progress.warning {
    stroke: var(--accent-gold) !important;
}

.clock-progress.danger {
    stroke: var(--accent-red) !important;
    animation: flash 0.5s infinite alternate;
}

.clock-time-display {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 26px;
    letter-spacing: -0.5px;
}

.clock-subtext {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Khu vực VS ở giữa */
.vs-badge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.vs-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 15px;
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.turn-indicator-text {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-align: center;
}

/* ================= SÂN KHẤU TRUNG TÂM ================= */
.main-stage {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.stage-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.question-counter {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 16px;
    color: #fff;
}

.category-tag {
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 10px;
    border-radius: 8px;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hint-banner {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    font-style: italic;
}

/* Khung Media */
.media-viewport {
    width: 100%;
    max-width: 760px;
    height: 285px;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8), 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.media-viewport img,
.media-viewport video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.media-viewport:hover img {
    transform: scale(1.02);
}

/* Hộp Đáp Án Bí Mật */
.answer-stage-box {
    margin-top: 12px;
    width: 100%;
    max-width: 760px;
}

.answer-card {
    background: rgba(15, 23, 42, 0.85);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 10px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.answer-card.revealed {
    border-style: solid;
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.08);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.12);
    transform: translateY(-1px);
}

.answer-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.answer-text {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
    filter: blur(8px);
    transition: filter 0.3s ease, color 0.3s ease;
}

.answer-card.revealed .answer-text {
    filter: blur(0);
    color: #fef3c7;
    text-shadow: none;
}

.answer-hidden-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.answer-card.revealed .answer-hidden-hint {
    opacity: 0;
    visibility: hidden;
}

/* ================= BẢNG TRỌNG TÀI / ADMIN TỐI ƯU CÔNG THÁI HỌC ================= */
.admin-control-bar {
    background: rgba(12, 16, 28, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border-radius: 18px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.55);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Ẩn bảng điều khiển khi người dùng muốn chiếu 1 màn hình */
.admin-control-bar.minimized-bar {
    display: none !important;
}

/* Hàng tiêu đề & Điều hướng nhanh */
.admin-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.admin-title-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.3s;
}
.status-pulse-dot.running {
    background: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulse 1s infinite;
}
.status-pulse-dot.paused {
    background: var(--accent-gold);
    box-shadow: 0 0 8px var(--accent-gold);
}

.admin-title-text {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.match-state-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.match-state-badge.ready {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}
.match-state-badge.running {
    background: rgba(0, 230, 118, 0.18);
    color: var(--accent-green);
    border: 1px solid rgba(0, 230, 118, 0.3);
}
.match-state-badge.paused {
    background: rgba(255, 214, 0, 0.18);
    color: var(--accent-gold);
    border: 1px solid rgba(255, 214, 0, 0.3);
}

/* Cụm điều hướng câu hỏi mini & Bốc thăm */
.stage-nav-cluster {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.35);
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-nav-mini {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 4px 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 4px;
}
.btn-nav-mini:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.dock-q-counter {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    padding: 0 6px;
    white-space: nowrap;
}

.nav-cluster-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 2px;
}

/* Lối tắt Quick Actions */
.admin-quick-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-quick-action {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 4px;
}
.btn-quick-action:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.btn-quick-action.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #fca5a5;
}
.btn-quick-action.highlight {
    color: var(--accent-gold);
    border-color: rgba(255, 214, 0, 0.25);
    background: rgba(255, 214, 0, 0.08);
}
.btn-quick-action.highlight:hover {
    background: rgba(255, 214, 0, 0.2);
    border-color: var(--accent-gold);
    color: #fff;
}

/* Hàng nút thao tác cốt lõi (Sắp xếp theo quy trình công thái học chuẩn MC) */
.control-buttons-primary {
    display: grid;
    grid-template-columns: 1.35fr 1.05fr 1.2fr 0.95fr 1.05fr 1fr;
    gap: 10px;
}

.btn-action {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.15);
    outline: none;
    border-radius: 14px;
    padding: 13px 10px;
    min-height: 52px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
}

.btn-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 42%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    border-top-left-radius: 13px;
    border-top-right-radius: 13px;
}

.btn-action .btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.3px;
    white-space: nowrap;
    z-index: 1;
}

.btn-action .btn-icon {
    font-size: 17px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.btn-action .btn-hotkey {
    position: absolute;
    top: 5px;
    right: 6px;
    font-size: 9.5px;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-weight: 800;
    background: rgba(10, 14, 26, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 2px 5px;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    z-index: 2;
    line-height: 1;
}

.btn-action:hover {
    transform: translateY(-2px);
    filter: brightness(1.12);
}

.btn-action:active,
.btn-action.key-pressed {
    transform: scale(0.96) translateY(2px) !important;
    filter: brightness(1.25) !important;
}

/* 1. Nút Đúng (+1đ & Dừng Giờ) - Hero Button Chủ Đạo */
.btn-correct {
    background: linear-gradient(135deg, #10b981 0%, #059669 60%, #047857 100%);
    color: #ffffff;
    border-color: rgba(110, 231, 183, 0.45);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.38), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.btn-correct:hover {
    box-shadow: 0 6px 22px rgba(16, 185, 129, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* 2. Nút Báo Sai (Buzzer Phạt) - Cạnh Nút Đúng tạo thành cặp Phán Quyết */
.btn-wrong {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 60%, #b91c1c 100%);
    color: #ffffff;
    border-color: rgba(252, 165, 165, 0.45);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.38), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.btn-wrong:hover {
    box-shadow: 0 6px 22px rgba(239, 68, 68, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* 3. Nút Chuyển Lượt & Bắt đầu tính giờ đối thủ */
.btn-switch-turn {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 60%, #0369a1 100%);
    color: #ffffff;
    border-color: rgba(125, 211, 252, 0.45);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.btn-switch-turn:hover {
    box-shadow: 0 6px 22px rgba(14, 165, 233, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* 4. Nút Bỏ Qua (Pass) - Vàng Cam Hổ Phách */
.btn-pass {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 60%, #b45309 100%);
    color: #ffffff;
    border-color: rgba(253, 230, 138, 0.4);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.32), inset 0 1px 1px rgba(255, 255, 255, 0.35);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.btn-pass:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.48), inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

/* 5. Nút Hiện Đáp Án - Tím Thạch Anh / Indigo Sang Trọng */
.btn-reveal {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 60%, #6d28d9 100%);
    color: #ffffff;
    border-color: rgba(196, 181, 253, 0.4);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.32), inset 0 1px 1px rgba(255, 255, 255, 0.35);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.btn-reveal:hover {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.48), inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

/* 6. Nút Tạm Dừng / Tiếp Tục */
.btn-pause {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(5, 150, 105, 0.28));
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}
.btn-pause.running {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(185, 28, 28, 0.3));
    border-color: rgba(239, 68, 68, 0.55);
    color: #fca5a5;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}
.btn-pause:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

/* Hàng tinh chỉnh thời gian phạt/thưởng & chọn đội (Cockpit Đối Kháng) */
.control-time-modifiers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    gap: 12px;
}

.time-cluster {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.65);
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: var(--transition-smooth);
}

.team-a-cluster {
    border-color: rgba(56, 189, 248, 0.25);
}
.team-b-cluster {
    border-color: rgba(251, 113, 133, 0.25);
}

/* Nút kích hoạt đội Đội A & Đội B (Cockpit Trigger) */
.btn-team-pick {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f1f5f9;
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
    user-select: none;
    letter-spacing: 0.3px;
}

.btn-team-pick .team-pick-badge kbd {
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn-team-pick .team-avatar-inline {
    font-size: 14px;
    line-height: 1;
}

.btn-team-pick .team-name-inline {
    font-family: var(--font-heading);
    font-size: 12.5px;
    letter-spacing: 0.5px;
}

.btn-team-pick .live-dot-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.btn-team-pick.a:hover {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.5);
    color: #fff;
    transform: translateY(-1px);
}

.btn-team-pick.a.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(2, 132, 199, 0.45));
    border-color: var(--team-a-primary);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    color: #fff;
}
.btn-team-pick.a.active .live-dot-indicator {
    background: #38bdf8;
    box-shadow: 0 0 10px #38bdf8;
    animation: livePulse 1s infinite alternate;
}

.btn-team-pick.b:hover {
    background: rgba(251, 113, 133, 0.18);
    border-color: rgba(251, 113, 133, 0.5);
    color: #fff;
    transform: translateY(-1px);
}

.btn-team-pick.b.active {
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.3), rgba(225, 29, 72, 0.45));
    border-color: var(--team-b-primary);
    box-shadow: 0 0 18px rgba(251, 113, 133, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    color: #fff;
}
.btn-team-pick.b.active .live-dot-indicator {
    background: #fb7185;
    box-shadow: 0 0 10px #fb7185;
    animation: livePulse 1s infinite alternate;
}

/* Cụm nút điều chỉnh thời gian (-5s / +5s) */
.cluster-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-time-mod {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 13px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
    min-width: 46px;
    line-height: 1;
}

.btn-time-mod.minus {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.38);
    color: #fca5a5;
}
.btn-time-mod.minus:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}
.btn-time-mod.minus:active {
    transform: scale(0.94);
}

.btn-time-mod.plus {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.38);
    color: #6ee7b7;
}
.btn-time-mod.plus:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}
.btn-time-mod.plus:active {
    transform: scale(0.94);
}

/* Cụm đối kháng trung tâm */
.time-cluster-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-glow-badge {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 2px;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #94a3b8;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

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


/* ============================================================= */
/* 2. GIAO DIỆN CÀI ĐẶT & QUẢN TRỊ (SETTINGS SCREEN)             */
/* ============================================================= */
.settings-container {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

/* Header card cài đặt */
.settings-header-card {
    background: linear-gradient(135deg, rgba(20, 26, 44, 0.9), rgba(12, 16, 28, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 22px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.settings-badge {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-gold);
    margin-bottom: 4px;
}

.settings-header-info h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-header-info p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Nút Hero Play to đẹp */
.btn-hero-play {
    background: linear-gradient(135deg, var(--team-a-primary), #0284c7);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 800;
    padding: 13px 26px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
    transition: var(--transition-smooth);
    letter-spacing: 0.5px;
}

.btn-hero-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.35);
}

/* Thanh Sub-tabs điều hướng trong cài đặt */
.settings-nav-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
    overflow-x: auto;
}

.settings-nav-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.settings-nav-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.settings-nav-pill.active {
    background: rgba(56, 189, 248, 0.12);
    border-color: var(--team-a-primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.15);
}

/* Các Panel cài đặt */
.settings-panels-wrapper {
    position: relative;
    width: 100%;
}

.settings-panel {
    display: none;
    flex-direction: column;
    gap: 20px;
    animation: fade-in-panel 0.25s ease-out;
}

.settings-panel.active {
    display: flex;
}

@keyframes fade-in-panel {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Grid 2 cột */
.settings-grid-2cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Thẻ cài đặt chung */
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: blur(16px);
    border-radius: 18px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 14px;
}

.settings-card-icon {
    font-size: 24px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-card-header h3 {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 800;
    color: #fff;
}

.settings-card-header p {
    font-size: 12px;
    color: var(--text-muted);
}

.settings-card-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-block label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

/* Các nút chọn thời gian nhanh (Presets) */
.time-presets-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-preset-time {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-preset-time:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-preset-time.active {
    background: var(--team-a-gradient);
    border-color: var(--team-a-primary);
    color: #0b0f17;
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.2);
}

/* Cấu hình 2 Đội */
.team-config-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.team-config-box.team-a-box {
    border-left: 4px solid var(--team-a-primary);
}

.team-config-box.team-b-box {
    border-left: 4px solid var(--team-b-primary);
}

.team-config-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.btn-sub-tiny {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
}
.btn-sub-tiny:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.team-config-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
}

.avatar-select-wrapper,
.name-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.avatar-select-wrapper label,
.name-input-wrapper label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Footer nút lưu cấu hình */
.settings-actions-footer {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    padding-top: 10px;
}

.btn-action-primary {
    background: linear-gradient(135deg, var(--team-a-primary), #0284c7);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}
.btn-action-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
}

.btn-action-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}
.btn-action-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ================= QUẢN LÝ NGÂN HÀNG CÂU HỎI (QB) ================= */
.qb-toolbar-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 16px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.qb-stats {
    display: flex;
    gap: 16px;
    align-items: center;
}

.qb-stat-item {
    font-size: 13px;
    color: var(--text-muted);
}
.qb-stat-item strong {
    color: #fff;
    font-size: 16px;
    font-family: var(--font-heading);
}

.qb-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-qb-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}
.btn-qb-action:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-qb-action.primary {
    background: linear-gradient(135deg, var(--team-a-primary), #0284c7);
    color: #ffffff;
    border: none;
    font-weight: 700;
}
.btn-qb-action.primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.btn-qb-action.danger {
    color: #fca5a5;
}
.btn-qb-action.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.btn-qb-action.excel-highlight {
    background: linear-gradient(135deg, rgba(16, 124, 65, 0.35), rgba(16, 185, 129, 0.25));
    border-color: rgba(16, 185, 129, 0.5);
    color: #a7f3d0;
    font-weight: 700;
}
.btn-qb-action.excel-highlight:hover {
    background: linear-gradient(135deg, #107c41, #059669);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(16, 124, 65, 0.5);
    border-color: #34d399;
}

.btn-qb-action.template {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}
.btn-qb-action.template:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--accent-gold);
    color: #ffffff;
}

/* Form thêm câu hỏi mới */
.qb-form-card {
    background: var(--bg-card);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 18px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: fade-in-panel 0.25s ease-out;
}

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

.form-grid-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.form-inputs-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.form-preview-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.form-preview-col label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.media-live-preview {
    width: 100%;
    height: 220px;
    background: #000;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.media-live-preview img,
.media-live-preview video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.preview-empty-text {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 10px;
}

/* Grid danh sách câu hỏi trong ngân hàng */
.qb-list-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.qb-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.qb-list-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
}

.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.question-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

.question-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.question-card-thumb-wrap {
    width: 100%;
    height: 160px;
    background: #000;
    position: relative;
    overflow: hidden;
}

.question-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.question-card:hover .question-card-thumb {
    transform: scale(1.04);
}

.question-badge-num {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
}

.question-badge-type {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(56, 189, 248, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--team-a-primary);
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.question-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.question-card-category {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.question-card-answer {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
}

.question-card-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.question-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-card-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.btn-card-action:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}
.btn-card-del {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}
.btn-card-del:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fff;
}

/* ================= CÀI ĐẶT ÂM THANH & HIỆU ỨNG ================= */
.setting-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.setting-toggle-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.setting-toggle-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Switch Toggle UI */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: 0.3s;
    border-radius: 26px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--accent-green);
}
input:checked + .slider:before {
    transform: translateX(22px);
}

/* Volume Slider */
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-gold);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 214, 0, 0.5);
    transition: transform 0.1s;
}
.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Sound Test Pad */
.sound-test-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-test-sound {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: var(--transition-smooth);
}
.btn-test-sound span {
    font-size: 22px;
    flex-shrink: 0;
}
.btn-test-sound strong {
    display: block;
    font-size: 13px;
    color: #fff;
    font-weight: 700;
}
.btn-test-sound small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}
.btn-test-sound:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--team-a-primary);
    transform: translateY(-1px);
}
.btn-test-sound:active {
    transform: scale(0.98);
}
.btn-test-sound.full-span {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(255, 214, 0, 0.12), rgba(255, 115, 0, 0.08));
    border-color: rgba(255, 214, 0, 0.3);
}

/* ================= HƯỚNG DẪN & PHÍM TẮT ================= */
.guide-hotkeys-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-hotkey-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.guide-keys {
    min-width: 110px;
}
.guide-keys kbd {
    background: rgba(255, 255, 255, 0.12);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.guide-desc {
    font-size: 13px;
    color: #cbd5e1;
}
.guide-desc strong {
    color: #fff;
}

.rules-list-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rule-item {
    display: flex;
    gap: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 14px;
    border-radius: 12px;
}

.rule-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--team-a-gradient);
    color: #000;
    font-weight: 900;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rule-item strong {
    font-size: 14px;
    color: #fff;
}

.rule-item p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* ================= FORM ELEMENTS CHUNG ================= */
.form-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 14px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}
.form-input:focus {
    border-color: var(--team-a-primary);
}

.file-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition-smooth);
}
.file-dropzone:hover {
    border-color: var(--team-a-primary);
    background: rgba(56, 189, 248, 0.05);
}
.file-dropzone span {
    font-size: 13px;
    color: var(--text-muted);
}

.btn-add-question {
    background: var(--team-a-gradient);
    border: none;
    color: #0b0f17;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 14px;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 4px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-add-question:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

/* ================= MODAL PHÓNG TO XEM TRƯỚC (PREVIEW) ================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}
.modal-overlay.active {
    display: flex;
}

.preview-modal-window {
    background: #111524;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
    animation: modal-pop 0.25s ease-out;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}
.btn-close-modal:hover {
    color: #fff;
}

.preview-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.preview-media-full {
    width: 100%;
    max-height: 480px;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.preview-media-full img,
.preview-media-full video {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
}

.preview-details-box {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 18px;
}

/* ================= MODAL VICTORY (CHIẾN THẮNG) ================= */
.victory-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(14px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}
.victory-modal.active {
    display: flex;
}

.victory-card {
    background: #0f172a;
    border: 1.5px solid var(--accent-gold);
    border-radius: 28px;
    padding: 40px;
    text-align: center;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(245, 158, 11, 0.2);
    animation: bounce-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.victory-trophy {
    font-size: 64px;
    animation: wiggle 2s infinite ease-in-out;
}

.victory-reason-badge {
    font-size: 13px;
    font-weight: 800;
    color: var(--accent-red);
    letter-spacing: 2px;
}

.victory-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 900;
    color: #fff;
}

.victory-winner-name {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(90deg, #fcd34d, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.victory-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    margin-top: 8px;
}

.victory-stat-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px;
}
.victory-stat-box span {
    font-size: 12px;
    color: var(--text-muted);
}
.victory-stat-box strong {
    display: block;
    font-size: 20px;
    color: #fff;
    margin-top: 4px;
}

.btn-restart-game {
    margin-top: 14px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    color: #0f172a;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    padding: 14px 32px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
    transition: transform 0.2s;
}
.btn-restart-game:hover {
    transform: scale(1.03);
}

#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2999;
}

/* ================= ANIMATIONS ================= */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(1.04); }
}

@keyframes pulse-slow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes flash {
    0% { opacity: 1; }
    100% { opacity: 0.3; }
}

@keyframes modal-pop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounce-in {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); opacity: 1; }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

/* ================= MÀN CHE BẢO MẬT CÂU HỎI KHI CHƯA BẮT ĐẦU ================= */
.stage-cover {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(11, 15, 23, 0.98), rgba(17, 24, 39, 0.98));
    backdrop-filter: blur(16px);
    border-radius: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s ease;
    padding: 24px;
    text-align: center;
}

.stage-cover.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.stage-cover-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: cover-pulse 3s infinite ease-in-out;
}

.stage-cover-icon {
    font-size: 30px;
}

.stage-cover-text-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stage-cover-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 1px;
}

.stage-cover-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.stage-cover-actions {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.btn-cover-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-cover-action kbd {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: monospace;
}

.btn-cover-action.team-a {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.12);
    color: var(--team-a-primary);
}
.btn-cover-action.team-a:hover {
    background: rgba(56, 189, 248, 0.22);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.25);
    transform: translateY(-2px);
}

.btn-cover-action.team-b {
    border-color: rgba(251, 113, 133, 0.4);
    background: rgba(251, 113, 133, 0.12);
    color: var(--team-b-primary);
}
.btn-cover-action.team-b:hover {
    background: rgba(251, 113, 133, 0.22);
    box-shadow: 0 4px 15px rgba(251, 113, 133, 0.25);
    transform: translateY(-2px);
}

@keyframes cover-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 6px 25px rgba(56, 189, 248, 0.2);
    }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
    .settings-grid-2cols {
        grid-template-columns: 1fr;
    }
    .form-grid-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .teams-arena {
        grid-template-columns: 1fr;
    }
    .vs-badge-container {
        flex-direction: row;
        justify-content: center;
    }
    .control-buttons-primary {
        grid-template-columns: 1fr 1fr;
    }
    .control-time-modifiers {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    .time-cluster {
        flex: 1 1 auto;
        justify-content: space-between;
    }
    .app-header {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }
    .sound-test-grid {
        grid-template-columns: 1fr;
    }
    .btn-test-sound.full-span {
        grid-column: span 1;
    }
}
