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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Header Styles */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.game-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.game-header p {
    font-size: 1.3rem;
    opacity: 0.95;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.header-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.decoration-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    border-radius: 2px;
    animation: decorationPulse 2s ease-in-out infinite;
}

.decoration-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: decorationGlow 2s ease-in-out infinite;
}

@keyframes decorationPulse {
    0%, 100% { opacity: 0.6; transform: scaleX(1); }
    50% { opacity: 1; transform: scaleX(1.2); }
}

@keyframes decorationGlow {
    0%, 100% { 
        opacity: 0.8; 
        transform: scale(1);
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.3);
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    }
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.btn-primary {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24, #ff8a80);
    background-size: 200% 200%;
    color: white;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    animation: gradientMove 3s ease infinite;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6);
    background-position: right center;
}

.btn-secondary {
    background: linear-gradient(45deg, #74b9ff, #0984e3, #a29bfe);
    background-size: 200% 200%;
    color: white;
    box-shadow: 0 8px 25px rgba(116, 185, 255, 0.4);
    animation: gradientMove 3s ease infinite reverse;
}

.btn-secondary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(116, 185, 255, 0.6);
    background-position: right center;
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.game-status {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 25px;
    border-radius: 30px;
    color: white;
    font-weight: 600;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.game-status:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Race Track Container */
.race-track-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 25px;
    padding: 35px;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.race-track-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.race-track {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.finish-line {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3.5rem;
    z-index: 10;
    animation: finishLineGlow 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

@keyframes finishLineGlow {
    0%, 100% { 
        transform: translateY(-50%) scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
    }
    50% { 
        transform: translateY(-50%) scale(1.2);
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1));
    }
}

/* Player Sections */
.player-section {
    display: grid;
    grid-template-columns: 200px 1fr 300px;
    gap: 25px;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.player-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 200% 200%;
    animation: gradientMove 3s ease infinite;
}

.player-section:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

.player-info h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #2d3436;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

.player-info h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    border-radius: 2px;
}

.score {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0984e3;
    background: linear-gradient(45deg, #0984e3, #00b894);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

/* Player Track */
.player-track {
    position: relative;
    height: 70px;
    background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 50%, #f8f9fa 100%);
    border-radius: 35px;
    overflow: hidden;
    box-shadow: 
        inset 0 2px 10px rgba(0, 0, 0, 0.1),
        0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.8);
    position: relative;
}

.player-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.track-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #00b894, #00cec9, #00d2a7);
    background-size: 200% 200%;
    border-radius: 35px;
    transition: width 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 0%;
    animation: gradientMove 2s ease infinite;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.avatar {
    position: absolute;
    top: 50%;
    left: 25px;
    transform: translateY(-50%);
    font-size: 2.5rem;
    z-index: 5;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.4));
    animation: avatarFloat 3s ease-in-out infinite;
}

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

.avatar.winner {
    animation: winnerCelebration 1s ease-in-out;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
}

@keyframes winnerCelebration {
    0% { transform: translateY(-50%) scale(1) rotate(0deg); }
    25% { transform: translateY(-50%) scale(1.3) rotate(-10deg); }
    50% { transform: translateY(-50%) scale(1.4) rotate(10deg); }
    75% { transform: translateY(-50%) scale(1.3) rotate(-5deg); }
    100% { transform: translateY(-50%) scale(1.2) rotate(0deg); }
}

/* Question Section */
.question-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.question {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    color: white;
    background: linear-gradient(45deg, #ff7675, #fd79a8, #fdcb6e);
    background-size: 200% 200%;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 
        0 8px 25px rgba(255, 118, 117, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: gradientMove 3s ease infinite;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.question::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: questionShimmer 3s ease-in-out infinite;
}

@keyframes questionShimmer {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

input[type="number"] {
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
}

input[type="number"]:focus {
    outline: none;
    border-color: #0984e3;
    box-shadow: 
        0 0 0 4px rgba(9, 132, 227, 0.15),
        0 8px 25px rgba(9, 132, 227, 0.2);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 1);
}

input[type="number"]:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

input[type="number"]::placeholder {
    color: #adb5bd;
    font-weight: 500;
}

.feedback {
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    min-height: 25px;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feedback.correct {
    color: #00b894;
    background: rgba(0, 184, 148, 0.1);
    border: 1px solid rgba(0, 184, 148, 0.3);
    animation: feedbackSlideIn 0.4s ease;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.2);
}

.feedback.incorrect {
    color: #d63031;
    background: rgba(214, 48, 49, 0.1);
    border: 1px solid rgba(214, 48, 49, 0.3);
    animation: feedbackSlideIn 0.4s ease;
    box-shadow: 0 4px 15px rgba(214, 48, 49, 0.2);
}

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

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

/* Winner Modal */
.winner-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
    padding: 50px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 8px 32px rgba(0, 0, 0, 0.1);
    animation: modalSlideIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    max-width: 500px;
    width: 90%;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 200% 200%;
    animation: gradientMove 3s ease infinite;
}

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

.modal-content h2 {
    font-size: 2.8rem;
    margin-bottom: 25px;
    color: #2d3436;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    font-weight: 800;
}

.modal-content p {
    font-size: 1.3rem;
    margin-bottom: 35px;
    color: #636e72;
    font-weight: 500;
    line-height: 1.6;
}

/* Confetti Animation */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ff6b6b;
    animation: confettiFall 4s linear forwards;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.confetti:nth-child(odd) {
    border-radius: 50%;
}

.confetti:nth-child(3n) {
    width: 8px;
    height: 8px;
}

.confetti:nth-child(4n) {
    width: 15px;
    height: 15px;
    border-radius: 0;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes sparkle {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .player-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .player-info {
        text-align: center;
    }
    
    .question {
        font-size: 1.5rem;
        padding: 10px;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .race-track-container {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    .question {
        font-size: 1.2rem;
    }
    
    .avatar {
        font-size: 1.5rem;
    }
    
    .modal-content {
        padding: 20px;
        margin: 20px;
    }
    
    .modal-content h2 {
        font-size: 2rem;
    }
}

/* Game States */
.game-active .player-section {
    border: 2px solid transparent;
}

.game-active .player-section.active {
    border-color: #00b894;
    box-shadow: 0 0 20px rgba(0, 184, 148, 0.3);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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