* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#app {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #00ff00;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

#app::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--fill-height, 0%);
    background-color: #ff0000;
    transition: height 0.1s linear;
    z-index: 1;
}

#timer-display,
#lap-time {
    position: relative;
    z-index: 2;
}

#lap-time {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.7);
    min-height: 30px;
    text-align: center;
    width: 100%;
    padding: 0 20px;
}

#timer-display {
    font-size: 120px;
    font-weight: 700;
    color: #000;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.3);
    letter-spacing: -2px;
}

#settings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 280px;
    z-index: 3;
}

#settings.hidden {
    display: none;
}

#settings label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

#settings input {
    padding: 12px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
}

#settings input:focus {
    border-color: #007AFF;
}

#settings button {
    padding: 14px;
    font-size: 18px;
    font-weight: 600;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

#settings button:active {
    background: #0051D5;
}

@media (max-width: 600px) {
    #timer-display {
        font-size: 80px;
    }
    
    #lap-time {
        font-size: 20px;
        top: 15px;
    }
}

@media (max-width: 400px) {
    #timer-display {
        font-size: 60px;
    }
    
    #lap-time {
        font-size: 18px;
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: inset 0 0 0px rgba(255, 255, 255, 0);
    }
    50% {
        box-shadow: inset 0 0 100px 50px rgba(255, 255, 255, 0.6);
    }
}

.pulse-slow {
    animation: pulse 1s ease-in-out;
}

.pulse-fast {
    animation: pulse 0.5s ease-in-out;
}
