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

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    background: #000;
    color: #fff;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* Animated Stars Background with MORE stars and movement */
.stars-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #0a0a1e 0%, #000000 100%);
    overflow: hidden;
}

/* Multiple layers of stars with different sizes and animations */
.stars-background::before,
.stars-background::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* Layer 1: MANY bright stars with SLOW movement */
.stars-background::before {
    background-image: 
        radial-gradient(circle, #ffffff 1px, transparent 1px),
        radial-gradient(circle, #ffffff 1.5px, transparent 1.5px),
        radial-gradient(circle, #aaaaff 1px, transparent 1px),
        radial-gradient(circle, #ffaaff 1px, transparent 1px),
        radial-gradient(circle, #ffffff 2px, transparent 2px),
        radial-gradient(circle, #ffffff 0.8px, transparent 0.8px),
        radial-gradient(circle, #aaffff 1.2px, transparent 1.2px),
        radial-gradient(circle, #ffffff 1px, transparent 1px),
        radial-gradient(circle, #ffaaaa 0.9px, transparent 0.9px),
        radial-gradient(circle, #ffffff 1.3px, transparent 1.3px);
    background-size: 
        250px 250px,
        200px 200px,
        180px 180px,
        300px 300px,
        350px 350px,
        220px 220px,
        280px 280px,
        150px 150px,
        320px 320px,
        400px 400px;
    background-position: 
        0 0,
        40px 60px,
        130px 270px,
        70px 100px,
        250px 400px,
        180px 30px,
        90px 200px,
        300px 150px,
        50px 350px,
        200px 250px;
    animation: stars-drift-1 180s ease-in-out infinite, stars-twinkle-1 6s ease-in-out infinite;
}

/* Layer 2: MANY small stars with SLOW movement */
.stars-background::after {
    background-image: 
        radial-gradient(circle, #ffffff 0.5px, transparent 0.5px),
        radial-gradient(circle, #aaaaff 0.8px, transparent 0.8px),
        radial-gradient(circle, #ffffff 1px, transparent 1px),
        radial-gradient(circle, #ffaaaa 0.7px, transparent 0.7px),
        radial-gradient(circle, #ffffff 0.6px, transparent 0.6px),
        radial-gradient(circle, #aaffff 0.9px, transparent 0.9px),
        radial-gradient(circle, #ffffff 0.7px, transparent 0.7px),
        radial-gradient(circle, #ffaaff 0.8px, transparent 0.8px);
    background-size: 
        150px 150px,
        200px 200px,
        250px 250px,
        300px 300px,
        180px 180px,
        220px 220px,
        170px 170px,
        280px 280px;
    background-position: 
        50px 50px,
        180px 60px,
        300px 200px,
        100px 300px,
        250px 100px,
        30px 250px,
        350px 80px,
        150px 350px;
    animation: stars-drift-2 140s ease-in-out infinite reverse, stars-twinkle-2 8s ease-in-out infinite;
}

/* Smooth drift animation 1 - gentle movement without rotation */
@keyframes stars-drift-1 {
    0% { 
        transform: translate(0, 0); 
    }
    12% { 
        transform: translate(-45px, 25px); 
    }
    23% { 
        transform: translate(30px, -40px); 
    }
    35% { 
        transform: translate(-20px, 60px); 
    }
    48% { 
        transform: translate(55px, -15px); 
    }
    61% { 
        transform: translate(-35px, -50px); 
    }
    74% { 
        transform: translate(40px, 35px); 
    }
    87% { 
        transform: translate(-50px, -25px); 
    }
    100% { 
        transform: translate(0, 0); 
    }
}

/* Smooth drift animation 2 - gentle movement without rotation */
@keyframes stars-drift-2 {
    0% { 
        transform: translate(0, 0) scale(1); 
    }
    15% { 
        transform: translate(50px, -35px) scale(1.05); 
    }
    28% { 
        transform: translate(-30px, 45px) scale(0.95); 
    }
    42% { 
        transform: translate(35px, 50px) scale(1.02); 
    }
    56% { 
        transform: translate(-55px, -20px) scale(0.98); 
    }
    68% { 
        transform: translate(25px, -55px) scale(1.03); 
    }
    82% { 
        transform: translate(-40px, 30px) scale(0.97); 
    }
    95% { 
        transform: translate(20px, -10px) scale(1.01); 
    }
    100% { 
        transform: translate(0, 0) scale(1); 
    }
}

/* Smooth twinkling animation 1 - gentle pulsation */
@keyframes stars-twinkle-1 {
    0% { 
        opacity: 0.7; 
    }
    20% { 
        opacity: 0.85; 
    }
    40% { 
        opacity: 0.75; 
    }
    60% { 
        opacity: 0.95; 
    }
    80% { 
        opacity: 0.8; 
    }
    100% { 
        opacity: 0.7; 
    }
}

/* Smooth twinkling animation 2 - gentle pulsation */
@keyframes stars-twinkle-2 {
    0% { 
        opacity: 0.8; 
    }
    25% { 
        opacity: 0.9; 
    }
    50% { 
        opacity: 0.7; 
    }
    75% { 
        opacity: 1; 
    }
    100% { 
        opacity: 0.8; 
    }
}

/* Neon Text Styles */
.neon-text {
    color: #fff;
    text-shadow: 
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px #fff,
        0 0 40px #0ff,
        0 0 80px #0ff,
        0 0 90px #0ff,
        0 0 100px #0ff,
        0 0 150px #0ff;
    animation: neon-flicker 2s infinite alternate;
}

/* Neon Text for ХОККЕЙ - Bright hot pink neon */
.neon-text-red {
    color: #ff0066;
    font-weight: 900;
    text-shadow: 
        0 0 5px #ff0066,
        0 0 10px #ff0066,
        0 0 20px #ff0066,
        0 0 40px #ff0066,
        0 0 60px #ff0066,
        0 0 80px #ff0066,
        0 0 100px #ff0066;
    animation: neon-glow-pulse 3s ease-in-out infinite;
}

/* Cyan Neon Text for PVP */
.neon-text-cyan {
    color: #00ffff;
    font-weight: 700;
    text-shadow: 
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 40px #00ffff,
        0 0 60px #00ffff,
        0 0 80px #00ffff;
    animation: neon-pulse-cyan 2s ease-in-out infinite;
}

/* Smooth neon glow pulse for ХОККЕЙ - hot pink */
@keyframes neon-glow-pulse {
    0%, 100% {
        text-shadow: 
            0 0 5px #ff0066,
            0 0 10px #ff0066,
            0 0 20px #ff0066,
            0 0 40px #ff0066,
            0 0 60px #ff0066,
            0 0 80px #ff0066,
            0 0 100px #ff0066;
    }
    50% {
        text-shadow: 
            0 0 8px #ff0066,
            0 0 15px #ff0066,
            0 0 30px #ff0066,
            0 0 50px #ff0066,
            0 0 80px #ff0066,
            0 0 120px #ff0066,
            0 0 150px #ff0066;
    }
}

@keyframes neon-pulse-cyan {
    0%, 100% {
        text-shadow: 
            0 0 10px #00ffff,
            0 0 20px #00ffff,
            0 0 40px #00ffff,
            0 0 60px #00ffff,
            0 0 80px #00ffff;
    }
    50% {
        text-shadow: 
            0 0 15px #00ffff,
            0 0 30px #00ffff,
            0 0 50px #00ffff,
            0 0 70px #00ffff,
            0 0 100px #00ffff;
    }
}

.neon-text-small {
    color: #fff;
    text-shadow: 
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px #0ff,
        0 0 40px #0ff;
}

.green-text {
    color: #00ff00;
    font-weight: 600;
    text-shadow: 0 0 5px #00ff00, 0 0 10px #00ff00, 0 0 20px #00ff00;
}

.red-text {
    color: #ff0066;
    font-weight: 600;
    text-shadow: 0 0 5px #ff0066, 0 0 10px #ff0066, 0 0 20px #ff0066;
}

@keyframes neon-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 
            0 0 5px #fff,
            0 0 10px #fff,
            0 0 20px #fff,
            0 0 40px #0ff,
            0 0 80px #0ff,
            0 0 90px #0ff,
            0 0 100px #0ff,
            0 0 150px #0ff;
    }
    20%, 24%, 55% {        
        text-shadow: 
            0 0 5px #fff,
            0 0 10px #fff,
            0 0 20px #fff,
            0 0 40px #0ff;
    }
}

/* Menu Screen */
.menu-content,
.howto-content,
.gameover-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 20px;
    max-width: 500px;
}

.logo {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    margin-bottom: 15px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-align: center;
}

.subtitle {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 50px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-weight: 700;
    text-align: center;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.neon-button {
    background: transparent;
    border: 2px solid;
    border-image: linear-gradient(135deg, #ff0066, #0066ff, #00ffff) 1;
    color: #ffffff;
    padding: 14px 40px;
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 
        0 0 5px rgba(255, 255, 255, 0.5),
        0 0 10px rgba(0, 255, 255, 0.5);
    box-shadow: 
        0 0 10px rgba(0, 255, 255, 0.3),
        0 0 20px rgba(255, 0, 102, 0.2),
        inset 0 0 10px rgba(0, 255, 255, 0.1);
    min-width: 260px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.neon-button::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;
}

.neon-button:hover::before {
    left: 100%;
}

.neon-button:hover {
    background: rgba(0, 255, 255, 0.05);
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.6),
        0 0 40px rgba(255, 0, 102, 0.4),
        0 0 60px rgba(0, 102, 255, 0.3),
        inset 0 0 20px rgba(0, 255, 255, 0.2);
    transform: scale(1.05);
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(0, 255, 255, 0.8);
}

.neon-button:active {
    transform: scale(0.98);
}

/* How To Play Screen */
.howto-content h2 {
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 30px;
    letter-spacing: 0.15em;
}

.rules {
    text-align: left;
    background: rgba(10, 10, 30, 0.6);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid transparent;
    border-image: linear-gradient(135deg, #ff0066, #0066ff, #00ffff) 1;
    margin-bottom: 30px;
    line-height: 1.8;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    box-shadow: 
        0 0 10px rgba(255, 0, 102, 0.3),
        0 0 20px rgba(0, 102, 255, 0.2),
        0 0 30px rgba(0, 255, 255, 0.1);
}

.rules p {
    margin-bottom: 15px;
}

.rules ul {
    list-style: none;
    padding-left: 20px;
}

.rules li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 15px;
}

.rules li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #ff0066;
    text-shadow: 0 0 5px #ff0066;
}

/* Game Canvas - FULLSCREEN with transparent background */
#game-canvas {
    display: block;
    background: transparent;
    touch-action: none;
    width: 100vw !important;
    height: 100vh !important;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
}

/* Hide cursor only when game screen is active */
#game-screen.active #game-canvas {
    cursor: none;
}

#game-screen {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Pause Button */
.pause-button {
    display: none; /* Hide pause button */
}

/* Countdown - HIDDEN */
.countdown {
    display: none !important; /* Completely hide countdown */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(4rem, 15vw, 8rem);
    font-weight: bold;
    pointer-events: none;
    opacity: 0;
    z-index: 100;
}

.countdown.show {
    opacity: 1;
    animation: countdown-pulse 1s ease-out;
}

@keyframes countdown-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Goal Message - White with Neon Glow */
.goal-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(2.5rem, 10vw, 5rem); /* Smaller size */
    font-weight: bold;
    pointer-events: none;
    opacity: 0;
    z-index: 99;
    color: #ffffff; /* Pure white */
    text-shadow: 
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px #fff,
        0 0 30px #0ff,
        0 0 50px #0ff,
        0 0 70px #0ff,
        0 0 100px #0ff; /* Cyan neon glow */
}

.goal-message.show {
    opacity: 1;
    animation: goal-appear 1s ease-out;
}

@keyframes goal-appear {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.5); 
    }
    50% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1.1); 
    }
    100% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
    }
}

/* Game Over Screen */
.gameover-content h2 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    margin-bottom: 30px;
    letter-spacing: 0.2em;
    font-weight: 900;
    text-transform: uppercase;
}

#final-score {
    font-size: clamp(1.3rem, 3.5vw, 1.8rem);
    margin-bottom: 50px;
    color: #00ffff;
    font-weight: 600;
    text-shadow: 
        0 0 5px #00ffff,
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 40px #00ffff,
        0 0 60px rgba(0, 255, 255, 0.5);
    letter-spacing: 0.1em;
}

/* Matchmaking Screen */
.matchmaking-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 20px;
    max-width: 500px;
}

.matchmaking-content h2 {
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 50px;
    letter-spacing: 0.2em;
}

.searching-animation {
    margin: 60px 0;
}

.spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    border: 4px solid rgba(0, 255, 255, 0.1);
    border-top: 4px solid #00ffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.5),
        inset 0 0 20px rgba(0, 255, 255, 0.3);
}

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

#search-status {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: #00ffff;
    text-shadow: 
        0 0 5px #00ffff,
        0 0 10px #00ffff,
        0 0 20px #00ffff;
    animation: pulse 2s ease-in-out infinite;
}

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

#cancel-search-button {
    margin-top: 40px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .logo {
        margin-bottom: 5px;
    }
    
    .subtitle {
        margin-bottom: 30px;
    }
    
    .rules {
        padding: 20px;
        font-size: 0.9rem;
    }
    
    .neon-button {
        padding: 12px 30px;
        min-width: 200px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .logo {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .menu-buttons {
        gap: 10px;
    }
    
    .neon-button {
        padding: 10px 30px;
        font-size: 1rem;
    }
}

