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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #c4ff00;
    color: #000;
    height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

/* Timer Queue */
.timer-queue {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
    width: auto;
    min-width: 60px;
    max-width: calc(100vw - 40px);
}

.queue-item {
    font-size: 18px;
    font-weight: bold;
    color: #000;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.queue-item.completed {
    text-decoration: line-through;
    opacity: 0.6;
}

.queue-item.current {
    color: #000;
    font-weight: 900;
}

/* Main Timer Display */
.main-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timer-display {
    font-size: 120px;
    font-weight: bold;
    color: #000;
    text-align: center;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.timer-display.completed {
    text-decoration: line-through;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-input {
    width: 80px;
    height: 60px;
    background-color: #000;
    color: #c4ff00;
    border: none;
    border-radius: 8px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    outline: none;
}

.time-input::placeholder {
    color: #c4ff00;
    opacity: 1;
}

.time-input:focus::placeholder {
    opacity: 0;
}

.time-separator {
    font-size: 24px;
    font-weight: bold;
    color: #000;
}

.add-button {
    width: 80px;
    height: 80px;
    background-color: #000;
    color: #c4ff00;
    border: none;
    border-radius: 50%;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-button:hover {
    transform: scale(1.05);
}

.add-button:active {
    transform: scale(0.95);
}

.start-button {
    background-color: #000;
    color: #c4ff00;
    border: none;
    border-radius: 25px;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.start-button:hover {
    transform: scale(1.05);
}

.start-button:active {
    transform: scale(0.95);
}

/* Congratulations Screen */
.congratulations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #c4ff00;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.celebration-emoji {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.congrats-text {
    font-size: 36px;
    font-weight: bold;
    color: #000;
    margin-bottom: 10px;
    text-align: center;
}

.congrats-subtext {
    font-size: 18px;
    color: #000;
    text-align: center;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Hidden state */
.hidden {
    display: none !important;
}

/* Initial state - hide timer until start */
.main-timer {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timer-started .main-timer {
    opacity: 1;
}

/* Countdown animation */
.countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #c4ff00;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.countdown-number {
    font-size: 200px;
    font-weight: bold;
    color: #000;
    animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Running state */
.running .input-section {
    display: none;
}

.running .timer-display {
    font-size: 140px;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .timer-display {
        font-size: 80px;
    }
    
    .running .timer-display {
        font-size: 100px;
    }
    
    .timer-queue {
        top: 15px;
        left: 15px;
        max-width: calc(100vw - 30px);
    }
    
    .queue-item {
        font-size: 16px;
        background-color: rgba(255, 255, 255, 0.2);
        padding: 6px 10px;
        border: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    .time-input {
        width: 70px;
        height: 50px;
        font-size: 20px;
    }
    
    .add-button {
        width: 70px;
        height: 70px;
        font-size: 30px;
    }
    
    .congrats-text {
        font-size: 28px;
    }
    
    .celebration-emoji {
        font-size: 60px;
    }
}

@media (max-width: 320px) {
    .timer-display {
        font-size: 60px;
    }
    
    .running .timer-display {
        font-size: 80px;
    }
    
    .time-input {
        width: 60px;
        height: 45px;
        font-size: 18px;
    }
    
    .add-button {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}

/* iPhone specific adjustments */
@media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) {
    /* iPhone 11 Pro, X, XS */
    .timer-queue {
        top: 50px; /* Account for notch */
        left: 15px;
        max-width: calc(100vw - 30px);
    }
    
    .queue-item {
        font-size: 16px;
        background-color: rgba(255, 255, 255, 0.3);
        padding: 8px 12px;
        border: 2px solid rgba(0, 0, 0, 0.2);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        font-weight: 900;
    }
}

@media only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) {
    /* iPhone 11, XR */
    .timer-queue {
        top: 50px; /* Account for notch */
        left: 15px;
        max-width: calc(100vw - 30px);
    }
    
    .queue-item {
        font-size: 17px;
        background-color: rgba(255, 255, 255, 0.3);
        padding: 8px 12px;
        border: 2px solid rgba(0, 0, 0, 0.2);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        font-weight: 900;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .queue-item {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    .timer-queue {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .container {
        padding: 10px;
    }
    
    .timer-queue {
        top: 10px;
        left: 10px;
    }
    
    .timer-display {
        font-size: 80px;
    }
    
    .running .timer-display {
        font-size: 100px;
    }
    
    .input-section {
        margin-bottom: 20px;
    }
    
    .queue-item {
        font-size: 14px;
    }
}
