@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

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

body {
    font-family: 'Orbitron', monospace;
    background: #000;
    overflow: hidden;
    height: 100vh;
}

.container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a0033 0%, #000 70%);
    animation: pulse 4s ease-in-out infinite;
}

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

.timer-wrapper {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 3rem;
    border: 2px solid #ff0080;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.8);
    box-shadow:
        0 0 30px #ff0080,
        inset 0 0 30px rgba(255, 0, 128, 0.1);
    backdrop-filter: blur(10px);
}

.title {
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    text-shadow:
        0 0 10px #ff0080,
        0 0 20px #ff0080,
        0 0 30px #ff0080;
    margin-bottom: 2rem;
    letter-spacing: 0.3em;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow:
            0 0 10px #ff0080,
            0 0 20px #ff0080,
            0 0 30px #ff0080;
    }
    to {
        text-shadow:
            0 0 20px #ff0080,
            0 0 30px #ff0080,
            0 0 40px #ff0080,
            0 0 50px #ff0080;
    }
}

.timer-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-value {
    font-size: 6rem;
    font-weight: 700;
    color: #00ffff;
    text-shadow:
        0 0 10px #00ffff,
        0 0 20px #00ffff;
    transition: all 0.3s ease;
    min-width: 2.5ch;
}

.time-value.warning {
    color: #ff4444;
    text-shadow:
        0 0 10px #ff4444,
        0 0 20px #ff4444;
    animation: warning-flash 1s ease-in-out infinite;
}

@keyframes warning-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.time-value.critical {
    color: #ff0000;
    text-shadow:
        0 0 10px #ff0000,
        0 0 20px #ff0000,
        0 0 30px #ff0000;
    animation: critical-flash 0.5s ease-in-out infinite;
}

@keyframes critical-flash {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.time-label {
    font-size: 0.8rem;
    color: #ccc;
    font-weight: 400;
    letter-spacing: 0.2em;
    margin-top: 0.5rem;
}

.separator {
    font-size: 4rem;
    color: #00ffff;
    font-weight: 700;
    text-shadow:
        0 0 10px #00ffff,
        0 0 20px #00ffff;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

#timeInput {
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #00ffff;
    border-radius: 8px;
    color: #00ffff;
    text-align: center;
    width: 120px;
}

#timeInput:focus {
    outline: none;
    box-shadow: 0 0 10px #00ffff;
}

/* Hide default spinner arrows and style custom ones */
#timeInput::-webkit-inner-spin-button,
#timeInput::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox - hide default spinners */
#timeInput[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Wrapper for input with custom controls */
.input-wrapper {
    position: relative;
    display: inline-block;
}

/* Custom arrow buttons */
.arrow-up,
.arrow-down {
    position: absolute;
    right: 5px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.arrow-up {
    top: 8px;
    border-bottom: 8px solid #00ffff;
}

.arrow-up:hover {
    border-bottom-color: #66ffff;
    filter: drop-shadow(0 0 4px #00ffff);
}

.arrow-down {
    bottom: 8px;
    border-top: 8px solid #00ffff;
}

.arrow-down:hover {
    border-top-color: #66ffff;
    filter: drop-shadow(0 0 4px #00ffff);
}

.btn {
    padding: 0.8rem 1.5rem;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    min-width: 90px;
}

.start-btn {
    background: linear-gradient(45deg, #00ff00, #00cc00);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.start-btn:hover {
    background: linear-gradient(45deg, #00cc00, #009900);
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.8);
    transform: translateY(-2px);
}

.pause-btn {
    background: linear-gradient(45deg, #ffaa00, #ff8800);
    color: #000;
    box-shadow: 0 0 15px rgba(255, 170, 0, 0.5);
}

.pause-btn:hover {
    background: linear-gradient(45deg, #ff8800, #ff6600);
    box-shadow: 0 0 25px rgba(255, 170, 0, 0.8);
    transform: translateY(-2px);
}

.reset-btn {
    background: linear-gradient(45deg, #ff4444, #cc0000);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.5);
}

.reset-btn:hover {
    background: linear-gradient(45deg, #cc0000, #990000);
    box-shadow: 0 0 25px rgba(255, 68, 68, 0.8);
    transform: translateY(-2px);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ffff, #ff0080);
    border-radius: 4px;
    transition: width 1s linear;
    width: 100%;
    box-shadow: 0 0 10px #00ffff;
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.8;
    animation: float 6s linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10px) translateX(var(--random-x, 0));
        opacity: 0;
    }
}

.finished {
    animation: celebration 2s ease-in-out infinite;
}

@keyframes celebration {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.05) rotate(2deg);
    }
    75% {
        transform: scale(1.05) rotate(-2deg);
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }

    .time-value {
        font-size: 4rem;
    }

    .timer-wrapper {
        padding: 2rem;
        margin: 1rem;
    }

    .controls {
        flex-direction: column;
        gap: 0.8rem;
    }

    .btn {
        width: 100%;
        max-width: 200px;
    }
}