/* Font Face Declarations */
@font-face {
    font-family: 'Centra No2';
    src: url('./fonts/CentraNo2-Reg.otf') format('opentype'),
         url('./fonts/CentraNo2-Book.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Centra No2';
    src: url('./fonts/CentraNo2-Medium.otf') format('opentype'),
         url('./fonts/CentraNo2-Medium.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Centra No2';
    src: url('./fonts/CentraNo2-Bold.otf') format('opentype'),
         url('./fonts/CentraNo2-Bold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

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

:root {
    /* Primary Colors */
    --pacific-blue: #4248ED;
    --black: #000000;
    --white: #FFFFFF;
    
    /* Secondary Colors */
    --exuma: #318EEE;
    --emerald-isle: #1ADE98;
    --arctic-fjord: #0E214B;
    
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, var(--pacific-blue) 0%, var(--exuma) 100%);
    --secondary-gradient: linear-gradient(135deg, var(--emerald-isle) 0%, var(--exuma) 100%);
    --dark-gradient: linear-gradient(135deg, var(--arctic-fjord) 0%, var(--black) 100%);
}

body {
    font-family: 'Centra No2', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--white);
    min-height: 100vh;
    color: var(--black);
}

.container {
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Welcome Page */
.welcome-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(66, 72, 237, 0.1);
    border: 3px solid var(--pacific-blue);
}

.welcome-card h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--arctic-fjord);
    margin-bottom: 30px;
    font-weight: 500;
}

.game-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-admin {
    background: var(--primary-gradient);
    color: var(--white);
    border: 2px solid var(--pacific-blue);
}

.btn-player {
    background: var(--secondary-gradient);
    color: var(--white);
    border: 2px solid var(--emerald-isle);
}

.btn-leaderboard {
    background: var(--dark-gradient);
    color: var(--white);
    border: 2px solid var(--arctic-fjord);
}

.btn-single {
    background: linear-gradient(45deg, #9b59b6, #8e44ad);
    color: var(--white);
    border: 2px solid #9b59b6;
}

.single-player-info {
    color: var(--pacific-blue);
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: rgba(66, 72, 237, 0.1);
    border-radius: 8px;
    margin: 10px 0;
}

/* Single-player leaderboard styles */
.single-player-balloon {
    position: relative;
}

.balloon-time {
    position: absolute;
    top: 99px; /* Position below the balloon name */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.balloon-winner {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.single-player-stat .stat-details {
    font-size: 12px;
    color: white;
    margin-top: 2px;
}

.single-player-stat .stat-score {
    font-weight: bold;
    color: white;
}

/* Airplane Banner Animation */
.airplane-banner {
    position: absolute;
    top: 20%;
    right: -300px;
    z-index: 10;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.airplane {
    font-size: 24px;
    animation: airplane-wiggle 2s ease-in-out infinite;
}

.airplane-body {
    width: 400px;
    height: 200px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

.banner-text {
    background: linear-gradient(45deg, var(--pacific-blue), var(--emerald-isle));
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

.banner-text::before,
.banner-text::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    top: 50%;
    transform: translateY(-50%);
}

.banner-text::before {
    left: -8px;
    border-width: 8px 8px 8px 0;
    border-color: transparent var(--pacific-blue) transparent transparent;
}

.banner-text::after {
    right: -8px;
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent var(--emerald-isle);
}

@keyframes airplane-fly {
    0% {
        right: -300px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        right: calc(100% + 300px);
        opacity: 0;
    }
}

@keyframes airplane-wiggle {
    0%, 100% {
        transform: rotate(-2deg);
    }
    50% {
        transform: rotate(2deg);
    }
}

.airplane-banner.flying {
    animation: airplane-fly 8s linear forwards;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
    border: 2px solid var(--pacific-blue);
}

.btn-secondary {
    background: var(--arctic-fjord);
    color: var(--white);
    border: 2px solid var(--arctic-fjord);
}

.btn-success {
    background: var(--secondary-gradient);
    color: var(--white);
    border: 2px solid var(--emerald-isle);
}

.btn-warning {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: var(--white);
    border: 2px solid #f39c12;
}

.btn-danger {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: var(--white);
    border: 2px solid #e74c3c;
}

.instructions {
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.instructions h3 {
    color: var(--arctic-fjord);
    margin-bottom: 15px;
    font-weight: 600;
}

.instructions ol {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 10px;
    color: var(--arctic-fjord);
    font-weight: 400;
}

/* Admin Panel */
.admin-panel {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(66, 72, 237, 0.1);
    border: 3px solid var(--pacific-blue);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--pacific-blue);
}

.admin-header h1 {
    font-size: 2.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.back-btn {
    color: var(--arctic-fjord);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.back-btn:hover {
    color: var(--pacific-blue);
}

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

.control-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid var(--pacific-blue);
}

.control-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-group label {
    font-weight: 600;
    color: #555;
}

.setting-group select {
    padding: 10px;
    border: 2px solid var(--pacific-blue);
    border-radius: 8px;
    font-size: 1rem;
}

.button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.game-status {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 2px solid var(--pacific-blue);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #95a5a6;
    animation: pulse 2s infinite;
}

.status-dot.active {
    background: #2ecc71;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.player-list h4 {
    margin-bottom: 15px;
    color: #333;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.player-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid var(--pacific-blue);
    text-align: center;
}

.player-card.connected {
    border-color: var(--emerald-isle);
    background: #f0fff4;
}

.player-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.player-status {
    font-size: 0.9rem;
    color: #666;
}

.question-management {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid var(--pacific-blue);
}

.question-stats {
    margin-bottom: 15px;
}

/* Welcome Screen */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #ffffff 0%, #4248ED 100%);
    background-image: 
        url("/images/endscreen.png");
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    font-family: 'Centra No2', sans-serif;
}

.welcome-content {
    text-align: center;
    max-width: 800px;
    width: 90%;
    padding: 40px 20px;
}

.welcome-title {
    font-family: 'Centra No2', sans-serif;
    font-weight: 600;
    font-size: 2rem;
    line-height: 1.1;
    color: #000000;
    margin-bottom: 60px;
    text-align: center;

        /* Add opaque background */
        background: rgba(255, 255, 255, 0.85); /* Semi-transparent white */
        padding: 20px 30px; /* Add padding inside */
        border-radius: 20px; /* Rounded corners */
        display: inline-block; /* Make it fit the text width */
}

.welcome-form {
    margin-bottom: 40px;
}

.input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.welcome-input {
    flex: 1;
    max-width: 300px;
    height: 60px;
    padding: 0 25px;
    border: none;
    border-radius: 30px;
    background: #ffffff;
    font-family: 'Centra No2', sans-serif;
    font-size: 1.1rem;
    color: #000000;
    outline: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.welcome-input::placeholder {
    color: #999999;
    font-weight: 400;
}

.welcome-submit {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: #000000;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.welcome-submit:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.welcome-logo {
    display: block;
}

/* Player Screen */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
}

.modal-content input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--pacific-blue);
    border-radius: 10px;
    font-size: 1.1rem;
    margin-bottom: 20px; 
}

.modal-content input:focus {
    outline: none;
    border-color: var(--pacific-blue);
}

.error-message {
    color: #e74c3c;
    font-weight: 600;
    background: #FFFFFF;
    border: 10px solid #e74c3c;
    border-radius: 30px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    padding: 0 20px;
    transition: opacity 0.3s ease, max-height 0.3s ease, margin-top 0.3s ease, padding 0.3s ease;
}

.error-message:not(:empty) {
    opacity: 1;
    max-height: 100px;
    margin-top: 10px;
    padding: 12px 20px;
}

/* Post Answer Modal Styles */
.post-answer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1f3a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    font-family: 'Centra No2', sans-serif;
}

.post-answer-content {
    max-width: 600px;
    width: 90%;
    text-align: center;
    position: relative;
}

.post-answer-title {
    color: #ffffff;
    font-family: 'Centra No2', sans-serif;
    font-weight: 600;
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
}

.post-answer-text {
    background: #ffffff;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 0;
    font-family: 'Centra No2', sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #000000;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.post-answer-text p {
    margin-bottom: 15px;
}

.post-answer-text p:last-child {
    margin-bottom: 0;
}

.post-answer-continue-btn {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: #4248ED;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(66, 72, 237, 0.3);
    z-index: 2;
}

.post-answer-continue-btn:hover {
    background: #3539c7;
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 8px 25px rgba(66, 72, 237, 0.4);
}

.continue-arrow {
    font-family: 'Centra No2', sans-serif;
    font-weight: 600;
}

.waiting-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #ffffff 0%, #4248ED 100%);
    background-image: url("/images/endscreen.png");
    background-size: cover;
    background-position: center;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    font-family: 'Centra No2', sans-serif;
}

.waiting-screen.show {
    display: flex;
}

.waiting-content {
    text-align: center;
    max-width: 500px;
    width: 90%;
    padding: 40px 20px;
}

.waiting-content h2 {
    font-family: 'Centra No2', sans-serif;
    font-weight: 600;
    font-size: 2.5rem;
    color: #000000;
    margin-bottom: 30px;
}

.balloon-animation {
    margin: 40px 0;
}

.balloon {
    font-size: 4rem;
    animation: float 3s ease-in-out infinite;
}

.waiting-content p {
    font-family: 'Centra No2', sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    color: #666666;
    margin-bottom: 30px;
}

.waiting-indicator {
    margin-top: 20px;
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.game-screen {
    background: var(--white);
    background-image: url('/images/question-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    font-family: 'Centra No2', sans-serif;
}

.quiz-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px 20px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.player-avatar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

.avatar-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--pacific-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Centra No2', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--white);
}

.progress-bar {
    width: 200px;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--pacific-blue);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 4%; /* Start with 4% progress */
}

.score-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.score-text, .correct-text {
    font-family: 'Centra No2', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: #666666;
}

.question-section {
    margin-bottom: 40px;
}

.question-tag {
    display: inline-block;
    background: var(--pacific-blue);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Centra No2', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-text {
    font-family: 'Centra No2', sans-serif;
    font-weight: 600;
    font-size: 1.8rem;
    line-height: 1.3;
    color: #000000;
    margin: 0;
}

.options-section {
    margin-top: 30px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.game-header h2 {
    color: #333;
}

.player-info {
    text-align: right;
}

.progress-info {
    display: flex;
    gap: 20px;
    margin-top: 5px;
    font-size: 0.9rem;
    color: #666;
}

.question-container {
    margin-bottom: 30px;
}

.question-card {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    border: 2px solid var(--pacific-blue);
}

.question-card h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.3rem;
    line-height: 1.5;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: none;
    border-radius: 12px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: 'Centra No2', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: #333333;
    position: relative;
}

.option-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.option-btn.selected {
    background: var(--pacific-blue);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(66, 72, 237, 0.3);
}

.option-btn.correct {
    background: var(--emerald-isle);
    color: var(--white);
}

.option-btn.incorrect {
    background: #e74c3c;
    color: var(--white);
}

.option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Centra No2', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
    border: 2px solid #dee2e6;
    background: var(--white);
    color: #6c757d;
}

.option-btn.selected .option-letter {
    background: var(--white);
    color: var(--pacific-blue);
    border-color: var(--white);
}

.option-btn.correct .option-letter,
.option-btn.incorrect .option-letter {
    background: var(--white);
    border-color: var(--white);
}

.option-btn.correct .option-letter {
    color: var(--emerald-isle);
}

.option-btn.incorrect .option-letter {
    color: #e74c3c;
}

.option-text {
    flex: 1;
    font-family: 'Centra No2', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.4;
}

.game-footer {
    text-align: center;
    margin-top: 30px;
}

.game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/images/endscreen.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1002;
    text-align: center;
    padding: 40px;
    font-family: 'Centra No2', sans-serif;
    overflow: hidden;
}

/* Game over screen background styling similar to race track 
.game-over-screen::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: #4248ED;
    z-index: 1;
}

.game-over-screen::before {
    content: '';
    position: absolute;
    bottom: 40px;
    right: 20%;
    width: 150px;
    height: 40px;
    background: #E3E5FB;
    border-radius: 80%;
    z-index: 1;
}
*/
.game-over-clouds {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.game-over-content {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.game-over-content h2 {
    margin-bottom: 20px;
    color: #333;
}

.final-stats {
    margin: 20px 0;
    font-size: 1.1rem;
}

.final-stats p {
    margin-bottom: 10px;
    color: #666;
}

/* Leaderboard */
.leaderboard-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--white);
    padding: 20px;
    overflow: hidden;
}

.leaderboard-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
    flex-shrink: 0;
}

.leaderboard-header h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

.race-track {
    position: relative;
    flex: 1;
    min-height: 0;
    /*background: linear-gradient(180deg, #87CEEB 0%, #B0E0E6 100%);*/
    background-color: #ECEDFD;
    border-radius: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.race-track::before {
    content: '';
    position: absolute;
    bottom: -55px;
    right: -5%;
    width: 119%;
    height: 160px;
    background: transparent;
    border-radius: 80%;
    border-style: solid;
    border-color: #4248ED;
    z-index: 4;
}

.race-track::after {
    content: '';
    position: absolute;
    bottom: -60px;
    right: -10%;
    width: 120%;
    height: 160px;
    background: #4248ED;
    opacity: 0.2;
    border-radius: 80%;
    z-index: 2;
}

/* Landmarks */
.landmarks {
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 100%;
    height: 150px;
    z-index: 5;
    overflow: visible;
}

.landmark {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    bottom: 0;
    animation: scroll-landmark 50s linear infinite;
}

.landmark-icon {
    width: 140px;
    height: 202px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    margin-bottom: -3px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.landmark-label {
    background: #4248ED;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 12px;
    font-family: 'Centra No2', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(66, 72, 237, 0.3);
}

@keyframes scroll-landmark {
    0% { 
        left: 100%;
    }
    100% { 
        left: -200px;
    }
}

.hills::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 15%;
    width: 180px;
    height: 50px;
    background: linear-gradient(to top, #228B22 0%, #32CD32 50%, #90EE90 100%);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}


.track-background {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.clouds {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 20px;
}

.cloud {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.8;
}

/* Alternating speeds for infinite scrolling with randomized cloud images */
.cloud-1 { 
    animation: float-cloud-slow 25s linear infinite;
    animation-delay: 0s; 
}
.cloud-2 { 
    animation: float-cloud-fast 18s linear infinite;
    animation-delay: 2s; 
}
.cloud-3 { 
    animation: float-cloud-slow 25s linear infinite;
    animation-delay: 4s; 
}
.cloud-4 { 
    animation: float-cloud-fast 18s linear infinite;
    animation-delay: 6s; 
}
.cloud-5 { 
    animation: float-cloud-slow 25s linear infinite;
    animation-delay: 8s; 
}
.cloud-6 { 
    animation: float-cloud-fast 18s linear infinite;
    animation-delay: 10s; 
}

/* Slow scrolling animation - starts off-screen left */
@keyframes float-cloud-slow {
    0% { 
        left: -250px; 
        transform: translateX(0);
    }
    100% { 
        left: calc(100% + 50px); 
        transform: translateX(0);
    }
}

/* Fast scrolling animation - starts off-screen left */
@keyframes float-cloud-fast {
    0% { 
        left: -250px; 
        transform: translateX(0);
    }
    100% { 
        left: calc(100% + 50px); 
        transform: translateX(0);
    }
}

.finish-line {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    z-index: 5;
}

.finish-flag {
    font-size: 3rem;
    margin-bottom: 10px;
}

.finish-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
    background: var(--arctic-fjord);
    padding: 8px 15px;
    border-radius: 8px;
    border: 2px solid var(--white);
}

.balloons-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;
}

.balloon {
    position: absolute;
    width: 100px;
    height: 125px;
    transition: left 1s ease-in-out, top 0.5s ease-in-out;
    animation: balloon-float 3s ease-in-out infinite;
    z-index: 10;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

.balloon-body {
    width: 75px;
    height: 100px;
    position: relative;
    margin: 0 auto;
    display: flex;
    padding-top: 20px;
    align-items: flex-start;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 600;
    color: #000099;
    background-image: url('/images/balloon1.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}


.balloon-name {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #4248ED;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 12px;
    font-family: 'Centra No2', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(66, 72, 237, 0.3);
}



.balloon-name {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: #000099;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 0, 153, 0.3);
    z-index: 15;
    transition: all 1s ease-in-out;
}

@keyframes balloon-float {
    0%, 100% { 
        transform: translateY(0px) rotate(1deg) scale(1); 
    }
    25% { 
        transform: translateY(-8px) rotate(-1deg) scale(1.02); 
    }
    50% { 
        transform: translateY(-15px) rotate(1deg) scale(1.05); 
    }
    75% { 
        transform: translateY(-8px) rotate(-1deg) scale(1.02); 
    }
}

@keyframes balloon-shake {
    0%, 100% { 
        transform: translateX(0px) rotate(0deg); 
    }
    25% { 
        transform: translateX(-3px) rotate(-2deg); 
    }
    50% { 
        transform: translateX(3px) rotate(2deg); 
    }
    75% { 
        transform: translateX(-2px) rotate(-1deg); 
    }
}

.player-stats {
    background: transparent;
    padding: 0;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.player-stats h3 {
    display: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap: 15px;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

.stat-card {
    background: #000099;
    padding: 15px 20px;
    border-radius: 50px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(26, 31, 58, 0.3);
}

.stat-card.winner {
    background: #4248ED;
}

.stat-letter {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ffffff;
    color: #1a1f3a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Centra No2', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.stat-name {
    font-family: 'Centra No2', sans-serif;
    font-weight: 600;
    color: #ffffff;
    font-size: 1rem;
    flex: 1;
}

.stat-score {
    font-family: 'Centra No2', sans-serif;
    font-weight: 600;
    color: #ffffff;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.stat-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: white;
}

.game-status-display {
    text-align: center;
    display:none;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid var(--pacific-blue);
    flex-shrink: 0;
}

.status-message {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 20px;
}

.winner-announcement {
    background: var(--primary-gradient);
    color: var(--white);
    padding: 30px;
    border-radius: 15px;
    margin-top: 20px;
    border: 3px solid var(--white);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.winner-announcement h2 {
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .leaderboard-container {
        padding: 15px;
    }
    
    .leaderboard-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .race-track {
        margin-bottom: 15px;
    }
    
    .player-stats {
        margin-bottom: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px 15px;
    }
    
    .landmarks {
        bottom: 10px;
    }
    
    .race-track::after {
        height: 30px;
    }
    
    .landmark-icon {
        width: 66px;
        height: 99px;
    }
    
    .landmark-label {
        font-size: 0.6rem;
        padding: 3px 6px;
    }
    
    .balloon {
        width: 75px;
        height: 95px;
    }
    
    .balloon-body {
        width: 55px;
        height: 75px;
        font-size: 1.4rem;
    }
    
    .balloon-name {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
    
    .game-status-display {
        padding: 10px;
    }
    
    .status-message {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .leaderboard-container {
        padding: 10px;
    }
    
    .leaderboard-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
    
    .race-track {
        margin-bottom: 10px;
    }
    
    .player-stats {
        margin-bottom: 10px;
    }
    
    .landmarks {
        bottom: 8px;
        height: 80px;
    }
    
    .race-track::after {
        height: 25px;
    }
    
    .landmark-icon {
        width: 55px;
        height: 83px;
    }
    
    .landmark-label {
        font-size: 0.5rem;
        padding: 2px 4px;
    }
    
    .balloon {
        width: 65px;
        height: 85px;
    }
    
    .balloon-body {
        width: 50px;
        height: 70px;
        font-size: 1.2rem;
    }
    
    .balloon-name {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}

@media (min-width: 1921px) {
    .leaderboard-container {
        padding: 30px;
    }
    
    .leaderboard-header {
        margin-bottom: 30px;
        padding-bottom: 20px;
    }
    
    .race-track {
        margin-bottom: 30px;
    }
    
    .player-stats {
        margin-bottom: 30px;
    }
    
    .stats-grid {
        max-width: 1900px;
    }
    
    .stat-card {
        padding: 20px 25px;
    }
    
    .landmarks {
        bottom: 20px;
        height: 150px;
    }
    
   /* .race-track::after {
        height: 50px;
    }*/
    
    .landmark-icon {
        width: 110px;
        height: 165px;
    }
    
    .landmark-label {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .balloon {
        width: 120px;
        height: 150px;
    }
    
    .balloon-body {
        width: 95px;
        height: 120px;
        font-size: 2rem;
    }
    
    .balloon-name {
        font-size: 1.1rem;
        padding: 8px 16px;
    }
}

/* Legacy responsive styles for other pages */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .welcome-card {
        padding: 20px;
    }
    
    .welcome-card h1 {
        font-size: 2rem;
    }
    
    .welcome-title {
        font-size: 2.2rem;
        margin-bottom: 40px;
    }
    
    .input-group {
        flex-direction: column;
        gap: 20px;
        max-width: 280px;
    }
    
    .welcome-input {
        max-width: 100%;
        height: 50px;
        font-size: 1rem;
    }
    
    .welcome-submit {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .welcome-logo {
        width: 150px;
        height: 45px;
        margin-top: 60px;
    }
    
    .quiz-container {
        padding: 20px 15px;
    }
    
    .quiz-header {
        margin-bottom: 30px;
    }
    
    .avatar-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .progress-bar {
        width: 150px;
        height: 6px;
    }
    
    .question-text {
        font-size: 1.4rem;
    }
    
    .option-btn {
        padding: 15px;
        gap: 12px;
    }
    
    .option-letter {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .game-links {
        flex-direction: column;
        align-items: center;
    }
    
    .admin-controls {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .leaderboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .race-track {
        height: 300px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
