/* Egg Emergency - the round's own CSS (egg-stage.js draws it), out of play.html with no change to what it draws.
   play.html loads it between its two style blocks, where these rules sat (they outrank its first block at equal weight);
   toy.css still dresses it (the toy theme loads last). The ON THE BIG SCREEN pill (.eg-air) stays in play.html: Whack,
   Gridlock and Clear Cut wear it too. So does the control-diagnostics panel (.eg-dbg), which its ?ctldebug=1 log draws. */
/* ----- EGG EMERGENCY (Chansey catches falling eggs, dodges Voltorb) ----- */
.eg-head{ display:flex; }
.eg-stat{ flex:1; }
.eg-stat b{ display:block; font-family:var(--disp); font-size:22px; line-height:1.05; }
.eg-stat span{ letter-spacing:1.5px; text-transform:uppercase; }
.eg-tier{ align-self:center; letter-spacing:1.5px; border:1px solid rgba(255,210,63,.5); border-radius:999px; }
/* the play field: lanes of a building facade, Chansey on the ledge at the bottom */
.eg-field{ position:relative; width:min(100%,430px); height:min(calc(46 * var(--vh)),360px);
  /* the last term reserves the stats above and the (now taller) control row below, so a short
     phone shrinks the field instead of scrolling the page mid-round */
  /* No hand-tuned height reserve: the page is bounded to the screen during a round (see
     body.eg-focus) and this is the one shrinkable item, so it gives up space only when a short
     screen actually needs it. A fixed reserve just left the board small with dead space below. */
  /* Sized by what's LEFT, not by a fraction of the screen: the page is bounded to the viewport
     during a round (body.eg-focus) and this is the only growable item, so it takes all the space
     the stats row and controls don't need — up to a cap — and gives space back on a short phone.
     A fixed dvh fraction left the board small with dead space stranded under the buttons. */
  flex:1 1 auto; height:auto; min-height:150px; max-height:min(calc(62 * var(--dvh)), 470px);
  margin:0 auto; border-radius:16px; overflow:hidden;
  /* Anchored to the LIP, not to the bottom of the field. The bottom of the field is behind the
     opaque stage front, so `center bottom` buried the lowest part of the artwork — the storey
     Chansey should be standing in front of — and put the ground line in the wrong place. Offset
     by the ledge's height and the art meets the lip exactly, which is where her feet are. */
  background:#a28565 url('egg/bg3.jpg') center bottom var(--eg-ledge-px, 0px) / cover no-repeat;
  border:1px solid rgba(255,255,255,.12); touch-action:none; overscroll-behavior:contain; }
.eg-field::before{ content:''; position:absolute; inset:0; z-index:0; pointer-events:none;
  background:linear-gradient(180deg, rgba(8,11,18,.22) 0%, rgba(8,11,18,.10) 45%, rgba(8,11,18,0) 100%); } /* a touch of shade at the top, where eggs enter */
.eg-lanes{ display:none; }   /* the background art gives the structure — guides read as clutter over the brick */
.eg-lane{ flex:1; border-right:1px dashed rgba(255,255,255,.16); }
.eg-lane:last-child{ border-right:0; }
.eg-lanes::before, .eg-lanes::after{ content:''; position:absolute; top:0; bottom:0; width:1px; background:rgba(255,255,255,.16); }
.eg-lanes::before{ left:0; } .eg-lanes::after{ right:0; }
/* THE STAGE FRONT. Its TOP edge is the walking surface — Chansey's feet and the catch line both sit on --eg-ledge, which
   JS owns (see LEDGE_PCT). It sits BEHIND her (z-index 3 vs 4) and in front of the backdrop, and
   falling items are z-index 6, so a missed egg drops past the lip and across the face of the
   stage exactly as it does in the original. */
/* The stage front is the stone-and-bushes band cut from the bottom of the backdrop's own picture
   (ledge-front3: bg3 ends at the top of the stone, this starts there), drawn full width from the
   element's top edge — that edge IS the walking surface. The slab runs from there to the bottom of
   the field, a height that changes with the screen, so under the band it is the stone's own colour. */
.eg-ledge{ position:absolute; left:0; right:0; bottom:0; height:var(--eg-ledge,26%); z-index:3; pointer-events:none;
  background:#a28565 url('egg/ledge-front3.jpg') center 0 / 100% auto no-repeat;
  box-shadow:0 -10px 22px rgba(0,0,0,.35); --toy-drop:0px; --toy-drop-c:transparent; --toy-under:opacity(1); }
/* Voltorb at 37% of Chansey's width, matching the Stadium original (she spans ~260px there, the
   Voltorb ~95px). It was 53% — half again too big, which read as a menace rather than a hazard
   and made the sky look more crowded than the drop schedule actually is. The EGG was already
   right at 28% against the original's 27%, so it is untouched. */
/* Sized against HER, not against the field, so the ?chan= knob cannot break the ratios.
   0.37 is the Stadium relation measured earlier (Voltorb ~37% of Chansey's width). */
.eg-item{ position:absolute; width:calc(var(--eg-chan,40%) * 0.37); z-index:6; will-change:transform; pointer-events:none; }
/* The sprites carry their OWN outline, so a heavy drop-shadow on top of it read as a thick black
   border rather than as depth. Softened, and the egg's own ring was thinned in the asset. */
.eg-item img{ width:100%; display:block; --toy-fx:drop-shadow(0 3px 5px rgba(0,0,0,.32)); filter:var(--toy-fx, opacity(1)) drop-shadow(0 var(--toy-drop, 0px) 0 var(--toy-drop-c, transparent)) var(--toy-under, opacity(1)); }
/* 22% of her width. NOT 18%, which is the egg in her POUCH — the Stadium original does not draw
   those the same size either (its falling eggs are ~27% of her), and a strict match rendered
   21px on a phone, too small to track. 25 sits just under the full Stadium value.
   Her own default width went 32% -> 40% at the same time, and everything that falls is sized
   against HER, so the eggs grew twice over: bigger ratio on a bigger Chansey. The pouch is still where a catch LANDS; it just is not the size reference. */
.eg-egg{ width:calc(var(--eg-chan,40%) * 0.23); }
/* Duration is set per move in JS (LEAN_MS x lanes) so she travels at a CONSTANT speed —
   a flat duration made a one-lane hop as slow as a two-lane crossing. .055s is the one-lane
   value, here only as the pre-script default. */
/* Her width is a knob (?chan=N) because it is half of a RATIO, not a value on its own. In the
   Stadium original Chansey, the window and the archway are all about half the play column's
   width; ours had her at 32% against a window at 78%, so she read as a doll in a giant house.
   Scoring is untouched by this — lanes come from her CENTRE (see CHAN_X), never her size. */
/* --eg-stand brings her forward onto the ledge instead of flat against the wall behind it. The
   catch line follows automatically: FALL_LAND is measured off her drawn rect, not off the ledge. */
.eg-chansey{ position:absolute; bottom:calc(var(--eg-ledge,30%) - var(--eg-stand, 9px)); width:var(--eg-chan,40%); z-index:4; transition:left .055s cubic-bezier(.3,.9,.4,1); pointer-events:none; } /* stands on the ledge — only reaches */
.eg-chansey img{ width:100%; display:block; --toy-fx:drop-shadow(0 7px 12px rgba(0,0,0,.6)); filter:var(--toy-fx, opacity(1)) drop-shadow(0 var(--toy-drop, 0px) 0 var(--toy-drop-c, transparent)) var(--toy-under, opacity(1));
  transform-origin:50% 100%; }
/* Only while resting: .bop is set by setSprite for the rest pose and cleared for every other. */
.eg-chansey.bop img{ animation:egBreathe var(--eg-bop,.44s) step-end infinite; }
/* She is at REST about 80% of a round — readyc alone held the screen 6.9s of a 30s round, against
   ~50ms for a catch frame. So this is the pose worth spending on, and it is the one that was a
   still image. Scale only in Y, with the origin at her feet: her width never changes, so the lane
   geometry and every hand/pouch fraction measured against the canvas still hold, and she cannot
   drift off the ledge. No new art — one image, redrawn slightly each refresh. */
/* 4.5%, not the 2.2% this shipped with. That was 2.6px of travel over 3.2s — 0.8px a second,
   under the threshold of noticing while your eyes are on falling eggs, and Daniel could not
   see it at all on a phone. 4.5% moves 5.4px. Same period on purpose: one variable. */
/* A BOP, NOT A BREATH. Two frames, hard-cut, no blend: step-end holds each keyframe until the
   next, so this is a square wave rather than a ramp. Crossfading two poses made her a double
   exposure and read as slow-motion smearing however narrow the blend got; the fix was to stop
   interpolating between drawings, which is what frame animation has always done. */
@keyframes egBreathe{ 0%{ transform:scaleY(1); } 50%{ transform:scaleY(1.045); } }
/* THE IDLE LAYER. idlec is the same drawing as readyc with her ears raised and flared — the one
   thing a transform cannot do, because CSS can move the plate but never change what is on it.
   Stacked pixel-registered over the base sprite and CROSSFADED rather than switched: cutting
   between two frames reads as two frames, and cutting at the middle of the breath — the fastest
   part of the movement — is the most visible place to do it. Blending means the ears travel.
   Same duration, easing and direction as the breath, so the flare IS the rise rather than a
   separate tic. .eg-chansey img already gives this element the breath; the fade rides on top. */
.eg-chansey img.eg-idle{ position:absolute; left:0; top:0; opacity:0; }
.eg-chansey.bop img.eg-idle{ animation:egBreathe var(--eg-bop,.44s) step-end infinite,
                                       egIdleFade var(--eg-bop,.44s) step-end infinite; }
.eg-chansey img.eg-idle.hide{ display:none; }
/* HOLD, BLEND, HOLD — not a continuous ramp. Fading straight from 0 to 1 across the whole 3.2s
   means she is a genuine double exposure for most of the cycle: both ear positions visible at
   half strength, which reads as slow-motion smearing rather than movement. Holding each frame
   flat and blending only across the middle fifth gives ~0.5s of smear between two crisp poses —
   close to what a real animation does, where the eye is given something solid to land on. */
@keyframes egIdleFade{ 0%{ opacity:0; } 50%{ opacity:1; } }
/* Shake the INNER img, never the container: the container carries translateX(-50%) for centring,
   and animating its `transform` replaced that outright — which threw her half a body-width right. */
/* This also REPLACES the breath: same element, same `animation` property, higher specificity. */
.eg-chansey.trip img{ animation:egTrip 1s cubic-bezier(.2,.85,.3,1); }
/* back up after a zap: she blinks for egg-sim's SAFE_MS, while Voltorbs pass through her (on the wrapper, so the
   sprite's own breath and poses carry on underneath) */
.eg-chansey.safe{ animation:egSafe .18s steps(2, jump-none) infinite; }
@keyframes egSafe{ from{ opacity:1; } to{ opacity:.35; } }
@media (prefers-reduced-motion: reduce){ .eg-chansey.safe{ animation:none; opacity:.6; } }
/* Reduced motion silences BOTH, and the trip is the one that matters. The breath is a 2.2%
   scale; the trip throws her 35% of her height into the air and rotates her ±8° — that is the
   one here capable of making somebody feel ill, and the bare rule below left it running while
   stopping the harmless one. Nothing is lost by stopping it: the ZAPPED banner, the dimmed
   field and the dead controls all still say she is stunned. .trip is listed explicitly because
   a media query adds no specificity, so .eg-chansey.trip img (0,2,1) outranks a bare
   .eg-chansey img (0,1,1) even from inside the query. */
@media (prefers-reduced-motion: reduce){
  .eg-chansey img, .eg-chansey.trip img{ animation:none; }
  /* opacity:0 as well as animation:none — a stopped fade would otherwise freeze wherever
     it happened to be and leave her permanently double-exposed. */
  .eg-chansey img.eg-idle{ animation:none; opacity:0; }
}
/* Zapped off her feet: a fast jolt upward, a jittering hover for the shock, then she drops back
   onto the ledge as the stun wears off. translateY is a %, so the lift scales with her size. */
@keyframes egTrip{
  0%   { transform:translateY(0)    rotate(0); }
  10%  { transform:translateY(-27%) rotate(-8deg); }
  24%  { transform:translateY(-34%) rotate(7deg); }
  38%  { transform:translateY(-30%) rotate(-6deg); }
  52%  { transform:translateY(-35%) rotate(6deg); }
  66%  { transform:translateY(-28%) rotate(-5deg); }
  80%  { transform:translateY(-17%) rotate(3deg); }
  92%  { transform:translateY(-4%)  rotate(-1deg); }
  100% { transform:translateY(0)    rotate(0); }
}
/* FIVE EGGS THROWN CLEAR when a Voltorb zaps her. The penalty is exactly -5, so these are not
   decoration — they are the score leaving, and a player can count them. Spawned into the field,
   never into #egChansey: syncLedge() measures that element to place the catch line, and anything
   inside it that changed its box would move where eggs are caught.
   Dimmer than a live egg on purpose. At full brightness they read as three more eggs to chase,
   which is the opposite of what they mean — these are gone.
   X AND Y ARE SEPARATE LAYERS, because a throw is not one curve: horizontal speed is constant and
   vertical is under gravity. Sharing a single eased transform made them spread outwards and only
   then drop, like a firework. Split, they arc. */
.eg-spill{ position:absolute; z-index:9; width:calc(var(--eg-chan,40%) * 0.23); pointer-events:none;
  transform:translate(-50%,-50%); }
.eg-spill i{ display:block; animation:egSpillX 1.15s linear forwards; }          /* constant vx */
.eg-spill b{ display:block; animation:egSpillY 1.15s forwards; }                 /* rise, then fall */
.eg-spill img{ display:block; width:100%; --toy-fx:brightness(.8) saturate(.85) drop-shadow(0 3px 5px rgba(0,0,0,.28)); filter:var(--toy-fx, opacity(1)) drop-shadow(0 var(--toy-drop, 0px) 0 var(--toy-drop-c, transparent)) var(--toy-under, opacity(1));
  animation:egSpillSpin 1.15s linear forwards; }
@keyframes egSpillX{ from{ transform:translateX(0) } to{ transform:translateX(var(--dx)) } }
/* Per-keyframe easing: decelerating up to the apex at 30%, then accelerating down for the rest —
   the fall is more than twice the rise, which is what sells it as weight rather than a float. */
@keyframes egSpillY{
  0%   { transform:translateY(0);          animation-timing-function:cubic-bezier(.10,.62,.35,1); }
  30%  { transform:translateY(var(--peak)); animation-timing-function:cubic-bezier(.52,0,.88,.42); }
  100% { transform:translateY(var(--fall)); }
}
@keyframes egSpillSpin{ 0%{ transform:rotate(0deg); opacity:.6 } 68%{ opacity:.42 } 100%{ transform:rotate(var(--rot)); opacity:0 } }
/* the +1 / −5 over her: free-floating sticker type, the colour (set per pop) in ZAPPED!'s heavy ink outline and
   stepped drop, tilted like an arcade popup - no plate behind it, which read as a badge (2026-11-06: it was bare
   coloured type with a browser-faked bold, the old dark look's; the big screen shows it now) */
.eg-float{ position:absolute; z-index:8; transform:translateX(-50%) rotate(-5deg); font-family:var(--disp); font-size:34px; font-weight:400; line-height:1; pointer-events:none; animation:egFloat .7s ease-out forwards;
  -webkit-text-stroke:4px var(--toy-ink-color); paint-order:stroke fill; text-shadow:0 4px 0 var(--toy-ink-color),0 3px 0 var(--toy-ink-color),0 2px 0 var(--toy-ink-color),0 1px 0 var(--toy-ink-color); }
@keyframes egFloat{ 0%{ opacity:1; transform:translate(-50%,0) rotate(-5deg);} 100%{ opacity:0; transform:translate(-50%,-34px) rotate(-5deg);} }
.eg-burst{ position:absolute; width:calc(var(--eg-chan,40%) * 0.50); z-index:7; transform:translate(-50%,-50%); pointer-events:none; animation:egBurst .45s ease-out forwards; }
@keyframes egBurst{ 0%{ opacity:1; transform:translate(-50%,-50%) scale(.5);} 100%{ opacity:0; transform:translate(-50%,-50%) scale(1.7);} }
/* L / R controls — big thumb targets, mirroring the N64 shoulder buttons */
    /* touch-action:none, NOT 'manipulation' — same reason as the mole grid and the Word Rush keys.
   'manipulation' still lets the browser recognise a PAN, and a thumb sliding L->R (or just drifting
   down the button) can hand the gesture to the scroller, which fires touchcancel. A cancelled touch
   vanishes from e.touches while the finger is still physically down, so the lean was dropped
   mid-reversal and she stopped at centre with no further event coming to free her. The universal
   `* { touch-action:manipulation }` rule means the BUTTONS need this too — the touch targets them,
   not the row, and touch-action does not inherit. */
/* The row is padded, not just the buttons: the touch handlers live on the ROW and a press that
   lands on it but misses a button still resolves to the nearer half. So this padding is live hit
   area — it widens the margin for error without making the buttons look oversized. Weighted
   downward, which is where a thumb actually slips. */
/* LIFT. The row used to sit ~36px off the bottom of the screen. A layout bug that accidentally
   raised it by about the height of Safari's URL bar made the dropped presses stop — the first
   lever in this whole investigation that changed the fault rather than measuring it. So the gap
   is now deliberate and tunable: ?lift=N (px) overrides EG_LIFT, and the field gives up the
   space, since it is the only thing in the column that flexes. Find the smallest value that
   still holds before settling on one. */
.eg-ctrls{ display:flex; gap:12px; width:min(100%,430px); margin:8px auto 0;
  padding:8px 0 calc(14px + var(--eg-lift, 0px));
  touch-action:none; overscroll-behavior:contain; }
html.pcz .eg-ctrls{ padding-bottom:14px; }   /* a computer: no thumb to lift clear of Safari's bar, and no bar under the buttons (it is in the top corners) - the field takes the band back */
/* Keyboard players need to know the arrows exist, or they'll mouse the buttons and be at a
   disadvantage. Shown only where there's a real pointer — phones never see it. */

.eg-kbd{ display:none; margin:9px auto 0; font-size:12px; letter-spacing:.3px; }
@media (hover:hover) and (pointer:fine){ .eg-kbd{ display:block; }
  /* a computer's scaled phone (html.pcz): no room under the buttons for the line - the keys join the rules line above */
  html.pcz .eg-kbd{ display:none; } }   /* a computer's scaled phone: no room under the buttons - the keys are on them (.eg-key) */
.eg-key{ display:none; }
@media (hover:hover) and (pointer:fine){ html.pcz .eg-key{ display:grid; } }
/* On a desktop there's room to play properly, so scale the whole game up. Width is DERIVED from
   height: the backdrop is a near-square canvas drawn with `cover`, so a field wider than ~1:1
   crops the top — which is exactly where the lit windows are. Keeping it slightly taller than
   square means any spare is trimmed off the mirrored brick at the sides instead, where nothing
   is lost. One shared width var keeps the stats row, field and controls aligned. */
/* (not on a computer's scaled phone, html.pcz: that is the phone layout, scaled - this one fought it and the buttons
   covered the keyboard hint) */
@media (hover:hover) and (pointer:fine) and (min-width:600px){
  /* the last term reserves the stats row above and the controls below, so the whole game fits
     without scrolling even on a short laptop window */
  html:not(.pcz) { --eg-h:max(360px, min(calc(62 * var(--vh)), 560px, calc(calc(100 * var(--vh)) - 350px))); --eg-w:calc(var(--eg-h) * .93); }
  /* desktop sizes width FROM height to keep the backdrop uncropped, so it opts out of the phone
     layout's flex-fill and max-height — those re-cropped the lit windows off the top. */
  html:not(.pcz) .eg-field { width:var(--eg-w); height:var(--eg-h); max-height:none; flex:0 0 auto; border-radius:20px; }
  html:not(.pcz) .eg-head, html:not(.pcz) .eg-ctrls, html:not(.pcz) .eg-kbd { width:var(--eg-w); margin-left:auto; margin-right:auto; }
  html:not(.pcz) .eg-stat b { font-size:28px; } html:not(.pcz) .eg-stat span{ font-size:11px; }
  html:not(.pcz) .eg-tier { font-size:13px; padding:6px 14px; }
  html:not(.pcz) .eg-btn { font-size:28px; height:86px; }
  html:not(.pcz) .eg-kbd { font-size:14px; color:rgba(255,255,255,.62); }
  html:not(.pcz) .eg-kbd b { color:#9fe8ff; background:rgba(159,232,255,.10); border:1px solid rgba(159,232,255,.28);
    border-radius:6px; padding:1px 7px; margin:0 2px; }
}
/* Firmer than they were. The fill and the 1px border were tuned for a flat dark page; now they
   sit on artwork — brickwork, an archway, eggs falling behind them — and at .11 the EDGE was the
   part that disappeared. Where the button ends matters more than how it looks: a thumb aiming at
   a boundary it cannot see drifts low, and low is the one direction with a real cost. */
.eg-btn{ flex:1; height:92px; border-radius:20px; border:2px solid rgba(255,255,255,.38); background:linear-gradient(180deg,rgba(255,255,255,.20),rgba(255,255,255,.10));
  color:#eef2f8; font-family:var(--disp); font-size:26px; display:flex; align-items:center; justify-content:center; gap:8px; user-select:none; -webkit-user-select:none; touch-action:none; }
.eg-btn.on, .eg-btn:active{ background:linear-gradient(180deg,rgba(0,240,255,.28),rgba(0,240,255,.12)); border-color:rgba(0,240,255,.6); transform:scale(.97); }
/* STUNNED. For the 1s after a Voltorb she cannot move, but the buttons went on looking live and
   still lit up cyan on every press — the game answering "yes, got it" while she stands there
   doing nothing. That reads as a dropped input, not as a penalty you are serving. Deaden them
   for the duration and suppress the pressed highlight, so the controls say why she isn't moving. */
.eg-ctrls .eg-btn{ transition:opacity .12s, filter .12s; }
.eg-ctrls.stunned .eg-btn{ opacity:.34; --toy-fx:saturate(.25); filter:var(--toy-fx, opacity(1)) drop-shadow(0 var(--toy-drop, 0px) 0 var(--toy-drop-c, transparent)) var(--toy-under, opacity(1)); }
.eg-ctrls.stunned .eg-btn.on, .eg-ctrls.stunned .eg-btn:active{
  background:linear-gradient(180deg,rgba(255,255,255,.20),rgba(255,255,255,.10)); border-color:rgba(255,255,255,.38); transform:none; }
/* the arrow glyph is its own touch target, and the universal `*` rule would leave it on
   'manipulation' — a press landing on the arrow could still be claimed as a pan */
.eg-btn svg{ width:34px; }
/* Perfect run on the player's own end screen — the gold matches the ★ PERFECT badge the big screen
   puts next to their name, so the two read as the same award. */
.eg-perfect{ display:inline-block; margin:0 auto 6px; font-family:var(--disp); font-size:15px; letter-spacing:2px;
  color:#3a2a00; background:linear-gradient(180deg,#ffe27a,#f5b301); padding:6px 16px; border-radius:999px;
  box-shadow:0 0 22px rgba(245,197,66,.55); --toy-drop:0px; --toy-drop-c:transparent; --toy-under:opacity(1); animation:egPerf 1.6s ease-in-out infinite alternate; }
@keyframes egPerf{ from{ transform:scale(1); box-shadow:0 0 16px rgba(245,197,66,.42); }
                   to{ transform:scale(1.045); box-shadow:0 0 30px rgba(245,197,66,.75); } }
.eg-perfectsub{ margin:2px 0 0; font-size:13px; color:#ffd23f; }

@media (prefers-reduced-motion: reduce){ .eg-perfect{ animation:none; } }
/* NO DIM ON THE FIELD DURING A STUN, deliberately. This rule began as a copy of Whack's old
   .wa-grid.frozen with its pointer-events:none dropped — and that half was where the meaning
   lived: there the grid IS what you tap, so dimming what you just disabled is honest. (Whack's
   stun has since been cut entirely; this one stays, because a Voltorb really does take the
   controls away.) Here you never touch the field;
   you press the L/R buttons, and .eg-ctrls.stunned already dims those. Compared side by side the
   dim was doing three things, two of them backwards: the shock sprite is a saturated blue-and-
   yellow flash against warm brick and never needed help to read; ZAPPED! is #ff6b6b and got
   HARDER to read against it; and brightness() multiplies the always-on ::before scrim, dragging
   the top of the field from 61 to 37 — dark enough to stop reading as brickwork and start
   reading as a panel laid over the game. Five signals remain: the sprite, the shake, the banner
   and its countdown, the dimmed buttons, and the zap. The class is still applied — it is a
   useful hook — it simply no longer paints. */

.eg-trip{ position:absolute; inset:0; display:none; align-items:center; justify-content:center; z-index:9; pointer-events:none; }
.eg-trip.on{ display:flex; }
/* ZAPPED!: the toy lettering in electric yellow, leaning forward like a jolt, a bolt either side and a blue-white
   glow round it (Daniel, 2026-11-06: "a little more electrical") */
.eg-tripbox{ display:flex; flex-direction:column; align-items:center; font-family:var(--disp); color:#FFE066; font-size:38px; letter-spacing:2px; }
.eg-zw{ display:flex; align-items:center; gap:6px; transform:skewX(-10deg); }
.eg-zw b{ font-weight:400; -webkit-text-stroke:4px var(--toy-ink-color); paint-order:stroke fill; text-shadow:0 4px 0 var(--toy-ink-color),0 3px 0 var(--toy-ink-color),0 2px 0 var(--toy-ink-color),0 1px 0 var(--toy-ink-color),0 0 10px #7DF9FF,0 0 22px rgba(125,249,255,.75); }
.eg-zw img{ width:34px; --toy-fx:drop-shadow(0 2px 0 var(--toy-ink-color)); filter:var(--toy-fx, opacity(1)) drop-shadow(0 var(--toy-drop, 0px) 0 var(--toy-drop-c, transparent)) var(--toy-under, opacity(1)); } .eg-zw img.flip{ transform:scaleX(-1); }
.eg-triptrack{ width:130px; height:12px; border-radius:999px; background:var(--toy-bg-eggshell); border:2.5px solid var(--toy-ink-color); box-shadow:0 2px 0 var(--toy-ink-color), 0 1.67px 0 var(--toy-ink-color), 0 1.33px 0 var(--toy-ink-color), 0 0.67px 0 var(--toy-ink-color), 0 0.33px 0 var(--toy-ink-color), 0 1px 0 var(--toy-ink-color); --toy-drop:0px; --toy-drop-c:transparent; --toy-under:opacity(1); margin:8px auto 0; overflow:hidden; }
.eg-triptrack i{ display:block; height:100%; width:100%; background:#FFC700; transform-origin:left; animation:egTripBar 1s linear forwards; }
@keyframes egTripBar{ from{ transform:scaleX(1);} to{ transform:scaleX(0);} }

/* Holding a control made iOS start a text selection and drag it across the HUD/field. */
/* Keep the L/R row clear of the browser's own bottom toolbar. On iOS the buttons ended up ~12px
   above Safari's chrome — its back arrow sits directly under the L button — so a thumb aiming low
   hit the toolbar and the press never reached the page at all (no touch event, nothing to log).
   The field above is sized in dvh for the same reason: `vh` is the toolbar-hidden height, so it
   was reserving more room than the screen actually shows and pushing this row down. */
/* Bound the page to the screen for the duration of the round. The body normally GROWS with its
   content (so tall pages scroll), but here that let the control row drift under the browser's
   toolbar on a short phone. Bounded, the field's flex-shrink takes the hit instead — no scrolling
   mid-round, and no hand-tuned height reserve to go stale. */
/* Flat 18px, NOT the safe-area inset. `dvh` already excludes the browser toolbar and the home
   indicator, so padding by the inset on top double-counted it and stranded ~60px of dead space
   under the controls. The row carries its own 14px of hit area below the buttons on top of this. */
/* The bottom inset is NOT decoration. The base rule uses max(16px, env(safe-area-inset-bottom));
   this rule used to override it with a flat 18px, which on any iPhone with a home indicator (inset
   34px) dropped the L/R buttons 16px INTO the system swipe-up zone. A touch that starts there can
   be claimed by iOS for its own gesture and never delivered to the page at all — no event, no
   handler, nothing to log. That is a press that genuinely does not register, and it is the one
   fault the control log could never see, because there is nothing to see.
   Keep the inset, and let the field give up the space instead. */
/* touch-action does not inherit, and the page default is 'manipulation', which still PERMITS
   pinch. The field and the control row set 'none' individually, but the header, the subtitle and
   the body itself did not — so a second finger landing anywhere else could still start a gesture,
   and a recognised gesture is the one thing that makes WebKit stop delivering touches. During a
   round nothing here is meant to be zoomed or panned. */
body.eg-focus, body.eg-focus *{ touch-action:none; }
/* PINNED. Measured on-device: the same page with these settings dropped 3 presses in 99, and
   without them 21 in 173 — a four-fold difference. The less scope iOS has to interpret a touch
   as one of its own gestures, the fewer presses it withholds. Nothing here scrolls during a
   round anyway; position:fixed removes even the possibility of a scroll beginning. */
html:has(body.eg-focus){ overflow:hidden; overscroll-behavior:none; }
/* PINNED TO THE VISUAL VIEWPORT, not the layout one. `position:fixed; inset:0` anchors to the
   LAYOUT viewport, whose top sits BEHIND Safari's URL bar, while `height:calc(100 * var(--dvh))` measures the
   VISUAL viewport, which is shorter. Holding both at once shoved the whole column up by roughly
   the URL bar's height: the stats row was clipped off the top of the screen and a bank of dead
   space collected under the buttons. --vv-top / --vv-h come from visualViewport (see
   syncViewport) so the column lands exactly on what the player can actually see, and dvh is only
   the fallback for a browser without it. */
body.eg-focus{ position:fixed; left:0; right:0; top:var(--vv-top, 0px);
  height:var(--vv-h, calc(100 * var(--dvh))); overscroll-behavior:none; }
/* Tighten the column so the board gets the room instead of the gaps between rows — the same trim
   Word Rush does in its focus mode. Four 18px gaps plus the stage's own padding was ~55px that
   the play field could be using. */
body.eg-focus .stage{ gap:8px; }
/* THE CONTROLS FLOAT OVER THE FIELD. The lift that stopped the dropped presses costs ~76px of
   screen, and the stage face below Chansey's ledge costs another slice — two bands of decorative
   emptiness, stacked. Overlap them instead: the field runs all the way to the bottom, the buttons
   sit on top of its lower part, and the region the thumbs cover IS the stage face things fall
   past. The lift is unchanged — the buttons are exactly as far off the bottom edge as they were —
   but the space behind them is artwork now instead of nothing, and the field gets bigger rather
   than smaller. Absolute, not fixed: body.eg-focus is the containing block, so this rides the
   visual-viewport pinning above instead of re-anchoring to the layout viewport. */
body.eg-focus .eg-field{ max-height:none; }
/* THE SCORES RIDE BELOW THE BUTTONS. The lift reserves ~96px at the bottom of the screen that no
   touch target may ever occupy — putting one there is the exact fault the lift exists to avoid —
   but nothing stops a READOUT living in it, and the original puts its scores in the same place,
   over the lower storey. Moving them out of the column gives every pixel they were using back to
   the play field. Never interactive: display only, pointer-events:none. */
body.eg-focus .eg-head{ position:absolute; left:16px; right:16px; z-index:21;
  bottom:max(18px, calc(var(--sab) - 12px)); gap:8px; pointer-events:none; }
/* EGG EMERGENCY ONLY: the readout goes back to the TOP and the page chrome goes to the bottom.
   The eyes are up there — that is where the eggs come from, and it is where you are looking for
   the whole round — so the two numbers that decide the round belong in the same place, not below
   the controls where you have to look away from the falling eggs to read them. The brand, mode,
   Standings, points and name matter between rounds, not during one, so they take the low ground.
   This overrides the bottom placement declared just above; both are kept so the reasoning for the
   band below the buttons survives, and swapping back is one rule. */
body.eg-focus .eg-head{ top:max(6px, calc(var(--sat, 0px) + 2px)); bottom:auto; }
/* The chrome is absolute, so it leaves the flow entirely and the field gets the height it was
   using. It rides the same reserved band the scores used to: below the lifted controls, where the
   lift already guarantees nothing of the game is. */
/* top:auto matters — the base rule is position:sticky with top:0, and an absolutely positioned box
   with BOTH top and bottom set stretches between them. Left in, it rendered 758px tall. The base
   padding goes too: it carries the safe-area inset for a bar at the TOP of the screen, which at
   the bottom is just a gap. */
/* (a computer keeps the bar in the top corners, out of the field's flow - no thumbs there to keep clear of; below) */
html:not(.pcz) body.eg-focus .top{ position:absolute; left:16px; right:16px; top:auto; z-index:21; margin:0;
  bottom:max(10px, calc(var(--sab) - 14px)); gap:8px; padding:6px 10px; border-radius:14px;
  background:var(--t-tile); border:var(--toy-border-inset); box-shadow:none; --toy-drop:2px; --toy-drop-c:var(--toy-ink-color); --toy-under:opacity(1);   /* the toy chassis (it was smoky dark glass) */
  transform:scale(.92); transform-origin:50% 100%; filter:var(--toy-fx, opacity(1)) drop-shadow(0 var(--toy-drop, 0px) 0 var(--toy-drop-c, transparent)) var(--toy-under, opacity(1))}
/* The scores were display-only down there for a reason — that band is the one place a stray thumb
   reaching for L or R lands. These ARE touch targets, so they are held off during play and handed
   back the moment the round ends. */
html.pcz body.eg-focus .top{ position:absolute; top:0; left:calc(-1 * var(--pcx)); right:calc(-1 * var(--pcx)); margin:0; z-index:21; }
/* A WIDE COMPUTER WINDOW (7:4 and wider) IS THE HOUSE, as Clear Cut's is its dojo: egg/house-wide.webp, Gemini's wide
   painting of this same wall (its middle bay is bg3's roof and balconies) with trees, bunting and its own stone walkway.
   The walkway is put on the catch line - syncLedge measures where Chansey stands and hands it over (--eg-walk-y, window
   px), and the painting is sized so its walkway lands there. The field keeps its size, lanes and fall;
   it only loses its box, its own plate and its stage front, so the eggs fall past the house's bricks and Chansey stands
   on its stones. The painting itself is the page's background: toy.css, with the computer's other backgrounds. */
@media (min-aspect-ratio:7/4){
  html.pcz body.eg-focus .eg-field{ background:none; border:0; border-radius:0; box-shadow:none; --toy-drop:0px; --toy-drop-c:transparent; --toy-under:opacity(1); }
  html.pcz body.eg-focus .eg-field::before{ display:none; }
  html.pcz body.eg-focus .eg-ledge{ background:none; box-shadow:none; --toy-drop:0px; --toy-drop-c:transparent; --toy-under:opacity(1); }
}
html:not(.pcz) body.eg-focus.eg-playing .top{ pointer-events:none; opacity:.75; }
/* ...and it must not LOOK pressable while it isn't. Standings opens a FULL-SCREEN panel, so a
   stray thumb reaching for L or R would bury the field mid-round and cost the player eggs — worse
   than the button being unavailable for the 30s a round lasts. Every other screen keeps it live,
   because everywhere else this bar is at the TOP, out of the thumb's path.
   Nothing is lost by it: audio unlocks from a window-level capture listener on ANY touch, so the
   sound pill here is an indicator, not the way back to sound. */
html:not(.pcz) body.eg-focus.eg-playing .standbtn, html:not(.pcz) body.eg-focus.eg-playing .sndpill{
  background:none; border-color:transparent; box-shadow:none; --toy-drop:0px; --toy-drop-c:transparent; --toy-under:opacity(1); }
html:not(.pcz) body.eg-focus.eg-playing .standbtn, html:not(.pcz) body.eg-focus.eg-playing .sndpill{ color:var(--t-ink2); }   /* flat icons in ink on the light chassis (white vanished into it) */
html:not(.pcz) body.eg-focus.eg-playing .standbtn svg{ opacity:.6; }
/* The stage starts below the readout rather than under it. */
body.eg-focus .stage{ padding-top:46px; }
/* They sit on brickwork now, not on the page's flat dark. Without a ground of their own the
   numbers read straight into the mortar. */
/* .74 was enough over brickwork, but a Voltorb falling past the stage face passes BEHIND these
   cards and showed straight through the numbers — the score and the clock are the two things that
   must stay readable at a glance. */
:is(body.eg-focus, .egd) .eg-stat{ padding:3px 6px; }
:is(body.eg-focus, .egd) .eg-stat b{ font-size:17px; }
:is(body.eg-focus, .egd) .eg-stat span{ font-size:9px; }
/* THE EGG COUNT IS THE NUMBER OF THE ROUND, so it gets the size. Stacked "12" over "of 75" spent
   the row's height on the label; laid out on one baseline the same row carries a number half as
   big again, and the field loses nothing — this row's height is unchanged. */
/* grid, not flex: the stat boxes stretch to the tallest of them (TIME is two lines), and a flex
   ROW inside a taller box sits at its top — which is why the count read high rather than centred.
   align-content centres the single row in whatever height the box ends up with. */
:is(body.eg-focus, .egd) .eg-stat.score{ display:grid; grid-auto-flow:column; column-gap:.3em;
  justify-content:center; align-content:center; align-items:center; }   /* centred on one axis: the egg, the count and its / 75 (it sagged on the baseline) */
:is(body.eg-focus, .egd) .eg-stat.score b{ font-size:26px; letter-spacing:-.5px; }
:is(body.eg-focus, .egd) .eg-stat.score span{ font-size:11px; letter-spacing:1px; }
:is(body.eg-focus, .egd) .eg-stat.time b{ font-size:26px; }   /* the clock's seconds, the count's size */
:is(body.eg-focus, .egd) .eg-stat.time .eg-clock{ width:24px; height:24px; }
/* THE OUTER PILLS HUG WHAT THEY HOLD (2026-11-06): stretched to share the row, each was mostly empty cream over the top of the
   wall, where the eggs come in. Now each is its icon and number with a little air, the same width as the other (min-width)
   so the pair stays symmetrical, tabular figures so 9 -> 10 doesn't nudge them, and the three spread across the bar. */
:is(body.eg-focus, .egd) .eg-head{ justify-content:space-between; align-items:center; }
:is(body.eg-focus, .egd) .eg-stat{ flex:0 0 auto; min-width:108px; padding:3px 12px; box-sizing:border-box; }
:is(body.eg-focus, .egd) .eg-stat b{ font-variant-numeric:tabular-nums; }
:is(body.eg-focus, .egd) .eg-stat.score .eg-eggic{ width:18px; height:22px; }   /* the stopwatch's height, clear of the bevel */
body.eg-focus .eg-tier{ font-size:10px; padding:4px 9px; }
/* The scoring rules are on the tutorial screen you just came from. Mid-round this line is read
   once and then costs height for the rest of the round. */
/* The bottom inset moves from the BODY to the control row. Nothing sits in the flow down there any
   more, so reserving it on the body only stopped the field short of the screen edge — and an
   absolutely positioned child measures `bottom` from the padding EDGE, so the body's padding was
   not protecting the buttons either, it was quietly eating 22px of the lift. The row carries its
   own inset now; the field runs to the glass. */
body.eg-focus{ padding-bottom:0; }
body.eg-focus .stage{ padding-bottom:0; }
/* FULL SCREEN, as Whack, Rock Harden, Stampede and Breakaway play (Daniel, 2026-11-06: "make egg emergency also a full
   screen game like the others"): the brick wall IS the screen, edge to edge and top to bottom, not a gold-rimmed panel
   16px in with the party backdrop down each side. The readout, the rules line, the buttons and the page bar float on
   it; the buttons keep their own 16px off each edge (below - iOS's edge swipe). Phones only: a computer keeps the
   framed column, sized from its height so the backdrop's lit windows aren't cropped (the desktop block above). After the
   stage's padding-top above, which it overrides on a phone. */
@media not all and (hover:hover) and (pointer:fine) and (min-width:600px){
  body.eg-focus{ padding-top:0; padding-left:0; padding-right:0; }
  body.eg-focus .stage{ padding:0; }
  body.eg-focus .eg-field{ width:100%; margin:0; border:0; border-radius:0; box-shadow:none; --toy-drop:0px; --toy-drop-c:transparent; --toy-under:opacity(1); }
  /* ON THE BIG SCREEN sits under L and R, in the band between the buttons and the bar (Daniel, 2026-11-17: "the top is
     important because that's where the players' eyes are on the falling eggs"). The band runs from the bar's top, about
     30px over the row's foot, to the buttons' foot, 14px + the lift over it (.eg-ctrls' padding); the tag is centred in it. */
  body.eg-focus .eg-air{ top:auto; bottom:calc(max(22px, var(--sab)) + (48px + var(--eg-lift, 0px)) / 2); transform:translate(-50%, 50%); }
}
/* KEEP THE ROW OFF ALL THREE EDGES, not just the bottom. Going absolute made this full-bleed and
   the buttons ran x 0..402 — flush with the left and right edges, which is where iOS runs its
   back/forward swipe. That is the same fault the bottom lift exists to avoid, reintroduced on the
   sides, and a round on it brought the dropped presses straight back. The 16px inset restores the
   geometry every clean round was measured on (L x 16..195, R x 207..386).
   The bottom is 22px, not 18: the stage used to contribute 4px of padding under the row, and
   dropping that quietly took the tested 76px clearance down to 72. */
body.eg-focus .eg-ctrls{ position:absolute; left:50%; transform:translateX(-50%);
  bottom:max(22px, var(--sab)); width:min(calc(100% - 32px), 430px); margin:0; z-index:20; }
body.eg-focus, body.eg-focus *{ -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; -webkit-tap-highlight-color:transparent; }

/* THE HOW-TO CARD'S DEMO (EggStage.wireDemo): the round itself, in the card's box. Drawn at an iPhone 14's width (390px,
   the round's own px) and scaled into the box as one piece - wireDemo sets the transform and the height - so every
   sprite, pose, pop-up and button is the round's at any box size. Its layout is the round's full screen: the wall edge to
   edge, the egg count over it (the readout's sizes above are shared), L and R floating at its foot. Not the clock, the
   tier, the keys line or ON THE BIG SCREEN: the board loops, and the card says the rest. No home-swipe zone in a card,
   so the buttons sit 16px off its foot rather than the round's lift. */
.egd{ position:absolute; left:0; top:0; width:390px; height:100%; transform-origin:0 0; overflow:hidden; text-align:center; }
.egd .eg-field{ position:absolute; inset:0; width:auto; height:auto; min-height:0; max-height:none; margin:0;
  border:0; border-radius:0; box-shadow:none; --toy-drop:0px; --toy-drop-c:transparent; --toy-under:opacity(1); }
.egd .eg-head{ position:absolute; left:16px; right:16px; top:10px; z-index:21; gap:8px; pointer-events:none; }
.egd .eg-stat.time, .egd .eg-tier, .egd .eg-kbd, .egd .eg-air{ display:none; }
.egd .eg-ctrls{ position:absolute; left:16px; right:16px; bottom:16px; width:auto; margin:0; padding:8px 0 14px; z-index:20; }
.egd, .egd *{ touch-action:none; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
