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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(180deg, #87ceeb 0%, #4a90e2 30%, #2c5aa0 70%, #1e3a5f 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* JavaScript-generated bubble layers */
.bubble-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.bubble-layer-1 {
    z-index: 1;
}

.bubble-layer-2 {
    z-index: 2;
}

.bubble-layer-3 {
    z-index: 3;
}

.bubble {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
    animation: bubble-rise linear forwards;
    top: 100vh;
}

.bubble.layer-1 {
    font-size: 28px;
    color: rgba(255, 255, 255, 0.25);
    animation-duration: 45s;
}

.bubble.layer-2 {
    font-size: 22px;
    color: rgba(255, 255, 255, 0.18);
    animation-duration: 35s;
}

.bubble.layer-3 {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.12);
    animation-duration: 55s;
}

@keyframes bubble-rise {
    0% { 
        transform: translateY(0) rotate(0deg); 
        opacity: 0;
    }
    10% { 
        opacity: 1;
    }
    90% { 
        opacity: 1;
    }
    100% { 
        transform: translateY(-150vh) rotate(8deg); 
        opacity: 0;
    }
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 10;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: 300;
}

.timer-display {
    margin-bottom: 40px;
}

.clock-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.clock {
    display: block;
    margin: 0 auto;
}

.time-text {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    font-family: 'Courier New', monospace;
    text-align: center;
    pointer-events: none;
}

.time {
    font-size: 4rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
}

.phase {
    font-size: 1.5rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.phase.work {
    color: #3498db;
}

.phase.break {
    color: #27ae60;
}

.controls {
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.input-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.input-group input[type="range"]:hover {
    opacity: 1;
}

.input-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.input-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: #5a6fd8;
}

.input-group input[type="range"]::-moz-range-thumb {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.input-group input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
    background: #5a6fd8;
}

.slider {
    margin: 10px 0;
}

.buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

button {
    padding: 12px 24px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

#startBtn {
    background: #B3E5F0;
    color: #006B7A;
    border-color: rgba(0, 107, 122, 0.15);
}

#startBtn:hover:not(:disabled) {
    background: #9BD9E8;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#pauseBtn {
    background: #E0F2F1;
    color: #00695C;
    border-color: rgba(0, 105, 92, 0.15);
}

#pauseBtn:hover:not(:disabled) {
    background: #C8E6C9;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#resetBtn {
    background: #E1F5FE;
    color: #0277BD;
    border-color: rgba(2, 119, 189, 0.15);
}

#resetBtn:hover:not(:disabled) {
    background: #B3E5FC;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.progress {
    margin-top: 30px;
}

.round-info {
    margin-bottom: 15px;
    color: #666;
    font-weight: 500;
}

/* Diver Progress Indicator */
.diver-container {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 80px;
    height: 100vh;
    pointer-events: none;
    z-index: 5;
}

.diver {
    z-index: 6;
}

.diver {
    position: absolute;
    top: 80vh; /* Start at bottom (80% down screen) */
    left: 0;
    width: 60px;
    height: 80px;
    transition: top 2s ease;
}

.helmet {
    width: 45px;
    height: 45px;
    background: radial-gradient(circle at 30% 30%, #DAA520, #CD853F, #B8860B);
    border-radius: 50%;
    border: 3px solid #8B4513;
    position: relative;
    margin: 0 auto;
    box-shadow: 
        inset -3px -3px 0 rgba(0,0,0,0.3),
        inset 3px 3px 0 rgba(255,215,0,0.4),
        0 2px 4px rgba(0,0,0,0.3);
}

/* Main viewport glass */
.helmet::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 21px;
    height: 21px;
    background: radial-gradient(circle, rgba(135, 206, 235, 0.9), rgba(70, 130, 180, 0.7));
    border-radius: 50%;
    border: 2px solid #4682B4;
    box-shadow: 
        inset 1px 1px 0 rgba(255,255,255,0.5),
        0 0 3px rgba(0,0,0,0.3);
}

/* Air valve on top */
.helmet::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 14px;
    background: linear-gradient(to bottom, #8B4513, #654321);
    border-radius: 3px;
    border: 1px solid #654321;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Rivets around helmet */
.helmet .rivet {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #FFD700, #DAA520);
    border-radius: 50%;
    border: 1px solid #B8860B;
}

.helmet .rivet:nth-child(1) { top: 5px; left: 20px; }
.helmet .rivet:nth-child(2) { top: 20px; left: 5px; }
.helmet .rivet:nth-child(3) { bottom: 5px; left: 20px; }
.helmet .rivet:nth-child(4) { top: 20px; right: 5px; }

/* Side viewing ports */
.helmet .side-port {
    position: absolute;
    width: 8px;
    height: 6px;
    background: rgba(70, 130, 180, 0.6);
    border: 1px solid #4682B4;
    border-radius: 2px;
}

.helmet .side-port.left {
    top: 18px;
    left: -2px;
}

.helmet .side-port.right {
    top: 18px;
    right: -2px;
}

.body {
    width: 30px;
    height: 35px;
    background: #2F4F4F;
    margin: 5px auto;
    border-radius: 5px;
    border: 2px solid #1C1C1C;
}

.arms {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 8px;
    background: #2F4F4F;
    border-radius: 4px;
    border: 1px solid #1C1C1C;
}

.arms::before,
.arms::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #8B4513;
    border-radius: 50%;
    border: 1px solid #654321;
    top: -2px;
}

.arms::before {
    left: -6px;
}

.arms::after {
    right: -6px;
}

.legs {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 20px;
    background: #2F4F4F;
    border-radius: 0 0 8px 8px;
    border: 2px solid #1C1C1C;
    border-top: none;
}

.legs::before,
.legs::after {
    content: '';
    position: absolute;
    bottom: -8px;
    width: 15px;
    height: 8px;
    background: #000;
    border-radius: 8px;
}

.legs::before {
    left: 0;
}

.legs::after {
    right: 0;
}

.air-hose {
    position: absolute;
    top: -100vh; /* Extend upward from diver */
    left: calc(50% - 4px); /* Align with helmet air valve */
    width: 8px;
    height: calc(100vh + 10px); /* Extend to connect with air valve */
    background: linear-gradient(to bottom, 
        #FF6B35 0%, 
        #F7931E 25%, 
        #FF6B35 50%, 
        #F7931E 75%, 
        #FF6B35 100%
    );
    border-radius: 4px;
    pointer-events: none;
    z-index: 1; /* Behind diver */
    opacity: 1;
    box-shadow: 0 0 4px rgba(0,0,0,0.5), 0 0 8px rgba(255,107,53,0.3);
    border: 1px solid #CC5428;
}


#airHosePath {
    stroke: url(#hoseGradient);
    opacity: 0.85;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.4));
    animation: hoseWave 4s ease-in-out infinite;
}

@keyframes hoseWave {
    0%, 100% {
        transform: translateX(0px);
    }
    25% {
        transform: translateX(1px);
    }
    50% {
        transform: translateX(0px);
    }
    75% {
        transform: translateX(-1px);
    }
}

/* Hose end fittings */
.air-hose-svg::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 24px;
    width: 12px;
    height: 8px;
    background: #6B3410;
    border-radius: 6px;
    border: 1px solid #4A2408;
    z-index: 5;
    opacity: 0.9;
}

.air-hose-svg::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 24px;
    width: 12px;
    height: 10px;
    background: #6B3410;
    border-radius: 50%;
    border: 1px solid #4A2408;
    z-index: 5;
    opacity: 0.9;
}

/* iPad and touch device optimizations */
@media (max-width: 768px) {
    .input-group input[type="range"]::-webkit-slider-thumb {
        width: 30px;
        height: 30px;
    }
    
    .input-group input[type="range"]::-moz-range-thumb {
        width: 30px;
        height: 30px;
    }
    
    .input-group input[type="range"] {
        height: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .time {
        font-size: 3rem;
    }
    
    .buttons {
        flex-direction: column;
        align-items: center;
    }
    
    button {
        width: 100%;
        max-width: 200px;
    }
    
    .input-group input[type="range"]::-webkit-slider-thumb {
        width: 35px;
        height: 35px;
    }
    
    .input-group input[type="range"]::-moz-range-thumb {
        width: 35px;
        height: 35px;
    }
    
    .input-group input[type="range"] {
        height: 15px;
    }
}