@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
    font-family: 'Share Tech Mono', monospace;
    color: #0f0;
    user-select: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    z-index: 0;
}

#vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
    z-index: 1;
}

#game-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 2;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    z-index: 3;
}

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

#stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    font-size: 20px;
    text-shadow: 0 0 10px #0f0;
    flex-wrap: wrap;
    gap: 10px;
}

.stat-box {
    background: rgba(0, 20, 0, 0.7);
    padding: 8px 16px;
    border: 1px solid #0f0;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.2);
    transition: all 0.3s ease;
}

.stat-box:hover {
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.4);
}

#input-display-container {
    position: absolute;
    bottom: 60px;
    width: 100%;
    text-align: center;
}

#current-input {
    display: inline-block;
    min-width: 50px;
    min-height: 40px;
    font-size: 36px;
    color: #fff;
    text-shadow: 0 0 10px #fff, 0 0 20px #0ff;
    border-bottom: 3px solid #0ff;
    padding: 0 15px;
    transition: all 0.2s ease;
}

#current-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

#high-score {
    position: absolute;
    top: 80px;
    right: 30px;
    font-size: 16px;
    color: #888;
    text-shadow: 0 0 5px #888;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 5, 10, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    pointer-events: auto;
}

.hidden {
    display: none !important;
}

.glitch {
    font-size: 72px;
    color: #0ff;
    position: relative;
    text-shadow: 2px 2px #f0f;
    margin: 0 0 20px 0;
    animation: glitch-pulse 2s infinite ease-in-out;
}

@keyframes glitch-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

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

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 #f0f;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 #0ff;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 30px, 0); }
    20% { clip: rect(80px, 9999px, 100px, 0); }
    40% { clip: rect(30px, 9999px, 60px, 0); }
    60% { clip: rect(70px, 9999px, 120px, 0); }
    80% { clip: rect(10px, 9999px, 50px, 0); }
    100% { clip: rect(50px, 9999px, 90px, 0); }
}

button {
    margin: 10px;
    padding: 15px 50px;
    font-size: 24px;
    background: transparent;
    color: #0ff;
    border: 2px solid #0ff;
    font-family: 'Share Tech Mono', monospace;
    cursor: pointer;
    box-shadow: 0 0 10px #0ff;
    transition: all 0.3s ease;
    pointer-events: auto;
}

button:hover {
    background: #0ff;
    color: #000;
    box-shadow: 0 0 30px #0ff, inset 0 0 10px rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

button:active {
    transform: scale(0.98);
}

.subtitle {
    font-size: 24px;
    color: #0f0;
    letter-spacing: 2px;
    margin: 10px 0;
    text-shadow: 0 0 10px #0f0;
}

.instructions {
    color: #aaa;
    margin: 5px 0;
    font-size: 16px;
}

.high-score-display {
    color: #ff0;
    margin: 20px 0;
    font-size: 18px;
    text-shadow: 0 0 10px #ff0;
}

.final-score, .final-level, .final-combo {
    font-size: 20px;
    color: #0f0;
    margin: 10px 0;
    text-shadow: 0 0 10px #0f0;
}

.final-score span, .final-level span, .final-combo span {
    color: #0ff;
    font-weight: bold;
}

#pause-screen {
    z-index: 15;
}

#pause-screen button {
    background: transparent;
    color: #ff0;
    border-color: #ff0;
    box-shadow: 0 0 10px #ff0;
}

#pause-screen button:hover {
    background: #ff0;
    color: #000;
    box-shadow: 0 0 30px #ff0;
}

@media (max-width: 768px) {
    .glitch {
        font-size: 48px;
    }
    
    #stats-bar {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    .stat-box {
        padding: 5px 10px;
    }
    
    #current-input {
        font-size: 24px;
    }
    
    button {
        padding: 12px 30px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .glitch {
        font-size: 36px;
    }
    
    #stats-bar {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    #input-display-container {
        bottom: 80px;
    }
    
    #high-score {
        top: 60px;
        font-size: 12px;
    }
}
