/* Base styles */
:root {
    --primary-color: #4361ee;
    --primary-dark: #3a0ca3;
    --secondary-color: #f72585;
    --tertiary-color: #7209b7;
    --accent-color: #4cc9f0;
    --success-color: #2dc653;
    --danger-color: #ef233c;
    --warning-color: #ffca3a;
    --text-color: #2b2d42;
    --light-text: #8d99ae;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--tertiary-color));
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color), var(--tertiary-color));
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

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

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    padding-top: 16px; /* Account for fixed nav */
}

@media (min-width: 768px) {
    body {
    padding-top: 50px; /* Account for fixed nav */
}

}


.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

/* Navigation */
nav.nav {
    background-color: #fff;
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

.brand {
    font-size: 1.8rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    margin-left: 0;
    display: inline-block;
    flex-shrink: 0;
}

.menu {
    display: flex;
    list-style: none;
    margin-right: 30px;
    align-items: center;
}

.menu li {
    margin-left: 25px;
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: color var(--transition-fast), background-color var(--transition-fast);
    font-size: 1.1rem;
    padding: 10px 20px;
    border-radius: 30px;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
    background-color: rgba(67, 97, 238, 0.15);
}

/* Dropdown menu */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
}

.dropdown-toggle::after {
    content: '▼';
    font-size: 0.7em;
    margin-left: 5px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--card-bg);
    min-width: 180px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 10px 0;
    z-index: 100;
}

.bottom-ad-container {
    min-height:600px;
}

/* Fix user dropdown positioning to prevent it from going off-screen */
.profile-link .dropdown-menu {
    right: 0;
    left: auto;
}

.nav-dropdown:hover .dropdown-menu, .nav-dropdown:focus-within .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 8px 15px;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.3s;
}

.dropdown-item:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.dropdown-loading {
    padding: 8px 15px;
    color: var(--light-text);
}

.user-info {
    display: flex;
    align-items: center;
}

.user-profile {
    display: flex;
    align-items: center;
}

#user-display-name {
    margin-right: 10px;
    font-weight: 500;
}

/* Condensed Quiz Header Styles */
.quiz-header-container {
    background: #fff;
    height: 40px;
    top: 0;
    z-index: 1000;
    margin-top: 4px;
}

.quiz-header-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brainu-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.brainu-logo-img {
    height: 32px;
    width: auto;
}

.btn-signup {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 5px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-signup:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Header buttons container */
.header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Restart button */
.btn-restart {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-restart:hover {
    background: #f0f0f0;
    border-color: #999;
}

.btn-restart i {
    font-size: 11px;
}

.restart-text {
    display: inline;
}

/* Quiz Progress Bar */
.quiz-progress-bar {
    top: 40px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    padding: 8px 12px 10px;
    z-index: 999;
}

/* Question Counter */
.question-label {
    font-size: 15px;
    font-weight: 500;
    color: #666;
}

.question-number {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
}

/* Stats Display */
.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 2px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 16px;
    background: #ddd;
    margin: 0 15px;
}

/* Fire Container and Animation */
.fire-container {
    display: inline-block;
    font-size: 16px;
    margin-right: 4px;
    filter: grayscale(1) opacity(0.3);
    transition: filter 0.3s ease;
}

.fire-container.active {
    filter: grayscale(0) opacity(1);
    animation: fire-burn 1s ease-in-out infinite;
}

@keyframes fire-burn {
    0%, 100% {
        transform: scale(1) translateY(0);
        filter: brightness(1);
    }
    25% {
        transform: scale(1.1) translateY(-1px) rotate(-5deg);
        filter: brightness(1.2);
    }
    50% {
        transform: scale(1.15) translateY(-2px) rotate(5deg);
        filter: brightness(1.3) hue-rotate(10deg);
    }
    75% {
        transform: scale(1.1) translateY(-1px) rotate(-3deg);
        filter: brightness(1.1);
    }
}

/* Higher streak effects */
.fire-intense {
    animation: fire-burn-intense 0.6s ease-in-out infinite;
}

@keyframes fire-burn-intense {
    0%, 100% {
        transform: scale(1.2) translateY(0);
        filter: brightness(1.2) hue-rotate(0deg);
    }
    25% {
        transform: scale(1.3) translateY(-2px) rotate(-8deg);
        filter: brightness(1.4) hue-rotate(-10deg);
    }
    50% {
        transform: scale(1.35) translateY(-3px) rotate(8deg);
        filter: brightness(1.5) hue-rotate(15deg) saturate(1.2);
    }
    75% {
        transform: scale(1.25) translateY(-1px) rotate(-5deg);
        filter: brightness(1.3) hue-rotate(5deg);
    }
}

.streak-display {
    min-width: 30px;
}

/* Progress Container */
.progress-container {
    margin-top: 6px;
    margin-bottom:6px;
}


/* Timer bar */
.timer-bar-container {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.timer-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #4CAF50 60%, #FFC107 85%, #FF5722 100%);
    transition: width 0.1s linear;
    border-radius: 5px;
    position: absolute;
    top: 0;
    left: 0;
}

/* Utility classes */
.fixed { position: fixed; }
.w-full { width: 100%; }
.bg-white { background: white; }
.z-50 { z-index: 50; }
.z-40 { z-index: 40; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.ml-1 { margin-left: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.font-semibold { font-weight: 600; }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1); }
.rounded-b-lg {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}
.relative { position: relative; }
.rounded { border-radius: 0.25rem; }
.overflow-hidden { overflow: hidden; }

.ezoic-ad {
    min-height:100px !important;
}

/* Mobile specific */
@media (max-width: 768px) {

    .question-container {
        min-height: 125px !important;
    }

    .btn-signup {
        font-size: 16px;
        padding: 4px 8px;
    }

    .btn-restart {
        font-size: 16px;
        padding: 4px 6px;
        margin-right: 8px;
    }

    .btn-restart i {
        font-size: 10px;
    }

    /* Hide restart text on very small screens, show only icon */
    @media (max-width: 360px) {
        .restart-text {
            display: none;
        }
    }

    .header-buttons {
        gap: 4px;
    }

    /* Adjust main container padding on mobile to account for nav + progress bar */
    #main-container {
        padding-top: 125px !important;
    }

    .quiz-progress-bar .question-label {
        font-size: 18px !important;
    }

    .quiz-progress-bar .question-number {
        font-size: 18px !important;
    }

    .quiz-progress-bar .stat-value {
        font-size: 16px !important;
        font-weight: 600 !important;
    }

    .quiz-progress-bar .stat-label {
        font-size: 16px !important;
        font-weight: 500 !important;
    }

    .quiz-progress-bar .stat-divider {
        margin: 0 10px !important;
        height: 14px;
    }

    .quiz-progress-bar .streak-fire {
        font-size: 16px !important;
    }

    body {
        padding-top: 0;
    }
}

/* Desktop */
@media (min-width: 769px) {
    #game-area .container {
        padding-top: 90px !important;
    }

    body {
        padding-top: 0;
    }
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
}

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

.btn-secondary:hover {
    background-color: #e55a5a;
}

.btn-large {
    padding: 12px 24px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 4px 8px;
    font-size: 0.9rem;
}

/* Pages */
.page {
    display: none;
    padding: 0px 0;    
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page.active {
    display: block;
    opacity: 1;
}

/* Home page */
.hero {
    text-align: center;
    padding: 60px 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--light-text);
    margin-bottom: 30px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.feature-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 15px;
}

/* Loading indicator styles */
#loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#loading-indicator.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

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

#loading-indicator p {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
}

/* Active games notification styles */
.active-games-container {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.active-games-container.hidden {
    display: none;
}

.active-games-container h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 10px;
}

.active-games-container p {
    margin-bottom: 15px;
}

#active-games-list {
    list-style-type: none;
    padding: 0;
    margin-bottom: 20px;
}

#active-games-list li {
    padding: 10px 15px;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 8px;
    transition: background-color 0.3s;
}

#active-games-list li:hover {
    background-color: #f1f1f1;
}

.active-game-link {
    color: #007bff;
    text-decoration: none;
    display: block;
}

.active-game-link:hover {
    text-decoration: underline;
}

/* Timer bar with label */
.timer-container {
    margin-bottom: 20px;
}

.timer-label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    font-size: 0.85rem;
    color: var(--light-text);
}

.timer-label i {
    margin-right: 5px;
}

/* Trivia sections on homepage */
.trivias-section {
    margin: 40px 0;
}

.trivias-section h2 {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    display: inline-block;
}

.trivias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.trivia-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.trivia-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.trivia-card-header {
    position: relative;
    height: 120px;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    color: white;
    background-size: cover;
    background-position: center;
}

.trivia-card-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.trivia-card-header h3 {
    position: relative;
    z-index: 1;
    text-align: center;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 1.2rem;
}

.trivia-card-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
    padding: 15px 10px 10px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 60%;
}

.trivia-card-title-overlay h3 {
    color: white;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    font-size: 1.2rem;
    text-align: center;
}

.trivia-card-body {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
}

.trivia-card-body p {
    margin-bottom: 15px;
    flex-grow: 1;
    color: var(--light-text);
    font-size: 0.9rem;
}

.trivia-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--light-text);
    margin-bottom: 10px;
}

.trivia-category {
    background-color: var(--bg-color);
    padding: 3px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.category-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.trivia-image {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-size: cover;
    background-position: center;
}

.trivia-image-container {
    position: relative;
    height: 150px;
    overflow: hidden;
}

.category-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 2;
}

.trivia-meta.secondary {
    margin-top: -5px;
    margin-bottom: 12px;
    font-size: 0.75rem;
    color: var(--light-text);
}

.play-trivia-btn {
    width: 100%;
    padding: 8px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.play-trivia-btn:hover {
    background-color: var(--primary-dark);
}

.loading-placeholder {
    text-align: center;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 8px;
    color: var(--light-text);
}

.timer-label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    font-size: 0.85rem;
    color: var(--light-text);
}

.timer-icon {
    font-size: 1.1rem;
}

.timer-container {
    width: 100%;
    height: 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

#timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(to right, #ff9f43, #4361ee);
    border-radius: 10px;
    box-shadow: 0 0 5px rgba(67, 97, 238, 0.5);
}

/* Play page */
.game-setup {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-setup h2 {
    text-align: center;
    margin-bottom: 30px;
}

.game-options {
    margin-bottom: 30px;
}

.option-group {
    margin-bottom: 20px;
}

.option-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
}

.checkbox-item input {
    margin-right: 8px;
}

select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.game-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}


.game-fixed-header {
    position: sticky;
    top: 70px;
    z-index: 950;
    background: #ffffff;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.25);
    margin-bottom: 24px;
}

.game-fixed-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.game-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.game-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
    flex-shrink: 0;
}

.game-avatar i {
    font-size: 1.6rem;
}

.question-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.question-progress-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.header-question-counter {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1f2937;
    background: none;
    padding: 0;
    border-radius: 0;
}

.game-header-stats {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(244, 247, 254, 0.85);
    padding: 10px 16px;
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.15), rgba(14, 165, 233, 0.35));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    flex-shrink: 0;
}

.score-stat .stat-icon {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(249, 115, 22, 0.35));
    color: #92400e;
}

.streak-stat .stat-icon {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(239, 68, 68, 0.35));
    color: #b91c1c;
}

.stat-details {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.streak-container {
    gap: 10px;
    color: inherit;
}

.streak-value {
    display: flex;
    align-items: center;
    gap: 6px;
}

.streak-value #streak-count {
    font-weight: 700;
    font-size: 1.1rem;
    color: #0f172a;
    min-width: 26px;
    text-align: center;
}

.streak-count.pulse {
    animation: pulse-text ease-out;
    animation-duration: 750ms; /* Default, will be overridden by inline style */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 215, 0, 0.6);
    background-color: rgba(255, 215, 0, 0.3);
    color: #FFF7CC;
    font-weight: 800;
}

.game-progress-bar {
    margin-top: 18px;
}

.game-progress-bar .timer-container {
    margin-bottom: 0;
    height: 12px;
    background: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    padding: 2px;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.12);
}

.game-progress-bar #timer-bar {
    border-radius: 999px;
    box-shadow: none;
    height: 100%;
    background: linear-gradient(90deg, #22d3ee 0%, #3b82f6 100%);
}

.game-fixed-header + .game-trivia-title {
    margin-top: 10px;
}

@media (max-width: 768px) {
    .game-fixed-header {
        top: 60px;
        padding: 16px 14px;
    }

    .game-fixed-header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .game-header-left {
        width: 100%;
    }

    .game-header-stats {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }

    .stat-item {
        flex: 1 1 30%;
        padding: 12px;
        justify-content: flex-start;
    }

    .stat-details {
        gap: 2px;
    }

    .stat-value {
        font-size: 1rem;
    }

    .game-progress-bar {
        margin-top: 14px;
    }
}

/* Legacy game header layout used on marketing pages */
.game-header {
    padding: 12px 20px;
    background: var(--gradient-primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.game-header .question-counter {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.15);
    padding: 5px 12px;
    border-radius: 20px;
}

.game-header .score-display {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.game-header .streak-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.game-header .streak-count {
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 5px;
    min-width: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.streak-count.pulse {
    animation: pulse-text ease-out;
    animation-duration: 750ms; /* Default, will be overridden by inline style */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 215, 0, 0.6);
    background-color: rgba(255, 215, 0, 0.3);
    color: #FFF7CC;
    font-weight: 800;
}

@keyframes pulse-text {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.2); }
    75% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.streak-fire {
    color: #ffda63;
    margin-left: 5px;
    font-size: 1.1rem;
    vertical-align: middle;
    animation: slow-flicker infinite alternate;
    animation-duration: 2s; /* Default duration, will be overridden */
    text-shadow: 0 0 4px #ffffff, 0 0 8px #ffc300;
    position: relative;
    display: inline-block;
    --glow-opacity: 0.4; /* Default glow opacity */
    --glow-pulse-duration: 1600ms; /* Default glow pulse duration */
}

.streak-fire.hidden {
    display: none;
}

@keyframes slow-flicker {
    0% { opacity: 0.9; transform: scale(1); text-shadow: 0 0 4px #ffffff, 0 0 8px #ffc300; }
    50% { opacity: 0.7; transform: scale(1.15); text-shadow: 0 0 8px #ffffff, 0 0 15px #ffc300; }
    100% { opacity: 1; transform: scale(1); text-shadow: 0 0 4px #ffffff, 0 0 8px #ffc300; }
}

/* Add a more intense flicker animation for high streaks */
@keyframes intense-flicker {
    0% { opacity: 1; transform: scale(1); text-shadow: 0 0 4px #ffffff, 0 0 12px #ffc300; }
    25% { opacity: 0.9; transform: scale(1.3); text-shadow: 0 0 15px #ffffff, 0 0 25px #ffc300, 0 0 40px #ff6b00; }
    50% { opacity: 0.8; transform: scale(0.85); text-shadow: 0 0 8px #ffffff, 0 0 15px #ffc300; }
    75% { opacity: 1; transform: scale(1.4); text-shadow: 0 0 20px #ffffff, 0 0 30px #ffc300, 0 0 50px #ff6b00; }
    100% { opacity: 0.95; transform: scale(1); text-shadow: 0 0 4px #ffffff, 0 0 12px #ffc300; }
}

/* Add pseudo-element for additional glow effect */
.streak-fire::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,195,0,0.6) 0%, rgba(255,195,0,0) 70%);
    z-index: -1;
    opacity: var(--glow-opacity, 0.4);
    transition: opacity 0.2s ease;
    filter: blur(5px);
    animation: glow-pulse infinite alternate;
    animation-duration: var(--glow-pulse-duration, 1600ms);
}

@keyframes glow-pulse {
    0% { opacity: 0.3; transform: translate(-50%, -50%) scale(1.5); filter: blur(5px); }
    50% { opacity: 0.7; transform: translate(-50%, -50%) scale(2.5); filter: blur(8px); }
    100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1.8); filter: blur(6px); }
}

.game-branding {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.game-title {
    font-size: 1.8rem;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin: 0;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.stats-container {
    display: flex;
    gap: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(67, 97, 238, 0.1);
    padding: 3px 10px;
    border-radius: 50px;
}

.stat-icon {
    font-size: 1.2rem;
}

.question-container {
    margin-bottom: 10px;    
    padding: 10px 15px;
    text-align: center;
    background-color: #2d2e2d;
    color: white;
    min-height: 70px;
    vertical-align: middle;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 500;    
    line-height: 1.5;
}

.question-image-container {
    text-align: center;
    background-color: #f2f5f0;
    position: relative;
    padding-top: 30px;
}

/* Mobile-specific parallax image container */
@media (max-width: 768px) {
    .question-image-container:not(.has-video) {
        height: 230px; /* 220px content + 10px padding */
        padding-top: 10px;
        box-sizing: border-box; /* Include padding in height */
        overflow: hidden;
        position: relative;
    }

    .question-image-container.has-tall-image {
        /* Container maintains 230px total height */
        height: 230px;
        position: relative;
    }

    /* Ensure padding area is always visible with gray background */
    .question-image-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 10px;
        background-color: #f2f5f0;
        z-index: 1;
    }

    .question-image-container.has-tall-image .question-image {
        position: absolute;
        top: 10px; /* Start below the padding */
        left: 0;
        width: 100%;
        height: auto;
        will-change: transform;
        transition: transform 0.15s ease-out; /* Smoother, more noticeable transition */
    }

    /* For images shorter than 220px, center them */
    .question-image-container:not(.has-tall-image) {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.question-image {
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
}

/* Desktop keeps original behavior */
@media (min-width: 769px) {
    .question-image-container {
        height: auto !important; /* Auto height on desktop */
        padding-top: 30px; /* Keep original padding */
        overflow: visible; /* Show full image */
    }

    .question-image {
        max-width: 100%;
        max-height: 300px;
        width: auto; /* Maintain aspect ratio */
        height: auto; /* Maintain aspect ratio */
        position: static; /* Normal positioning on desktop */
    }
}

.options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin:0px 15px;
}

@media (max-width: 768px) {
    .options-container {
        grid-template-columns: 1fr;
    }
    
    /* Fix game header formatting on mobile */
    .game-header {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        text-align: center;
    }
    
    .game-header .question-counter {
        width: 100%;
        text-align: center;
    }
    
    .game-header .score-display {
        font-size: 1rem;
    }
    
    .game-header .streak-container {
        justify-content: center;
        width: 100%;
    }
    
    .game-header .streak-label {
        font-size: 0.85rem;
    }
    
    .game-header .streak-count {
        font-size: 1rem;
    }
}

.option {
    position: relative;
    padding: 10px 25px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--card-bg);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 100%);
    z-index: 1;
}

.option:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    margin-right: 15px;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.option:hover .option-letter {
    transform: scale(1.1);
    background-color: var(--primary-dark);
}

.option-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
    flex-grow: 1;
}

.option.correct {
    background-color: rgba(45, 198, 83, 0.1);
    border-color: var(--success-color);
    pointer-events: none;
}

.option.correct .option-letter {
    background-color: var(--success-color);
    animation: pulse 1s ease-out;
}

.option.incorrect {
    background-color: rgba(239, 35, 60, 0.1);
    border-color: var(--danger-color);
    pointer-events: none;
}

.option.incorrect .option-letter {
    background-color: var(--danger-color);
}

.option.disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(45, 198, 83, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(45, 198, 83, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(45, 198, 83, 0);
    }
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
    flex-wrap: wrap;
}

.game-controls .btn {
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 10px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    min-width: 180px;
}

/* Mobile responsive stacking */
@media (max-width: 768px) {
    .game-controls {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        max-width: 100%;
    }
    
    .game-controls .btn {
        min-width: 200px;
        width: 100%;
        max-width: 300px;
    }
}

.game-controls .btn-primary {
    background: var(--gradient-primary);
    border: none;
}

.game-controls .btn-primary:hover {
    box-shadow: var(--shadow-md), 0 0 10px rgba(67, 97, 238, 0.5);
    transform: translateY(-2px);
}

.game-controls .btn-secondary {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.game-controls .btn-secondary:hover {
    background-color: rgba(67, 97, 238, 0.1);
    transform: translateY(-2px);
}

.game-results {
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    animation: slide-up 0.7s ease-out;
}

@keyframes slide-up {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.game-results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: var(--gradient-primary);
}

.game-results h2 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    color: var(--primary-dark);
    font-weight: 800;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    position: relative;
    display: inline-block;
}

.game-results h2::after {
    content: '🏆';
    font-size: 1.5rem;
    position: absolute;
    top: -15px;
    right: -30px;
    animation: trophy-bounce 2s ease infinite;
}

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

.results-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 30px 0;
}

/* Mobile responsive styles for results container */
@media (max-width: 768px) {
    .results-container {
        gap: 10px;
        margin: 20px 0;
    }
    
    .result-item {
        padding: 12px 16px;
        min-height: 50px;
        gap: 10px;
    }
    
    .result-item i {
        font-size: 1.4rem;
    }
    
    .result-item h3 {
        font-size: 0.9rem;
    }
    
    .result-value {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .results-container {
        gap: 8px;
    }
    
    .result-item {
        padding: 10px 12px;
        min-height: 45px;
        gap: 8px;
    }
    
    .result-item i {
        font-size: 1.2rem;
    }
    
    .result-item h3 {
        font-size: 0.85rem;
    }
    
    .result-value {
        font-size: 1.4rem;
    }
}

.result-item {
    background-color: rgba(67, 97, 238, 0.05);
    border-radius: var(--border-radius);
    padding: 16px 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    animation: pop-in 0.5s ease-out forwards;
    animation-delay: calc(var(--item-index, 0) * 0.1s);
    opacity: 0;
    transform: scale(0.9);
    min-height: 60px;
}

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

.result-item:hover {
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.2);
    transform: translateY(-5px);
}

.result-item i {
    font-size: 1.6rem;
    margin-bottom: 0;
    color: var(--primary-color);
    animation: pulse-icon 2s infinite;
    flex-shrink: 0;
}

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

.result-item h3 {
    margin-bottom: 0;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--light-text);
    line-height: 1.2;
    flex: 1;
}

.result-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-top: 0;
    flex-shrink: 0;
}

.ranking-container {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(67,97,238,0.05) 100%);
    border: 2px solid rgba(67, 97, 238, 0.1);
    border-radius: 16px;
    padding: 32px 24px;
    margin: 30px 0;
    position: relative;
    animation: fade-in 1s ease-out 0.5s forwards;
    opacity: 0;
    box-shadow: 0 8px 32px rgba(67, 97, 238, 0.12);
    text-align: center;
    backdrop-filter: blur(10px);
}

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

.ranking-title {
    font-size: 1.3rem;
    margin-bottom: 24px;
    color: var(--primary-dark);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.ranking-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.ranking-rank {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    padding: 8px 16px;
    background: rgba(67, 97, 238, 0.1);
    border-radius: 20px;
    display: inline-block;
    border: 1px solid rgba(67, 97, 238, 0.2);
}

.ranking-value {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary-color);
    text-shadow: 0 2px 10px rgba(67, 97, 238, 0.3);
    margin-bottom: 16px;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ranking-message {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 16px;
    line-height: 1.5;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.ranking-percentile {
    font-size: 1.1rem;
    margin-top: 12px;
    font-weight: 600;
    color: var(--secondary-color);
    padding: 10px 20px;
    background: rgba(67, 97, 238, 0.08);
    border-radius: 25px;
    display: inline-block;
    border: 1px solid rgba(67, 97, 238, 0.15);
}

/* Mobile responsive styles for ranking container */
@media (max-width: 768px) {
    .ranking-container {
        padding: 24px 16px;
        margin: 20px 0;
    }
    
    .ranking-container::before {
        top: 12px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 1.8rem;
    }
    
    .ranking-title {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }
    
    .ranking-rank {
        font-size: 1.2rem;
        padding: 6px 12px;
    }
    
    .ranking-value {
        font-size: 2.4rem;
        margin-bottom: 14px;
    }
    
    .ranking-message {
        font-size: 1rem;
        margin-bottom: 14px;
    }
    
    .ranking-percentile {
        font-size: 1rem;
        padding: 8px 16px;
    }
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f22525;
    animation: confetti-fall linear forwards;
}

/* Leaderboard page */
.leaderboard-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter {
    flex: 1;
    min-width: 200px;
}

.filter label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.filter select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-bg);
    color: var(--text-color);
}

.leaderboard-header {
    display: grid;
    grid-template-columns: 80px 1fr 120px 120px;
    gap: 10px;
    padding: 15px 20px;
    background-color: var(--bg-color);
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.leaderboard-entries {
    background-color: var(--card-bg);
    border-radius: 0 0 8px 8px;
    padding: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 80px 1fr 120px 120px;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.leaderboard-entry:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.leaderboard-entry:hover {
    background-color: var(--bg-color);
}

.leaderboard-entry .rank {
    font-weight: 600;
    color: var(--primary-color);
}

.leaderboard-entry .username {
    font-weight: 500;
}

.leaderboard-entry .score {
    font-weight: 600;
    color: var(--text-color);
}

.leaderboard-entry .accuracy {
    color: var(--secondary-color);
    font-weight: 500;
}

.loading-message {
    padding: 30px;
    text-align: center;
    color: var(--light-text);
}

.error-message {
    padding: 30px;
    text-align: center;
    color: #e63946;
    background-color: rgba(230, 57, 70, 0.1);
    border-radius: 8px;
}

/* Styles for Extra Information box */
.extra-info {
    margin-top: 25px;
    margin-bottom: 20px; /* Add some space before next button */
    padding: 20px;
    background-color: #e9f5fe; /* Light blue background */
    border-left: 5px solid var(--primary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    color: var(--text-color);
}

.extra-info p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
}

.extra-info p:not(:last-child) {
    margin-bottom: 10px;
}

/* Top 3 styling */
.leaderboard-entry:nth-child(1) .rank {
    color: gold;
    font-weight: 700;
    font-size: 1.1rem;
}

.leaderboard-entry:nth-child(2) .rank {
    color: silver;
    font-weight: 700;
}

.leaderboard-entry:nth-child(3) .rank {
    color: #cd7f32; /* bronze */
    font-weight: 700;
}

/* Profile page */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

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

#guest-conversion {
    background-color: var(--warning-color);
    color: #333;
    padding: 10px 15px;
    border-radius: 4px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 1rem;
    color: var(--light-text);
    margin-bottom: 10px;
}

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

.profile-history h3 {
    margin-bottom: 20px;
}

.history-table-container {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.history-table th {
    background-color: var(--bg-color);
    font-weight: 600;
}

.history-table tr:hover {
    background-color: var(--bg-color);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal h2 {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.modal-footer {
    margin-top: 20px;
    text-align: center;
}

.modal-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.modal-footer a:hover {
    text-decoration: underline;
}

/* Footer */
.site-footer {
    background-color: #f8f9fa;
    text-align: center;
    padding: 20px 0;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
}

.site-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-footer p {
    margin-bottom: 10px;
    color: var(--text-color);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

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

/* Category Page */
.category-header {
    margin-bottom: 30px;
}

.category-header h2 {
    margin-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    display: inline-block;
}

.category-description {
    color: var(--light-text);
    max-width: 800px;
}

/* Trivia Card Styles */
.trivia-card {
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.trivia-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.trivia-image {
    height: 150px;
    background-size: cover;
    background-position: center;
}

.trivia-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.trivia-content h3 {
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.trivia-category {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.trivia-content p {
    color: var(--light-text);
    margin-bottom: 15px;
    flex-grow: 1;
    font-size: 0.9rem;
}

.trivia-actions {
    margin-top: auto;
}

.empty-message {
    grid-column: 1 / -1;
    padding: 20px;
    text-align: center;
    color: var(--light-text);
    background-color: var(--card-bg);
    border-radius: 8px;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 5px;
}

.page-link {
    padding: 8px 12px;
    border-radius: 4px;
    background-color: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.3s;
}

.page-link:hover, .page-link.active {
    background-color: var(--primary-color);
    color: white;
}

/* CSS fix for linting error */

/* Selected Trivia Info */
.selected-trivia-info {
    margin-bottom: 20px;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

/* Loading Indicator */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

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

/* Active Games Notification */
.active-games-container {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-color);
}

.active-games-container h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.active-games-container ul {
    list-style-type: none;
    padding: 0;
    margin: 15px 0;
}

.active-games-container li {
    margin-bottom: 10px;
}

.active-game-link {
    display: block;
    padding: 10px;
    background-color: rgba(67, 97, 238, 0.1);
    border-radius: 5px;
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s;
}

.active-game-link:hover {
    background-color: rgba(67, 97, 238, 0.2);
    transform: translateY(-2px);
}

/* Share Results */
.share-results {
    margin: 20px 0;
    padding: 15px;
    background-color: rgba(67, 97, 238, 0.1);
    border-radius: 8px;
}

.share-results h3 {
    margin-top: 0;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.share-url-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--card-bg);
    padding: 8px 12px;
    border-radius: 5px;
    margin-top: 10px;
}

.share-url-container a {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--primary-color);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

/* Utilities */
/* Commented out to rely solely on .page and .page.active 
.hidden {
    display: none;
}
*/

.force-hidden {
    display: none;
    visibility: hidden;
    opacity: 0;
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}

/* Add trivia title styles */
.trivia-title {
    font-size: 2rem;
    font-weight: bold;
    color: #4361ee;
    margin-bottom: 20px;
    text-align: center;
    padding: 10px 0;
    border-bottom: 2px solid #e0e0e0;
}

/* Timer animation */
@keyframes timer-countdown {
    from { width: 100%; }
    to { width: 0%; }
}

.timer-bar {
    width: 100%;
    height: 8px;
    background-color: #4361ee;
    border-radius: 4px;
    transition: width 30s linear;
    box-shadow: 0 0 5px rgba(67, 97, 238, 0.5);
}

/* Style for the new game trivia title */
.game-trivia-title {
    text-align: center;
    color: var(--primary-dark);
    font-weight: 700;
    margin-top: 70px;
    margin-bottom: 15px;
    font-size: 1.6rem;
}

/* Flash effect when streak increments */
.streak-fire.flash {
    animation: streak-flash 0.5s ease-out;
}

@keyframes streak-flash {
    0% { transform: scale(1.5); filter: brightness(1.8); text-shadow: 0 0 20px #ffffff, 0 0 40px #ffc300, 0 0 60px #ff6b00; }
    100% { transform: scale(1); filter: brightness(1); }
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
    }
    100% {
        transform: translateY(calc(100vh - 100px)) rotate(720deg);
    }
}

/* Make sure hidden class works properly */
.hidden {
    display: none !important;
}

/* Responsive Navigation */
.hamburger {
    display: none; /* Hidden by default */
    background: #f0f0f0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    color: #333; /* Dark color for visibility on white background */
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.6rem 0.8rem;
    margin-right: 15px;
    transition: all 0.2s ease;
    z-index: 10000; /* Higher than menu z-index */
    position: relative;
}

.hamburger:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(1.05);
}

.hamburger:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }
    
    .nav .menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: #333;
        flex-direction: column;
        width: 100%;
        padding: 1rem 0;
        z-index: 9999;
        display: none;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .nav .menu.active {
        display: flex;
    }

    .nav .menu li {
        width: 100%;
        text-align: left;
        margin: 0;
        padding: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        box-sizing: border-box;
    }

    .nav .menu li a {
        display: block;
        padding: 1.2rem 1.5rem;
        width: 100%;
        color: white; /* Set link color to white for contrast */
        font-size: 1.1rem;
        transition: all 0.3s ease;
        position: relative;
        box-sizing: border-box;
        word-wrap: break-word;
    }
    
    .nav .menu li a:hover, .nav .menu li a.active {
        background-color: rgba(102, 126, 234, 0.2); /* Primary color with transparency */
        color: #fff; /* Keep white for better contrast */
        transform: translateX(10px);
        padding-left: 2rem;
    }
    
    .nav .menu li a:hover::before {
        content: '▸';
        position: absolute;
        left: 1rem;
        color: #667eea;
    }

    .nav .menu li:last-child a {
        border-bottom: none;
    }

    /* Mobile dropdown styles */
    .nav .menu .nav-dropdown {
        width: 100%;
    }
    
    .nav .menu .nav-dropdown.active > .dropdown-menu {
        display: block !important;
    }
    
    .nav .menu .nav-dropdown ul {
        display: none; /* Hide by default */
        position: static !important; /* This is the key - no absolute positioning */
        width: 100% !important;
        background: rgba(0, 0, 0, 0.2);
        margin: 0;
        padding: 0;
        box-shadow: none;
        background-color: #444;
    }

    .nav .menu .nav-dropdown.open ul {
        display: block; /* Show when parent has .open */
    }

    .nav .menu .nav-dropdown-toggle i {
        transition: transform 0.3s ease; /* Smooth arrow rotation */
    }
    
    .nav .menu .nav-dropdown.open .nav-dropdown-toggle i {
        transform: rotate(180deg); /* Point arrow down when open */
    }

    .nav .menu .nav-dropdown ul li.dropdown-item {
        padding: 0; /* Remove padding from li, add to a */
        color: #eee; /* Lighter color for sub-items */
        background-color: transparent; /* Transparent background */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Subtle separator */
        text-align: left; /* Align text left for dropdown items */
        cursor: pointer; /* Add pointer cursor */
        display: block; /* Ensure it takes full width */
        width: 100%;
    }
    
    .nav .menu .nav-dropdown ul li.dropdown-item a {
        display: block;
        padding: 1rem 2rem;
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.95rem;
        transition: all 0.3s ease;
    }

    .nav .menu .nav-dropdown ul li.dropdown-item:last-child {
         border-bottom: none; /* Remove border on last sub-item */
    }

    .nav .menu .nav-dropdown ul li.dropdown-item a:hover {
        background-color: rgba(102, 126, 234, 0.2);
        color: white;
        padding-left: 2.5rem;
    }
    
    /* Dropdown toggle arrow animation */
    .nav .menu .nav-dropdown-toggle i.fa-chevron-down {
        transition: transform 0.3s ease;
        margin-left: 5px;
        font-size: 0.8em;
    }
    
    .nav .menu .nav-dropdown.active .nav-dropdown-toggle i.fa-chevron-down {
        transform: rotate(180deg);
    }

    .hamburger {
        display: block !important; /* Show hamburger on mobile */
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10001; /* Make sure it's above menu */
    }
    
    /* Mobile Create button special styling */
    .nav .menu .create-nav-link {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white !important;
        margin: 0.5rem 1rem !important;
        border-radius: 25px;
        text-align: center;
        font-weight: 600;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        width: auto !important;
        display: inline-block !important;
    }
    
    .nav .menu .create-nav-link:hover {
        transform: translateX(0) scale(1.05);
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
        padding-left: 1.5rem !important;
    }
    
    /* Mobile auth links (Login/Join) */
    .nav .menu .auth-link a {
        width: auto !important;
        display: inline-block !important;
        margin: 0 1rem !important;
    }
    
    .nav .menu .signup-link .nav-link {
        background-color: #1a73e8;
        color: white !important;
        padding: 0.8rem 1.5rem !important;
        border-radius: 20px;
        margin: 0.5rem 1rem !important;
        width: auto !important;
        display: inline-block !important;
    }
    
    /* Ensure nav has proper height on mobile */
    nav.nav {
        min-height: 60px;
        padding: 10px 15px;
    }
    
    /* Adjust brand logo on mobile */
    .brand {
        margin-left: 0;
    }
    
    #brand-logo {
        height: 40px; /* Smaller on mobile */
    }
}


/* Logo Styling */
.brand-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.brand-accent {
    color: var(--secondary-color, #ff6b35);
}

#brand-logo {
    height: 50px;
    width: auto;
    vertical-align: middle;
}

/* Hint Feature Styles */
.hint-button-container {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.hint-button {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    border: none;
    padding: 0.6rem 1.3rem;
    border-radius: 25px;
    cursor: pointer;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.hint-button i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.hint-button .hint-text {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.hint-button .hint-label {
    font-size: 0.95rem;
    font-weight: 600;
}

.hint-button .hint-disclosure {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.75;
}

.hint-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
}

.hint-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.hint-button i {
    font-size: 1rem;
}

.hint-container {
    background: linear-gradient(135deg, #fff9e6 0%, #fffaf0 100%);
    border: 2px solid #ffd700;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    animation: slideDown 0.5s ease;
}

.hint-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #333;
}

.hint-icon {
    color: #ffd700;
    font-size: 1.5rem;
    flex-shrink: 0;
}

#hint-text {
    font-size: 1rem;
    line-height: 1.5;
}

.hint-reveal {
    animation: pulseGlow 0.6s ease;
}

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

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(255, 215, 0, 0.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* Mobile responsiveness for hint feature */
@media (max-width: 768px) {
    .hint-button-container {
        margin-top: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .hint-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .hint-button i {
        font-size: 0.95rem;
    }
    
    .hint-button .hint-label {
        font-size: 0.9rem;
    }
    
    .hint-button .hint-disclosure {
        font-size: 0.8rem;
    }
    
    .hint-container {
        padding: 0.75rem 1rem;
        margin: 0.75rem 0.5rem;
    }
    
    .hint-content {
        flex-direction: row;
        text-align: left;
    }
    
    .hint-icon {
        font-size: 1.25rem;
    }
}

/* Lifeline Button Styles */
.lifeline-button {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: linear-gradient(135deg, #FF6B35, #F72E2E);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(247, 46, 46, 0.3);
    transition: all 0.3s ease;
    z-index: 10;
}

.lifeline-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(247, 46, 46, 0.4);
}

.lifeline-button i {
    font-size: 18px;
}

/* Lifeline Modal Styles */
.lifeline-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
}

.lifeline-modal-content {
    background: #2d2e2d;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.lifeline-modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lifeline-modal-header h2 {
    margin: 0;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
}

.lifeline-modal-close {
    background: none;
    border: none;
    color: #999;
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s;
}

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

.lifeline-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lifeline-option {
    background: linear-gradient(135deg, #1e1f1e, #2d2e2d);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 18px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.lifeline-option:hover {
    background: linear-gradient(135deg, #2d2e2d, #3d3e3d);
    border-color: rgba(255, 107, 53, 0.5);
    transform: translateX(5px);
}

.lifeline-option i {
    font-size: 24px;
    color: #FF6B35;
}

/* Poll Results Styles */
.poll-result {
    margin: 20px 10px 15px 10px !important;
    height: 35px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    overflow: hidden;
    display: block !important;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    width: calc(100% - 20px) !important;
}

.poll-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #66BB6A);
    border-radius: 18px;
    transition: width 0.8s ease;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

.poll-percent {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Ensure poll results don't affect option layout */
.answer-option {
    position: relative;
    padding-bottom: 5px;
    display: flex !important;
    min-height: auto;
}

.answer-option.disabled .poll-result {
    opacity: 1 !important;
}

/* Make option and answer-option containers accommodate poll results */
.option.answer-option.has-poll-result,
.option.has-poll-result {
    flex-direction: column;
    align-items: stretch;
}

/* Keep normal horizontal layout for options without poll results */
.option.answer-option:not(.has-poll-result),
.option:not(.has-poll-result) {
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

/* Ensure the poll result is full width within the option */
.option .poll-result,
.answer-option .poll-result {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

/* 50/50 Removed Option Style */
.fifty-fifty-removed {
    position: relative;
}

.fifty-fifty-removed::after {
    content: '✖';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: #ff4444;
    opacity: 0.7;
}

/* Mobile Responsive Styles for Lifeline */
@media (max-width: 768px) {
    .lifeline-button {
        bottom: 10px;
        right: 10px;
        padding: 8px 16px;
        font-size: 13px;
    }

    .lifeline-button i {
        font-size: 16px;
    }

    .lifeline-modal-content {
        max-width: 350px;
    }

    .lifeline-modal-header h2 {
        font-size: 20px;
    }

    .lifeline-option {
        padding: 15px;
        font-size: 15px;
    }

    .lifeline-option i {
        font-size: 20px;
    }
}

/* Trivia scroll arrow styling */
.trivia-scroll-arrow-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    animation: fadeIn 0.5s ease-out;
    position: relative;
    z-index: 1;
}

.trivia-scroll-arrow {
    font-size: 2.5rem;
    color: #3498db;
    animation: bounceArrow 2s infinite;
    cursor: pointer;
    transition: all 0.3s ease;
}

.trivia-scroll-arrow:hover {
    color: #2980b9;
    transform: translateY(5px);
}

@keyframes bounceArrow {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(10px);
    }
    60% {
        transform: translateY(5px);
    }
}

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

