:root { --agar: #efe6cd; --plate: #f7f1df; --ink: #1a1c10; --green: #6dff12; --deep: #16330a; --husk: #6b6038; --mono: 'Sometype Mono', ui-monospace, Menlo, monospace; --fat: 'Dela Gothic One', 'Arial Black', sans-serif; --pad: clamp(16px, 3vw, 44px); }
* { box-sizing: border-box; margin: 0; }
html { background: var(--agar); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { font: 400 16px/1.45 var(--mono); overflow-x: hidden; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
button { border: 2px solid var(--ink); background: transparent; border-radius: 99px; padding: 6px 16px; min-height: 42px; font-weight: 600; cursor: pointer; }
button:hover { background: var(--plate); } button.go { background: var(--green); } button.go:hover { background: #9bff5c; } button:disabled { opacity: .45; cursor: default; }
.dymo { display: inline-block; background: var(--ink); color: var(--plate); font: 700 1em/1 var(--mono); text-transform: uppercase; letter-spacing: .13em; padding: .42em .5em .42em .62em; border-radius: 3px; }

/* first screen: the plate and the bench */
.lab { display: grid; grid-template-columns: minmax(0, min(57vw, calc(100svh - 40px))) minmax(0, 1fr); gap: clamp(20px, 2.6vw, 44px); padding: 20px var(--pad) 20px 20px; min-height: 100svh; align-items: center; }
.plate { position: relative; aspect-ratio: 1; width: 100%; }
#dish { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.plate.draw #dish { touch-action: none; }
.tag { position: absolute; background: var(--ink); color: var(--plate); padding: 6px 10px; font-size: 14px; line-height: 1.35; pointer-events: none; border-radius: 3px; white-space: pre; z-index: 2; }
.bench { display: flex; flex-direction: column; gap: 11px; min-width: 0; }
h1 { line-height: 0; } #word { width: 100%; height: 100px; display: block; }
.hook { font-size: clamp(19px, 1.8vw, 29px); display: flex; flex-wrap: wrap; gap: 7px; }
.hook .dymo:nth-child(2) { background: var(--green); color: var(--ink); }
.scores { display: grid; grid-template-columns: 1fr 1fr .84fr; gap: 10px; margin-top: 4px; }
.sc { border: 2px solid var(--ink); border-radius: 18px; padding: 10px 14px 10px; min-width: 0; }
.sc b { display: block; --fs: clamp(22px, 2.4vw, 37px); font: 400 var(--fs)/1.15 var(--fat); white-space: nowrap; letter-spacing: -.03em; } .sc span { font-size: 13px; line-height: 1.25; display: block; margin-top: 3px; }
.sc.s { background: var(--green); } .sc.u { background: var(--ink); color: var(--plate); } .sc.h b { --fs: clamp(19px, 2vw, 31px); line-height: 1.44; }
@supports (width: 1cqi) { .sc { container-type: inline-size; } .sc b { font-size: min(var(--fs), calc(100cqi / (var(--n, 5) * .72))); } }
.rule { font-size: 14px; min-height: 4.2em; line-height: 1.4; } .rule b { font-weight: 700; } .rule button { min-height: 0; padding: 0 8px; font-size: 14px; border-width: 1.5px; margin-left: 6px; }
.ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; } .gen { margin-left: auto; font-size: 15px; } .gen b { font: 400 22px/1 var(--fat); margin-left: 4px; }
#play { min-width: 88px; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; } .seg button { border: 0; border-radius: 0; padding: 4px 13px; min-height: 38px; font-size: 15px; } .seg button[aria-pressed=true] { background: var(--ink); color: var(--plate); }
.feed { display: flex; gap: 8px; } .feed input { flex: 1; min-width: 0; border: 2px solid var(--ink); border-radius: 99px; background: var(--plate); padding: 8px 18px; font-size: 16px; } .feed input::placeholder { color: var(--husk); opacity: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 35px; overflow: hidden; } .chips button { min-height: 34px; padding: 2px 12px; font-size: 14px; border-width: 1.5px; font-weight: 500; } .chips button[aria-pressed=true] { background: var(--ink); color: var(--plate); }
.under { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .under > button { min-height: 42px; font-size: 15px; padding: 4px 14px; }
.status { font-size: 14px; min-height: 1.45em; color: #3d3a22; } .status button { min-height: 0; padding: 1px 10px; font-size: 14px; border-width: 1.5px; margin-left: 6px; }
.cost { display: flex; align-items: center; gap: 12px; font-size: 15px; } .cost input { flex: 1; min-width: 0; } .cost output { min-width: 3.6em; text-align: right; font-weight: 700; }
.grow { position: relative; } #grow { width: 100%; height: 128px; display: block; }
input[type=range] { appearance: none; -webkit-appearance: none; height: 34px; background: transparent; cursor: ew-resize; touch-action: pan-y; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: var(--ink); border-radius: 2px; } input[type=range]::-moz-range-track { height: 3px; background: var(--ink); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 22px; margin-top: -10px; border-radius: 50%; border: 3px solid var(--deep); background: radial-gradient(circle at 50% 50%, var(--deep) 0 22%, var(--green) 24%); box-shadow: 0 0 0 3px var(--plate); }
input[type=range]::-moz-range-thumb { width: 30px; height: 18px; border-radius: 50%; border: 3px solid var(--deep); background: radial-gradient(circle at 50% 50%, var(--deep) 0 22%, var(--green) 24%); }

section:not(.lab) { padding: clamp(70px, 10vw, 140px) var(--pad) 0; }
h2 { font-size: clamp(24px, 3.7vw, 56px); margin-bottom: 26px; line-height: 1; }
.film { position: relative; height: clamp(300px, 52vh, 500px); border: 2px solid var(--ink); border-radius: 22px; overflow: hidden; background: var(--plate); } .film canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; cursor: ew-resize; }
#lid { width: 100%; margin-top: 10px; }
.filmsum { display: grid; grid-template-columns: 70fr 30fr; gap: 20px; font-size: 17px; } .filmsum b { font: 400 clamp(26px, 3.6vw, 54px)/1.1 var(--fat); display: block; letter-spacing: -.02em; }
.mem { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 0 clamp(20px, 4vw, 70px); align-items: end; } .mem h2 { grid-column: 1 / -1; }
.scat { position: relative; height: clamp(340px, 62vh, 620px); } .scat canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.big { font-size: clamp(18px, 1.7vw, 25px); line-height: 1.35; } .big b { font: 400 clamp(44px, 6.4vw, 104px)/.95 var(--fat); display: block; letter-spacing: -.03em; margin-top: 18px; } .big b:first-child { margin-top: 0; }
.slides { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(8px, 1.2vw, 20px); }
.slide { display: flex; flex-direction: column; gap: 6px; min-width: 0; } .slide canvas { width: 100%; aspect-ratio: 1; background: var(--plate); border-radius: 50%; border: 2px solid var(--ink); } .slide b { font: 400 clamp(17px, 1.7vw, 25px)/1.1 var(--fat); margin-top: 8px; } .slide p { font-size: 15px; line-height: 1.35; min-height: 2.7em; } .slide button { align-self: flex-start; font-size: 15px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 3vw, 50px); padding-bottom: clamp(70px, 9vw, 130px) !important; } .how canvas { width: 100%; aspect-ratio: 1.12; display: block; } .how figcaption { font-size: clamp(17px, 1.6vw, 23px); line-height: 1.3; font-weight: 600; margin-top: 12px; }
footer { background: var(--ink); color: var(--plate); padding: 40px var(--pad) 48px; display: grid; gap: 14px; } footer p { max-width: 82ch; font-size: 15px; line-height: 1.6; }
footer nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; } footer nav > * { border: 2px solid var(--plate); border-radius: 99px; padding: 6px 18px; min-height: 44px; color: inherit; text-decoration: none; display: inline-flex; align-items: center; font-weight: 600; } footer nav [hidden] { display: none; } footer nav > *:hover { background: var(--green); color: var(--ink); border-color: var(--green); } footer :focus-visible { outline-color: var(--green); }

@media (max-width: 900px) {
  .lab { grid-template-columns: minmax(0, 1fr); padding: 14px 16px 10px; gap: 12px; min-height: 0; } .bench { display: contents; }
  h1 { order: -3; } .hook { order: -2; font-size: clamp(14px, 4.1vw, 24px); gap: 6px; flex-wrap: nowrap; } .hook .dymo { letter-spacing: .06em; white-space: nowrap; } .plate { order: -1; max-width: 620px; margin: 0 auto; }
  .sc { padding: 8px 10px; border-radius: 14px; } .sc b { --fs: clamp(19px, 6vw, 34px); line-height: 1.15 !important; } .sc.h b { --fs: clamp(17px, 5vw, 28px); } .sc span { font-size: 12px; } .scores { gap: 6px; margin: 0; }
  .rule { min-height: 5.8em; font-size: 14px; } .ctl { gap: 8px 6px; } .seg button { padding: 4px 10px; } .gen { font-size: 14px; } .gen b { font-size: 18px; }
  .mem { grid-template-columns: 1fr; gap: 18px; } .scat { height: 380px; } .slides { grid-template-columns: 1fr; gap: 18px; } .slide { display: grid; grid-template-columns: 120px 1fr; gap: 2px 16px; align-items: center; } .slide canvas { grid-row: 1 / 4; } .slide b { margin: 0; font-size: 20px; } .slide p { min-height: 0; } .how { grid-template-columns: 1fr; } .how canvas { max-width: 420px; margin: 0 auto; }
  .filmsum { grid-template-columns: 1fr 1fr; font-size: 14px; } footer nav > * { flex: 1 1 100%; justify-content: center; }
}
