/* THE FONT @import HAS MOVED INTO index.html (9 August, stage 1, plan section
   12.3). It is not deleted - the same two families load, from the same URL,
   with the same display=swap - it is hoisted two hops up so the preload scanner
   can see it. An @import on line 1 of a stylesheet hides the request behind two
   round trips the scanner cannot look through, and once the module graph is
   preloaded that chain becomes the thing first paint waits for: measured at 192
   milliseconds. Do not put it back here. */

:root {
  /* LIGHT ONLY. The companion to <meta name="color-scheme"> in index.html, and
     both are needed: the meta is read before this file arrives, this one is
     what form controls and scrollbars key off. Dark mode is refused, not
     deferred (plan section 8.10) - no @media (prefers-color-scheme: dark) block
     is written anywhere in this file. */
  color-scheme: light;

  /* Color palette - warm afternoon tea theme */
  --color-cream: #FBF5EC;
  --color-card: #FFFFFF;
  --color-border: #E8D5B7;
  --color-accent: #C17B5C;
  --color-accent-hover: #A0624A;
  /* THE DEEP ACCENT (defect 1, 9 August). White on --color-accent measures
     3.36:1, so every primary button in the game failed the 4.5:1 text bar on
     the ground it already had. White on this measures 6.15:1. It is a token
     rather than a literal because plan section 8.7 puts every icon stroke on it
     too, and stage 3's token layer will not re-add it. */
  --accent-deep: #8E5239;
  /* GOLD IS #C9A227 - Dean's decision 5 of 10/08/2026, applied by stage 8. The
     project shipped #D4AF37 while the motion prototype used #C9A227 and the
     plan never named a hex; the prototype's value wins, because it is what the
     motion work was judged against, it is deeper and less brassy, and it reads
     2.14:1 on cream against 1.90:1. It is a REPLACEMENT rather than a second
     gold, so this declaration and the 28 rgba() literals derived from it move
     together - four of those literals are stage 4's, written before the fork
     was settled. Contrast is not load-bearing here: decision 15's gold is
     carried by COUNT, two concentric rings against the accent's one. */
  --color-accent-gold: #C9A227;
  /* THE FLAVOUR OF THE DAY's colour (6 August), and it is the last free slot on
     the meters rail: the tea gauge owns gold, the Tasting Menus own the green
     family, and a fourth panel that borrowed either would read as belonging to
     it. Rose is also the one accent that reads as "ingredient" rather than as a
     status - it is a deeper relative of --tile-pink, deliberately, since the
     thing it marks IS a tile. */
  --color-accent-pink: #C4708A;
  --color-text-primary: #3D2B1F;
  /* DEEPENED FROM #7A6050 (defect 2, 9 August). The old value passed only
     because today's page is one flat #FBF5EC, where it measures 5.36:1; on the
     painted grounds stage 4 brings it fell to 4.31:1 on the cloth's shaded stop
     and 3.71:1 on the wall's. #6B5040 measures 6.81:1 on today's cream and
     holds 4.72:1 on the deepest ground the finished screen will have. */
  --color-text-secondary: #6B5040;
  --color-danger: #C0392B;
  --color-success: #5A8A5C;
  --color-disabled: #CCCCCC;

  /* Game tile colours */
  --tile-yellow: #F5D76E;
  --tile-pink: #F4A9BB;
  --tile-green: #8CC88C;
  --tile-blue: #7EC8E3;
  --tile-orange: #F0974A;

  /* ---- Sizing tokens ------------------------------------------------------
     EVERY load-bearing dimension in the game screen is a token, and the values
     here are the XL (1800px+) ones, which is the signed-off layout. The
     responsive bands below XL override TOKEN VALUES ONLY and never touch a
     component rule - that separation is the whole reason the breakpoints stay
     small and the XL layout stays frozen. See ../Web UI/RESPONSIVE_PLAN_2026-08-04_v4.md
     section 4 for the per-band table.

     Two of these have hard floors that are not negotiable by any breakpoint:
       - a tile a player must TAP cannot go below 44px (platform touch target),
         which is why --tile-size bottoms out at 44 and --tile-size-opp does not;
       - opponent boards are display-only, so --tile-size-opp is free to go all
         the way down to 14px, and that asymmetry is what makes the single-column
         layout fit an iPad at all. */
  --tile-size: 60px;
  /* Opponent boards. Identical to --tile-size at XL, so this token is inert
     until the L band; below that the opponents shrink and eventually drop their
     ingredient symbols entirely, leaving colour-only boards. */
  --tile-size-opp: 60px;
  --tile-gap: 2px;
  /* THE WIDTH OF A BOARD COLUMN. A 5x5 grid of tiles, the gaps between them,
     .ft-board-grid's padding, and its 1px border each side.

     Two things are sized from it and they must agree or the seat tears: the
     board column itself, and - from the L band down, where the two stack - the
     score column above it.

     IT MUST BE RE-DECLARED WHEREVER --tile-size IS, and .ft-seat--opp does
     exactly that. A var() inside a custom property is substituted at the element
     that DECLARES it, not at the element that uses it; the result then inherits
     already resolved. So this one is frozen at :root's --tile-size, and an
     opponent seat redefining --tile-size underneath would otherwise keep
     inheriting a width computed from the wrong one - a 226px board sitting in a
     266px column, which is precisely what it did before the redeclaration was
     added. */
  --board-col-width: calc(5 * var(--tile-size) + 4 * var(--tile-gap)
                          + 2 * var(--spacing-sm) + 2px);
  /* The tile market's two gutter tracks, which hold the sweep buttons. They were
     a full --tile-size each; the buttons only ever needed enough room for an
     arrow and a label, and the height of that top row is pure page height.
     BOTH are under the 44px touch floor, so both go to 44 at M and below - the
     sweep buttons are the primary control and must be tappable. */
  --market-gutter-h: 26px;
  --market-gutter-w: 34px;
  /* The centre column's fixed width. Band 3 (the card row) flex-wraps and sets
     no floor, so this is bounded only by band 2 (market + meters) - about 658px
     at a 60px tile. The 800 here is headroom, not a requirement. */
  --centre-width: 800px;
  /* The score column beside each player's board. */
  --score-col-min: 200px;
  /* One plate on the cake stand. */
  --stand-plate: 34px;
  /* Reward card height. Width follows from the sprite sheet's aspect ratio
     rather than being computed in JS - see .card-market-sprite. */
  --card-height: 235px;
  /* Minimum height forced onto controls that become tap targets. Zero at XL and
     L (mouse-driven widths), 44px at M and below. */
  --touch-target: 0px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 20px;
  --spacing-2xl: 24px;

  /* Shadows */
  --shadow-card: 0 2px 8px rgba(61, 43, 31, 0.12);
  --shadow-card-hover: 0 4px 12px rgba(61, 43, 31, 0.16);
  --shadow-modal: 0 8px 24px rgba(61, 43, 31, 0.2);

  /* ========================================================================
     THE TOKEN LAYER - stage 3 of the phone and visual plan, 10 August 2026.

     Every value below is ADDED. Nothing above it changed and nothing in this
     file consumes any of it yet: the whole acceptance test for this stage is
     that the screenshot diff against the post-stage-2 build is empty at every
     band. STAGE 4 IS WHAT WIRES THESE UP.

     Source: ../Web UI/phone-and-visual-plan-2026-08-09-v1.md, sections 7 and
     8.3 to 8.6 and 8.9, cross-checked against the prototypes in
     ../Web UI/wayfinder/prototypes/. Where a plan name holds a value that
     already has a legacy name in this file, BOTH are declared and the hex is
     written out rather than aliased, so that changing one can never silently
     move the other. --color-cream is the case that matters: stage 4 reassigns
     it from the page to the panel, which is exactly why --surface below
     carries its own literal rather than pointing at it.
     ======================================================================== */

  /* ---- 8.3 The grounds ---------------------------------------------------
     The page is the WALL and the board areas sit on the CLOTH, so the game
     screen composes the way hero.jpg does: wallpaper behind, cloth in front,
     painted objects on the cloth. Y is relative luminance, and the 22.3 points
     between the wall and the cloth's lit stop are what make the cloth read as
     a lit thing in front of a shaded one. */
  --wall: #E4D7C0;         /* Y 68.9  the page background, carries the floral */
  --wall-lit: #EBE1D0;     /* Y 76.1  upper left, where the 10 o'clock light lands */
  --wall-deep: #DCCDB4;    /* Y 62.2  lower right of the one 163deg fall */

  --cloth-lit: #FFF0DB;    /* Y 88.7  the ground of the BOARD AREAS only, */
  --cloth-mid: #FBE7CE;    /* Y 82.1  three stops on one 163deg fall */
  --cloth-shade: #EDDCC0;  /* Y 73.0 */

  --surface: #FBF5EC;      /* Y 91.9  panels, sheets, strips */
  --surface-rgb: 251, 245, 236; /* the same colour as three channels, for the one
                                   place that needs it at an alpha: the card
                                   row's edge fades. Held the way --shadow-ink is
                                   rather than faded to `transparent`, which is
                                   transparent BLACK and greys the fall. */
  --object: #FFFFFF;       /* Y 100   a goal card face, a tasting menu face, nothing else */
  --inverse: #3D2B1F;      /* Y 3.0   the one dark surface: the turn bar */
  --recess: #E9D9BE;       /* Y 70.7  the 5x5 pressed into the cloth. FLAT and OPAQUE */
  --dent: #E2D3BB;         /* Y 66.3  an empty cell */
  --near-wall: #DFCEB0;    /*         the recess's 1px inner border */

  /* The recess is flat and opaque and that is a decision, not an oversight:
     decision 17 is a FLOOR ON A VALUE, and a gradient turns a floor into a
     range. A flat #E9D9BE makes the yellow tile's guarantee identical in all
     twenty-five cells. Do not make it a wash. */

  /* ---- The five china stops (8.6, the empty plate) -----------------------
     Sampled off empty_plate.png, whose filigree renders at 0.39 / 0.32 / 0.29
     CSS px and whose scallops render at 1.11 / 0.89 / 0.81 - under the 2.00px
     floor at every size, four times further under it than the nut symbol. Stage 4
     replaces the image with a CSS plate built from these, at zero bytes. */
  --china: #F1EADE;        /* Y 82.8  the body's mid stop */
  --china-lit: #FCF8F0;    /* Y 94.1 */
  --china-well: #F2EBE0;   /*         the well, drawn as light rather than as a colour */
  --china-shade: #D9D4CB;  /* Y 66.2 */
  --china-dk: #A7B1B9;     /* Y 43.2  the rim line: the filigree's own blue-grey */

  /* ---- 8.1 The light -----------------------------------------------------
     ONE light. Upper left, 10 o'clock in plan, about 60 degrees above the
     table, never re-lit at any size in any component on any screen.

     THE SHADOW IS NEVER BLACK. Measured across 555 shadow pixels on
     ingredient_bonus_back.png, the densest cast shadow reads #AAB6BF on
     #FFF9EB. Held as three channel numbers so it can be used at any alpha:
     rgba(var(--shadow-ink), .34). */
  --shadow-ink: 110, 122, 140;

  /* ---- 8.6 The tile: five colours as light / mid / dark triples ----------
     THE MIDS DO NOT MOVE. They are the printed tile colours and the goal
     cards' pattern swatches, and web and print may not diverge on the game's
     own colour language for a screen-only reason - which is why the mid below
     is an alias of the shipped --tile-<colour> rather than a second hex.

     The dark stop is also the tile's RIM (border: 1px solid var(--<c>-dk)),
     present at every size from 14 to 60, and it is what repays the separation
     the warmer cloth costs: yellow falls from dE 22.2 to 15.4 against the
     ground, and its rim reads 1.92:1 against the lit cloth.

     The dusty blue is refused with a measurement - it scores worse against
     green at every CVD type - so do not re-propose it. */
  --yellow-lt: #FBEBA9;  --yellow: var(--tile-yellow);  --yellow-dk: #D2AC4B;
  --pink-lt:   #FBD2DC;  --pink:   var(--tile-pink);    --pink-dk:   #D07F92;
  --green-lt:  #C0E4C0;  --green:  var(--tile-green);   --green-dk:  #689F6B;
  --blue-lt:   #B9E4F3;  --blue:   var(--tile-blue);    --blue-dk:   #529FBD;
  --orange-lt: #F9C28D;  --orange: var(--tile-orange);  --orange-dk: #CA722D;

  /* ---- 8.4 The inks ------------------------------------------------------
     Contrast against the nine grounds this screen has, from the plan's table:

                        object  surface  cloth-lit  cloth-shade  wall  wall-deep
       --ink            13.43   12.39    11.98      9.98         9.45  8.59
       --ink-soft        7.38    6.81     6.58      5.48         5.19  4.72
       --accent-deep     6.15    5.67     5.49      4.57         4.33  3.93
       --accent          3.36    3.10     3.00      2.49 FAILS   2.36  2.15 FAILS

     --accent #C17B5C IS A UI COLOUR. It never carries text and text never sits
     on it: it keeps every job that is a fill, a rail, a ring, a meter or a
     border, and by amendment 5 it is not an icon stroke either. --ink bottoms
     out at 8.59:1 and --ink-soft at 4.72:1, so the tables are the check and
     judgement is not.

     The rule that keeps this simple: NO TEXT OF ANY KIND SITS ON THE WALL. */
  --ink: #3D2B1F;          /* = the legacy --color-text-primary */
  --ink-soft: #6B5040;     /* = the legacy --color-text-secondary, deepened by stage 1 */
  --ink-inverse: #FBF5EC;  /* on --inverse, at 12.39:1 */
  --accent: #C17B5C;       /* = the legacy --color-accent */
  /* --accent-deep #8E5239 is declared at the top of this block; stage 1 added
     it for defect 1 and it needs no second definition. It is the token that
     stage 4 item 9 puts under .ft-setup__toggle-btn.active, which is white on
     --color-accent at 3.36:1 today - a live text failure no defect list named.
     White on --accent-deep is 6.15:1, so the token supports it as it stands. */

  /* THE PRIMARY BUTTON'S HOVER IS INVERTED AND THIS IS THE TOKEN THAT FIXES IT.
     Stage 1 moved .ft-btn--primary's fill to --accent-deep #8E5239 (defect 1),
     but .ft-btn--primary:hover still goes to --color-accent-hover #A0624A,
     which is LIGHTER than the base it is meant to deepen and drops white from
     6.15:1 to 4.84:1 on hover. Plan section 8.4 ruling 2 settles it in one
     phrase: --color-accent-hover "retires into" --accent-deep. It supplies no
     deeper stop for the new base, so the hover stops being a colour change and
     the button's hover feedback is the --shadow-card lift it already carries.

     Defined by stage 3 as an alias, wired by stage 4, and GIVEN ITS VALUE HERE
     by stage 5 - Dean's decision 4 of 10/08/2026, taken while stage 4 was
     already running, which is why the three land in three different stages.

     #7A4530 IS THE SAME HUE ONE STOP DEEPER than the #8E5239 base, so hover
     reinforces the contrast fix rather than eroding it as the old #A0624A did.
     Measured on the computed value: white on #7A4530 is 7.41:1 against the
     base's 6.15:1 and the retired hover's 4.84:1. The button therefore darkens
     under the pointer, which is the direction every other lift on the page
     already goes. */
  --accent-deep-hover: #7A4530;

  /* 8.5. --rule keeps exactly two jobs: separating rows inside a table, and
     the single edge where a persistent strip meets content. Every panel border
     dies in stage 4. Distinct from the legacy --color-border #E8D5B7. */
  --rule: #E0D2BC;

  /* ---- 8.9 Seat colour ---------------------------------------------------
     Four hues DELIBERATELY OFF THE TILE WHEEL, because today's four seat tints
     are four of the five tile hues and that stops working the moment the tile
     field is painted. All four clear 3:1 against every ground, 4.5:1 on the
     surface and the cloth, and carry white text at 5.8 to 7.3:1.

     Seat colour is a MARK, not a wash: a 4px rule, a 10px dot and an outline
     ring, all at zero layout width. It never fills a seat's ground and it
     never tints the cloth, a tile, the recess or a dent. */
  --seat-1: #9B3F4F;  /* claret: 6.02 on surface, 4.59 on wall, white 6.53 */
  --seat-2: #2C6E78;  /* teal:   5.37 on surface, 4.10 on wall, white 5.82 */
  --seat-3: #4E6B3A;  /* moss:   5.55 on surface, 4.24 on wall, white 6.02 */
  --seat-4: #6B4A7C;  /* plum:   6.69 on surface, 5.10 on wall, white 7.25 */

  /* ---- 8.5 Typography ----------------------------------------------------
     Eleven roles and that is the whole list. Fraunces is the voice of the
     game and is never uppercase, never letterspaced and never below 15px;
     Inter is the voice of the interface. No third face, no italic, and NO NEW
     WEBFONT WEIGHTS, so the type system costs zero bytes.

     The scale does not change by band except the two display roles, which drop
     below the M band - the override is in the max-width: 1149px block.

       token             px   face      weight  line   role
       --type-display    28   Fraunces  700     1.15   screen title, end-screen winner
       --type-title      20   Fraunces  600     1.2    a sheet title, and only that
       --type-heading    15   Fraunces  600     1.3    sentence case, L and XL only
       --type-figure     22   Fraunces  700     1      a number that is the point, tabular
       --type-figure-sm  16   Fraunces  700     1      the same figure inside a rail chip
       --type-body       14   Inter     400     1.5    sentences
       --type-body-sm    13   Inter     400     1.45   dense or secondary prose
       --type-label      13   Inter     600     1.2    buttons, chips, control labels
       --type-caption    12   Inter     400     1.4    the caption under a figure
       --type-micro      11   Inter     500     1.3    table headers, seat names, chip labels
       --type-stamp      10   Inter     700     1.15   +0.08em, uppercase. THE ONLY uppercase role */
  --type-display: 28px;
  --type-title: 20px;
  --type-heading: 15px;
  --type-figure: 22px;
  --type-figure-sm: 16px;
  --type-body: 14px;
  --type-body-sm: 13px;
  --type-label: 13px;
  --type-caption: 12px;
  --type-micro: 11px;
  --type-stamp: 10px;

  /* ---- 7. The motion vocabulary -----------------------------------------
     Four movements, three easing curves, and nothing exceeds 300ms: the
     gather's worst case is 200ms of travel plus four 20ms stagger steps, which
     is 280ms exactly. The count is the one thing allowed past it, because it
     blocks nothing.

     Three curves and no more. TRAVEL decelerates hard, because a thing that
     stops is a thing you can look at; ENTER is a rise; EXIT accelerates,
     because a dismissal should not be read twice. */
  --ft-dur-gather: 200ms;      /* a swept tile, market cell to swept tray */
  --ft-dur-settle: 160ms;      /* a tile landing on a cell of your own board */
  --ft-dur-plate: 240ms;       /* a claimed tile, board to cake stand */
  --ft-dur-dissolve: 180ms;    /* the claimed card, leaving for good */
  --ft-stagger: 20ms;          /* per tile in a gather */
  --ft-stagger-cap: 4;         /* ...capped at four steps, which is what holds 280ms */

  --ft-dur-bar: 180ms;         /* the phase bar, one step */
  --ft-dur-sheet-in: 220ms;    /* a sheet rising from the bottom edge */
  --ft-dur-sheet-out: 160ms;   /* ...and leaving, faster */
  --ft-dur-log: 180ms;         /* the log line arriving */
  --ft-dur-ring: 1600ms;       /* the gold ring's breath, infinite */

  /* The count is a rAF tween in JS rather than a CSS animation, but its
     numbers belong with the rest of the vocabulary: 25ms per point, clamped. */
  --ft-count-per-point: 25ms;
  --ft-dur-count-min: 300ms;
  --ft-dur-count-max: 700ms;

  --ft-ease-travel: cubic-bezier(.2, 0, 0, 1);
  --ft-ease-enter: cubic-bezier(.05, .7, .1, 1);
  --ft-ease-exit: cubic-bezier(.4, 0, 1, 1);

  /* ---- 8.6 / section 1: THE CLOTH RING ------------------------------------
     The cloth's own padding, the one dimension of the painted layer that
     changes by band: 14 at XL, 12 at L, 10 at M and S, 6 at an M opponent's
     24px board and none at an S opponent's 14px one.

     IT IS SPENT AS A NEGATIVE MARGIN ON THE HORIZONTAL AXIS, and that is not a
     flourish. XL is frozen by decision 6 at a measured content minimum of
     2181px, and 2181 is a sweep width: the right-hand seat's panel ends at
     2180.4 of a 2181px viewport, so the layout has SIX TENTHS OF A PIXEL of
     horizontal headroom and any ring at all would overflow it. Bleeding the
     ring outward costs nothing and the harness reads every width unchanged.
     Vertically it is real padding on a board (there is a swept-tile tray
     directly above your own) and a bleed on the market (whose wrap already
     carries more padding than the ring). */
  --cloth-ring: 14px;

  /* ---- 8.6 THE TILE'S FORM, AND THE SHRINK LADDER -------------------------
     Three values, declared here and OVERRIDDEN BY VALUE in the bands, which is
     what keeps the shrink ladder inside the rule that a band sets values and
     never component rules. The ladder, in full:

       60  XL, every board     rim, full form, ink, slab shadow 2px 3px
       48  L and M, your board rim, full form, ink, slab shadow 2px 3px
       44  phone, your board   rim, full form, ink, slab shadow 1px 2px
       42  ------------------- the nut symbol's two grooves go below here
       40  L, an opponent      rim, full form, ink less the nut's grooves
       33  ------------------- the floor for drawing an ingredient at all
       24  M, an opponent      rim, edge light only, no ink, no cast shadow
       14  phone, an opponent  rim only, no form, no ink, no cast shadow

     At 24 and 14 THE INGREDIENT IS NOT SHOWN AND IS NOT CLAIMED TO BE SHOWN, so
     nothing is being carried by colour alone and the hard constraint is intact.

     --form-edges is a custom property rather than three literals so that every
     state rule can re-declare box-shadow WITHOUT DELETING THE PAINT. A state
     adds a wash in front of the field; it must never subtract form. */
  --form-edges:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 1px 0 0 rgba(255, 255, 255, 0.30),
    inset -1px -1px 0 rgba(107, 78, 58, 0.26);

  /* --tile-field IS NOT DECLARED HERE, AND IT CANNOT BE. See the note over
     .ft-colour, where it lives. Stage 4 declared it on :root with var(--lt) /
     var(--mid) / var(--dk) inside it; those three are declared on the COLOUR
     CLASS, which is on the tile, so on :root the references were substituted
     against a root element that has none of them. The custom property computed
     to the empty string, `background: var(--tile-field)` became invalid at
     computed-value time, background-image came out `none`, and EVERY TILE IN
     THE GAME WAS A FLAT --mid FILL from stage 4 until stage 4a repaired it.
     Silently: no error, no fallback, no warning. Same trap --board-col-width
     documents below. A var() inside a custom property is substituted where the
     custom property is DECLARED, so a recipe must be declared on an element
     that already carries its ingredients. */

  /* The dent's form is the tile's form INVERTED - shade top and left, light
     bottom and right - and it shrinks on the same ladder. */
  --dent-edges:
    inset 0 2px 3px -1px rgba(var(--shadow-ink), 0.38),
    inset 2px 0 3px -2px rgba(var(--shadow-ink), 0.26),
    inset 0 -1px 0 rgba(255, 255, 255, 0.60),
    inset -1px 0 0 rgba(255, 255, 255, 0.35);

  /* The empty plate: the well's near wall, its far wall catching the light, and
     THE CONTACT SHADOW - the only shadow any object on this board casts at rest.
     2px 3px at 60 and 48, 1px 2px at 44, none below 24, and the disc grows from
     84 to 92 per cent of the cell as the detail drops, because the silhouette is
     all that is left and it needs the pixels. */
  --plate-size: 84%;
  --plate-body:
    radial-gradient(32% 32% at 26% 19%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 74%),
    radial-gradient(circle at 50% 50%,
      rgba(110, 122, 140, 0) 0 46%,
      rgba(110, 122, 140, 0.34) 57%,
      rgba(255, 255, 255, 0.55) 66%,
      rgba(255, 255, 255, 0) 76%),
    linear-gradient(148deg, var(--china-lit) 0%, var(--china) 50%, var(--china-shade) 100%);
  --plate-edges:
    inset 0 2px 3px -1px rgba(var(--shadow-ink), 0.34),
    inset 0 -2px 2px -1px rgba(255, 255, 255, 0.65),
    2px 3px 4px -1px rgba(var(--shadow-ink), 0.40);
}

/* REDUCED MOTION IS A DIFFERENT SET OF NUMBERS, NOT AN OFF SWITCH (section
   7.3). No browser auto-skips a view transition, so the branch has to be
   written, and every one of these keeps the information the movement carried:
   the gather keeps its STAGGER, because five things arriving one after another
   is a count and a count is information; the settle keeps its arrival and its
   position; the count still counts.

   TWO VALUES HERE ARE THE PLAN'S RATHER THAN THE PROTOTYPE'S. The plan's 7.3
   table says the plating reduces to a 120ms cross-fade with THE DISSOLVE
   UNCHANGED, so --ft-dur-dissolve stays at 180ms; the prototype CSS at
   ../Web UI/wayfinder/prototypes/motion-vocabulary-v1.css drops it to 120 and
   the plan outranks the prototype. The sheet's exit is the prototype's 100ms,
   which the plan does not state either way.

   The gold ring is NOT a duration change: with motion off the outer ring is
   HELD at the middle of its own range at opacity .45, so a gold thing still
   has two rings and an accent thing one. Stage 8 writes that rule. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --ft-dur-gather: 120ms;
    --ft-dur-settle: 100ms;
    --ft-dur-plate: 120ms;
    --ft-stagger: 15ms;
    --ft-dur-bar: 120ms;
    --ft-dur-sheet-in: 120ms;
    --ft-dur-sheet-out: 100ms;
    --ft-dur-count-max: 350ms;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* THE PAGE IS THE WALL (plan section 8.3, decision 12). --color-cream is not
   deleted and does not move - it is REASSIGNED from the page to the panel, which
   is why every panel below still names it and why --surface carries the same
   literal. What changes is what is behind them: one 163 degree fall from the 10
   o'clock light, 22.3 luminance points below the cloth's lit stop, so the cloth
   reads as a lit thing in front of a shaded thing.

   A wall at #E9DECB was tried and rejected: at Y 73.9 it is the same value as
   the cloth's own shaded edge and the far edge of the table dissolves into it.

   NOT background-attachment: fixed, which both prototypes use. A fixed
   attachment paints the fall against the VIEWPORT, so on the 3,000px page the
   phone band still has it covers the first screenful and leaves the rest of the
   wall unpainted - reproduced here at 390 and 2400 before it was changed. The
   fall belongs to the wall, so it runs the height of the wall. */
body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(163deg, var(--wall-lit) 0%, var(--wall) 48%, var(--wall-deep) 100%);
  background-repeat: no-repeat;
  color: var(--color-text-primary);
  font-size: 13px;
  line-height: 1.5;
  position: relative;
  min-height: 100dvh;
}

/* THE WALLPAPER (plan section 8.8, decision 19). The hero's own sprigged floral,
   keyed out of landing/hero.jpg, on a single 340px repeat at every band.

   TWELVE PER CENT, not the brief's 3 to 5. Opacity multiplies the pattern's OWN
   contrast, and this floral differs from the wall by only about 70 levels, so 5
   per cent is a 3.5-level shift and is invisible; 12 per cent is 11.2 levels.
   The PNG carries alpha rather than cream, so the number is the pattern's
   strength and the wall underneath is exactly the declared token.

   THE FAILURE THAT MATTERS IS SPATIAL FREQUENCY, NOT OPACITY. The repeat must be
   at least FOUR TIMES the tile pitch at every band or the two grids beat against
   each other: 340px against a 46px pitch is 7.4x at the phone's 44px tile, 6.8x
   at M and L's 48 and 5.5x at XL's 60. A 92px repeat at the same opacity is 2x
   and visibly interferes.

   Its own layer, behind everything and above the canvas, so its strength is one
   number and it can never end up in front of a painted object. It stops at the
   cloth's edge because the cloth is opaque and in front of it - the pattern is
   never behind a board at all, which is the structural half of why it survives a
   busy 5x5.

   Absolutely positioned over the whole document rather than fixed to the
   viewport, for the same reason the fall is: paper is on the wall, not on the
   window, and a fixed layer leaves everything below the first screenful bare. */
body::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('images/wallpaper-v1.png') repeat;
  background-size: 340px 340px;
  opacity: 0.12;
  pointer-events: none;
}

/* 100dvh, NOT 100vh (9 August, ticket 00 / finding 18). On mobile Safari and
   Chrome for Android, 100vh is the LARGE viewport - the height the page would
   have if the browser toolbars were hidden - so for the whole time the toolbars
   are showing, which is most of the time, a 100vh box is taller than the screen
   the player is looking at and the page starts life already scrollable. 100dvh
   is the viewport as it is right now and follows the toolbars as they retract.

   The two are identical on desktop and in a headless browser, so nothing above
   the phone band moves and nothing in the layout harness measures a difference.
   The change is only visible on the devices the whole map is about. */
#app {
  width: 100%;
  min-height: 100dvh;
}

/* ======= Typography ======= */

h1 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: var(--spacing-lg);
}

h2 {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

h3 {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

label {
  display: block;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

/* ======= THE INTERFACE ICON SET (stage 2, plan section 8.7) ================
   One inline <defs> sprite at the top of <body> in index.html, referenced by
   <use href="#i-name"> here. Thirteen drawings on a 16 x 16 grid at 1.5 stroke.

   THE INK IS --accent-deep #8E5239, NOT --accent (plan section 17, amendment
   5). --accent #C17B5C fails the 3:1 non-text bar on five of the nine grounds
   this build has and clears it by 0.00 to 0.10 on three of the remaining four.
   That is fine for a 4px seat rule, a 2px ring or a 999px wash, all of which
   are large areas or long runs. It is not fine for a 1.5px hairline, which is
   the hardest case there is and the only thing in the whole system drawn at
   that weight. --accent-deep clears 3:1 on every ground and 4.5:1 on every
   ground an icon can actually land on. --accent stays a fill, a rail, a ring,
   a meter or a border - never an ink.

   INSIDE A CONTROL THE ICON IS NOT BROWN. It takes currentColor, so it goes
   white on a filled primary button (6.15:1 on --accent-deep) and follows every
   state the label follows - which is why the sweep buttons' arrows need no
   rule of their own when .is-awaiting recolours the label.

   Sizes are set per site, in width/height attributes where they are fixed and
   in CSS where they change by band (the sweep arrows, 12 at XL and 16 in the
   touch band). The stroke scales with the drawing rather than being pinned
   with vector-effect: 16 and 24 are one drawing at two sizes, not two. */
.ft-icon {
  display: inline-block;
  vertical-align: -0.125em;   /* sits on the text baseline at any size */
  color: var(--accent-deep);
  flex: 0 0 auto;
  pointer-events: none;       /* the control takes the click, never the glyph */
}

button .ft-icon,
a .ft-icon {
  color: currentColor;
}

/* The word behind an icon that stands in for one. Off screen for sighted
   players, read normally by assistive technology, and zero page height - it is
   absolutely positioned out of flow, which is what lets the seat header lose
   "(Bot)" without losing the fact. */
.ft-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The seat header's 12px person/bot marker. inline-flex so the icon cannot
   shift the h2's line box, and the hidden word inside it is out of flow. */
.ft-seat__marker {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

/* ======= Landing / Setup Screen ======= */

.ft-landing {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--spacing-2xl) var(--spacing-xl) 0;
}

/* ==========================================================================
   THE RESUME CARD (stage 8, plan section 10, decision 4)

   ABOVE THE HERO, and emitted only when a valid save exists - so with no save
   the landing page is byte-for-byte what it is today, and a publisher opening
   the pitch link never sees this. It is a CARD IN THE FLOW rather than a modal,
   the same shape the rotate card takes, because a modal on arrival is the popup
   the phone model forbids twice over.

   Two buttons, 44px, DISMISSIVE TO THE LEFT OF CONFIRMING - Discard, then Resume
   game - which is the model's own reading of Material and the same order the
   sheets use.
   ========================================================================== */
.ft-resume {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--accent-deep);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.ft-resume__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: var(--type-title);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.ft-resume__position {
  font-size: var(--type-body);
  font-weight: 600;
  color: var(--color-text-primary);
}

.ft-resume__when,
.ft-resume__note {
  font-size: var(--type-caption);
  color: var(--color-text-secondary);
  margin-top: var(--spacing-xs);
}

.ft-resume__actions {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.ft-resume__actions .ft-btn {
  min-height: 44px;
}

/* --- Hero --- */

.ft-hero {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--spacing-md);
  text-align: center;
}

.ft-hero__art {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.ft-hero__tagline {
  font-family: 'Fraunces', serif;
  font-size: clamp(15px, 1.9vw, 19px);
  font-style: italic;
  color: var(--color-accent);
  margin: var(--spacing-md) 0 var(--spacing-xs);
}

/* --- Two-column layout: art + about | setup + stats --- */

.ft-landing__main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  align-items: start;
  margin-bottom: var(--spacing-2xl);
}

.ft-landing__col {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
  height: 100%;
}

/* The lower card in each column absorbs the slack so both columns end level. */
.ft-about,
.ft-stats {
  flex: 1;
}

/* Stat list - deliberately quiet, sits under the setup card */

.ft-stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-content: center;
  gap: var(--spacing-md);
  padding: var(--spacing-lg) var(--spacing-md);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.ft-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  text-align: center;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.ft-stat img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.ft-stat strong {
  display: block;
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1.2;
}

/* Card headings carry the sell sheet's gold rule. */
.ft-landing__heading,
.ft-play__title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  color: var(--color-accent);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--color-accent-gold);
  margin-bottom: var(--spacing-lg);
}

.ft-about {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--spacing-xl);
}

.ft-about p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text-secondary);
}

.ft-about p + p {
  margin-top: var(--spacing-md);
}

.ft-play {
  background: var(--color-card);
  border: 2px solid var(--color-accent-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-hover);
  padding: var(--spacing-xl);
}

.ft-play__actions {
  display: flex;
  gap: var(--spacing-sm);
}

.ft-play__actions .ft-btn--secondary { flex: 1; }
.ft-play__actions .ft-btn--primary { flex: 2; padding: 12px; }

/* --- Footer --- */

.ft-landing__footer {
  text-align: center;
  padding: var(--spacing-xl) 0 var(--spacing-2xl);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 12px;
}

.ft-landing__footer a {
  color: var(--color-accent);
}

.ft-landing__fineprint {
  margin-top: var(--spacing-xs);
  opacity: 0.75;
}

/* THE LANDING PAGE, retuned to the game's own band boundaries (plan phase F).

   These were 860 and 520, chosen before the game screen had any breakpoints at
   all. They are the only two media queries the stylesheet had, and they meant the
   landing page went single-column at 860 while the game behind it stayed a
   three-column table down to 768 - the two screens disagreed about what a narrow
   window was. Retuned to 1150 and 768, which are the M/S and floor boundaries the
   rest of the file uses. */
@media (max-width: 1149px) {
  .ft-landing { padding: var(--spacing-lg) var(--spacing-md) 0; }
  .ft-landing__main { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .ft-setup__difficulty-group { grid-template-columns: repeat(3, 1fr); }
  /* Four stats across a phone is four columns of about 70px, which wraps every
     label onto three lines. Two by two reads. */
  .ft-stats { grid-template-columns: repeat(2, 1fr); }
  .ft-stat img { width: 36px; height: 36px; }

  /* The end screen's results table is seven columns each carrying 12px of
     padding a side, which is 168px of pure padding before any content. Trimming
     it is the cheap half of the fix; letting the table scroll itself is the half
     that guarantees the numbers stay readable rather than being crushed.

     UNVERIFIED, unlike everything else in this file: the harness has no route to
     the end screen, so this is reasoned rather than measured. It cannot affect
     any width above 767. */
  .ft-end-screen__results-table th,
  .ft-end-screen__results-table td {
    padding: var(--spacing-xs);
    font-size: 12px;
  }
  .ft-end-screen__results-table {
    display: block;
    overflow-x: auto;
  }
}

/* .ft-score-table (a 28px 1fr 50px 50px 60px grid, further up this file) was on
   the phase F list for a narrow variant. It does not need one: nothing in
   src/ or index.html carries that class any more. Left in place rather than
   deleted, since removing dead CSS is not this plan's business. */

.ft-setup__section {
  margin-bottom: var(--spacing-xl);
}

.ft-setup__label {
  display: block;
  margin-bottom: var(--spacing-md);
  font-weight: 500;
}

.ft-setup__select {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  background: var(--color-card);
  color: var(--color-text-primary);
  cursor: pointer;
}

/* THE TASTING MENU EXPANSION SWITCH (16 August), Dean's shape: a name, one
   control and one short line, all on a single row. It replaces a two-option
   radio group with a note beneath, which stood four lines deep on a screen whose
   only other question is one line high.

   IT WRAPS RATHER THAN SHRINKS. The row is ~380px of content against a ~445px
   column on a desktop and a ~322px one on a phone, so `flex-wrap` puts the note
   on a second line at the narrow end instead of squeezing the name. The row-gap
   is smaller than the column-gap for exactly that case. */
.ft-setup__expansion {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px var(--spacing-sm);
  cursor: pointer;
  /* The containing block for the clipped switch input below, which is
     position: absolute. Without it the input resolves against whatever ancestor
     happens to be positioned and drifts out of its own row. */
  position: relative;
}

.ft-setup__expansion-name {
  font-weight: 500;      /* matches .ft-setup__label, the row above */
}

.ft-setup__expansion-note {
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

/* THE TOGGLE SWITCH. The input is a checkbox with role="switch" (see board.js
   for why a checkbox and not a radio); this draws the pill it wears.

   THE INPUT IS HIDDEN, NOT REMOVED. `display: none` and `visibility: hidden`
   both take a control out of the focus order, and this one has to be reachable
   by keyboard - so it is clipped to a 1px box instead and the sibling span is
   painted in its place. The <label> wrapping both is what routes the click. */
.ft-setup__switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 36x20 track, 16px knob, 2px of inset, so the travel is 16px. Sized against
   the 16px dot it replaces - a switch has to read as a switch at a glance, and
   below about 32px wide the two states stop being distinguishable across a
   table. */
.ft-setup__switch {
  flex: none;
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--color-border);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.ft-setup__switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.ft-setup__expansion:hover .ft-setup__switch {
  background: var(--color-text-secondary);
}

.ft-setup__switch-input:checked + .ft-setup__switch {
  background: var(--accent-deep);
}

.ft-setup__expansion:hover .ft-setup__switch-input:checked + .ft-setup__switch {
  background: var(--color-accent);
}

.ft-setup__switch-input:checked + .ft-setup__switch::after {
  transform: translateX(16px);
}

/* The focus ring has to be drawn on the TRACK, because the thing that actually
   holds focus is the clipped 1px input and a ring on that would be invisible. */
.ft-setup__switch-input:focus-visible + .ft-setup__switch {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}

/* The knob slide is decoration, not information - the colour change carries the
   state on its own - so it goes with everything else under reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .ft-setup__switch,
  .ft-setup__switch::after {
    transition: none;
  }
}

.ft-setup__player-row {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.ft-setup__player-label {
  font-weight: 600;
  min-width: 70px;
}

/* THE AI/HUMAN TOGGLE READ BACKWARDS until 9 August (ticket 00 / finding 11).
   The group carried a solid grey fill, so the UNSELECTED half was the one that
   looked filled in, while the selected half was white with orange text - the
   lighter, quieter of the two. Every player who has ever used a segmented
   control reads the filled half as the chosen one, so the control was telling
   them the opposite of the truth on the one screen they have to get right
   before the game starts.

   The fix is the ordinary convention: the selected half is filled with the
   accent and reversed out in white; the unselected half is left plain on the
   white player row it sits in, with only the group's border to say the two
   belong together.

   NOTE for the typography ticket: accent on white measures 3.4:1, which clears
   the 3:1 UI-component bar but not the 4.5:1 text bar. --color-accent-hover
   measures 4.8:1 if that turns out to matter more than matching the buttons. */
.ft-setup__toggle-group {
  display: flex;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2px;
}

.ft-setup__toggle-btn {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

/* THE TWENTIETH DEFECT, found by stage 1 and named by no list. White on
   --color-accent measures 3.36:1 and fails the 4.5:1 text bar - the same failure
   as defect 1, at a site the review missed, on the one screen a player has to
   get through before the game starts. The AI/Human toggle is explicitly in scope
   (finding 11), and it is fixed here rather than in stage 3 because stage 3 had
   to produce an empty screenshot diff and this is a visible change. White on
   --accent-deep is 6.15:1. */
.ft-setup__toggle-btn.active {
  background: var(--accent-deep);
  color: #FFFFFF;
  font-weight: 600;
}

.ft-setup__difficulty-group {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  width: 100%;
}

.ft-setup__difficulty-btn {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ft-setup__difficulty-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.ft-setup__difficulty-btn.active {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* ======= Buttons ======= */

.ft-btn {
  padding: var(--spacing-md) var(--spacing-lg);
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.ft-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* WHITE ON --accent-deep, NOT ON --accent (defect 1). The accent stays a fill,
   a rail, a ring, a meter and a border everywhere else in this file; what it
   cannot be is the ground under text, which is what this button is. */
.ft-btn--primary {
  background: var(--accent-deep);
  color: white;
}

/* WIRED TO --accent-deep-hover (stage 3's second token defect). The hover still
   went to --color-accent-hover #A0624A, which is LIGHTER than the base stage 1
   deepened, so hovering the primary button took white from 6.15:1 back down to
   4.84:1 - the fix for defect 1 undone by the pointer. The token currently
   aliases --accent-deep, so the hover is the shadow lift alone; the plan retires
   --color-accent-hover without supplying a deeper stop and inventing one would
   be a design act. If Dean wants a distinct deeper brown it is a one-line change
   to the token and nothing here moves. */
.ft-btn--primary:hover:not(:disabled) {
  background: var(--accent-deep-hover);
  box-shadow: var(--shadow-card);
}

.ft-btn--secondary {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
}

.ft-btn--secondary:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.ft-btn--sweep {
  background: #F5F5F5;
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  padding: 0;
  font-size: 12px;
}

/* THE SWEEP ARROWS, 12 AT XL AND 16 IN THE TOUCH BAND (plan section 8.7). They
   were arrow_down.png at 334x500 and arrow_left.png at 500x334 - two pure-black
   print-resolution triangles, 9.0 KB and two requests, drawn at 12x12. The size
   lives here rather than in an attribute because it is the one icon size in the
   build that changes by band, and the gutters these sit in grow with the band.

   No colour rule and no filter: the arrow takes currentColor, so it is the ink
   at rest, the accent while .is-awaiting, and white on the filled hover state,
   for free. The old build needed `filter: brightness(0) invert(1)` on hover to
   stop a black PNG sinking into the accent fill. */
.ft-btn--sweep .ft-icon {
  width: 12px;
  height: 12px;
}

.ft-btn--sweep:hover:not(:disabled) {
  background: var(--color-card);
  border-color: var(--color-accent);
}

/* ---- "It's your turn: sweep" -------------------------------------------
   All ten sweep buttons pulse while a HUMAN is in the sweep step and has not
   swept yet. Sweeping is the one move a new player cannot guess - the tiles
   look clickable and the buttons look like labels, which is exactly backwards -
   so the buttons say so themselves.

   Design decisions worth keeping:
   - ONE animation on all ten, so they pulse IN PHASE. Ten independently-timed
     pulses read as a fault; ten in unison read as one object asking to be used.
   - Colour and shade only, no transform. These buttons are grid gutters aligned
     pixel-for-pixel with the rows and columns they sweep; scaling them would
     break that alignment, which is the one thing making them legible.
   - It clears itself the instant the sweep resolves (the class is derived from
     the same `enabled` flag that gates the click handlers), so it teaches once
     per turn instead of becoming wallpaper.
   - Hover still wins: a player who has found the button gets the normal, calmer
     hover state rather than a control that keeps flashing under the cursor. */
/* ---- "It's your turn: sweep" -------------------------------------------
   The sweep buttons are the one control a new player cannot guess, so while a
   HUMAN is in the sweep step and has not swept yet, all ten advertise
   themselves. This follows the ordinary web-game convention for marking valid
   options rather than inventing a treatment:

     - ONE interactive colour, the product accent, used consistently. The
       previous version cycled through gold, amber, apricot and terracotta,
       which is a carnival cue, not an affordance - shifting hue makes a control
       look broken or decorative, and it competes with the tiles, which are the
       only things here that are supposed to be colourful.
     - The RESTING state already reads as actionable on its own: white surface,
       accent border, accent label. If the animation never ran, you would still
       know these are the buttons. Animation is the nudge, never the message.
     - The breathe is slow (1.8s) and stays INSIDE the button - a tint and a soft
       glow, no expanding ring. These buttons sit 2px apart in a strip of ten;
       an expanding halo on each would merge into one blob and lose the
       per-button definition that tells you which line you are about to sweep.
     - HOVER is a decisive commit, not more of the same: the animation stops
       dead, the button fills solid, the label and arrow invert to white and it
       lifts. That is the moment of "yes, this one".
     - Nothing moves the layout. transform and box-shadow only, so every button
       still points at exactly the row or column it sweeps. */
/* REWRITTEN ONTO THE SHARED RING (stage 8, plan section 7.2). `sweep-ready` was
   an INFINITE animation on `background` and `box-shadow` - two paint properties
   - running on up to TEN buttons at once, and it was the whole of the shipped
   build's ten infinite animations at rest. It becomes the ring vocabulary's
   "you may act here": a DASHED accent ring, 2px, told apart from the other three
   meanings by being dashed rather than by moving, and it does not breathe.
   That is what takes the resting cost from ten to nought. */
.ft-btn--sweep.is-awaiting {
  cursor: pointer;
  font-weight: 700;
  background: var(--color-card);
  border-color: var(--color-accent);
  color: var(--color-accent-hover);
  outline: 2px dashed var(--color-accent);
  outline-offset: 1px;
}

.ft-btn--sweep.is-awaiting:hover:not(:disabled) {
  outline: none;
  background: var(--color-accent);
  border-color: var(--color-accent-hover);
  color: #FFFFFF;
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(193, 123, 92, 0.3), 0 3px 10px rgba(61, 43, 31, 0.3);
}

/* The reduced-motion branch this rule used to need is GONE with the animation
   it turned off (stage 8). The dashed ring above is identical in both branches,
   because it never moved: reduced motion is a different set of numbers, and a
   signal with no numbers has nothing to change. */

/* ======= Game Screen ======= */

/* THE THREE-COLUMN TABLE: opponents left and right, the shared centre between.

   `minmax(min-content, 1fr)` on the side columns, and the choice is not
   cosmetic. The obvious move is `minmax(0, 1fr)`, so a track that cannot fit
   its contents shrinks instead of pushing the page into horizontal scroll. It
   does not work at XL, and the reason is worth writing down: THE CONTENTS
   CANNOT SHRINK. A seat at a 60px tile needs ~660px whatever the track says, so
   a 0-minimum track does not make it fit, it makes it OVERLAP - the seat renders
   over the centre column, and the tile market's sweep buttons end up underneath
   a player's board tiles where they cannot be clicked at all.

   Pinning the minimum to min-content means the table is never narrower than the
   things on it. Where that exceeds the viewport the page scrolls sideways, which
   is what it already did; the difference is that everything stays reachable.

   This is also why it needs no per-band override. As the L, M and S bands shrink
   --tile-size and --tile-size-opp, min-content falls with them, and the same
   rule stops overflowing on its own once the contents genuinely fit. */
.ft-game {
  display: grid;
  grid-template-columns: minmax(min-content, 1fr) var(--centre-width) minmax(min-content, 1fr);
  grid-template-rows: auto auto;
  gap: var(--spacing-lg);
  padding: var(--spacing-xl);
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
}

/* THE PANEL DOES NOT SURVIVE AS A GENERAL CONTAINER (plan section 8.5). Four
   replacements take its jobs - a cloth region for the board areas, a flat
   --surface for anything made of words and numbers, a sheet for anything that
   comes over the board, and a strip for persistent chrome - and a SEAT is none
   of them. A seat is a grouping, not a box: it holds a surface (the score
   column) and a cloth region (the board), and what separates it from its
   neighbour is the wall showing between them.

   So the tint, the border, the radius, the shadow AND the padding all go. The
   padding is not incidental: it is what pays for the cloth's ring. Removing 12px
   of padding and 1px of border a side gives each seat back 26px of width, which
   is what makes room for a 28px ring at XL where the layout has six tenths of a
   pixel of horizontal headroom. A box with no ground has no reason to hold its
   contents off its own edge.

   THE FOUR SEAT TINTS GO WITH IT, and they were four of the five TILE hues -
   orange, blue, green and pink - which stops working the moment the tile field
   is painted. Seat colour is a mark now (section 8.9): a rule, a dot and an
   outline, all at zero layout width. It never fills a seat's ground, because
   four washes on a wall-and-cloth composition are four competing grounds. */
.ft-panel {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* The active seat is an OUTLINE ON ITS CLOTH plus the seat rule going 4px to 6
   (plan section 8.9, carrier 3), so this rule holds no paint of its own - see
   .ft-panel--active .ft-cloth and .ft-panel--active .ft-seat__rule below. A 2px
   BORDER would have cost 4px of seat width; an outline sits outside the box
   model and costs nothing, which is the whole reason it is the one chosen. */

/* ======= Seats =======
   A SEAT is one player's whole area: their score column beside their board.
   These rules carry what used to be inline styles in renderGameScreen, and they
   must stay after .ft-panel, whose column direction they override.

   Positioning by class rather than by markup is the entire point (plan A3):
   an inline `grid-column` cannot be overridden by a media query, so no
   breakpoint could reflow the table while the positions lived in the HTML.
   Every band below XL re-places these four selectors and nothing else. */
.ft-seat {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-lg);
  /* THE SEAT NEVER RENDERS NARROWER THAN WHAT IS IN IT.
     This is needed because of, not despite, the minmax(0, 1fr) on .ft-game:
     a grid item only gets its automatic content-based minimum when the track's
     MIN sizing function is auto/min-content/max-content. Pinning the track
     minimum to 0 - which is what stops a too-wide seat dragging the whole page
     into horizontal scroll - also switches that protection off, and the panel
     would then shrink to a sliver while the board grid inside it spilled out
     the side.

     `max-content` is safe here ONLY because .ft-seat__board-col has a definite
     width (see below). A definite width overrides an item's content
     contribution, so the phase bar's long coaching sentences cannot inflate
     this - which is exactly what would happen if the board column were still
     `flex: 1` and left to size itself from its text.

     What this does NOT do is make the page fit: three seats of ~660px plus an
     800px centre still needs more width than any laptop has, so the horizontal
     criterion keeps failing until the L/M/S bands shrink the tokens and drop to
     fewer columns. Phase A's job is only to stop the board escaping its panel. */
  min-width: max-content;
}

.ft-seat--1 { grid-column: 1; grid-row: 1; --seat: var(--seat-1); }
.ft-seat--2 { grid-column: 1; grid-row: 2; --seat: var(--seat-2); }
.ft-seat--3 { grid-column: 3; grid-row: 1; --seat: var(--seat-3); }
.ft-seat--4 { grid-column: 3; grid-row: 2; --seat: var(--seat-4); }

/* ======= SEAT COLOUR AS A MARK (plan section 8.9, decision 18) =============
   Four hues deliberately off the tile wheel - claret, teal, moss, plum - all
   clearing 3:1 against every ground on the screen, 4.5:1 on the surface and the
   cloth, and carrying white at 5.8 to 7.3:1.

   THREE CARRIERS, AND NONE OF THEM MAY ADD TO A SEAT'S max-content WIDTH. That
   is a standing rule rather than a preference: the opponent strip was measured
   with exactly 2px of headroom at 390, where two more pixels of chip costs 269px
   of page height because a seat drops from two per row to one. */

/* 1. THE SEAT RULE. 4px of seat ink, the full width of the board column,
      directly above the cloth. Every size, every seat, always - it is the one
      carrier that never drops, because it is the only one that survives the
      14px opponent board where the dot and the name are already gone. A block
      element takes the width it is given, so this is free. */
.ft-seat__rule {
  height: 4px;
  width: 100%;
  border-radius: 2px;
  background: var(--seat);
  margin-bottom: 6px;
  flex: 0 0 auto;
}

/* 2. THE SEAT DOT. 10px, before the player's name, on your own seat and on a
      desktop opponent's. It is inline on the name line, which is never a seat's
      widest row, so it costs no width either. Applied to the shrink ladder, seat
      identity says: the dot goes first, the rule never does. */
.ft-seat__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--seat);
  flex: 0 0 auto;
}

/* 3. THE ACTIVE RING, around the seat's CLOTH rather than around the seat, so
      what is marked is the thing being played on. outline-offset puts it in the
      ring of cloth the padding already provides, and the seat rule thickens with
      it - two carriers for one state, one of which survives desaturation. */
.ft-panel--active .ft-cloth {
  outline: 2px solid var(--seat);
  outline-offset: 3px;
}

.ft-panel--active .ft-seat__rule {
  height: 6px;
}

/* A seat with nobody in it, at player counts below four. */
.ft-seat--absent {
  display: none;
}

/* THE OTHER HALF OF THE OVERFLOW BUG (plan section 1), and the one that was
   visible at EVERY width including 1920 rather than only on a tablet.

   This column used to be `flex: 1`, i.e. `flex: 1 1 0%`, so it could be sized
   below its own contents. .ft-board-grid is a fixed 5-tile-wide child with
   `margin: 0 auto`, so instead of forcing the seat wider it simply OVERFLOWED
   it: at 1920 the fifth column of your own board sat outside the coloured panel
   and ran under the centre column. The seat measured 570px while its contents
   needed 661 - the score column renders at ~295px, not the 200px its token
   suggests, because its own content (the score table and the cake stand) is
   wider than that floor.

   The fix is to say what this column IS rather than let it be squeezed: exactly
   the width of the board grid, stated in the same tokens the grid is built
   from, so it tracks --tile-size through every band automatically - and
   --tile-size-opp inside an opponent seat, which redefines --tile-size for its
   own subtree.

   A DEFINITE width, not a min-width, and that is load-bearing twice over: it
   stops the phase bar's coaching sentences from setting the column's width, and
   it is what makes `min-width: max-content` on .ft-seat safe. */
.ft-seat__board-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  width: var(--board-col-width);
}

/* The seat dot sits BEFORE the name, so the header stops being a space-between
   row - there is nothing to push to the far edge, and the two belong together.
   TWO CLASSES, because .ft-panel__header carries the space-between and is
   declared after this in the file; a single class would lose the cascade and
   leave the dot stranded at the far left of the board column. */
.ft-panel__header.ft-seat__header {
  width: 100%;
  margin-bottom: var(--spacing-sm);
  justify-content: flex-start;
  gap: 7px;
}

.ft-seat__swept-label {
  text-align: center;
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: var(--spacing-sm) 0;
}

.ft-seat__controls {
  width: 100%;
  margin-top: var(--spacing-md);
}

/* THE RULE UNDER A HEADING DIES (plan section 8.5). --rule keeps exactly two
   jobs from here on - separating rows inside a table, and the single edge where
   a persistent strip meets content - and a line under a heading is neither. */
.ft-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: none;
  /* The 8px of padding-bottom went with the rule. It was the space that held the
     name off the line under it; with no line it is a second gap on top of the
     8px margin the header already carries. IT IS ALSO 2px OF PAGE HEIGHT AT L:
     the L band's tallest column is two seats stacked, so a saving in a seat is
     doubled, and the mid-game position came in 1832 against an 1830 ratchet
     until this came off. It is worth 16. */
  padding-bottom: 0;
}

.ft-panel__title {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.ft-panel__status {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* ======= Score Table ======= */

.ft-score-table {
  display: grid;
  grid-template-columns: 28px 1fr 50px 50px 60px;
  gap: var(--spacing-sm);
  font-size: 13px;
  padding: var(--spacing-md);
  background: var(--surface);
  border-radius: var(--radius-lg);
}

.ft-score-table__header {
  display: contents;
}

.ft-score-table__header-cell {
  font-weight: 600;
  color: var(--color-text-secondary);
  padding: var(--spacing-xs);
  text-align: center;
}

.ft-score-table__row {
  display: contents;
}

.ft-score-table__icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.ft-score-table__cell {
  padding: var(--spacing-xs);
  text-align: center;
}

.ft-score-table__score {
  font-weight: 600;
  background: var(--color-success);
  color: white;
  border-radius: var(--radius-sm);
  padding: 2px 4px;
}

.ft-score-table__score.zero {
  background: #E8E8E8;
  color: var(--color-text-secondary);
}

.ft-score-total {
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--color-border);
  color: var(--color-accent);
}

/* ======= Score Breakdown ======= */

.ft-score-breakdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--surface);
  border-radius: var(--radius-lg);
  font-size: 12px;
}

.ft-score-breakdown__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  color: var(--color-text-secondary);
}

.ft-score-breakdown__item strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

/* ======= Cake Stand ======= */

.ft-stand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-xs) var(--spacing-md);
  /* THE STAND TRAY IS A BOARD AREA (plan section 8.5's container table), so it
     takes the cloth: the same three stops on the same 163deg fall, the same
     upper-left highlight, the same one contact shadow, radius 10, no border.
     It keeps its OWN padding rather than taking the cloth ring - the ring is
     specified for the board region, and at XL the score column this sits in is
     content-sized with no width to give.
     No grain here either - see the note on .ft-cloth. */
  background:
    radial-gradient(150% 110% at 18% 4%, rgba(255, 255, 255, 0.80), rgba(255, 255, 255, 0) 62%),
    linear-gradient(163deg, var(--cloth-lit) 0%, var(--cloth-mid) 52%, var(--cloth-shade) 100%);
  border: none;
  border-radius: 10px;
  box-shadow:
    2px 3px 10px -3px rgba(var(--shadow-ink), 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.ft-stand__prompt {
  margin-top: var(--spacing-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent);
  text-align: center;
}

.ft-stand__row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-xs);
  padding: 2px var(--spacing-xs);
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
}

/* "CAKE STAND", hung off the left of the TOP row.
   OUT OF FLOW ON PURPOSE, and both halves of that matter. `right: 100%` pins it
   immediately left of the row whatever the plate size is, so it needs no magic
   offset per band; and being absolute it adds no height to the stand and does
   not push the one-plate top row off the centre line the tier is built on.
   It lives beside the TOP row because that is the narrowest one, so the centred
   pyramid leaves the most room there - about 55px at a 34px plate and 40px at
   the 24px plate of the tightest band, which is why the words are stacked and
   right-aligned rather than run on one line. */
.ft-stand__label {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 5px;
  text-align: right;
  /* --type-stamp: 10px Inter 700 at +0.08em, and THE ONLY UPPERCASE ROLE LEFT
     in the whole system (plan section 8.5). */
  font-size: var(--type-stamp);
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  white-space: nowrap;
  pointer-events: none;
}

.ft-stand__row--legal {
  cursor: pointer;
  border-color: var(--color-accent-gold);
  background: rgba(201, 162, 39, 0.12);
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.4);
}

.ft-stand__row--legal:hover {
  background: rgba(201, 162, 39, 0.25);
}

.ft-stand__lock {
  width: 18px;
  height: 18px;
  object-fit: contain;
  margin-top: 8px;
  flex-shrink: 0;
}

.ft-stand__lock--empty {
  width: 18px;
  height: 18px;
  margin-top: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px dashed var(--color-border);
  opacity: 0.5;
}

.ft-stand__plates {
  display: flex;
  gap: 3px;
}

.ft-stand__slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.ft-stand__plate-wrap {
  position: relative;
  display: inline-flex;
}

/* Subtle marker on the four cupcake plates: sits in the plate's top-right
   corner, present whether the plate is empty or filled. Marks the plate, not
   the tile - see CUPCAKE_PLATES in game.js and the board art (cake_stand.png). */
.ft-stand__cupcake-plate {
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
  opacity: 0.9;
}

.ft-stand__plate {
  width: var(--stand-plate);
  height: var(--stand-plate);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  /* The same 1px rim of the tile's own dark stop, shrinking inside border-box so
     the plate's 34/32/30/28px size does not move. */
  border: 1px solid var(--dk);
  /* background-IMAGE over the .ft-stand__plate.ft-colour background-color, for
     the reason given on .ft-tile (stage 4a). */
  background-image: var(--tile-field);
  box-shadow: var(--form-edges);
}

/* An empty slot on the stand is the same object an empty board cell is: a dent,
   square, never round, at the plate's own radius. */
.ft-stand__plate--empty {
  background: var(--dent);
  border-color: transparent;
  box-shadow: var(--dent-edges);
}

.ft-stand__plate--filled {
  border-color: var(--dk);
}

.ft-stand__symbol {
  width: 60%;
  height: 60%;
  object-fit: contain;
}

.ft-stand__value {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-secondary);
  line-height: 1;
}

.ft-stand__value--earned {
  color: var(--color-accent);
  font-weight: 700;
}

.ft-stand__crumbs {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 12px;
  color: var(--color-text-secondary);
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.ft-stand__crumbs strong {
  color: var(--color-text-primary);
}

.ft-stand__crumbs-note {
  font-size: 10px;
  font-style: italic;
  opacity: 0.8;
}

.ft-stand__crumbs--legal {
  cursor: pointer;
  border-color: var(--color-accent-gold);
  background: rgba(201, 162, 39, 0.12);
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.4);
}

.ft-stand__crumbs--legal:hover {
  background: rgba(201, 162, 39, 0.25);
}

/* THE ROW LOCK, SAID AT THE MOMENT IT BINDS (defect 17, 9 August).
   Rendered only while the stand is a live destination - see renderStand's
   `interactive` branch - so it costs zero page height on every other frame of
   the game, which is every frame the layout harness measures. It is not
   first-run copy: it appears on every claim of every game, and a veteran reads
   it as the label on a choice they are making right now. */
/* DEFECT 17's LINE, AND WHERE IT LIVES (stage 1 wrote it, stage 7 moved it).
   The first tile plated on a row locks that row to that ingredient for the whole
   game - the one irreversible choice in the game, and until stage 1 the only
   place that said so was the rules modal and a `title` a phone cannot render.

   IT IS OFF BY DEFAULT AND ON ONLY INSIDE THE STAND SHEET. Stage 1 could afford
   it only in the destination step, where it cost 33px of canvas, because outside
   stage 7's model there was nowhere free to put it. Plan section 11.1: teaching
   goes in a sheet, where it is free, and never on the canvas, where it is not.
   Below 1149 the score panel IS the stand sheet - position: fixed, out of the
   page's flow - so the line is permanent there at zero page height, and the 33px
   comes back at every band. Above the band the rules modal carries it. */
.ft-stand__lock-note {
  display: none;
  margin-top: var(--spacing-xs);
  padding: 0 var(--spacing-xs);
  font-size: 10px;
  font-style: italic;
  line-height: 1.3;
  color: var(--color-text-secondary);
}

/* ======= Card VP Badge ======= */

/* ONE REWARD CARD, cut out of the shared sprite sheet.

   SIZED HERE, NOT IN JAVASCRIPT (plan A5). cardSpriteHTML used to compute
   background-position and background-size in PIXELS from a display height and
   write them into a style attribute, which meant the cards could not be resized
   by CSS at all: a responsive --card-height would have been silently ignored,
   because the pixel maths had already been baked into the markup.

   All the renderer emits now is the card's ADDRESS on the sheet - a column and
   a row - and the geometry is done in percentages, which are independent of the
   rendered size. reward-cards-v9.webp is a TTS-style 10x7 sheet (3391 x 3290);
   cards 1-50 fill the first five rows and the last two are blank.

   v9 (17 August) IS THE BATTENBERG DIAGONAL SWAP, resampled from
   Reward-Cards-v13.png. Three cards changed and nothing else: 43 Summer fruit
   tart, 49 Iced fancies and 50 Autumn fruit tart were 2x2s of four and three
   different colours, which playtesting found too complicated to read, and are
   now two-colour diagonals in the manner of card 41 Battenberg - 43 Blood
   orange harlequin, 49 Marmalade and damson chequerboard, 50 Lime and blueberry
   chequer slice. Same geometry as v8, so the percentages below are untouched.

   v7/v8 (13 August) ARE THE PATTERN REMIX. Every card's pattern was redrawn so
   it depicts its own patisserie - colour reads as appearance, not flavour - and
   25 of the 50 subjects changed. v8 was the live one, resampled from
   Reward-Cards-v12a.png; v7 came from the earlier Reward-Cards-v12.png and is
   superseded twice over - card 17 was a duplicate of card 48, and a laurel
   wreath had been left printed under the VP. THAT WREATH IS WHY THE SOURCE IS
   NAMED v12a: .ft-card__vp draws its own badge over that spot, so a wreath in
   the art double-prints under it. If a future export brings one back, either
   drop it or re-fit the badge - measured, the wreath sits at 0.919 of card
   height and 0.188 of card width, against the badge's 0.913 and 0.185.
   v6 and v7 are both kept to diff against.

   WEB SCALE, NOT PRINT SCALE (ticket 17, 9 August). v5 was the print export
   dropped straight into the build at 7501 x 7277 and 11.3MB, which was 92.4% of
   everything the page loaded. v6 is the same art resampled so one card cell is
   470px tall - exactly 2x the largest --card-height (235px at XL) and no more -
   and written as WebP at quality 85. 11,327,047 bytes becomes 521,206. The
   printed swatches survive it: tools/check-card-sheet.mjs reads the colours back
   out of this file and still matches all 50 cards. Re-export at the same 2x
   rule, not at whatever the print sheet happens to be.

   THE SHEET IS DATA AND IT GOES STALE. The pattern swatches are painted into
   the art, so a card whose pattern is edited in reward_cards.csv keeps showing
   its old colours until the sheet is re-exported - the engine matches on the
   new pattern while the player reads the old one off the card. That is exactly
   what happened to cards 25, 26 and 43 between 21 July and 9 August, and it is
   why the filename carries a version: re-export to a NEW name and repoint this
   rule, so the previous sheet stays around to diff against. Bump the ?v= query
   too, or browsers keep the cached image.

   The percentages: with the image scaled to 1000% x 700%, it is exactly 10
   cards wide and 7 tall, so a background-position of x% slides it across
   (10 - 1) = 9 card widths. Column c therefore sits at c/9 of the way, and row r
   at r/6. That is where the 9 and the 6 come from - they are one less than the
   card counts, not a fudge.

   background-origin: border-box matters. The default padding-box would make the
   sheet's scale depend on the border width, and .ft-card--claimable swaps the
   2px border for 5px - the art would visibly jump the moment a card became
   claimable.

   Cards are also containers, so the VP badge can size itself in cqw and hold
   its place at the foot of the card as the card grows or shrinks. (Up to v5 it
   sat on top of a laurel wreath printed into the art, which is where its size
   came from; the v5 export drops the wreath, so the badge now stands alone on
   the cream.) */
.card-market-sprite {
  container-type: size;
  position: relative;
  height: var(--card-height);
  aspect-ratio: 0.72155;
  background-image: url('images/reward-cards-v9.webp?v=9');
  background-repeat: no-repeat;
  background-size: 1000% 700%;
  background-position: calc(var(--sprite-col) / 9 * 100%)
                       calc(var(--sprite-row) / 6 * 100%);
  background-origin: border-box;
}

/* The card's VP, drawn bottom-center over the art rather than read off it, so
   the displayed value always matches the data even when the sheet is stale -
   which, as the note on .card-market-sprite says, it periodically is.

   The 18.5cqw width is inherited from the sheets up to v4, where it was fitted
   to a laurel wreath printed at that size so the laurel framed the badge
   without spilling into the pattern tiles above. v5 drops the wreath; the size
   is kept because it still reads well against the empty cream, but it is now a
   free choice rather than a measurement of something. */
.ft-card__vp {
  position: absolute;
  bottom: 2%;
  left: 50%;
  transform: translateX(-50%);
  width: 18.5cqw;
  height: 18.5cqw;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 10cqw;
  font-weight: 700;
  color: var(--color-text-primary);
  background: radial-gradient(circle at 50% 40%, #FBE7B8 0%, var(--color-accent-gold) 100%);
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(61, 43, 31, 0.4);
  pointer-events: none;
  z-index: 2;
}

/* ======= Cupcake Supply ======= */

.ft-cupcake-supply {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}

/* ANNOUNCING, so it takes the left rail - the one job the rail keeps. Additive:
   nothing about the resting panel changes, a mark appears on it. */
.ft-cupcake-supply--active {
  box-shadow: inset 3px 0 0 var(--color-accent);
}

/* ONE LINE: the word and the count. It was a column - a label, an italic
   instruction, and then one 36x36 BUTTON PER CUPCAKE - and all three went with
   stage 6's settlement of defect 13 (Dean's decision 1):

     - the instruction described the two board spends, which are chips of their
       own now and carry their own prices;
     - the per-cupcake buttons were the only way into board-spend mode, and at
       twelve cupcakes (the engine's own 1,500-game maximum) twelve 36px buttons
       wrap to three rows inside a sheet capped at 280px. They were also the
       second of ticket 04's two 44px tap-target failures, at 36x36.

   What is left is what the row always meant: how many you have. */
.ft-cupcake-header {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

.ft-cupcake-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--color-accent);
}

.ft-cupcake-count {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 15px;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink, var(--color-text-primary));
}

/* THE ONE CUPCAKE (10 August). This replaces .ft-cupcake-count__icon, which
   styled the supply header's painted cupcake alone while five other places drew
   the same object as a line glyph. There is one mark now, emitted by
   cupcakeMark() in board.js at whatever size its site asks for, so the size
   belongs on the element and not in here.
   It carries .ft-icon as well, which is where its baseline alignment, its
   flex-shrink and its pointer-events come from - an <img> in that class behaves
   the same as an <svg> in it, and inheriting rather than duplicating is what
   keeps the spend chip's negative margin working for both. */
.ft-cupcake-mark {
  object-fit: contain;
}

.ft-cupcake-points {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-weight: 500;
  text-align: center;
}

/* ======= Game Grids ======= */

/* THE SWEPT-TILE TRAY IS FLAT, and the anti-creep clause is what decides it
   (plan section 8, decision 3): an item on neither the painted list nor the flat
   list is flat until a ticket puts it on the painted list, and the painted list
   names board areas - your board, the market, opponent boards, the stand tray -
   not this. Painted tiles standing on a flat surface is the register working as
   intended; a painted object does not paint its container. What comes off is the
   dashed border, because borders die. */
.ft-working-area {
  display: grid;
  grid-template-columns: repeat(4, var(--tile-size));
  gap: var(--tile-gap);
  min-height: calc(var(--tile-size) + 2 * var(--spacing-sm));
  padding: var(--spacing-sm);
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  justify-content: center;
}

/* ======= THE CLOTH (plan section 8.6, tickets 06 and 10) ===================
   The ground of the BOARD AREAS ONLY. Three things on it and nothing else: the
   three sampled stops on one 163 degree fall, a broad soft highlight at the
   upper left, and a contact shadow down and to the right. No border, no
   four-sided drop shadow, no printed pattern, no lace, no hem, no depicted
   weave, no folds.

   THE GRAIN IS GONE (10 August, Dean). grain-v1.png was a fourth layer here and
   on .ft-stand: a 128px tile of PER-PIXEL random alpha, mean 7/255, drawn at a
   fixed 128px in CSS pixels. The arithmetic that justified it was about
   AMPLITUDE - at most 13.7 levels on a cream ground, the same order as the
   wallpaper - and amplitude was never the problem. SPATIAL FREQUENCY was. Noise
   whose period is one CSS pixel does not resolve as texture at any viewing
   distance; on a DPR 2 or 3 screen the browser resamples that single-pixel noise
   and it resolves as SPECKLE - a dithered, dot-screened ground, which is what
   the two largest bare expanses of it (the empty player board and the cake stand
   tray) were read as. The gradient below it is doing the work the texture was
   supposed to support, and it survives on its own: a smooth fall with one soft
   highlight reads as cloth in raking light, which is the whole brief.
   The PNG stays in images/ unreferenced. If a later session wants texture back,
   the fix is a LOW-frequency one - a soft mottle on a repeat of 200px or more,
   four or more times the tile pitch, the same rule the wallpaper is held to at
   line 505 - and not this file at a lower opacity.

   THE CONTACT SHADOW IS LOAD-BEARING, NOT DECORATION. The cloth's far corner is
   only 4.1 luminance points above the wall; at .34 the shadow puts the wall
   under that edge 18 points below the cloth's shaded stop, which is what makes
   the two read as two planes rather than as a seam. A later session must not
   delete it as decoration. */
.ft-cloth {
  padding: var(--cloth-ring);
  /* The ring is spent outward on the horizontal axis - see --cloth-ring in
     :root for the 0.6px of headroom at 2181 that forces it. */
  margin-left: calc(-1 * var(--cloth-ring));
  margin-right: calc(-1 * var(--cloth-ring));
  border-radius: 10px;
  background:
    radial-gradient(150% 110% at 18% 4%, rgba(255, 255, 255, 0.80), rgba(255, 255, 255, 0) 62%),
    linear-gradient(163deg, var(--cloth-lit) 0%, var(--cloth-mid) 52%, var(--cloth-shade) 100%);
  box-shadow:
    2px 3px 10px -3px rgba(var(--shadow-ink), 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* The market's cloth wraps the whole container, the two sweep-button gutters
   included, and bleeds on all four sides: .ft-market-wrap already carries more
   padding than the ring on every band, so the ring is free in both axes and the
   grid tracks - and therefore every button's alignment with the line it sweeps -
   do not move by a pixel. */
.ft-cloth--market {
  margin: calc(-1 * var(--cloth-ring));
  width: max-content;
}

/* ======= THE RECESS =======================================================
   The 5x5 pressed into the cloth, so the 2px grid gaps read as the cloth in
   SHADE rather than as the lit cloth - which is decision 17's binding condition
   on the yellow tile.

   FLAT AND OPAQUE, AND THAT IS A DECISION. The elegant transparent slate wash is
   refused with a measurement: decision 17 is a FLOOR ON A VALUE, and a gradient
   turns a floor into a range. A 5 per cent wash leaves the board's near corner
   ten points above the floor and a 16 per cent wash puts the far corner 11.9
   points lower, so the yellow tile's edge would differ cell by cell. A flat
   #E9D9BE makes the guarantee identical in all twenty-five cells. Do not make it
   a wash.

   THE 8px OF PADDING AND THE 1px BORDER ARE KEPT EXACTLY, because
   --board-col-width is derived from them and the layout harness reads it. The
   border is not decoration either - it is the near wall of the recess.

   THE SLAB SHADOW IS A box-shadow ON THIS RECTANGLE, never a filter:
   drop-shadow on the grid: a grid of tiles is lit as ONE slab, and a filter
   would force all 25 children into a single compositing layer and re-rasterise
   the lot on any change. A resting tile stays one element with no layer, which
   is what stage 8's transition-name budget depends on. */
.ft-board-grid {
  display: grid;
  grid-template-columns: repeat(5, var(--tile-size));
  gap: var(--tile-gap);
  padding: var(--spacing-sm);
  background: var(--recess);
  border: 1px solid var(--near-wall);
  border-radius: var(--radius-md);
  justify-content: center;
  margin: 0 auto;
  box-shadow:
    inset 0 2px 3px -1px rgba(var(--shadow-ink), 0.30),
    inset 0 -1px 0 rgba(255, 255, 255, 0.40),
    2px 3px 9px -3px rgba(var(--shadow-ink), 0.30);
}

/* THE MARKET IS A BOARD AREA and takes the same ground. It gets the recess with
   NO padding of its own and a bleeding 1px near wall, because its cells are
   positioned by the container's grid tracks and the sweep buttons are aligned to
   those same tracks - 9px of recess padding would slide every tile away from the
   button that sweeps it. The recess's job here is the ground behind the 2px
   gaps, and that is unaffected. The 8px padding is a BOARD-grid requirement,
   there because --board-col-width is computed from it. */
.ft-market-grid {
  display: grid;
  /* 5x5 tile market at all player counts. board.js also sets this inline from
     gameState.marketSize, which wins; this is the static fallback. */
  grid-template-columns: repeat(5, var(--tile-size));
  gap: var(--tile-gap);
  padding: 0;
  margin: -1px;
  background: var(--recess);
  border: 1px solid var(--near-wall);
  border-radius: var(--radius-sm);
  box-shadow:
    inset 0 2px 3px -1px rgba(var(--shadow-ink), 0.30),
    inset 0 -1px 0 rgba(255, 255, 255, 0.40),
    2px 3px 9px -3px rgba(var(--shadow-ink), 0.30);
}

/* ======= THE TILE (plan section 8.6, decisions 7 and 13) ===================
   A painted fondant square. Four layers, in this order, and nothing else:

     1. RIM      1px of the tile's own DARK STOP. Present at every size from 14
                 to 60, and the only layer that never drops. It replaces the 2px
                 cream border, which is the single thing that made a tile read as
                 a swatch rather than as an object - and it shrinks INSIDE
                 border-box, so no dimension moves.
     2. FORM     a 10 o'clock radial highlight, a 148deg body gradient light to
                 dark, an inner edge light on the top and left, an inner shade on
                 the bottom right.
     3. SURFACE  NOT ON THE TILE. The weave lives in the cloth (plan section 17,
                 amendment 1). A world texture is continuous across objects.
     4. INK      the existing <img>, the pure black silhouette at 60 per cent,
                 unlit and unshaded. Ink printed on a painted object.

   A RESTING TILE IS ONE ELEMENT, one border, one gradient pair and one
   box-shadow list. No pseudo-element, no image, no filter, no opacity, no
   transform: 75 tiles, 75 paints, zero compositing layers at rest. Stage 8's
   transition-name budget depends on that and so does the slab lighting.

   The rim is not a breach of the 2.00px painted-feature floor: the floor governs
   depicted features, and an edge is not one. */

.ft-tile {
  width: var(--tile-size);
  height: var(--tile-size);
  aspect-ratio: 1;
  border: 1px solid var(--dk);
  border-radius: calc(var(--tile-size) * 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  /* NARROWED FROM `all` (defect 9, 9 August). `all` covered background-color,
     border-color and box-shadow as well, and it only fails to bite today
     because updateGameDisplay makes every tile node new on every render, so
     nothing ever has an old value to animate away from. That makes it a trap
     for the first render path that reuses a node rather than a live bug: the
     tile's colour, its rim and its state ring would all cross-fade for 150ms
     on a state change that is meant to be instant. transform and opacity are
     also the only two properties that animate off the main thread. */
  transition: transform 0.15s ease, opacity 0.15s ease;
  /* background-IMAGE, not the `background` shorthand (stage 4a). The shorthand
     reset background-color to transparent in the same declaration, and the flat
     --mid under the gradient stack is the printed tile colour: the field sits on
     top of the mid, it never replaces it. A tile with no colour class - a dent,
     an empty plate - has no --tile-field at all, so this resolves to the initial
     `none` for it and its own rule paints the ground. */
  background-image: var(--tile-field);
  box-shadow: var(--form-edges);
  position: relative;
}

/* The hover lift means "this responds to a click". It applies to the PLAYER
   BOARD, where tiles really are clickable - to place, to pick a sacrifice, to
   move with a cupcake.

   It deliberately does NOT apply to the tile market. You sweep a whole LINE
   there, with the row and column buttons; clicking an individual market tile
   does nothing, and lifting it on hover was promising an interaction the game
   does not have. That was actively working against the sweep buttons, which are
   the real control.

   NO SCALE, AND NO BORDER CHANGE (plan section 8.6, every state). scale(1.08) at
   a 60px tile is +4.8px into a 2px gap, so a hovered tile overlapped its
   neighbours; and a painted object is never repainted to show state, which rules
   the accent border out. A 3px rise and a cast shadow say the same thing and can
   never collide. THINGS THAT LIFT, CAST: this is the one place a single tile is
   allowed a compositing layer, because it is the one place it leaves the slab.

   Wrapped in @media (hover: hover), which is what the touch-hygiene block at the
   end of the file used to have to undo by hand. */
@media (hover: hover) {
  .ft-tile:hover:not(.ft-tile--empty):not(.ft-tile--ghost):not(.ft-tile--blocked):not(.market-tile),
  .market-tile.ft-tile--pickable:hover {
    transform: translateY(-3px);
    box-shadow: var(--form-edges), 2px 3px 4px rgba(var(--shadow-ink), 0.42);
  }
}

.ft-tile:active:not(.ft-tile--empty) {
  cursor: grabbing;
}

/* ======= THE DENT (decision 16, plan section 8.6) =========================
   An empty cell is not a white square and not a faded tile. It is a shallow
   recess in the cloth - a place setting waiting for a tile - so a nearly-empty
   board looks intended rather than unfinished.

   THE FORM IS THE TILE'S FORM INVERTED, and that is the whole idea. A tile is
   proud: light on its top and left, shade on its bottom right. A dent is sunk:
   shade on its top and left, light on its bottom right. Same light, opposite
   relief. That is what stops 25 empty cells reading as 25 pale tiles, and it
   costs the order of two shadows.

   IT IS SQUARE AND IT IS NEVER ROUND. A faint plate ring in an empty cell is a
   faint version of the empty plate, and the empty plate is the one thing on this
   board that must never be mistaken for an empty cell. Square is a place you can
   use; round is a place you have used up. */
.ft-tile--empty {
  background: var(--dent);
  border-color: transparent;
  box-shadow: var(--dent-edges);
}

/* A placed tile is JUST THE OBJECT (plan section 8.6, every state). The shipped
   `border-color: rgba(0,0,0,.2)` was a state drawn into the paint; the rim is
   the tile's own dark stop now and needs nothing added to say "placed". */
.ft-tile--placed {
  border-color: var(--dk);
}

/* GHOST - a provisional placement, in hand but not committed. The shipped
   opacity: .6 is refused outright: NOTHING IS DIMMED, at any width, in any
   state. Emphasis is additive. Full paint, and a solid accent ring says it is
   provisional. */
.ft-tile--ghost {
  opacity: 1;
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

/* ======= THE EMPTY PLATE (decision 23, plan section 8.6) ===================
   THE BOARD HAS THREE HEIGHTS AND THIS IS THE TOP ONE:

     below the cloth   a DENT   a place you may still use
     flush with it     a TILE   a place you have used well
     on top of it      a PLATE  a place you have used up

   THE DARK #6B5847 FILL GOES. Once the plate is a shape rather than an image the
   job that fill existed for is done by the silhouette, and a dark chocolate
   square reads as a hole burnt in the cloth. The cell under the plate is the
   recess, so the plate stands on the board rather than in a hole.

   FOUR INDEPENDENT CARRIERS separate a plate from a cell and two of them survive
   at 14px desaturated: shape (a disc against a rounded square), value (china at
   Y 82.8 per cent against the dent's 66.3 - the plate is the brightest cell on
   the board), relief, and the cast shadow. THE PLATE IS THE ONLY OBJECT ON THE
   BOARD THAT CASTS AT REST: a tile casts only when it lifts, but a plate is not
   a tile, it is a painted object standing on the table.

   EVERY PLATE IS IDENTICAL - no chip, no crumb, no tea stain, no per-cell
   rotation. The engine has one { type: 'blocked' }, any depicted wear is under
   the 2px floor, and a randomised mark would visibly change while travelling
   under a View Transition. What accumulates is RELIEF: nine plates is nine
   shadows, and adjacent plates darken the 2px gap between them twice over. */
.ft-tile--blocked {
  background: var(--recess);
  border-color: transparent;
  box-shadow: none;
  cursor: default;
}

.ft-plate {
  width: var(--plate-size);
  height: var(--plate-size);
  border-radius: 50%;
  /* THE RIM LINE IS THE FILIGREE'S OWN BLUE-GREY, sampled off the painting and
     promoted to the plate's edge exactly as each tile's dark stop was promoted
     to its rim. It is the plate's yellow tile: #A7B1B9 reads 1.57:1 against the
     gap where the yellow rim reads 1.55:1. Same problem, same fix. */
  border: 1px solid var(--china-dk);
  /* Three layers: the specular at 10 o'clock on the rim band; the WELL, drawn as
     light rather than as a colour exactly as the tile's form is - a shadow ring
     where the well's wall turns up, then the rim band catching the light above
     it, soft enough that no edge falls under the 2px floor (the junction runs
     from 46 to 76 per cent of the diameter, 9.6 CSS px at a 44px tile); and the
     body along the light. NO FILIGREE AND NO SCALLOPS: measured off the painting
     they render at 0.39 / 0.32 / 0.29 and 1.11 / 0.89 / 0.81 CSS px, and
     anything under the floor is deleted rather than shrunk. */
  background: var(--plate-body);
  box-shadow: var(--plate-edges);
  pointer-events: none;
}

/* ILLEGAL / REMOVABLE - "this is going away". A ring plus a wash, never a
   repaint: the only 3px ring in the system, at offset 2, plus a 14 per cent
   danger wash sitting ABOVE the field and BELOW the content, so no state at any
   strength can reach the black silhouette. The wash is
   `inset 0 0 0 999px`, which costs zero elements and zero layers. */
.ft-tile--removable {
  outline: 3px solid var(--color-danger);
  outline-offset: 2px;
  box-shadow: inset 0 0 0 999px rgba(192, 57, 43, 0.14), var(--form-edges);
  cursor: pointer;
}

/* A removable EMPTY PLATE keeps the plate's own relief under the danger wash. */
.ft-tile--blocked.ft-tile--removable {
  box-shadow: inset 0 0 0 999px rgba(192, 57, 43, 0.14);
}

.ft-tile__icon {
  width: 60%;
  height: 60%;
  object-fit: contain;
}

/* Teapot symbol printed on the tile-market board. Rendered only on the five
   symbol cells while they are EMPTY (see TEAPOT_SYMBOL_CELLS / updateMarket).
   A PRINTED MARKER IN A DENT, not a collectible tile: plan section 8.6 settles
   the five symbol cells as dents with the teapot printed into them, because a
   printed marker in a dent is not an object standing in a place setting.

   Nothing dims it any more. Empty market cells used to be drawn at 0.3 opacity
   and a symbol cell was exempted from that so the marker was not lost at
   0.3 x 0.5; the dent replaces the fade entirely, so this is just a marker on
   the board's own ground.

   The size and opacity are tuned to the TEAPOT art, which replaced a cupcake:
   it is cream-on-cream, so it washes out below ~0.6, and it is a landscape image
   in a square box, so object-fit: contain renders far less ink than the square
   cupcake did. */
.ft-market-teapot-symbol {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 62%;
  height: 62%;
  object-fit: contain;
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* THE GATE, SHOWN ON THE BOARD. Once REFRESH_THRESHOLD symbols are uncovered a
   fresh pot may be ordered, so at that instant every showing symbol lights up.
   GOLD MEANS "THIS COSTS YOU SOMETHING", or here that a gate is open (decision
   15), and it lights THE MARKER rather than repainting the cell - the cell is a
   dent and a dent is part of the board, not a state indicator.

   .ft-tile--symbol (#FFFCF5) and .ft-tile--symbol-armed (a gold wash and a
   pulse) were deleted here. Neither had EVER rendered: the empty market cell's
   inline `background-color: white` beat both of them for the whole life of the
   build, so the five teapot cells have always been plain white on screen. They
   were reproduced deliberately by stage 3 so its screenshot diff could be empty,
   and retired here, which is the first stage entitled to change what they look
   like. */
.ft-market-teapot-symbol--armed {
  opacity: 1;
  filter: drop-shadow(0 0 3px rgba(201, 162, 39, 0.9));
}

/* DRAG-OVER - the cell a dragged tile is currently over. A ring and a wash. */
.ft-tile.drag-over {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
  box-shadow: inset 0 0 0 999px rgba(193, 123, 92, 0.10), var(--dent-edges);
}

/* MOVABLE - a tile a cupcake could pick up. Gold, because it costs a cupcake. */
.ft-tile--movable {
  cursor: grab;
  outline: 2px solid var(--color-accent-gold);
  outline-offset: 1px;
  box-shadow: inset 0 0 0 999px rgba(201, 162, 39, 0.16), var(--form-edges);
}

.ft-tile--movable:active {
  cursor: grabbing;
}

/* MOVE TARGET - where the paid move may land. The same gold, on a dent. */
.ft-tile--move-target {
  outline: 2px solid var(--color-accent-gold);
  outline-offset: 1px;
  box-shadow: inset 0 0 0 999px rgba(201, 162, 39, 0.16), var(--dent-edges);
  cursor: crosshair;
}

/* ======= The tap path (plan B1) =======

   A swept tile that has been tapped and is waiting for a destination. It has to
   be unmistakable, because on touch there is no cursor and no drag ghost to say
   what is in hand - this ring IS the feedback that the tap registered. */
/* ARMED. A solid accent ring at 2px offset 2, a 2px rise, and THE TILE CASTS -
   because things that lift, cast. The shipped glow is replaced by the cast
   shadow, which is the same message told with the one light the whole system
   uses rather than with a halo that has no source. */
.working-tile--selected {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 999px rgba(193, 123, 92, 0.08),
    var(--form-edges),
    2px 3px 5px rgba(var(--shadow-ink), 0.40);
}

/* BACK IN THE BAG (the trim rule, 6 August). A swept tile with nowhere left to
   go: the board is full and this one returns to the bag when Done is pressed.
   Giving a tile up is an ordinary outcome, not a mistake, and the phase bar
   already says how many - the point is only that it must not read as a tile the
   player forgot to place.

   NOTHING IS DIMMED. The shipped `opacity: .45` plus `grayscale(.6)` is exactly
   what the register forbids - it fades a painted object and desaturates the one
   layer the colourblind gate depends on. A 52 per cent COOL SLATE WASH says the
   same thing without touching the paint, and the flat strike stays. The wash
   sits above the field and below the content, so the black silhouette is still
   pure black. */
.working-tile--to-bag {
  opacity: 1;
  filter: none;
  position: relative;
  cursor: not-allowed;
  box-shadow: inset 0 0 0 999px rgba(var(--shadow-ink), 0.52), var(--form-edges);
}

.working-tile--to-bag::after {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  border-top: 2px solid rgba(61, 43, 31, 0.60);
  transform: rotate(-20deg);
  pointer-events: none;
}

/* TAP TARGET - every cell the armed tile could legally land in. Deliberately
   quieter than .ft-tile--move-target, which marks a PAID once-a-turn move,
   whereas this is the ordinary case and is on up to 24 cells at once. The dashed
   border moves OUTSIDE the cell as an outline, which is what stops 24 of them
   nudging the grid, and the wash goes 6 to 10 per cent to pay for the border no
   longer being drawn on the cell itself. */
.ft-tile--tap-target {
  outline: 2px dashed var(--color-accent);
  outline-offset: 1px;
  box-shadow: inset 0 0 0 999px rgba(193, 123, 92, 0.10), var(--dent-edges);
  cursor: pointer;
}

/* ======= THE TILE COLOUR CLASSES (defect 8, stage 3, 10 August) =======

   board.js used to write a tile's colour as an inline background-color at six
   sites, and AN INLINE DECLARATION BEATS ANY STYLESHEET. Stage 4's per-colour
   light and dark stops - the tile's field, and the rim derived from its dark
   stop - could therefore not be applied from CSS at all. getColourClass() in
   board.js now emits a class and the colour lives here instead.

   The rejected alternative was alpha layers over the inline colour via
   background-image, which is a different property and would have layered over
   background-color untouched at zero code. It is refused by the plan because
   it costs the per-colour DARK STOP, and the rim is derived from it. Do not
   revisit it.

   TWO THINGS A LATER STAGE MUST NOT UNDO.

   1. The selector stays at three classes. Stage 3 needed it because four rules
      here set a background on a state a COLOURED tile can be in at the same
      time and the inline declaration beat all four; STAGE 4 HAS TAKEN THE
      BACKGROUND OFF EVERY ONE OF THEM - a state is a ring plus a wash now, and
      a wash is a box-shadow - so the specificity is no longer load-bearing for
      that reason. It is kept because it is what paints the flat mid under the
      tile's own gradient stack and on the two non-tile carriers below, and
      because lowering specificity is a change with no upside.
   2. --lt / --mid / --dk are the names the painted tile is written against
      (`border: 1px solid var(--dk)`, and --tile-field's 148deg fall). The MID is
      an alias of the shipped --tile-<colour> and does not move: it is the
      printed tile colour and the goal cards' pattern swatch, and web and print
      may not diverge on the game's own colour language. Only --lt and --dk are
      new.

   ft-colour-none IS RETIRED. It was the literal `background-color: white` an
   empty market cell carried inline, and an empty cell is not a colour - it is
   the whole cell, drawn as a dent. getColourClass() returns nothing for a cell
   with no tile in it. */
.ft-colour-yellow { --lt: var(--yellow-lt); --mid: var(--yellow); --dk: var(--yellow-dk); }
.ft-colour-pink   { --lt: var(--pink-lt);   --mid: var(--pink);   --dk: var(--pink-dk); }
.ft-colour-green  { --lt: var(--green-lt);  --mid: var(--green);  --dk: var(--green-dk); }
.ft-colour-blue   { --lt: var(--blue-lt);   --mid: var(--blue);   --dk: var(--blue-dk); }
.ft-colour-orange { --lt: var(--orange-lt); --mid: var(--orange); --dk: var(--orange-dk); }

/* ======= THE FIELD (plan section 8.6, stage 4a) ===========================
   LAYER 2 OF THE TILE, and the centrepiece of the visual language: a radial
   highlight at 27 / 20 per cent, and a 148 degree body gradient running the
   colour's light stop to its mid at 46 per cent to its dark stop. It is the
   prototype's recipe to the character (wayfinder/prototypes/tile-treatment-v1
   .html, .tile) and it is not to be re-derived.

   IT IS DECLARED HERE, ON THE BARE .ft-colour MARKER, AND NOWHERE ELSE, and
   that placement is the whole of stage 4a. A var() inside a custom property is
   substituted at the point of DECLARATION, against the element the custom
   property is being computed for - not at the point of USE. --lt, --mid and
   --dk are declared on .ft-colour-<name> immediately above, so the only scope
   where this recipe can resolve is an element carrying a colour class. .ft-colour
   is on every one of them: board tiles, market tiles, working tiles, the stand's
   filled plates and the sweep dialog's .ds-tile, all from one getColourClass()
   in board.js.

   Declared on :root instead - which is where stage 4 put it - the three stops
   are absent, the property computes to the empty string, and every consumer's
   background-image silently resolves to `none`. That shipped through a whole
   stage of screenshot review because an empty string and a deliberate `none`
   look identical.

   One class of specificity is deliberate and is enough: nothing sets a custom
   property inline, so this needs none of the three-class depth the
   background-color rule below needs. It leaves the shrink ladder room to turn
   the field off from a band with a two-class descendant selector, which is what
   the 24 and 14px rungs do.

   CONSUMED AS background-image, NEVER as the `background` shorthand. The
   shorthand would reset background-color to transparent in the same rule, and
   the flat --mid underneath the gradient stack is the printed tile colour - it
   may be painted over, never replaced. */
.ft-colour {
  --tile-field:
    radial-gradient(115% 115% at 27% 20%, rgba(255, 255, 255, 0.60), rgba(255, 255, 255, 0) 56%),
    linear-gradient(148deg, var(--lt) 0%, var(--mid) 46%, var(--dk) 100%);
}

.ft-tile.ft-colour.ft-colour-yellow,
.ft-tile.ft-colour.ft-colour-pink,
.ft-tile.ft-colour.ft-colour-green,
.ft-tile.ft-colour.ft-colour-blue,
.ft-tile.ft-colour.ft-colour-orange,
.ft-stand__plate.ft-colour {
  background-color: var(--mid);
}
/* .ft-modal__option-colour.ft-colour came off this list with the swatch it
   painted. Stage 5 replaced the sweep dialog's colour SWATCH with the actual
   tiles the sweep would take (decision 10), which are .ds-tile and take their
   field from --lt / --mid / --dk exactly as .ft-tile does. */

/* The touch-hygiene block that neutralises :hover lives at the VERY END of this
   file - see "Touch hygiene (plan B2)". It has to, because a media query adds no
   specificity: three of the rules it overrides (.ft-cupcake-spend-btn:hover,
   .ft-card--claimable:hover, .ft-card--reservable:hover) are declared further
   down, and would beat it from here. */

/* Kills the ~300ms tap delay and the double-tap-to-zoom gesture on the controls
   a player taps repeatedly. Without it every placement feels laggy, and a quick
   two-tile placement can be swallowed as a zoom. */
.ft-tile,
.board-tile,
.working-tile,
.ft-btn,
.market-tile,
.ft-cupcake-spend-btn,
.ft-card {
  touch-action: manipulation;
}

/* ======= Market Controls ======= */

.ft-market-controls {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.ft-market-selector {
  flex: 1;
}

.ft-market-selector__label {
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ft-market-selector__buttons {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
}

.ft-market-selector__btn {
  width: var(--tile-size);
  height: var(--tile-size);
  border: 1px solid var(--color-border);
  background: white;
  color: var(--color-text-primary);
  font-size: 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ft-market-selector__btn:hover {
  border-color: var(--color-accent);
  background: var(--color-cream);
}

/* ======= Card Market ======= */

/* The card row is VARIABLE-LENGTH (28 July rework, CAPPED at MAX_MARKET_CARDS on
   30 July): it starts at 3, grows by one at the end of every turn up to 8,
   shrinks by one per market claim, and a fresh pot of tea cuts it back to 3.

   The row is framed as its own strip so its length is legible: a header states
   the count. It no longer caps its height or scrolls, and the cards no longer
   step down in size as it grows - the art carries the PATTERN a player has to
   match, so the panel takes the height instead. Since 4 August the strip is the
   full width of the centre column, and CARD_DISPLAY_HEIGHT in board.js is derived
   from that width; the derivation is written out in full there. */
/* ---------------------------------------------------------------------------
   THE PLAYER PANEL'S LEFT COLUMN: score breakdown, cake stand, cupcake supply.

   IT MUST NEVER SCROLL. This carried an inline `overflow-y: auto; max-height:
   550px` on all four player panels, which was fine until the 3 August cupcake
   spend menu added two buttons to the supply block and pushed it past the cap -
   at which point a scrollbar appeared and quietly hid the bottom of the stand,
   which is the single most important thing on the panel to be able to read.

   A fixed pixel cap could only ever be right for one content length. Instead the
   column simply stretches: the panel is a flex ROW, so the default align-items:
   stretch makes this full height, and the panel's height is set by the taller
   right-hand column (header + swept tiles + board + phase controls). The two
   columns therefore end level, at the bottom of the action area, whatever either
   of them contains.
   --------------------------------------------------------------------------- */
.ft-player-score {
  flex-shrink: 0;
  min-width: var(--score-col-min);
  /* No max-height and no overflow: see above. If this column ever genuinely
     needs to be bounded, bound the PANEL and let both columns agree - never this
     one alone, or the stand goes back under a scrollbar. */
}

/* The INGREDIENT OBJECTIVES design note stood here - why the panel sat beside the
   tile market (a pair was won by declaring an ingredient on a sweep), why its
   requirements were symbols rather than words, why it was tinted, and its three
   states. The pantry goals are deleted from the game, 4 August, and the rules
   they documented no longer exist anywhere. */

/* ===========================================================================
   THE CENTRE COLUMN
   ===========================================================================
   Three horizontal BANDS, top to bottom in the order a player needs them:

     1. head   - whose turn, which step, and the way into the rules
     2. table  - the shared tile market, plus the two clocks that measure the
                 game's state (cards claimed, fresh pot)
     3. cards  - the card market, full width. This was `split` until 4 August: two
                 scoring tracks side by side, ingredient objectives | card market.
                 The objectives are deleted, so the cards have the band to
                 themselves and were resized for it.

   Every block inside them is a .ft-section, and since stage 4 a section is a
   flat SURFACE on the wall: one ground, one radius, no tint, no border, no rail
   and no shadow. What separates two of them is the gap of wall between them.
   =========================================================================== */

/* ONE panel spanning BOTH grid rows, sized to its own content.
   It used to be two panels, one per grid row, and that was the white gap: a grid
   row is as tall as its tallest cell, the player panels beside it are ~490px, so
   the centre panel stretched to match and left ~88px of empty panel under the
   tile market. Spanning both rows removes the row boundary; align-self: start
   stops the merged panel stretching, so slack falls BELOW the cards as page
   background rather than being trapped as white in the middle. */
.ft-centre {
  grid-column: 2;
  /* Was an inline `grid-row: 1 / span 2` in the markup. Moved here for the same
     reason the seat positions were: a media query cannot override a style
     attribute, and the narrow bands have to re-place this panel. */
  grid-row: 1 / span 2;
  align-self: start;
  gap: var(--spacing-sm);
  /* The centre stops being a panel with the rest of them: a card inside a card
     wasted ~36px of width, and each section carries its own ground. */
  padding: 0;
}

/* ---- THE SURFACE (plan section 8.5) ---------------------------------------
   A section is a SURFACE: the flat container for anything made of words and
   numbers. Ground --surface, radius 12, NO BORDER, NO SHADOW, NO TINT AND NO
   RAIL. The gap of wall around it is what separates it from its neighbour, and
   it separates far better than a tint ever did - a 12px gap of wall between two
   surfaces is a 23 point luminance step, where the six section tints were 4.

   THE LEFT RAIL RETURNS AS STATE, not as identity: a 3px accent rail shown only
   while a section is announcing something. A rail that is always there says
   nothing; a rail that appears says read me. It is an inset box-shadow rather
   than a border so it costs no width - see .ft-section--alert. */
.ft-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: var(--radius-lg);
  background: var(--surface);
  min-width: 0;
}

/* The announcing state, ready for stages 6 and 7 to switch on. */
.ft-section--alert {
  box-shadow: inset 3px 0 0 var(--color-accent);
}

/* ONE HEADING TREATMENT: Fraunces 15, sentence case, no rule under it.
   ALL-CAPS LETTERSPACED TYPE LEAVES THE HEADING SYSTEM ENTIRELY (plan section
   8.5) and survives in exactly one role, --type-stamp. Fraunces is the voice of
   the game and is never uppercase, never letterspaced and never below 15px. */
.ft-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--spacing-sm);
  padding-bottom: var(--spacing-xs);
  border-bottom: none;
}

/* A head with no title left in it has nothing to push apart. */
.ft-section__head--metaonly,
.ft-section__head--figure {
  justify-content: flex-start;
  padding-bottom: 0;
}

.ft-section__title {
  font-family: 'Fraunces', serif;
  font-size: var(--type-heading);
  font-weight: 600;
  line-height: 1.3;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text-primary);
  white-space: nowrap;
}

.ft-section__meta {
  font-size: 11px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.ft-section__meta strong {
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
}

/* A figure that IS the point of its section (a score, a ratio) rather than an
   aside - sized and coloured to be read from across the table. */
/* A FIGURE THAT IS THE POINT of its section rather than an aside, at
   --type-figure: 22px at L and XL, 20 below M. It carries --accent-deep rather
   than --accent, which fails the text bar on five of the nine grounds this build
   has (plan section 8.4 ruling 1: the accent is a fill, a rail, a ring, a meter
   or a border, and never an ink). */
.ft-section__meta--figure {
  font-family: 'Fraunces', serif;
  font-size: var(--type-figure);
  font-weight: 700;
  line-height: 1;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}

/* The caption under a figure, and the one-line plain-language note some sections
   end on: --type-caption. */
.ft-section__note {
  margin: 0;
  font-size: var(--type-caption);
  line-height: 1.4;
  color: var(--color-text-secondary);
}

/* THE END TRIGGER BONUS note (16 August), on the board-fill gauge. Same caption
   size as the note above it - it is a second caption, not a heading - but in the
   primary ink rather than the secondary, because it is the only line on the panel
   that is an INCENTIVE rather than a reading, and secondary grey is what the
   build uses for "context you can skip". A top margin separates the two notes so
   they do not read as one wrapped sentence. */
.ft-section__note--reward {
  margin-top: 4px;
  color: var(--color-text-primary);
}

/* ---- Per-section identity: THERE ISN'T ANY, AND THAT IS THE POINT ----------
   The six section tints and their six coloured left rules are DELETED (plan
   section 8.5). They were doubled in strength on 7 August to try to make six
   panels stacked in one column read as six things; the answer turned out not to
   be more tint but no box - the gap of wall between two surfaces is a 23 point
   luminance step and does the separating on its own, at zero saturation, without
   competing with the tiles and cards, which are the only things on this screen
   that are meant to be colourful.

   THE WRAPPING HACK RETIRES WITH THEM. .ft-section--claims's title is deleted
   outright - it is a figure with a caption now - so only the Flavour's title,
   which carries its price beside a "+3 most" figure, still needs to wrap. */
.ft-flavour .ft-section__title {
  white-space: normal;
  min-width: 0;
}

/* AND THE FLAVOUR'S TITLE GIVES BACK ITS TRACKING, because wrapping alone was not
   enough. With the name held together by non-breaking spaces, "FLAVOUR OF THE DAY"
   is one 131px line inside a box the head can only spare 125px for - so it ran
   into the "+3 most" figure with no gap between them. 0.09em over 18 characters is
   18px of pure letterspacing; at 0.03em the line fits with room to spare and the
   label still reads as a label. The padding is the belt to that braces: it
   guarantees a channel even if a longer figure ever sits beside it. */
.ft-flavour .ft-section__title {
  letter-spacing: 0.03em;
  padding-right: 4px;
}

/* .ft-section--objectives, --tiles, --claims, --cards and --tea all carried a
   tint and a coloured left rule here. All five are deleted by stage 4: TINT
   DIES, BORDER DIES, RAIL SURVIVES ONLY AS STATE. The tea gauge's own --ready /
   --locked modifiers are declared further down and still win, which is right - a
   gauge that cannot go loud when the pot is due is not a gauge, and that is a
   section ANNOUNCING something rather than a section wearing a colour. */

/* ---- BAND 1: the title bar ----------------------------------------------- */
.ft-centre-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  /* The one dark surface in the layout. It gives the column a top edge with real
     weight, and makes "whose turn is it" readable from across the table. */
  background: linear-gradient(135deg, #4A3527 0%, #3D2B1F 100%);
  box-shadow: inset 0 -2px 0 rgba(201, 162, 39, 0.5);
}

.ft-centre-head__turn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ft-centre-head__player {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
  color: #FBF5EC;
  white-space: nowrap;
}

/* Hidden until a bot is thinking; setThinkingState toggles the container, so it
   must not reserve height when idle. */
.ft-centre-head__thinking {
  display: none;
  width: 180px;
}

.ft-centre-head__thinking-track {
  height: 4px;
  background-color: rgba(251, 245, 236, 0.25);
  border-radius: 2px;
  overflow: hidden;
}

.ft-centre-head__thinking-bar {
  height: 100%;
  width: 0%;
  background-color: var(--color-accent-gold);
  transition: width 0.2s ease;
}

.ft-centre-head__right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

/* The turn bar is a STRIP, and its label is the stamp role - the second and last
   site of the only uppercase role in the system. */
.ft-centre-head__stat {
  font-size: var(--type-stamp);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(251, 245, 236, 0.65);
  white-space: nowrap;
}

.ft-centre-head__stat strong {
  font-size: 14px;
  color: #FBF5EC;
  font-variant-numeric: tabular-nums;
}

/* ---- The How to Play button ---------------------------------------------
   The only control in this column, so it is FILLED rather than outlined and it
   says what it does. On the dark bar it reads as the obvious next click. */
/* ==========================================================================
   THE MUTE (stage 8, plan section 13.6)

   Beside How to Play, in the turn bar's right group, at every band. On a phone
   the turn bar IS the dock and this is its right end; above 1149 there is no
   dock and the bar is the panel's own title row, which is why one rule serves
   both.

   IT IS 28px HIGH AT DESKTOP AND 44 IN THE TOUCH BAND, and the number is not a
   choice: the rule that governs it is 44px for anything a FINGER taps, and the
   band where a finger taps is the band where the phone rules below give it 44.
   Above that it matches the button beside it to the pixel, because a taller
   control in this row would raise the whole title bar and the page-height
   ratchet only ever permits a number to fall.

   TRANSPARENT AND BORDERLESS AT DESKTOP, so the row still has exactly one filled
   control in it - a second gold button beside How to Play would read as a second
   primary action, and this is a preference rather than an action.
   ========================================================================== */
.ft-sound-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-inverse);
  cursor: pointer;
  flex: 0 0 auto;
}

.ft-sound-btn:hover {
  background: rgba(251, 245, 236, 0.14);
}

.ft-btn-howto {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  /* 6px, not the 7 this shipped with. The button was sized around a 15px emoji
     glyph and the `book` icon is 16, which took the button from 29px to 30 and
     the whole band-1 title bar with it - measured as +1px of page height at
     1150, 1280, 1366 and 1399, in both the opening and mid-game positions, and
     the page-height ratchet only ever permits a number to fall. One pixel off
     the padding puts the button at 28 and the M band at 1617, below where it
     started. Nothing else in this bar is taller than it. */
  padding: 6px var(--spacing-md);
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-accent-gold);
  color: #3D2B1F;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.ft-btn-howto:hover {
  background: #E4C24B;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.ft-btn-howto:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* The icon here is the `book` <use> site. It used to be a live open-book emoji
   written as a numeric character reference, which is why ticket 00's grep for
   Extended_Pictographic could not see it (defect 6). No font-size rule is
   needed any more - the SVG carries its own 16. */
.ft-btn-howto__label {
  letter-spacing: 0.02em;
}

/* ---- BAND 2: market + the two clocks ------------------------------------- */
.ft-centre-table {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--spacing-sm);
  align-items: start;
}

.ft-centre-meters {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  min-width: 0;
}

/* The market grid is a fixed size, so its section hugs it rather than stretching. */
.ft-section--tiles {
  width: max-content;
}

/* The market is the thing everyone is looking at, and it was sitting tight
   against its own section border. The generous padding is the point - it lets
   the grid read as an object on a table rather than a bitmap in a box. */
.ft-market-wrap {
  display: flex;
  justify-content: center;
  padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-xl);
}

/* ---- BAND 3: the card row ------------------------------------------------
   .ft-centre-split lived here: a two-column grid, `260px 1fr`, with the Pantry
   Goals panel on the left and the card market on the right. The pantry goals are
   deleted from the game (4 August), so there is no second column and no wrapper -
   .ft-section--cards is a plain full-width child of .ft-centre.

   THE 260px WAS LOAD-BEARING and its removal is not cosmetic: cardDisplayHeight()
   in board.js was tuned to the width the split left over. It has been re-derived
   against the full 782px band - see the comment on CARD_DISPLAY_HEIGHT, which
   carries the whole subtraction. If the centre column ever moves, that comment is
   the thing to redo. */

/* ---- The cards-claimed bar ------------------------------------------------ */
.ft-claim-meter__track {
  height: 10px;
  background-color: rgba(61, 43, 31, 0.12);
  border-radius: 5px;
  overflow: hidden;
}

.ft-claim-meter__bar {
  height: 100%;
  width: 0%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--color-accent) 0%, #D89A78 100%);
  transition: width 0.3s ease;
}

/* ---- The SECOND gauge: the fullest cake stand (17 August) ------------------
   End condition 3 shipped on 12 August and this panel carried only end condition
   1. The two readings are the same KIND of fact - how close is somebody to
   ending the game - so they are the same object twice rather than two designs,
   and the second one inherits .ft-claim-meter__track and __bar untouched.

   THE FILL IS THE ONLY THING THAT DIFFERS, and it differs because the two bars
   are stacked 30px apart and a player has to be able to tell at a glance which
   one moved. The board bar runs terracotta; this one runs the cake stand's own
   gold, which is the ink the stand and its plates are already drawn in
   everywhere else on the screen. Same geometry, same easing, same height. */
.ft-claim-meter__bar--stand {
  background: linear-gradient(90deg, #C9A227 0%, #E3C878 100%);
}

/* The second figure's head needs the gap the first one gets from the section's
   own top padding. 10px is the panel's internal rhythm - the same step the
   caption above it sits on - so the pair reads as two rows of one panel rather
   than as a panel and an afterthought. */
.ft-section__head--second {
  margin-top: 10px;
}

/* THE FINAL-ROUND LINE (17 August). A third note on the ending panel, and the
   only one of the three that is an EVENT rather than a standing reading - it is
   absent for the whole game and then appears for one lap. So it is the one that
   is allowed to be loud: primary ink, and the panel's own accent as a left rule,
   which is the same device the tea gauge uses when the pot is due.

   It is NOT a colour-only signal. The line opens with the words "Final round." in
   bold, and the sentence names who armed the ending and whose last turn this is,
   so nothing about it depends on seeing the rule at the side. */
.ft-section__note--final {
  margin-top: 10px;
  padding: 6px 8px;
  border-left: 3px solid var(--color-accent);
  border-radius: 0 4px 4px 0;
  background-color: rgba(201, 162, 39, 0.10);
  color: var(--color-text-primary);
}

/* ---- The start player marker (17 August) -----------------------------------
   The teapot beside the seat that went first. It sits in the seat header next to
   the human/bot marker and is sized to match it, so the header carries two small
   facts about the seat in one row rather than growing a second.

   NO WIDTH OF ITS OWN AT THE NARROW BANDS: the opponent strip has none to spend
   (see the seat rule's note in section 8.9), so the marker is inline and the
   16px image is its whole footprint. */
.ft-seat__start {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  vertical-align: middle;
  opacity: 0.85;
}

/* THE PANTRY GOALS STYLESHEET IS DELETED (4 August), all ~195 lines of it:
   .ft-objectives__list, .ft-objective and its --ready / --taken states, the
   .ft-objective__reqs / __req / __req--met chips, __symbol, __count-text,
   __owner and __owner--ready, plus the objective-ready keyframes and their
   prefers-reduced-motion off-switch. (Two near-identical copies of the set had
   accumulated, one overriding the other; both go.)

   The ingredient objectives are gone from the game, so nothing emits any of
   these class names any more - see the note at the top of src/engine/game.js
   for why the module was cut, and the note left where renderObjectives stood in
   src/ui/board.js for what the markup used to be. */

/* ---------------------------------------------------------------------------
   THE PAID CUPCAKE SPENDS (3 August). Three buttons in the cupcake panel, and
   they do not all behave alike. The extra tile (restored 9 August) and the
   reserve ARM a mode, and the target is then clicked on the market or the card
   row; the 2-card deal (8 August) fires on the click itself, because the player
   picks nothing. They are disabled rather than hidden when unavailable, so the
   menu is always legible - a player needs to know the option exists on the turn
   they cannot use it, not only on the turn they can.
   --------------------------------------------------------------------------- */
/* A GRID SINCE STAGE 6, one column here and two on the phone (Dean's decision
   1). One column is what the flex column already drew, so nothing moves above
   the band; what changes is that there are SIX chips rather than three buttons,
   because the extra tile at step 1 and the further claim at step 4 were the two
   spends this menu never listed. */
.ft-cupcake-spends {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: var(--spacing-xs);
}

.ft-cupcake-spend-btn {
  padding: 4px var(--spacing-sm);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

/* THE CHIP: icon, name, price. The price is a COLUMN rather than a suffix in
   the name - "(1 cupcake)" at the end of a sentence is unscannable in a
   two-column grid, and six prices that line up are six prices you can compare.
   The cupcake is the icon and it is aria-hidden; the button's aria-label says
   the price in words, because no icon in this set is ever the accessible name
   of anything. */
.ft-spend-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-xs);
  text-align: left;
}

.ft-spend-chip__name {
  min-width: 0;
}

.ft-spend-chip__price {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.ft-spend-chip__price .ft-icon {
  color: currentColor;
  /* THE MARK GREW; THE CHIP DID NOT (10 August). The currency mark went from 14
     to 20 - see SPEND_CUPCAKE_ICON in board.js - and because it is the tallest
     thing in a chip whose text is 11px, every one of the six chips would grow
     6px with it. Six chips at 6px is 36px of page, and the widest band has 22px
     of slack: the score column is the tallest column there, so anything this
     panel gains, the page gains.
     All six are given back to the chip's own 4px of padding, which the mark now
     overhangs by 3px top and bottom. It stops 2px short of the border, the chip
     stays exactly the 24px it shipped at, and the page height at 2181 and 2400
     is unchanged. This is the whole reason the mark could be made big enough to
     read: 16px was the largest that fitted without it, and 16px was not enough.
     Do not raise SPEND_CUPCAKE_ICON further without moving this number with it,
     and not past 22 at all - at 22 the mark reaches the border.
     It selects .ft-icon and the cupcake is an <img> in that class, which is the
     point of putting it there: the rule did not have to learn a second name when
     the glyph became art. */
  margin-block: -3px;
}

/* The sixth chip is NOT a control. A further claim is taken by tapping a card
   at the claim step, so there is no button here to press and a permanently
   disabled one would be a lie about what the interface does. It states a price,
   which is the one thing about that spend a player cannot read anywhere else. */
.ft-spend-chip--note {
  cursor: default;
  background: none;
  border-style: dashed;
  color: var(--color-text-secondary);
  /* AND IT IS QUIET UNTIL THE PRICE IS REAL (10 August). The other five chips
     are buttons, so an unavailable one greys itself to 0.4 through :disabled.
     This one is a span and could not, which left the single most prominent chip
     in the menu describing the one spend that is unavailable for most of the
     turn - the first claim of a turn is free, so until a claim has been made
     there is no price here to pay. It takes the same 0.4 by hand. */
  opacity: 0.4;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

/* Lit for exactly as long as a further claim can be bought - see extraClaimLive
   in board.js. Full strength, primary ink and the same gold the armed chips
   carry, but the border stays DASHED: this is now relevant, and it is still not
   a button. The claim is taken by tapping a card. */
.ft-spend-chip--note.is-live {
  opacity: 1;
  background: #FFF6DC;
  border-color: var(--color-accent-gold, #C9A227);
  color: var(--color-text-primary);
}

.ft-cupcake-spend-btn:hover:not(:disabled) {
  background: #FFF6DC;
  border-color: var(--color-accent-gold, #C9A227);
}

.ft-cupcake-spend-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Armed: the next market/card click spends. */
.ft-cupcake-spend-btn--active {
  background: #FFF1C2;
  border-color: var(--color-accent-gold, #C9A227);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.35);
}

/* COACHING, sitting under the button it is about.
   These two lines came out of the phase bar on 4 August (plan section 5.4). The
   phase bar is the COMMAND - what you must do now, and the buttons to do it -
   and it was carrying explanations of controls that live in this panel. At a
   narrow width the extra-tile sentence alone wrapped to four lines and made the
   bar 200px tall, which is what broke the single-column vertical budget.

   Deliberately quieter than a .ft-phase-bar__status: it is a footnote to the
   button above it, not an instruction competing with one. The left rule ties it
   to that button rather than letting it read as another item in the list. */
.ft-cupcake-note {
  display: block;
  font-size: 10px;
  line-height: 1.35;
  color: var(--color-text-secondary);
  padding: 2px 0 2px var(--spacing-xs);
  margin: -2px 0 2px;
  border-left: 2px solid var(--color-border);
  /* THIS CAP IS LOAD-BEARING, and without it the page grows by ~380px.
     .ft-seat is `min-width: max-content` so a board can never overflow its own
     panel (plan A2). The board column is immune to that because it has a
     definite width, but the SCORE column does not - it sizes to its own content
     - so a long enough sentence in here sets the whole seat's minimum at its
     UNWRAPPED length, and the page follows. Measured: 2181px -> 2560px in the
     place phase, purely from the extra-tile note arriving.

     Clamping the max-width clamps the element's max-content contribution, which
     is the thing actually doing the damage. 200px at XL is well under the ~297px
     the stand already gives the column, so nothing moves; the sentence simply
     wraps instead of dictating the layout.

     NOTE FOR PHASE E: section 4 sets --score-col-min to `auto` at the S band.
     `max-width: auto` is invalid and computes to `none`, which switches this
     protection off - so the S band must either give this a length or drop
     .ft-seat's max-content minimum, which single-column has to do regardless. */
  max-width: var(--score-col-min);
}

/* A live offer, rather than a statement of fact. Same gold as the armed button,
   so the eye connects the sentence to the control it is offering. */
.ft-cupcake-note--offer {
  color: var(--color-text-primary);
  border-left-color: var(--color-accent-gold, #C9A227);
}

/* A market tile that the armed extra-tile purchase can lift. Deliberately the
   same visual language as the free line-clear bonus tile, because it is the same
   operation at a price. (Deleted 8 August with the rule, restored 9 August.) */
/* REWRITTEN ONTO THE SHARED RING (stage 8). `ft-buyable-pulse` ran on up to 25
   market tiles at once - 25 infinite box-shadow animations, which is not a
   signal, it is a field. It becomes the gold DOUBLE ring, and the breath is
   capped to one by capRings() in motion.js. */
.ft-tile--buyable {
  outline: 2px solid var(--color-accent-gold);
  outline-offset: -2px;
}

/* IN HAND (10 August). The extra tile is bought and placed in one action at the
   spend step, so between the two taps a tile has been lifted off the market and
   not yet put down. It is still sitting in its market cell, because nothing is
   paid for until a board cell is named and a cancelled lift must leave the
   market exactly as it was - so the tile is marked rather than moved.
   It takes the ring vocabulary's SOLID accent double ring and lifts off the
   cloth, which is the same "this one is in play right now" the armed sweep
   buttons say. It reads against .ft-tile--buyable's single gold ring on the 24
   tiles around it: one of them is chosen, the rest are still offers. */
.ft-tile--held {
  outline: 3px solid var(--color-accent);
  outline-offset: -3px;
  box-shadow: 0 4px 10px -2px rgba(var(--shadow-ink), 0.5);
  transform: translateY(-2px);
  z-index: 2;
}

/* A long row is a standing invitation to order a fresh pot of tea (the only
   thing that cuts it back), so it is worth flagging rather than just counting. */
.ft-card-row__count--long {
  color: var(--color-accent-gold);
  background: rgba(201, 162, 39, 0.14);
  border-radius: var(--radius-sm);
  padding: 1px var(--spacing-sm);
}

/* In-page notice above the row - currently the one-claim-per-turn rejection.
   Deliberately not a modal: it answers a click, it does not interrupt a turn. */
.ft-card-row__notice {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-danger);
  background: rgba(192, 57, 43, 0.08);
  border-left: 3px solid var(--color-danger);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm) var(--spacing-md);
}

.ft-card-row__notice--flash {
  animation: notice-flash 0.45s ease;
}

/* SURVIVES, MINUS ITS BACKGROUND STEP (stage 8). The 35% keyframe animated
   `background`, a paint property, for one frame of a 450ms arrival that the
   opacity and the 4px rise already carry. Only transform and opacity animate. */
@keyframes notice-flash {
  0% { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.ft-card-grid {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: var(--spacing-md);
  /* NO HEIGHT CAP AND NO SCROLL. The section grows with the row instead.
     It used to cap at 480px and scroll, which worked with the old
     cardDisplayHeight() steps that shrank the cards to fit - and shrinking the
     cards is exactly what we do not want, because the art carries the PATTERN a
     player has to match. Cards are one fixed size now and the panel takes the
     height. The row is capped at MAX_MARKET_CARDS (8), so the worst case is
     three rows, which is bounded and fine.
     The padding is not decoration - .ft-card--claimable draws a glow ring 8px
     outside the card, which a scroll container would clip. */
  padding: 10px;
  background: transparent;
  border-radius: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.ft-card-grid::-webkit-scrollbar {
  width: 10px;
}

.ft-card-grid::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 5px;
}

.ft-card-grid::-webkit-scrollbar-track {
  background: transparent;
}

/* ======= THE CARD ROW'S OVERFLOW CUE (10 August) ===========================
   Below 1150 the row scrolls sideways rather than wrapping, because the card art
   carries the pattern a player has to match and must not be shrunk. The one
   thing that band never had was a way of SAYING there is more row: the scrollbar
   is an overlay hairline that Chrome fades out when idle and that iOS does not
   draw at all until a finger is already moving, so a 390px screen showing three
   cards of eight reads as a row of three - and the row's length is strategic
   information, not decoration.

   NOTHING HERE IS BEHIND A BREAKPOINT. syncCardScrollCue in board.js measures
   scrollWidth against clientWidth and sets data-scroll-prev / data-scroll-next on
   this wrapper, so the cue is a function of whether anything is actually
   off-screen. At XL and L the row wraps, neither attribute is ever 1, and this
   whole block resolves to one positioned div. It also self-clears at each end of
   the travel, which is what makes it a statement about direction rather than a
   permanent frame. */
.ft-card-scroll {
  position: relative;
  min-width: 0;
}

/* THE FADE. A card cut off flat by the panel edge reads as a card that has been
   cropped; a card dissolving into the panel ground reads as a card that carries
   on past it. It is the only half of this cue that survives mid-swipe, when the
   nudge button is under the player's own thumb.
   56px is about a third of a card at every band: enough that the far card reads
   as continuing rather than merely dim, and not so much that it stops being
   identifiable. The 2px inset top and bottom keeps the fade clear of the panel's
   own rounded corner. */
.ft-card-scroll::before,
.ft-card-scroll::after {
  content: '';
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 56px;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.ft-card-scroll::before {
  left: 0;
  background: linear-gradient(to right,
    rgba(var(--surface-rgb), 0.98) 12%,
    rgba(var(--surface-rgb), 0) 100%);
}

.ft-card-scroll::after {
  right: 0;
  background: linear-gradient(to left,
    rgba(var(--surface-rgb), 0.98) 12%,
    rgba(var(--surface-rgb), 0) 100%);
}

.ft-card-scroll[data-scroll-prev="1"]::before,
.ft-card-scroll[data-scroll-next="1"]::after {
  opacity: 1;
}

/* THE NUDGE. The fade is honest but passive: it says "there is more" without
   saying "and here is how you reach it", which is the same gap the hidden
   scrollbar leaves. One tap moves the strip by exactly one card, so a player who
   never thinks to swipe still gets to the end of the row.
   44px, because it is a touch target in the band where it appears and the plan's
   floor for one is 44. It sits ON the fade, at the vertical centre of the strip,
   and it is the china of an object rather than the accent: this is a way of
   looking at the row, never a move in the game, and the accent in this build is
   reserved for what you may DO. */
.ft-card-scroll__nudge {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-card);
  color: var(--color-text-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px -2px rgba(var(--shadow-ink), 0.45);
}

.ft-card-scroll__nudge--prev { left: 2px; }
.ft-card-scroll__nudge--next { right: 2px; }

.ft-card-scroll[data-scroll-prev="1"] .ft-card-scroll__nudge--prev,
.ft-card-scroll[data-scroll-next="1"] .ft-card-scroll__nudge--next {
  display: flex;
}

.ft-card-scroll__nudge:hover {
  background: var(--surface);
  border-color: var(--color-accent);
  color: var(--color-accent-hover);
}

.ft-card-scroll__nudge:active {
  transform: translateY(-50%) scale(0.94);
}

/* Cards a player may not claim again this turn. STILL CLICKABLE, so the click
   can be answered with the rule (see showCardRowNotice), and NO LONGER DIMMED.

   STAGE 5, THE FIRST OF THE CARD ROW'S THREE DIMS. `opacity: .55` plus
   `grayscale(.35)` is the exact thing plan section 6.5 forbids at every band:
   emphasis is additive, and nothing is ever dimmed to say that something else
   is the step. Stage 4 applied that ruling to the ten tile states and left the
   card row for this ticket, because the ticket owns the card row.

   What says it instead is what was always saying it: .ft-card--claimable adds a
   gold ring and a pulse to a card you MAY take, so a card you may not is a card
   with no ring. The cursor and the notice carry the rest, and both are prose
   rather than paint. The rule is kept as a hook rather than deleted, because
   board.js adds the class at two sites and a class with no rule reads as a
   mistake to the next session. */
.ft-card--claim-used {
  cursor: not-allowed;
}

/* A card is NOT clickable by default, and the cursor must say so.
   This carried `cursor: pointer` unconditionally, which meant every card in the
   game claimed to be a button: the market row outside the claim step, and the
   read-only "On order" reserve slots in the player panels, which are pure
   display and can never be clicked at all.

   A card responds to a click in exactly two situations, and each carries its own
   class and its own cursor:
     .ft-card--claimable  - the claim step, and this card's pattern is on your board
     .ft-card--reservable - you have armed the paid reserve
   Plus .ft-card--claim-used, which sets `not-allowed` deliberately: you have
   already claimed this turn, and that is worth saying rather than going inert. */
.ft-card {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: default;
  transition: all 0.2s ease;
  /* background-COLOR, not the `background` shorthand. The shorthand resets
     background-image, and .ft-card is matched by the same elements as
     .card-market-sprite but declared later in this file, so it used to wipe the
     sprite off every card. That went unnoticed only because the sprite was an
     inline style until A5, which outranks any rule here. */
  background-color: white;
}

/* The hover lift means "this responds". It belongs to the two interactive
   states, which declare it themselves below (.ft-card--claimable:hover and
   .ft-card--reservable:hover) - there is deliberately no blanket .ft-card:hover
   any more, because it lifted cards that do nothing. */

/* THE CARD TAKES THE GOLD DOUBLE RING (stage 8, and decision 15 answered by
   COUNT rather than by substitution). `pulse-gold-strong` DIES: it put a
   scale(1.01) wobble and two animated box-shadow glows on every claimable card,
   up to eight at once. What is left is the same two rings every gold thing in
   the game has - the 5px border is the inner one - and the outer ring is the
   ::before, breathing on the one surviving keyframe set. */
.ft-card--claimable {
  border: 5px solid var(--color-accent-gold);
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.6), 0 0 40px rgba(201, 162, 39, 0.4);
  position: relative;
}

.ft-card--claimable::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border: 2px solid var(--color-accent-gold);
  border-radius: var(--radius-md);
  opacity: 0.55;
  animation: ft-ring-breathe var(--ft-dur-ring) var(--ft-ease-travel) infinite;
  pointer-events: none;
}

.ft-card--claimable:hover {
  box-shadow: 0 0 30px rgba(201, 162, 39, 0.8), 0 0 50px rgba(201, 162, 39, 0.5);
  border-color: var(--color-accent-gold);
}

/* .ft-card--unavailable DELETED BY STAGE 5. The second of the card row's three
   dims, and the only one of the three that was never applied: a grep of src/
   and index.html finds no site that adds the class, so it has been a dead
   `opacity: .5` waiting for a caller since before this map opened. It is
   deleted rather than rewritten, because the ruling it breaks would have to be
   answered before it could be used and there is nothing to answer it for. */

/* ==========================================================================
   THE SHARED RING (stage 8, plan section 7.2 and 7.3)

   ELEVEN KEYFRAME SETS BECOME FOUR, AND THIS IS THE ONE THEY COLLAPSE ONTO.
   `pulse-ring` is promoted: it was already on `opacity`, which is one of the two
   properties allowed to animate, and it is now THE ONE PULSE IN THE BUILD.
   `cupcake-pulse` and `pulse-symbol` had already gone with the elements they
   styled; `pulse-gold-strong` and `slide-in` die here; `sweep-ready`,
   `ft-buyable-pulse` and `pulse-forced` are rewritten onto the ring vocabulary
   above and below. What survives beside this: `notice-flash`, `fade-in`,
   `toast-in`.

   THE PULSE IS THE OUTER RING BREATHING rather than a second mechanism, which is
   what makes reduced motion "the same signal with the travel removed": with
   motion on the outer ring breathes scale(1) to scale(1.06) and .55 to .18 over
   1600ms; with motion off it is HELD at the middle of its own range, opacity
   .45. At every instant, in both branches, A GOLD THING HAS TWO RINGS AND AN
   ACCENT THING HAS ONE, at zero layout width - which is decision 15 carried by
   COUNT, and it matters because ticket 09 measured gold and the accent
   desaturating to the same grey.
   ========================================================================== */
@keyframes ft-ring-breathe {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50%      { transform: scale(1.06); opacity: 0.18; }
}

/* THE PULSE CAP: one pulse per meaning, and where several elements share a
   meaning the breath moves to the smallest container that holds them all. The
   RING STAYS ON EVERY MEMBER, because the count is what carries the meaning
   under desaturation and it must not depend on the pulse; only the breath moves.
   motion.js decides this per CONTAINER after every group has been counted. */
.ft-ring--quiet::before,
.ft-ring--quiet::after { animation: none !important; opacity: 0.45; transform: none; }

.ft-ring-region {
  position: relative;
}

/* INSET 0, NOT A NEGATIVE INSET, and the reason is measured rather than
   aesthetic. #cardMarket is a horizontal scroll container below 1150 and #market
   sits inside an XL column with 0.6px of horizontal headroom (stage 4), so a
   ring hung outside either box would either extend a scrollable area or push the
   page into horizontal scroll. At inset 0 the ring costs nothing anywhere and
   still reads as drawn around the group rather than around one member. */
.ft-ring-region::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--color-accent-gold);
  border-radius: var(--radius-sm);
  opacity: 0.55;
  pointer-events: none;
  animation: ft-ring-breathe var(--ft-dur-ring) var(--ft-ease-travel) infinite;
}

/* MOTION OFF IS A HOLD, NOT A DELETION, and that is the whole of decision 15's
   requirement met without motion: the outer ring stays drawn at the middle of
   its own range, so the ring COUNT is identical in both branches. */
@media (prefers-reduced-motion: reduce) {
  .ft-card--claimable::before,
  .ft-ring-region::after {
    animation: none;
    opacity: 0.45;
    transform: none;
  }
}

/* ==========================================================================
   THE FLIP CLONE (stage 8, plan section 7.1)

   A tile settling on your own board is FLIP, never a view transition, and the
   whole of an opponent's turn is FLIP too. Ticket 03's own rule: view
   transitions for the few named movements a player is meant to follow, FLIP for
   anything bulk or anything that must not block a finger. Placement is the most
   finger-heavy movement in the game - up to five in a row with the finger still
   on the glass - and a view transition redirects hit testing to the document
   element for its whole duration.

   IT COSTS ZERO NAMES, which is why the budget is never tight.
   ========================================================================== */
.ft-flip {
  position: fixed;
  left: 0;
  top: 0;
  margin: 0;
  /* Above the canvas and the phase bar's 900, under the toast's 950 and the
     modals' 1000 (stage 6's stack), so a flight is never drawn over a message
     and never hidden behind the bar it flies past. */
  z-index: 940;
  pointer-events: none;              /* NEVER delays the next input. */
  will-change: transform;
  /* Ticket 09: A TILE CASTS ITS OWN SHADOW ONLY WHEN IT LIFTS, because a grid of
     tiles is lit as one slab with a single region shadow. A travelling tile is a
     lifted tile, so it carries the cast shadow for the flight and lands flat.
     That rule is inherited here, not invented. */
  box-shadow: 2px 3px 6px -1px rgba(var(--shadow-ink), 0.5);
}

/* ==========================================================================
   THE ONE-LINE LOG (stage 8, plan section 7.5)

   Motion cannot say WHICH, and the single most important fact of an opponent's
   sweep is the declaration. The line takes the phase bar's own instruction slot,
   which on an opponent's turn is addressed to a player who has nothing to do -
   so IT COSTS NO HEIGHT - and it persists until the next action replaces it
   rather than timing out, so a player who looked away can still read it.

   It reuses `fade-in` rather than adding a twelfth keyframe set: the eleven come
   down to four and a new one would put them back to five for an 8px rise.
   ========================================================================== */
.ft-motion-log {
  animation: fade-in var(--ft-dur-log) var(--ft-ease-enter);
}

/* The cell the settle lands on, fading up under the arriving clone. One class,
   one existing keyframe set, and it ends at the value the cell already has. */
.ft-tile--settling {
  animation: fade-in var(--ft-dur-settle) linear;
}

/* THE COUNT'S ONE REQUIREMENT. Proportional digits reflow the score line as they
   change, which turns a count into a shimmer. Tabular figures cost nothing and
   are the only thing the count needs in CSS. */
.ft-score-total,
.pm-chip__fig {
  font-variant-numeric: tabular-nums;
}

/* ======= Phase Bar ======= */

/* The phase bar is the one piece of persistent chrome in the seat, and from the
   M band down it is fixed to the foot of the viewport - which is a STRIP (plan
   section 8.5): one ground, one hairline on the edge facing content, no box. The
   3px accent top rule survives as that hairline's louder relative, because a bar
   that says what you must do now IS a section announcing something. */
.ft-phase-bar {
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin-top: var(--spacing-md);
  border-top: 3px solid var(--color-accent);
}

.ft-phase-bar__instruction {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

.ft-phase-bar__status {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-sm);
}

.ft-phase-bar__status.success {
  color: var(--color-success);
  font-weight: 600;
}

.ft-phase-bar__status.warning {
  color: #FF9800;
  font-weight: 600;
}

.ft-phase-bar__status.danger {
  color: var(--color-danger);
  font-weight: 600;
}

.ft-phase-bar__controls {
  display: flex;
  gap: var(--spacing-sm);
}

/* .ft-phase-bar__cupcake-hint was here. Deleted 4 August with the element it
   styled - see updatePhaseControls, where the hint turned out to have been
   gated on a phase it was never rendered in. Its role is now .ft-cupcake-note,
   beside the buttons. */

/* `slide-in` DELETED (stage 8). Dead code: it was defined here and referenced
   nowhere, in this stylesheet or in any module. It is the eleventh keyframe set
   the motion review found, and the one that cost nothing to remove. */

/* ======= Modal ======= */

.ft-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(61, 43, 31, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fade-in 0.15s ease;
}

.ft-modal__inner {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-modal);
  /* min() rather than a bare 500px (plan phase F). A fixed max-width is not a
     maximum on a narrow screen, it is a floor the viewport cannot meet: at 768
     the dialog was 500px plus 2 x 24px of padding against a screen that also
     wants a margin. The calc leaves 16px either side at every width and is
     inert above 532px, so the desktop dialog is untouched.

     Measured content sits at 260px with .ft-modal__option at 98px tall, both
     comfortably clear of the 44px touch floor - the width was the only problem. */
  max-width: min(500px, calc(100vw - 32px));
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

/* THE ONE CLOSE CONTROL (defect 7, stage 2). Three modals shipped two different
   glyphs between them - ✕ U+2715 on the rules modal and × U+00D7 on the other
   two - so the same control was drawn two ways in one build. All three now
   carry the `close` icon at 16.

   44 x 44, not the old 28 x 28: it is the platform touch minimum and this is
   the only way out of a modal on a phone. The box grows outward from the same
   top/right inset, so the title's padding-right grows with it. */
.ft-modal__close {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.ft-modal__close:hover {
  background: var(--color-cream);
  color: var(--color-accent);
}

.ft-modal__title {
  margin-bottom: var(--spacing-lg);
  /* Clears the 44px close target and its 8px inset. */
  padding-right: 52px;
}

/* .ft-modal__section, __section-title, __options, __option, __option-icon and
   __option-colour DELETED BY STAGE 5. All six existed for the two sweep dialogs
   and nothing else; the rules modal (board.js:136) uses only .ft-modal, __inner,
   __close and __title, and it is untouched by this stage. The sweep dialog is
   .ds-dialog below. */

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===========================================================================
   THE SWEEP DIALOG (plan section 6.3, defect 3, stage 5)

   ONE ANCHOR AT EVERY DESKTOP WIDTH: the dialog hangs under the market, centred
   on it, twelve pixels below its bottom edge, in DOCUMENT coordinates so it
   travels with the market under scroll and does not slide about on resize. It
   cannot cover the market, because its first pixel is twelve below the market's
   last one. showSweepOptions in board.js writes `left` and `top` from
   #marketContainer's own measured box; what this file owns is the box.

   WHY IT IS NOT .ft-modal ANY MORE - DEFECT 3, AND IT IS WORSE THAN THE DEFECT
   LIST RECORDED. .ft-modal's scrim is rgba(61, 43, 31, .5) across the whole
   viewport at z-index 1000, and measured it covers THE WHOLE MARKET at every
   desktop width - 294x294 at 1280, 284x276 at 1440 and 1920, 344x336 at 2400.
   That is the purest possible breach of the one ruling that holds at every band:
   emphasis is additive and nothing is ever dimmed to say that something else is
   the step. It dimmed the very thing the dialog was asking about.

   AND IT ATE THE COMMONEST CANCEL ROUTE. Backing out of a sweep is "wrong row,
   click a different chip", and that only works if there is nothing over the
   market to eat the click. With the scrim in front, the first click closed the
   dialog and the second opened the right row.

   .ft-modal STAYS EXACTLY AS IT IS for the rules modal (board.js:136), which is
   genuinely modal: a document you read is the one thing on the screen while you
   read it.

   AN ANCHOR IS NOT A LAYOUT, so the desktop half of this block carries a FLOOR
   (`min-width: 1150px`) rather than a range. Nothing in the band table moves,
   and the dialog is out of flow and body-appended, so it contributes nothing to
   any column's max-content width and nothing to scrollHeight.
   =========================================================================== */

:root {
  /* The gap between the market's bottom edge and the dialog's top edge. 12px is
     the L band's own column gap, so the dialog is spaced off the market the way
     the three columns are spaced off each other. */
  --ds-gap: 12px;

  /* THE WIDTH IS THE CONTENT BOUND PLUS FOUR PIXELS, AND BOTH TERMS ARE
     MEASURED. A group of options is `50p + 10k - 4` pixels wide at the 48px
     desktop tile, where p is the tiles in the line and k the options in that
     axis, both capped at five - a 48px tile, a 2px gap inside a chip, 4px of
     chip padding and a 4px gap between chips. So the widest group any line can
     produce is 296px at p=5 k=5, and 296 + 24 of padding a side = 344 is the
     smallest box that holds it.

     344 IS NOT THE BOX, BECAUSE 296 IN 296 HAS NO SLACK. The content box is 300
     and the dialog is 348. The four pixels are bought at the price of two pixels
     of clearance from the clocks column, and what the width may NOT be is a
     round number: a 320px content box is 368 wide and, centred under the market
     at 1440, its trailing edge lands inside .ft-centre-meters. */
  --ds-width: 348px;
  --ds-pad: 24px;

  /* The dialog's tile. 48 above 1149, and 44 below it, which is the same rung
     the band the dialog is open in already draws its own board at. Written as
     its own token rather than by re-declaring --tile-size, because a var()
     inside a custom property is substituted where it is DECLARED and
     --board-col-width would have to be re-declared with it. */
  --ds-tile: 44px;
}

.ds-dialog {
  box-sizing: border-box;
  /* BELOW 1150 there is no anchor yet - stage 6 brings the bottom sheet - so the
     dialog centres on the viewport, which is what the old modal did, minus the
     scrim. `width: min()` rather than a bare 348, because 348 does not fit a
     360px screen with a margin either side. */
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(var(--ds-width), calc(100vw - 32px));
  z-index: 1000;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  /* One shadow. Section 8.5 allows a sheet exactly one, because there it says
     "above the board", and a dialog hanging off the market makes the same
     claim. */
  box-shadow: 0 8px 26px -10px rgba(var(--shadow-ink), 0.55);
  color: var(--ink);
  animation: fade-in 0.15s ease;
}

.ds-dialog__chrome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-sm);
  padding: 14px var(--ds-pad) 6px;
}

/* --type-title, and this is the only place it is used. */
.ds-dialog__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: var(--type-title);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Labelled Close and not Done, because nothing has been done. 44x44 is a touch
   floor and this dialog opens at mouse widths too, but a 28px hit area on the
   one control that undoes a mis-click is no better with a pointer than with a
   finger, and the room is free. */
.ds-dialog__close {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.ds-dialog__close:hover {
  border-color: var(--accent-deep);
  color: var(--accent-deep);
}

.ds-dialog__body {
  padding: 0 var(--ds-pad) 18px;
  /* IT DOES NOT SCROLL, AT ANY WIDTH. That is the constraint the 300px content
     box exists to keep. */
  overflow: visible;
}

/* TWO LABELLED GROUPS IN ONE LIST, STACKED. Not tabs - they would hide half the
   options to save nothing - and not merged, because a one-tile chip is the same
   picture under either heading and the single-tile chip is exactly what the
   worst case is made of. Coincident options are both shown (decision 28): the
   duplication is where a player learns that either declaration is legal and
   takes the same tiles. */
.ds-group + .ds-group {
  margin-top: var(--spacing-sm);
}

/* --type-micro. Sentence case, not the one surviving uppercase role, which is a
   printed label on a painted component. */
.ds-group__label {
  font-size: var(--type-micro);
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-soft);
  margin-bottom: var(--spacing-xs);
}

/* ONE LINE PER AXIS, ALWAYS, AND IT IS PROVABLE - see --ds-width. `flex-wrap` is
   set anyway, because a wrap that can never fire costs nothing and a dialog that
   overflows costs everything. */
.ds-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  align-items: flex-start;
}

/* AN OPTION IS A SLICE OF THE MARKET'S OWN RECESS - same fill, same near wall,
   same 2px gaps, same rims - so the thing in the dialog and the thing in the row
   are visibly the same object, which is the whole of decision 10.

   No colour name, no ingredient name, no count. The tiles carry all three: a
   colour chip is monochrome, an ingredient chip is mono-silhouette, and the
   count is how many tiles are in it. The words survive as the accessible name
   and nowhere else. */
.ds-opt {
  position: relative;
  display: flex;
  gap: var(--tile-gap);
  padding: var(--spacing-xs);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--recess);
  box-shadow:
    inset 0 2px 3px -1px rgba(var(--shadow-ink), 0.30),
    inset 0 -1px 0 rgba(255, 255, 255, 0.40),
    2px 3px 9px -3px rgba(var(--shadow-ink), 0.30);
  cursor: pointer;
  touch-action: manipulation;
  /* 44 + 4 + 4 = 52 on both axes for a one-tile option, so the smallest option
     in the system clears the 44px floor by 8 at every width. */
  min-width: 52px;
  min-height: 52px;
}

/* State drawn AROUND, never into. An outline costs zero layout, so pressing a
   chip cannot move its neighbours. */
.ds-opt:focus-visible,
.ds-opt:active {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@media (hover: hover) {
  .ds-opt:hover {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
  }
}

/* The tile inside a chip. The same layers a market tile carries - the 1px rim
   off its own dark stop, the flat local colour, the inner edge light and shade -
   sized from --ds-tile rather than --tile-size so it is 48 at every desktop
   width including XL, where the market's own tile is 60.

   background-COLOR: var(--mid) with the field over it as background-IMAGE, the
   way .ft-tile does it. Stage 5 wrote this pair while --tile-field was still
   computing to the empty string, precisely so that the chip would draw whatever
   the market drew and would follow the token the moment it was repaired. Stage
   4a repaired it - the recipe moved to .ft-colour, which this element carries -
   so this chip now paints the full field with no edit of its own. */
.ds-tile {
  /* Positioned for the strike on a surplus tile below, and for nothing else. */
  position: relative;
  width: var(--ds-tile);
  height: var(--ds-tile);
  border: 1px solid var(--dk);
  border-radius: calc(var(--ds-tile) * 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--mid);
  background-image: var(--tile-field);
  box-shadow: var(--form-edges);
  flex: 0 0 auto;
}

.ds-tile__icon {
  width: 60%;
  height: 60%;
  object-fit: contain;
  display: block;
}

/* ---- THE OVERFLOW PREVIEW (plan section 5.4, stage 6) ---------------------
   BACK IN THE BAG, on the option, BEFORE the tap. Not a new mark: it is the
   state the build already uses for a tile returning to the bag - a 52% cool
   slate wash and a flat strike - so the sheet and the placement step say the
   same thing in the same language. No opacity and no filter, because a painted
   object is never faded; the strike is a SHAPE and survives desaturation, which
   matters because it is the only thing saying a tile is lost.

   It is silent 99.68% of the time: 20 overflows in 6,280 measured sweeps, and
   every one of them with one or two spaces left. That rarity is the argument
   for having it at all - a player meets it perhaps once in a game, has never
   seen it before, and at that moment their own board is the one thing the sheet
   is standing in front of. */
.ds-tile--tobag {
  box-shadow: inset 0 0 0 999px rgba(var(--shadow-ink), 0.52), var(--form-edges);
}

.ds-tile--tobag::after {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  border-top: 2px solid rgba(61, 43, 31, 0.60);
  transform: rotate(-20deg);
  pointer-events: none;
}

/* THE FOOT APPEARS RATHER THAN LIVING THERE. Ticket 12's argument for the left
   accent rail, applied to a sentence: a line that is always there says nothing,
   a line that appears says read me. Stage 7's pinned board-fill chip carries the
   same number permanently two docks above, which is what stops this needing to
   be furniture - and if a later ticket ever moves that chip off the rail, this
   foot has to become permanent.

   TWO LINES AT 360 IS A HARD CONSTRAINT and these numbers are the whole of it:
   16px of chrome (8 margin, 7 padding, 1 rule) and 45 of text, which is two 12px
   lines at 1.4 with 11px spare and not three. */
.ds-foot {
  display: none;
  margin-top: var(--spacing-sm);
  padding-top: 7px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.ds-foot b {
  color: var(--ink);
  font-weight: 600;
}

.ds-dialog[data-overflow="1"] .ds-foot {
  display: block;
}

/* The grab handle is the phone sheet's, and it is what makes swipe-to-dismiss
   discoverable and what VoiceOver reads. There is no swipe above the band. */
.ds-dialog__handle {
  display: none;
}

/* THE ROW RING. One absolutely positioned element appended to #marketContainer
   and removed on every market re-render. An outline sits outside the box model,
   so the ring costs ZERO layout at 44, 48 and 60 alike and the market grid does
   not move by a pixel when it appears. NOTHING IS DIMMED and nothing is lifted:
   the only wash that would read as "not this one" is the slate wash that means
   back in the bag, and a lifted tile means in hand. */
.ds-rowring {
  position: absolute;
  pointer-events: none;
  border-radius: var(--radius-sm);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  z-index: 2;
}

/* The gutter chip you clicked stays pressed. Second carrier, and the one that
   says WHICH way you are reading the market. */
.ft-btn--sweep.ds-chip-held {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #FFFFFF;
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

@media (min-width: 1150px) {
  :root {
    --ds-tile: 48px;
  }

  /* THE ANCHOR. Document coordinates, so the dialog belongs to the market rather
     than to the window: it travels with it under scroll and does not slide about
     when somebody resizes. board.js writes left and top; all this rule does is
     take the box out of the viewport's frame and put it in the page's. */
  .ds-dialog {
    position: absolute;
    transform: none;
    left: 0;
    top: 0;
    width: var(--ds-width);
  }
}

/* ======= End Game Screen ======= */

.ft-end-screen {
  padding: var(--spacing-xl);
  max-width: 800px;
  margin: var(--spacing-2xl) auto;
}

.ft-end-screen__panel {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-2xl);
  box-shadow: var(--shadow-card);
}

.ft-end-screen__title {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.ft-end-screen__winner {
  text-align: center;
  background: var(--color-cream);
  border: 2px solid var(--color-accent-gold);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.ft-end-screen__winner-name {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  color: var(--color-accent-gold);
  font-weight: 700;
}

.ft-end-screen__results {
  margin-bottom: var(--spacing-xl);
}

.ft-end-screen__results-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--spacing-lg);
}

.ft-end-screen__results-table th {
  padding: var(--spacing-md);
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ft-end-screen__results-table td {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.ft-end-screen__results-table tr.winner {
  background: var(--color-cream);
}

.ft-end-screen__results-table tr.winner td {
  font-weight: 600;
  color: var(--color-accent);
}

.ft-end-screen__score {
  font-weight: 700;
  color: var(--color-accent);
  text-align: right;
}

.ft-end-screen__score.zero {
  color: var(--color-text-secondary);
}

.ft-end-screen__ingredient-breakdown {
  background: #FAFAFA;
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: var(--spacing-md);
}

.ft-end-screen__ingredient-row {
  display: grid;
  grid-template-columns: 20px 1fr 30px 30px 40px;
  gap: var(--spacing-sm);
  align-items: center;
  margin-bottom: var(--spacing-xs);
}

.ft-end-screen__ingredient-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.ft-end-screen__buttons {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
}

/* ======= Info Panel ======= */

.ft-info-panel {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.ft-info-block {
  background: #FAFAFA;
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.ft-info-block__title {
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-xs);
}

.ft-info-block__content {
  font-size: 13px;
  color: var(--color-text-primary);
}

/* ======= Toast ======= */

/* THE REPLACEMENT FOR alert() (9 August, ticket 00 / finding 16). See the note
   on showToast in src/ui/board.js for why the OS dialog had to go.

   FIXED AND BODY-MOUNTED, for the same reason the JS mounts it on document.body:
   the game re-renders by assigning #app.innerHTML, so anything living inside the
   app tree would vanish mid-message.

   It sits ABOVE the phase bar rather than at the top of the screen because the
   phase bar is where a player's eyes already are while taking a turn, and on a
   phone the top of the page may be scrolled a long way from what they tapped.
   The clearance below is the bar's own budget - see .ft-game's padding-bottom in
   the touch band, which is measured from the same figure.

   Deliberately built from existing tokens only, and deliberately plain: the
   typography ticket may restyle it, and it should not have to undo anything. */
.ft-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--spacing-lg) + env(safe-area-inset-bottom, 0px));
  z-index: 950;
  max-width: min(420px, calc(100vw - 2 * var(--spacing-lg)));
  /* A tap dismisses it, so it is a touch target and carries the 44px floor
     unconditionally - the toast is not a per-band control and there is no width
     at which a mouse is the only way to reach it. */
  min-height: 44px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  color: var(--color-text-primary);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-danger);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  cursor: pointer;
}

.ft-toast--flash {
  animation: toast-in 0.28s ease;
}

@keyframes toast-in {
  0% { opacity: 0; transform: translateX(-50%) translateY(8px); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* The toast still APPEARS instantly for anyone who has asked for less motion -
   it just does not slide. The message is the point; the slide is not. */
@media (prefers-reduced-motion: reduce) {
  .ft-toast--flash {
    animation: none;
  }
}

/* ======= Utility Classes ======= */

.ft-hidden {
  display: none !important;
}

.ft-text-center {
  text-align: center;
}

.ft-text-small {
  font-size: 12px;
  color: var(--color-text-secondary);
}

select {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  background: var(--color-card);
  color: var(--color-text-primary);
  cursor: pointer;
}

select:hover {
  border-color: var(--color-accent);
}

select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(193, 123, 92, 0.1);
}

/* ======= Game End Screen ======= */

/* 100dvh for the same reason as #app - see the note there. */
.ft-game-end {
  min-height: 100dvh;
  background: var(--color-cream);
  padding: var(--spacing-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ft-game-end__container {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: var(--spacing-2xl);
  box-shadow: var(--shadow-modal);
  max-width: 900px;
  width: 100%;
}

.ft-game-end__header {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
  padding-bottom: var(--spacing-xl);
  border-bottom: 2px solid var(--color-border);
}

.ft-game-end__header h1 {
  margin-bottom: var(--spacing-md);
  font-size: 32px;
}

.ft-game-end__winner {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-accent);
}

.ft-game-end__section {
  margin-bottom: var(--spacing-2xl);
}

.ft-game-end__section h2 {
  margin-bottom: var(--spacing-md);
}

.ft-stats__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.ft-stats__table thead {
  background: var(--color-cream);
  border-bottom: 2px solid var(--color-border);
}

.ft-stats__table th {
  padding: var(--spacing-md);
  text-align: left;
  font-weight: 600;
  color: var(--color-text-primary);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.ft-stats__player-row {
  border-bottom: 1px solid var(--color-border);
}

.ft-stats__player-row--winner {
  background: rgba(201, 162, 39, 0.05);
  font-weight: 600;
}

.ft-stats__player-row td {
  padding: var(--spacing-md);
}

.ft-stats__player-name {
  font-weight: 600;
  color: var(--color-text-primary);
}

.ft-stats__player-score {
  font-weight: 700;
  color: var(--color-accent);
  font-size: 15px;
}

.ft-stats__player-detail {
  color: var(--color-text-secondary);
  font-size: 13px;
}

.ft-game-end__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-2xl);
}

.ft-game-end__stats-group {
  background: var(--color-cream);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  border: 1px solid var(--color-border);
}

.ft-game-end__stats-group h3 {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-md);
  font-weight: 600;
}

.ft-game-end__stat {
  margin-bottom: var(--spacing-md);
}

.ft-game-end__stat:last-child {
  margin-bottom: 0;
}

.ft-game-end__stat-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xs);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ft-game-end__stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-accent);
  font-family: 'Fraunces', serif;
}

.ft-game-end__actions {
  display: flex;
  gap: var(--spacing-lg);
  justify-content: center;
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-xl);
  border-top: 2px solid var(--color-border);
}

.ft-game-end__actions button {
  min-width: 150px;
}

/* ======= End Screen Statistics ======= */

.ft-end-screen__stats {
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-xl);
  border-top: 1px solid var(--color-border);
}

.ft-end-screen__stats h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-lg);
}

/* Shown only when the finished game was resumed at least once (stage 8). The
   stats collector is deliberately not saved, so eight of these nine boxes cover
   play since the resume and one - Turns Played - is engine state and covers the
   whole game. The result table above is computed from engine state and is
   unaffected, so nothing about who won or by how much is touched. */
.ft-end-screen__stats-note {
  font-size: var(--type-caption);
  color: var(--color-text-secondary);
  margin-top: calc(var(--spacing-lg) * -1 + var(--spacing-xs));
  margin-bottom: var(--spacing-lg);
}

.ft-end-screen__stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: var(--spacing-lg);
}

.ft-stat-box {
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  text-align: center;
}

.ft-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xs);
  display: block;
}

.ft-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-accent);
  font-family: 'Fraunces', serif;
}

/* ======= Rules Modal ======= */

.ft-rules {
  /* 600px is taller than the whole viewport on a tablet in landscape, which made
     the rules scroll the PAGE instead of themselves and stranded the close
     button off-screen. 80vh keeps the scroll inside the panel where it belongs
     and is inert on any screen over 750px tall (plan phase F). */
  max-height: min(600px, 80vh);
  overflow-y: auto;
}

.ft-rules__section {
  margin-bottom: var(--spacing-xl);
}

/* A BOXED section: a coloured frame that visibly binds a heading to the text
   under it. The turn-sequence section above is already grouped by its own
   .ft-rules__step cards, but the prose sections (fresh pot, cupcakes, scoring)
   were loose paragraphs, so on a long scroll it was not obvious where one
   heading stopped applying and the next began.

   Two custom properties per section: --rule-accent for the frame, and
   --rule-tint for the heading strip. The tint is written as an explicit rgba
   literal rather than derived with color-mix() from the accent, because these
   accents differ wildly in lightness (gold vs pink vs green) and a single mix
   ratio does not read evenly across all three - and it keeps the panel working
   in browsers without color-mix. */
.ft-rules__section--boxed {
  --rule-accent: var(--color-accent);
  --rule-tint: rgba(193, 123, 92, 0.10);
  border: 1px solid var(--rule-accent);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
  background: var(--color-cream);
}

/* The heading sits ON the frame's top edge, so it reads as the box's label
   rather than as the first line of its contents. Its text stays the standard
   dark brown: the accents are chosen to be legible as a BORDER, and pale gold or
   pink type on a pale tint would not carry the contrast. */
.ft-rules__section--boxed .ft-rules__section-title {
  color: var(--color-text-primary);
  /* Negative margins exactly cancel the section's own padding, so the strip
     spans the full inner width and sits flush against the inside of the frame. */
  margin: calc(var(--spacing-md) * -1) calc(var(--spacing-lg) * -1) var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--rule-tint);
  border-bottom: 1px solid var(--rule-accent);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* One accent per section, in reading order. They are deliberately distinct
   rather than a single house colour: the panel is a long scroll, and the colour
   is the fastest way to tell at a glance which heading the paragraph under your
   thumb belongs to. */
.ft-rules__section--goal {
  --rule-accent: var(--color-accent);
  --rule-tint: rgba(193, 123, 92, 0.12);
}

.ft-rules__section--turn {
  --rule-accent: var(--tile-blue);
  --rule-tint: rgba(126, 200, 227, 0.20);
}

.ft-rules__section--tea {
  --rule-accent: var(--color-accent-gold);
  --rule-tint: rgba(201, 162, 39, 0.14);
}

/* .ft-rules__section--objectives stood here, gold to match the objectives panel
   on the game screen. Both are deleted with the pantry goals, 4 August. */

/* The Tasting Menu takes the GREEN of the scoring section rather than the fresh
   pot's gold, and the change of family from the Freshness Bonus it replaced is
   deliberate. The cups WERE the tea rule seen from the scoring side, so sharing
   gold with it was correct; a Tasting Menu has nothing to do with the pot of tea,
   and colouring it as though it did would teach the one thing about the module
   that players must not believe. It runs a shade deeper than the scoring section
   so the two are still tellable apart. */
.ft-rules__section--menus {
  --rule-accent: var(--color-success);
  --rule-tint: rgba(90, 138, 92, 0.20);
}

.ft-rules__section--cupcakes {
  --rule-accent: var(--tile-pink);
  --rule-tint: rgba(244, 169, 187, 0.20);
}

.ft-rules__section--scoring {
  --rule-accent: var(--color-success);
  --rule-tint: rgba(90, 138, 92, 0.12);
}

.ft-rules__section--end {
  --rule-accent: var(--tile-orange);
  --rule-tint: rgba(240, 151, 74, 0.16);
}

/* The turn section is the one box whose contents are themselves cards
   (.ft-rules__step). Drop their own background to plain white so the nesting
   reads as one framed list rather than cards-inside-a-card, and let the frame
   supply the cream. */
.ft-rules__section--turn .ft-rules__step {
  background: var(--color-card);
}

.ft-rules__section--turn .ft-rules__step:last-child {
  margin-bottom: 0;
}

.ft-rules__section-title {
  font-family: 'Fraunces', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: var(--spacing-md);
}

/* "mini expansion" beside the Tasting Menus heading (16 August). The section
   only renders when the expansion is switched on, so this is not a warning - it
   tells a player who turned it on that what follows is the thing they added,
   which is what makes the rest of the modal read as the base game. */
.ft-rules__tag {
  display: inline-block;
  margin-left: var(--spacing-sm);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--color-card);
  border: 1px solid var(--rule-accent, var(--color-border));
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  vertical-align: middle;
}

.ft-rules__step {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-md);
  border-left: 2px solid var(--color-border);
  padding: var(--spacing-md);
  background: var(--color-cream);
  border-radius: var(--radius-sm);
}

.ft-rules__step-title {
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.ft-rules__text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

.ft-rules__text:last-child {
  margin-bottom: 0;
}

/* Text quoted verbatim from a printed component - it held the fresh-pot trigger
   printed on the tile market board, plus a tag line each for the Tasting Menus and
   the Flavour of the Day. NOTHING USES IT AS OF 7 August: the rules modal was cut
   back to statements of the rules, and the two tag lines were the first things
   out. The rule is kept, not deleted, because the ONE legitimate use is still
   likely to come back - copy printed on a component, which a player has to
   recognise as something to look for on the table rather than as more prose. Do
   not use it for a slogan. */
.ft-rules__quote {
  font-family: 'Fraunces', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-accent);
  background: rgba(201, 162, 39, 0.12);
  border: 1px dashed var(--color-accent-gold);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  text-align: center;
}

.ft-rules__btn {
  width: 100%;
  margin-top: var(--spacing-lg);
}

/* ======= Fresh Pot of Tea ======= */

/* NOTE (1 August): .ft-btn--tea, .ft-tea-option__btn and the whole .ft-tea-confirm
   block below are now UNUSED. They styled the "Order a fresh pot of tea" button
   and its confirm overlay, and tea stopped being an action a player takes - it
   fires automatically at the end of any turn that leaves four teapots showing.
   Kept rather than deleted because they are the ready-made styling if a future
   rule ever puts a tea control back in the player's hands; nothing renders them
   today, so they cost only bytes. */

.ft-btn--tea {
  background: linear-gradient(135deg, #F6E3C5 0%, var(--color-accent-gold) 100%);
  border: 1px solid var(--color-accent-gold);
  color: var(--color-text-primary);
  font-weight: 700;
}

.ft-btn--tea:hover:not(:disabled) {
  background: linear-gradient(135deg, #FBEFD6 0%, #E0BC4A 100%);
  border-color: var(--color-accent);
}

/* ---- The fresh-pot GAUGE, under the tile market ----
   Deliberately QUIET (30 July), and purely a readout since 1 August: how close
   this turn is to triggering the flush. There is no button in it any more, so
   --ready no longer means "you may order one", it means "one is coming at the end
   of this turn". The rules panel explains what a fresh pot does. */
.ft-tea-option {
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: var(--radius-lg);
  /* The sixth tint, and the last to go. It was deepened on 7 August so it could
     be told apart from the oat market above it and the peach clock beside it;
     both of those are --surface now, and the gauge is a surface on the wall like
     everything else. Gold is left free to mean what decision 15 says it means. */
  background: var(--surface);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm) var(--spacing-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* A pot is coming at the end of this turn. GOLD MEANS THIS COSTS YOU SOMETHING,
   or here that a gate is open (decision 15), and the panel says so ADDITIVELY -
   the resting ground is untouched and a gold rail plus a gold wash appear on it.
   The tint the panel used to wear at rest is gone, so a state can be a state. */
.ft-tea-option--ready {
  box-shadow:
    inset 3px 0 0 var(--color-accent-gold),
    inset 0 0 0 999px rgba(201, 162, 39, 0.16);
}

/* Not available: the gauge stays perfectly readable, it just stops advertising.
   NOTHING IS DIMMED, so the 0.85 goes and the resting state IS the resting
   state - what "locked" means here is only that no rail has appeared. */
.ft-tea-option--locked {
  opacity: 1;
}

/* Forced (the tile market emptied): no longer an option, so it stops looking
   like one and shouts instead. Danger rail, danger wash, same grammar. */
/* REWRITTEN ONTO THE RING VOCABULARY (stage 8). `pulse-forced` was an infinite
   box-shadow animation, and it also fought the two inset shadows on the line
   above it - the animation's own `box-shadow` replaced them for the whole cycle.
   The ring vocabulary's fourth meaning, "this is going away", is told apart by
   WEIGHT rather than by count or by motion: one danger ring at 3px. */
.ft-tea-option--forced {
  box-shadow:
    inset 3px 0 0 var(--color-danger),
    inset 0 0 0 999px rgba(192, 57, 43, 0.10);
  outline: 3px solid var(--color-danger);
  outline-offset: 1px;
}

/* ---- The gauge AS A SECTION (3 August) -----------------------------------
   It carries .ft-section as well as .ft-tea-option now, so it sits in the meters
   rail looking like every other block in the centre column. These rules come
   AFTER the base .ft-tea-option above deliberately: they are the reconciliation,
   and they must win on the handful of properties the two classes both set.

   What changes: it stacks (it is a narrow rail item, not a wide banner under the
   board), it loses the free-floating margin (the rail's flex gap spaces it), and
   its border goes solid with a gold left rule to match the other sections. What
   does NOT change is the state tinting - --ready and --forced still override the
   background and border above, because a gauge that cannot go loud when the pot
   is due is not a gauge. */
.ft-section.ft-tea-option {
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: var(--spacing-sm);
  margin-top: 0;
}

/* (.ft-tea-option__count and its strong stood here - the "[teapot] teapots
   visible" line that sat under the note. Deleted 7 August: the icon moved up into
   the head beside the figure it counts, and the caption went with it, because the
   3/4 already said what the caption said and the line cost a whole row of a panel
   in the rail's tightest column.) */

/* The teapot in the head, immediately before the N/4. Sized to the figure it now
   sits beside rather than to the 22px it took on a line of its own, and nudged
   down onto the text baseline so icon and number read as one unit rather than as
   a picture with a number after it. */
.ft-tea-option__icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: -3px;
  margin-right: 2px;
}

/* Shown only for the two states the gauge cannot express by itself: a forced pot,
   and a dead bag. Everything else stays silent. */
.ft-tea-option__note {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.45;
}

.ft-tea-option--forced .ft-tea-option__note {
  color: var(--color-danger);
  font-weight: 600;
}

/* ======= The Tasting Menus (5 August) =======
   One card per player, dealt at setup and never replaced. The first player whose
   CAKE STAND shows the named ingredients takes it, free and automatic, and it is
   then out of the game.

   THE ONE THING THIS STYLING HAS TO DO is make a taken menu read as GONE FOR
   GOOD. That is the entire difference between this module and the two it
   replaced, both of which handed value back on a cycle: a spent Freshness cup was
   styled to say "resting, back at the next pot", and getting the same feeling here
   would teach exactly the wrong rule. Hence a taken menu is struck through and
   stamped with a name rather than dimmed in place.

   THE SECOND THING is the ONE-TILE-SHORT state, which has no equivalent in either
   predecessor. 44.3% of players finish one tile short of a menu; that is the
   decision the whole module exists to create, and a player who cannot see it is
   playing a different game. It gets the loudest treatment on the panel.

   IT SITS in the meters rail under the fresh-pot gauge, but NOT as a pair with it
   - a pot of tea does nothing to a menu. The green family is deliberate distance
   from the gauge's gold. */
.ft-section.ft-menus {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  /* The green tint and its rail go with the other five (plan section 8.5). It
     was deepened twice on 7 August to stop the panel merging with the white menu
     cards on it and to stop the rail's panels merging with each other; on the
     wall, with a gap of wall between every surface, neither problem exists. The
     cards are --object white and this is --surface, which is a 8.1 point step
     rather than a few per cent. */
}

/* Every menu gone. This IS an ending - nothing brings them back - and the panel
   says so in words ("Every menu has gone") on the line below. NOTHING IS DIMMED
   at any width in any state, so the 0.66 goes: the struck-through cards carry
   it, each stamped with the name of whoever took it. */
.ft-menus--spent {
  opacity: 1;
}

/* The price tag beside the head. It rides INSIDE the title span so the
   space-between head keeps the N/M figure hard right; a price is prose, not an
   area label, so the label treatment (uppercase, letterspacing, bold) is undone. */
.ft-menus__vp {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

/* ---- The cards ----
   THREE TO FIVE of them - the deal is players + 1 - wrapping rather than
   overflowing so a narrow rail is safe. Nothing here assumes a count:
   TASTING_MENU_SURPLUS is a knob and the deal is sized against the player count.
   The five-card case at 4 players is the one that governs the panel height, so
   measure that band rather than the 3-card one. */
.ft-menus__cards {
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  /* Widened 7 August with the card shadows. Two cards on one row need a visible
     channel between them, and at the old --spacing-xs their 2px borders nearly
     touched and read as a single divided box. */
  gap: var(--spacing-sm);
}

/* SIZED SO TWO FIT ACROSS THE METERS RAIL. At four players the panel holds four
   cards, and at ~114px each they stacked one per row and made the panel three
   times the height of the Freshness strip it replaced - which is most of what the
   5 August screenshot re-baseline was reporting. A 1/1/1 card is three chips wide,
   so the symbol size is what governs, and since the count became a corner badge
   the chip IS the symbol: at 48px a card is 160px, which is one per row in the M
   and L bands and two across in XL. Do not grow the symbol without re-running
   tools/layout-check.mjs. */
/* MADE TO READ AS SEPARATE CARDS, 7 August. White cards on a near-white green
   wash, with two cards now sitting side by side since the symbols shrank, blurred
   into one strip - a player could not see where one menu ended and the next began,
   which matters more here than anywhere else on the page: two adjacent cards are
   two DIFFERENT sets of ingredients, and misreading the boundary means reading a
   menu that does not exist.
   Three changes, and they work together rather than any one of them doing it: the
   panel wash goes deeper (above) so a white card is genuinely lighter than what is
   behind it, each card gets a soft drop shadow so it sits ON the panel rather than
   in it, and the gap between cards widens. The border stays 2px because the state
   colours (one-tile-short green, qualified gold) ride on it. */
.ft-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 5px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card);
  box-shadow: 0 1px 3px rgba(61, 43, 31, 0.16);
  transition: opacity 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

/* The ingredients and their quantities, which is the whole content of the card.
   Read left to right in descending quantity, so the "2" always comes first. */
.ft-menu__needs {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* The chip is exactly as wide as its symbol - the count rides ON the symbol as a
   corner badge rather than sitting beside it. That is what bought the bigger art
   on 5 August: the symbol went 18px -> 26px and the CARD DID NOT GROW, because
   the 7px digit and its gap came out of the chip at the same time. */
.ft-menu__need {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* TIED TO THE TILE ICON (7 August), which is what a menu symbol IS a picture of:
   .ft-tile__icon is 60% of --tile-size, so this is the same arithmetic and the two
   now shrink together band by band - 36px at XL, 28.8 at L and M, 26.4 at S. It
   was a flat 48px, larger than the tiles it names, and the panel was the tallest
   thing on the centre rail because of it.
   IT IS A CALC, NOT A NUMBER, deliberately: the responsive bands retune
   --tile-size and nothing here has to be retuned with them.
   THE OLD CEILING STILL APPLIES and there is now far more room under it. Measured
   5 August: the cards box is 182px wide in the narrowest band that shows this
   panel (1280 and 1150), and a 1/1/1 card is 3 symbols + 2x2 gap + 8 padding + 4
   border, so 3S + 16 <= 182 gives S <= 55.3. At 28.8 a card is 102px, so two now
   fit across even the narrow rail. Do not push the multiplier past 0.6 without
   re-running tools/layout-check.mjs - and if you do, change .ft-tile__icon with
   it or the two stop being the same picture at the same size. */
.ft-menu__symbol {
  width: calc(var(--tile-size) * 0.6);
  height: calc(var(--tile-size) * 0.6);
  object-fit: contain;
  flex-shrink: 0;
}

/* Drawn ONLY for a 2 (board.js omits it for a 1), so it is a genuine "note the
   double" rather than a digit on every symbol. Sits on the bottom-right corner,
   overhanging the symbol box so it costs the chip no width. */
/* SHRUNK WITH THE SYMBOL, 7 August. At 20px on a 36px symbol the badge was over
   half the chip and read as the card's subject rather than as a note on it. Left
   as fixed pixels rather than another calc: a digit has a legibility floor that
   does not scale, and 16px is close to it. */
.ft-menu__count {
  position: absolute;
  right: -2px;
  bottom: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--color-card);
  background: var(--color-text-primary);
  color: var(--color-card);
  font-family: 'Fraunces', serif;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Only a TAKEN card has a foot - the name of whoever took it. */
.ft-menu__holder {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-secondary);
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ON OFFER but not close - the resting state. Present, legible, not shouting. */
.ft-menu--open {
  border-color: var(--color-border);
}

/* ONE TILE SHORT. The loudest state on the panel, and the reason the panel
   exists. Since the deficit text was removed this border, glow and wash are the
   WHOLE signal on the card itself - the panel note below spells it out in words.
   Do not tone them down. */
.ft-menu--close {
  border-color: var(--color-success);
  background: linear-gradient(135deg, #F2F8F1 0%, rgba(90, 138, 92, 0.26) 100%);
  /* The glow REPLACES nothing: the base card's drop shadow is restated first, or
     the loudest card on the panel would be the one that stopped sitting on it. */
  box-shadow: 0 1px 3px rgba(61, 43, 31, 0.16), 0 0 10px rgba(90, 138, 92, 0.50);
}

/* QUALIFIED ALREADY - only reachable under TASTING_MENU_ONE_PER_TURN, where a
   second qualifying menu waits a turn. Gold, because it is banked rather than
   chased. */
.ft-menu--ready {
  border-color: var(--color-accent-gold);
  background: linear-gradient(135deg, #FBF5EC 0%, rgba(201, 162, 39, 0.30) 100%);
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.55);
}

/* TAKEN - struck through, dashed, and carrying the name of whoever took it. The
   name is the point: "the player on my left took the two-citrus one" is what makes
   losing a race feel personal rather than arbitrary, and it is the one thing the
   Freshness panel could never honestly show.

   STAGE 5, THE THIRD OF THE CARD ROW'S THREE DIMS. `opacity: .42` and
   `grayscale(1)` come off; the STRIKE and the DASHED BORDER stay, and they are
   what was carrying the state anyway. That is the same reasoning ticket 09 used
   for back-in-the-bag: a strike is a SHAPE, so it survives desaturation and it
   survives a fade nobody applied, whereas a grey card is only distinguishable
   from a live one while the two are side by side. It also stops the card's
   printed ingredient symbols being repainted to show a state that belongs to
   the card rather than to the ingredient. */
.ft-menu--taken {
  border-style: dashed;
}

.ft-menu--taken .ft-menu__needs {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.ft-menu--taken .ft-menu__holder {
  font-style: italic;
  color: var(--color-text-primary);
}

.ft-menus__note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-text-secondary);
}

.ft-menus--spent .ft-menus__note {
  font-weight: 600;
  color: var(--color-text-primary);
}

/* The ingredient symbols on a player's Tasting Menu score line, showing which
   menus they took rather than only the total - "she took the two-citrus-two-
   chocolate one" is how players actually talk about which cards have gone. */
.ft-score-breakdown__symbol {
  width: 14px;
  height: 14px;
  object-fit: contain;
  vertical-align: -2px;
}

/* ---- The claim-step affordance ----
   The one moment the module pays off: a matched-pattern cell whose tile, removed
   and PLATED, completes a menu right now. It rides ON TOP of .ft-tile--removable
   rather than replacing it - the cell is still a removal choice, it is just the
   decisive one.

   ONLY COMPLETION IS BADGED. A badge for partial progress would be on most of the
   board and would say nothing; this one means "take this card, now, for the whole
   menu". And it VANISHES for good the moment a rival takes that menu - the same
   tile in the same cell is worth TASTING_MENU_VP on one turn and nothing ever
   again (the badge prints the live number). Nothing else in
   this interface changes value because of what somebody else did. */
.ft-tile--menu {
  box-shadow: 0 0 0 3px var(--color-success), 0 0 12px rgba(90, 138, 92, 0.65);
}

.ft-tile__menu {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--color-success);
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ===========================================================================
   THE FLAVOUR OF THE DAY (6 August)
   ===========================================================================
   IT SITS UNDER THE TASTING MENUS and has to be told apart from them at a
   glance, because both name ingredients and everything else about them is
   opposite: a menu reads your cake stand and one player takes it; the Flavour
   reads your player board and everybody scores it. The menus own the GREEN
   family and the tea gauge owns GOLD, so this takes the game's warm PINK/rose
   accent - the one colour on the rail not already spoken for.

   IT IS NOT A METER AND MUST NOT LOOK LIKE ONE. Nothing here is counting down
   or filling up: the ingredient is revealed once and never changes. What moves
   is only the per-player counts, which is why they are a plain list of numbers
   rather than bars - a bar would imply a target, and there is none. */
.ft-section.ft-flavour {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  /* The rose tint and its rail go with the rest. It existed to hold its own
     between a gold neighbour above and a green one below; neither is tinted any
     more, so there is nothing to hold out against. */
}

/* The price tag beside the head, matching the menus' treatment: a price is prose,
   not an area label, so the label styling is undone. */
.ft-flavour__vp {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

/* THE REVEALED CARD: SYMBOL LEFT, PLACE RIGHT (restructured 7 August).
   It was centred - symbol and name side by side, reading as a label. It is now
   left-aligned and carries the sentence that matters, because "which ingredient"
   is only half of what a player has to know and the other half is the half they
   get wrong: these tiles score ON YOUR PLAYER BOARD, not on the cake stand that
   every other lane in the game reads.
   The symbol keeps its own width and never shrinks; the text takes the rest and
   wraps, which is why the card no longer centres anything. */
.ft-flavour__card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--spacing-sm);
  padding: 5px 6px;
  border: 2px solid var(--color-accent-pink, #C4708A);
  border-radius: var(--radius-sm);
  background: var(--color-card);
}

.ft-flavour__symbol {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

/* The text column. min-width: 0 lets it wrap inside the rail rather than forcing
   the card wider than the panel. */
.ft-flavour__where {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ft-flavour__label {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text-primary);
}

/* WHERE THE TILES HAVE TO BE. Secondary size, because it is a caption to the
   ingredient above it - but the "not" inside it is bold and takes the primary
   text colour, since the negative is the whole point of the line and a player
   skimming will read exactly that one word. */
.ft-flavour__place {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  line-height: 1.35;
  color: var(--color-text-secondary);
}

.ft-flavour__place strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

/* (A PER-PLAYER COUNT LIST stood here - a row each with a count and a leader chip,
   plus a rule paragraph and a shared-lead note. All of it was trimmed on 7 August
   because all of it was a REPEAT: the count and the leader chip are on each
   player's own score panel, beside the board holding the tiles, and the rule is in
   the rules modal and on this card's tooltip. The panel is now the head and the
   card, which is everything that is not said twice elsewhere.) */

/* ---- On the player boards ----
   ON EVERY BOARD AND AT ALL TIMES, unlike the menu badge, which speaks only at
   the claim step. A dozen of these can be on one board at once, so it is a TINT
   AND A RING rather than a badge: the useful reading is "how many do I have",
   which is a shape you count, not a number you read. Kept deliberately quieter
   than .ft-tile--removable and .ft-tile--menu, both of which mark a decision that
   is live RIGHT NOW; this marks a standing fact. */
.ft-tile--flavour {
  box-shadow: inset 0 0 0 3px rgba(196, 112, 138, 0.85);
}

/* THE COST MARK, at the one moment it costs something: this cell is a candidate
   sacrifice and the tile on it is a Flavour tile, so claiming here spends a point
   and possibly the lead. It can sit on the same cell as the green +VP menu badge -
   that is a genuinely hard choice rather than a rendering clash, so the two marks
   are different colours, different corners and different signs. */
.ft-tile--flavour-risk {
  box-shadow: inset 0 0 0 3px rgba(196, 112, 138, 0.95), 0 0 10px rgba(196, 112, 138, 0.55);
}

.ft-tile__flavour {
  position: absolute;
  bottom: -6px;
  right: -6px;
  min-width: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--color-accent-pink, #C4708A);
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* The score-panel line: "most +3" while this player leads, and the live tile
   count beside it. Provisional until the game ends, which the tooltip says. */
.ft-score-breakdown__lead {
  padding: 0 4px;
  border-radius: 8px;
  background: var(--color-accent-pink, #C4708A);
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 700;
}

.ft-score-breakdown__sub {
  color: var(--color-text-secondary);
  font-size: 10px;
}

/* DEAD SINCE 11 AUGUST: the paid reserve is deleted, so nothing sets
   .ft-card--reservable any more. The rules are kept unchanged rather than
   removed - they are the worked answer to "how does an armed spend show itself
   on a phone", and the next spend that arms something outside the sheet should
   take this vocabulary rather than reinvent it.

   Market cards invite a click during a human's reserve step. */
/* ARMED, AND IT HAS TO SHOW (10 August). This carried a pointer cursor and a
   hover lift and nothing else, which is no affordance at all on the device where
   the reserve is hardest to use: a phone has no hover and no cursor, so a player
   who tapped "Reserve a card" watched the sheet close and then saw a card row
   that looked exactly as it had a moment earlier.
   It takes the ring vocabulary's "you may act here" - a DASHED accent ring, the
   same mark the sweep buttons wear while they are waiting to be used, told apart
   from the claimable card's SOLID gold ring by being dashed rather than by
   moving. Nothing animates: the row can hold eight of these at once. */
.ft-card--reservable {
  cursor: pointer;
  outline: 2px dashed var(--color-accent);
  outline-offset: 3px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ft-card--reservable:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 16px rgba(193, 123, 92, 0.45);
}

/* DEAD SINCE 11 AUGUST: the reserve is deleted, renderOnOrderSlot with it, and
   nothing emits .ft-on-order. Kept for the record of what it solved - see the
   note below, which is the only written account of the desktop rail's one
   unbounded height term and how it was capped.

   "On order" reserved-card slot in a player panel.

   DEFECT 5, AND IT IS DEAN'S DECISION 2 OF 10/08/2026. Until stage 5 this was a
   wrapping ROW of full 150px cards, which cost 171px of column height per
   reserved card with no cap on reserves - the only unbounded term in the whole
   desktop layout, and the one thing that could make the L band's new opponent
   rail taller than the centre column it sits beside. In a 226px rail column
   exactly one card fits per row, so every reserve added a whole row, for ever.

   IT BECOMES AN OVERLAPPED FAN, CAPPED AT ONE CARD'S HEIGHT. The cards sit in a
   single row with each one drawn 24px along from the last, so the top card is
   fully visible and the ones behind show a 24px strip apiece - the way a hand of
   cards is held. Past three the remaining reserves become a +N badge. The rail's
   height is then a constant whatever a player has ordered, and desktop keeps the
   picture instead of falling back to the phone's count.

   THE 24px STRIP IS A REAL TARGET, not just a peek: it is 24 x 150, which clears
   the 44px floor on its long axis and is clickable for the whole of it. That is
   what lets a covered card still be claimed. */
.ft-on-order {
  /* The fan's two numbers, declared here so the container and the cards cannot
     disagree about them. The card's WIDTH is derived rather than typed:
     .card-market-sprite has `aspect-ratio: 0.72155`, so a 150px card is 108.2px
     wide and the negative margin that produces the overlap has to be written
     against the same figure. */
  --fan-card-h: 150px;
  --fan-step: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-md);
}

.ft-on-order__cards {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  /* A definite height, so a fan of three is exactly as tall as a fan of one and
     nothing downstream has to trust that the overlap worked. */
  height: var(--fan-card-h);
}

/* THE OVERLAP. Every card after the first is pulled back over its predecessor
   until only --fan-step of it shows. Later siblings paint over earlier ones, and
   the cards are emitted oldest first, so the newest order is the one on top and
   fully visible. */
.ft-on-order__cards > .card-market-sprite + .card-market-sprite {
  margin-left: calc(var(--fan-step) - var(--fan-card-h) * 0.72155);
}

/* A reserve past the third is not drawn. It is counted instead - see
   .ft-on-order__more - which is what caps the fan's WIDTH at
   108.2 + 2 x 24 = 156px, comfortably inside the rail's 226px column.
   board.js exempts a card that can be claimed right now, so a covered order can
   never become an unreachable one. */
.ft-on-order__cards > .card-market-sprite.ft-on-order__card--folded {
  display: none;
}

/* The +N. ABSOLUTELY POSITIONED, so it costs the fan no width at all - the
   standing rule from decision 18 that nothing in a seat may add to its
   max-content width applies here for the same reason it applies to seat colour.
   It sits on the top card's leading corner, over the card rather than beside
   it, because that is the one part of the fan that is never a click target. */
.ft-on-order__more {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--accent-deep);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  pointer-events: none;
}

.ft-on-order__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

/* .ft-card__teacup DELETED 9 August (ticket 00 / finding 07). It drew a gold
   ring around a teapot emoji in the corner of a reserved card. The emoji went
   with the rest of them, and the ring had nothing left to hold: the "On order"
   label directly above the card already says what the badge said. */

/* ======= Touch hygiene (plan B2) =======

   :hover STICKS ON TOUCH. A tap satisfies :hover and the browser keeps it
   satisfied until something else is tapped, so every lift-and-scale rule in this
   file leaves a tile sitting raised and glowing with nothing to explain it - it
   reads as selected when it is not, which in a game about selecting tiles is
   worse than having no hover response at all.

   LAST IN THE FILE ON PURPOSE. A media query contributes no specificity, so
   these only win by source order - three of the rules below
   (.ft-cupcake-spend-btn:hover, .ft-card--claimable:hover,
   .ft-card--reservable:hover) are declared late and would otherwise beat it.

   Written as an override rather than by gating each original rule in
   `@media (hover: hover)`: the desktop stylesheet then stays exactly as it was,
   byte for byte, which is what keeps the XL freeze honest. */
@media (hover: none) {
  /* THE TILE'S OWN HOVER LIFT NO LONGER NEEDS UNDOING HERE. Stage 4 wrapped it
     in @media (hover: hover) at the point of declaration, which is the honest
     form: a lift that only exists where there is a pointer cannot stick to a
     tap. The three card and cupcake lifts are still declared unconditionally
     further up the file and are still undone here. (.ft-cupcake-btn--active
     came off this list with the element: stage 6 replaced the row of
     per-cupcake buttons with a count.) */
  .ft-card--reservable:hover,
  .ft-card--claimable:hover {
    transform: none;
    box-shadow: none;
  }
  .ft-card--claimable:hover {
    border-color: var(--color-accent-gold);
    box-shadow: 0 0 30px rgba(201, 162, 39, 0.8), 0 0 50px rgba(201, 162, 39, 0.5);
  }

  /* The background-only rules. Milder, but a stand row left highlighted after a
     tap suggests it is still the chosen destination.
     The three tile rules that used to sit here - .ft-tile--removable:hover,
     .ft-tile--movable:hover and .ft-tile--move-target:hover - are gone with the
     hover backgrounds they were undoing. A tile state is a ring plus a wash and
     does not respond to hover at all. */
  .ft-stand__row--legal:hover,
  .ft-stand__crumbs--legal:hover { background: rgba(201, 162, 39, 0.12); }
  .ft-cupcake-spend-btn:hover:not(:disabled) {
    background: var(--surface);
    border-color: var(--color-border);
  }
}

/* ===========================================================================
   RESPONSIVE BANDS

   Everything below XL overrides TOKEN VALUES ONLY. No component rule is
   redeclared in a band, which is what keeps these blocks short and keeps the
   signed-off 1800+ layout provably untouched - see the token table in
   ../Web UI/RESPONSIVE_PLAN_2026-08-04_v4.md section 4.

   Only the touch band exists so far (plan B2/B3). The L, M and S layout bands
   are phases C, D and E; until they land the page still scrolls sideways below
   ~2180px, which the harness reports at every width.
   =========================================================================== */

/* AN OPPONENT'S BOARD RUNS ON ITS OWN TILE SIZE, and this one rule is what makes
   the narrow bands possible at all (plan 6.4).

   Redefining --tile-size for the subtree means every rule built from it -
   .ft-board-grid, .ft-tile, and .ft-seat__board-col's definite width - follows
   an opponent down without any of them being touched. The asymmetry it encodes
   is the important part: YOUR tiles are tap targets and cannot go below the 44px
   platform floor, whereas an opponent's board is display-only and can shrink as
   far as it stays readable. That is what turns three 568px columns into three
   ~170px cards.

   Inert at XL, where both tokens are 60px. */
.ft-seat--opp {
  --tile-size: var(--tile-size-opp);
  /* Re-derived, NOT inherited - see the note on --board-col-width in :root. The
     inherited copy was resolved against :root's --tile-size and would keep the
     opponent's columns at the human's size. Same formula on purpose; it is the
     redeclaration that carries the meaning, not the arithmetic. */
  --board-col-width: calc(5 * var(--tile-size) + 4 * var(--tile-gap)
                          + 2 * var(--spacing-sm) + 2px);
}

/* THE L BAND - 1400 to 2180 (plan phase C).
   Three columns still, but nothing is at its XL size any more. The structural
   change is that an opponent's score column moves ABOVE their board instead of
   beside it: side-by-side is what makes a seat 568px wide, and stacking is what
   collapses it to roughly the width of the board itself.

   THE UPPER BOUND IS 2180, NOT THE 1800 THE PLAN NAMES. The frozen XL layout - a
   60px tile and an 800px centre - has a measured content minimum of 2181px, so
   an "XL band" starting at 1800 spends its first 380px of range overflowing the
   viewport it is supposed to fit. That was true before any of this work (1920
   was 27px over); Phase A's containment fix only made it honest, by stopping the
   boards from hiding the shortfall by spilling out of their own panels.

   So the boundary is set where the layout actually stops fitting rather than at
   a round number, and the XL design is untouched everywhere it can be shown as
   designed. Decision taken 4 August; the cost is that a 1920 monitor now gets a
   48px tile, and the gain is that no width scrolls sideways. */
@media (max-width: 2180px) {
  :root {
    --tile-size: 48px;
    --tile-size-opp: 40px;
    --centre-width: 598px;
    /* 184, not the 170 the plan's table predicted. Measured: the cake stand's
       widest row (the four-plate one, plus its lock and the stand's padding) has
       a min-content width of 173px at a 30px plate, and nothing narrower than
       that is honest - the stand cannot wrap. The other three parts of the
       column need far less: total 39, breakdown 77, cupcake panel 92. The
       remaining 11px is deliberate headroom, because this figure is what decides
       whether the band clears 1400 at all. */
    --score-col-min: 184px;
    --card-height: 200px;
    --stand-plate: 30px;
    --cloth-ring: 12px;
  }

  /* YOUR OWN score column gets a definite width, exactly as the opponents' do
     and for the same reason. Left to itself it takes its MAX-content - 295px,
     because .ft-seat is min-width: max-content and nothing downstream caps it -
     even though its true floor is 181. That 105px of slack was the whole of the
     L band's remaining overflow, and it bought nothing: the column is a stack of
     things that are happy to wrap.

     This is also why the plan's predicted 478px human panel came out at 605. The
     arithmetic in section 3 assumed the score column sat at its --score-col-min
     token; it never has. At XL it renders 295 against a 200px token, which is
     recorded in .ft-seat__board-col's note but never fed back into the band
     totals. */
  .ft-seat--own .ft-seat__score-col {
    width: var(--score-col-min);
    min-width: 0;
    flex: 0 0 auto;
  }

  .ft-seat--opp {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
  }

  /* BOARD COLUMN FIRST, so the panel reads name -> board -> score.

     The seat's DOM order is [score column, board column], which is right when
     they sit side by side and wrong the moment they stack: the player's NAME
     lives in the board column's header, so stacking in source order buried
     "Player 3" underneath their total, their cake stand and their cupcakes. The
     panel announced itself four items in.

     Reordering rather than moving the header out of the board column in the
     markup, because that header is a child of a column with a definite width and
     making it a direct child of the seat would add a third flex item to the XL
     row - which would wreck the layout this whole plan is built to leave alone.

     The plan's phrase for the L band is "score stacked above the board". What
     stacking buys is WIDTH; which of the two ends up on top is free, and putting
     the name at the top of the card is worth more than putting the total there. */
  .ft-seat--opp .ft-seat__board-col { order: 1; }
  .ft-seat--opp .ft-seat__score-col { order: 2; }

  /* Stacked, the score column is exactly as wide as the board it sits under.
     A DEFINITE width, for the same reason .ft-seat__board-col has one: `width:
     100%` does not work here, because the percentage resolves against a parent
     whose own width is content-derived (.ft-seat is min-width: max-content), so
     the column just reports its content back and the seat sizes to THAT. It
     measured 295px against a 226px board - the score column, not the board, was
     setting the width of every opponent seat.

     --score-col-min's floor has to come off with it, or the 170px minimum
     re-inflates the seat once the tiles shrink below that. */
  .ft-seat--opp .ft-seat__score-col {
    width: var(--board-col-width);
    min-width: 0;
  }

  /* An opponent's cupcake panel is a READOUT - they cannot be clicked and the
     spend chips are not even rendered for another player, so the tiebreak
     footnote is telling you how to use controls that are not there. The count
     itself stays. (The italic instruction line was the other half of this rule
     and is deleted outright by stage 6 - see .ft-cupcake-header.) */
  .ft-seat--opp .ft-cupcake-points {
    display: none;
  }

  /* The full breakdown goes; the total stays (plan phase C). Three labelled
     rows is a level of detail for the board you are playing, not for a glance
     across the table - and what an opponent is actually threatening is on their
     stand and their board, both of which remain. */
  .ft-seat--opp .ft-score-breakdown {
    display: none;
  }

  /* The stand has to fit the narrower column. Its plates are the one thing in
     there with a size of their own rather than a text width. */
  .ft-seat--opp {
    --stand-plate: 24px;
  }

  /* THE 42px RUNG (plan section 17, amendment 2). L's opponent tile is 40px, and
     the redrawn nut's two grooves render at 1.91 CSS px there - under the
     2.00px floor, and anything under the floor is DELETED rather than shrunk.
     The solid teardrop is the same drawing with its two grooves filled, derived
     from the same source render rather than redrawn, so the silhouette is
     identical and only the sub-floor detail is gone. It loses nothing that
     carries the ingredient.
     `content` on a replaced element swaps the image without a second code path
     in board.js and without a second <img> in 25 cells.

     THE SELECTOR MOVED WITH THE 17 AUGUST RENAME, and this is the one place in
     the stylesheet that had to. It matched alt="almond" - the raw engine id, back
     when the id, the label and the file stem were one word. All three are now
     separate: the id is `nuts`, the alt text is the LABEL a screen reader reads,
     and the file is still named for what it is a picture OF. So the selector
     matches the label and the url keeps the old stem, which looks like a
     mismatch and is not - see src/ui/ingredients.js. */
  .ft-seat--opp .ft-tile__icon[alt="Nuts"] {
    content: url('images/symbol-almond-solid-v3.png');
  }
}

/* The strip is INERT above the L band: its seats are promoted back out and
   placed by .ft-seat--2/3/4 exactly as they were before the wrapper existed.

   THAT IS EXACTLY WHY PLAYER 2 LANDS UNDER PLAYER 1 at L today. `contents`
   promotes the three opponents back out to be placed by their own classes, and
   .ft-seat--2 says column 1, row 2 - which was right when all four seats were
   the same size and is a bug of omission the moment they are not. The L block
   below switches this wrapper ON rather than building one, which is what keeps
   the rework to CSS with nothing re-parented. */
.ft-opp-strip {
  display: contents;
}

/* THE ONE-LINE STAND SUMMARY and the cupcake count on an opponent's total.
   Both are rendered for every opponent at every width and hidden here, because
   at XL the full stand and the cupcake panel are still on show and these would
   be duplicates. Switched on in the L block below and again in the M band. */
.ft-stand-mini,
.ft-score-total__cupcakes {
  display: none;
}

/* THE MINI STAND'S OWN ROWS, AT FILE SCOPE BECAUSE TWO BANDS USE THEM NOW.
   These four rules lived inside the M block until stage 5, when decision 26 gave
   the L band's opponents the same one-line summary. They describe what the
   summary LOOKS like rather than where it appears, and the two `display` rules
   that decide whether it appears at all stay in their bands - which is the same
   separation the band blocks keep everywhere else in this file. */
.ft-stand-mini__row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--color-text-secondary);
  line-height: 1.2;
}

/* A completed row is the thing worth spotting at a glance: it is an ingredient
   that can never be plated again, by anyone, anywhere on that stand. */
.ft-stand-mini__row--full {
  color: var(--color-accent);
  font-weight: 600;
}

.ft-stand-mini__lock {
  width: 12px;
  height: 12px;
  object-fit: contain;
  font-size: 10px;
  line-height: 1;
}

.ft-stand-mini__lock--empty {
  border: 1px dashed var(--color-border);
  border-radius: 50%;
  opacity: 0.6;
}

/* The fifth chip's marker. It is an INTERFACE icon and the four before it are
   painted INGREDIENT silhouettes, which is exactly right: the crumb tray is not
   an ingredient, and the two families are meant to read differently. It keeps
   --accent-deep rather than following the row's secondary ink, because it is a
   chip rather than a control. Moved out of the M block with the four rules
   above, and for the same reason: the tray chip is drawn at L too. */
.ft-stand-mini__tray {
  margin-right: 2px;
}

/* ===========================================================================
   THE L BAND RESHAPED - 1400 to 2180 (plan section 6.1, stage 5)

   THREE COLUMNS, ONE ROW, NO SPANNING ITEM: you, the table, and an opponent
   rail. This is the one band whose SHAPE differs from both its neighbours, which
   is why it is a RANGE query rather than the file's usual max-width cascade -
   written as `max-width: 2180px` the M block would have to unpick five rules
   rather than override two tokens.

   WHAT WAS WRONG, AND IT IS A BUG OF OMISSION RATHER THAN A DESIGN. XL seats
   four players round a table, two down each side, with the centre spanning both
   rows. That works because at 2400 all four seats are the same width, so which
   player sits in which slot does not matter. L inherited the arrangement and
   broke its premise: your seat is 466px here and an opponent 226, and
   .ft-seat--2 still parked the 226 in the 466 column, directly under the one
   seat on the page that is not like it.

   AND THE HOLE UNDER THE GOAL CARDS WAS A SPANNING ITEM OVER TWO UNEQUAL ROWS.
   The side columns carried two stacked seats; the centre carried one column of
   table; the difference appeared as a rectangle of nothing bounded above by the
   cards and on both sides by a seat. EVERY GAP IN THIS FILE COULD GO TO ZERO AND
   THE SHORTFALL WOULD REMAIN, because it is the difference between two
   independent stacks of content. There is no row 2 here and nothing spans, so
   the hole cannot form: three columns of unequal length ending at unequal
   heights against the wall is ordinary page layout.

   XL IS INERT BY CONSTRUCTION, NOT BY INSPECTION. Every rule in this block
   carries the 2180 upper bound, so nothing in it can reach 2181. That is Dean's
   decision 6 written as CSS rather than promised in a comment.

   WHERE THIS BLOCK SITS IS NOT A MATTER OF TASTE. @media contributes no
   specificity, so `.ft-opp-strip { display: contents }` forty lines above would
   beat `.ft-opp-strip { display: flex }` here on source order alone if this
   block were moved up. It goes after the file-scope strip rules and before the
   touch band. The touch-hygiene block near the top of the responsive section is
   still last relative to the hover rules it undoes; nothing here declares one.
   =========================================================================== */
@media (min-width: 1400px) and (max-width: 2180px) {
  /* max-content columns rather than 1fr. A 1fr column stretches a 226px
     opponent card across 625px of track at 1920, which is the other half of
     what makes the shipped band look unfinished. The composition is its own
     natural width at every point in the band and the wall shows either side -
     a centred block, decision 27, with the discontinuity at 2181 accepted
     rather than smoothed. */
  .ft-game {
    grid-template-columns: max-content var(--centre-width) max-content;
    grid-template-rows: auto;
    justify-content: center;
    align-items: start;
    /* 12, not --spacing-lg's 16. Defect 4: the shipped band needs 1416px at its
       own lower boundary of 1400, so it overflows the band it defines. Four
       pixels off each column gap pays for it, and THE BAND IS REPAIRED AT 1400
       RATHER THAN STARTED AT 1416 - which is what keeps the band table
       2181 / 1400 / 1150 / 768 a confirmation rather than a revision. */
    column-gap: 12px;
    row-gap: 12px;
  }

  .ft-seat--1 { grid-column: 1; grid-row: 1; }
  .ft-centre  { grid-column: 2; grid-row: 1; }

  /* THE RAIL. The wrapper is already in the markup and NOTHING IS RE-PARENTED -
     board.js binds its placement, claim and cupcake listeners once by
     delegation, and a moved node loses nothing visibly and everything
     functionally. */
  .ft-opp-strip {
    display: flex;
    flex-direction: column;
    gap: 12px;
    grid-column: 3;
    grid-row: 1;
    align-items: stretch;
  }

  /* Inside the rail the seats are flex items, so their XL grid positions have to
     be revoked or they fight the column - exactly as the M band already revokes
     them for its horizontal strip. */
  .ft-seat--2,
  .ft-seat--3,
  .ft-seat--4 {
    grid-column: auto;
    grid-row: auto;
    flex: 0 0 auto;
    min-width: 0;
  }

  /* THE RAIL READS IN TURN ORDER, AND IT DOES NOT WITHOUT THIS. The markup emits
     the seats 1, 3, 2, 4, which is what puts them round a table two-and-two in a
     row-major grid. Stack the same four in one column and the rail reads
     P3, P2, P4 - the one order that is neither turn order nor seating order.
     Flex `order` rather than a markup change, for the no-re-parenting rule
     above: ordering is the one thing flex will do that the DOM does not have
     to. */
  .ft-seat--2 { order: 1; }
  .ft-seat--3 { order: 2; }
  .ft-seat--4 { order: 3; }

  /* THE PRICE OF THE RAIL (decision 26). A rail is a VERTICAL budget and the
     shipped L opponent does not fit one: three full-detail opponents are over
     2,000px of column and the rail would cost more than the hole it removes.
     The full cake stand is the bulk of it, and the M band already solved this
     and shipped the solution - the one-line .ft-stand-mini in place of the
     stand, with the cupcake count folded onto the total line. Promoting those
     rules into L is the entire content change in this block. XL keeps full
     stands, so nobody on a large screen loses anything. */
  .ft-seat--opp .ft-stand,
  .ft-seat--opp .ft-cupcake-supply {
    display: none;
  }

  .ft-seat--opp .ft-stand-mini {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px var(--spacing-xs);
    margin-top: var(--spacing-xs);
  }

  .ft-seat--opp .ft-score-total__cupcakes {
    display: inline;
    margin-left: var(--spacing-sm);
    font-weight: 500;
  }
}

/* THE TOUCH BAND - M and below (plan B3).
   1400 is where the plan stops assuming a mouse. Two of the game's most-used
   controls are under the 44px platform minimum at their XL sizes: the market's
   sweep buttons measure 34x60 and 60x26, because the gutters they live in were
   sized for an arrow and a label rather than for a fingertip. The sweep is THE
   move of the turn, so these are the last controls that should be hard to hit.

   Both buttons take their size from these tokens - including where the size is
   written as an inline style, since that style names the token rather than a
   pixel value - so widening the gutters widens the buttons with them. */
@media (max-width: 1399px) {
  :root {
    --market-gutter-h: 44px;
    --market-gutter-w: 44px;
    --touch-target: 44px;
  }

  /* The arrow grows with the gutter. 12px in a 44px button is a mark rather
     than a direction; 16 is the size the drawing was authored at. */
  .ft-btn--sweep .ft-icon {
    width: 16px;
    height: 16px;
  }
}

/* --touch-target is 0px at XL and L, so this is inert until the band above
   fires. Declared outside the query on purpose: the RULE is constant, only the
   value moves, which is the same separation the bands themselves keep.

   THE SETUP SCREEN IS IN THIS LIST, and it was the last thing to be checked
   because every screenshot in the harness was taken after #startButton had
   already been clicked - so the one screen a player has to get through BEFORE
   the game starts was the one screen never measured. Its difficulty buttons were
   24px tall and the player-count select 36px, on a tablet, where they are the
   only things standing between a player and a game. */
/* .ft-modal__option and .sweep-option-btn came off this list with the two sweep
   dialogs stage 5 replaced. Their successor, .ds-opt, carries its own 52x52
   floor unconditionally rather than only inside the touch band, because the
   smallest option in the system is one 44px tile plus 4px of chip padding a
   side and that is true at every width. */
.ft-btn,
.ft-btn--small,
.ft-cupcake-spend-btn,
.ft-setup__difficulty-btn,
.ft-setup__toggle-btn,
.ft-setup__expansion,
.ft-setup__select {
  min-height: var(--touch-target);
}

/* THE M BAND - 1150 to 1400 (plan phase D). TWO COLUMNS.

   The three-column table is what costs the width: two seat columns plus a fixed
   centre cannot be squeezed below about 1400 without taking the tiles under the
   44px touch floor. So the table stops being a table. The centre and your own
   seat sit side by side, and the opponents drop out of the columns entirely into
   a strip along the bottom - which is the point at which they also stop needing
   to be readable in detail, and become colour-only.

   This is where the 5x5 grids of three other players collapse from ~250px
   columns to ~146px cards, and that saving is the whole reason the band fits. */
@media (max-width: 1399px) {
  :root {
    /* Your own tiles stay at 48: they are tap targets from here down, and the
       plan's floor for a tile you must hit is 44. The opponents' go to 24, where
       a symbol would be mush and is dropped instead (plan 6.1 - validated by eye
       at 24, 14 and 40px; all five colours stay plainly distinct). */
    --tile-size-opp: 24px;
    --cloth-ring: 10px;
  }

  /* THE 24px RUNG OF THE SHRINK LADDER, set as VALUES so no component rule moves
     (plan section 8.6). Rim, flat local colour, one 1px inner edge light: no
     body gradient, no highlight, no ingredient - and the ingredient is neither
     shown nor claimed to be shown, so nothing is carried by colour alone. The
     dent mirrors it exactly, one 1px inner SHADE on the top edge. Below 24 the
     cast shadow is off, so the plate keeps its relief and loses its contact. */
  .ft-seat--opp {
    --cloth-ring: 6px;
    --form-edges: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    --dent-edges: inset 0 1px 0 rgba(var(--shadow-ink), 0.38);
    --plate-size: 92%;
    --plate-body: linear-gradient(var(--china), var(--china));
    --plate-edges: inset 0 1px 0 rgba(var(--shadow-ink), 0.34);
  }

  /* THE FIELD GOES AT 24, and it is turned off ON THE TILE rather than on the
     seat (stage 4a). --tile-field can only be declared where --lt / --mid / --dk
     are in scope, so the seat is not a scope that can hold it; two classes beat
     the one on .ft-colour, and `none` is the literal initial value of
     background-image, so the surface leaves and the flat --mid background-color
     stays exactly where it was. Surface goes first, then form, never the
     silhouette - plan section 8.2. */
  /* THE :not() IS STAGE 7's (plan section 4.5). One opponent at a time leaves the
     collapsed strip and becomes a tall sheet with their board at 44px, which is a
     rung where the field paints; excluding the open seat here is what lets it,
     without a second copy of the recipe that could drift from .ft-colour's. */
  .ft-seat--opp:not([data-pm-open="1"]) .ft-colour {
    --tile-field: none;
  }

  .ft-game {
    grid-template-columns: minmax(0, var(--centre-width)) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: start;
  }

  .ft-centre  { grid-column: 1; grid-row: 1; }
  .ft-seat--1 { grid-column: 2; grid-row: 1; }

  /* The strip becomes real: one flex row under both columns. */
  .ft-opp-strip {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    grid-column: 1 / -1;
    grid-row: 2;
    align-items: start;
  }

  /* Inside the strip the seats are flex items, so their XL grid positions have
     to be revoked or they fight the row. */
  .ft-seat--2,
  .ft-seat--3,
  .ft-seat--4 {
    grid-column: auto;
    grid-row: auto;
    flex: 0 1 auto;
    min-width: 0;
  }

  /* COLOUR ONLY. At 24px a tile has room for about a 14px symbol, which is mush;
     hiding it is what the tile should look like at this size, not a compromise
     (plan 6.3). The colour is what the reward cards are about, so the question
     you actually ask of another player's board - how close are they to that
     card - is fully answered by the pattern that remains. */
  .ft-seat--opp .ft-tile__icon {
    display: none;
  }

  /* ...WHICH MAKES THE FLAVOUR RING THE ONLY INGREDIENT AN OPPONENT'S BOARD SHOWS
     at this size, and the only way to read the contest at all: their score
     breakdown is hidden below (so their count is not written anywhere), and the
     rail panel does not carry counts since the 7 August trim. So the ring stays,
     and it is worth the pixels - it is a colour, not a symbol, so it survives the
     shrink that the symbols do not.
     Thinner in proportion: 3px of inset on a 24px tile is a quarter of the tile
     and reads as a different colour rather than as a marked one. */
  .ft-seat--opp .ft-tile--flavour {
    box-shadow: inset 0 0 0 2px rgba(196, 112, 138, 0.9);
  }

  /* What an opponent's panel is FOR at this size is their board and their score.
     The full cake stand cannot shrink below ~170px and would double the width of
     every card in the strip, and their cupcake panel is a readout of controls
     nobody can press. Both go - but the stand is REPLACED rather than simply
     dropped, by the one-line summary below, and the cupcake count moves onto the
     total line. See renderStandSummary and plan 6.2. */
  .ft-seat--opp .ft-stand,
  .ft-seat--opp .ft-cupcake-supply {
    display: none;
  }

  /* COLUMN GUTTERS ARE ZERO, and that is what pays for the crumb chip's icon
     (plan section 8.7). The 4px between the five chips existed only because the
     fifth had no leading graphic to separate it from the fourth. Give every
     chip a graphic and the alternation of glyph and digits IS the separation,
     so 16px of gutter buys a 12px tray icon and 2px of margin with 2px left
     over: the strip comes out narrower than it was.
     The row gap stays at 2px - it separates wrapped seats, not chips.
     THE WIDTH BUDGET HERE IS NIL. At 390 the strip has 2px of headroom and two
     more pixels of chip costs 269px of page height, because the seat drops from
     two per row to one and a whole seat row appears. Re-measure before adding
     anything at all to this strip. */
  .ft-seat--opp .ft-stand-mini {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 0;
    margin-top: var(--spacing-xs);
  }

  .ft-seat--opp .ft-score-total__cupcakes {
    display: inline;
    margin-left: var(--spacing-sm);
    font-weight: 500;
  }

  /* .ft-stand-mini__row, --full, __lock, __lock--empty and __tray MOVED OUT OF
     THIS BLOCK to file scope by stage 5, because two bands render the summary
     now. They are unchanged; see the note beside them above the L block. */

  .ft-seat--opp .ft-seat__score-col {
    width: auto;
  }

  /* The market section is `width: max-content` at XL, where it sits in a column
     sized around it. Once the column is wider than the grid - which it is from
     here down - that makes the section hug the market and strand it against the
     left edge of an otherwise full-width stack. Letting the section span and
     centring the grid inside it (.ft-market-wrap already does) puts the market
     back in the middle of the space it has. */
  .ft-section--tiles {
    width: auto;
  }

  /* THE TWO SURVIVING PANEL HEADINGS ARE DELETED BELOW L (plan section 8.5's
     table: phone, S and M lose them, L and XL keep them). Cover the heading, and
     ask whether a player can still name what they are looking at: a row of
     patisserie cards and a row of menu cards both answer yes. Nothing is
     renamed - Dean's terms stand, and both are still printed here at L and XL. */
  .ft-menus .ft-section__title,
  .ft-section--cards .ft-section__title {
    display: none;
  }

  /* ---- THE ACTION BAR, pinned to the bottom of the viewport (plan 5.5) ------

     FIXED, NOT STICKY, and the plan's own CSS cannot work here. `position:
     sticky` is clipped to its PARENT's box: #phaseControls lives inside
     .ft-seat__board-col, which ends a few pixels below it, so a sticky bar would
     have essentially no range to stick over. It would unpin the moment you
     scrolled past your own board - which is precisely the scroll that hides it,
     since the card row is below.

     The alternative was to re-parent #phaseControls to .ft-game in the markup,
     which would put a third item in the XL seat row and break the frozen layout.
     Fixed positioning gets the plan's stated intent - the controls stay reachable
     without scrolling back - without touching XL at all.

     z-index below the 1000 the modals use, or the sweep-choice dialog gets a bar
     laid across it. */
  .ft-seat__controls {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    width: auto;
    margin-top: 0;
    /* Deliberately no background or padding on the CONTAINER. It is empty on a
       bot's turn and in any phase with no controls, and a padded container would
       then draw an empty strip across the foot of the screen. .ft-phase-bar
       carries its own cream background, so an empty container is 0px tall and
       invisible. */
    pointer-events: none;
  }

  /* THE HOME INDICATOR (9 August, ticket 00 / finding 18). The safe-area inset
     used to be carried on the MARGIN, which lifts the whole bar and leaves a
     strip of page showing under it - and on an iPhone that strip is exactly
     where the home indicator sits, so the bar's own bottom edge was still being
     crossed by it. Carrying the inset as PADDING instead grows the bar's cream
     downwards into the unsafe area: the indicator now floats over the bar's
     background rather than over its content or the page behind it.

     `max(12px, ...)` because the inset is 0 on every device without an
     indicator, and the bar needs bottom padding regardless - 12px matches
     --spacing-md, which is the padding on the other three sides. */
  .ft-seat__controls > .ft-phase-bar {
    pointer-events: auto;
    margin: 0 var(--spacing-sm) var(--spacing-sm);
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(61, 43, 31, 0.18);
  }

  /* Clearance, so the last thing on the page is not sitting under the bar. The
     measured bar is ~127px in the tallest phase (place, with the count and two
     buttons); 190 covers it plus the safe-area inset on an iPad. */
  .ft-game {
    padding-bottom: 190px;
  }

  /* The bar is fixed from here down, so the toast has to clear it or it lands on
     top of the controls it is talking about. 150 is the measured bar (~127px in
     its tallest phase) plus a gap, and it stays inside the 190px the page below
     is already reserving. */
  .ft-toast {
    bottom: calc(150px + env(safe-area-inset-bottom, 0px));
  }
}

/* THE S BAND - under 1150 (plan phase E). ONE COLUMN.

   Covers 1024 and the 768 tablet-portrait floor. Two columns still needs ~1130,
   so below that the centre and your seat stop sharing a row.

   The ORDER is the substance of this band, and it is chosen so that the tile
   market and your own board are on screen TOGETHER - placement needs both, and
   that co-visibility is what let the plan delete its auto-scroll entirely. */
@media (max-width: 1149px) {
  :root {
    /* 44 is a floor, not a preference: your own tiles are tap targets. The spare
       vertical budget goes to margin rather than to bigger tiles. */
    --tile-size: 44px;
    --tile-size-opp: 14px;
    --card-height: 170px;
    --stand-plate: 28px;

    /* THE ONLY TWO TYPE ROLES THAT CHANGE BY BAND (plan section 8.5). The
       scale is otherwise identical everywhere, and this block is "below M"
       exactly. Added by stage 3 with the rest of the token layer; nothing
       consumes either token until stage 4. */
    --type-display: 24px;
    --type-figure: 20px;

    --cloth-ring: 10px;
  }

  /* 44px, YOUR OWN BOARD: full form and full ink, but the cast shadow drops to
     1px 2px - the light does not move, the object is simply smaller. */
  :root {
    --plate-edges:
      inset 0 2px 3px -1px rgba(var(--shadow-ink), 0.34),
      inset 0 -2px 2px -1px rgba(255, 255, 255, 0.65),
      1px 2px 3px -1px rgba(var(--shadow-ink), 0.40);
  }

  /* THE 14px RUNG. Rim and flat local colour, and that is the whole object; the
     dent is fill only. The board region's ring goes to nothing, because at 14px
     a 5x5 is 78px wide and a 10px ring round it would be half the object again -
     and because the opponent strip was measured with two pixels of width
     headroom at 390, where two more would cost 269px of page height. */
  .ft-seat--opp {
    --cloth-ring: 0px;
    --form-edges: 0 0 0 0 rgba(0, 0, 0, 0);
    --dent-edges: 0 0 0 0 rgba(0, 0, 0, 0);
    --plate-size: 92%;
    --plate-body: linear-gradient(var(--china), var(--china));
    --plate-edges: 0 0 0 0 rgba(0, 0, 0, 0);
  }

  /* The field is already off from the 24px rung above, which this query is
     always inside; restated so the 14px rung reads as a complete rung and a
     later edit to the M band cannot switch the field back on at 14 by accident.
     The :not() is stage 7's, for the same reason as the 24px rung's: the one
     opponent open as a tall sheet is drawing at 44, not at 14. */
  .ft-seat--opp:not([data-pm-open="1"]) .ft-colour {
    --tile-field: none;
  }

  /* .ft-centre and .ft-centre-table dissolve so their children become items of
     .ft-game, where `order` can reach them. Without this the market is trapped
     inside .ft-centre and your board inside a seat - different parents, and
     `order` cannot move a child out of its parent.

     Losing .ft-centre's panel framing is a gain rather than a cost: a card
     inside a card wastes ~36px of width, and each .ft-section already carries
     its own tint and left rule. */
  .ft-game {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    /* MUST be restated. The M band above sets `align-items: start` for its
       two-column grid, and this query also matches there - left as it was, every
       section shrank to its own content and the page rendered as a ragged
       380px-wide strip down the left of a 768px screen. On the single column the
       sections should span it. */
    align-items: stretch;
  }

  /* .ft-centre-meters JOINS THEM (4 August), for the flavour panel. The rail
     was a real box at this band, so `order` could only shuffle things WITHIN it -
     and the existing `.ft-section--tea { order: 5 }` did exactly that the moment
     a third child arrived, pushing the tea gauge below the flavour panel that
     had just been placed under it. Dissolving the rail here puts all three of its
     children where `order` can reach them individually, which is the same reason
     .ft-centre and .ft-centre-table dissolve.
     The two clocks below are given an explicit order because of it: released into
     .ft-game they would otherwise default to 0 and land above the turn bar. */
  .ft-centre,
  .ft-centre-table,
  .ft-centre-meters {
    display: contents;
  }

  .ft-centre-head    { order: 1; }
  .ft-section--tiles { order: 2; }
  /* THE TASTING MENUS SIT WITH THE TILE MARKET AT THIS BAND, not with the two
     clocks at the bottom, and the move is deliberate rather than convenient.
     Claims-claimed and the fresh-pot gauge are glanceable STATE - you read them
     when you wonder how long is left. The menus are a per-decision number: they
     are read on every claim and they are what you steer your sweeps by, so they
     belong beside the two things they decide, which at this band are the market
     directly above and your own cake stand directly below.
     It ties with .ft-section--tiles rather than taking an order of its own, and a
     tie resolves in DOM order - the market is earlier in the document, so it
     stays first.
     THIS BAND DOES NOT FOLLOW THE RAIL'S TILE-TRAVEL ORDER, and that divergence is
     forced rather than chosen. In the rail the Flavour comes first, because a tile
     reaches your player board before it ever reaches your cake stand (see the
     markup). Here the Flavour is below your board instead - not because the order
     is wrong but because there is no room for it above, see the note under
     .ft-seat--1. The menus keep the slot beside the market because they are the
     panel you steer a sweep by. */
  .ft-menus          { order: 2; }
  .ft-seat--1        { order: 3; }
  /* THE FLAVOUR PANEL GOES BELOW YOUR OWN BOARD at this band, and it is the only
     panel on the rail that leaves the market's side. MEASURED, not chosen: the
     market-and-board column has THREE pixels of headroom at 768x920 (criterion 3
     measured board bottom 917 of a 920 viewport with this panel absent), so
     anything added between them pushes your board below the fold, the placement
     click scrolls it back into view, and the market goes off the top. A 69px panel
     took the criterion from 166px of slack to 164px of overflow. There was no
     version of this panel small enough to sit there.
     Below the board is also where it reads best, which is the consolation: the
     tiles it counts are on the board directly above it, so "how many do I have" is
     answered next to the thing being counted. It ties with the card row and
     resolves in DOM order, which puts it first - the counts stay in the same
     scroll position as your board rather than after a full card row. */
  .ft-flavour        { order: 4; }
  .ft-section--cards { order: 4; }
  .ft-section--claims { order: 5; }
  .ft-section--tea   { order: 5; }
  .ft-opp-strip      { order: 6; }

  /* COMPACT AT THIS BAND. It has just been put between the market and your board
     - the one adjacency the whole band order exists to protect - so the panel
     becomes a row: the head on its own line and the menu cards strung across,
     still reading as one unit. The rule line goes; it is in the rules modal, and
     this is not where a player learns the game.
     MEASURE THIS RATHER THAN TRUSTING IT, and this is now TWO modules overdue. The
     heights quoted in the responsive plan were measured for the Speciality panel
     (an ingredient card and a track); the Freshness cups were a different shape
     and were never re-measured; the menu cards are a THIRD shape - two to four
     wider cards rather than five small tokens - and are wider and taller than
     either. See the responsive plan's measurement harness. */
  .ft-section.ft-menus {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm) var(--spacing-md);
  }

  .ft-menus .ft-section__head {
    flex: 1 0 100%;
  }

  .ft-menus .ft-section__note {
    display: none;
  }

  .ft-menus__note {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* THE FLAVOUR PANEL BECOMES A SINGLE LINE HERE - the head and the ingredient side
     by side. Since the 7 August trim it is nearly that already at every width; what
     this band still takes off is the second line and the card's frame.
     THE MEASUREMENT THAT DROVE IT, kept because it is why the panel sits below your
     board at this band rather than beside the market (see the order rules above):
     at 768x920 the market-and-board column has three pixels of headroom, and the
     panel at its original 137px took criterion 3 from 166px of slack to 168px of
     overflow. Re-run tools/layout-check.mjs after touching any of it. */
  .ft-section.ft-flavour {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px var(--spacing-sm);
  }

  /* NOT `flex: 1 0 100%` like the menus' head. A full-width head is a second line,
     and a second line is 20px this band does not have. */
  .ft-flavour .ft-section__head {
    flex: 0 1 auto;
    gap: var(--spacing-xs);
  }

  /* The frame comes off the card: at 24px the symbol reads as an inline chip, and
     a border round it at this size looks like a button. */
  .ft-flavour__card {
    border: none;
    background: none;
    padding: 0;
  }

  .ft-flavour__symbol {
    width: 24px;
    height: 24px;
  }

  .ft-flavour__label {
    font-size: 13px;
  }

  /* Your own seat stops being two columns side by side. */
  .ft-seat--1 {
    flex-direction: column;
    align-items: center;
  }

  /* AND THE BOARD GOES ABOVE THE SCORE COLUMN, which is the whole reason the
     band fits.

     Stacked in DOM order the score column lands between the market and your
     board, and it is not small - the cake stand and the cupcake panel come to
     around 400px. That pushed the board's last row 1337px from the top of the
     market and broke the one thing this order exists to guarantee: that you can
     see the market and your own board at the same time, because placement needs
     both.

     Worth recording that plan section 5.2's vertical budget does not have a line
     for this column at all. It counts the turn bar, the market, the seat
     chrome, the swept-tiles row, the board and the phase bar - the score column
     is simply missing, which is why the measured stack came in far above the
     853px the budget predicted. */
  .ft-seat--own .ft-seat__board-col { order: 1; }
  .ft-seat--own .ft-seat__score-col {
    order: 2;
    width: 100%;
    max-width: var(--board-col-width);
  }

  /* THE FOUR TRIMS (plan 5.2). Between them they are the difference between a
     1012px stack and one that fits an iPad.

     The seat header goes because on a single column the board under "your turn"
     is self-evidently yours, and the swept-tiles caption goes because a row of
     tiles directly above your board during the one step where you are placing
     them does not need naming. */
  .ft-seat--1 .ft-seat__header,
  .ft-seat__swept-label {
    display: none;
  }

  /* The market's generous padding is right at XL for the reasons its own note
     gives; at S it is pure viewport. */
  .ft-market-wrap {
    padding: var(--spacing-sm);
  }

  /* The strip is already a row; at 14px three opponents plus gaps come to about
     390px, so it fits 768 with no horizontal scroll and no collapse. Every
     opponent stays visible all the time, which is what replaces ~1470px of
     stacked panels with ~150px. */
  .ft-opp-strip {
    justify-content: center;
  }
}

/* ---------------------------------------------------------------------------
   STAGE 6'S FILE-SCOPE DEFAULTS, and they are all "off".

   Three things exist in the markup at every width and are drawn at none of them
   except the phone band below. They are emitted unconditionally so that no
   render path in board.js has to consult a media query - the stylesheet decides
   where a thing appears, which is the same separation the seat positions have
   kept since phase A.

   They must sit BEFORE the block below rather than after it: @media contributes
   no specificity, so a default declared later would win at every width and turn
   all three off again.
   --------------------------------------------------------------------------- */

/* The sheet's chrome. There are no sheets above 1149 - your score column and
   your cupcake supply are on the canvas there, where they belong. */
.pm-sheet-head {
  display: none;
}

/* STAGE 7's TWO, AND THEY ARE OFF FOR THE SAME REASON. Desktop does not take the
   summary rail (plan section 6.4): the L rework brings 1440 to 1150, so the
   clocks stay on screen at every scroll position for any viewport over 464px
   tall, and the rail solves a problem the rework removed. The collapsed
   opponent row is the phone's answer to a strip that was 42 per cent of the
   page; above the band an opponent is a seat with a board on it. */
.pm-rail,
.pm-seat-row {
  display: none;
}

/* The phase bar's sheet opener, and a phase bar that opens nothing. */
.ft-btn--sheet {
  display: none;
}

/* THE ONE-ROW BAR'S TEXT COLUMN. `display: contents` above the band, so the
   instruction and the status figure remain block-level siblings of the controls
   carrying their own margins, and the desktop bar renders exactly as it did
   before the wrapper existed. */
.ft-phase-bar__text {
  display: contents;
}

/* ===========================================================================
   THE PHONE STEP MODEL - stage 6, plan sections 3 and 5, 10 August 2026
   ===========================================================================

   ONE CANVAS BETWEEN TWO FIXED DOCKS, WITH STANDARD BOTTOM SHEETS IN TWO SIZES.
   Dean's standing decision 1: a persistent board with sheets over it, not
   full-screen steps and not a swipeable pager.

       fixed   TURN BAR         48   whose turn, which step, the rules button
       fixed   SUMMARY RAIL     48   stage 7's five chips. THE SLOT IS RESERVED
       --------------------------------------------------------------------
       scroll  the market            tiles, and the ten sweep gutter chips
       scroll  the swept-tile tray
       scroll  YOUR 5x5 BOARD
       scroll  the patisserie goal cards
       scroll  the opponent strip
       --------------------------------------------------------------------
       fixed   [ a sheet rises here ]
       fixed   PHASE BAR        76   what this step wants, and the primary

   Five things on the canvas, in the order a tile travels: taken from the
   market, held in the tray, placed on your board, matched against a card,
   compared with the opponents. Nothing else is ever on the page - and the six
   panels that used to sit between them are sheets now.

   THE ONE GEOMETRIC LAW, and it is a number rather than a preference:

       A SHEET NEVER COVERS YOUR BOARD WHILE YOUR BOARD IS PART OF THE DECISION

   THE ONE STRUCTURAL TRICK: NOTHING IS RE-PARENTED. Every block that leaves the
   canvas leaves it by going `position: fixed` where it already sits in the DOM.
   board.js binds its placement, claim and cupcake listeners ONCE, by delegation,
   to #workingArea1, #playerBoard1 and #playerScore1; re-parenting any of them
   kills input silently and shows up in no layout measurement. This is also why
   the reveal is `visibility` and never `display` or `transform` - see the sheet
   block below, where both traps are real and named.

   THIS BLOCK IS A SECOND max-width: 1149px QUERY and it sits at the end of the
   file on purpose. @media adds no specificity, so it is source order that lets
   it override the S band above it without a single !important or a raised
   selector. The S band is not edited; it is superseded here, block by block,
   which keeps stage 6's whole diff readable in one place.
   =========================================================================== */
@media (max-width: 1149px) {

  :root {
    /* THE VIEWPORT UNIT. `vh` is normatively `lvh`, so it over-reports by the
       height of the browser toolbar - which is exactly the strip a bottom sheet
       would end up underneath. svh is the small viewport. Declared as a fallback
       pair rather than inside one min(), because a min() containing an
       unsupported unit is invalid as a whole and would take the cap with it. */
    --pm-vh: 100vh;
    --pm-half-vh: 50vh;

    /* THE TOP DOCK. The turn bar plus the summary rail's slot. STAGE 7 FILLS THE
       SLOT; stage 6 reserves it, because every number below is derived from the
       dock's height and a rail that arrives later must not move the geometry it
       arrives into. */
    --pm-turnbar-h: 48px;
    --pm-rail-h: 48px;
    --pm-dock-top: calc(var(--pm-turnbar-h) + var(--pm-rail-h));

    /* THE BOTTOM DOCK: the phase bar, which was already fixed below 1400 and
       keeps that role, compacted from three rows to one. The shipped bar ran to
       about 127px in the place phase because it stacked an instruction, a status
       line and two buttons on separate rows; 76 is 44 of button and 32 of
       padding, and the bar is exactly that at every phone width. */
    --pm-dock-bottom: 76px;

    /* The sheet's own chrome: handle, title, Close. It sits above whichever
       sheet is open and comes out of the same budget. */
    --pm-sheet-chrome-h: 56px;
    --pm-air: 26px;

    /* WHAT THE BOARD NEEDS, AND WHAT A HALF SHEET MAY THEREFORE NEVER TAKE.
       --board-col-width is 5 tiles at 44, 4 gaps at 2, the grid's 8px of padding
       and its 1px border each side = 246px, and it is the same expression the
       board itself is drawn from, so the two cannot drift. */
    --pm-board-reserve: calc(var(--board-col-width) + var(--pm-sheet-chrome-h) + var(--pm-air));

    /* TWO SHEET SIZES, AND THE ENGINE PICKS BETWEEN THEM RATHER THAN TASTE.

       A HALF SHEET is one you ACT THROUGH while the canvas is still part of the
       action: the spend sheet, because two of the six spends - move a tile,
       clear an empty plate - are played by tapping your own board while it is
       open. A TALL SHEET is one you READ, or one that is the whole of its own
       decision: your score and stand, where by claim step 3 the tile is already
       chosen and the stand rows ARE the tap targets.

       Apple's medium detent and Material's cap at 50 per cent of screen height
       independently land on half a screen; the cap takes the LOWER of that and
       what the board leaves, so the platform figure is a ceiling rather than the
       answer. Measured: 280 / 344 / 432 half and 552 / 616 / 704 tall, at
       360x780, 390x844 and 430x932. */
    --pm-sheet-max: min(
      var(--pm-half-vh),
      calc(var(--pm-vh) - var(--pm-dock-top) - var(--pm-dock-bottom) - var(--pm-board-reserve))
    );
    --pm-sheet-tall: calc(
      var(--pm-vh) - var(--pm-dock-top) - var(--pm-dock-bottom) - var(--pm-sheet-chrome-h)
    );

    /* THE SWEEP SHEET TAKES ITS OWN, TIGHTER RESERVE (plan section 5.2), and
       this is the one number in the model that is NOT the generic half sheet.

       The generic cap keeps YOUR BOARD on screen. During sweep the thing that
       must stay on screen is THE MARKET, and the market is taller than the
       board: #marketContainer is a 44px gutter row, a 2px gap, five 44px tile
       rows and four 2px gaps = 274px, against the board grid's 246. Under the
       generic cap the leftover canvas is exactly 272px at EVERY phone width -
       because the cap is the viewport minus the fixed things, so the gap is
       (board reserve minus chrome) whatever the screen - and THE MARKET WOULD
       MISS BY TWO PIXELS.

       So it is derived from the market rather than typed as 240. The 12px is the
       board region's padding; if that ever changes, this cap moves with it and
       the expression is the thing to re-evaluate rather than the number.
       Measured: 240 / 304 / 392 / 460 at 360 / 390 / 430 / 768. */
    --ss-market-h: calc(var(--market-gutter-h) + var(--tile-gap)
                        + 5 * var(--tile-size) + 4 * var(--tile-gap));
    --ss-region-pad: 12px;
    --ss-sweep-reserve: calc(var(--ss-market-h) + var(--ss-region-pad)
                             + var(--pm-sheet-chrome-h) + var(--pm-air));
    --ss-sheet-max: min(
      var(--pm-half-vh),
      calc(var(--pm-vh) - var(--pm-dock-top) - var(--pm-dock-bottom) - var(--ss-sweep-reserve))
    );

    /* The dialog's tile is already 44 below 1150; --ds-pad is the sheet's own
       12px rather than the desktop dialog's 24, which is what puts the widest
       group (276px at the ten-option worst case) inside a 336px inner width at
       360 with 60px to spare. */
    --ds-pad: 12px;
  }

  @supports (height: 100svh) {
    :root {
      --pm-vh: 100svh;
      --pm-half-vh: 50svh;
    }
  }

  /* =========================================================================
     1. THE CANVAS
     ========================================================================= */

  /* The two docks are fixed, so the canvas is PADDED past them rather than
     scrolled under them. 190px of bottom clearance was sized for the old
     three-row bar; the compact one needs 76 plus a comfortable 44. */
  .ft-game {
    padding-top: calc(var(--pm-dock-top) + 8px);
    padding-bottom: calc(var(--pm-dock-bottom) + 44px);
  }

  /* Anything scrolled into view by the browser clears the docks rather than
     landing under them. This is the cheap half of an auto-scroll; the model
     needs no other half, because the board is never more than one screen from
     the market. */
  /* THE TWO SPEND TARGETS ARE ON THE LIST TOO (10 August). revealSpendTarget in
     board.js scrolls the tile market or the card row into view when a spend is
     armed against it, and neither is a direct child of .ft-game - they are both
     inside the centre column - so without naming them here the browser would
     park each one neatly underneath the fixed top dock. */
  .ft-game > *,
  .ft-market-wrap,
  .ft-section--cards {
    scroll-margin-top: calc(var(--pm-dock-top) + 8px);
    scroll-margin-bottom: calc(var(--pm-dock-bottom) + 8px);
  }

  /* ---- 1a. THE TURN BAR: survives, halved, and pinned ---------------------
     78px of SCROLLING page saying whose turn it is - the one fact you need most
     often and the first one you scroll away from. It becomes a STRIP in the
     plan's section 8.5 sense: the --inverse ground, flat (the 135deg gradient
     goes, because a flat interface means flat), one hairline on the content
     edge, radius 0, no shadow, edge to edge.

     z-index 890: under the phase bar's 900 and above the sheets' 880, so a tall
     sheet stops at the dock rather than sliding under a transparent gap. */
  .ft-centre-head {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 890;
    height: var(--pm-turnbar-h);
    min-height: 0;
    flex-wrap: nowrap;
    gap: var(--spacing-sm);
    padding: 0 6px 0 var(--spacing-md);
    background: var(--inverse);
    border: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 0;
    box-shadow: none;
  }

  /* --type-heading, sentence case. Fraunces is the voice of the game and is
     never uppercase and never letterspaced. */
  .ft-centre-head__player {
    font-size: var(--type-heading);
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ft-centre-head__turn {
    flex: 1 1 auto;
    gap: 4px;
  }

  .ft-centre-head__thinking {
    width: 100%;
    max-width: 180px;
  }

  .ft-centre-head__right {
    flex: 0 0 auto;
    gap: var(--spacing-xs);
  }

  /* TAP TARGET FIX 1 OF 2. Ticket 04 measured #gameRulesButton at 120x29 and it
     is the one 44px failure the harness reports at every single width. The
     `book` icon at 16 in a 44px target, taking currentColor from the control it
     sits in; the words stay as the accessible name, because the icon is never
     the accessible name of anything. */
  #gameRulesButton {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
    gap: 0;
    background: transparent;
    border: 1px solid rgba(251, 245, 236, 0.35);
    color: var(--ink-inverse);
    box-shadow: none;
  }

  #gameRulesButton .ft-btn-howto__label {
    display: none;
  }

  /* TAP TARGET, THE MUTE. 44x44 in the touch band, in the 48px turn bar, at its
     right end - which is the one place plan section 13.6 allows it, because five
     72px chips are exactly 360px at 360 and a scrolling rail is refused. */
  #soundToggle {
    width: 44px;
    height: 44px;
  }

  /* ---- 1c. MARKET, BOARD, CARDS: the three that stay ----------------------
     The shipped band already orders market(2), your seat(3), cards(4). The model
     does not reorder it; it EMPTIES THE GAPS. The tasting menus sat between the
     market and your board and the ~400px score column sat between your board and
     the cards, and both are sheets now. */

  /* PATISSERIE GOALS is deleted on the phone: a row of patisserie cards names
     itself, and the figure beside the heading is what was actually being read.
     Its note is rules text sitting in the one gap the claim's co-visibility is
     measured across, and the rules modal already says it. */
  .ft-section--cards > .ft-section__head > .ft-section__title,
  .ft-section--cards > .ft-section__note {
    display: none;
  }

  /* SCROLL, DO NOT SHRINK. Three 170px cards wrap to two rows at 360 and cost
     372px of page; one row costs 178 and the cards keep their size. This is what
     brings the claim's span - your board to the card row - inside the viewport,
     so it is load-bearing rather than tidy. */
  #cardMarket {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--spacing-xs);
  }

  #cardMarket > * {
    flex: 0 0 auto;
    scroll-snap-align: center;
  }

  /* =========================================================================
     2. THE SHEETS
     One object, six uses. Bottom-anchored, capped so the board stays visible,
     full-bleed under 600px and centred at a 600px cap above it - which is
     Material's own compact-window figure and which stops a 1149px-wide screen
     getting a letterbox sheet. ONE LINE OF CSS AND ONE MEDIA FEATURE, NOT A
     BAND: max-width 600px with margin-inline auto is the whole of it.

     THEY ARE MATERIAL *STANDARD* SHEETS, NOT MODAL ONES, and there is NO SCRIM
     ANYWHERE IN THE MODEL. Material's own distinction: a standard sheet
     co-exists with the screen's main UI region while a modal one disables all
     other app functionality. Two of the six spends are played by tapping your
     own board through the open spend sheet, so the canvas behind a sheet stays
     lit and stays interactive wherever the phase allows. That requirement is
     what makes the half-sheet cap non-negotiable.

     THE FOUR READING PANELS ARE SHEETS HERE AND HAVE NO OPENER UNTIL STAGE 7.
     #cardProgress, #teaOption, #tastingMenuPanel and #flavourPanel are the
     panels the rail's chips expand (plan section 4.2), and taking them off the
     canvas is most of what makes the page 1886. The chips that open them are
     stage 7's, and until they land those four are reachable only by setting
     body[data-pm-sheet] by hand.
     ========================================================================= */
  #playerScore1,
  #cupcakeSupply1,
  #tastingMenuPanel,
  #flavourPanel,
  #cardProgress,
  #teaOption {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--pm-dock-bottom);
    /* NEVER translateX(-50%) TO CENTRE. A transform on a fixed sheet makes it
       the containing block for its own fixed descendants, and #cupcakeSupply1 is
       a fixed descendant of #playerScore1. margin-inline centres with no
       transform and no trap. */
    margin: 0 auto;
    width: 100%;
    max-width: 600px;
    max-height: calc(var(--pm-sheet-tall) + var(--pm-sheet-chrome-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 880;
    /* REVEALED BY `visibility`, NEVER `display` OR `transform`. display:none
       drops the cake stand's [data-dest-row] targets out of layout and breaks
       the claim's third step; a transform springs the containing-block trap
       above. visibility is also the only one of the three a child can override
       on a hidden parent, which is exactly what #cupcakeSupply1 needs. */
    visibility: hidden;
    background: var(--surface);
    border: 0;
    border-radius: 16px 16px 0 0;
    /* The one flat container in the system allowed a shadow, because here it
       says "above the board" rather than decorating. */
    box-shadow: 0 -6px 20px -6px rgba(var(--shadow-ink), 0.38);
    padding: 0 var(--spacing-md) var(--spacing-md);
  }

  /* ONE ATTRIBUTE IS THE WHOLE STATE MACHINE. */
  body[data-pm-sheet="stand"]   #playerScore1,
  body[data-pm-sheet="spend"]   #cupcakeSupply1,
  body[data-pm-sheet="menus"]   #tastingMenuPanel,
  body[data-pm-sheet="flavour"] #flavourPanel,
  body[data-pm-sheet="fill"]    #cardProgress,
  body[data-pm-sheet="tea"]     #teaOption {
    visibility: visible;
  }

  /* #cupcakeSupply1 is a CHILD of #playerScore1 and has to be able to show while
     its parent is hidden and to hide while its parent shows. */
  body[data-pm-sheet="stand"] #cupcakeSupply1 {
    visibility: hidden;
  }

  /* THE ONE HALF SHEET IN THE MODEL. Everything else on this list is a tall
     sheet, either because you read it or because it is the whole of its own
     decision. */
  #cupcakeSupply1 {
    max-height: calc(var(--pm-sheet-max) + var(--pm-sheet-chrome-h));
    margin-top: 0;
  }

  /* THE SHEET CHROME, INSIDE ITS SHEET rather than floating above it. The
     arithmetic is identical - the 56px comes out of the same budget either way -
     and it is what .ds-dialog already does, so the model has one shape rather
     than two and there is no second element to re-position on every render.
     Sticky, so it stays put if a tall sheet's content ever scrolls under it. */
  .pm-sheet-head {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 1;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    height: var(--pm-sheet-chrome-h);
    margin: 0 calc(-1 * var(--spacing-md));
    padding: 14px var(--spacing-md) 6px;
    background: var(--surface);
    border-radius: 16px 16px 0 0;
  }

  /* Apple: people expect to swipe a sheet down to dismiss it. The handle is what
     makes that discoverable and what VoiceOver reads. */
  .pm-sheet-head__handle {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 2px;
    background: var(--rule);
  }

  /* --type-title, and the sheet's title is the only heading in the room: you got
     here by tapping something that said what it was. */
  .pm-sheet-head__title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--type-title);
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* Labelled Close and not Done, because nothing has been done. */
  .pm-sheet-head__close {
    flex: 0 0 auto;
    min-width: 64px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
  }

  /* Inside a sheet the panel's own section heading is deleted, for the same
     reason the sheet has a title at all. */
  #tastingMenuPanel > .ft-section__head > .ft-section__title,
  #flavourPanel > .ft-section__head > .ft-section__title,
  #cardProgress > .ft-section__head > .ft-section__title {
    display: none;
  }

  /* The seat's own rules for a score column that is no longer in the seat. */
  #playerScore1 {
    min-width: 0;
  }

  /* =========================================================================
     3. THE PHASE BAR: survives, compacted to one row
     It keeps the fixed bottom position it already had below 1400. What changes
     is that it is ONE ROW rather than three, and that the primary sits at the
     trailing end of a bar inset from both screen edges.

     Apple says avoid full-width buttons and puts a sheet's primary on the
     trailing edge; Material anchors persistent UI at the bottom with the
     confirming action closest to the trailing edge, and says dismissive actions
     never sit to the right of confirming ones. An inset bar with the primary
     trailing and 12px of padding puts its centre about 42px in from the corner,
     clear of the 64px corner-accuracy penalty - which is the part of the reach
     evidence that survived its own author's repudiation of the thumb-zone map.

     THE BAR IS EXACTLY --pm-dock-bottom TALL, and the safe-area inset is carried
     as PADDING rather than margin (ticket 00, finding 18) so the home indicator
     floats over the bar's own ground instead of over the page behind it.
     ========================================================================= */
  .ft-seat__controls > .ft-phase-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--spacing-sm);
    margin: 0 var(--spacing-sm);
    padding: var(--spacing-md);
    padding-bottom: max(var(--spacing-md), env(safe-area-inset-bottom));
    min-height: var(--pm-dock-bottom);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -2px 12px rgba(61, 43, 31, 0.18);
  }

  /* The instruction and the status figure become ONE COLUMN sharing the row with
     the controls, which is the whole of "three rows to one". Both are clamped:
     the bar is a dock with a fixed height, and a phase whose sentence ran long
     used to be a phase whose bar was half again as tall. */
  .ft-phase-bar__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .ft-phase-bar__instruction {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.3;
    margin: 0;
  }

  .ft-phase-bar__status {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.3;
    margin: 0;
  }

  .ft-phase-bar__controls {
    flex: 0 0 auto;
    gap: var(--spacing-sm);
    /* Dismissive actions never sit to the right of the confirming one, and the
       markup already emits them in that order. */
    flex-direction: row;
  }

  .ft-phase-bar__controls .ft-btn {
    min-height: 44px;
  }

  /* Undo is an icon in the bar. Its word is worth about 40px of the text column
     at 360, and the icon plus its accessible name says the same thing. */
  .ft-btn--undo {
    min-width: 44px;
    padding: 0;
    justify-content: center;
  }

  .ft-btn--undo .ft-btn__label {
    display: none;
  }

  /* THE SHEET OPENER, which exists only where a sheet does. */
  .ft-btn--sheet {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
  }

  /* The toast clears the compacted bar rather than the old three-row one. */
  .ft-toast {
    bottom: calc(var(--pm-dock-bottom) + 12px + env(safe-area-inset-bottom, 0px));
  }

  /* =========================================================================
     4. THE SPEND SHEET - defect 13, Dean's decision 1
     409px of content against a 280px cap at 360, and the cap is not negotiable
     because two of the six spends are played by tapping the board through the
     open sheet. So the panel is what gives: a TWO-COLUMN GRID OF SIX CHIPS,
     three rows of two. All six stay visible, nothing scrolls, and there is no
     second navigation step.
     ========================================================================= */
  .ft-cupcake-supply {
    gap: var(--spacing-sm);
    padding: 0;
    margin-top: 0;
    border-radius: 16px 16px 0 0;
  }

  .ft-cupcake-spends {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .ft-spend-chip {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    padding: var(--spacing-xs) var(--spacing-sm);
    line-height: 1.25;
  }

  .ft-spend-chip__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .ft-spend-chip__price {
    font-weight: 700;
  }

  .ft-cupcake-state {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .ft-cupcake-note {
    margin: 0;
    max-width: none;
  }

  /* "Cupcakes score no points - they break ties" is a rule, and a rule belongs
     in the rules modal, which states it. On the phone it is 22px of a sheet with
     76px of slack in its worst case - three state lines, six live chips and a
     full purse - and this is the cheapest 22px in the panel. */
  .ft-cupcake-points {
    display: none;
  }

  /* The sheet opener is the icon alone; its word is the accessible name. */
  .ft-btn--sheet {
    min-width: 44px;
    padding: 0;
    justify-content: center;
  }

  .ft-btn--sheet .ft-btn__label {
    display: none;
  }

  /* =========================================================================
     5. THE SWEEP SHEET (plan section 5)
     The desktop dialog stage 5 built IS the sweep sheet - same element, same
     content, the same four data attributes on the option and the same
     onMarketClick. Only the container changes, which is what section 7 of the
     sweep-sheet write-up asks for. Below 1150 it stops centring on the viewport
     (which covered the market, the last live half of defect 3) and becomes a
     bottom sheet on the market's own reserve.
     ========================================================================= */
  .ds-dialog {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: var(--pm-dock-bottom);
    transform: none;
    margin: 0 auto;
    width: 100%;
    max-width: 600px;
    /* The cap is the BODY's budget; the chrome comes out of the same reserve and
       is added back here because it lives inside the element. */
    max-height: calc(var(--ss-sheet-max) + var(--pm-sheet-chrome-h));
    border-radius: 16px 16px 0 0;
    z-index: 880;
    box-shadow: 0 -6px 20px -6px rgba(var(--shadow-ink), 0.38);
  }

  .ds-dialog__chrome {
    position: relative;
    align-items: center;
    height: var(--pm-sheet-chrome-h);
    padding: 14px var(--ds-pad) 6px;
  }

  .ds-dialog__handle {
    display: block;
    position: absolute;
    top: 6px;
    left: 50%;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 2px;
    background: var(--rule);
  }

  /* 14 of top air, two groups of 70.3 with 8 between them, 10 at the foot: the
     sheet body is 173px at rest and 222px with the overflow warning, AT EVERY
     PHONE WIDTH AND ON EVERY DEAL, because each axis is exactly one line of
     chips. Nothing reflows, nothing jumps, and the market behind it never
     moves. */
  .ds-dialog__body {
    padding: 14px var(--ds-pad) 10px;
  }
}

/* ---------------------------------------------------------------------------
   THE M BAND'S HALF OF THE SAME TAP TARGET, and it turned out to be free.

   #gameRulesButton at 115x28 is the one 44px failure the harness reported at
   EVERY width in the touch band, and the block above only reaches 1149. At M the
   button keeps its words - the column is 1280px wide and there is no reason to
   take them away - so the fix is the height alone: the title bar is 44px tall
   already, sized by its own 8px of padding around a 28px button, so giving the
   button the bar's full height and taking the bar's vertical padding to zero
   leaves the bar at 44 and the page at 1407, measured at 1280 before and after.
   A tap target grew by 16px and nothing moved.
   --------------------------------------------------------------------------- */
@media (min-width: 1150px) and (max-width: 1399px) {
  .ft-centre-head {
    padding-top: 0;
    padding-bottom: 0;
  }

  /* THE TOUCH BAND RUNS TO 1399, NOT TO 1149, which is the boundary the tap-
     target criterion uses and not the one the phone model uses - so both controls
     carry the 44px floor here. It costs zero page height, measured: the bar is
     already 44px because of the rules button, the right group does not wrap even
     with the mute in it (1407 either way at 1280), and the padding above is what
     pays for both. */
  #gameRulesButton,
  #soundToggle {
    height: 44px;
    min-height: 44px;
  }

  #soundToggle {
    width: 44px;
  }
}

/* ===========================================================================
   THE SUMMARY RAIL AND THE COLLAPSED OPPONENT STRIP
   stage 7, plan section 4, 10 August 2026
   ===========================================================================

   THE STAGE THAT DELIVERS THE HEADLINE: one page height, at every phone width,
   on every turn. Stage 6 got the phone to 1513 on the opening and 1878 mid; the
   opponent strip was the only block on the page that GREW as the game ran, and
   it was the whole of the mid-game residue. The rail is what makes the number
   stop varying, and the collapsed row is what stops the strip growing.

       fixed   TURN BAR         48
       fixed   SUMMARY RAIL     48   FIVE CHIPS - stage 6 reserved this slot and
       ------------------------      every number in the model is derived from a
       scroll  the canvas            96px top dock, so the rail lands in 48 and
       ------------------------      does not ask for 49
       fixed   [ a sheet ]
       fixed   PHASE BAR        76

   A THIRD max-width: 1149px QUERY, at the end of the file for the same reason
   stage 6's is: @media contributes no specificity, so source order is what lets
   this override the two blocks above it without a single !important. Neither of
   them is edited; they are superseded here, block by block.

   THE FOUR READING PANELS GET THEIR OPENERS. Stage 6 made #cardProgress,
   #teaOption, #tastingMenuPanel and #flavourPanel bottom sheets, which is most
   of the 1,520px it refunded - but nothing opened them, so on that commit the
   end-of-game meter, the fresh-pot gauge, the tasting menus and the flavour of
   the day were not readable on a phone at all. These five chips are the openers,
   and a chip's id IS stage 6's sheet id.
   =========================================================================== */
@media (max-width: 1149px) {

  /* =========================================================================
     1. THE RAIL
     A STRIP in plan section 8.5's sense: --surface, one hairline on the content
     edge, radius 0, no shadow, edge to edge, never a heading. z-index 890, with
     the turn bar it sits under: above the sheets' 880 and below the phase bar's
     900.

     IT NEVER VARIES BY PHASE and it is present during opponents' turns, which is
     when it earns most of its keep - it is the only thing on the screen that is
     changing. A chip that ARRIVES cannot announce a change, because there is
     nothing to compare it against, and the announcement model depends on every
     chip being present continuously.

     NOT overflow-x: auto. Dean rejected a scrolling rail outright and the reason
     is mechanical rather than aesthetic: the whole value of a chip is that it is
     on screen at the moment its number moves.
     ========================================================================= */
  .pm-rail {
    display: flex;
    position: fixed;
    top: var(--pm-turnbar-h);
    left: 0;
    right: 0;
    z-index: 890;
    height: var(--pm-rail-h);
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
    overflow: hidden;
  }

  /* A fifth of 360 is 72px, and Dean's decision 22 makes the whole 72 content
     budget: there is no horizontal padding, because the flex centring is what
     separates one chip from the next and there is no divider to clear. The
     widest line the engine can produce - a score of 95 with twelve cupcakes, its
     own 1,500-game maximum - measures 69 of the 72. If it ever tightens, the
     cupcake glyph goes first and the count stays.

     48 tall by 72 wide clears the 44px floor on both axes, with the height
     binding. */
  .pm-chip {
    flex: 1 1 0;
    min-width: 0;
    /* The delta badge and the threshold rail are absolutely positioned against
       this, so neither can add a pixel to the chip's content width. */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-height: var(--pm-rail-h);
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* A DISPLAY VALUE BEATS THE hidden ATTRIBUTE, which is a UA rule, so a chip
     given `hidden` by updateSummaryRail would still be laid out without this
     line. It is the Menus chip that needs it: the Tasting Menu is an expansion
     since 16 August and is off by default, so the base game runs a four-chip
     rail. The four survivors are `flex: 1 1 0` and simply take the width. */
  .pm-chip[hidden] {
    display: none;
  }

  .pm-chip__line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    max-width: 100%;
    min-width: 0;
  }

  /* The mark is an interface label beside the figure and takes the interface's
     brown; the painted marks - the teapot and the day's ingredient - are objects
     rather than icons and are drawn as themselves, because one object in two
     registers is the confusion the icon set exists to prevent. */
  .pm-chip__mark {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    color: var(--accent-deep);
  }

  .pm-chip__mark img {
    display: block;
    object-fit: contain;
  }

  /* --type-figure-sm, Fraunces 700 / 16 / tabular. The number IS the chip, so it
     is set in the voice of the game. */
  .pm-chip__fig {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
  }

  /* THE ONE SUBORDINATE NUMBER ON THE RAIL (decision 33). Score and cupcakes are
     one chip rather than a sixth cell: both are "where you stand", and they are
     told apart by WEIGHT rather than by position, so the cupcake count can never
     be read as the score it sits beside. */
  .pm-chip__fig2 {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--ink-soft);
    white-space: nowrap;
  }

  .pm-chip__fig2 svg {
    color: var(--accent-deep);
  }

  /* --type-micro, Inter 500 / 11, sentence case. NEVER --type-stamp: that is a
     printed label on a painted component, and a rail chip is not one. */
  .pm-chip__label {
    max-width: 100%;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* State is drawn around a thing, never into it. The open chip carries the same
     3px accent rail the panel system already uses as a state marker. */
  .pm-chip[aria-expanded="true"] {
    box-shadow: inset 0 -3px 0 var(--accent);
  }

  .pm-chip[aria-expanded="true"] .pm-chip__label {
    color: var(--ink);
  }

  /* The live region carries the threshold sentences only - a screen reader that
     announced every tick would be unusable. It rides inside the fixed rail, so
     it can never be page height. */
  .pm-rail__live {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* -------------------------------------------------------------------------
     1a. WHAT A CHANGE LOOKS LIKE. Three grades, graded by CONSEQUENCE rather
     than by size of change, and stage 8 owns every duration below.

     FIVE THINGS NO GRADE MAY EVER DO: move the chip, change its width or reflow
     the dock; dim anything; be the only carrier; depend on colour alone; cost
     any of the View Transition name budget. Every carrier here is a wash, an
     absolutely positioned mark or a colour, and the rail takes zero names.

     BOTH TIMED CARRIERS ARE ANIMATIONS RATHER THAN JS-DRIVEN OPACITY, and that
     is load-bearing twice over: an animation ends where it started, so the rail
     returns to rest by itself, and the screenshot harness freezes animations to
     their end state, so a timed carrier can never make a capture depend on when
     it was taken.
     ------------------------------------------------------------------------- */

  /* GRADE 1, A TICK. The number moved by a step. The wash primitive paints ABOVE
     the ground and BELOW the content, so no strength of announcement can ever
     reach the figure it is announcing. */
  @keyframes pm-tick {
    0%   { box-shadow: inset 0 0 0 999px rgba(193, 123, 92, 0); }
    25%  { box-shadow: inset 0 0 0 999px rgba(193, 123, 92, 0.22); }
    100% { box-shadow: inset 0 0 0 999px rgba(193, 123, 92, 0); }
  }

  /* STAGE 8 REPLACES STAGE 7's PLACEHOLDER. 900ms was a number to be going on
     with and it broke the vocabulary's 300ms ceiling on its own. A tick is one
     step of change marked, which is exactly what the phase bar's own step change
     is, so it takes --ft-dur-bar: 180ms. The wash rises over a quarter of that
     and falls over the rest, which is the same in-and-out shape it always had. */
  .pm-chip[data-pm-news="tick"] {
    animation: pm-tick var(--ft-dur-bar) var(--ft-ease-exit) 1;
  }

  /* GRADE 2, A THRESHOLD, AND IT IS THE ONE THAT CARRIES THE DESIGN CLAIM. A
     board full at 25; the teapot count reaching the trigger; the last tasting
     menu going; the flavour majority changing hands.

     THE RAIL STAYS UNTIL THE PLAYER TAPS THE CHIP (decision 32). A transient
     cannot carry news the player may be looking away from, and a flash nobody
     saw is precisely the failure the rail was built to prevent. It is a STATIC
     3px mark, so it survives prefers-reduced-motion intact - the grade that
     carries consequence is the one that cannot be turned off. The pulse is the
     arrival; the rail is the memory. */
  .pm-chip[data-pm-threshold="1"]::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--accent-deep);
    pointer-events: none;
  }

  .pm-chip[data-pm-threshold="1"] .pm-chip__fig {
    color: var(--accent-deep);
  }

  @keyframes pm-threshold {
    0%, 100% { box-shadow: inset 0 0 0 999px rgba(142, 82, 57, 0); }
    50%      { box-shadow: inset 0 0 0 999px rgba(142, 82, 57, 0.26); }
  }

  /* STAGE 8. Three 600ms pulses was the placeholder. A threshold's arrival IS a
     breath, and the vocabulary has exactly one number for a breath - the gold
     ring's 1600ms - so it breathes ONCE, on the ring's own curve. One cycle
     rather than three, because the persistent rail is the memory and the pulse
     is only the arrival: repeating it three times is a flash asking to be
     noticed, which is the thing decision 32 refused. */
  .pm-chip[data-pm-threshold="1"][data-pm-news="threshold"] {
    animation: pm-threshold var(--ft-dur-ring) var(--ft-ease-travel) 1;
  }

  /* GRADE 3, CATCH-UP. Three bots play between your turns on a phone you are not
     watching, and without this the rail is a snapshot with no history - the board
     fill quietly going 9 to 14 is exactly what a clock exists to prevent. The
     badge is absolutely positioned, so it costs zero layout width and cannot
     push a chip, and it fades by animation rather than by timer. */
  .pm-chip__delta {
    position: absolute;
    top: 1px;
    right: 2px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--accent-deep);
    opacity: 0;
    pointer-events: none;
  }

  /* STAGE 8. 2600ms was the placeholder and the badge is two things, not one: a
     HOLD, which is not a movement at all and takes the ring's own 1600ms - the
     vocabulary's only number for how long a standing signal stands - and an
     EXIT, which is a movement and takes the claimed card's own dissolve, 180ms.
     1780ms total, and the fade is the last 10.1 per cent of it. */
  @keyframes pm-delta {
    0%, 89.9% { opacity: 1; }
    100%      { opacity: 0; }
  }

  .pm-chip[data-pm-delta="1"] .pm-chip__delta {
    animation: pm-delta calc(var(--ft-dur-ring) + var(--ft-dur-dissolve)) var(--ft-ease-exit) 1 both;
  }

  /* The reduced-motion substitute is the same signal with the travel removed,
     not silence. Neither wash has travel, so what goes is the ramp: they step to
     their lit value, hold, and step off. The threshold rail is static and is
     untouched. */
  /* STAGE 8 takes the two 700ms literals out: --ft-dur-bar is already 120ms in
     this branch and --ft-dur-ring does not move, because a HOLD is not travel
     and there is nothing in it to remove. What still goes is the ramp - each
     wash steps to its lit value, holds and steps off. */
  @media (prefers-reduced-motion: reduce) {
    .pm-chip[data-pm-news="tick"],
    .pm-chip[data-pm-threshold="1"][data-pm-news="threshold"],
    .pm-chip[data-pm-delta="1"] .pm-chip__delta {
      animation-timing-function: steps(1, end);
    }
  }

  /* =========================================================================
     2. THE FIVE SHEETS - which cap each takes.

     Stage 6 built two sizes and gave all four reading panels the tall one. THREE
     OF THE FOUR ARE READ AGAINST YOUR OWN 5x5 - how close the end is, how many
     flavour tiles you hold, which menus you could still make - so they take the
     HALF cap, which stops a reading sheet covering the thing it is being read
     against. A cap is a ceiling rather than a height, so this takes nothing
     away. The You sheet stays tall: it is the whole of its own decision, and it
     is the one sheet the claim opens by itself.
     ========================================================================= */
  #cardProgress,
  #teaOption,
  #tastingMenuPanel,
  #flavourPanel {
    max-height: calc(var(--pm-sheet-max) + var(--pm-sheet-chrome-h));
  }

  /* The gauge supplies its own section heading, and inside a sheet the sheet's
     title is the only heading in the room. Stage 6 deleted the other three. */
  #teaOption > .ft-section__head > .ft-section__title {
    display: none;
  }

  /* Both of these panels are a wrapping ROW at this band, so their chrome has to
     claim a line of its own rather than becoming a flex item beside the cards. */
  #tastingMenuPanel > .pm-sheet-head,
  #flavourPanel > .pm-sheet-head {
    flex: 1 0 100%;
  }

  /* THE MENUS' NOTE COMES BACK, AND IT IS FREE NOW. It is display:none below
     1150 because stage 1 measured it as real page height on the canvas; the
     panel is a sheet on this commit, out of the page's flow entirely, so the two
     facts it carries - anywhere on the stand or the crumb tray, not your board,
     and first to qualify keeps it - reach a phone player for nothing. Stage 1
     had to merge them into one line for the desktop bands and that wording is
     unchanged: the fuller version still costs 15px from 1400 up, where there is
     no sheet to put it in. */
  #tastingMenuPanel > .ft-section__note {
    display: block;
  }

  /* THE STAND GOES FIRST AND THE BREAKDOWN SECOND (plan section 4.2), which is a
     reordering rather than a re-parenting, so board.js's delegated
     [data-dest-row] listeners are untouched. The reason is the claim: when this
     sheet opens itself at claim step 3 the stand rows ARE the tap targets, and a
     tap target below the fold of a sheet that has just opened is a defect. The
     breakdown is a reading item and may be scrolled to. */
  #playerScore1 {
    display: flex;
    flex-direction: column;
  }

  #playerScore1 > .pm-sheet-head      { order: 0; }
  #playerScore1 > .ft-stand__prompt   { order: 1; }
  #playerScore1 > .ft-stand           { order: 2; }
  #playerScore1 > .ft-score-total     { order: 3; }
  #playerScore1 > .ft-score-breakdown { order: 4; }
  #playerScore1 > .ft-cupcake-supply  { order: 5; }

  /* Defect 17's line, in the sheet where teaching is free. See the note beside
     .ft-stand__lock-note at file scope. */
  .ft-stand__lock-note {
    display: block;
  }

  /* =========================================================================
     3. THE COLLAPSED OPPONENT STRIP - decision 20, on by default

     ONE FULL-WIDTH 44px ROW PER OPPONENT. Three opponents cost 160px against the
     428 the shipped strip cost on the opening and the 793 it reached by turn 1.

     THE ONE STRUCTURAL CLAIM: a shipped seat is a `min-width: max-content` flex
     item in a WRAPPING row, so two pixels of extra chip width flips two seats
     per row to one and a whole seat row appears - 220px of page height, with
     13px of headroom left at 360. A COLLAPSED SEAT IS A FULL-WIDTH ROW. It is
     not sized by its content and there is no wrap decision to make, so the
     mechanism that produced the cliff is GONE rather than avoided.

     A SESSION THAT REVERTS THE STRIP TO THE SHIPPED SEAT INHERITS THE CLIFF
     AGAIN, and the standing rule is not weakened by any of this: nothing
     carrying seat colour may add to a seat's max-content width.

     The strip is a SURFACE and never the wall - a thing made of words and
     numbers. It would matter most if a 14px board were in here; there is not
     one, and the ground is right anyway.
     ========================================================================= */
  .ft-opp-strip {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px;
    background: var(--surface);
    border-radius: 12px;
    align-items: stretch;
    justify-content: flex-start;
  }

  /* DOM order in the strip is seat 3, 2, 4, inherited from the XL grid.
     Collapsed, the strip is a list, and a list is read in seat order. */
  .ft-opp-strip .ft-seat--2 { order: 1; }
  .ft-opp-strip .ft-seat--3 { order: 2; }
  .ft-opp-strip .ft-seat--4 { order: 3; }

  /* :not(.ft-seat--absent) IS LOAD-BEARING (10 August). This is the only rule in
     the file that gives a seat a `display` after .ft-seat--absent has taken it
     away, and at (0,3,0) it beat that rule's (0,1,0) - so in a two- or
     three-player game on a phone the unoccupied seats came back as empty 44px
     rows, each one a tap target for a sheet about a player who is not in the
     game. board.js no longer emits an absent seat at all, which is the actual
     fix; this is the half that stops the next rule to touch a collapsed seat
     from resurrecting one. */
  .ft-opp-strip .ft-seat--opp:not([data-pm-open="1"]):not(.ft-seat--absent) {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    /* THE ROW IS THE TAP TARGET, and 44 is the floor for one. */
    min-height: 44px;
    margin: 0;
    /* 14 leading, for the 4px seat rule inside the row's own padding. */
    padding: 4px 8px 4px 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* CARRIER 1, the seat rule, at the row's leading edge. Collapsed there is no
     board column for it to stand above, so the same 4px of the same ink stands
     at the leading edge instead - a fill inside the row's own padding, so it
     costs no width anybody can measure. The element is the one the seat already
     had; only where it sits changes. */
  .ft-opp-strip .ft-seat--opp .ft-seat__rule {
    position: absolute;
    left: 4px;
    top: 6px;
    bottom: 6px;
    width: 4px;
    height: auto;
    margin: 0;
  }

  /* CARRIERS 2 AND 3 OF AN OPPONENT'S TURN, both at zero layout width: the
     active ring is an `outline`, which sits outside the box model, and the seat
     rule goes 4px to 6px. */
  .ft-opp-strip .ft-seat--opp.ft-panel--active {
    outline: 2px solid var(--seat);
    outline-offset: -2px;
  }

  .ft-opp-strip .ft-seat--opp.ft-panel--active .ft-seat__rule {
    width: 6px;
    height: auto;
  }

  /* The engine's own determinate thinking progress, along the row's bottom edge
     in the seat's ink. Absolutely positioned, so it is outside every width
     calculation, and it is a progress bar rather than a decoration - which is
     why prefers-reduced-motion keeps it. */
  .pm-seat-row__think {
    position: absolute;
    left: 14px;
    right: 8px;
    bottom: 3px;
    height: 2px;
    border-radius: 1px;
    background: var(--seat);
    opacity: 0.35;
    transform-origin: left center;
    transform: scaleX(0);
    pointer-events: none;
  }

  /* WHAT COMES OFF, and the 14px board is the largest of them and the one worth
     arguing about (decision 31). Three tickets measured it as failing: it is
     unreadable at that size, green against blue sits at dE 7.8 for a tritanope
     with no ink to help, and the board's own ground and the wall are dE 1.6
     apart. Removing it RETIRES both colour problems rather than mitigating them,
     and it comes back at 44px in the sheet, where the ink resolves both narrow
     pairs outright. This reverses the collapsed variant that kept the unreadable
     half and threw away the score. */
  .ft-opp-strip .ft-seat--opp:not([data-pm-open="1"]) .ft-cloth,
  .ft-opp-strip .ft-seat--opp:not([data-pm-open="1"]) .ft-stand,
  .ft-opp-strip .ft-seat--opp:not([data-pm-open="1"]) .ft-stand-mini,
  .ft-opp-strip .ft-seat--opp:not([data-pm-open="1"]) .ft-score-total,
  .ft-opp-strip .ft-seat--opp:not([data-pm-open="1"]) .ft-score-breakdown,
  .ft-opp-strip .ft-seat--opp:not([data-pm-open="1"]) .ft-working-area,
  .ft-opp-strip .ft-seat--opp:not([data-pm-open="1"]) .ft-seat__dot,
  .ft-opp-strip .ft-seat--opp:not([data-pm-open="1"]) > .pm-sheet-head,
  /* THE RESERVED CARD. It renders a real 108 x 150 card face inside the seat's
     board column, which is 171px of a 44px row and the only unbounded term in
     the whole layout budget. It is not deleted - it becomes the row's fourth
     readout, a count rather than a card, and the card itself is in the sheet. */
  .ft-opp-strip .ft-seat--opp:not([data-pm-open="1"]) .ft-on-order {
    display: none;
  }

  /* The two columns stop being columns, and both lose their definite
     --board-col-width, which is the whole of the max-content story. */
  .ft-opp-strip .ft-seat--opp:not([data-pm-open="1"]) .ft-seat__board-col {
    order: 1;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    width: auto;
    min-width: 0;
    gap: 0;
  }

  .ft-opp-strip .ft-seat--opp:not([data-pm-open="1"]) .ft-seat__score-col {
    order: 2;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .ft-opp-strip .ft-seat--opp:not([data-pm-open="1"]) .ft-seat__header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    text-align: left;
  }

  /* --type-micro. The seat's name was Fraunces 16 on a panel; on a row it is a
     label beside three figures, and the figures are what carry the voice. */
  .ft-opp-strip .ft-seat--opp:not([data-pm-open="1"]) .ft-panel__title {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* THE READOUTS. One element on the row's trailing side rather than four
     scattered through the seat: the score, the cupcakes, THEIR OWN BOARD FILL,
     a count of any cards on order, and the disclosure.

     Their board fill is the one that earns its place. The rail's board-fill chip
     says how full the FULLEST board is and says nothing about whose; this is the
     complementary half, and it is the only opponent fact that is a clock on
     everybody rather than a fact about that player's score. */
  .ft-opp-strip .ft-seat--opp:not([data-pm-open="1"]) .pm-seat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
  }

  .pm-seat-row__stat {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--ink-soft);
    white-space: nowrap;
  }

  .pm-seat-row__stat--score {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
  }

  .pm-seat-row__stat svg {
    display: block;
    color: var(--accent-deep);
  }

  .pm-seat-row__more {
    display: flex;
    flex: 0 0 auto;
    color: var(--ink-soft);
  }

  /* =========================================================================
     4. ONE OPPONENT, EXPANDED - a tall sheet (plan section 4.5)

     Stage 6's structural trick applied to a seat: NOTHING IS RE-PARENTED. The
     seat leaves the strip by going `position: fixed` where it already sits in
     the DOM, so updateStats keeps rewriting it and every delegated listener
     survives. Its chrome sits INSIDE it as a .pm-sheet-head, which is stage 6's
     convention and the reason there is no floating bar to re-position.

     It is the whole of its own decision - your own board is not part of it - so
     it takes the tall cap, and the point of it is a board at a size that can be
     read.
     ========================================================================= */
  .ft-seat--opp[data-pm-open="1"] {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--pm-dock-bottom);
    /* NEVER translateX(-50%). A transform on a fixed sheet makes it the
       containing block for its own fixed descendants. */
    margin: 0 auto;
    width: 100%;
    max-width: 600px;
    max-height: calc(var(--pm-sheet-tall) + var(--pm-sheet-chrome-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 880;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-md) var(--spacing-md);
    background: var(--surface);
    border: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -6px 20px -6px rgba(var(--shadow-ink), 0.38);
    cursor: default;
    /* THE BOARD COMES BACK AT 44px, AND SO DOES THE INK. This is the whole of
       decision 31. The rung's values are taken by `inherit` rather than retyped:
       the parent chain declares none of them, so each resolves to the :root
       value this band already sets for a 44px board, and the sheet cannot drift
       from the rung it is meant to be drawing. */
    --tile-size: 44px;
    --tile-size-opp: 44px;
    --stand-plate: 24px;
    --cloth-ring: inherit;
    --form-edges: inherit;
    --dent-edges: inherit;
    --plate-size: inherit;
    --plate-body: inherit;
    --plate-edges: inherit;
  }

  .ft-seat--opp[data-pm-open="1"] > .pm-sheet-head {
    display: flex;
    order: 0;
  }

  .ft-seat--opp[data-pm-open="1"] .ft-seat__board-col { order: 1; }
  .ft-seat--opp[data-pm-open="1"] .ft-seat__score-col { order: 2; }
  .ft-seat--opp[data-pm-open="1"] .pm-seat-row { display: none; }

  /* The seat rule keeps a leading edge in the sheet too, so the sheet is still
     visibly that player's. */
  .ft-seat--opp[data-pm-open="1"] .ft-seat__rule {
    position: absolute;
    left: 0;
    top: 16px;
    bottom: auto;
    width: 4px;
    height: 24px;
    margin: 0;
  }

  .ft-seat--opp[data-pm-open="1"] .ft-tile__icon { display: block; }
  .ft-seat--opp[data-pm-open="1"] .ft-stand      { display: block; }
  .ft-seat--opp[data-pm-open="1"] .ft-stand-mini { display: none; }

  /* THE BREAKDOWN COMES BACK TOO. It is display:none for every opponent below
     2181 - three labelled rows are a level of detail for the board you are
     playing rather than for a glance across the table - and this sheet is not a
     glance. It is the one place a player has deliberately asked for that seat in
     full, which is the whole reason for opening it. */
  .ft-seat--opp[data-pm-open="1"] .ft-score-breakdown {
    display: flex;
  }

  /* The sheet's own title says whose seat it is, so the seat header would be the
     same name twice, and the cupcake supply is a readout of controls nobody can
     press - the count is on the row and in the breakdown. */
  .ft-seat--opp[data-pm-open="1"] .ft-seat__header,
  .ft-seat--opp[data-pm-open="1"] .ft-cupcake-supply {
    display: none;
  }
}

/* ===========================================================================
   A FOURTH max-width: 1149px QUERY, and the last block in the file for the same
   reason the two above it sit where they do: @media contributes no specificity,
   so source order is what lets this override them without a single !important.

   THE MARKET IS PINNED WHILE THE SWEEP STEP IS ASKING FOR IT (10 August, Dean's
   iPhone report, third pass).

   THE SYMPTOM, IN HIS WORDS: "when the page first opens the top of the tile
   market is displayed correctly, but after the first time you scroll, the top of
   the tile market disappears under the floating menu."

   THE TWO FIXES BEFORE THIS ONE BOTH TREATED IT AS A SCROLL POSITION - reset the
   page at mount, put the market back when the step begins - and neither could be
   right, because the page is 1,245px against a 739px viewport on his phone and
   the market's top goes under a fixed dock on ANY scroll at all. There is no
   scroll position to find. The market has to stop being scrollable-under while
   it is the thing being asked for.

   SO IT STICKS, and only during the step where it IS the decision. The gutter
   chips are the tap targets of the sweep and they live in the market's top and
   left edges, so a covered market is not merely hard to read - a column sweep
   is unreachable. Pinned at exactly --pm-dock-top, flush under the rail, so no
   sliver of scrolling content shows between the two.

   WHY THE SECTION AND NOT .ft-market-wrap: a sticky element travels only inside
   its own containing block, and the wrap's is the 331px section, which is 41px
   of travel and useless. The section's parents are display:contents, so ITS
   containing block is .ft-game - the whole page - and it can hold the top for
   the entire scroll. Measured: no ancestor of either has overflow other than
   visible, which is the other thing that silently kills a sticky element.

   z-index: 3 CLEARS THE STATIC CONTENT THAT SCROLLS UNDER IT AND NOTHING ELSE.
   The docks are 890 and 900 and the sheets 880, so a sheet still rises over the
   pinned market exactly as it does over everything else, and the sweep dialog is
   appended to document.body rather than inside the section, so it cannot be
   trapped in a stacking context this creates.

   IT IS THE SWEEP STEP ONLY, and that is a budget rather than a preference. The
   market is 290px of a 568px canvas; pinning it through the place step would
   stand it over the board while the board is part of the decision, which is the
   one geometric law the phone model is built on.
   =========================================================================== */
@media (max-width: 1149px) {
  body[data-pm-step="sweep"] .ft-section--tiles {
    position: sticky;
    top: var(--pm-dock-top);
    z-index: 3;
  }
}
