/* ─── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── CSS Variables ────────────────────────────────────────────────────────── */
:root {
    --bg-dark:      #1b1f2e;
    --bg-card:      #232844;
    --bg-surface:   #2c3354;
    --border:       #3d4468;
    --text-primary: #edf1fb;
    --text-muted:   #8f9ab5;
    --accent-blue:  #3b82f6;
    --accent-amber: #f59e0b;
    --accent-green: #22c55e;
    --accent-red:   #ef4444;
    --accent-purple:#a78bfa;
    --glow-blue:    rgba(59,130,246,0.3);
    --glow-amber:   rgba(245,158,11,0.3);
    --glow-green:   rgba(34,197,94,0.3);

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body:    'Inter', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --radius-xl:  24px;
    --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

a { color: var(--accent-blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: #60a5fa; }

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

/* ─── Utility Classes ──────────────────────────────────────────────────────── */
.text-muted    { color: var(--text-muted); }
.text-blue     { color: var(--accent-blue); }
.text-amber    { color: var(--accent-amber); }
.text-green    { color: var(--accent-green); }
.text-red      { color: var(--accent-red); }
.text-purple   { color: var(--accent-purple); }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.font-mono     { font-family: var(--font-mono); }
.font-heading  { font-family: var(--font-heading); }
.fw-500        { font-weight: 500; }
.fw-600        { font-weight: 600; }
.fw-700        { font-weight: 700; }

.d-flex        { display: flex; }
.d-grid        { display: grid; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1  { gap: 0.5rem; }
.gap-2  { gap: 1rem; }
.gap-3  { gap: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }
.flex-1    { flex: 1; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem;   padding-bottom: 1rem; }
.px-2 { padding-left: 1rem;  padding-right: 1rem; }
.w-100 { width: 100%; }

.hidden { display: none !important; }

/* ─── Gradient Text ────────────────────────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-amber));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Navigation ───────────────────────────────────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-amber));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.navbar-nav a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
}

.navbar-nav a:hover { color: var(--text-primary); }

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .navbar-toggle { display: block; }
    .navbar-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0; right: 0;
        flex-direction: column;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        padding: 1rem 2rem;
        gap: 1rem;
    }
    .navbar-nav.open { display: flex; }
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 0 0 0 var(--glow-blue);
}
.btn-primary:hover:not(:disabled) {
    filter: brightness(0.85);
    box-shadow: 0 0 16px var(--glow-blue);
    color: #fff;
}

.btn-amber {
    background: var(--accent-amber);
    color: #000;
}
.btn-amber:hover:not(:disabled) {
    filter: brightness(0.85);
    box-shadow: 0 0 16px var(--glow-amber);
    color: #000;
}

.btn-green {
    background: var(--accent-green);
    color: #000;
}
.btn-green:hover:not(:disabled) {
    filter: brightness(0.85);
    box-shadow: 0 0 16px var(--glow-green);
    color: #000;
}

.btn-danger {
    background: var(--accent-red);
    color: #fff;
}
.btn-danger:hover:not(:disabled) {
    filter: brightness(0.85);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-outline-blue {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}
.btn-outline-blue:hover:not(:disabled) {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 0 12px var(--glow-blue);
}

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-xl { padding: 1rem 2.5rem; font-size: 1.1rem; font-weight: 600; }

.btn-loading { pointer-events: none; opacity: 0.7; }
.btn-loading::after {
    content: '';
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Cards / Glass Panels ─────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.card-glass {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(61,68,104,0.6);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.card-glow-blue {
    border-color: rgba(59,130,246,0.4);
    box-shadow: 0 0 24px rgba(59,130,246,0.1);
}

.card-glow-amber {
    border-color: rgba(245,158,11,0.4);
    box-shadow: 0 0 24px rgba(245,158,11,0.1);
}

/* ─── Forms ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0.65rem 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--glow-blue);
}

.form-control::placeholder { color: #565e7a; }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238b949e' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    padding-right: 2.5rem;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent-blue); cursor: pointer; }
.form-check label { margin: 0; cursor: pointer; color: var(--text-primary); font-size: 0.9rem; }

.form-error {
    color: var(--accent-red);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.form-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

/* ─── Alerts / Flash ───────────────────────────────────────────────────────── */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}
.alert-success { background: rgba(34,197,94,0.1);  border-color: rgba(34,197,94,0.3);  color: #4ade80; }
.alert-error   { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.3);  color: #f87171; }
.alert-warning { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: #fbbf24; }
.alert-info    { background: rgba(59,130,246,0.1);  border-color: rgba(59,130,246,0.3); color: #60a5fa; }

/* ─── Toast Notifications ──────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    min-width: 200px;
    max-width: 340px;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.toast-success { border-left: 3px solid var(--accent-green); }
.toast-error   { border-left: 3px solid var(--accent-red); }
.toast-info    { border-left: 3px solid var(--accent-blue); }

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ─── Badges ───────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-mono);
}
.badge-blue   { background: rgba(59,130,246,0.15);  color: var(--accent-blue); }
.badge-amber  { background: rgba(245,158,11,0.15);  color: var(--accent-amber); }
.badge-green  { background: rgba(34,197,94,0.15);   color: var(--accent-green); }
.badge-red    { background: rgba(239,68,68,0.15);   color: var(--accent-red); }
.badge-purple { background: rgba(167,139,250,0.15); color: var(--accent-purple); }
.badge-gray   { background: rgba(139,148,158,0.15); color: var(--text-muted); }

/* ─── Tables ───────────────────────────────────────────────────────────────── */
.table-container { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table th {
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(61,68,104,0.5);
    vertical-align: middle;
}

table tr:last-child td { border-bottom: none; }
table tbody tr:hover { background: var(--bg-surface); }

/* ─── Tabs ─────────────────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.tab-btn:hover  { color: var(--text-primary); }
.tab-btn.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── Modal ────────────────────────────────────────────────────────────────── */
.modal-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-backdrop.open { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeScaleIn 0.2s ease;
}

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

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }

/* ─── Page Layout ──────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 680px; margin: 0 auto; padding: 0 1.5rem; }
.container-md { max-width: 860px; margin: 0 auto; padding: 0 1.5rem; }

.page-header {
    padding: 2rem 0 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.page-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-family: var(--font-heading);
    font-weight: 700;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ─── Grid Layouts ─────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

@media (max-width: 900px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ─── Hero Section ─────────────────────────────────────────────────────────── */
.hero {
    padding: 6rem 0 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(27, 31, 46, 0.68) 0%,
        rgba(27, 31, 46, 0.48) 60%,
        rgba(27, 31, 46, 0.82) 100%
    );
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.25rem;
}

.hero-sub {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

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

/* ─── Feature Cards ────────────────────────────────────────────────────────── */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.feature-card:hover {
    border-color: rgba(59,130,246,0.4);
    box-shadow: 0 0 20px rgba(59,130,246,0.08);
}

.feature-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}
.icon-blue   { background: rgba(59,130,246,0.15); }
.icon-amber  { background: rgba(245,158,11,0.15); }
.icon-green  { background: rgba(34,197,94,0.15); }
.icon-purple { background: rgba(167,139,250,0.15); }

/* ─── Dashboard ────────────────────────────────────────────────────────────── */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all var(--transition);
}

.sidebar-menu a:hover {
    color: var(--text-primary);
    background: var(--bg-surface);
}

.sidebar-menu a.active {
    color: var(--accent-blue);
    border-left-color: var(--accent-blue);
    background: rgba(59,130,246,0.08);
}

.sidebar-section {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 1rem 1.5rem 0.4rem;
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-x: hidden;
}

@media (max-width: 900px) {
    .dashboard-layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border); }
    .sidebar-menu { display: flex; overflow-x: auto; padding: 0; }
    .sidebar-menu a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; padding: 0.7rem 1.25rem; }
    .sidebar-menu a.active { border-bottom-color: var(--accent-blue); }
    .sidebar-section { display: none; }
}

/* ─── Game Cards ───────────────────────────────────────────────────────────── */
.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.game-card:hover {
    border-color: rgba(59,130,246,0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.game-card-header {
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.game-card-body { padding: 1rem 1.25rem; }

.game-code {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--accent-amber);
    letter-spacing: 0.1em;
}

.game-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.75rem 1.25rem 1.25rem;
}

/* ─── In-Game Player View ──────────────────────────────────────────────────── */
.game-screen {
    min-height: 100vh;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.game-panel {
    width: 100%;
    max-width: 600px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: 0 8px 48px rgba(0,0,0,0.5);
}

.round-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-amber);
    margin-bottom: 0.75rem;
}

.question-text {
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 3vw, 1.6rem);
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.bid-options {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.bid-btn {
    flex: 1;
    min-width: 80px;
    padding: 0.85rem;
    background: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.bid-btn:hover {
    border-color: var(--accent-amber);
    color: var(--accent-amber);
    box-shadow: 0 0 12px var(--glow-amber);
}

.bid-btn.selected {
    border-color: var(--accent-amber);
    background: rgba(245,158,11,0.12);
    color: var(--accent-amber);
    box-shadow: 0 0 16px var(--glow-amber);
}

.answer-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.answer-input {
    flex: 1;
}

/* ─── Score Display ────────────────────────────────────────────────────────── */
.score-badge {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 50;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-green);
}

/* ─── Scoreboard ───────────────────────────────────────────────────────────── */
.scoreboard {
    width: 100%; max-width: 700px;
}

.score-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: all var(--transition);
}

.score-rank {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    width: 28px;
    text-align: center;
}

.score-rank.gold   { color: var(--accent-amber); font-weight: 700; }
.score-rank.silver { color: #94a3b8; font-weight: 700; }
.score-rank.bronze { color: #b45309; font-weight: 700; }

.score-team { flex: 1; font-weight: 500; }

.score-pts {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-green);
}

/* ─── Host Control Panel ───────────────────────────────────────────────────── */
.host-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    padding: 1.5rem;
    min-height: calc(100vh - 64px);
}

@media (max-width: 900px) {
    .host-layout { grid-template-columns: 1fr; }
}

.host-main {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.host-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.host-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.answer-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid rgba(61,68,104,0.5);
}

.answer-item:last-child { border-bottom: none; }

.answer-team { flex: 0 0 130px; font-size: 0.85rem; font-weight: 500; }
.answer-text { flex: 1; color: var(--text-primary); }
.answer-bid  { flex: 0 0 50px; text-align: center; font-family: var(--font-mono); color: var(--accent-amber); }
.answer-actions { display: flex; gap: 0.4rem; }

.btn-correct {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(34,197,94,0.4);
    background: rgba(34,197,94,0.1);
    color: var(--accent-green);
    cursor: pointer;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.btn-correct:hover { background: rgba(34,197,94,0.2); box-shadow: 0 0 8px var(--glow-green); }

.btn-wrong {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(239,68,68,0.4);
    background: rgba(239,68,68,0.1);
    color: var(--accent-red);
    cursor: pointer;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.btn-wrong:hover { background: rgba(239,68,68,0.2); }

/* ─── Presentation Mode ────────────────────────────────────────────────────── */
.presentation-screen {
    min-height: 100vh;
    background: var(--bg-dark);
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 0;
    position: relative;
    overflow: hidden;
}

.presentation-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 50% 60% at 30% 50%, rgba(59,130,246,0.07), transparent);
    pointer-events: none;
}

.presentation-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
}

.presentation-question {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.presentation-sidebar {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border-left: 1px solid var(--border);
    padding: 1.5rem;
    overflow-y: auto;
}

.team-check-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(61,68,104,0.4);
}

.team-check-indicator {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.team-check-indicator.submitted {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

/* ─── Chat Drawer ──────────────────────────────────────────────────────────── */
.chat-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 52px; height: 52px;
    background: var(--accent-blue);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(59,130,246,0.4);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    z-index: 100;
}

.chat-toggle:hover { transform: scale(1.05); }

.chat-count {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--accent-amber);
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.chat-drawer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 55vh;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 200;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.chat-drawer.open { transform: translateY(0); }

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

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-message {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
}

.chat-author {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--accent-blue);
    margin-bottom: 0.1rem;
}

.chat-input-row {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
}

/* ─── Question Editor ──────────────────────────────────────────────────────── */
.question-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.75rem;
    align-items: start;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: border-color var(--transition);
}

.question-row:hover { border-color: rgba(59,130,246,0.3); }

.question-row .q-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-top: 0.7rem;
}

@media (max-width: 640px) {
    .question-row { grid-template-columns: 1fr; }
}

/* ─── Lobby ────────────────────────────────────────────────────────────────── */
.lobby-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-dark);
}

.lobby-code {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--accent-amber);
    text-shadow: 0 0 32px var(--glow-amber);
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 420px;
    margin-top: 1.5rem;
}

.team-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
}

/* ─── Footer ───────────────────────────────────────────────────────────────── */
footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ─── Score Animation ──────────────────────────────────────────────────────── */
@keyframes scoreReveal {
    from { transform: scale(0.8) translateY(10px); opacity: 0; }
    to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

.score-animate { animation: scoreReveal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

/* ─── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--bg-surface); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #5a6285; }

/* ─── Loading Spinner ──────────────────────────────────────────────────────── */
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 2rem auto;
}

/* ─── Empty State ──────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 { font-size: 1.2rem; color: var(--text-primary); margin-bottom: 0.5rem; }

/* ─── Color Swatch Picker ──────────────────────────────────────────────────── */
.color-picker-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.color-swatch {
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition);
}

.color-swatch.active, .color-swatch:hover { border-color: #fff; }

/* ─── Progress Bar ─────────────────────────────────────────────────────────── */
.progress-bar {
    height: 4px;
    background: var(--bg-surface);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 2px;
    transition: width 0.4s ease;
}

/* ─── Divider ──────────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
