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

body {
    font-family: 'Space Grotesk', sans-serif;
    overflow: hidden;
    background: #1a0a2e;
    color: #fff;
    user-select: none;
    -webkit-user-select: none;
}

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10;
    background: rgba(13, 2, 33, 0.85);
    backdrop-filter: blur(10px);
}

.screen.active {
    display: flex;
}

.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(3rem, 15vw, 8rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    text-shadow: 
        0 0 20px rgba(52, 152, 219, 0.8),
        0 0 40px rgba(52, 152, 219, 0.4),
        4px 4px 0 rgba(0,0,0,0.3);
    animation: titlePulse 2s ease-in-out infinite;
}

.game-title .accent {
    color: #e74c3c;
    text-shadow: 
        0 0 20px rgba(231, 76, 60, 0.8),
        0 0 40px rgba(231, 76, 60, 0.4),
        4px 4px 0 rgba(0,0,0,0.3);
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.subtitle {
    font-size: clamp(0.8rem, 3vw, 1.2rem);
    color: #88ccff;
    letter-spacing: 0.3em;
    margin-top: 0.5rem;
    text-transform: uppercase;
}

.menu-buttons {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.menu-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    padding: 1rem 2.5rem;
    border: 2px solid #3498db;
    background: rgba(52, 152, 219, 0.1);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}

.menu-btn:hover {
    background: rgba(52, 152, 219, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.4);
}

.menu-btn.primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-color: #5dade2;
}

.menu-btn.primary:hover {
    background: linear-gradient(135deg, #5dade2, #3498db);
}

.footer {
    position: absolute;
    bottom: 1.5rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    text-align: center;
}

.footer a {
    color: #ff6b9d;
    text-decoration: none;
}

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

/* Help Screen */
.help-content, .pause-content, .end-content {
    text-align: center;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
}

.help-content h2, .pause-content h2, .end-content h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 2rem;
    color: #3498db;
}

.controls-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 0.6rem 1.2rem;
    background: rgba(52, 152, 219, 0.1);
    border-left: 3px solid #3498db;
}

.control-item .key {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0,0,0,0.3);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #ccff00;
}

.control-item .desc {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

.rule {
    color: #88ccff;
    font-style: italic;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

/* HUD */
.hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    z-index: 5;
    pointer-events: none;
}

.hud.hidden {
    display: none;
}

.score-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.player-score, .ai-score {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-score .label {
    font-size: 0.75rem;
    color: #3498db;
    letter-spacing: 0.2em;
}

.ai-score .label {
    font-size: 0.75rem;
    color: #e74c3c;
    letter-spacing: 0.2em;
}

.score {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 900;
    transition: transform 0.3s ease;
}

.score.score-pulse {
    transform: scale(1.2);
}

.vs {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: rgba(255,255,255,0.5);
}

.game-info {
    text-align: center;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #88ccff;
}

.serve-indicator {
    text-align: center;
    margin-top: 0.5rem;
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    color: #ccff00;
    animation: blink 1s ease-in-out infinite;
    font-weight: bold;
}

.rally-counter {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    font-family: 'Orbitron', sans-serif;
}

.control-hint {
    position: fixed;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    font-family: 'Orbitron', sans-serif;
    text-align: center;
}

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

.pause-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
    z-index: 6;
}

.pause-btn:hover {
    background: rgba(52, 152, 219, 0.5);
    border-color: #3498db;
}

/* Mini Map */
.mini-map {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 80px;
    height: 140px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.mini-court {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(193, 127, 89, 0.3);
}

.mini-net {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%);
}

.mini-player, .mini-ai, .mini-ball {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.1s, top 0.1s;
}

.mini-player {
    background: #3498db;
    box-shadow: 0 0 6px #3498db;
}

.mini-ai {
    background: #e74c3c;
    box-shadow: 0 0 6px #e74c3c;
}

.mini-ball {
    width: 6px;
    height: 6px;
    background: #ccff00;
    box-shadow: 0 0 6px #ccff00;
}

/* Point Overlay */
.point-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 15;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.point-overlay.hidden {
    display: none;
}

.point-content {
    text-align: center;
    animation: pointPopIn 0.3s ease-out;
}

@keyframes pointPopIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.point-content h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(3rem, 12vw, 6rem);
    font-weight: 900;
    text-shadow: 0 0 30px currentColor;
    animation: pointPulse 0.5s ease-in-out infinite;
}

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

.point-content p {
    font-size: clamp(1rem, 4vw, 1.5rem);
    margin-top: 1rem;
    color: rgba(255,255,255,0.9);
}

.countdown {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 8vw, 4rem);
    margin-top: 2rem;
    color: #ccff00;
    animation: countdownPulse 0.6s ease-in-out infinite;
}

@keyframes countdownPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.9); }
}

/* End Screen */
.final-score {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    margin-bottom: 1rem;
    color: rgba(255,255,255,0.8);
}

.match-stats {
    margin-bottom: 2rem;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

.match-stats p {
    margin: 0.3rem 0;
}

/* Confetti */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 10px;
    animation: confettiFall 3s ease-out forwards;
}

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

/* Mobile adjustments */
@media (max-width: 600px) {
    .menu-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .control-item {
        flex-direction: column;
        gap: 0.3rem;
        text-align: center;
        padding: 0.5rem;
    }
    
    .pause-btn {
        width: 40px;
        height: 40px;
    }
    
    .rally-counter {
        font-size: 0.75rem;
    }
    
    .control-hint {
        font-size: 0.65rem;
        bottom: 2.5rem;
    }
    
    .mini-map {
        width: 60px;
        height: 100px;
    }
    
    .mini-player, .mini-ai {
        width: 6px;
        height: 6px;
    }
    
    .mini-ball {
        width: 4px;
        height: 4px;
    }
}

/* Floating shapes animation */
.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}