@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;600;700;800&display=swap');
:root{color-scheme:light;--paper:#f6f1e7;--card:#fffdf8;--ink:#2a2f3a;--muted:#736c7c;--line:#e2dccd;--plum:#5b3f8f;--amber:#c27f22;--teal:#1f6f78;--gold:#d9a531;--danger:#c23b4c;--fw:64px;--gh:184px;--gap:16px}
*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:'DM Sans',system-ui,sans-serif}
button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;touch-action:manipulation;border:0;color:inherit}button:disabled{cursor:default}
button:focus-visible,a:focus-visible{outline:3px solid var(--plum);outline-offset:3px}a{color:inherit;text-decoration:none}[hidden]{display:none!important}
.sprites{position:absolute;width:0;height:0;overflow:hidden}
.shell{max-width:1220px;margin:auto;padding:24px 38px 44px}
header{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding-bottom:18px}
.brand{font:800 16px 'Manrope',sans-serif;letter-spacing:2px}.brand span{color:var(--amber)}
.utilities{display:flex;gap:8px}.utilities button{padding:9px 13px;border:1px solid var(--line);border-radius:8px;background:transparent;font-size:12px;font-weight:700}.utilities button:disabled{opacity:.45}
.heading{display:flex;align-items:flex-end;justify-content:space-between;margin:34px 0 25px}
.eyebrow{font-size:10px;font-weight:800;letter-spacing:1.8px;margin:0 0 12px;color:var(--plum)}
h1{font:800 clamp(38px,5vw,62px)/1.05 'Manrope',sans-serif;letter-spacing:-3px;margin:0}h1 em{font-style:normal;color:var(--plum)}
.tagline{color:var(--muted);font-size:14px;line-height:1.7;margin:0 0 4px;text-align:right}
.layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:30px}
.brew{border:1px solid var(--line);border-radius:20px;padding:20px;background:var(--card);box-shadow:0 12px 40px #3a2f1a08;min-width:0}
.hud{display:grid;grid-template-columns:1.2fr 1.2fr 1fr .8fr;padding-bottom:15px;border-bottom:1px solid var(--line)}
.hud>div{padding-left:15px;border-left:1px solid var(--line);min-width:0}.hud>div:first-child{padding-left:0;border:0}
.hud small{display:block;color:var(--muted);font-size:9px;letter-spacing:1px;font-weight:700}
.hud strong{display:flex;align-items:center;gap:6px;font:800 23px 'Manrope',sans-serif;margin-top:6px;white-space:nowrap;min-height:30px}
#puzzle{font-size:17px}#pours.over{color:var(--amber)}
.stars{display:block;font-size:11px;letter-spacing:1px;color:var(--gold);margin-top:2px}
.opening{display:flex;align-items:center;gap:14px;background:#efe8f6;padding:18px;border-radius:12px;margin:16px 0}
.sun{font-size:38px;color:var(--plum)}.opening h2{font:800 18px 'Manrope',sans-serif;margin:0 0 6px}.opening p{font-size:12px;line-height:1.5;margin:0;color:#56506a}
.rule-choices{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}.rule-choices button{min-height:44px;padding:8px 10px;border:1px solid #cdbfe2;border-radius:8px;background:#fff8;color:var(--plum);font-size:12px;font-weight:700}.rule-choices button[aria-pressed=true]{background:var(--plum);color:#fff;border-color:var(--plum)}.rule-choices button:disabled{opacity:.65;cursor:default}
.ai-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:10px}.ai-actions button{min-height:44px}.ai-actions .secondary:disabled{opacity:.7}.opening-copy{min-width:0}
.opening-condition{margin-top:8px!important}.opening-ai-note{margin-top:8px!important;color:var(--plum)!important;font-weight:600}.opening-actions{display:flex;gap:8px;margin-left:auto}
.primary,.secondary{padding:12px 15px;font-size:12px;font-weight:800;border-radius:9px;transition:transform .12s}
.primary{background:var(--plum);color:#fff}.secondary{background:#efe8f6;color:var(--plum);border:1px solid #dccfee}
.primary:active,.secondary:active{transform:translateY(2px)}.primary:disabled,.secondary:disabled{opacity:.55}
.text-button{background:none;color:var(--plum);padding:7px;font-size:11px;font-weight:700}.text-button:disabled{opacity:.45}
.day-line{display:flex;justify-content:space-between;gap:10px;font-size:10px;color:var(--muted);padding:12px 0 6px}.day-line span:first-child{color:var(--plum);font-weight:700}
.rule-impact{font-size:11px;color:var(--muted);margin:0 0 12px}.small{font-size:11px;color:var(--muted)}
/* The shelf: flasks are buttons drawn with CSS; the potion shapes come from the inline SVG sprites. */
.stage{position:relative;border-radius:16px;padding:34px 12px 26px;background:#2a2036 url(art/potion-bg.jpg) center bottom/cover no-repeat;box-shadow:inset 0 0 0 1px #ffffff14,0 14px 30px #2a1f3a26;overflow:hidden}
.shelf{display:grid;grid-template-columns:repeat(var(--cols,5),var(--fw));justify-content:center;gap:26px var(--gap);min-height:calc(var(--gh) + 26px)}
.flask{position:relative;display:flex;flex-direction:column;align-items:center;gap:5px;width:var(--fw);min-height:44px;padding:0;background:none;transition:transform .16s ease;transform-origin:50% 85%}
.flask:focus-visible{outline:none}.flask:focus-visible .glass{box-shadow:0 0 0 3px #fff,0 0 0 6px var(--plum)}
.flask .number{font:800 11px 'Manrope',sans-serif;color:#f5ead6;opacity:.8;line-height:1}
.glass{position:relative;display:block;width:100%;height:var(--gh);border:3px solid #f3eee4d9;border-top-width:0;border-radius:4px 4px 26px 26px;background:linear-gradient(90deg,#ffffff24,#ffffff08 40%,#ffffff1a);overflow:hidden;box-shadow:inset -6px 0 0 #ffffff0d}
.glass:before{content:'';position:absolute;z-index:2;top:0;left:-3px;right:-3px;height:7px;border-radius:4px;background:#f3eee4e6}
.glass:after{content:'';position:absolute;z-index:2;top:12px;bottom:18px;left:6px;width:5px;border-radius:5px;background:#ffffff40;pointer-events:none}
.liquid{position:absolute;inset:7px 0 0;display:flex;flex-direction:column-reverse}
.layer{position:relative;flex:0 0 25%;display:grid;place-items:center;background:linear-gradient(90deg,color-mix(in srgb,var(--potion) 82%,#000),var(--potion) 45%,color-mix(in srgb,var(--potion) 88%,#fff));box-shadow:inset 0 2px 0 #00000038}
.layer.joined{box-shadow:none}
.layer .glyph{width:58%;height:58%;max-width:24px;max-height:24px;fill:#fff;stroke:#1d1626;stroke-opacity:.55;stroke-width:1.6;paint-order:stroke;stroke-linejoin:round}
.cork{position:absolute;z-index:3;top:-1px;left:50%;width:56%;height:14px;transform:translateX(-50%);border-radius:3px 3px 5px 5px;background:linear-gradient(#c9905a,#8a5a31);box-shadow:0 2px 0 #0003}
.flask.sealed .glass{border-color:#f2d58ce6}.flask.sealed .glass:before{background:#f2d58c}
.flask.spare .number:after{content:' spare';font-weight:700}
.flask.selected{transform:translateY(-18px)}.flask.selected .glass{border-color:#fff;box-shadow:0 0 0 3px #ffe39a99,0 10px 18px #0006}
.flask.pouring{animation:pour-right .42s ease}.flask.pouring.pour-left{animation-name:pour-left}
.flask.filling .glass{animation:fill .42s ease}
.flask.blocked{animation:shake .32s ease}
@keyframes pour-right{0%{transform:translateY(-18px)}45%{transform:translateY(-26px) rotate(24deg)}100%{transform:none}}
@keyframes pour-left{0%{transform:translateY(-18px)}45%{transform:translateY(-26px) rotate(-24deg)}100%{transform:none}}
@keyframes fill{40%{box-shadow:0 0 0 4px #ffe39a,0 0 22px #ffe39a99}}
@keyframes shake{25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
.shelf[data-phase=ready] .flask,.shelf[data-phase=paused] .flask{opacity:.45;filter:blur(1.5px)}
.shelf[data-phase=won] .flask,.shelf[data-phase=failed] .flask{opacity:.7}
.flask[aria-disabled=true]{cursor:default}
.legend{display:flex;flex-wrap:wrap;gap:6px 14px;list-style:none;margin:12px 0 0;padding:0;font-size:11px;font-weight:700;color:var(--muted)}
.legend li{display:flex;align-items:center;gap:5px}.legend .glyph{width:16px;height:16px;fill:var(--potion);stroke:#2a2f3a;stroke-opacity:.5;stroke-width:1.4;paint-order:stroke}
.tools{display:flex;gap:8px;margin-top:12px}.tools button{flex:1;min-height:44px}
.tools .suggest{background:var(--plum);color:#fff;box-shadow:0 0 0 3px #d8c8f0}
.notice{font-size:12px;line-height:1.5;color:var(--plum);min-height:36px;margin:11px 0}
.controls{font-size:9px;line-height:1.6;color:var(--muted);margin:10px 0 0}
.story-card,.result{background:#f1ecf7;border:1px solid #e0d6ee;padding:22px;border-radius:14px}
.story-card h2,.result h2{font:800 25px/1.25 'Manrope',sans-serif;letter-spacing:-.8px;margin:0 0 12px}
.story-card>p:not(.eyebrow),.result>p{font-size:12px;line-height:1.75;color:#5c566a}
.rule-note{padding:11px;border-left:2px solid #b9a6d8;background:#fff8;font-size:11px;line-height:1.6;color:var(--plum);margin:15px 0}
.story-card .secondary{width:100%;background:var(--plum);color:#fff}.story-card .small{font-size:9px!important;margin-bottom:0}
.result{margin-top:16px;background:#f6ecdc;border-color:#eadbc3}.reflection{padding:12px;border:1px dashed #d6bc98;border-radius:9px}
.reflection small{font-size:8px;letter-spacing:1px;color:#a27950;font-weight:800}.reflection p{font-size:12px;line-height:1.7;margin:7px 0 0}
.result-actions{display:grid;gap:8px;margin-top:16px}
.field-guide{margin:25px 0 20px;padding:0 6px}.field-guide h3{font:800 15px 'Manrope',sans-serif;margin:0 0 12px}.field-guide p{font-size:11px;color:var(--muted);line-height:1.7;margin:8px 0}.field-guide b{color:var(--ink)}
.game-help-links{display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;margin:14px 0}
.game-help-links a,.game-help-links button{display:inline-flex;align-items:center;min-height:44px;padding:0 8px;touch-action:manipulation;background:transparent}
.game-help-links .play-guide-link{color:var(--plum);font-size:14px;text-decoration:underline;text-underline-offset:3px}.catalog{font-size:11px;font-weight:700}
#help-panel{width:min(560px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:0;border:1px solid var(--line);border-radius:16px;background:var(--paper);color:var(--ink);overflow:hidden;box-shadow:0 18px 70px #2a2f3a33}
#help-panel::backdrop{background:#2a2f3a80}
.lab-help{display:flex;flex-direction:column;max-height:calc(100dvh - 24px)}
.help-body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:22px;line-height:1.65;overflow-wrap:anywhere}
.help-body h2{font:800 24px/1.25 'Manrope',sans-serif;margin:0 0 14px}.help-body p,.help-steps{font-size:14px}
.help-state{padding:12px;border-radius:9px;background:#efe8f6;color:var(--plum)}
.help-steps{padding-left:22px}.help-steps li{padding-left:4px;margin:12px 0}.help-body .help-keys{font-size:12px;color:var(--muted)}
.help-full-guide{display:inline-flex;align-items:center;min-height:44px;color:var(--plum);text-decoration:underline;text-underline-offset:3px}
.help-actions{flex:0 0 auto;border-top:1px solid var(--line);padding:14px 22px;background:var(--paper)}.help-actions button{width:100%;min-height:44px;font-size:14px;white-space:normal}
body[data-phase=paused] .brew{border-color:#cdbfe2}body[data-phase=paused] .day-line span:first-child:before{content:'PAUSED · '}
@media(max-width:1100px){:root{--fw:50px;--gh:144px;--gap:10px}}
@media(max-width:900px){.shell{padding:18px 22px 30px}.layout{grid-template-columns:minmax(0,1fr) 250px;gap:18px}.brew{padding:15px}.opening{flex-wrap:wrap}.opening-actions{width:100%;margin-left:0}.opening-actions button{flex:1}.tagline{display:none}:root{--fw:44px;--gh:132px;--gap:8px}}
/* Keep the HUD clear of the mobile sticky header when a round starts or practice continues. */
.brew,.result{scroll-margin-top:76px}
@media(max-width:700px){:root{--fw:52px;--gh:128px;--gap:10px}.shell{padding:12px 12px 24px}header{position:sticky;top:0;z-index:3;background:var(--paper);padding:6px 0 12px}.brand{font-size:13px;letter-spacing:1.2px}.utilities button{padding:8px 10px;font-size:10px;min-height:44px}.heading{margin:21px 5px 18px}.eyebrow{font-size:9px;letter-spacing:1.3px}h1{font-size:38px;letter-spacing:-2px}.layout{display:block}.brew{padding:12px;border-radius:15px}.hud{grid-template-columns:1.15fr 1.1fr 1fr .8fr}.hud>div{padding-left:8px}.hud small{font-size:9px;letter-spacing:.2px}.hud strong{font-size:19px;gap:4px}#score{font-size:16px}#puzzle{font-size:13px}#pours{font-size:16px}.opening{margin:12px 0;padding:13px}.opening .sun{display:none}.opening h2{font-size:16px}.opening p{font-size:12px}.day-line{padding:10px 0 4px}.rule-impact{margin-bottom:10px}.stage{padding:30px 6px 20px}.shelf{row-gap:30px}.notice{font-size:12px}.controls{font-size:10px}aside{margin-top:18px}.help-body{padding:16px}.help-actions{padding:12px 16px}.help-body h2{font-size:22px}button{min-height:44px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important}}
/* Inside the /play/ feed (html.cc-embed, set by play-bridge.js): no site chrome, and the
   opening, HUD and shelf share one screen. The opening sits over the shelf, and flasks
   shrink to the rows the shelf needs (game.mjs sets --rows). */
.cc-embed .brand,.cc-embed .heading,.cc-embed .story-card,.cc-embed .field-guide,.cc-embed .controls,.cc-embed .catalog{display:none}
.cc-embed .shell{position:relative;display:flex;flex-direction:column;height:100vh;height:100dvh;max-width:1220px;padding:8px 12px 10px}
.cc-embed header{position:static;justify-content:flex-end;border:0;padding:0 0 6px;background:none;z-index:auto}
.cc-embed .game-help-links{position:absolute;top:8px;left:12px;margin:0;z-index:3}
.cc-embed .game-help-links .play-guide-link{min-height:44px;padding:0 4px;font-size:0}
.cc-embed .game-help-links .play-guide-link::before{content:'How to play';font-size:12px;font-weight:700}
.cc-embed .layout{flex:1;min-height:0;grid-template-columns:minmax(0,1fr) auto;gap:16px}
.cc-embed aside{min-height:0;overflow:auto}
.cc-embed .brew{display:grid;min-height:0;padding:12px;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto auto minmax(0,1fr) auto auto auto;grid-template-areas:"hud" "line" "status" "impact" "stage" "legend" "tools" "notice"}
.cc-embed .hud{grid-area:hud;padding-bottom:10px}.cc-embed .day-line{grid-area:line;padding:8px 0 2px}.cc-embed #progress-status{grid-area:status;margin:0}
.cc-embed .rule-impact{grid-area:impact;margin:0 0 8px}.cc-embed .legend{grid-area:legend;margin-top:8px}.cc-embed .tools{grid-area:tools;margin-top:8px}.cc-embed .notice{grid-area:notice;margin:6px 0 0;min-height:36px}
.cc-embed .stage{grid-area:stage;display:flex;align-items:center;justify-content:center;min-height:0;padding:22px 8px 10px;container-type:size}
.cc-embed .shelf{min-height:0;row-gap:22px}
.cc-embed .glass{height:clamp(56px,calc((100cqh + 4px) / var(--rows,1) - 38px),var(--gh))}
.cc-embed .opening{grid-area:stage;z-index:2;align-self:center;justify-self:center;flex-wrap:wrap;max-width:520px;max-height:100%;overflow:auto;margin:0 6px;box-shadow:0 10px 34px #1d16288c}
.cc-embed .opening{flex-direction:column;flex-wrap:nowrap;align-items:stretch;overflow:hidden}.cc-embed .opening .sun{display:none}.cc-embed .opening-copy{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}
.cc-embed .opening-actions{flex:0 0 auto;width:100%;margin-left:0}.cc-embed .opening-actions button{flex:1}
.cc-embed .result{display:flex;flex-direction:column;width:280px;margin-top:0}.cc-embed .result>*{margin-top:0}
.cc-embed .result-actions{order:1;margin:0 0 14px}.cc-embed .reflection{order:2}
@media(max-width:700px){
  .cc-embed .shell{padding:6px 8px 8px}.cc-embed .game-help-links{top:10px;left:8px}
  .cc-embed .layout{display:flex;flex-direction:column}.cc-embed .brew{flex:1;min-height:420px;padding:10px}.cc-embed aside{flex:none;margin:0;overflow:visible}
  .cc-embed .result{width:auto;margin-top:10px}
  .cc-embed body:is([data-phase=won],[data-phase=failed]) .result{position:fixed;left:8px;right:8px;bottom:8px;z-index:5;max-height:calc(100dvh - 16px);overflow:auto;margin:0;box-shadow:0 -10px 40px #2a1f3a59}
}
