/* ============================================
   LIVE QUIZ — Design System v2.0
   Theme: Light Premium with Optional Dark Mode
   Layout: Vertical 3-step flow
   ============================================ */

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

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Core palette */
    --primary: #1155D6;
    --primary-light: #4d80e8;
    --primary-dark: #0d44b5;
    --primary-glow: rgba(17, 85, 214, 0.22);
    --accent: #0ea5a0;
    --accent-light: #38bdf8;

    /* Backgrounds */
    --bg-page: #f0f2f8;
    --bg-card: #ffffff;
    --bg-card-hover: #fafbff;
    --bg-subtle: #f7f8fc;
    --bg-input: #f4f5fa;

    /* Text */
    --text-primary: #1a1a2e;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-on-primary: #ffffff;

    /* Borders & shadows */
    --border: #dce3f0;
    --border-focus: var(--primary);
    --shadow-sm: 0 2px 8px rgba(17, 85, 214, 0.06);
    --shadow-md: 0 4px 20px rgba(17, 85, 214, 0.08);
    --shadow-lg: 0 8px 40px rgba(17, 85, 214, 0.12);
    --shadow-glow: 0 0 30px rgba(17, 85, 214, 0.18);

    /* Status */
    --success: #00b894;
    --success-bg: #e6f9f3;
    --error: #d63031;
    --error-bg: #fde8e8;
    --warning: #f39c12;
    --warning-bg: #fef9e7;

    /* Radius & spacing */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Dark Mode ---------- */
[data-theme="dark"] {
    --bg-page: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.85);
    --bg-card-hover: rgba(51, 65, 85, 0.9);
    --bg-subtle: rgba(51, 65, 85, 0.5);
    --bg-input: rgba(15, 23, 42, 0.6);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border: rgba(17, 85, 214, 0.18);
    --border-focus: var(--primary-light);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(17, 85, 214, 0.35);

    --success-bg: rgba(0, 184, 148, 0.15);
    --error-bg: rgba(214, 48, 49, 0.15);
    --warning-bg: rgba(243, 156, 18, 0.15);
}

[data-theme="dark"] .step-card {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(17, 85, 214, 0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Header ---------- */
.app-header {
    width: 100%;
    padding: 14px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
    gap: 8px;
}

/* Header Stepper */
.header-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-left: 30px;
}

.stepper-step {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.stepper-num {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.1rem;
}

.stepper-dot {
    color: var(--border);
    font-size: 1.4rem;
    line-height: 1;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.header-brand img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
}

.header-brand span {
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.header-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.header-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(17, 85, 214, 0.06);
    transform: translateY(-1px);
}

.header-link i {
    font-size: 0.85rem;
}

/* Accès élève — Accent button (non-blue) */
.header-link-eleve {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff !important;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(5, 150, 105, 0.3);
    font-weight: 700;
}

.header-link-eleve:hover {
    background: linear-gradient(135deg, #047857, #059669);
    color: #ffffff !important;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.45);
    transform: translateY(-2px);
}

/* Theme toggle */
.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all var(--transition-fast);
    padding: 0;
    margin: 0;
}

.theme-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(17, 85, 214, 0.06);
    transform: translateY(-1px);
}

/* ---------- Main Container ---------- */
.main-container {
    width: 90%;
    max-width: 1400px;
    padding: 30px 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
    margin: 0 auto;
}

/* ---------- Step Cards ---------- */
.step-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 28px 32px;
    position: relative;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
    opacity: 0;
    width: 100%;
}


.step-card:not(.reveal) {
    animation: fadeSlideIn 0.5s ease forwards;
}

.step-card:nth-child(1):not(.reveal) { animation-delay: 0.05s; }
.step-card:nth-child(2):not(.reveal) { animation-delay: 0.15s; }
.step-card:nth-child(3):not(.reveal) { animation-delay: 0.25s; }

/* Scroll Reveal classes */
.step-card.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.step-card.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.step-card:hover {
    box-shadow: var(--shadow-lg);
}

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

/* Step header with number badge */
.step-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.step-number {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.step-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.step-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 2px;
    font-weight: 500;
}

/* ---------- Step 1: 2-Column Question Layout ---------- */

/* Column label banners */
.q-col-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: -4px;
}

.q-col-label-manual {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.q-col-label-ai {
    background: linear-gradient(135deg, rgba(17, 85, 214, 0.12), rgba(45, 114, 232, 0.08));
    color: var(--primary);
    border: 1px solid rgba(17, 85, 214, 0.2);
}

[data-theme="dark"] .q-col-label-manual {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
}

.step1-tab-inner {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: stretch;
}

.step1-tab-inner > .q-block:first-child {
    flex: 2; /* Takes 2/3 of space */
    height: auto;
}

.step1-tab-inner > .q-block:last-child {
    flex: 1; /* Takes 1/3 of space */
    height: auto;
}

/* Retain separator inside merged block if needed */
.q-block-sep {
    border-top: 1px solid var(--border);
    margin: 14px 0;
}

/* Bank select row */
.bank-select-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bank-select-row > label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.bank-select-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bank-select {
    flex: 1;
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 0.88rem;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: border-color var(--transition-fast);
    cursor: pointer;
}

.bank-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Q-Block Cards */
.q-block {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px 20px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.q-block:hover {
    border-color: rgba(17, 85, 214, 0.3);
    box-shadow: var(--shadow-sm);
}

.q-block-clickable {
    cursor: pointer;
    align-items: center;
}

.q-block-clickable:hover {
    background: rgba(17, 85, 214, 0.04);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.q-block-ai {
    background: linear-gradient(135deg, rgba(17, 85, 214, 0.06), rgba(14, 165, 160, 0.04));
    border-color: rgba(17, 85, 214, 0.2);
}

.q-block-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.q-block-body {
    flex: 1;
    min-width: 0;
}

.q-block-body h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.q-block-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.q-block-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
    justify-content: center;
}

.q-block-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.q-block-clickable:hover .q-block-arrow {
    color: var(--primary);
    transform: translateX(3px);
}

/* Bank buttons grid */
.bank-buttons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bank-btn {
    padding: 7px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.bank-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(17, 85, 214, 0.04);
}

/* Small button variant */
.btn-sm {
    padding: 7px 14px;
    font-size: 0.82rem;
}

/* AI Form Stacked (2-row layout): theme on top, fields+button on bottom */
.ai-form-stacked {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.ai-form-stacked .ai-field {
    min-width: unset;
    flex: unset;
    width: 100%;
}

.ai-form-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.ai-form-row .ai-field-sm {
    flex: 1;
    min-width: 80px;
}

/* Thème field gets priority space */
.ai-field-theme {
    flex: 3 !important;
    min-width: 200px;
}

.ai-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.ai-field input, 
.ai-field select {
    width: 100%;
    padding: 10px 12px;
    background: #ffffff;
    border: 1.5px solid rgba(17, 85, 214, 0.15);
    border-radius: 8px;
    font-size: 0.9rem;
    color: #1a202c;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.dark-mode .ai-field input, 
.dark-mode .ai-field select {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(17, 85, 214, 0.4);
    color: #e2e8f0;
}

.ai-field input:focus, 
.ai-field select:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

.dark-mode .ai-field input:focus, 
.dark-mode .ai-field select:focus {
    background: rgba(0, 0, 0, 0.3);
}

/* Full-width generate button (sits below fields row) */
.btn-generate-full {
    width: 100%;
    padding: 11px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 14px var(--primary-glow);
    transition: all var(--transition-fast);
    margin-top: 4px;
}

.btn-generate-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px var(--primary-glow);
}

.btn-generate-full:active {
    transform: translateY(0);
}

/* AI Form Inline (kept for potential other uses) */
.ai-form-inline {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-top: 10px;
}

.ai-field {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-field label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ai-field input,
.ai-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 0.88rem;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-fast);
}

.ai-field input:focus,
.ai-field select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

.ai-field-sm {
    flex: 0 0 80px;
    min-width: 70px;
}

.btn-generate-inline {
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    width: auto;
    transition: all var(--transition-fast);
    margin: 0;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 12px var(--primary-glow);
    flex-shrink: 0;
}

.btn-generate-inline:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

#albert-error {
    color: var(--error);
    font-size: 0.82rem;
    margin-top: 8px;
}

/* AI Prompt Modal Actions */
.ai-prompt-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.ai-send-group-modal {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-send-group-modal label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.ai-send-group-modal select {
    padding: 7px 12px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
}

/* Scroll-Snap Reveal Animations */
.step-card.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.step-card.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Keep step-card base animation for non-reveal cards */
.step-card:not(.reveal) {
    animation: fadeSlideIn 0.5s ease forwards;
    opacity: 0;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    font-family: 'Inter', sans-serif;
    width: auto;
    margin: 0;
}

.btn-action-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-action-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-action-secondary {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-action-secondary:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(17, 85, 214, 0.06);
    transform: translateY(-1px);
}

/* Questions Table */
.questions-section {
    margin-top: 4px;
}

.questions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.questions-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
}

.questions-header .q-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 20px;
    margin-left: 8px;
}

.q-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.q-table thead {
    background: var(--bg-subtle);
}

.q-table th {
    text-align: left;
    padding: 12px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.q-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

.q-table tbody tr:hover {
    background: var(--bg-subtle);
}

.q-table input {
    width: 100%;
    padding: 7px 10px;
    margin: 0;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 0.84rem;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    font-family: 'Inter', sans-serif;
}

.q-table input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

.q-table .input-correct {
    border-color: var(--success);
    background: var(--success-bg);
}

.q-table .input-correct:focus {
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.15);
}

.q-table .input-wrong {
    border-color: #ff7675;
}

.q-table .input-duration {
    border-color: var(--warning);
    background: var(--warning-bg);
    width: 55px;
    text-align: center;
}

.btn-delete-q {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    width: auto;
    margin: 0;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.btn-delete-q:hover {
    color: var(--error);
    background: var(--error-bg);
    transform: scale(1.15);
}

.empty-table-msg {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 30px;
}

/* ---------- Step 2: Mode Switches (iOS-style pill) ---------- */
.custom-switch-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.custom-switch-layout {
    display: flex;
    align-items: center;
    gap: 16px;
    background: transparent;
}

.custom-switch-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.custom-switch-label:hover {
    color: var(--text-primary);
}

.custom-switch-label.active {
    color: var(--primary);
}

.custom-switch-label i {
    font-size: 1.05rem;
}

.custom-switch-pill {
    position: relative;
    width: 64px;
    height: 34px;
    display: inline-block;
    cursor: pointer;
}

.custom-switch-pill input {
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-switch-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.custom-switch-slider::before {
    content: "";
    position: absolute;
    height: 25px;
    width: 25px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.custom-switch-pill input:checked + .custom-switch-slider {
    background-color: rgba(17, 85, 214, 0.1);
    border-color: var(--primary);
}

.custom-switch-pill input:checked + .custom-switch-slider::before {
    transform: translateX(30px);
    background-color: var(--primary);
}

[data-theme="dark"] .custom-switch-slider {
    background-color: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .custom-switch-pill input:checked + .custom-switch-slider {
    background-color: rgba(17, 85, 214, 0.2);
    border-color: var(--primary);
}

[data-theme="dark"] .custom-switch-slider::before {
    background-color: var(--text-secondary);
}

[data-theme="dark"] .custom-switch-pill input:checked + .custom-switch-slider::before {
    background-color: var(--primary-light);
}

/* Tab content visibility */
.mode-tab-content {
    display: none;
    animation: fadeTabIn 0.3s ease;
}

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

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

/* Scan intro banner */
.scan-intro {
    text-align: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(14, 165, 160, 0.08), rgba(17, 85, 214, 0.06));
    border: 1px solid rgba(14, 165, 160, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.scan-intro h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.scan-intro p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Option input number (for scan config) */
.option-input-number {
    width: 70px;
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    text-align: center;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.option-input-number:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

/* Scan actions */
.scan-actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Tournament placeholder */
.tournament-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.tournament-placeholder h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.tournament-placeholder p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Scan Lobby */
.scan-session-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 10px 0 20px;
    flex-wrap: wrap;
}

.scan-session-code {
    font-size: 1rem;
    color: var(--text-secondary);
}

.scan-session-code strong {
    color: var(--primary);
    letter-spacing: 2px;
    font-size: 1.15rem;
}

.scan-session-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.status-waiting {
    background: var(--warning);
    animation: statusPulse 2s ease-in-out infinite;
}

.status-dot.status-active {
    background: var(--success);
    animation: statusPulse 1.2s ease-in-out infinite;
}

.status-dot.status-ended {
    background: var(--text-muted);
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.scan-lobby-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 24px;
}

.scan-lobby-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.scan-lobby-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.scan-lobby-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Scan Steps Grid */
.scan-steps-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.scan-step-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all var(--transition-base);
}

.scan-step-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.scan-step-number {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.scan-step-body {
    flex: 1;
}

.scan-step-body h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.scan-step-body p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

.scan-step-qr-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.qr-container {
    display: flex;
    justify-content: center;
}

@media (max-width: 600px) {
    .scan-steps-grid {
        gap: 12px;
    }
    .scan-step-card {
        padding: 16px;
    }
    .scan-step-qr-row {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* ---------- Step 2: Options ---------- */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.option-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.option-card:hover {
    border-color: var(--primary);
    background: rgba(17, 85, 214, 0.04);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.option-card.active {
    border-color: var(--primary);
    background: rgba(17, 85, 214, 0.06);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.option-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.option-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #d0d5e0;
    border-radius: 24px;
    transition: all var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ---------- Step 3: Launch ---------- */
.launch-section {
    text-align: center;
    padding: 10px 0;
}

.launch-section p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 24px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 500;
}

.btn-launch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 6px 25px var(--primary-glow);
    width: auto;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

.btn-launch::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.6s ease;
}

.btn-launch:hover::before {
    left: 100%;
}

.btn-launch:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(17, 85, 214, 0.35);
}

.btn-launch:active {
    transform: translateY(-1px);
}

.btn-launch i {
    font-size: 1.3rem;
}

/* ---------- Other Screens (game, lobby, etc.) ---------- */
/* Keep .card system for non-home screens */
.card {
    background: var(--bg-card);
    width: 100%;
    max-width: 900px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    padding: 30px;
    text-align: center;
    display: none;
    margin: 30px auto;
}

.card.active {
    display: block;
}

/* Hide home screen via card system but show via custom layout */
#screen-home {
    max-width: none;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
    background: transparent;
    margin: 0;
}

#screen-home.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

h1 {
    color: var(--primary);
    margin: 0 0 10px 0;
    font-weight: 800;
    font-size: 1.6rem;
}

.subtitle {
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 20px;
    display: block;
}

/* General input styles */
input, textarea {
    font-family: 'Inter', sans-serif;
}

/* General button styles */
button {
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all var(--transition-fast);
}

button:hover {
    transform: translateY(-2px);
}

.btn-host {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    font-weight: 700;
    width: 100%;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-host:hover {
    box-shadow: 0 6px 25px var(--primary-glow);
}

.btn-close {
    background: var(--error);
    width: auto;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    float: right;
    border: none;
    color: white;
    border-radius: var(--radius-sm);
}

.btn-export {
    background: var(--text-primary);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    margin-bottom: 10px;
}

/* Player Grid */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.player-badge {
    background: var(--bg-subtle);
    padding: 10px 35px 10px 15px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 2px solid transparent;
    position: relative;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.player-badge.ready {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success);
}

.badge-delete {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
}

.badge-delete:hover {
    color: var(--error);
}

/* Timer */
.timer-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
    position: relative;
}

.timer-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    width: 100%;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 4px;
    transition: width 0.1s linear;
}

/* Image container */
.q-image-container {
    margin: 15px 0;
    display: none;
}

.q-image {
    max-width: 100%;
    max-height: 250px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.tab-btn {
    background: var(--bg-subtle);
    color: var(--text-muted);
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92rem;
    transition: all var(--transition-fast);
    border: 1px solid var(--border);
}

.tab-btn:hover {
    background: rgba(17, 85, 214, 0.06);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Ranking */
.ranking-list {
    max-height: 400px;
    overflow-y: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.95rem;
    transition: background var(--transition-fast);
}

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

.ranking-item:hover {
    background: var(--bg-subtle);
}

.rank-1 {
    background: #fff8e1;
    color: #d35400;
    border-left: 4px solid #f39c12;
}

/* Results */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    text-align: left;
}

.result-item {
    padding: 16px 18px;
    border-radius: var(--radius-md);
    color: white;
    position: relative;
    font-weight: 700;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.result-item.correct {
    background: linear-gradient(135deg, #00b894, #00cec9);
    opacity: 1;
    border: none;
}

.result-item.incorrect {
    background: linear-gradient(135deg, #d63031, #e17055);
    opacity: 0.75;
}

.result-count {
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 12px;
    border-radius: 6px;
    min-width: 24px;
    text-align: center;
    font-size: 0.9rem;
}

/* Logo in game screen */
.logo-top-right {
    position: absolute;
    top: 25px;
    left: 20px;
    width: 70px;
    height: auto;
    opacity: 0.8;
}

/* Floating room code */
.floating-room-code {
    position: fixed;
    bottom: 12px;
    left: 12px;
    background: var(--text-primary);
    color: white;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    z-index: 9999;
    letter-spacing: 1.5px;
    display: none;
    font-family: 'Inter', monospace;
}

/* MathJax */
.mjx-chtml {
    font-size: 1.2em !important;
}

.hidden {
    display: none !important;
}

/* File drop */
.file-drop {
    border: 3px dashed var(--border);
    padding: 30px;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 15px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.file-drop:hover,
.file-drop.dragover {
    background: var(--bg-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

/* Launch Section */
.launch-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 0;
    gap: 16px;
}

.launch-section p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0;
}

/* ---------- Footer ---------- */
.app-footer {
    width: 100%;
    padding: 24px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.7;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    margin-top: auto;
}

.app-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.app-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.footer-sep {
    color: var(--border);
}

.footer-credit {
    opacity: 0.8;
}

.footer-credit a {
    color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .questions-columns {
        grid-template-columns: 1fr;
    }

    .header-stepper {
        order: 3;
        width: 100%;
        justify-content: center;
        padding-top: 4px;
    }
}

@media (max-width: 768px) {
    .main-container {
        width: 95%;
        padding: 20px 14px 30px;
        gap: 20px;
    }

    .step-card {
        padding: 22px 18px;
    }

    .ai-form-inline {
        flex-direction: column;
    }

    .ai-field,
    .ai-field-sm {
        flex: unset;
        min-width: unset;
        width: 100%;
    }

    .btn-generate-inline {
        width: 100%;
        justify-content: center;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .btn-action {
        justify-content: center;
    }

    .header-actions .header-link span {
        display: none;
    }

    .header-stepper {
        display: none;
    }

    .app-header {
        padding: 12px 16px;
    }

    .q-table {
        font-size: 0.78rem;
    }

    .q-table th,
    .q-table td {
        padding: 6px 4px;
    }

    .btn-launch {
        width: 100%;
        padding: 16px 24px;
    }

    .ai-prompt-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ai-send-group-modal {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .step-header {
        gap: 10px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .step-title {
        font-size: 1.05rem;
    }

    .header-brand img {
        width: 34px;
        height: 34px;
    }

    .header-brand span {
        font-size: 1.15rem;
    }

    .q-block {
        padding: 14px;
    }

    .q-block-icon {
        width: 34px;
        height: 34px;
        font-size: 1.2rem;
    }
}

/* ---------- AI Form Select ---------- */
.ai-form .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    background: #ffffff;
    color: #1a1a2e;
    outline: none;
    transition: all var(--transition-fast);
    margin: 0;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    appearance: auto;
}

.ai-form .form-group select:focus {
    border-color: rgba(255, 255, 255, 0.9);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

/* ---------- Join Link Display (Lobby) ---------- */
.join-link-display {
    text-align: center;
    margin: 10px auto 0;
    padding: 12px 20px;
    max-width: 500px;
}

/* ---------- Edit Button ---------- */
.btn-edit-q {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 6px;
    width: auto;
    margin: 0 2px;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.btn-edit-q:hover {
    color: var(--primary);
    background: rgba(17, 85, 214, 0.08);
    transform: scale(1.15);
}

/* ---------- Edit Modal ---------- */
.edit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.edit-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 600px;
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

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

/* ---------- Animated Podium ---------- */
.podium-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 15px;
    height: 300px;
    margin: 40px auto;
    padding: 0 20px;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
}

.podium-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 5px;
    text-align: center;
    word-break: break-all;
}

.podium-score {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.podium-bar {
    width: 100%;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15px;
    font-size: 3rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.9);
    animation: growUp 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: bottom;
    transform: scaleY(0);
}

.place-1 .podium-bar {
    height: 200px;
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    box-shadow: 0 -5px 20px rgba(241, 196, 15, 0.5);
    animation-delay: 1.6s;
}
.place-2 .podium-bar {
    height: 140px;
    background: linear-gradient(135deg, #bdc3c7, #95a5a6);
    animation-delay: 0.8s;
}
.place-3 .podium-bar {
    height: 100px;
    background: linear-gradient(135deg, #e67e22, #d35400);
    animation-delay: 0s;
}

.place-1 { order: 2; z-index: 3; }
.place-2 { order: 1; z-index: 2; }
.place-3 { order: 3; z-index: 1; }

@keyframes growUp {
    0% { transform: scaleY(0); }
    100% { transform: scaleY(1); }
}

.edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}

.edit-modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.edit-modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all var(--transition-fast);
    margin: 0;
}

.edit-modal-close:hover {
    background: var(--error-bg);
    color: var(--error);
}



.edit-modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.edit-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.edit-field label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.edit-field input,
.edit-field textarea {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-fast);
    resize: vertical;
    width: 100%;
    margin: 0;
}

.edit-field input:focus,
.edit-field textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

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

.small-field {
    max-width: 140px;
}

.edit-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}

.btn-modal-cancel {
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    width: auto;
    margin: 0;
}

.btn-modal-cancel:hover {
    border-color: var(--error);
    color: var(--error);
}

.btn-modal-save {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px var(--primary-glow);
    font-family: 'Inter', sans-serif;
    width: auto;
    margin: 0;
}

.btn-modal-save:hover {
    box-shadow: 0 6px 20px var(--primary-glow);
}

@media (max-width: 480px) {
    .edit-row {
        grid-template-columns: 1fr;
    }
    .edit-modal {
        max-width: 100%;
    }
}

/* ---------- Toast Notification ---------- */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-primary);
    color: white;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 20000;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    font-family: 'Inter', sans-serif;
    max-width: 90vw;
    text-align: center;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- Draggable Table Rows ---------- */
.q-table tbody tr[draggable="true"] {
    cursor: grab;
}

.q-table tbody tr[draggable="true"]:active {
    cursor: grabbing;
}

/* Media Queries for step 1 tabs */
@media (max-width: 768px) {
    .step1-tab-inner {
        flex-direction: column;
    }
}

/* ---------- Floating Music Button ---------- */
.floating-music-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid var(--border);
    transition: all 0.3s ease;
    z-index: 1000;
}

.floating-music-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.2);
    color: var(--primary);
    border-color: var(--primary);
}

.floating-music-btn.music-active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 20px var(--primary-glow);
    animation: musicPulse 2s ease-in-out infinite;
}

.floating-music-btn.music-active:hover {
    color: white;
    transform: scale(1.1);
    animation: none;
}

@keyframes musicPulse {
    0%, 100% { box-shadow: 0 4px 20px var(--primary-glow); }
    50% { box-shadow: 0 4px 30px rgba(17, 85, 214, 0.4); }
}