/* DAM IT! — styles. The scene plates and tiles ARE the locked
   reference stills; CSS only lays the interactive layer over them
   in the stills' own positions. One centre axis, no scroll. */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { height:100%; overflow:hidden; background:#07303a; }
body { font-family:"Trebuchet MS","Segoe UI",Verdana,sans-serif; color:#fff7e6; }
button { font-family:inherit; cursor:pointer; border:none; background:none; color:inherit; }
.hidden { display:none !important; }
#app { position:fixed; inset:0; overflow:hidden; }

/* ---------- loading (Live Scene) ---------- */
#loading { position:absolute; inset:0; z-index:40; background:#07303a; overflow:hidden; }
#loadScene { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
#loadShade { position:absolute; inset:0; background:linear-gradient(180deg, rgba(4,32,40,.18), rgba(4,32,40,.42)); }
#loadLogo { position:absolute; left:50%; top:6%; transform:translateX(-50%); width:min(62vw,560px); filter:drop-shadow(0 10px 22px rgba(0,0,0,.45)); }
#loadDam { position:absolute; left:50%; bottom:15.5%; transform:translateX(-50%); display:flex; gap:4px; }
#loadDam .loadLog { width:34px; height:15px; border-radius:8px; background:linear-gradient(180deg,#a9743f,#7c4f26); border:2px solid #5d3a1a; opacity:.25; }
#loadDam .loadLog.set { opacity:1; }
#trough { position:absolute; left:50%; bottom:11%; transform:translateX(-50%); width:min(72vw,620px); height:22px; border:3px solid #5d3a1a; border-radius:10px; background:rgba(24,52,44,.75); overflow:hidden; }
#troughFill { height:100%; width:0%; background:linear-gradient(180deg,#57c8d8,#1d7d96); transition:width .3s ease; }
#loadTip { position:absolute; left:50%; bottom:5.5%; transform:translateX(-50%); width:min(86vw,640px); text-align:center; font-size:clamp(14px,2.4vmin,20px); font-weight:700; color:#ffeec4; text-shadow:0 2px 6px rgba(0,0,0,.8); }
#loadFail { position:absolute; left:50%; bottom:2.2%; transform:translateX(-50%); width:min(86vw,640px); text-align:center; font-size:clamp(12px,2vmin,16px); font-weight:700; color:#ffb1a1; text-shadow:0 2px 6px rgba(0,0,0,.8); }

/* ---------- stage ---------- */
#stageWrap { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:#07303a; overflow:hidden; }
#stageBackdrop { position:absolute; inset:0; background-size:cover; background-position:center; background-repeat:no-repeat; filter:blur(18px) brightness(0.75); transform:scale(1.12); pointer-events:none; }
#stage { position:relative; overflow:hidden; flex:none; box-shadow:0 0 60px rgba(0,0,0,.5); }
#stage.phone { aspect-ratio:1152/2048; }
#stage.desktop { aspect-ratio:2352/1008; }
#scenePlate { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
#stage.shake { animation:stageShake .5s ease-in-out; }
@keyframes stageShake { 0%,100%{transform:translate(0,0)} 20%{transform:translate(-4px,2px)} 40%{transform:translate(4px,-2px)} 60%{transform:translate(-3px,-1px)} 80%{transform:translate(3px,1px)} }

/* grid — phone: exactly over the still's own grid.
   desktop: over the still's board WITH its perspective slant
   (William's correction: the slant is reference, keep it). */
#grid { position:absolute; display:grid; grid-template-columns:repeat(5,1fr); grid-template-rows:repeat(4,1fr); z-index:2; /* CORRECTION PASS: above the ambient scene layers (#riverFlow/#fallsLayer/#pondLife, z-index 1) — a positive-z canvas otherwise PAINTS OVER the z-auto grid (DOM order does not save it), washing every settled tile with water texture. Below #boardWater (z 4): the flood tint over tiles is the declared submerged behaviour. */ }
#stage.phone #grid { left:8.51%; top:35.45%; width:79.86%; height:44.24%; gap:0.55%; }
#stage.desktop #grid { left:23.2%; top:31.5%; width:46%; height:50.00%; gap:0.7%; transform-origin:0 0; /* DESKTOP PLATE v3 / FAN v3: source box 46%x50.00% (bh/bw 1.087) for the repainted plate's taller river window; must match fitStage's box array in game.js. Short-wide now shares this box (the tight fan's tall box retired). DESKTOP FAN v2: source box re-proportioned again (46%x62.48% -> 46%x47.38%, bh/bw 1.358 -> 1.03 — near-square, the anisotropy balance for the low river fan); must match fitStage's box array in game.js. The tight fan's tall box survives under .shortwide below. (DESKTOP FAN PASS had: 62.1%x44.8% -> 46%x62.48%.) */ grid-template-rows:1.92fr 1.52fr 1.13fr 0.92fr; /* E2 iteration 2 (the one sanctioned re-iteration): iteration 1 weights 1.24/1.25/1.09/1.01 rendered 76/96/105/126 permil vs the still's 94/111/117/134 — each weight scaled by target/rendered (1.24*94/76, 1.25*111/96, 1.09*117/105, 1.01*134/126). Iteration 1 numbers are recorded in results-EF.md. */ }
/* COMPOSITE COHERENCE RULING (coordinator): E3 "Seam-Sealed" is NOT merged.
   Its opaque #grid background + gap:0 hides the painted board in the boot/
   attract state, where the overlay grid is empty — E3's own base capture is
   a brown slab with no board (captures/E3-base-desktop.png), and its seam
   metric (0 light px) was measured on that slab. E2 carries Bracket E in the
   composite; E3 is recorded as rejected-at-coherence in the report. */
.cell { position:relative; overflow:hidden; border-radius:4%; }
.cell img { width:100%; height:100%; object-fit:fill; display:block; }
.cell.spinning img { animation:cellDrop .34s ease-in; }
@keyframes cellDrop { 0%{transform:translateY(-46%); filter:blur(2px) brightness(1.25);} 100%{transform:translateY(0); filter:none;} }
.cell.winPulse { z-index:3; }
.cell.winPulse img { animation:winPulse .55s ease-in-out 2; }
@keyframes winPulse { 0%,100%{transform:scale(1);} 50%{transform:scale(1.10); filter:brightness(1.35) drop-shadow(0 0 10px gold);} }
.cell.scatterPulse img { animation:winPulse .5s ease-in-out 3; filter:brightness(1.3) drop-shadow(0 0 12px #ffd75e); }

/* bonus dam overlay — logs stack across the top in-scene */
#damOverlay { position:absolute; pointer-events:none; z-index:5; }
#stage.phone #damOverlay { left:3%; right:3%; top:4.5%; height:26%; }
#stage.desktop #damOverlay { left:2%; right:2%; top:12%; height:14.5%; }
#stage.desktop .damStrip { height:clamp(7px,1.5vmin,12px); }
#stage.desktop #damCount { display:none; } /* fsBadge already carries the log count */
#stage.desktop #fsBadge { top:27.6%; }
#stage.desktop #winBox { top:77.4%; }
#stage.desktop #bannerText { font-size:clamp(26px,5.4vmin,58px); }
#damLogs { position:absolute; left:0; right:0; bottom:0; display:flex; flex-direction:column-reverse; gap:1px; }
.damStrip { height:clamp(10px,2.2vmin,17px); background-image:url("assets/plank.webp"); background-repeat:repeat-x; background-size:auto 100%; background-position:left center; border-radius:4px; box-shadow:0 1px 3px rgba(0,0,0,.35); animation:stripIn .18s ease-out; }
@keyframes stripIn { from { transform:translateY(-6px); opacity:.4; } to { transform:none; opacity:1; } }
#damCount { display:none; /* the fsBadge carries the log count on both viewports */ }

/* flood wave overlay */
#waveOverlay { position:absolute; z-index:6; pointer-events:none; overflow:hidden; opacity:0; }
#stage.phone #waveOverlay { left:0; right:0; top:32%; height:50%; }
#stage.desktop #waveOverlay { left:0; right:0; top:29%; height:54%; }
#waveSheet { position:absolute; left:-5%; right:-5%; bottom:0; height:0%; background:linear-gradient(180deg, rgba(87,200,216,.88), rgba(19,110,134,.94)); clip-path:polygon(0 7px, 12.5% 1px, 25% 6px, 37.5% 0, 50% 7px, 62.5% 1px, 75% 6px, 87.5% 0, 100% 5px, 100% 100%, 0 100%); /* F2: gentle undulating crest — the rising water no longer reads as a straight-edged rectangle (the flat 6px border-top line is gone) */ }
#waveSheet::before { content:""; position:absolute; left:0; right:0; top:0; height:26px; background:url("assets/foam.webp") repeat-x center top / auto 100%; opacity:.92; /* F2: the game's own foam plate as a repeating crest strip on the sheet's top edge (presentation CSS only; artwork byte-identical) */ }
#waveFoam { position:absolute; left:0; width:100%; height:64px; object-fit:cover; opacity:.85; bottom:0; transform:translateY(100%); }

/* flood gauge plaque — sits ON the still's gauge post
   (phone: right post; desktop: centre-top post — as drawn) */
#gaugePlaque { position:absolute; z-index:7; background:linear-gradient(180deg,#7c4f26,#5d3a1a); border:2px solid #3f2712; border-top:3px solid #c9973f; border-bottom:3px solid #c9973f; border-radius:8px; text-align:center; padding:3px 8px; box-shadow:0 4px 10px rgba(0,0,0,.5); min-width:86px; /* F2: brass cap rails top/bottom — the plaque reads as a plate bolted to the post */ }
#stage.phone #gaugePlaque { left:82.5%; right:auto; width:15.5%; top:28.0%; min-width:0; padding:2px 2px; border-top-width:2px; border-bottom-width:2px; /* F2: centred ON the phone post (post x 84.1-96.4%, centre 90.25%; y 25.8-68% — plaque sits on its upper third). V1.2 LAYOUT RESIDUE FIX: the plaque's bottom grazed the grid's top-right corner by 165 px² (plaque bottom 36.49% vs grid top 35.45% at 390x844). Raised 30% -> 28.0% and trimmed vertical padding/borders (~45px -> ~41px tall): the plaque stays ON the post (still its upper third, x untouched) and its bottom now clears the grid top by ~9px at 390x844 — plaque∩grid = 0 in every state. */ }
#stage.desktop #gaugePlaque { left:45.85%; width:8.5%; top:5%; min-width:0; /* F2 + v1.1 RE-GROUND: post re-measured on the locked desktop still by pixel edge-scan (dark-wood column run at y 6-25% of height): post body x 47.9-52.3%, centre 50.1% — the tournament's grounded bbox (x 50.0-56.7%, centre 53.35%) was pulled right, apparently by the post's brass float arm; plaque left = 50.1 - 8.5/2 = 45.85% centres the plaque on the resolved post. Post visible y 1.3-32.7% (above grid). */ }
#gaugeLab { font-size:clamp(8px,1.3vmin,11px); font-weight:800; letter-spacing:.08em; color:#ffd98f; }
#gaugeVal { font-size:clamp(13px,2.4vmin,22px); font-weight:900; color:#fff3cf; font-variant-numeric:tabular-nums; white-space:nowrap; }

#fsBadge { position:absolute; z-index:7; left:50%; transform:translateX(-50%); background:linear-gradient(180deg,#0f6d84,#0a4c5e); border:2px solid #ffe1a0; color:#fff3cf; font-weight:900; padding:4px 16px; border-radius:14px; font-size:clamp(12px,2.2vmin,18px); box-shadow:0 4px 12px rgba(0,0,0,.5); white-space:nowrap; }
#stage.phone #fsBadge { top:32.4%; }
#stage.desktop #fsBadge { top:24%; }

#banner { position:absolute; z-index:8; left:50%; top:44%; transform:translate(-50%,-50%); text-align:center; pointer-events:none; width:94%; }
#bannerText { font-size:clamp(30px,8.5vmin,84px); font-weight:900; letter-spacing:.02em; line-height:1.06; color:#ffedb8; text-shadow:0 3px 0 #b4762a, 0 6px 0 rgba(31,90,104,.9), 0 12px 26px rgba(0,0,0,.65); }
#bannerSub { font-size:clamp(15px,3.4vmin,30px); font-weight:900; color:#fff7e6; text-shadow:0 2px 8px rgba(0,0,0,.85); margin-top:4px; }

/* dock controls — laid over the still's own dock bar */
.dockCtl { position:absolute; z-index:9; text-align:center; }
.ctlLab { font-size:clamp(9px,1.5vmin,13px); font-weight:800; letter-spacing:.09em; color:#3a2410; text-shadow:0 1px 0 rgba(255,238,196,.55); }
.ctlVal { font-weight:900; color:#2c1c0c; font-variant-numeric:tabular-nums; white-space:nowrap; text-shadow:0 1px 0 rgba(255,238,196,.5); }
#stage.phone #balBox { left:6.5%; top:80.5%; width:19%; }
#stage.desktop #balBox { left:3.2%; top:83.5%; width:17%; }
#balVal { font-size:clamp(13px,2.6vmin,24px); background:rgba(255,246,220,.82); border-radius:8px; padding:1px 4px; box-shadow:inset 0 1px 3px rgba(90,60,20,.5); }
#stage.phone #betBox { left:30.2%; top:85.2%; width:33.6%; }
#stage.desktop #betBox { left:40.5%; top:85%; width:35%; }
#betBox { display:flex; align-items:center; justify-content:center; gap:4px; }
#betMid { flex:1 1 auto; min-width:0; }
#betVal { font-size:clamp(14px,3vmin,27px); background:rgba(255,246,220,.88); border-radius:8px; padding:1px 4px; box-shadow:inset 0 1px 3px rgba(90,60,20,.5); overflow:hidden; }
.cleat { flex:none; width:clamp(26px,5.4vmin,44px); height:clamp(26px,5.4vmin,44px); border-radius:50%; background:radial-gradient(circle at 35% 30%, #d9dde2, #8d949c 60%, #5f666e); color:#22262b; font-size:clamp(16px,3.4vmin,26px); font-weight:900; box-shadow:0 3px 6px rgba(0,0,0,.45), inset 0 1px 2px rgba(255,255,255,.7); }
.cleat:active { transform:translateY(1px); }
/* desktop bar: readouts sit IN the pier's materials — recessed dark
   wood insets with cream figures, as the desktop still's bar reads */
#stage.desktop .ctlLab { color:#ffe9bd; text-shadow:0 1px 2px rgba(0,0,0,.75); }
#stage.desktop #balVal, #stage.desktop #betVal { background:linear-gradient(180deg,#241605,#3a2410); color:#ffeec4; text-shadow:0 1px 1px rgba(0,0,0,.8); box-shadow:inset 0 2px 6px rgba(0,0,0,.85), 0 1px 0 rgba(255,225,160,.18); border:1px solid rgba(30,18,6,.9); }
#stage.phone #winBox { left:30.2%; top:80.5%; width:33.6%; }
#stage.desktop #winBox { left:22.5%; top:85%; width:16%; }
#winVal { font-size:clamp(13px,2.6vmin,24px); color:#ffe9a8; text-shadow:0 2px 4px rgba(0,0,0,.75); min-height:1.2em; }

#spinBtn { position:absolute; z-index:10; border-radius:50%; display:flex; align-items:center; justify-content:center; background:radial-gradient(circle at 38% 32%, rgba(255,225,160,.28), rgba(0,0,0,0) 55%); }
#stage.phone #spinBtn { left:70.5%; top:72.8%; width:28%; aspect-ratio:1; }
#stage.desktop #spinBtn { left:86.2%; top:66.5%; width:13.4%; aspect-ratio:1; }
#spinLab { font-weight:900; color:#ffe9b0; font-size:clamp(15px,3.6vmin,30px); letter-spacing:.05em; text-shadow:0 2px 0 #7c4a16, 0 4px 10px rgba(0,0,0,.6); opacity:0; transition:opacity .2s; }
#spinBtn:hover #spinLab, #spinBtn:focus-visible #spinLab { opacity:1; }
#spinBtn:disabled { filter:saturate(.4) brightness(.75); }
#spinBtn:not(:disabled):active { transform:scale(.965); }

#propRow { position:absolute; z-index:9; display:flex; gap:6px; flex-wrap:nowrap; }
#stage.phone #propRow { left:2%; bottom:1.1%; right:2%; justify-content:center; gap:4px; }
#stage.phone .propChip { font-size:clamp(8px,1.45vmin,11px); padding:4px 6px; }
#stage.desktop #propRow { left:2.5%; bottom:2%; }
.propChip { background:linear-gradient(180deg,#8a5a2b,#6e4423); border:2px solid #4c2f16; color:#ffeec4; font-weight:800; font-size:clamp(9px,1.7vmin,14px); padding:5px 9px; border-radius:9px; letter-spacing:.03em; box-shadow:0 3px 6px rgba(0,0,0,.4); white-space:nowrap; }
.propChip.gold { background:linear-gradient(180deg,#c99b3f,#a4762a); border-color:#6e4d16; color:#fff6d8; }
.propChip.on { background:linear-gradient(180deg,#1d8aa5,#0f6d84); border-color:#ffe1a0; color:#fff; }
.propChip:disabled { opacity:.45; }

#demoTag { position:absolute; z-index:9; top:8px; left:8px; background:rgba(10,40,50,.8); border:1px solid #ffd98f; color:#ffd98f; font-weight:800; font-size:11px; padding:2px 8px; border-radius:8px; letter-spacing:.08em; }

/* ---------- modals ---------- */
.modal { position:absolute; inset:0; z-index:30; background:rgba(4,26,34,.72); display:flex; align-items:center; justify-content:center; padding:12px; }
.panel { background:linear-gradient(180deg,#a9743f,#8a5a2b); border:3px solid #5d3a1a; border-radius:16px; width:min(680px,96vw); max-height:92vh; overflow:auto; padding:10px 12px; box-shadow:0 18px 50px rgba(0,0,0,.6); color:#fff3d6; }
.panel.small { width:min(440px,94vw); text-align:center; font-size:clamp(14px,2.4vmin,18px); line-height:1.45; }
.panelHead { display:flex; align-items:flex-start; justify-content:space-between; }
#menuLogo { width:104px; max-width:40%; }
.xBtn { font-size:20px; color:#ffeec4; background:rgba(0,0,0,.25); border-radius:8px; width:36px; height:36px; }
.tabs { display:flex; gap:6px; margin:6px 0; }
.tabBtn { flex:1; padding:6px 4px; border-radius:9px; background:rgba(0,0,0,.28); color:#ffe9bd; font-weight:800; font-size:clamp(11px,2vmin,15px); }
.tabBtn.on { background:#0f6d84; color:#fff; }
#tabBody { font-size:clamp(11.5px,2.1vmin,15.5px); line-height:1.32; }
#tabBody p { margin-bottom:5px; }
#tabBody table { width:100%; border-collapse:collapse; margin:4px 0 8px; }
#tabBody td, #tabBody th { padding:2px 6px; border-bottom:1px solid rgba(255,238,196,.25); text-align:left; font-variant-numeric:tabular-nums; }
#tabBody td:not(:first-child), #tabBody th:not(:first-child) { text-align:right; }
.sliders { display:flex; gap:14px; flex-wrap:wrap; margin-top:7px; }
.sliders label { flex:1; min-width:130px; font-weight:800; font-size:12px; letter-spacing:.05em; }
.sliders input { width:100%; accent-color:#0f6d84; }
#legalNote { margin-top:7px; font-size:9.5px; line-height:1.3; color:rgba(255,243,214,.85); }
.confirmRow { display:flex; gap:10px; margin-top:14px; }
.bigBtn { flex:1; padding:12px; border-radius:11px; background:#0f6d84; color:#fff; font-weight:900; font-size:16px; box-shadow:0 4px 10px rgba(0,0,0,.35); }
.bigBtn.alt { background:rgba(0,0,0,.3); color:#ffeec4; }
#confirmBody b { color:#ffd98f; }
.fitNow { display:inline-block; }

#toast { position:absolute; z-index:50; left:50%; bottom:6%; transform:translateX(-50%); background:rgba(64,18,8,.92); border:2px solid #ff9d7a; color:#ffe2d6; font-weight:800; padding:10px 18px; border-radius:12px; font-size:clamp(12px,2.2vmin,16px); max-width:92vw; text-align:center; box-shadow:0 10px 30px rgba(0,0,0,.55); }

/* ===== COMPOSITE: A2 toast-in-stage override ===== */
#toast { position:absolute; z-index:50; left:50%; bottom:12%; transform:translateX(-50%); background:rgba(64,18,8,.92); border:2px solid #ff9d7a; color:#ffe2d6; font-weight:800; padding:10px 18px; border-radius:12px; font-size:clamp(12px,2.2vmin,16px); max-width:92%; text-align:center; box-shadow:0 10px 30px rgba(0,0,0,.55); }

/* ---------- B2 "Tray Law" ----------
   Phone: bet sits IN the tray (stage-rel x 30.2-63.8%, y 83.5-90.9%,
   centred at 85.2%); WIN is a dark-wood inset on the dock directly
   above the tray, clear of the grid (top 80.5% vs grid bottom 79.5%);
   balance narrows onto the gauge face (left 6.5%, width 19%).
   ALL phone readouts are dark-wood insets with cream figures,
   matching desktop. Desktop: WIN leaves the bet plaque for its own
   inset on the free pier segment between balance and bet
   (left 22.5%, width 16%, aligned with the bet row at top 85%);
   the BET label moves fully inside the inset block — label and
   value now share one recessed block (#betMid), no rim straddle. */
#stage.phone .ctlLab { color:#ffe9bd; text-shadow:0 1px 2px rgba(0,0,0,.75); }
#stage.phone #balVal, #stage.phone #betVal { background:linear-gradient(180deg,#241605,#3a2410); color:#ffeec4; text-shadow:0 1px 1px rgba(0,0,0,.8); box-shadow:inset 0 2px 6px rgba(0,0,0,.85), 0 1px 0 rgba(255,225,160,.18); border:1px solid rgba(30,18,6,.9); }
#stage.phone #winBox { display:flex; align-items:center; justify-content:center; gap:8px; background:linear-gradient(180deg,#241605,#3a2410); border:1px solid rgba(30,18,6,.9); border-radius:8px; box-shadow:inset 0 2px 6px rgba(0,0,0,.85), 0 1px 0 rgba(255,225,160,.18); padding:1px 8px; }
#stage.phone #winVal { color:#ffeec4; min-height:0; }
#stage.desktop #winBox { background:linear-gradient(180deg,#241605,#3a2410); border:1px solid rgba(30,18,6,.9); border-radius:8px; box-shadow:inset 0 2px 6px rgba(0,0,0,.85), 0 1px 0 rgba(255,225,160,.18); padding:0 6px; }
#stage.desktop #winVal { color:#ffeec4; }
#stage.desktop #betMid { background:linear-gradient(180deg,#241605,#3a2410); border:1px solid rgba(30,18,6,.9); border-radius:8px; box-shadow:inset 0 2px 6px rgba(0,0,0,.85), 0 1px 0 rgba(255,225,160,.18); padding:0 6px; }
#stage.desktop #betVal { background:transparent; border:none; box-shadow:none; padding:0 2px; }

/* === FIX TOURNAMENT C3 "Disc Ring + Brass Cleats" === */
/* C-D1: ghost SPIN suppressed in all states, as C2 — but the button keeps
   its v1 size/position (hit area unchanged). */
/* DETAIL TOURNAMENT — WILLIAM'S RULING (Studio playtest of v1.1):
   "What is with the circle on the spin? It doesn't need to be there."
   The C3 gold ring (hover/focus/active box-shadow) is REMOVED — the
   composite ships the bare disc. The press feedback that remains is
   the base rule's :active scale(.965); ghost-SPIN suppression stays. */
#spinLab { display:none !important; opacity:0 !important; }
/* C-D2: cleats restyled from grey metal to brass gears (brass radial,
   darker rim, gear-tooth ring via dashed outline offset). */
.cleat { background:radial-gradient(circle at 35% 30%, #e8c56a, #b98a34 58%, #7c5a1c); color:#2c1c0c; border:2px solid #5d4315; box-shadow:0 3px 6px rgba(0,0,0,.45), inset 0 1px 2px rgba(255,246,200,.8), inset 0 -2px 4px rgba(60,38,8,.55); outline:2px dashed rgba(93,67,21,.55); outline-offset:2px; }
/* Desktop ONLY: shift each cleat exactly onto the plate's painted gear
   glyph so each -/+ appears ONCE. Measured on v1control-base-desktop:
   painted minus centre 39.3% stage-w vs cleat centre 42.0% (-40px);
   painted plus centre 76.7% vs cleat centre 73.9% (+39px). Relative
   positioning shifts the visual only; flex layout/hit flow unchanged. */
#stage.desktop #betMinus { position:relative; left:-40px; }
#stage.desktop #betPlus { position:relative; left:39px; }

/* === FIX TOURNAMENT C3 === */
/* C-D3: "on" chips join the brass/gold family (same gradient as .gold),
   with a warm lit glow so ON still reads as ON — no cyan anywhere. */
.propChip.on { background:linear-gradient(180deg,#c99b3f,#a4762a); border-color:#6e4d16; color:#fff6d8; box-shadow:0 3px 6px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,240,190,.55), 0 0 10px rgba(255,200,80,.45); }

/* === FIX TOURNAMENT D2 "Built Dam" === */

/* D-D2: fsBadge becomes a wooden sign in the scene's own materials —
   wood gradient like the .propChip base, cream text, wood border.
   The cyan #1d8aa5 family is gone from the badge. */
#fsBadge { background:linear-gradient(180deg,#8a5a2b,#6e4423); border:2px solid #4c2f16; color:#ffeec4; border-radius:10px; box-shadow:0 4px 12px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,238,196,.35); }

/* Dam zone clipped to the stills' dam: phone insets 6% (was 3%);
   desktop top 10.5%, insets 4%, and the overlay's bottom edge sits at
   the grid's top edge (10.5% + 21% = 31.5% = desktop grid top). */
#stage.phone #damOverlay { left:6%; right:6%; }
#stage.desktop #damOverlay { left:4%; right:4%; top:10.5%; height:21%; }
/* Desktop strips hang from the fence line at the TOP of the dam zone
   and build downward, so the badge at top 25.8% hangs in clear space
   between the built dam's lower edge and the grid top (31.5%) with
   zero badge/strip overlap at every log count. Phone keeps v1's
   bottom-anchored stacking on the painted dam (badge below overlay). */
#stage.desktop #damLogs { bottom:auto; top:0; flex-direction:column; }
/* Built-dam rows: flex rows of individual log segments (plank.webp
   crop per segment), filling centre-out (justify-content:center);
   the row element keeps the .damStrip class for measurement. */
.damRow { background:none; box-shadow:none; animation:stripIn .18s ease-out; display:flex; justify-content:center; align-items:flex-end; gap:2px; }
.damSeg { flex:none; width:64px; height:100%; background-image:url("assets/plank.webp"); background-size:auto 100%; background-position:left center; border-radius:5px; box-shadow:inset 0 0 0 1px rgba(46,26,8,.65), 0 1px 2px rgba(0,0,0,.35); }
#stage.phone .damSeg { width:46px; }
.damSeg:nth-child(odd) { transform:translateY(.5px) rotate(.45deg); }
.damSeg:nth-child(even) { transform:translateY(-.5px) rotate(-.45deg); }
.damSeg:nth-child(3n) { transform:translateY(1px) rotate(.2deg); }
/* Wooden sign hung below the dam, in the gap above the grid. */
#stage.phone #fsBadge { top:30.8%; }
#stage.desktop #fsBadge { top:25.8%; }

/* ===== COMPOSITE MERGE (coordinator): C2 disc-exact SPIN geometry =====
   C3 wins Bracket C on the panel split + severity (it also kills the
   duplicate cleats); C2's disc-fitted button geometry is merged here
   as the CD report recommends — final #spinBtn positions: */
#stage.phone #spinBtn { left:68.0%; top:78.6%; width:29.2%; }
#stage.desktop #spinBtn { left:83.4%; top:69.0%; width:13.4%; }

/* ===== DETAIL TOURNAMENT B2-2A "Grout Shadow" =====
   Desktop only; geometry untouched (no trap/row/gap change).
   Each cell carries a soft inset grout shadow ABOVE the tile
   (::after, pointer-events none) so internal boundaries read as
   dark painted grout instead of light leaks. In the pre-deal /
   attract state the shadow is only an edge vignette: the painted
   board stays visible through every cell centre (no cover, no
   background on #grid — the E3 slab failure is not repeated). */
#stage.desktop .cell::after { content:""; position:absolute; inset:0; z-index:2; pointer-events:none; border-radius:inherit;
  box-shadow: inset 0 0 0 2px rgba(38,24,10,.55), inset 0 0 16px rgba(24,14,4,.45), inset 0 0 3px rgba(20,12,4,.6); }

/* ===== DETAIL TOURNAMENT B3-3B "Foam Breakup" =====
   The body gains foam-derived turbulence from the shipped
   foam.webp only: a repeating foam speckle layer (::after)
   whose mask density increases toward the crest (top) and
   fades with depth, screen-blended at low opacity. The front
   sheet's gradient, height mapping and crest (::before,
   z-index 2, above the speckle) are the incumbent's, untouched. */
#waveSheet::after { content:""; position:absolute; inset:0; z-index:1; pointer-events:none;
  background-image:url("assets/foam.webp"); background-repeat:repeat; background-size:150px auto; background-position:center 18%;
  opacity:.30; mix-blend-mode:screen;
  -webkit-mask-image:linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 42%, rgba(0,0,0,.10) 100%);
  mask-image:linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 42%, rgba(0,0,0,.10) 100%); }
#waveSheet::before { z-index:2; }

/* ===== DETAIL TOURNAMENT B1-1B "Gauge Dial" =====
   Desktop only: no separate box over the glass. The balance becomes
   the gauge's own counter window, set into the brass dial's lower
   segment directly under the dial's PAINTED "BALANCE" word (so the
   HTML label is retired on desktop -- the painted label serves).
   Cream glass window + brass rim + engraved dark digits: the dial's
   own materials. Window x 3.7-14.1% sits inside the defined gauge
   face (3.4-14.2%); bottom 92.7% clears the prop-chip row (93.0%). */
#stage.desktop #balBox { left:3.3%; top:89.4%; width:11.2%; }
#stage.desktop #balLab { display:none; }
#stage.desktop #balVal { background:linear-gradient(180deg,#fdf6dc,#eee0b6); color:#2c1c0c; border:1.5px solid #8a6420; border-radius:5px; box-shadow:inset 0 1px 3px rgba(90,60,20,.55), 0 1px 0 rgba(255,240,190,.45); font-size:15px; padding:0 3px; margin:0 6px; text-shadow:none; }

/* ===== DETAIL TOURNAMENT B4-4A "Shifted Sign" =====
   Phone only: the wooden sign shifts left on its centre anchor
   (50% -> 41%) so its right tip clears the gauge plaque's left edge
   by >=8px even at the maximum badge string. Vertical position is
   unchanged, so badge/dam and badge/grid geometry is untouched.
   Desktop unchanged (its badge never grazes the plaque: no y overlap). */
#stage.phone #fsBadge { left:41%; }

/* ===== DETAIL TOURNAMENT B5-5B "Inset System Panel" =====
   The panel is rebuilt from the dock bar's own language: the same
   dark-wood inset gradient (#241605 -> #3a2410), the same inset
   shadow, the same brass family as the bar's .gold chips -- one
   materials system with the dock bar. The logo is mounted
   in a matching dark inset with a brass hairline so its baked teal
   backing reads as a plate set into the inset. No size, spacing or
   font changes: fit cannot regress.
   SCOPE CUT (parent note, HUD tournament): this variant is confined
   to the panel body and the logo mount. An earlier cut also
   restyled the panel's tab buttons, volume sliders and the confirm
   modal's buttons; those rules are REMOVED -- buttons and toggles
   belong to the dedicated HUD tournament, whose winner will govern
   them in v1.2 alongside this bracket's winner. */
.panel { background:linear-gradient(180deg,#241605,#3a2410); border:2px solid #c9973f; box-shadow:inset 0 2px 8px rgba(0,0,0,.85), 0 18px 50px rgba(0,0,0,.6), 0 1px 0 rgba(255,225,160,.18); color:#ffeec4; }
#menuLogo { background:linear-gradient(180deg,#1a0f04,#2c1c0c); border:1px solid rgba(201,151,63,.85); border-radius:8px; padding:5px 8px; box-shadow:inset 0 2px 6px rgba(0,0,0,.85), 0 1px 0 rgba(255,225,160,.15); }

/* ===== GAUGE BRACKET G1 "The Gauge Is The Dam" =====
   The D2 segment row is gone. A brass collar-float rides the painted
   gauge post itself: desktop it collars the post body below the plaque
   (scale centre 24.5% at 0 logs to 14.8% at the 53-log cap threshold,
   clear of plaque above and badge below); phone it rides the post's
   exposed outer edge (centre 66% at 0 to 38% at 53), right of the grid's
   88.37% edge, so it never touches a tile. The exact count is always the
   plaque number — the float is position, never the only readout. */
#gaugeFloat { position:absolute; z-index:8; pointer-events:none; transform:translateY(-50%); border-radius:5px; background:radial-gradient(circle at 35% 30%, #f0d179, #c99b3f 55%, #7c5a1c); border:2px solid #5d4315; box-shadow:0 2px 5px rgba(0,0,0,.55), inset 0 1px 2px rgba(255,246,200,.85), inset 0 -2px 3px rgba(60,38,8,.6); transition:top .38s ease; }
#gaugeFloat::before, #gaugeFloat::after { content:""; position:absolute; top:50%; width:5px; height:5px; border-radius:50%; background:#3a2410; transform:translateY(-50%); box-shadow:inset 0 1px 1px rgba(255,240,190,.7); }
#gaugeFloat::before { left:3px; }
#gaugeFloat::after { right:3px; }
#stage.desktop #gaugeFloat { left:46.9%; width:6.4%; height:1.9%; top:24.5%; }
#stage.phone #gaugeFloat { left:89.3%; width:7.1%; height:1.7%; top:66%; }

/* ===== HUD TOURNAMENT H2 — "BRASS WORKS" =====
   ONE finish system: aged brass, the same metal as the flood-gauge
   plaque and the bet cleats that already live in the scene. Every
   control is a riveted brass plate with engraved lettering; readout
   windows are dark glass inset in brass frames. ON = polished and
   lit. BUY = the deep-gold plate. Nothing else is introduced. */
/* SPIN ring removed per William's ruling (all entrants) */
#spinBtn:hover, #spinBtn:focus-visible { box-shadow:none; outline:none; filter:brightness(1.08); }
#spinBtn:not(:disabled):active { box-shadow:none; filter:brightness(.93); }

/* chips -> riveted brass plates */
#stage .propChip { position:relative; background:linear-gradient(180deg,#dcb968,#bb9038 55%,#9a742a); border:2px solid #6e4d16; border-radius:7px; color:#33200a; font-weight:900; letter-spacing:.04em; text-shadow:0 1px 0 rgba(255,242,196,.55); box-shadow:0 3px 6px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,246,200,.75), inset 0 -2px 4px rgba(84,58,14,.55); padding-left:13px; padding-right:13px; }
#stage .propChip::before, #stage .propChip::after { content:""; position:absolute; top:50%; width:5px; height:5px; border-radius:50%; transform:translateY(-50%); background:radial-gradient(circle at 35% 30%, #f4e2a0, #8a6524 70%, #5d4315); box-shadow:inset 0 -1px 1px rgba(0,0,0,.5); }
#stage .propChip::before { left:4px; }
#stage .propChip::after { right:4px; }
#stage .propChip:active { transform:translateY(1px); }
#stage .propChip.gold { background:linear-gradient(180deg,#f0d078,#d3a83e 55%,#b3862c); border-color:#7c5a1c; color:#2b1a05; }
#stage .propChip.on { background:linear-gradient(180deg,#f6dc8a,#e3bc52 55%,#c79c34); color:#241703; box-shadow:0 3px 6px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,250,214,.9), inset 0 -2px 4px rgba(84,58,14,.5), 0 0 12px rgba(255,205,85,.55); }
#stage .propChip:disabled { opacity:.45; }

/* readouts -> brass-framed dark windows (the gauge plaque's family) */
#stage.phone #balVal, #stage.phone #betVal, #stage.desktop #balVal, #stage.desktop #betVal { background:linear-gradient(180deg,#1d1103,#2e1c07); border:2px solid #8a6524; color:#ffeec4; text-shadow:0 1px 1px rgba(0,0,0,.85); box-shadow:inset 0 2px 7px rgba(0,0,0,.9), 0 1px 0 rgba(255,225,160,.25); border-radius:7px; }
#stage.phone #winBox, #stage.desktop #winBox { background:linear-gradient(180deg,#1d1103,#2e1c07); border:2px solid #8a6524; box-shadow:inset 0 2px 7px rgba(0,0,0,.9), 0 1px 0 rgba(255,225,160,.25); border-radius:7px; }
#stage.desktop #betMid { background:linear-gradient(180deg,#1d1103,#2e1c07); border:2px solid #8a6524; box-shadow:inset 0 2px 7px rgba(0,0,0,.9), 0 1px 0 rgba(255,225,160,.25); border-radius:7px; }
#stage.desktop #betVal { background:transparent; border:none; box-shadow:none; }
#stage.phone #winVal, #stage.desktop #winVal { color:#ffeec4; }
/* labels -> stamped brass */
#stage.phone .ctlLab { color:#5d4315; text-shadow:0 1px 0 rgba(255,238,196,.55); letter-spacing:.12em; }
#stage.desktop .ctlLab { color:#e8c56a; text-shadow:0 1px 2px rgba(0,0,0,.8); letter-spacing:.12em; }

/* cleats: already brass gears — harmonised (dashed tooth ring kept,
   it is the same metal's machining) */
/* bonus badge -> brass plate sign */
#stage #fsBadge { background:linear-gradient(180deg,#dcb968,#bb9038 55%,#9a742a); border:2px solid #6e4d16; color:#33200a; text-shadow:0 1px 0 rgba(255,242,196,.55); box-shadow:0 4px 12px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,246,200,.75); border-radius:8px; }

/* menu panel -> wood bound in brass, brass furniture */
.modal .panel { border:3px solid #8a6524; box-shadow:0 18px 50px rgba(0,0,0,.6), inset 0 0 0 2px rgba(255,225,160,.25); }
.modal .tabBtn { background:linear-gradient(180deg,#c8a452,#a97f31); color:#33200a; text-shadow:0 1px 0 rgba(255,242,196,.5); box-shadow:inset 0 1px 0 rgba(255,246,200,.7), 0 2px 4px rgba(0,0,0,.3); border-radius:7px; }
.modal .tabBtn.on { background:linear-gradient(180deg,#f6dc8a,#e3bc52); color:#241703; box-shadow:0 0 10px rgba(255,205,85,.5), inset 0 1px 0 rgba(255,250,214,.9); }
.modal .bigBtn { background:linear-gradient(180deg,#dcb968,#b3862c); color:#2b1a05; text-shadow:0 1px 0 rgba(255,242,196,.55); box-shadow:0 4px 10px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,246,200,.8); border-radius:8px; }
.modal .bigBtn.alt { background:linear-gradient(180deg,#8a6524,#6e4d16); color:#ffeec4; text-shadow:0 1px 1px rgba(0,0,0,.6); }
.modal .xBtn { background:linear-gradient(180deg,#c8a452,#a97f31); color:#33200a; border-radius:7px; }
/* H2 patch: restate betMid frame cleanly */
#stage.desktop #betMid { border:2px solid #8a6524; }

/* ===== V1.2 CORE MERGE — H2 REMEDIES + CASCADE RESOLUTIONS =====
   (build-v12 Wave 1 / Workstream A — see build-v12/merge-notes.md)
   REMEDY 1 (from hud-tournament-v1/report.md, winner's weakness #1,
   remedy proven by runner-up H5's spacing budget): on PHONE ONLY the
   brass plates' rivet side-padding drops 13px -> 7px. The rivets stay;
   the plate narrows. H5's numbers project the phone max-bet row spill
   from 9.3px/side (rims only) to <=1px, and a clean social-mode fit. */
#stage.phone .propChip { padding-left:5px; padding-right:5px; }
#stage.phone .propChip::before { left:2px; }
#stage.phone .propChip::after { right:2px; }
#stage.phone #propRow { gap:2px; }
/* REMEDY 1 MEASURED CORRECTION (see merge-notes.md): the remedy as
   written assumed H2's 13px governed on phone; it never did — the
   v1.1 phone rule (specificity 1,2,0, padding 4px 6px) outranks H2's
   #stage .propChip (1,1,0), so H2's captures rendered at 6px and
   still spilled 9.3px/side at max bet. Setting 7px in the merge
   widened the row (+12px) and spill grew to 15.2px/side at $500 —
   verified live. The target (<=1px) is met by the budget above:
   padding 6px -> 5px (text starts at 2px border + 5px = 7px, rivets
   tucked to span 2-7px so lettering still clears them) and the phone
   row gap 4px -> 2px. Desktop plates keep H2's 13px untouched. */

/* REMEDY 2 + 1B PROTECTION (winner's weakness #2, and the merge's one
   head-on cascade collision): H2's readout rule above paints the
   DESKTOP balance value dark glass — but the detail tournament's
   B1-1B "Gauge Dial" owns that exact element in v1.2: on desktop the
   balance lives in the brass dial's own cream counter window under
   its painted BALANCE word, and 1B must survive. So:
   (a) the desktop BALANCE readout gets the remedy's DARK BACKING CHIP:
       #balBox itself becomes a dark-glass chip in a brass frame
       (background + inset ring only — no border/padding/layout change,
       so 1B's measured balBox rect (48,693) 161x19 at 1440x900 is
       untouched and the painted dial face behind the label zone is no
       longer the label's ground);
   (b) 1B's cream counter window is RE-ASSERTED for #balVal after H2,
       so the value still reads dark-on-cream (~12:1) inside the chip.
   The HTML BALANCE label stays retired on desktop per 1B (the dial's
   painted word serves); every other desktop/phone readout is H2 dark
   glass exactly as the HUD tournament shipped it. */
#stage.desktop #balBox { background:linear-gradient(180deg,#1d1103,#2e1c07); border-radius:7px; box-shadow:inset 0 0 0 2px #8a6524, inset 0 2px 7px rgba(0,0,0,.9), 0 1px 0 rgba(255,225,160,.25); }
#stage.desktop #balVal { background:linear-gradient(180deg,#fdf6dc,#eee0b6); color:#2c1c0c; border:1.5px solid #8a6420; border-radius:5px; box-shadow:inset 0 1px 3px rgba(90,60,20,.55), 0 1px 0 rgba(255,240,190,.45); text-shadow:none; }

/* PANEL RESOLUTION (build law: panels stay 5B UNDER the brass system):
   B5-5B's panel BODY stands — its dark-wood inset gradient background,
   its text colour and the #menuLogo enamel-plate mount are NOT touched
   by anything above (no rule here or in H2 sets .panel background).
   What H2's .modal .panel rule adapts is the panel's ACCENT HARDWARE
   only: the rim becomes the brass system's 3px #8a6524 frame with its
   inset hairline (higher specificity .modal .panel beats 5B's .panel
   border) — 5B layout/inventory on brass hardware, one finish system.
   The buttons that sit on the panel (tabBtn / bigBtn / xBtn) are the
   control set, so H2 governs them, exactly as 5B's own scope cut
   prescribed. */

/* SPIN (William's ruling, verified in the merge captures): the disc
   stays BARE — no rule in this merged sheet gives #spinBtn a ring or
   an outline; hover/focus feedback is H2's brightness shift only and
   :active keeps the composite's scale(.965) press (H2's brightness
   .93 layers on the same state, no shadow anywhere). */

/* ===== V1.2 WAVE 2 — FEATURES (build-v12/features-notes.md) ===== */

/* --- 1. FOUNTAIN POUR (symbol drop) ---
   Flights are children of #grid in cell space, so the desktop
   homography projects them into their trapezoid cells exactly.
   The settled tile stays hidden until its own flight lands; the
   landing settle + splash ripple are the fountain's beats. */
.cell.pouring img { visibility:hidden; }
.pourTile { position:absolute; width:20%; height:25%; z-index:4; pointer-events:none; will-change:transform; }
.pourTile img { width:100%; height:100%; object-fit:fill; display:block; border-radius:4%; filter:drop-shadow(0 3px 5px rgba(6,30,38,.35)); }
.cell.landed img { animation:landSettle .28s ease-out; }
@keyframes landSettle { 0% { transform:translateY(-3.5%) scale(1.03); } 55% { transform:translateY(1.2%) scale(.995); } 100% { transform:none; } }
.pourRipple { position:absolute; width:17%; height:19%; z-index:5; pointer-events:none; border:2px solid rgba(228,250,255,.75); border-radius:50%; transform:translate(-50%,-50%); animation:rippleOut .5s ease-out forwards; }
@keyframes rippleOut { from { opacity:.85; scale:.35; } to { opacity:0; scale:1.15; } }

/* --- 2. ALIVE SCENE (waterfalls + pond life) ---
   Above #scenePlate, below #grid (DOM order + z-index 1). Pure
   transform/opacity animation — the scene never sits like a poster,
   including between spins. Streams slide DOWN the plates' own
   painted falls (positions built per-plate by buildFalls() in
   game.js from the FALLS table measured on the art); foam breathes
   where each fall lands; the pond carries shimmer + ripple rings. */
#fallsLayer { position:absolute; inset:0; z-index:1; pointer-events:none; overflow:hidden; }
#pondLife { position:absolute; inset:0; z-index:1; pointer-events:none; overflow:hidden; }
.fallStream { position:absolute; transform:translateX(-50%); border-radius:40%; overflow:hidden;
  background:linear-gradient(180deg, rgba(186,238,250,0) 0%, rgba(186,238,250,.07) 32%, rgba(216,248,255,.15) 100%); }
.fallStream::before, .fallStream::after { content:""; position:absolute; top:-36%; height:36%; width:16%;
  background:linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.5));
  animation:fallSlide 1.05s linear infinite; }
.fallStream::before { left:14%; }
.fallStream::after { left:58%; animation-delay:-.52s; }
@keyframes fallSlide { from { transform:translateY(0); } to { transform:translateY(390%); } }
.fallFoam { position:absolute; transform:translate(-50%,-50%); height:8px; border-radius:50%;
  background:radial-gradient(ellipse at center, rgba(240,253,255,.55), rgba(240,253,255,0) 70%);
  animation:foamBreath 2.3s ease-in-out infinite alternate; }
@keyframes foamBreath { from { scale:.82; opacity:.55; } to { scale:1.14; opacity:.95; } }
.pondShimmer { position:absolute; height:10px; border-radius:50%;
  background:radial-gradient(ellipse at center, rgba(213,244,255,.32), rgba(213,244,255,0) 70%);
  animation:pondDrift 5.5s ease-in-out infinite alternate; }
@keyframes pondDrift { from { transform:translateX(-7px) scaleX(.9); opacity:.45; } to { transform:translateX(9px) scaleX(1.08); opacity:.95; } }
.pondRing { position:absolute; border:2px solid rgba(220,250,255,.5); border-radius:50%;
  animation:ringGrow 4.6s linear infinite; }
@keyframes ringGrow { from { scale:.3; opacity:.5; } to { scale:1.45; opacity:0; } }
#stage.phone .pondShimmer.s1 { left:0.5%; top:52%; width:9%; }
#stage.phone .pondShimmer.s2 { left:30%; top:81.3%; width:22%; animation-delay:-3s; }
#stage.phone .pondShimmer.s3 { left:87%; top:71%; width:10%; animation-delay:-5s; }
#stage.phone .pondRing.r1 { left:2%; top:57%; width:5.5%; height:2.2%; }
#stage.phone .pondRing.r2 { left:38%; top:82.5%; width:7%; height:2.6%; animation-delay:-2.3s; }
#stage.desktop .pondShimmer.s1 { left:4%; top:60%; width:14%; }
#stage.desktop .pondShimmer.s2 { left:38%; top:77.2%; width:20%; animation-delay:-3s; }
#stage.desktop .pondShimmer.s3 { left:88%; top:62%; width:9%; animation-delay:-5s; }
#stage.desktop .pondRing.r1 { left:9%; top:64%; width:4.5%; height:3.4%; }
#stage.desktop .pondRing.r2 { left:47%; top:78.6%; width:5.5%; height:3.8%; animation-delay:-2.3s; }

/* --- 3. UNDERWATER BOARD (William's restaged form) ---
   ONE screen-wide layer; its ONLY geometry is the waterline (the
   layer's height, set from GaugeProgress via BoardWater in game.js).
   No outline, no border, no trapezoid, no clip-path — a second
   perspective cannot exist. Tint sampled from the plates' own
   water pixels (water-mask medians over the pond/river regions of
   both plates: phone #59666e / #5a666f, desktop #5a6d79 / #53646c
   — slate teal, G/B over R): the haze below is that family darkened
   ~45% for depth, alpha inside the legibility budget measured in
   features-notes.md. Signage (plaque z 7, float z 8) and the dock
   (z 9) stay dry; win pulses (z 3) submerge with their cells. */
#boardWater { position:absolute; left:0; right:0; bottom:0; height:0; z-index:4; pointer-events:none; overflow:hidden; opacity:1; transition:height .55s ease, opacity .45s ease; }
#bwBody { position:absolute; left:0; right:0; top:7px; bottom:0;
  background:linear-gradient(180deg, rgba(38,74,79,.34), rgba(23,53,59,.50)); }
#bwBody::after { content:""; position:absolute; inset:0; pointer-events:none;
  background-image:url("assets/foam.webp"); background-repeat:repeat; background-size:170px 120px;
  opacity:.10; mix-blend-mode:screen; animation:bwSpeckle 9s linear infinite; }
@keyframes bwSpeckle { from { background-position:0 0; } to { background-position:0 120px; } }
#bwCrest { position:absolute; left:0; right:0; top:0; height:10px; animation:bwBob 3.8s ease-in-out infinite alternate; }
@keyframes bwBob { from { transform:translateY(-1.5px); } to { transform:translateY(1.5px); } }
#bwCrestWave { position:absolute; left:0; right:0; top:0; height:10px;
  background-image:url("assets/foam.webp"); background-repeat:repeat-x; background-position:0 center; background-size:150px 10px;
  opacity:.85; animation:bwCrestSlide 2.6s linear infinite; }
@keyframes bwCrestSlide { from { background-position-x:0; } to { background-position-x:150px; } }

/* --- 4a. SHORT-WIDE COMPOSITION (844x390 class of stages) ---
   fitStage adds .shortwide to a desktop stage shorter than 500px.
   The inherited desktop bar folds the readout boxes onto the chip
   row there (baseline total 3,098 px² of HUD-vs-HUD overlap, plus
   fsBadge∩grid 814 and float∩plaque 367 at 53 logs). This block
   recomposes ONLY that stage shape: readouts lift to their own row
   above the chips, the badge rides higher, the plaque compacts on
   its post, SPIN shrinks to fit the short stage. Phone and full
   desktop geometry are untouched. */
#stage.desktop.shortwide #balBox { top:auto; bottom:15.5%; }
#stage.desktop.shortwide #winBox { top:auto; bottom:15.5%; width:14%; }
/* the desktop cleat offsets (-40/+39px) are tuned for the full-size
   bar; at short-wide width they push the minus cleat 561 px² under
   the WIN box. ±25px lands both cleats exactly on the painted gear
   glyphs at this scale (39.3% / 76.7% of stage width) and clear. */
#stage.desktop.shortwide #betMinus { left:-25px; }
#stage.desktop.shortwide #betPlus { left:25px; }
#stage.desktop.shortwide #betBox { top:auto; bottom:14.5%; }
#stage.desktop.shortwide #propRow { bottom:1.5%; }
#stage.desktop.shortwide #spinBtn { width:10.5%; top:69%; }
/* badge: centred it crosses the gauge float's x-range at low log
   counts (float∩badge 367 px² at 2 logs) — it shifts left, the same
   move the phone badge makes under 4A, and compacts so its bottom
   still clears the grid top with the float's full travel clear. */
#stage.desktop.shortwide #fsBadge { left:34%; top:22%; font-size:11px; padding:2px 10px; }
/* plaque: compacts on its post (top 1.6%, tighter padding/type) so
   its bottom (12.4%) clears the float's highest reach (13.85%). */
#stage.desktop.shortwide #gaugePlaque { top:23.5%; padding:1px 6px; } /* DESKTOP PLATE v3: plaque re-ground on the repainted post (top 22.4%) at every desktop height — the 1.6% top belonged to the long-retired top-post plate. */
#stage.desktop.shortwide #gaugeLab { font-size:7px; }
#stage.desktop.shortwide #gaugeVal { font-size:12px; }

/* --- Reduced motion (declared choice, all Wave 2 features) ---
   Ambient life and the underwater surface go still; the pour
   collapses to an instant deal in game.js (REDUCED_MOTION). */
@media (prefers-reduced-motion: reduce) {
  .fallStream::before, .fallStream::after, .fallFoam, .pondShimmer, .pondRing,
  #bwCrest, #bwCrestWave, #bwBody::after { animation:none !important; }
}

/* ================================================================
   SLIM BAR + FULL MENU (variant, 2026-10-27) — William on v1.2:
   "I still don't like the buttons... can we make a menu? It's just
   too crowded." The brass system is NOT the complaint — the COUNT
   is. TURBO / AUTOPLAY setup / SOUND move into the menu as full
   brass toggle rows; the bar keeps ante, buy, MENU and the bare
   SPIN disc, plus ONE contextual pill: the autoplay STOP, visible
   only while autoplay runs (v1.2's AUTO-chip stop, transplanted).
   Freed width goes to spacing, not bigger chips.
   ================================================================ */

/* the row breathes: same chips, same sizes, wider gaps */
#stage.phone #propRow { gap:9px; }
#stage.desktop #propRow { gap:12px; }
#stage.desktop.shortwide #propRow { gap:8px; }

/* MENU button's turbo tell: one small lit rivet-dot at the chip's
   top-right corner, glowing amber while TURBO is on — readable
   from the bar without opening the menu, dark otherwise. */
#menuChip { position:relative; }
.tellDot { position:absolute; top:3px; right:3px; width:7px; height:7px; border-radius:50%;
  background:radial-gradient(circle at 35% 30%, #ffe9a8, #e8a91c 70%, #9a6d0e);
  box-shadow:0 0 7px 2px rgba(255,196,64,.75), inset 0 -1px 1px rgba(0,0,0,.45); }

/* --- menu control rows: full brass toggles, first-class citizens --- */
#ctlSection { margin-top:10px; padding-top:10px; border-top:2px solid rgba(0,0,0,.4);
  display:flex; flex-direction:column; gap:8px; }
.ctlRow { display:flex; align-items:center; gap:10px; padding:7px 10px; border-radius:9px;
  background:linear-gradient(180deg,#2e1c07,#241605); border:2px solid #8a6524;
  box-shadow:inset 0 1px 0 rgba(255,225,160,.16), inset 0 -6px 10px rgba(0,0,0,.35); }
.ctlRowLab { font-weight:900; letter-spacing:.05em; color:#ffe9bd; white-space:nowrap;
  font-size:clamp(12px,2vmin,15px); text-shadow:0 1px 1px rgba(0,0,0,.65); }
.togglePill { margin-left:auto; min-width:78px; padding:6px 14px; border-radius:999px;
  background:linear-gradient(180deg,#8a6524,#6e4d16); border:2px solid #4c3510;
  color:#ffeec4; font-weight:900; letter-spacing:.05em; font-size:clamp(12px,2vmin,14px);
  text-shadow:0 1px 1px rgba(0,0,0,.55); box-shadow:0 3px 6px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,246,200,.35);
  white-space:nowrap; cursor:pointer; }
.togglePill.on { background:linear-gradient(180deg,#f6dc8a,#e3bc52 55%,#c79c34); color:#241703;
  border-color:#7c5a1c; text-shadow:0 1px 0 rgba(255,242,196,.55);
  box-shadow:0 3px 6px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,250,214,.9), 0 0 12px rgba(255,205,85,.55); }
.togglePill:active { transform:translateY(1px); }
#autoCounts { display:flex; gap:5px; margin-left:auto; }
#autoCounts + .togglePill { margin-left:0; }
.miniChip { padding:5px 9px; border-radius:7px; cursor:pointer;
  background:linear-gradient(180deg,#dcb968,#bb9038 55%,#9a742a); border:2px solid #6e4d16;
  color:#33200a; font-weight:900; font-size:clamp(11px,1.9vmin,13px); letter-spacing:.03em;
  text-shadow:0 1px 0 rgba(255,242,196,.55); box-shadow:0 2px 4px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,246,200,.7); }
.miniChip.on { background:linear-gradient(180deg,#f6dc8a,#e3bc52 55%,#c79c34); color:#241703;
  box-shadow:0 2px 4px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,250,214,.9), 0 0 10px rgba(255,205,85,.5); }
.miniChip:active { transform:translateY(1px); }

/* ================================================================
   RIVET FIX (2026-10-27) — William, on the slim-bar captures:
   "The screws are over the letters."
   Measured cause (tools/measure_rivets.py, baseline): on phone the
   mid-height rivets' inner edges land exactly where the lettering
   box starts (text at 2px border + 5px padding = 7px; rivet spans
   2-7px) -> 0px designed clearance, 3-9px of dilated glyph ink
   inside every phone rivet disc, margins -0.5..-2.5px. Desktop's
   13px padding already cleared by 4.5-5.75px. The MENU chip's turbo
   tell dot also sat on the U (margin -2.89px phone).
   Fix: the screws move to the BOTTOM CORNERS of the plates, in the
   rim below the lettering band (phone ink band = rows 8-14 of the
   22px chip). Desktop keeps its 5px screws (bottom:3px; measured
   margins 4.78-6.44px). The phone plates are too short for 5px in
   the corner diagonal (binds at -0.26px), so per the fallback
   order the phone screws go to 4px at bottom:0, tucked 1px from
   the side rims (measured margins 2.03-4.26px). Same finish,
   relocated and right-sized — not removed. The MENU tell dot
   shrinks to 4px in the extreme top-right corner (margin 2.91px;
   its glow is a light effect, not screw metal). A computed-style
   audit confirms the menu rows/pills/mini-chips/tabs carry NO
   screw elements at all — the bar chips were the whole offence.
   Gate: rivet disc ∩ dilated glyph ink = 0 and margin >= 2px on
   every labelled plate at worst-case strings, both viewports,
   both wordings — rivets-final.json: ALL PASS.
   ================================================================ */
#stage .propChip::before, #stage .propChip::after { top:auto; bottom:3px; transform:none; }
#stage.phone .propChip::before, #stage.phone .propChip::after { bottom:0; width:4px; height:4px; }
#stage.phone .propChip::before { left:1px; }
#stage.phone .propChip::after { right:1px; }
.tellDot { top:0; right:0; width:4px; height:4px; }

/* ================================================================
   SECOND-GRID PASS — MENU + BAR (2026-10-27). Two of William's
   catches on the rivet-fix captures:
   (a) "Auto hangs over in the menu" — the AUTOPLAY row (label +
       10/25/50/100 chips + AUTO pill) was wider than the panel's
       inner width at phone size; the AUTO pill broke the panel
       silhouette. The row now wraps: label + AUTO pill on line 1,
       the four count chips on their own full-width line below,
       each chip flex:1 (about 77px wide, 33px tall at phone size —
       honest tap targets, all four counts and the AUTO pill kept,
       wording and confirm flow untouched).
   (b) "Can we move the buttons over? I feel like they're too close
       to the spin button" — measured before: the MENU chip passed
       5.8px from the SPIN disc on phone (circle clearance), the
       STOP pill 8.1px. The phone prop row is no longer centred:
       it starts at the stage's left edge and packs left, spends
       its internal gaps (9px -> 5px) and the chips' letter-spacing
       (.03em -> 0), and sits 0.8% lower where the disc's curve has
       fallen away. SPIN and the balance dial do not move. Desktop
       was measured already clear (min 113.8px at the bet cluster)
       and is not touched.
   Gate: panel-overflow = 0 on every menu element in every tab /
   state / viewport; spin-disc clearance >= 16px phone / >= 20px
   desktop in the tightest state (max bet + STOP pill showing).
   ================================================================ */
.ctlRow:has(#autoCounts) { flex-wrap:wrap; }
#autoCounts { order:3; flex:1 1 100%; margin-left:0; }
#autoCounts .miniChip { flex:1; padding:8px 0; text-align:center; }
#autoCounts + .togglePill { margin-left:auto; } /* wrapped row: AUTO sits flush right on line 1, like TURBO/SOUND (the slim-bar base rule zeroed this margin for the old one-line row) */

#stage.phone #propRow { left:0.5%; right:auto; justify-content:flex-start; gap:5px; bottom:0.3%; }
#stage.phone .propChip { letter-spacing:0; }
/* rivet-gate repair for the letter-spacing change (measured on the
   gate's own plates): the narrower phone chips pulled the corner
   furniture toward the ink — anteChip's right screw margin fell to
   1.64px and the MENU tell dot's to 1.95px (gate: >= 2.0). The right
   screws now sit flush at the rim (right:0, +1px of clearance) and
   the tell dot goes to 3.5px; both re-measured in rivets-secondgrid:
   every plate back over 2.0px with screw ∩ ink still 0. */
#stage.phone .propChip::after { right:0; }
.tellDot { width:3.5px; height:3.5px; }

/* ================================================================
   FALLS REWORK (same proof, William 2026-10-28): "The water falling
   also looks out of place... can we make it feel more like it is
   the waterfall." The .fallStream streak sprites are GONE. Each
   painted fall now flows with its OWN pixels: buildFalls() lays a
   layer over the painted channel carrying a crop of the painting
   itself (brightened, loop-blended), clipped by a silhouette mask
   derived from that same crop — the mask is fixed, the painting's
   texture travels down inside it. Foam at each base is likewise
   the painting's own foam crop, breathing. No rectangles, no
   streaks, no foreign colour: sampled whites/blue-greys only.
   ================================================================ */
.fallFlow { position:absolute; overflow:hidden; pointer-events:none; opacity:.68;
  -webkit-mask-size:100% 100%; mask-size:100% 100%; }
.fallFlowTex { position:absolute; left:0; top:-100%; width:100%; height:200%;
  background-repeat:repeat-y; background-size:100% 50%;
  animation:fallFlowMove linear infinite; }
@keyframes fallFlowMove { from { transform:translateY(0); } to { transform:translateY(50%); } }
.fallFoam2 { position:absolute; pointer-events:none;
  -webkit-mask-size:100% 100%; mask-size:100% 100%;
  background-size:100% 100%; transform-origin:50% 62%;
  animation:foamBreath2 2.7s ease-in-out infinite alternate; }
@keyframes foamBreath2 { from { transform:scale(.94); opacity:.45; }
  to { transform:scale(1.05); opacity:.85; } }
@media (prefers-reduced-motion: reduce) {
  .fallFlowTex, .fallFoam2 { animation:none !important; }
}

/* ===== FLOAT PROOF — "BLOCKS ON THE RIVER" =========================
   William's sketch plates + reference grammar: the board area is open
   river; symbols are card-free blocks floating on it. This section
   overrides the card-era rules above: no cell backgrounds, no frames,
   no panes, no grout — win/scatter states stay water effects (the
   pulse brightness on the block itself + its ripple). The .fl wrapper
   (contact shadow + ripple ring + symbol) is transform/opacity-driven
   by game.js's float loop — the single writer. */
/* Both layouts project #grid onto their river-fan trapezoid.
   SPACING PASS (William, 2026-10-28: "open it up a little — still keep
   them as the tiles, just a little more space"): source rows are
   weighted toward the top of the fan, where the homography compresses
   pitch hardest (measured uniform-row projected pitches, phone
   33/43/57/81px, desktop 18/24/34/50px, against symbol scale ratios
   that shrink far less) — the weights hand the far rows relatively
   more of the spread so every row band lands with clear water. */
#stage.phone #grid { transform-origin:0 0; grid-template-rows:0.96fr 1.01fr 1.08fr 1.15fr; /* correction pass: steepened further toward the compressed far rows — pitch bought by spacing, not by shrinking tiles */ }
#stage.desktop #grid { grid-template-rows:1.10fr 1.02fr 0.96fr 0.92fr; } /* ANGLE+GROW v3.1: weights return as a PITCH dial — [1.10, 1.02, 0.96, 0.92] hands source height to the far rows, whose projected boundary is the seat-bound scarce one, buying back the V gap the lean growth spends there; the size curve still rides the ROWF ramp + SYM_K (game.js). DESKTOP FAN v2: FLAT weights — in the low river fan the size curve is carried by the ROWF stand-scale ramp (game.js), not by source-row weights; weighted rows only move pitch between boundaries. The tight fan's weights live on under .shortwide. (DESKTOP FAN PASS: near-flat 1.06/1.05/0.97/0.91 for the tight fan.) */
#stage.desktop.shortwide #grid { width:46%; height:50.00%; grid-template-rows:1.06fr 1.01fr 0.97fr 0.96fr; } /* ANGLE+GROW v3.1: short-wide runs its OWN tempered weights [1.06, 1.01, 0.97, 0.96] (desktop's [1.10, 1.02, 0.96, 0.92] + the shared K growth saturated the 361px stack — see game.js ROWF note). DESKTOP PLATE v3 / FAN v3: short-wide runs the v3 fan's own fractions — same 46%x50.00% box, flat weights, v3 trap + ROWF ramp; at 362px stage height the v3 fan scales to ink ~[27, 30, 35, 41] with V gaps > 0 sway-worst (verified live). DESKTOP FAN v2: short-wide keeps the v1 TIGHT fan whole — its box (46%x62.48%) + weights; the v2 fan at 362px stage height would scale to ~22-29px ink with sub-zero sway-worst V gaps. */
.cell { overflow:visible; background:none; }
#stage.desktop .cell::after { content:none; display:none; } /* the E2 grout shadow was a card-grid effect — deleted */
.cell.pouring img { visibility:visible; } /* old pour hide neutralised: the float loop owns .fl opacity */
.fl { position:absolute; inset:0; will-change:transform,opacity; }
.flStand { position:absolute; inset:0; transform-origin:50% 88%; } /* per-cell stand matrix set by fitStage */
.flSway { position:absolute; inset:0; will-change:transform; }
/* symbol box: 126% in v1 -> ... -> 93% phone / 80% desktop
   (spacing passes 1-7, final). The passes are sized by the
   adversarial mask audit (tools/mask_audit.py — all-FROG / all-LOG /
   all-TROUT boards, paint-on-paint): AABB ink gaps overstated the
   crowding (diagonal symbols carry empty bbox corners), but
   full-frame symbols (LOG above all) genuinely stack at v1's size —
   ~2-4px of paint depth in the compressed top bands, worst
   vertically on desktop, whose fan is far shorter than it is wide
   (symbols scaled off the width), so desktop trims deepest. Even
   trimmed, the blocks stay larger on screen than the card era's
   symbols ever were. Offsets keep the box centred at 50% across /
   44% down the cell, exactly where the 126% box sat. game.js SYM_K
   mirrors these numbers per layout. */
.flSway img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; display:block; filter:drop-shadow(0 3px 3px rgba(2,24,30,.35)); } /* cream tile fills its stand box, aspect kept (contain) — the frame is never stretched */
/* CORRECTION PASS: the desktop-only 80% img shrink is REMOVED — it was
   a second, hidden trim stacked under SYM_K (effective desktop trim
   was 0.745 x 0.80 = 0.596, far deeper than the reported constant).
   SYM_K in game.js is now the single trim on both layouts. */
.flShadow { position:absolute; left:9%; right:9%; bottom:1%; height:17%; border-radius:50%;
  background:radial-gradient(ellipse at center, rgba(7,35,40,.40), rgba(7,35,40,0) 68%); will-change:transform,opacity; }
.flRipple { position:absolute; left:2%; right:2%; bottom:-4%; height:26%; border:2px solid rgba(226,250,255,.50);
  border-radius:50%; pointer-events:none; animation:flRing 4.8s linear infinite; }
@keyframes flRing { 0% { transform:scale(.55); opacity:.55; } 70% { opacity:.28; } 100% { transform:scale(1.12); opacity:0; } }
/* river-deal flights (stage space) */
.flowTile { position:absolute; left:0; top:0; z-index:5; pointer-events:none; will-change:transform; }
.flowTile img { width:100%; height:100%; object-fit:contain; display:block; filter:drop-shadow(0 4px 6px rgba(6,30,38,.35)); }
.flowTile.ww img { filter:brightness(1.5) drop-shadow(0 0 16px rgba(255,255,255,.95)); }
.flowSplash { position:absolute; z-index:5; pointer-events:none; border:2.5px solid rgba(230,252,255,.85); border-radius:50%;
  transform:translate(-50%,-50%); animation:flowSplashA .55s ease-out forwards; }
.flowFoam { position:absolute; z-index:5; pointer-events:none; border-radius:50%;
  background:radial-gradient(ellipse at center, rgba(245,254,255,.9), rgba(245,254,255,0) 70%);
  transform:translate(-50%,-50%); animation:flowFoamA .5s ease-out forwards; }
@keyframes flowSplashA { from { opacity:.9; scale:.3; } to { opacity:0; scale:1.25; } }
@keyframes flowFoamA { from { opacity:.95; scale:.5; } to { opacity:0; scale:1.5; } }
/* gauge furniture re-ground to the new plates' posts (see report) */
#stage.phone #gaugePlaque { top:35.6%; }
#stage.desktop #gaugePlaque { left:69.0%; top:23.5%; } /* DESKTOP PLATE v3: re-ground on the repainted ruler post (body x 70.6–75.8%, centre 73.2%; top 22.4%, base in water 56.2%) — plaque left = centre − 8.5/2, top just under the post's cap. */
#stage.desktop #gaugeFloat { left:70.0%; top:54.5%; } /* DESKTOP PLATE v3: float left = post centre − 6.4/2; top is the rest position (game.js GaugeProgress drives travel 54.5→32.5). */
/* pond life re-seated onto the new river's open water */
#stage.phone .pondShimmer.s1 { left:30%; top:56%; width:12%; }
#stage.phone .pondShimmer.s2 { left:52%; top:84%; width:22%; }
#stage.phone .pondShimmer.s3 { left:64%; top:66%; width:10%; }
#stage.phone .pondRing.r1 { left:16%; top:62%; }
#stage.phone .pondRing.r2 { left:58%; top:87%; }
#stage.desktop .pondShimmer.s1 { left:16%; top:68%; width:13%; }
#stage.desktop .pondShimmer.s2 { left:42%; top:84%; width:20%; }
#stage.desktop .pondShimmer.s3 { left:66%; top:66%; width:9%; }
#stage.desktop .pondRing.r1 { left:26%; top:72%; }
#stage.desktop .pondRing.r2 { left:52%; top:86%; }
@media (prefers-reduced-motion: reduce) { .flRipple { animation:none; opacity:.3; } }

/* RIVER FLOW — canvas above the plate, below the falls (DOM order). */
#riverFlow { position:absolute; inset:0; z-index:1; pointer-events:none; }

/* VERSION FOOTER — NEW in v1.3 (v1.2 shipped no version string anywhere).
   Static text in index.html directly under #legalNote, so it renders
   identically in both wordings; it is not part of either wording table. */
#versionNote { margin-top:4px; font-size:9.5px; line-height:1.3; color:rgba(255,243,214,.65); }
