:root{
    --bg1:#dcefff;
    --bg2:#f7fbff;
    --blue:#1597df;
    --blue-dark:#0572b5;
    --line:#3e4a52;
    --text:#123247;
    --muted:#557286;
    --card:#ffffff;
    --accent:#ffb020;
}

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

body{
    min-height:100vh;
    font-family:"Segoe UI", Arial, sans-serif;
    color:var(--text);
    background:
        radial-gradient(circle at 20% 10%, rgba(255,255,255,.9), transparent 28%),
        linear-gradient(180deg, var(--bg1), var(--bg2));
    display:flex;
    justify-content:center;
    align-items:center;
    padding:24px;
}

.app{
    width:min(980px, 100%);
}

.intro{
    text-align:center;
    margin-bottom:22px;
}

.badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:6px 14px;
    border-radius:999px;
    background:rgba(21,151,223,.12);
    color:var(--blue-dark);
    font-weight:700;
    font-size:14px;
    margin-bottom:10px;
}

h1{
    font-size:clamp(28px, 5vw, 46px);
    line-height:1.05;
    margin-bottom:10px;
}

.intro p{
    max-width:720px;
    margin:0 auto;
    color:var(--muted);
    font-size:clamp(15px, 2vw, 18px);
}

.scene{
    position:relative;
    width:100%;
    height:430px;
    background:linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.18));
    border:1px solid rgba(255,255,255,.65);
    border-radius:28px;
    box-shadow:0 22px 70px rgba(24,71,99,.18);
    overflow:hidden;
}

.ground{
    position:absolute;
    left:7%;
    right:7%;
    bottom:56px;
    height:20px;
    border-radius:999px;
    background:rgba(62,74,82,.16);
    filter:blur(.2px);
}

.vessel{
    position:absolute;
    bottom:76px;
    width:190px;
    height:280px;
    border:7px solid var(--line);
    border-top:0;
    border-radius:0 0 18px 18px;
    background:rgba(255,255,255,.74);
    overflow:hidden;
    box-shadow:inset 0 0 22px rgba(255,255,255,.45), 0 10px 26px rgba(28,62,84,.12);
}

.vessel::before{
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(90deg, rgba(255,255,255,.38), transparent 36%, rgba(0,0,0,.04));
    pointer-events:none;
    z-index:4;
}

.vessel-left{ left:9%; }
.vessel-right{ right:9%; }

.scale{
    position:absolute;
    z-index:5;
    top:18px;
    bottom:18px;
    right:9px;
    width:34px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    color:rgba(18,50,71,.42);
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.scale::before{
    content:"";
    position:absolute;
    right:36px;
    top:0;
    bottom:0;
    width:2px;
    background:repeating-linear-gradient(to bottom, rgba(18,50,71,.28) 0 2px, transparent 2px 18px);
}

.water{
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    height:50%;
    background:linear-gradient(180deg, #79ddff, var(--blue) 58%, #096dac);
    transition:height .12s linear;
    overflow:hidden;
}

.water::after{
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(90deg, rgba(255,255,255,.18), transparent 45%, rgba(255,255,255,.1));
}

.wave{
    position:absolute;
    left:-45%;
    width:190%;
    height:30px;
    top:-15px;
    border-radius:43%;
    background:rgba(255,255,255,.42);
    animation:waveMove 4.5s linear infinite;
}

.wave-two{
    opacity:.35;
    top:-9px;
    animation-duration:6.5s;
    animation-direction:reverse;
}

@keyframes waveMove{
    from{ transform:translateX(0) rotate(0deg); }
    to{ transform:translateX(45px) rotate(360deg); }
}

.tube{
    position:absolute;
    left:calc(9% + 190px);
    right:calc(9% + 190px);
    bottom:108px;
    height:44px;
    border-top:7px solid var(--line);
    border-bottom:7px solid var(--line);
    background:rgba(255,255,255,.68);
    overflow:hidden;
    z-index:0;
}

.tube-water{
    position:absolute;
    inset:0;
    background:linear-gradient(90deg, #0b86ca, #68d5ff, #0b86ca);
    background-size:220% 100%;
    animation:tubeFlow 1.4s linear infinite;
    opacity:.9;
}

.tube-water.slow{
    animation-duration:3.8s;
    opacity:.58;
}

@keyframes tubeFlow{
    from{ background-position:0% 50%; }
    to{ background-position:220% 50%; }
}

.bubble{
    position:absolute;
    top:50%;
    width:8px;
    height:8px;
    border-radius:50%;
    background:rgba(255,255,255,.85);
    filter:blur(.1px);
    animation:bubbleMove 2.8s linear infinite;
}

.bubble-one{ left:12%; animation-delay:0s; }
.bubble-two{ left:48%; width:6px; height:6px; animation-delay:.6s; }
.bubble-three{ left:72%; width:10px; height:10px; animation-delay:1.2s; }

@keyframes bubbleMove{
    0%{ transform:translateY(10px) scale(.8); opacity:0; }
    25%{ opacity:.9; }
    100%{ transform:translateY(-16px) scale(1.15); opacity:0; }
}

.flow-indicator{
    position:absolute;
    left:50%;
    top:46%;
    transform:translate(-50%, -50%);
    width:70px;
    height:70px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    background:rgba(255,255,255,.72);
    box-shadow:0 10px 26px rgba(17,80,119,.16);
    color:var(--blue-dark);
    font-size:34px;
    font-weight:800;
    animation:pulse 1.5s ease-in-out infinite;
}

@keyframes pulse{
    0%,100%{ transform:translate(-50%, -50%) scale(1); }
    50%{ transform:translate(-50%, -50%) scale(1.08); }
}

.panel{
    margin-top:18px;
    background:var(--card);
    border-radius:22px;
    padding:18px;
    box-shadow:0 18px 50px rgba(24,71,99,.14);
}

.control-block label{
    display:block;
    font-weight:700;
    margin-bottom:10px;
}

input[type="range"]{
    width:100%;
    accent-color:var(--blue-dark);
}

.control-grid{
    margin-top:16px;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}

button{
    border:0;
    border-radius:13px;
    padding:12px 14px;
    cursor:pointer;
    font-weight:800;
    color:white;
    background:linear-gradient(135deg, var(--blue), var(--blue-dark));
    box-shadow:0 8px 20px rgba(5,114,181,.22);
}

button:hover{
    filter:brightness(1.04);
}

.status{
    margin-top:14px;
    padding:13px 15px;
    border-radius:14px;
    background:rgba(21,151,223,.09);
    color:#164462;
    line-height:1.45;
}

.status strong{
    color:var(--blue-dark);
}

@media (max-width:740px){
    body{ padding:14px; }

    .scene{
        height:440px;
    }

    .vessel{
        width:38vw;
        max-width:170px;
        height:250px;
        bottom:84px;
    }

    .vessel-left{ left:5%; }
    .vessel-right{ right:5%; }

    .tube{
        left:calc(5% + min(38vw, 170px));
        right:calc(5% + min(38vw, 170px));
        bottom:116px;
        height:38px;
    }

    .flow-indicator{
        width:58px;
        height:58px;
        font-size:28px;
        top:48%;
    }

    .control-grid{
        grid-template-columns:1fr;
    }
}
