:root {
    --bg-tank: #0b1320;
    --water-top: #00b4db;
    --water-bottom: #0083b0;
    --water-break-top: #0f2027;
    --water-break-bottom: #203a43;
    --text-color: #ffffff;
}

* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Nunito', 'M PLUS Rounded 1c', sans-serif;
    background-color: var(--bg-tank);
    color: var(--text-color);
}

#aquarium {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Base background empty tank */
#aquarium::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, #1a2a40 0%, #08101a 100%);
    z-index: 0;
}

/* The Water Layer */
#water {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Height controlled by JS */
    background: linear-gradient(180deg, var(--water-top) 0%, var(--water-bottom) 100%);
    transition: background 1.5s ease-in-out, height 1s linear;
    z-index: 1;
    overflow: hidden;
    box-shadow: 0 -5px 20px rgba(0, 180, 219, 0.3);
}

.break-mode #water {
    background: linear-gradient(180deg, var(--water-break-top) 0%, var(--water-break-bottom) 100%);
    box-shadow: 0 -5px 20px rgba(15, 32, 39, 0.5);
}

/* Optional soft waves at top of water */
.wave {
    position: absolute;
    top: -15px;
    left: 0;
    width: 200%;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: moveWave 10s linear infinite alternate;
}
.wave2 {
    top: -10px;
    left: -50%;
    background: rgba(255, 255, 255, 0.05);
    animation: moveWave 8s linear infinite alternate-reverse;
}

@keyframes moveWave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-25%); }
}

#fish-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2;
    pointer-events: none;
}

#bubbles-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 3;
    pointer-events: none;
}

/* UI Layer */
#ui-layer {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    pointer-events: none;
}

.timer-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    transition: transform 0.3s ease;
}

.timer-card:hover {
    transform: translateY(-5px);
}

#mode-icon {
    font-size: 3rem;
    margin: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

#mode-text {
    font-size: 1.5rem;
    margin: 10px 0 0 0;
    font-weight: 800;
    color: #e0f7fa;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

#timer-display {
    font-size: 7rem;
    font-weight: 800;
    margin: 10px 0 30px 0;
    text-shadow: 0 4px 15px rgba(0,0,0,0.4);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

button {
    font-family: inherit;
    font-weight: 800;
    padding: 14px 20px;
    font-size: 1.1rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

button .icon {
    font-size: 1.3rem;
}

.primary {
    background: linear-gradient(135deg, #1fa2ff 0%, #12d8fa 50%, #a6ffcb 100%);
    color: #0d2e46;
    box-shadow: 0 4px 15px rgba(31, 162, 255, 0.4);
}

.primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(31, 162, 255, 0.6);
    transform: translateY(-2px);
}

.secondary {
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(75, 108, 183, 0.4);
}

.secondary:hover {
    filter: brightness(1.2);
    box-shadow: 0 6px 20px rgba(75, 108, 183, 0.6);
    transform: translateY(-2px);
}

.outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(1px);
}

/* Animations Objects */
.fish {
    position: absolute;
    font-size: 3.5rem;
    user-select: none;
    will-change: transform, left, top;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
    z-index: 5;
}

.fish::after {
    content: '💤';
    position: absolute;
    top: -20px;
    right: -25px;
    font-size: 1.8rem;
    opacity: 0;
    transition: opacity 1s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.break-mode .fish::after {
    opacity: 1;
    animation: zzzBounce 2s ease-in-out infinite alternate;
}

@keyframes zzzBounce {
    0% { transform: translateY(0) scale(0.9); opacity: 0.6; }
    100% { transform: translateY(-15px) scale(1.2); opacity: 1; }
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.1) 60%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2), inset 0 0 10px rgba(255, 255, 255, 0.5);
    animation: rise linear infinite;
    bottom: -50px;
    z-index: 3;
}

@keyframes rise {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    10% { opacity: 1; }
    80% { opacity: 0.8; }
    100% { transform: translateY(-100vh) scale(1.5); opacity: 0; }
}
