@font-face{font-family:ChromaSans;src:url('fonts/ChromaSans-Regular.woff2') format('woff2');font-style:normal;font-weight:400 500;font-display:swap}
@font-face{font-family:ChromaSans;src:url('fonts/ChromaSans-Bold.woff2') format('woff2');font-style:normal;font-weight:600 900;font-display:swap}
@font-face{font-family:Libertine;src:url('fonts/Libertine-Regular.woff2') format('woff2');font-style:normal;font-weight:400 700;font-display:swap}
:root{font-family:ChromaSans,'Trebuchet MS',sans-serif;color:#253b35;background:#f5f8f6;font-synthesis:none;--green:#253b35;--muted:#7a8780;--line:#dbe4df;--mint:#d4f5df;letter-spacing:0}
*{box-sizing:border-box}body{margin:0}button,a,input{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer}button:disabled{opacity:.35;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #259e73;outline-offset:5px}button{border:0;background:none}a{color:inherit;text-decoration:none}.topbar{height:96px;margin:0 5%;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}.brand{display:flex;align-items:center;gap:12px;font-size:27px;font-weight:700}.brand-light{font-weight:400}.brand sup{font-size:10px;vertical-align:top;margin-left:3px}.brandmark{width:38px;height:38px;display:grid;place-items:center;background:var(--green);border-radius:8px;color:#b6f1ce}.brandmark svg{width:23px;height:23px}.top-actions{display:flex;align-items:center;gap:14px}.level-link{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;padding:10px}.level-link svg{width:16px}.separator{height:20px;width:1px;background:var(--line);margin:0 4px}.icon-button{height:38px;width:38px;display:grid;place-items:center;border-radius:50%;transition:background .2s}.icon-button:hover{background:#e6ede8}.icon-button svg{width:19px;height:19px}.layout{max-width:1400px;margin:0 auto;padding:54px 5% 36px;display:grid;grid-template-columns:260px minmax(0,1fr);column-gap:54px;row-gap:26px}.sidebar{display:flex;flex-direction:column;min-width:0;padding:8px 0}.edition{display:flex;gap:8px;align-items:center;font:10px 'Courier New',monospace;color:#718179}.tiny-line{height:1px;width:18px;background:#718179}h1{font-size:46px;font-weight:500;line-height:1.07;margin:25px 0 39px}.title-dot{color:#57af85}.chapter{display:flex;gap:15px;align-items:center}.chapter-number{font:36px 'Courier New',monospace;color:#b6c9bd}.eyebrow{font:9px 'Courier New',monospace;color:#7c8e83;margin-bottom:7px}.chapter h2{font-size:15px;font-weight:500;margin:0}.difficulty{margin:22px 0 0;display:flex;gap:12px;align-items:center;font-size:11px;color:#7a8780}.difficulty-bars{display:flex;gap:3px}.difficulty-bars b{display:block;width:18px;height:4px;border-radius:2px;background:#dce6df}.difficulty-bars b.on{background:#78b792}.sidebar-bottom{margin-top:auto;padding-top:50px}.progress-label{font-size:11px;display:flex;justify-content:space-between;color:#7a8780;gap:10px}.progress-label b{font-weight:500;color:var(--green)}.progress-track{height:3px;background:#e0e9e3;margin-top:14px}.progress-track div{height:100%;background:#75af86;transition:width .4s}.mini-tubes{display:flex;gap:10px;margin-top:28px;height:38px;align-items:flex-end}.mini-tubes span{width:13px;height:33px;border:1px solid #a6b9ad;border-top:0;border-radius:0 0 8px 8px;background:linear-gradient(to top,var(--ink) 0 60%,transparent 60%);transform:rotate(-12deg)}.mini-tubes span:nth-child(2){height:37px;transform:rotate(8deg)}.mini-tubes span:nth-child(3){height:29px;transform:rotate(-5deg)}.mini-tubes span:nth-child(4){transform:rotate(12deg)}.text-button{display:flex;gap:14px;align-items:center;font-size:11px;padding:0;margin-top:24px}.text-button svg{width:14px;height:14px}.text-button:hover{text-decoration:underline}.experiment{position:relative;min-height:460px;border:1px solid #d8e5dd;border-radius:8px;background-color:#eef5ef;background-image:radial-gradient(#bfd5c5 .8px,transparent .8px);background-size:20px 20px;display:flex;flex-direction:column;isolation:isolate;overflow:hidden}.stage-top{padding:25px 29px 0;display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.stage-label{display:flex;gap:7px;align-items:center;font:9px 'Courier New',monospace;color:#698473;white-space:nowrap}.live-dot{height:5px;width:5px;border-radius:50%;background:#74a581}.stats{display:flex;gap:30px;text-align:right}.stats>div{min-width:40px;display:flex;flex-direction:column;gap:7px}.stats span{font:8px 'Courier New',monospace;color:#799183}.stats b{font:19px 'Courier New',monospace;font-weight:400}.play-area{display:flex;flex:1;flex-direction:column;justify-content:center;align-items:center;padding:25px 24px 14px;min-height:320px}.board{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:16px;max-width:660px;width:100%;padding:12px 0}.tube-button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;flex:0 0 88px;width:88px;height:218px;padding:0 0 0;border-radius:8px;transition:transform .25s,background .25s;touch-action:manipulation}.tube-button:hover:not(:disabled){transform:translateY(-5px)}.tube-button.selected{transform:translateY(-22px)!important}.tube-button.selected:after{content:'';position:absolute;bottom:22px;left:17px;right:17px;height:4px;border-radius:50%;box-shadow:0 26px 9px 2px #547f7638}.tube-button svg{width:80px;height:185px;overflow:visible;pointer-events:none;filter:drop-shadow(0px 9px 5px #6d95781f)}.tube-label{font:9px 'Courier New',monospace;color:#8aa093;margin-top:10px;height:12px}.tube-button.finished .tube-label{color:#399268}.tube-button.finished{animation:completed .55s ease}.tube-button.hint-source{background:#ffffff9c;outline:2px dashed #69a382;outline-offset:0}.tube-button.hint-target{background:#bce6ce80;outline:2px solid #69a382}.tube-button.invalid{animation:shake .25s}.status{font-size:11px;min-height:18px;color:#658371;text-align:center;margin-top:16px;max-width:100%}.stage-bottom{display:flex;align-items:center;justify-content:space-between;padding:0 29px 23px;gap:10px}.stage-caption{font:8px 'Courier New',monospace;color:#7f9987}.level-track{display:flex;gap:5px}.level-track span{height:4px;width:15px;border-radius:2px;background:#d5e3d9}.level-track span.done{background:#91bba0}.level-track span.current{background:#2e6b4c;width:25px}.toolbar{grid-column:2;display:flex;align-items:center;justify-content:center;gap:12px}.tool{height:49px;display:flex;align-items:center;justify-content:center;gap:9px;padding:0 20px;font-size:11px;border:1px solid #dce5df;border-radius:6px;background:#fafcfb;transition:background .2s,transform .2s;min-width:122px}.tool:not(:disabled):hover{background:#e9f1eb;transform:translateY(-2px)}.tool svg{width:17px;height:17px}.hint-tool{background:#e1f3e5;border-color:#cde6d4}.hint-badge{font-size:14px;color:#8db899;margin-left:7px}.pour-stream{display:none;position:fixed;height:5px;transform-origin:left center;z-index:100;border-radius:4px;pointer-events:none;transition:opacity .15s}footer{margin:0 5%;border-top:1px solid var(--line);display:flex;justify-content:space-between;padding:23px 0;gap:16px;font:8px 'Courier New',monospace;color:#94a39a}.footer-right{display:flex;gap:10px;align-items:center}.footer-dot{width:3px;height:3px;background:#94a39a;border-radius:50%}dialog{border:1px solid #d6e3db;border-radius:8px;padding:28px;max-width:calc(100% - 32px);width:460px;color:var(--green);background:#fafcfb;box-shadow:0 25px 100px #253b3526}dialog::backdrop{background:#21372b66;backdrop-filter:blur(5px)}.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px;gap:16px}.dialog-head h2{font-size:23px;font-weight:500;margin:0}.level-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:9px}.level-tile{height:62px;border:1px solid #dce6df;border-radius:6px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;background:white;font:15px 'Courier New',monospace}.level-tile svg{width:12px;height:12px}.level-tile.current{border-color:#5e9c78;box-shadow:inset 0 0 0 1px #5e9c78}.level-tile.done{background:#def1e3}.level-tile:disabled{opacity:.45}.setting-row{display:flex;justify-content:space-between;align-items:center;gap:20px;min-height:60px;border-bottom:1px solid var(--line);font-size:14px}.setting-row:last-child{border:0}input[type=checkbox]{appearance:none;width:40px;height:24px;border-radius:20px;background:#d6e2d9;position:relative;cursor:pointer;flex-shrink:0}input[type=checkbox]:after{content:'';position:absolute;top:3px;left:3px;width:18px;height:18px;background:white;border-radius:50%;transition:transform .2s}input:checked{background:#498363}input:checked:after{transform:translateX(16px)}.win-dialog{text-align:center;width:400px;padding:36px}.win-symbol{margin:0 auto 25px;width:70px;height:70px;background:#e2f3e6;border-radius:50%;display:grid;place-items:center;color:#4b9267}.win-symbol svg{width:31px;height:31px}.win-dialog h2{font-size:29px;font-weight:500;margin:12px 0 21px}.win-stars{display:flex;justify-content:center;gap:10px;color:#d7a83a}.win-stars svg{width:26px;height:26px;fill:#ebc765}.win-stars svg.dim{fill:none;color:#cad7ce}.win-stats{margin:22px 0 27px;font:12px 'Courier New',monospace;color:#7d8e82}.primary-button{height:49px;border-radius:6px;background:#294f3b;color:#eff8f1;display:flex;gap:25px;justify-content:center;align-items:center;width:100%;font-size:13px}.primary-button:hover{background:#38664c}.primary-button svg{width:17px}.win-dialog .text-button{justify-content:center;width:100%;margin-top:21px}.confetti{position:fixed;inset:0;z-index:10000;pointer-events:none;overflow:hidden}.confetti i{position:absolute;top:-20px;width:8px;height:14px;animation:fall 2s ease-in forwards}.reduce-motion *,.reduce-motion *:before,.reduce-motion *:after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}@keyframes shake{25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}@keyframes completed{50%{transform:translateY(-12px)}}@keyframes fall{to{transform:translateY(105vh) rotate(600deg)}}
.brand{font-size:29px}.brand-light{font-weight:400}
h1,.chapter-number,.dialog-head h2,.win-dialog h2{font-family:Libertine,Georgia,serif;font-weight:400}
h1{font-size:50px;line-height:1.02}.chapter-number{font-size:40px}.chapter h2{font-size:17px}
.edition,.eyebrow,.stage-label,.stats span,.stats b,.tube-label,.stage-caption,.level-tile,.win-stats,footer{font-family:ChromaSans,'Trebuchet MS',sans-serif;font-variant-numeric:tabular-nums}
.edition{font-size:11px}.eyebrow{font-size:10px}.stage-label{font-size:10px}.stats span{font-size:9px}.stats b{font-size:22px}.tube-label{font-size:11px}.stage-caption{font-size:9px}.level-tile{font-size:17px}.win-stats{font-size:14px}.tool{font-size:13px}.text-button{font-size:13px}footer{font-size:10px}
.experiment{background:#eaf2ed;background-image:none;box-shadow:inset 0 1px 0 #ffffffb3}
.win-stars{gap:8px}.win-stars svg{flex:0 0 26px}
.pour-flight{position:fixed;left:0;top:0;z-index:4000;pointer-events:none;will-change:transform;contain:layout style}
.pour-flight>svg{width:100%;height:100%;overflow:visible;filter:drop-shadow(0 12px 7px #315c4933)}
.pour-effects{position:fixed;inset:0;width:100%;height:100%;z-index:4001;pointer-events:none;overflow:visible}
.pouring-source>svg{visibility:hidden}.pouring-source:after{display:none}
.platform-paused *,.platform-paused *:before,.platform-paused *:after{animation-play-state:paused!important}
[hidden]{display:none!important}
dialog{max-height:calc(100dvh - 32px);overflow-y:auto}
@media(min-width:1400px){.layout{padding-top:70px;padding-bottom:50px}.experiment{min-height:520px}.tube-button{flex-basis:98px;width:98px;height:240px}.tube-button svg{width:88px;height:204px}.board{gap:20px}}
@media(max-width:1050px){.layout{grid-template-columns:200px minmax(0,1fr);column-gap:30px}.board{gap:8px}.tube-button{flex-basis:72px;width:72px;height:190px}.tube-button svg{width:68px;height:158px}h1{font-size:38px}.stage-top{padding:22px 20px 0}.stage-bottom{padding:0 20px 22px}.tool{min-width:100px;padding:0 14px}.play-area{padding-left:15px;padding-right:15px}}
@media(max-width:760px){.topbar{height:74px;margin:0 22px}.brand{font-size:23px;gap:9px}.brandmark{height:32px;width:32px}.top-actions{gap:4px}.separator{display:none}.level-link{padding:8px}.level-link span{display:none}.layout{display:flex;flex-direction:column;padding:27px 22px 30px;gap:20px}.sidebar{padding:0;display:grid;grid-template-columns:1fr auto;gap:16px;align-items:center}.edition{grid-column:1/-1;font-size:8px}h1{font-size:30px;line-height:1.1;margin:0}h1 br{display:none}.chapter{justify-self:end;gap:8px}.chapter-number{font-size:29px}.chapter h2{font-size:11px;max-width:110px}.eyebrow{font-size:7px}.difficulty{display:none}.sidebar-bottom{display:none}.experiment{min-height:405px}.stage-top{padding:21px 18px 0}.stats{gap:20px}.stats b{font-size:17px}.play-area{padding:27px 12px 13px;min-height:300px}.board{gap:10px;max-width:430px}.tube-button{flex-basis:68px;width:68px;height:181px}.tube-button svg{width:64px;height:148px}.stage-bottom{padding:0 18px 20px}.stage-caption{font-size:7px}.level-track span{width:10px}.level-track span.current{width:19px}.toolbar{gap:8px;justify-content:space-between}.tool{flex:1;min-width:0;height:49px;padding:0 10px;gap:7px;font-size:10px}.tool svg{width:16px}.hint-badge{display:none}footer{margin:0 22px;padding:20px 0;font-size:7px}.footer-right{font-size:7px}.level-grid{grid-template-columns:repeat(6,1fr);gap:7px}dialog{padding:23px}.level-tile{height:55px}.status{font-size:10px}}
@media(max-width:390px){.layout{padding-left:14px;padding-right:14px}.topbar,footer{margin-left:14px;margin-right:14px}h1{font-size:25px}.chapter-number{font-size:24px}.chapter h2{max-width:85px}.board{gap:6px}.tube-button{flex-basis:57px;width:57px;height:165px}.tube-button svg{width:57px;height:132px}.stage-label{font-size:8px}.stage-caption{font-size:6px}.stats{gap:12px}.footer-right{display:none}}
@media(prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* ===== Fit-to-screen layout (YouTube Playables: no page scroll at any size) ===== */
html,body{height:100%}
body{height:100dvh;display:flex;flex-direction:column;overflow:hidden;overscroll-behavior:none}
.topbar{flex:none}
.layout{flex:1;min-height:0;width:100%;grid-template-rows:minmax(0,1fr) auto;padding-top:clamp(14px,4vh,54px);padding-bottom:clamp(12px,3vh,36px)}
.experiment{min-height:0}
.play-area{min-height:0;overflow:hidden;padding-top:clamp(6px,2vh,25px);padding-bottom:clamp(4px,1.5vh,14px)}
.board{padding:0;gap:var(--gap,16px);row-gap:var(--gap,16px)}
.board .tube-button{flex:0 0 var(--tw,88px);width:var(--tw,88px);height:var(--th,218px)}
.board .tube-button svg{width:var(--sw,80px);height:var(--sh,185px)}
.status{margin-top:8px}
footer{flex:none}
@media(max-height:860px){footer{display:none}}
@media(min-width:1400px){.experiment{min-height:0}}
/* phones, portrait */
@media(max-width:760px){
  .topbar{height:56px}
  .layout{padding-top:12px;padding-bottom:14px;gap:12px}
  .edition{display:none}
  .sidebar{gap:10px}
  .experiment{min-height:0;flex:1 1 auto}
  .sidebar,.toolbar{flex:none}
  .stage-top{padding:12px 14px 0}
  .play-area{min-height:0;padding:6px 8px 4px}
  .stage-bottom{padding:0 14px 10px}
  .tube-label{margin-top:4px}
  .eyebrow,.stage-caption{font-size:9px}
  .chapter h2{font-size:13px}
}
@media(max-width:760px) and (max-height:700px){.stage-bottom{display:none}h1{font-size:22px}.chapter-number{font-size:22px}}
/* short landscape (phones held sideways, small embeds) */
@media(orientation:landscape) and (max-height:560px){
  .layout{display:grid}.sidebar{display:flex;flex-direction:column;align-items:flex-start;gap:0}.chapter{justify-self:auto}.tool{flex:none;font-size:12px;padding:0 12px}.chapter h2{max-width:none}
  .topbar{height:52px}.brand{font-size:21px}.brandmark{width:30px;height:30px}
  .layout{grid-template-columns:190px minmax(0,1fr);grid-template-rows:minmax(0,1fr);padding:10px 4% 10px;column-gap:20px}
  .sidebar{grid-row:1;grid-column:1;padding:0}
  h1{font-size:26px;margin:6px 0 14px}h1 br{display:none}
  .edition,.difficulty,.sidebar-bottom,.stage-bottom{display:none}
  .experiment{grid-column:2;grid-row:1}
  .stage-top{padding:10px 16px 0}
  .toolbar{grid-column:1;grid-row:1;align-self:end;flex-direction:column;align-items:stretch;gap:6px}
  .tool{height:38px;min-width:0;justify-content:flex-start}
  .tube-label{margin-top:4px}
}
