/* 
 * QuizGame - The Final Quiz App
 * Brand Identity CSS
 * 
 * Colori Principali:
 * - Blu Profondo: #1A2B4C (Intelligenza, fiducia)
 * - Arancione Brillante: #FF7F3F (Energia, entusiasmo)
 * - Giallo Oro: #FFD700 (Conoscenza, vittoria)
 * - Bianco/Grigio: Leggibilità
 */

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

:root {
    /* Brand Colors */
    --blue-deep: #1A2B4C;
    --blue-medium: #2A4A7C;
    --blue-light: #4A7AB0;
    --blue-glow: #5B9BD5;
    
    --orange-bright: #FF7F3F;
    --orange-dark: #E5652A;
    --orange-glow: #FF9F5F;
    
    --gold: #FFD700;
    --gold-light: #FFE44D;
    --gold-dark: #D4A500;
    
    /* Neutrals */
    --white: #FFFFFF;
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-300: #CED4DA;
    --gray-400: #ADB5BD;
    --gray-500: #6C757D;
    --gray-600: #495057;
    --gray-700: #343A40;
    --gray-800: #212529;
    --dark: #0D1525;
    
    /* Semantic */
    --success: #28A745;
    --danger: #DC3545;
    --warning: var(--gold);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue-medium) 100%);
    --gradient-accent: linear-gradient(135deg, var(--orange-bright) 0%, var(--gold) 100%);
    --gradient-glow: linear-gradient(135deg, var(--blue-glow) 0%, var(--orange-glow) 100%);
    --gradient-hero: linear-gradient(180deg, var(--dark) 0%, var(--blue-deep) 50%, #152238 100%);
    
    /* Effects */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-glow-orange: 0 0 30px rgba(255, 127, 63, 0.4);
    --shadow-glow-blue: 0 0 30px rgba(91, 155, 213, 0.4);
    --shadow-glow-gold: 0 0 20px rgba(255, 215, 0, 0.5);
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* === BASE STYLES === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-hero);
    color: var(--white);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: var(--orange-bright);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--gold);
}

/* === ANIMATED BACKGROUND === */
.quiz-page {
    position: relative;
    overflow-x: hidden;
}

.quiz-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 127, 63, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(91, 155, 213, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Stars animation */
.quiz-page::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 215, 0, 0.3), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255, 127, 63, 0.3), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(255, 255, 255, 0.3), transparent);
    background-size: 200px 200px;
    animation: twinkle 5s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

@keyframes twinkle {
    0% { opacity: 0.4; }
    100% { opacity: 0.8; }
}

.quiz-container {
    position: relative;
    z-index: 1;
}

/* === LOGO === */
.brand-logo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    filter: drop-shadow(0 4px 20px rgba(255, 127, 63, 0.3));
    animation: float 3s ease-in-out infinite;
    /* Rounded corners stile App Store iOS (22% del size) */
    border-radius: 22%;
    background: linear-gradient(145deg, rgba(26, 43, 76, 0.8), rgba(13, 21, 37, 0.9));
}

.brand-logo-sm {
    width: 48px;
    height: 48px;
    border-radius: 22%;
}

.brand-logo-lg {
    width: 200px;
    height: 200px;
    border-radius: 22%;
}

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

/* === GAME TITLE === */
.game-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.game-title .quiz {
    color: var(--blue-glow);
}

.game-title .game {
    color: var(--orange-bright);
}

.game-slogan {
    font-size: 0.9rem;
    color: var(--gray-200);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 500;
}

.game-description {
    color: var(--gray-300);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* === CARDS === */
.card {
    background: linear-gradient(145deg, rgba(26, 43, 76, 0.9), rgba(13, 21, 37, 0.95));
    border: 1px solid rgba(91, 155, 213, 0.2);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(90deg, rgba(42, 74, 124, 0.5), rgba(26, 43, 76, 0.5));
    border-bottom: 1px solid rgba(91, 155, 213, 0.2);
    padding: 1rem 1.25rem;
}

.card-header h5 {
    margin: 0;
    color: var(--white);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h5 i {
    color: var(--orange-bright);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(91, 155, 213, 0.1);
    padding: 1rem 1.25rem;
}

/* === HEXAGON ELEMENTS === */
.hexagon-badge {
    position: relative;
    width: 80px;
    height: 92px;
    background: var(--gradient-accent);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow-orange);
}

.hexagon-badge::before {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--blue-deep);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.hexagon-badge i {
    position: relative;
    z-index: 1;
    font-size: 2rem;
    color: var(--gold);
}

/* === COUNTDOWN === */
.countdown-wrapper {
    background: linear-gradient(145deg, rgba(26, 43, 76, 0.95), rgba(13, 21, 37, 0.98));
    border: 2px solid transparent;
    border-image: var(--gradient-glow) 1;
    border-radius: var(--radius-xl);
    padding: 2rem 2.5rem;
    box-shadow: var(--shadow-glow-blue);
    position: relative;
    overflow: hidden;
}

.countdown-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
}

.countdown-label {
    color: var(--gray-200);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.countdown-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    text-shadow: 0 0 40px rgba(255, 127, 63, 0.3);
}

.countdown-unit {
    font-size: 0.7rem;
    color: var(--gray-300);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.countdown-separator {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--gray-600);
    margin-bottom: 1rem;
}

/* === BUTTONS === */
.btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--dark);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-orange);
    background: linear-gradient(135deg, var(--orange-glow) 0%, var(--gold-light) 100%);
    color: var(--dark);
}

.btn-secondary {
    background: var(--blue-medium);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--blue-light);
    transform: translateY(-2px);
}

.btn-outline-light {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--orange-bright);
    color: var(--orange-bright);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.4);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--gold), var(--orange-bright));
    color: var(--dark);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* === FORMS === */
.form-control {
    background: rgba(26, 43, 76, 0.8);
    border: 2px solid rgba(91, 155, 213, 0.3);
    border-radius: var(--radius-md);
    color: var(--white);
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: rgba(26, 43, 76, 0.95);
    border-color: var(--orange-bright);
    box-shadow: 0 0 0 3px rgba(255, 127, 63, 0.2);
    outline: none;
    color: var(--white);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-label {
    color: var(--gray-300);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.nickname-input {
    background: rgba(13, 21, 37, 0.9) !important;
    border: 2px solid var(--blue-light) !important;
    font-size: 1.25rem !important;
    text-align: center;
    color: var(--white) !important;
}

.nickname-input:focus {
    border-color: var(--orange-bright) !important;
    box-shadow: var(--shadow-glow-orange) !important;
}

/* === JOIN FORM === */
.join-form-wrapper {
    background: linear-gradient(145deg, rgba(26, 43, 76, 0.9), rgba(13, 21, 37, 0.95));
    border: 1px solid rgba(91, 155, 213, 0.3);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.btn-join-game {
    background: var(--gradient-accent) !important;
    border: none !important;
    color: var(--dark) !important;
    font-weight: 700 !important;
    font-size: 1.2rem !important;
    padding: 1rem 2rem !important;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-join-game:hover {
    box-shadow: var(--shadow-glow-orange) !important;
    transform: translateY(-3px) !important;
}

/* === PLAYER BADGE === */
.player-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2), rgba(32, 201, 151, 0.2));
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    border: 2px solid var(--success);
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.3);
}

.player-badge i {
    color: var(--success);
    font-size: 1.25rem;
}

/* === PARTICIPANTS COUNTER === */
.participants-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-200);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
}

.participants-counter i {
    color: var(--blue-glow);
}

.participants-counter span {
    color: var(--orange-bright);
    font-weight: 700;
}

/* === BADGE STYLES === */
.badge {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    padding: 0.4em 0.8em;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.bg-success { background: linear-gradient(135deg, #28a745, #20c997) !important; }
.badge.bg-warning { background: var(--gradient-accent) !important; color: var(--dark) !important; }
.badge.bg-danger { background: linear-gradient(135deg, #dc3545, #c82333) !important; }
.badge.bg-info { background: linear-gradient(135deg, var(--blue-light), var(--blue-glow)) !important; }
.badge.bg-secondary { background: var(--gray-600) !important; }
.badge.bg-primary { background: var(--gradient-primary) !important; }

/* === ADMIN STYLES === */
.admin-page {
    background: var(--gradient-hero);
}

.admin-page .navbar {
    background: linear-gradient(90deg, var(--dark), var(--blue-deep)) !important;
    border-bottom: 2px solid rgba(255, 127, 63, 0.3);
    padding: 0.75rem 1rem;
}

.admin-page .navbar-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--white) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-page .navbar-brand i {
    color: var(--orange-bright);
}

/* === GAME STATS === */
.game-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.game-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-300);
    font-size: 0.9rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(91, 155, 213, 0.1);
}

.game-stats .stat:last-child {
    border-bottom: none;
}

.game-stats .stat i {
    color: var(--orange-bright);
    width: 20px;
    text-align: center;
}

/* === GAME CARD === */
.game-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(91, 155, 213, 0.2);
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: var(--orange-bright);
    box-shadow: var(--shadow-glow-orange);
}

/* === QUESTIONS LIST === */
.questions-list {
    display: flex;
    flex-direction: column;
}

.question-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem;
    border-bottom: 1px solid rgba(91, 155, 213, 0.1);
    transition: background 0.2s ease;
}

.question-item:hover {
    background: rgba(42, 74, 124, 0.3);
}

.question-header {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.question-number {
    background: var(--gradient-accent);
    color: var(--dark);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.question-content {
    flex: 1;
}

.question-text {
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--white);
}

.question-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.answers-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.answer-chip {
    background: rgba(91, 155, 213, 0.15);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--gray-300);
    border: 1px solid rgba(91, 155, 213, 0.2);
}

.answer-chip.correct {
    background: rgba(40, 167, 69, 0.2);
    color: var(--success);
    border-color: var(--success);
}

/* === QR CODE === */
.qr-image {
    max-width: 200px;
    border-radius: var(--radius-md);
    background: white;
    padding: 12px;
    box-shadow: var(--shadow-lg);
}

/* === INFO GRID === */
.info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(91, 155, 213, 0.1);
}

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

.info-label {
    color: var(--gray-300);
    font-size: 0.9rem;
}

.info-value {
    color: var(--white);
    font-weight: 600;
}

/* === ANSWER INPUT LABELS === */
.answer-label-a { background: #DC3545; color: white; font-weight: 700; }
.answer-label-b { background: var(--blue-glow); color: white; font-weight: 700; }
.answer-label-c { background: var(--gold); color: var(--dark); font-weight: 700; }
.answer-label-d { background: var(--success); color: white; font-weight: 700; }

/* === ANSWER INPUT GROUP (Admin) === */
.answer-input-group .input-group-text {
    background: rgba(26, 43, 76, 0.8);
    border: 2px solid rgba(91, 155, 213, 0.3);
    color: var(--gray-300);
    padding: 0.75rem 1rem;
}

.answer-input-group .input-group-text label {
    color: var(--gray-300);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

/* Custom Checkbox Styling */
.answer-input-group .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    background-color: rgba(13, 21, 37, 0.9);
    border: 2px solid var(--blue-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.answer-input-group .form-check-input:checked {
    background-color: var(--success);
    border-color: var(--success);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.answer-input-group .form-check-input:focus {
    border-color: var(--orange-bright);
    box-shadow: 0 0 0 3px rgba(255, 127, 63, 0.25);
    outline: none;
}

.answer-input-group .form-check-input:checked + label {
    color: var(--success);
    font-weight: 600;
}

.answer-input-group .form-check-input:hover {
    border-color: var(--orange-bright);
}

/* === CONTROL PAGE === */
.control-card .card-body {
    padding: 1.5rem;
}

.control-buttons .btn {
    font-size: 1rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 0.875rem 0;
    border-bottom: 1px solid rgba(91, 155, 213, 0.15);
}

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

.status-label {
    color: var(--gray-300);
}

.status-value {
    font-weight: 600;
    color: var(--white);
}

/* === QUESTION PREVIEW (Control Page) === */
.question-preview {
    color: var(--white) !important;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

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

.answer-preview {
    background: rgba(42, 74, 124, 0.6);
    border: 1px solid rgba(91, 155, 213, 0.3);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    color: var(--white);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.answer-preview .letter {
    background: var(--blue-light);
    color: var(--white);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.answer-preview.correct {
    background: rgba(40, 167, 69, 0.25);
    border-color: var(--success);
}

.answer-preview.correct .letter {
    background: var(--success);
}

/* === LEADERBOARD === */
.leaderboard-control {
    max-height: 400px;
    overflow-y: auto;
}

.lb-control-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(91, 155, 213, 0.1);
    transition: background 0.2s ease;
}

.lb-control-item:hover {
    background: rgba(42, 74, 124, 0.3);
}

.lb-control-item .lb-rank {
    width: 32px;
    height: 32px;
    background: var(--gradient-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--dark);
    margin-right: 1rem;
    font-size: 0.9rem;
}

.lb-control-item .lb-name {
    flex: 1;
    color: var(--white);
}

.lb-control-item .lb-score {
    font-weight: 700;
    color: var(--gold);
    font-family: 'Space Grotesk', sans-serif;
}

/* === LOGIN PAGE === */
.login-card {
    background: linear-gradient(145deg, rgba(26, 43, 76, 0.95), rgba(13, 21, 37, 0.98));
    border: 1px solid rgba(91, 155, 213, 0.3);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    margin-bottom: 2rem;
}

.login-header i {
    color: var(--orange-bright);
    font-size: 3rem;
}

/* === ERROR PAGES === */
.error-page {
    background: var(--gradient-hero);
}

.error-container h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 8rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === FLASH MESSAGES === */
.flash-messages {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1050;
    max-width: 400px;
}

.flash-messages .alert {
    background: rgba(26, 43, 76, 0.95);
    border: 1px solid rgba(91, 155, 213, 0.3);
    backdrop-filter: blur(10px);
    color: var(--white);
    border-radius: var(--radius-md);
}

.flash-messages .alert-success {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2), rgba(26, 43, 76, 0.95));
}

.flash-messages .alert-danger {
    border-color: var(--danger);
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.2), rgba(26, 43, 76, 0.95));
}

/* === TABLES === */
.table {
    color: var(--gray-300);
}

.table thead th {
    background: rgba(42, 74, 124, 0.5);
    color: var(--white);
    border-bottom: 2px solid rgba(255, 127, 63, 0.3);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody tr {
    border-bottom: 1px solid rgba(91, 155, 213, 0.1);
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(42, 74, 124, 0.3);
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

.table-active {
    background: rgba(255, 127, 63, 0.15) !important;
}

.table-active td {
    color: var(--white) !important;
}

.table-success {
    background: rgba(40, 167, 69, 0.15) !important;
}

.table-success td {
    color: var(--gray-200) !important;
}

/* === ANIMATIONS === */
.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

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

.bounce-animation {
    animation: bounce 2s ease-in-out infinite;
}

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

.glow-animation {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(255, 127, 63, 0.3); }
    100% { box-shadow: 0 0 25px rgba(255, 127, 63, 0.6); }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--blue-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--blue-light);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .countdown-value {
        font-size: 2.5rem;
    }
    
    .countdown-separator {
        font-size: 1.5rem;
    }
    
    .game-title {
        font-size: 1.75rem;
    }
    
    .brand-logo {
        width: 80px;
        height: 80px;
    }
    
    .question-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    .question-actions {
        align-self: flex-end;
    }
    
    .login-card {
        padding: 1.5rem;
        margin: 1rem;
    }
}

/* === GLOBAL TEXT VISIBILITY FIXES === */
/* Override Bootstrap text-muted for dark backgrounds */
.text-muted {
    color: var(--gray-400) !important;
}

/* Ensure paragraphs and general text are visible */
p, li, span {
    color: inherit;
}

/* Card body text should be white by default */
.card-body p,
.card-body li,
.card-body span:not(.badge) {
    color: var(--gray-200);
}

/* Table text visibility */
.table td,
.table th {
    color: var(--gray-200);
}

.table td strong {
    color: var(--white);
}

/* Alert text visibility */
.alert {
    color: var(--white);
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    border-color: var(--success);
}

/* Labels and form text */
label {
    color: var(--gray-200);
}

/* Info text and small text */
small, .small {
    color: var(--gray-400);
}

/* Ensure headers are always white */
h1, h2, h3, h4, h5, h6 {
    color: var(--white);
}

/* Empty state messages */
.text-center.py-4.text-muted,
.card-body .text-muted {
    color: var(--gray-400) !important;
}

/* === UTILITIES === */
.text-orange { color: var(--orange-bright) !important; }
.text-gold { color: var(--gold) !important; }
.text-blue { color: var(--blue-glow) !important; }
.text-bronze { color: #CD7F32 !important; }
.text-white { color: var(--white) !important; }
.text-light { color: var(--gray-200) !important; }
.bg-gradient-accent { background: var(--gradient-accent) !important; }
.bg-gradient-primary { background: var(--gradient-primary) !important; }
