:root {
    --neon-green: #39ff14;
    --neon-green-dim: rgba(57, 255, 20, 0.4);
    --neon-green-glow: rgba(57, 255, 20, 0.6);
    --bg-dark: #0a0a0a;
    --bg-container: #121212;
}

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

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Orbitron', monospace;
    background-color: var(--bg-dark);
}

.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.counter-container {
    position: relative;
    padding: 40px 30px;
    border-radius: 16px;
    background: var(--bg-container);
    border: 1px solid rgba(57, 255, 20, 0.3);
    box-shadow: 
        0 0 20px var(--neon-green-dim),
        0 0 40px rgba(57, 255, 20, 0.2),
        0 0 60px rgba(57, 255, 20, 0.1),
        inset 0 0 30px rgba(57, 255, 20, 0.05);
    animation: flicker 0.5s ease-out, containerGlow 3s ease-in-out infinite alternate;
    animation-delay: 0s, 0.5s;
    overflow: hidden;
    width: 100%;
    max-width: 500px;
}

@keyframes containerGlow {
    0% {
        box-shadow: 
            0 0 20px var(--neon-green-dim),
            0 0 40px rgba(57, 255, 20, 0.2),
            0 0 60px rgba(57, 255, 20, 0.1),
            inset 0 0 30px rgba(57, 255, 20, 0.05);
    }
    100% {
        box-shadow: 
            0 0 30px var(--neon-green-dim),
            0 0 60px rgba(57, 255, 20, 0.3),
            0 0 80px rgba(57, 255, 20, 0.15),
            inset 0 0 40px rgba(57, 255, 20, 0.08);
    }
}

@keyframes flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        opacity: 1;
    }
    20%, 24%, 55% {
        opacity: 0.6;
    }
}

.scanline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(57, 255, 20, 0.02) 2px,
        rgba(57, 255, 20, 0.02) 4px
    );
    pointer-events: none;
    z-index: 1;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.counter-display {
    font-size: 5rem;
    font-weight: 900;
    color: var(--neon-green);
    text-shadow: 
        0 0 10px var(--neon-green),
        0 0 20px var(--neon-green),
        0 0 40px var(--neon-green),
        0 0 80px rgba(57, 255, 20, 0.5);
    min-width: 180px;
    text-align: center;
    transition: transform 0.15s ease-out, text-shadow 0.15s ease-out;
    line-height: 1.2;
    padding: 10px 0;
}

.counter-display.pulse {
    transform: scale(1.08);
    text-shadow: 
        0 0 15px var(--neon-green),
        0 0 30px var(--neon-green),
        0 0 60px var(--neon-green),
        0 0 100px rgba(57, 255, 20, 0.7);
}

.control-btn {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: var(--bg-dark);
    border: 2px solid var(--neon-green);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neon-green);
    font-size: 2rem;
    font-weight: bold;
    font-family: 'Orbitron', monospace;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        0 0 10px rgba(57, 255, 20, 0.3),
        inset 0 0 15px rgba(57, 255, 20, 0.1);
    flex-shrink: 0;
}

.control-btn:hover {
    background: var(--neon-green);
    color: var(--bg-dark);
    box-shadow: 
        0 0 20px var(--neon-green),
        0 0 40px rgba(57, 255, 20, 0.5),
        inset 0 0 20px rgba(57, 255, 20, 0.2);
}

.control-btn:active {
    transform: scale(0.95);
    box-shadow: 
        0 0 30px var(--neon-green),
        0 0 60px var(--neon-green),
        inset 0 0 30px rgba(57, 255, 20, 0.3);
}

.reset-btn {
    display: block;
    margin: 30px auto 0;
    background: transparent;
    border: none;
    color: rgba(57, 255, 20, 0.6);
    font-size: 0.875rem;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    padding: 8px 16px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.reset-btn:hover {
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
}

.hint-text {
    margin-top: 20px;
    text-align: center;
    color: rgba(57, 255, 20, 0.3);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 2;
}

.footer {
    margin-top: 30px;
    text-align: center;
}

.footer-link {
    color: rgba(57, 255, 20, 0.4);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--neon-green);
}

/* Mobile styles */
@media (max-width: 480px) {
    .app-wrapper {
        padding: 16px;
    }
    
    .counter-container {
        padding: 30px 20px;
    }
    
    .controls-row {
        gap: 12px;
    }
    
    .counter-display {
        font-size: 3.5rem;
        min-width: 120px;
    }
    
    .control-btn {
        width: 56px;
        height: 56px;
        font-size: 1.75rem;
    }
    
    .reset-btn {
        margin-top: 24px;
        font-size: 0.75rem;
    }
    
    .hint-text {
        font-size: 0.65rem;
    }
}

@media (max-width: 360px) {
    .counter-display {
        font-size: 2.5rem;
        min-width: 100px;
    }
    
    .control-btn {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }
}