:root {
    --neon-green: #ccff00;
    --hot-pink: #ff00ff;
    --cyan: #00ffff;
    --black: #0a0a0a;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    cursor: crosshair;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: var(--black);
    font-family: 'Space Mono', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--white);
}

#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48ZmlsdGVyIGlkPSJnoiPjxmZVR1cmJ1bGVuY2UgdHlwZT0iZnJhY3RhbE5vaXNlIiBiYXNlRnJlcXVlbmN5PSIwLjY1IiBudW1PY3RhdmVzPSIzIiBzdGl0Y2hUaWxlcz0ic3RpdGNoIi8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsdGVyPSJ1cmwoI2cpIiBvcGFjaXR5PSIwLjA1Ii8+PC9zdmc+');
    pointer-events: none;
    z-index: 999;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 600px;
    max-height: 900px;
    background: #1a1a1a;
    border: 4px solid var(--white);
    box-shadow: 10px 10px 0px var(--hot-pink);
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(2px);
    pointer-events: auto;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.1) rotate(5deg);
}

.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) rotate(0deg);
}

h1 {
    font-family: 'Rubik Glitch', cursive;
    font-size: 4rem;
    color: var(--neon-green);
    text-shadow: 4px 4px 0px var(--hot-pink);
    margin-bottom: 0.5rem;
    text-align: center;
    line-height: 1;
    transform: rotate(-2deg);
}

.subtitle {
    font-size: 1.5rem;
    background: var(--white);
    color: var(--black);
    padding: 0.2rem 1rem;
    margin-bottom: 3rem;
    font-weight: bold;
    transform: rotate(1deg);
}

.brutal-btn {
    padding: 20px 40px;
    font-size: 2rem;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    color: var(--black);
    background-color: var(--cyan);
    border: 4px solid var(--black);
    box-shadow: 8px 8px 0px var(--black);
    cursor: pointer;
    transition: all 0.1s;
    text-transform: uppercase;
}

.brutal-btn:hover {
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0px var(--black);
    background-color: var(--white);
}

.brutal-btn:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px var(--black);
}

#score-board {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white);
    background: var(--black);
    padding: 10px;
    border: 2px solid var(--neon-green);
    box-shadow: 4px 4px 0px var(--neon-green);
    z-index: 10;
    pointer-events: none;
}

.marquee-container {
    position: fixed;
    left: 0;
    width: 100%;
    background: var(--neon-green);
    color: var(--black);
    padding: 10px 0;
    font-weight: bold;
    font-size: 1.2rem;
    z-index: 100;
    border-top: 4px solid var(--black);
    border-bottom: 4px solid var(--black);
}

.top {
    top: 0;
    transform: rotate(1deg) translateY(-5px);
}

.bottom {
    bottom: 0;
    transform: rotate(-1deg) translateY(5px);
}

.marquee {
    white-space: nowrap;
    animation: scroll 20s linear infinite;
}

.reverse {
    animation: scroll-reverse 20s linear infinite;
}

@keyframes scroll {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

@keyframes scroll-reverse {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.floating-emoji {
    position: absolute;
    font-size: 4rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

.shake-text {
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

/* Glitch effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(33px, 9999px, 11px, 0);
    }

    20% {
        clip: rect(86px, 9999px, 9px, 0);
    }

    40% {
        clip: rect(22px, 9999px, 68px, 0);
    }

    60% {
        clip: rect(1px, 9999px, 33px, 0);
    }

    80% {
        clip: rect(55px, 9999px, 92px, 0);
    }

    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0px var(--black);
    background-color: var(--white);
}

.brutal-btn:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px var(--black);
}

#score-board {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white);
    background: var(--black);
    padding: 10px;
    border: 2px solid var(--neon-green);
    box-shadow: 4px 4px 0px var(--neon-green);
    z-index: 10;
    pointer-events: none;
}

.marquee-container {
    position: fixed;
    left: 0;
    width: 100%;
    background: var(--neon-green);
    color: var(--black);
    padding: 10px 0;
    font-weight: bold;
    font-size: 1.2rem;
    z-index: 100;
    border-top: 4px solid var(--black);
    border-bottom: 4px solid var(--black);
}

.top {
    top: 0;
    transform: rotate(1deg) translateY(-5px);
}

.bottom {
    bottom: 0;
    transform: rotate(-1deg) translateY(5px);
}

.marquee {
    white-space: nowrap;
    animation: scroll 20s linear infinite;
}

.reverse {
    animation: scroll-reverse 20s linear infinite;
}

@keyframes scroll {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

@keyframes scroll-reverse {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.floating-emoji {
    position: absolute;
    font-size: 4rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

.shake-text {
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

/* Glitch effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(33px, 9999px, 11px, 0);
    }

    20% {
        clip: rect(86px, 9999px, 9px, 0);
    }

    40% {
        clip: rect(22px, 9999px, 68px, 0);
    }

    60% {
        clip: rect(1px, 9999px, 33px, 0);
    }

    80% {
        clip: rect(55px, 9999px, 92px, 0);
    }

    100% {
        clip: rect(12px, 9999px, 4px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(12px, 9999px, 55px, 0);
    }

    20% {
        clip: rect(65px, 9999px, 12px, 0);
    }

    40% {
        clip: rect(3px, 9999px, 33px, 0);
    }

    60% {
        clip: rect(88px, 9999px, 11px, 0);
    }

    80% {
        clip: rect(22px, 9999px, 66px, 0);
    }

    100% {
        clip: rect(44px, 9999px, 22px, 0);
    }
}

#reward-popup {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%) rotate(-5deg);
    background: rgba(255, 0, 255, 0.2);
    /* Transparent Hot Pink */
    backdrop-filter: blur(4px);
    color: var(--white);
    padding: 20px 40px;
    border: 2px solid var(--white);
    box-shadow: 0 0 15px var(--hot-pink);
    text-align: center;
    z-index: 50;
    animation: popup-bounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

#reward-popup h2 {
    font-size: 3rem;
    font-family: 'Rubik Glitch', cursive;
    margin-bottom: 10px;
}

#reward-popup p {
    font-size: 1.5rem;
    font-weight: bold;
}

@keyframes popup-bounce {
    0% {
        transform: translateX(-50%) scale(0) rotate(0deg);
    }

    100% {
        transform: translateX(-50%) scale(1) rotate(-5deg);
    }
}
/* Leaderboard Styles */
#input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

#player-name {
    background: var(--black);
    color: var(--white);
    border: 2px solid var(--neon-green);
    padding: 10px;
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    text-align: center;
    text-transform: uppercase;
    outline: none;
    width: 250px;
}

#player-name:focus {
    box-shadow: 0 0 10px var(--neon-green);
}

.brutal-btn.small {
    padding: 10px 20px;
    font-size: 1.2rem;
}

#leaderboard-section {
    text-align: center;
    width: 80%;
}

#leaderboard-section h2 {
    color: var(--cyan);
    font-family: 'Rubik Glitch', cursive;
    font-size: 2rem;
    margin-bottom: 10px;
}

#leaderboard-list {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
    border: 2px solid var(--white);
    background: rgba(0, 0, 0, 0.8);
}

#leaderboard-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #333;
    font-size: 1.2rem;
}

#leaderboard-list li:last-child {
    border-bottom: none;
}

#leaderboard-list li:nth-child(1) {
    color: var(--neon-green);
    font-weight: bold;
}

#leaderboard-list li:nth-child(2) {
    color: var(--cyan);
}

#leaderboard-list li:nth-child(3) {
    color: var(--hot-pink);
}

/* Мобилна версия – Sky Defender */
@media (max-width: 768px) {
    #game-container {
        max-width: 100%;
        max-height: 85vh;
        border-width: 3px;
    }
    
    .marquee-container {
        font-size: 0.75rem;
    }
    
    #score-board {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
    
    .screen h1.glitch {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .brutal-btn {
        padding: 14px 28px;
        font-size: 1rem;
    }
    
    .brutal-btn.small {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    #player-name {
        font-size: 1rem;
        padding: 10px;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    #game-container {
        max-height: 80vh;
    }
    
    .screen h1.glitch {
        font-size: 1.5rem;
    }
    
    .brutal-btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}

