* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a2634, #2c5364);
    font-family: 'Arial', sans-serif;
    overflow: hidden;
}

.modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100;
    backdrop-filter: blur(15px);
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(200, 200, 200, 0.1));
    padding: clamp(20px, 5vw, 40px);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 60px rgba(231, 76, 60, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.2);
    max-width: clamp(300px, 80vw, 450px);
    width: 90%;
    animation: holoFade 1s ease-out;
    border: 2px solid rgba(231, 76, 60, 0.5);
}

@keyframes holoFade {
    0% { transform: scale(0.8); opacity: 0; filter: brightness(0.5); }
    100% { transform: scale(1); opacity: 1; filter: brightness(1); }
}

.modal-content h1, .modal-content h2, .modal-content h3 {
    margin-bottom: clamp(15px, 4vw, 25px);
    color: #ffffff;
    font-size: clamp(24px, 6vw, 36px);
    text-shadow: 0 0 15px rgba(231, 76, 60, 0.7);
    animation: textGlow 2s infinite alternate;
}

.modal-content p {
    color: #ffffff;
    font-size: clamp(16px, 4vw, 20px);
    margin-bottom: clamp(10px, 3vw, 15px);
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.modal-content button {
    padding: clamp(10px, 3vw, 14px) clamp(20px, 5vw, 28px);
    font-size: clamp(16px, 4vw, 20px);
    background: linear-gradient(45deg, #e74c3c, #ff6b6b);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 25px rgba(231, 76, 60, 0.7);
}

.modal-content button:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.9);
}

#gameContainer {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #74b9ff, #dfe6e9);
    border: 5px solid #1a2634;
    overflow: hidden;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.5);
}

#uiContainer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(236, 240, 241, 0.1));
    padding: clamp(8px, 2vw, 12px) clamp(15px, 4vw, 25px);
    border: 4px double #e74c3c;
    border-top: none;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 8px 30px rgba(231, 76, 60, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.3);
    z-index: 10;
    width: fit-content;
    animation: neonFlicker 3s infinite;
}

@keyframes neonFlicker {
    0%, 100% { box-shadow: 0 8px 30px rgba(231, 76, 60, 0.5); }
    50% { box-shadow: 0 8px 40px rgba(231, 76, 60, 0.8); }
}

#score, #time, #highScore {
    font-size: clamp(16px, 2.5vw, 22px);
    margin: clamp(5px, 1vw, 10px) clamp(10px, 2vw, 20px);
    color: #ffffff;
    font-weight: bold;
    text-shadow: 0 0 12px rgba(231, 76, 60, 0.7);
    background: rgba(255, 255, 255, 0.15);
    padding: clamp(5px, 1vw, 8px) clamp(10px, 2vw, 12px);
    border-radius: 8px;
    transition: transform 0.2s;
    animation: textGlow 2s infinite alternate;
}

@keyframes textGlow {
    from { text-shadow: 0 0 12px rgba(231, 76, 60, 0.7); }
    to { text-shadow: 0 0 20px rgba(231, 76, 60, 1); }
}

#score:hover, #time:hover, #highScore:hover {
    transform: scale(1.05);
}

#leaderboard {
    font-size: clamp(14px, 2vw, 18px);
    margin: clamp(10px, 2vw, 20px) 0;
    color: #ffffff;
    text-align: center;
}

#leaderboard h3 {
    font-size: clamp(16px, 2.5vw, 20px);
    margin-bottom: 10px;
    text-shadow: 0 0 12px rgba(231, 76, 60, 0.7);
}

#leaderboardTable {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: clamp(5px, 1vw, 10px);
    box-shadow: 0 3px 15px rgba(231, 76, 60, 0.3);
    margin: 0 auto;
}

#leaderboardTable tr {
    font-size: clamp(12px, 1.8vw, 16px);
    background: linear-gradient(90deg, rgba(231, 76, 60, 0.2), transparent);
    transition: background 0.3s;
}

#leaderboardTable tr:hover {
    background: linear-gradient(90deg, rgba(231, 76, 60, 0.4), transparent);
}

#leaderboardTable td {
    padding: clamp(2px, 0.5vw, 5px) clamp(5px, 1vw, 10px);
    color: #ffffff;
    text-shadow: 0 0 8px rgba(231, 76, 60, 0.5);
}

#dot {
    position: absolute;
    width: clamp(40px, 5vw, 60px);
    height: clamp(40px, 5vw, 60px);
    background: radial-gradient(circle, #e74c3c, #ff6b6b);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 30px rgba(231, 76, 60, 1), inset 0 0 15px rgba(255, 255, 255, 0.6);
    transition: transform 0.3s ease, opacity 0.3s ease;
    animation: bounceIn 0.5s ease-out, colorPulse 4s infinite;
    touch-action: none;
}

#dot:hover {
    transform: scale(1.15);
    box-shadow: 0 0 40px rgba(231, 76, 60, 1.2), inset 0 0 20px rgba(255, 255, 255, 0.8);
}

#dot::after {
    content: '';
    position: absolute;
    width: clamp(8px, 1vw, 12px);
    height: clamp(8px, 1vw, 12px);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9), transparent);
    border-radius: 50%;
    top: -5px;
    right: -5px;
    animation: sparkle 1.8s infinite;
}

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
}

@keyframes colorPulse {
    0% { background: radial-gradient(circle, #e74c3c, #ff6b6b); }
    50% { background: radial-gradient(circle, #ff6b6b, #e74c3c); }
    100% { background: radial-gradient(circle, #e74c3c, #ff6b6b); }
}

.orbiting #dot {
    animation: bounceIn 0.5s ease-out, colorPulse 4s infinite, orbit 3s infinite ease-in-out;
}

@keyframes orbit {
    0% { transform: translate(0, 0); }
    25% { transform: translate(10px, -10px); }
    50% { transform: translate(0, -15px); }
    75% { transform: translate(-10px, -10px); }
    100% { transform: translate(0, 0); }
}

#trailCanvas, #backgroundCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

@media (max-width: 768px) {
    #uiContainer {
        padding: clamp(6px, 1.5vw, 10px) clamp(10px, 3vw, 20px);
    }

    #score, #time, #highScore {
        font-size: clamp(14px, 3vw, 18px);
        margin: clamp(4px, 1vw, 8px) clamp(8px, 2vw, 15px);
    }

    .modal-content {
        padding: clamp(15px, 4vw, 30px);
    }
}

@media (max-width: 480px) {
    #uiContainer {
        flex-wrap: wrap;
    }

    #score, #time, #highScore {
        font-size: clamp(12px, 2.5vw, 16px);
        padding: clamp(4px, 1vw, 6px) clamp(8px, 2vw, 10px);
    }

    #leaderboard h3 {
        font-size: clamp(14px, 2.5vw, 18px);
    }

    #leaderboardTable {
        padding: clamp(4px, 1vw, 8px);
    }

    #dot {
        width: clamp(30px, 6vw, 50px);
        height: clamp(30px, 6vw, 50px);
    }

    .modal-content h1, .modal-content h2 {
        font-size: clamp(20px, 5vw, 28px);
    }

    .modal-content button {
        font-size: clamp(14px, 3.5vw, 18px);
    }
}