/* Firefly Festival — CSS Design System */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;500;600;700&family=Crimson+Pro:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  /* Colors matching wombatgamefactory.com */
  --bg-dark:      #16130f;
  --bg-card:      #1e1a14;
  --bg-mid:       #211d16;
  --bg-light:     #2c261d;
  --copper:       #c4723a;
  --copper-light: #e09060;
  --gold:         #d4a843;
  --silver:       #9aabb8;
  --cream:        #f0e6d3;
  --text:         #c8bcae;
  --text-muted:   #7a6e60;
  --border:       #352e22;
  --border-light: #4a4035;

  /* Player colors (6 players) */
  --player-red:    #c0392b;
  --player-blue:   #2471a3;
  --player-green:  #1e8449;
  --player-yellow: #d4ac0d;
  --player-purple: #7d3c98;
  --player-orange: #e67e22;

  /* Zone accents — one hue per column so the eye can find a zone at a glance.
     The players column stays neutral silver: the six player colours live
     inside it and must not have to fight a seventh hue. */
  --accent-players: #a9b6c0;   /* silver     — who owns what   */
  --accent-action:  #e0a33c;   /* amber      — where you act   */
  --accent-side:    #4fa87a;   /* jade       — side actions    */
  --accent-goals:   #b07cc9;   /* violet     — goals & scoring */
  --accent-board:   #4a90d9;   /* azure      — the water       */

  /* Zone washes: each column's field, its title bar and the cards inside it */
  --players-bg:       #1d1c1a;
  --players-bg-title: #292725;
  --players-bg-card:  #24221f;

  /* The action column is a filled orange block — it is the one place the
     player acts from, so it should be impossible to look past. */
  --actions-bg:       linear-gradient(180deg, #c9762b 0%, #b0611f 45%, #914c17 100%);
  --actions-bg-solid: #a95a1c;   /* flat stand-in where a gradient can't be used */
  --actions-bg-title: rgba(30, 15, 4, 0.42);
  --actions-bg-card:  rgba(28, 15, 5, 0.80);

  --goals-bg:         #221b2d;
  --goals-bg-title:   #332844;
  --goals-bg-card:    #2e2540;

  /* Island selection — "pick an island" has to read across the room. The board
     art is cyan water + sand + warm green land, so the highlight hue has to be
     something the art never uses: firefly lime. The worker-source variant is a
     hot spring-green, still far brighter than the art's own greens. */
  --select-lime:      #d4ff2e;
  --select-lime-soft: rgba(212, 255, 46, 0.16);
  --select-mint:      #3dffa0;
  --select-mint-soft: rgba(61, 255, 160, 0.16);

  /* Deep water behind the map, sampled from the board's own water tile */
  --water:        #006adc;
  --water-deep:   #0b3f78;
  --water-abyss:  #061f3c;

  /* Player washes — each player's own colour, sunk into the dark field */
  --player-red-tint:    #4a241b;
  --player-blue-tint:   #223946;
  --player-green-tint:  #204027;
  --player-yellow-tint: #4a3d15;
  --player-purple-tint: #3e2740;
  --player-orange-tint: #543619;

  /* Sizing & spacing */
  --tile-size:    60px;
  --pstat-icon:   66px;   /* player-stat icon; steps down on narrow screens */
  --tile-gap:     2px;
  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --spacing-xs:   4px;
  --spacing-sm:   8px;
  --spacing-md:   12px;
  --spacing-lg:   16px;
  --spacing-xl:   20px;

  /* Effects */
  --shadow-card:       0 2px 8px rgba(61, 43, 31, 0.12);
  --shadow-card-hover: 0 4px 12px rgba(61, 43, 31, 0.16);
}

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

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Crimson Pro', serif;
  font-size: 18px;
  line-height: 1.7;
  background: var(--bg-dark);
  color: var(--text);
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cream);
}

h1 {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-lg);
}

h2 {
  font-size: 1.8rem;
  margin-bottom: var(--spacing-md);
}

h3 {
  font-size: 1.2rem;
  margin-bottom: var(--spacing-sm);
}

/* Buttons */
button {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: var(--spacing-md) var(--spacing-lg);
  border: none;
  border-radius: var(--radius-md);
  background: var(--copper);
  color: var(--cream);
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  background: var(--copper-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(196, 114, 58, 0.3);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.5;
}

/* Input fields */
input[type="text"],
input[type="number"],
select {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 8px rgba(196, 114, 58, 0.3);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--copper);
  box-shadow: var(--shadow-card-hover), 0 0 12px rgba(196, 114, 58, 0.2);
}

/* Flex utilities */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* Game container: player details · actions · map · goals */
.ff-game {
  display: grid;
  grid-template-columns: 270px 255px minmax(0, 1fr) 280px;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  height: 100%;
  overflow: hidden;
}

@media (max-width: 1500px) {
  .ff-game {
    grid-template-columns: 225px 220px minmax(0, 1fr) 235px;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
  }

  :root {
    --pstat-icon: 50px;
  }
}

/* ---------------------------------------------------------------------------
   Tablets — four columns on an iPad leave the map a letterbox. Below 1400px the
   action column stops being a column: it unwraps into a strip under the board,
   and every pixel that buys goes to the map.
   --------------------------------------------------------------------------- */

/* Landscape: player details and goals still flank the map, actions run beneath */
@media (max-width: 1400px) and (orientation: landscape) {
  .ff-game {
    grid-template-columns: 200px minmax(0, 1fr) 215px;
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "players board   goals"
      "actions actions actions";
  }
}

/* Portrait: nothing flanks the map — it takes the full width, the action strip
   sits under it, and the two reference columns share the space below. */
@media (max-width: 1400px) and (orientation: portrait) {
  .ff-game {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto minmax(150px, 0.5fr);
    grid-template-areas:
      "board   board"
      "actions actions"
      "players goals";
  }
}

/* Below tablet width the two reference columns no longer fit side by side */
@media (max-width: 700px) {
  .ff-game {
    grid-template-columns: minmax(0, 1fr);
    /* Floors go on the TRACKS, never on the panels: every region here is its
       own scroll container, so its automatic minimum size is zero and grid is
       free to squeeze it to nothing and let its contents spill out — and
       .ff-board-area's own `min-height: 0`, which it needs everywhere else,
       beats anything set on the element. With floors on the tracks the rows
       keep their height and .ff-game scrolls. */
    grid-template-rows:
      minmax(45vh, 1fr)
      min-content
      minmax(180px, auto)
      minmax(180px, auto);
    grid-template-areas:
      "board"
      "actions"
      "players"
      "goals";
    overflow-y: auto;
  }
}

@media (max-width: 1400px) {
  .ff-column--players { grid-area: players; }
  .ff-board-area      { grid-area: board; }
  .ff-column--goals   { grid-area: goals; }
  .ff-column--actions { grid-area: actions; }
}

/* The strip's own styling is at the very foot of this file: it restyles the
   action column, and those desktop rules come later, at equal specificity. */

/* Board area — the map now owns the full height of the page */
.ff-board-area {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* Open water: the frame around the map carries on the board's own blue, so the
   map dissolves into deeper sea rather than stopping at a black edge. */
.ff-board-svg {
  flex: 1;
  width: 100%;
  min-height: 0;
  background:
    radial-gradient(ellipse at center,
      #0e59a2 0%,
      var(--water-deep) 35%,
      var(--water-abyss) 88%);
  border: 2px solid var(--accent-board);
  border-radius: var(--radius-md);
  overflow: visible;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.45),
    inset 0 0 60px rgba(0, 106, 220, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Board background and overlay. The shadow softens the map's hard rectangular
   edge into the open water around it. */
.ff-board-background {
  width: 100%;
  position: relative;
  transform-origin: top center;
  box-shadow: 0 0 26px 10px rgba(6, 31, 60, 0.55);
  /* aspect-ratio is set inline by renderBoard */
}

.ff-board-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  perspective: 1000px;
}

/* The overlay is the island's 3×3 click target and its highlight; the island
   itself is painted art underneath, which carries its own shadow. A shadow
   here too would draw a square outline around a round-cornered island. */
.ff-island-overlay {
  transition: all 0.2s ease;
  border-radius: 12%;
}

/* A selectable island wears a thick lime ring, a lime wash and a slow pulse.
   The ring is drawn with box-shadow rather than `border` so it can't shift the
   overlay off the art it is outlining. */
.ff-island-overlay--selectable,
.ff-island-overlay--has-worker {
  background: var(--select-lime-soft) !important;
  box-shadow:
    inset 0 0 0 5px var(--select-lime),
    inset 0 0 18px rgba(212, 255, 46, 0.3),
    0 0 20px 5px rgba(212, 255, 46, 0.55);
  animation: ff-select-pulse 1.5s ease-in-out infinite;
}

.ff-island-overlay--selectable:hover,
.ff-island-overlay--has-worker:hover {
  background: rgba(212, 255, 46, 0.45) !important;
  box-shadow:
    inset 0 0 0 7px #ffffff,
    inset 0 0 32px rgba(212, 255, 46, 0.7),
    0 0 34px 12px rgba(212, 255, 46, 0.85);
  animation: none;
}

/* Islands holding one of your own workers — the pick-a-worker half of move /
   bridge / recruit. Same loudness, different hue, so "take from here" never
   gets confused with "put it there". */
.ff-island-overlay--has-worker {
  background: var(--select-mint-soft) !important;
  box-shadow:
    inset 0 0 0 5px var(--select-mint),
    inset 0 0 18px rgba(61, 255, 160, 0.28),
    0 0 20px 5px rgba(61, 255, 160, 0.5);
  animation-name: ff-select-pulse-mint;
}

.ff-island-overlay--has-worker:hover {
  background: rgba(61, 255, 160, 0.42) !important;
  box-shadow:
    inset 0 0 0 7px #ffffff,
    inset 0 0 32px rgba(61, 255, 160, 0.65),
    0 0 34px 12px rgba(61, 255, 160, 0.8);
}

/* The island already chosen as the source of a bridge or a move: locked in,
   so it holds a steady white-gold ring instead of begging for a click. */
.ff-island-overlay--source {
  background: rgba(255, 232, 150, 0.3) !important;
  box-shadow:
    inset 0 0 0 6px var(--gold),
    inset 0 0 28px rgba(255, 214, 110, 0.5),
    0 0 26px 8px rgba(212, 168, 67, 0.65);
  animation: none !important;
}

@keyframes ff-select-pulse {
  0%, 100% {
    box-shadow:
      inset 0 0 0 5px var(--select-lime),
      inset 0 0 18px rgba(212, 255, 46, 0.3),
      0 0 20px 5px rgba(212, 255, 46, 0.55);
  }
  50% {
    box-shadow:
      inset 0 0 0 5px #f2ff9e,
      inset 0 0 24px rgba(212, 255, 46, 0.45),
      0 0 32px 11px rgba(212, 255, 46, 0.9);
  }
}

@keyframes ff-select-pulse-mint {
  0%, 100% {
    box-shadow:
      inset 0 0 0 5px var(--select-mint),
      inset 0 0 18px rgba(61, 255, 160, 0.28),
      0 0 20px 5px rgba(61, 255, 160, 0.5);
  }
  50% {
    box-shadow:
      inset 0 0 0 5px #b6ffdc,
      inset 0 0 24px rgba(61, 255, 160, 0.42),
      0 0 32px 11px rgba(61, 255, 160, 0.85);
  }
}

/* Contrast does half the work: while a choice is open, every island that is
   NOT part of it sinks into the night. */
.ff-island-overlay--dimmed {
  background: rgba(4, 10, 20, 0.62) !important;
}

@media (prefers-reduced-motion: reduce) {
  .ff-island-overlay--selectable,
  .ff-island-overlay--has-worker {
    animation: none;
  }
}

/* An island that is NOT a legal target for the open action but is still worth
   a click, because the player deserves the reason (B4: pagodas may never go on
   a start island; B1/B2: the four festival requirements). Reads as barred, not
   as inviting — but the cursor stays a pointer so it is clearly clickable. */
.ff-island-overlay--illegal {
  background: rgba(140, 30, 30, 0.18) !important;
  border: 2px dashed rgba(226, 114, 91, 0.55) !important;
}

/* ---------------------------------------------------------------------------
   Festival-ready islands
   ---------------------------------------------------------------------------
   An island where somebody — anybody — could call a festival right now. It is
   the one thing on the map worth spotting from across the table, but it is a
   STATE, not a prompt: it may be an opponent's festival, and it may not be
   callable this turn. So it breathes slowly in lantern gold rather than
   flashing, and it never draws a ring.

   The halo lives on a pseudo-element for a reason. The action modes paint their
   own selection rings onto the overlay's own `box-shadow` and `animation`, and
   an island that is both festival-ready and a legal target has to wear both at
   once — sharing either property would mean one silently erasing the other.

   Gold is deliberate: the lime/mint/red of the action modes all mean "act on
   this now", and the festival glow must not be mistaken for one of them.
   --------------------------------------------------------------------------- */
.ff-island-overlay--festival-ready::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  animation: ff-festival-glow 2.6s ease-in-out infinite;
}

/* Three layers, because the board underneath is bright cyan water and a single
   soft shadow simply dissolved into it: a tight bright lip that keeps the
   island's edge legible, a mid bloom, and a wide warm haze that carries across
   the table. Even the trough of the pulse has to read as lit. */
@keyframes ff-festival-glow {
  0%, 100% {
    box-shadow:
      0 0 0 3px rgba(255, 231, 150, 0.55),
      0 0 18px 6px rgba(255, 196, 74, 0.65),
      0 0 44px 18px rgba(255, 166, 32, 0.34);
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(255, 243, 196, 0.9),
      0 0 32px 12px rgba(255, 222, 130, 0.95),
      0 0 72px 30px rgba(255, 176, 40, 0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  /* Held near the bright end — the island still has to stand out. */
  .ff-island-overlay--festival-ready::before {
    animation: none;
    box-shadow:
      0 0 0 4px rgba(255, 237, 172, 0.75),
      0 0 26px 9px rgba(255, 210, 105, 0.82),
      0 0 58px 24px rgba(255, 172, 36, 0.45);
  }
}

.ff-island-overlay--illegal:hover {
  background: rgba(140, 30, 30, 0.3) !important;
  border-color: #e2725b !important;
  box-shadow: 0 0 10px rgba(226, 114, 91, 0.5);
}

.ff-bridge-line {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* ---------------------------------------------------------------------------
   Coloured columns — players (steel blue), actions (amber), goals (violet).
   Each column carries its accent in --column-accent, so its title, border and
   highlights all pull from one place.
   --------------------------------------------------------------------------- */

.ff-column {
  --column-accent: var(--border-light);
  --column-bg: var(--bg-card);
  --column-bg-title: var(--bg-mid);
  --column-card: var(--bg-mid);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: var(--spacing-sm);
  background: var(--column-bg);
  border: 2px solid var(--column-accent);
  border-radius: var(--radius-md);
  overflow-y: auto;
  overflow-x: hidden;
}

.ff-column--players {
  --column-accent: var(--accent-players);
  --column-bg: var(--players-bg);
  --column-bg-title: var(--players-bg-title);
  --column-card: var(--players-bg-card);
}

.ff-column--actions {
  --column-accent: #ffd489;
  --column-bg: var(--actions-bg);
  --column-bg-title: var(--actions-bg-title);
  --column-card: var(--actions-bg-card);
}

.ff-column--goals {
  --column-accent: var(--accent-goals);
  --column-bg: var(--goals-bg);
  --column-bg-title: var(--goals-bg-title);
  --column-card: var(--goals-bg-card);
}

.ff-column-title {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 0 0 var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-align: center;
  color: var(--column-accent);
  background: var(--column-bg-title);
  border-bottom: 2px solid var(--column-accent);
}

.ff-column-body {
  padding: 0 var(--spacing-md);
}

/* Sub-headings inside a column pick up that column's accent */
.ff-column-body h3 {
  font-size: 0.85rem;
  color: var(--column-accent);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--column-accent);
}

/* Player panel — washed in that player's own colour, so the six players are
   told apart by their field and not just by the name at the top */
.ff-player-panel {
  background:
    linear-gradient(160deg, var(--player-tint, var(--bg-mid)) 0%, var(--column-card) 85%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--player-accent, var(--border-light));
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  font-size: 0.9rem;
}

.ff-player-panel--active {
  background: var(--player-tint, var(--bg-mid));
  border-color: var(--player-accent, var(--accent-players));
  box-shadow: 0 0 14px -2px var(--player-accent, transparent);
}

.ff-player-panel h4 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--spacing-sm);
  font-size: 1rem;
  margin-bottom: var(--spacing-sm);
  /* Let the seat / "on turn" tags drop to a second row rather than squeezing the
     name into two lines — see .ff-player-name. */
  flex-wrap: wrap;
  row-gap: 4px;
}

/* Player stats as icon chips: the board's own art, the count, and the word.
   Two across / three down, so each piece of art is big enough to read as the
   component it is rather than as a bullet point. */
.ff-player-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-xs);
}

.ff-pstat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "icon value"
    "label label";
  align-items: center;
  gap: 0 var(--spacing-xs);
  padding: var(--spacing-xs);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.ff-pstat-icon {
  grid-area: icon;
  width: var(--pstat-icon);
  height: var(--pstat-icon);
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}

.ff-pstat-value {
  grid-area: value;
  font-family: 'Oswald', sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
  text-align: right;
  color: var(--cream);
}

.ff-pstat-label {
  grid-area: label;
  font-family: 'Oswald', sans-serif;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
  color: #93867a;
}

/* The score is the number that decides the game — give it the gold */
.ff-pstat--score .ff-pstat-value {
  color: var(--gold);
}

.ff-player-panel--active .ff-pstat-label {
  color: var(--text);
}

.ff-player-turn-tag {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--accent-players);
  color: #10161b;
}

/* Who is playing this seat. Outlined rather than filled so it reads as a
   standing label and never competes with the solid "on turn" tag beside it.
   `margin-right: auto` keeps it tucked against the name and pushes "on turn"
   out to the right edge of the h4. */
/* Who is driving a seat — Human / Easy Bot / Hard Bot. Drawn in the player panel
   all game (.ff-player-seat) and again on the end screen (.ff-score-seat), where
   the question "did the good bot win?" is the whole point of reading the table.
   One look, two placements: only the margin differs, so the badge cannot drift
   between the two screens. */
.ff-player-seat,
.ff-score-seat {
  font-size: 0.58rem;      /* .ff-score-seat overrides this with an em size */
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 1px 6px;
  border-radius: 8px;
  border: 1px solid currentColor;
  opacity: 0.85;
}

/* Pushes the "on turn" tag to the far end of the panel heading. End-screen lines
   have their own layout, so the badge sits tight against the name there. */
.ff-player-seat {
  margin-right: auto;
}

.ff-score-seat {
  display: inline-block;
  vertical-align: 0.12em;
  margin-left: 6px;
  /* `em`, not `rem`: this badge appears both on a 0.95rem score line and inside
     the 1.5rem winner headline, and a fixed size that suits one looks like a typo
     in the other. Relative to its line it is the same badge in both places. */
  font-size: 0.62em;
  font-weight: 500;
}

.ff-player-seat--human,
.ff-score-seat--human { color: var(--cream); }
.ff-player-seat--easy,
.ff-score-seat--easy  { color: #93867a; }
.ff-player-seat--hard,
.ff-score-seat--hard  { color: var(--gold); }

/* Name and Crow token as one unit, so the token cannot be pushed onto a line of
   its own and the name still wraps inside the panel the way it always did. */
.ff-player-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  /* The panel is narrow enough that "Player 2" + the seat tag + "on turn" is
     already a squeeze, and the h4 resolves that by wrapping the NAME. A token
     stranded beside "Player" with the "2" under it reads as part of the name, so
     the name is kept on one line and the row is allowed to wrap below it
     instead — the tags are self-describing wherever they land. */
  white-space: nowrap;
}

/* A player who owns fewer fish than the printed ladder is long carries an "of N"
   note beside their supply count, because that is public and matters to everyone
   at the table. Only drawn when it is true — BAL-17 deleted the rule that could
   lower a player's maximum, so it is not drawn at all today. */
.ff-pstat--fish:has(.ff-pstat-note),
.ff-pstat--workers:has(.ff-pstat-note) {
  /* The label gives up the full-width bottom row so the note can sit beside it.
     Every other stat keeps the two-row "icon value / label" layout. */
  grid-template-areas:
    "icon  value"
    "label note";
}

.ff-pstat--fish:has(.ff-pstat-note) .ff-pstat-label,
.ff-pstat--workers:has(.ff-pstat-note) .ff-pstat-label {
  text-align: left;
}

/* Race mode: workers sitting on goal cards are not lost, just spent - gold, not warning red */
.ff-pstat--workers .ff-pstat-note {
  color: var(--gold);
  white-space: nowrap;
}

.ff-pstat-note {
  grid-area: note;
  justify-self: right;
  font-family: 'Oswald', sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
  color: #e2725b;
}

.ff-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xs);
  font-size: 0.85rem;
}

.ff-stat-label {
  color: var(--text-muted);
}

.ff-stat-value {
  color: var(--gold);
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Goal Zone — the lower board: public goal stacks, private goal hand, the
   Crow's space and the Lucky Fish track.
   --------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   Goal Zone sections. Public goals, private goals and the Crow are three
   different ways to score and they used to run together as one undifferentiated
   column of cards. Each is now a banded section with its own colour and its own
   piece of art, so "where are my private goals" is answered at a glance.
   --------------------------------------------------------------------------- */

.ff-goal-section {
  /* Light fields, one distinct hue each — three physical card types laid out on
     the violet mat, rather than three shades of the same dark panel. */
  --sec-field:    #f2e6c8;   /* the section's own paper   */
  --sec-card:     #fdf7e6;   /* a card sitting on it      */
  --sec-edge:     #b98b2e;   /* rules and borders         */
  --sec-ink:      #33260c;   /* headings and numbers      */
  --sec-ink-soft: #6a5730;   /* body text and captions    */
  position: relative;
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm);
  background: var(--sec-field);
  border: 2px solid var(--sec-edge);
  border-radius: var(--radius-md);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  color: var(--sec-ink);
}

/* Public — the gold of the ingot */
.ff-goal-section--public {
  --sec-field:    #f4e3ae;
  --sec-card:     #fdf6dd;
  --sec-edge:     #b8860b;
  --sec-ink:      #3b2a05;
  --sec-ink-soft: #6d5716;
}

/* Private — the rust of the bronze vessel */
.ff-goal-section--private {
  --sec-field:    #f3d2c4;
  --sec-card:     #fdeee7;
  --sec-edge:     #b0503a;
  --sec-ink:      #43180d;
  --sec-ink-soft: #7d4231;
}

/* End game — jade. The field is matched in lightness to the public gold rather
   than picked by eye: three sections at the same value read as three cards on
   the same mat, and a green that sat darker would read as disabled instead. */
.ff-goal-section--endgame {
  --sec-field:    #d5e9c8;
  --sec-card:     #eef8e6;
  --sec-edge:     #4e8b46;
  --sec-ink:      #14300f;
  --sec-ink-soft: #3d5c38;
}

/* ---- Everything inside a section flips to dark ink on the light field ---- */

.ff-goal-section .ff-goal-stack,
.ff-goal-section .ff-private-goal {
  background: var(--sec-card);
  border-color: var(--sec-edge);
  color: var(--sec-ink-soft);
}

.ff-goal-section .ff-goal-stack-name,
.ff-goal-section .ff-goal-need,
.ff-goal-section .ff-endgame-count,
.ff-goal-section .ff-fest-bonus-vp {
  color: var(--sec-ink);
}

.ff-goal-section .ff-goal-stack-text,
.ff-goal-section .ff-goal-have,
.ff-goal-section .ff-goal-slash,
.ff-goal-section .ff-goal-unit,
.ff-goal-section .ff-goal-aside,
.ff-goal-section .ff-goal-remaining,
.ff-goal-section .ff-goal-zone-note,
.ff-goal-section .ff-endgame-unit,
.ff-goal-section .ff-endgame-note,
.ff-goal-section .ff-fest-bonus-label,
.ff-goal-section .ff-fest-bonus-note,
.ff-goal-section .ff-fest-rung,
.ff-goal-section .ff-placeholder-note {
  color: var(--sec-ink-soft);
}

/* The live rung keeps its gold and its own dark ink — the point of it is that it
   is the one thing in the box that is NOT the section's palette. */
.ff-goal-section .ff-fest-rung--next {
  color: #2b1f08;
}

.ff-goal-section .ff-goal-vp {
  color: #9a6b06;
}

.ff-goal-section .ff-goal-progress-bar {
  background: rgba(0, 0, 0, 0.10);
  border-color: rgba(0, 0, 0, 0.18);
}

.ff-goal-section .ff-goal-progress-bar > span {
  background: var(--sec-edge);
}

.ff-goal-section .ff-goal-progress-bar > span.ff-goal-progress-fill--met {
  background: #1b8f52;
}

/* Met / not-yet badges, redrawn for a light card */
.ff-goal-section .ff-goal-badge--met {
  background: #1b8f52;
  border-color: #14663a;
  color: #f2fff7;
}

.ff-goal-section .ff-goal-badge--unmet,
.ff-goal-section .ff-goal-badge--spent {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.28);
  color: var(--sec-ink-soft);
}

.ff-goal-section .ff-goal-stack--met {
  border-left-color: #1b8f52;
  box-shadow: none;
}

.ff-goal-section .ff-goal-stack--claimable {
  background: #dff5e6;
  border-color: #1b8f52;
}

.ff-goal-section .ff-goal-stack--claimable:hover {
  background: #c6ecd4;
  box-shadow: 0 0 12px rgba(27, 143, 82, 0.5);
}

.ff-goal-section .ff-private-goal--met {
  border-color: #1b8f52;
}

.ff-goal-section-head {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: 0 0 var(--spacing-xs);
  padding-bottom: var(--spacing-xs);
  border-bottom: 2px solid var(--sec-edge);
}

.ff-goal-section-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

/* The seal is a tall, narrow piece — 1:2 where the two goal icons are close to
   square. Given the 30px square slot it would come out a 15px sliver, so it
   gets its own box and stands a little above the rule instead. */
.ff-goal-section-icon--sorin {
  width: 21px;
  height: 40px;
}

.ff-goal-section-title {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  line-height: 1.2;
  color: var(--sec-ink);
}

.ff-goal-section-tag {
  margin-left: auto;
  flex-shrink: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 8px;
  color: var(--sec-card);
  background: var(--sec-edge);
  border: 1px solid var(--sec-edge);
}

/* Cards inside a section keep that section's edge, so a card is always
   traceable back to which kind of goal it is */
.ff-goal-section .ff-goal-stack {
  border-left: 3px solid var(--sec-edge);
}

.ff-goal-zone-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: var(--spacing-sm);
}

/* Four of these have to fit a 280px column beside everything else in the
   panel, so the card is tight: the gutters are the smallest that still read as
   a card sitting on the section's paper rather than printed onto it. */
.ff-goal-stack {
  background: var(--column-card, var(--bg-mid));
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 6px var(--spacing-sm) 7px;
  margin-bottom: 6px;
  font-size: 0.8rem;
  line-height: 1.3;
}

.ff-goal-stack--met {
  border-left-color: #2fd07a;
  box-shadow: 0 0 8px rgba(47, 208, 122, 0.18);
}

.ff-goal-stack--unmet {
  border-left-color: var(--border-light);
}

.ff-goal-stack--spent {
  opacity: 0.5;
}

/* Clickable only while the Public Goal action mode is open */
.ff-goal-stack--claimable {
  cursor: pointer;
  border-color: #2fd07a;
  background: rgba(47, 208, 122, 0.08);
}

.ff-goal-stack--claimable:hover {
  background: rgba(47, 208, 122, 0.18);
  box-shadow: 0 0 12px rgba(47, 208, 122, 0.4);
}

.ff-goal-stack-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

.ff-goal-stack-name {
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream);
}

.ff-goal-badge {
  font-family: 'Oswald', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 1px 6px;
  border-radius: 8px;
  white-space: nowrap;
}

.ff-goal-badge--met {
  background: rgba(47, 208, 122, 0.2);
  border: 1px solid #2fd07a;
  color: #6fe7a8;
}

.ff-goal-badge--unmet {
  background: rgba(20, 18, 15, 0.6);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}

.ff-goal-badge--spent {
  background: rgba(20, 18, 15, 0.6);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}

.ff-goal-stack-text {
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.25;
  margin: 2px 0 0;
}

.ff-goal-stack-target {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-sm);
  margin: 2px 0;
}

.ff-goal-vp {
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
}

/* --- the readout: "5 / 8 coins", one line ---
   Weight is the label here. The target is the figure the card is asking for,
   so it keeps the size the old standalone threshold had; the count beside it
   is what you hold, at body size; the unit is a caption. Baseline alignment is
   what stops three type sizes on one line reading as three separate rows. */
.ff-goal-readout {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin: 3px 0 0;
}

.ff-goal-have {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}

.ff-goal-slash {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1;
}

.ff-goal-need {
  font-family: 'Oswald', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cream);
  line-height: 1;
}

.ff-goal-unit {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* "best 4" on the x2 cards — real information, but the least of it, so it is
   pushed to the far end rather than sitting in the middle of the count. */
.ff-goal-aside {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.85;
}

/* --- the meter row: bar · cards left · VP ---
   Three readings that used to take three lines. The bar is the only elastic
   one, so it absorbs whatever the two labels leave. */
.ff-goal-meter {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: 5px;
}

.ff-goal-progress-bar {
  flex: 1;
  min-width: 48px;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  overflow: hidden;
}

.ff-goal-progress-bar > span {
  display: block;
  height: 100%;
  background: var(--copper);
}

.ff-goal-progress-bar > span.ff-goal-progress-fill--met {
  background: #2fd07a;
}

/* Both labels are fixed-width anchors for the elastic bar, so neither may wrap
   — a wrapped "3 VP" would put the row back to two lines. */
.ff-goal-meter .ff-goal-remaining {
  font-size: 0.68rem;
  white-space: nowrap;
}

.ff-goal-meter .ff-goal-vp {
  font-size: 0.78rem;
  white-space: nowrap;
}

.ff-goal-reward {
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--copper-light);
  border: 1px solid var(--copper);
  border-radius: var(--radius-sm);
  padding: 0 5px;
}

.ff-goal-remaining {
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   End-game trigger card. Same chrome as a goal stack — it is a card on the
   same mat — but the count is the headline of the whole panel, so it carries
   display type nothing else in the column comes near.
   --------------------------------------------------------------------------- */

.ff-endgame-card {
  padding: 7px var(--spacing-sm) 8px;
  margin-bottom: 0;
}

.ff-endgame-readout {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
}

.ff-endgame-count {
  font-family: 'Oswald', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 0.85;
  color: var(--cream);
}

.ff-endgame-unit {
  font-family: 'Oswald', sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The pips are to the count what the bar is to a goal readout: they say how
   much of the game is spent without putting a second number on the card. */
.ff-sorin-pips {
  display: flex;
  align-items: flex-end;
  /* Never wrap. The supply is ONE track, and fifteen seals broken over two
     rows read as two separate things. */
  flex-wrap: nowrap;
  gap: 3px;
  margin: 7px 0 6px;
}

/* The supply runs 6 seals at two players to 15 at six, in a column that is
   270px on a desktop and 215px on a tablet, so the row has to survive both
   ends. `flex-basis` with shrink sizes the seals to whatever the column
   actually is — full size when there is room, smaller when there is not —
   without a breakpoint per layout. `contain` keeps them from distorting as
   they narrow, and `object-position: bottom` stands them on a common floor
   rather than floating them in the middle of a fixed-height box. */
.ff-sorin-pip {
  flex: 0 1 11px;
  min-width: 0;
  height: 22px;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

/* Spent seals hold their slot rather than vanishing — a row that shortens as
   it empties reads as a list, not as a track running out. */
.ff-sorin-pip--spent {
  opacity: 0.3;
  filter: grayscale(1) brightness(0.85);
}

/* --- Sōrin Bonus ladder (Dean, 7 August 2026) -----------------------------
   Sits between the seal pips and the end-game note, inside the same card,
   because it is the same clock read a second way. A rule above it separates the
   two readings without making it look like a second panel. */
.ff-fest-bonus {
  margin: 7px 0 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.14);
}

.ff-fest-bonus-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.ff-fest-bonus-label {
  font-family: 'Oswald', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ff-fest-bonus-vp {
  font-family: 'Oswald', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  color: var(--cream);
  white-space: nowrap;
}

/* The end of the ladder is a real state, not a zero to be read past. */
.ff-fest-bonus-vp--none {
  font-size: 0.8rem;
  opacity: 0.65;
  font-style: italic;
}

/* One rung per festival, laid out like the pips above: never wrapping, shrinking
   instead, so the ladder stays one track at any column width. */
.ff-fest-rungs {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 2px;
  margin: 5px 0 4px;
}

.ff-fest-rung {
  flex: 1 1 0;
  min-width: 0;
  padding: 2px 0;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.13);
  font-family: 'Oswald', sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}

/* Spent rungs hold their slot and grey out, matching .ff-sorin-pip--spent. */
.ff-fest-rung--spent {
  opacity: 0.32;
  text-decoration: line-through;
}

/* The only rung with colour: the one the next festival will actually take. */
.ff-fest-rung--next {
  background: var(--gold, #c8a33a);
  color: #2b1f08;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.ff-fest-bonus-note {
  font-size: 0.62rem;
  line-height: 1.3;
  font-style: italic;
  opacity: 0.85;
}

.ff-endgame-note {
  font-size: 0.66rem;
  line-height: 1.3;
  font-style: italic;
}

/* Last seal on the table. The section keeps its jade — the box is a fixture
   whose position the player has learned, and the moment it matters most is the
   wrong moment to make them re-find it — so the warning lands on the count. */
.ff-goal-section .ff-endgame-card--urgent {
  border-left-color: #c0392b;
}

.ff-goal-section .ff-endgame-card--urgent .ff-endgame-count {
  color: #a5281a;
}

.ff-goal-section .ff-goal-badge--urgent {
  background: #c0392b;
  border: 1px solid #8e2a1f;
  color: #fff2ef;
}

/* Private goal hand */
.ff-private-goal {
  background: var(--column-card, var(--bg-mid));
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  font-size: 0.8rem;
}

/* A private goal whose condition is currently satisfied */
.ff-private-goal--met {
  border-style: solid;
  border-color: #2fd07a;
}

/* Lucky Fish tracks — one 3/5/7 ladder PER PLAYER (R1), not one shared strip */
.ff-fish-player-track {
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-xs) 2px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
}

.ff-fish-player-track--active {
  border-color: var(--copper);
  background: rgba(196, 114, 58, 0.08);
}

.ff-fish-player-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--spacing-xs);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.ff-fish-player-state {
  font-weight: 400;
  font-size: 0.66rem;
  color: var(--text-muted);
}

.ff-fish-track {
  display: flex;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
}

.ff-fish-slot {
  flex: 1;
  text-align: center;
  padding: var(--spacing-xs);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--column-card, var(--bg-mid));
}

.ff-fish-slot--next {
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.25);
}

.ff-fish-slot--taken {
  background: var(--bg-mid);
  opacity: 0.8;
}

/* A rung this player cannot reach, because they do not own the fish that would
   sit on it. Struck through rather than hidden — the printed ladder is the same
   for everyone and what changes is how far up it they can climb, so the row keeps
   its width and the loss stays visible. Unreachable since BAL-17; kept so the
   ladder stays honest if a player's fish count is ever variable again. */
.ff-fish-slot--gone {
  opacity: 0.45;
  border-style: dashed;
}

.ff-fish-slot--gone .ff-fish-slot-cost {
  color: var(--text-muted);
  text-decoration: line-through;
}

.ff-fish-slot-cost {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.ff-fish-slot-cost span {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.ff-fish-slot-owner {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Claim lists inside the side-action panels */
.ff-claim-list {
  list-style: none;
  margin: 0 0 var(--spacing-sm) 0;
  padding: 0;
  font-size: 0.85rem;
}

.ff-claim-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.ff-claim-row:last-child {
  border-bottom: none;
}

.ff-claim-row--spent {
  opacity: 0.45;
}

.ff-claim-name {
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.05em;
  color: var(--cream);
  min-width: 8em;
}

.ff-claim-name em {
  color: var(--gold);
  font-style: normal;
}

/* The card's printed requirement, e.g. "Have a pagoda floor on level 5" */
.ff-claim-text {
  flex: 1 1 100%;
  font-size: 0.76rem;
  color: var(--text);
}

.ff-claim-detail {
  flex: 1;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: baseline;
  gap: var(--spacing-sm);
}

.ff-claim-row--met .ff-claim-detail {
  color: var(--text);
}

.ff-claim-buttons {
  display: flex;
  gap: var(--spacing-xs);
}

/* "FREE" flag on an action button backed by a pending entitlement */
.ff-action-button--bonus {
  position: relative;
  border-color: var(--gold) !important;
  box-shadow: 0 0 10px rgba(212, 168, 67, 0.35);
}

.ff-action-bonus-flag {
  position: absolute;
  top: 2px;
  right: 2px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0 4px;
  border-radius: 6px;
  background: var(--gold);
  color: #16130f;
}

.ff-goal-card {
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm);
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.4;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ============================================================
   Splash / setup screen
   ============================================================ */

.ff-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.ff-setup {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100%;
  padding: clamp(16px, 4vh, 48px) var(--spacing-xl) 40px;
  background: var(--bg-dark);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Night-festival photo, pushed right back so it reads as atmosphere, not content */
.ff-setup__sky {
  position: fixed;
  /* Slight overscan so the artwork's own painted border can never reach an
     edge, whatever the viewport aspect ratio. */
  inset: -3%;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(212, 168, 67, 0.16), transparent 62%),
    linear-gradient(180deg, rgba(22, 19, 15, 0.78) 0%, rgba(22, 19, 15, 0.93) 55%, var(--bg-dark) 100%),
    url('images/splash_bg.jpg') center 22% / cover no-repeat;
  z-index: 0;
  pointer-events: none;
}

/* --- drifting fireflies --- */
.ff-setup__motes {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.ff-firefly {
  position: absolute;
  left: var(--x);
  bottom: -12px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px 2px rgba(212, 168, 67, 0.75);
  opacity: 0;
  animation: ff-rise calc(var(--dur) * 2.6) linear var(--delay) infinite;
}

@keyframes ff-rise {
  0%   { transform: translate(0, 0) scale(0.7); opacity: 0; }
  12%  { opacity: 0.9; }
  50%  { transform: translate(28px, -46vh) scale(1); opacity: 0.65; }
  88%  { opacity: 0.5; }
  100% { transform: translate(-14px, -96vh) scale(0.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ff-firefly { animation: none; opacity: 0.5; }
}

.ff-setup__stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- hero art (the title is part of the artwork) --- */
.ff-setup__hero {
  width: 100%;
  margin: 0 0 var(--spacing-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(212, 168, 67, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 18px 50px rgba(0, 0, 0, 0.75),
    0 0 90px rgba(212, 168, 67, 0.14);
}

.ff-setup__hero img {
  display: block;
  width: 100%;
  height: auto;
}

/* The sell-sheet hook line. Given room to breathe — it does the most work
   of any text on the page. */
.ff-setup__hook {
  max-width: 32rem;
  margin: 0 0 var(--spacing-xl);
  text-align: center;
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  line-height: 1.4;
  color: var(--cream);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
}

/* --- box-back style stat strip --- */
.ff-setup__facts {
  display: flex;
  gap: var(--spacing-xl);
  list-style: none;
  margin: 0 0 var(--spacing-xl);
  padding: 0 0 var(--spacing-lg);
  border-bottom: 1px solid var(--border);
  width: 100%;
  justify-content: center;
}

.ff-setup__facts li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ff-setup__facts strong {
  font-family: 'Oswald', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
}

.ff-setup__facts span {
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

/* --- the configuration card --- */
.ff-setup__panel {
  width: 100%;
  background: rgba(30, 26, 20, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.ff-setup__hint {
  margin: var(--spacing-md) 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Rulebook, under the one call to action. Outlined and the same size as Start
   Game so it is impossible to miss, but hollow rather than lantern-gold-filled:
   Start Game stays the only thing pulling the first click. */
.ff-setup__rules-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  width: 100%;
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--gold);
  background: rgba(12, 18, 30, 0.35);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  transition: background 0.15s ease, color 0.15s ease;
}

.ff-setup__rules-link:hover,
.ff-setup__rules-link:focus-visible {
  background: var(--gold);
  color: #10161b;
}

/* --- marketing copy below the fold (from the sell sheet) --- */
.ff-setup__h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-align: center;
  margin: 0 0 var(--spacing-md);
}

.ff-setup__about {
  width: 100%;
  margin-top: 44px;
  padding-top: var(--spacing-xl);
  border-top: 1px solid var(--border);
  text-align: center;
}

.ff-setup__about p {
  margin: 0 auto var(--spacing-md);
  max-width: 34rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}

.ff-setup__pitch {
  color: var(--cream) !important;
  font-size: 1.05rem !important;
}

.ff-setup__pitch em { color: var(--copper-light); font-style: italic; }

.ff-setup__actions-guide {
  width: 100%;
  margin-top: var(--spacing-xl);
}

.ff-setup__action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--spacing-md);
  list-style: none;
  margin: 0;
  padding: 0;
}

.ff-setup__action-grid li {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  column-gap: var(--spacing-md);
  align-items: center;
  background: rgba(30, 26, 20, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

/* The action art sits on a light background, so frame it as a deliberate
   tile rather than letting a white square float on the dark card. */
.ff-setup__action-grid img {
  grid-row: 1 / span 2;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.ff-setup__action-grid h3 {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--cream);
}

.ff-setup__action-grid p {
  margin: 2px 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.ff-setup__features {
  width: 100%;
  list-style: none;
  margin: var(--spacing-xl) 0 0;
  padding: 0;
  display: grid;
  gap: var(--spacing-sm);
}

.ff-setup__features li {
  position: relative;
  padding-left: 26px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}

/* Firefly bullet */
.ff-setup__features li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 7px 1px rgba(212, 168, 67, 0.7);
}

.ff-setup__features strong { color: var(--cream); font-weight: 600; }

.ff-setup__credit {
  margin: var(--spacing-xl) 0 0;
  padding-top: var(--spacing-xl);
  border-top: 1px solid var(--border);
  width: 100%;
  font-family: 'Oswald', sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-align: center;
}

.ff-setup__section {
  margin-bottom: var(--spacing-xl);
  max-width: 600px;
  width: 100%;
}

.ff-setup__section:last-of-type { margin-bottom: var(--spacing-lg); }

@media (max-width: 560px) {
  .ff-setup__facts { gap: var(--spacing-md); flex-wrap: wrap; }
  .ff-setup__panel { padding: var(--spacing-lg) var(--spacing-md); }
  .ff-setup__action-grid { grid-template-columns: 1fr; }

  /* Label + toggles on one line, colour dots on their own line beneath —
     all three side by side overflows below ~560px. */
  .ff-setup__player-row {
    flex-wrap: wrap;
    row-gap: var(--spacing-sm);
  }

  .ff-setup__toggle-group { flex: 1 1 auto; }

  .ff-setup__color-picker {
    flex: 1 0 100%;
    margin-left: 0;
    justify-content: center;
  }

  .ff-setup__toggle-btn {
    padding: var(--spacing-sm) var(--spacing-sm);
    font-size: 0.78rem;
  }
}

/* Only the player-count section carries one of these, and it is the heading
   for the panel's first decision — so it is gold, not a muted caption. */
.ff-setup__label {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
  margin-bottom: var(--spacing-sm);
}

/* The player count is the first decision on the page and it was the quietest
   thing on it: a muted label over a near-black field in body serif, sitting
   above two rows of cream names, copper toggles and glowing colour dots. The
   eye went to PLAYER 1 and stayed there, so the control that adds players 3-6
   was never found (Dean, 1 August 2026).
   Gold now, in the same Oswald the rest of the panel's controls speak. It is
   an OUTLINE, not a fill — Start Game is the only filled block here and has to
   stay the end of the sequence, so the select leads on hue while the button
   still leads on weight. The inset shadow and the chevron are what keep it
   from reading as a second gold BUTTON alongside the rulebook link: fields
   sink, buttons stand up. */
.ff-setup__select {
  width: 100%;
  /* Right padding leaves room for the chevron drawn into the background. */
  padding: var(--spacing-sm) 40px var(--spacing-sm) var(--spacing-md);
  border: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  background-color: rgba(212, 168, 67, 0.10);
  color: var(--gold);
  font-family: 'Oswald', sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.5);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;

  /* The native arrow takes the OS's colour and cannot be tinted, so it is
     replaced with one drawn in the panel's gold. Inline SVG as a data URI: a
     separate asset for a 12px chevron is not worth a request, and the artifact
     CSP forbids fetching one anyway. */
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23d4a843' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--spacing-md) center;
}

.ff-setup__select:hover {
  background-color: rgba(212, 168, 67, 0.19);
  border-color: var(--copper-light);
}

.ff-setup__select:focus-visible {
  outline: none;
  border-color: var(--copper-light);
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.5), 0 0 10px rgba(212, 168, 67, 0.5);
}

/* The open list is drawn by the OS, which defaults to white-on-white against a
   dark page. Chrome and Edge honour these; Firefox and Safari ignore them and
   fall back to their own readable native list. */
.ff-setup__select option {
  background: var(--bg-card);
  color: var(--cream);
}

.ff-setup__player-row {
  background: rgba(33, 29, 22, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  transition: border-color 0.2s ease;
}

.ff-setup__player-row:hover { border-color: var(--border-light); }

.ff-setup__player-label {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  min-width: 68px;
  white-space: nowrap;
  color: var(--cream);
}

.ff-setup__color-picker {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.ff-setup__toggle-group {
  display: flex;
  gap: 2px;
  background: var(--bg-mid);
  border-radius: var(--radius-md);
  padding: 2px;
}

.ff-setup__toggle-btn {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;   /* "Easy Bot" must never wrap to two lines */
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ff-setup__toggle-btn:hover {
  color: var(--text);
}

.ff-setup__toggle-btn.active {
  background: var(--bg-card);
  color: var(--copper);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.ff-setup__color-picker {
  display: flex;
  gap: var(--spacing-xs);
  margin-left: auto;
}

.ff-setup__color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.ff-setup__color-dot:hover:not(.ff-setup__color-dot--disabled) {
  transform: scale(1.15);
}

.ff-setup__color-dot--selected {
  border-color: var(--cream);
  box-shadow: 0 0 8px rgba(240, 230, 211, 0.5);
}

.ff-setup__color-dot--disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Setup variant switch (currently just the water rewards). Built on a real
   checkbox so it is keyboard- and screen-reader-native; the input is hidden
   visually but NOT with display:none, which would drop it out of the tab
   order and off the accessibility tree entirely. */
.ff-setup__switch {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  background: rgba(33, 29, 22, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.ff-setup__switch:hover { border-color: var(--copper); }

.ff-setup__switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ff-setup__switch-track {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ff-setup__switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.2s ease, background 0.2s ease;
}

.ff-setup__switch-input:checked + .ff-setup__switch-track {
  background: rgba(196, 114, 58, 0.45);
  border-color: var(--copper);
}

.ff-setup__switch-input:checked + .ff-setup__switch-track .ff-setup__switch-thumb {
  transform: translateX(20px);
  background: var(--copper);
}

/* The label wraps the input, so focus has to be drawn on the track instead. */
.ff-setup__switch-input:focus-visible + .ff-setup__switch-track {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.ff-setup__switch-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ff-setup__switch-text strong {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
}

.ff-setup__switch-text small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ff-setup__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: var(--spacing-lg);
  max-width: 600px;
  width: 100%;
}

/* The one clear call to action on the page — lantern-gold, and it glows. */
.ff-setup__button {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  font-family: 'Oswald', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #21180c;
  background: linear-gradient(180deg, var(--copper-light) 0%, var(--copper) 55%, #a85c2c 100%);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 226, 176, 0.5),
    0 6px 18px rgba(0, 0, 0, 0.5),
    0 0 26px rgba(212, 168, 67, 0.22);
}

.ff-setup__button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 226, 176, 0.6),
    0 8px 22px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(212, 168, 67, 0.42);
}

.ff-setup__button:active { transform: translateY(1px); filter: brightness(0.96); }

.ff-setup__button:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

/* End screen */
.ff-end-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-mid) 100%);
  padding: var(--spacing-xl);
  text-align: center;
}

.ff-end-content {
  max-width: 600px;
}

.ff-end-content h1 {
  color: var(--gold);
  margin-bottom: var(--spacing-lg);
}

.ff-winner {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-lg);
}

.ff-scores {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.ff-score-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  text-align: left;
}

.ff-score-line:last-child {
  border-bottom: none;
}

.ff-score-name {
  flex: 0 0 auto;
  font-weight: 600;
}

/* The end-game arithmetic: island group size, group bonus, +15 flag, goals binned */
.ff-score-detail {
  flex: 1 1 auto;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.ff-end-detail--bonus {
  color: var(--gold);
}

.ff-end-detail--penalty {
  color: #e2725b;
}

.ff-score-vp {
  flex: 0 0 auto;
  color: var(--gold);
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Action column — "Choose an action". A vertical strip between the player
   details and the map, split into the turn's two slots: one main action
   (amber) and one side action (jade).
   --------------------------------------------------------------------------- */

/* No bottom padding: the Undo / End Turn row sticks flush to the foot.
   scroll-padding keeps that sticky bar from parking on top of whatever the
   column has just scrolled to — a panel's own buttons used to end up
   underneath it and become unclickable. */
.ff-action-column {
  padding-bottom: 0;
  scroll-padding-bottom: 96px;
}

.ff-action-column > *:not(.ff-column-title):not(.ff-turn-controls) {
  margin-left: var(--spacing-sm);
  margin-right: var(--spacing-sm);
}

/* The column scrolls, so nothing in it may be compressed: without this, flex
   shrinks an open panel to a sliver and its contents spill out of the scroll
   area entirely — the panel's own buttons ended up below the sticky foot,
   unreachable at any scroll position. */
.ff-action-column > * {
  flex-shrink: 0;
}

/* The side-action panels vary a lot in height, so the panel scrolls inside
   itself rather than pushing its own buttons off the bottom of the column.
   It must NOT be shrinkable to do that: `flex: 1 1 auto` with `min-height: 0`
   let a full column squash the panel to zero height, which clipped its own
   buttons out of existence — the panel was there, scrolled inside a 0px box,
   and unreachable at any scroll position. Fixed size, capped height, its own
   scrollbar when the content is genuinely tall. */
.ff-action-column #actionPanel {
  flex: 0 0 auto;
  max-height: 60vh;
  overflow-y: auto;
}

/* Whose turn it is, right above the buttons they would press */
.ff-turn-banner {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  background: var(--column-card, var(--bg-mid));
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-muted);
  border-radius: var(--radius-sm);
}

.ff-turn-banner--you {
  border-left-color: var(--accent-action);
}

.ff-turn-banner-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.ff-turn-banner-name {
  color: var(--cream);
  font-weight: 600;
}

.ff-turn-banner-who {
  margin-left: auto;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ff-turn-banner--you .ff-turn-banner-who {
  color: var(--accent-action);
}

/* Action Menu */
.ff-action-menu {
  flex-shrink: 0;
}

.ff-action-group {
  --group-accent: #ffd489;
  --group-tint:   rgba(255, 232, 199, 0.14);
  --group-edge:   rgba(255, 232, 199, 0.38);
  padding: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  background: var(--group-tint);
  border: 1px solid var(--group-edge);
  border-radius: var(--radius-md);
}

/* Side actions stay a shade cooler and quieter than the main action, but on the
   orange field the difference is weight, not a second hue fighting the first. */
.ff-action-group--side {
  --group-accent: #cdefdb;
  --group-tint:   rgba(40, 18, 4, 0.20);
  --group-edge:   rgba(255, 232, 199, 0.26);
}

.ff-action-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
}

.ff-action-group-title {
  font-family: 'Oswald', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--group-accent);
}

.ff-action-group-state {
  font-family: 'Oswald', sans-serif;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 240, 218, 0.75);
}

.ff-action-group-state--used {
  text-decoration: line-through;
}

.ff-action-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.ff-action-button {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon desc";
  align-items: center;
  column-gap: var(--spacing-sm);
  row-gap: 2px;
  text-align: left;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--column-card, var(--bg-mid));
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--group-accent);
  border-radius: var(--radius-sm);
  color: var(--cream);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 56px;
  width: 100%;
}

.ff-action-button:hover:not(:disabled) {
  background: var(--group-accent);
  border-color: var(--group-accent);
  color: #16130f;
  transform: translateX(3px);
  box-shadow: none;
}

.ff-action-button--active {
  background: var(--group-accent);
  border-color: var(--group-accent);
  color: #16130f;
}

.ff-action-button:active:not(:disabled) {
  transform: translateX(1px);
}

.ff-action-button:disabled,
.ff-action-button.disabled {
  background: transparent;
  border-color: var(--border);
  border-left-color: var(--border);
  color: var(--text-muted);
  opacity: 0.4;
  filter: grayscale(1);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ff-action-button.disabled:hover {
  background: transparent;
  border-color: var(--border);
  transform: none;
  box-shadow: none;
}

/* End Turn / Undo row — not among the 8 actions, so it sits at the foot of
   the column, under whatever panel is open */
.ff-turn-controls {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--spacing-xs);
  margin-top: auto;
  padding: var(--spacing-sm);
  background: var(--actions-bg-solid);
  border-top: 1px solid rgba(255, 232, 199, 0.35);
}

.ff-turn-controls-buttons {
  display: flex;
  gap: var(--spacing-xs);
}

.ff-turn-controls-buttons > button {
  flex: 1;
}

.ff-turn-controls-hint {
  font-size: 0.75rem;
  text-align: center;
  color: rgba(255, 240, 218, 0.85);
}

/* Rulebook link, sitting between the turn hint and the buttons — the spot a
   player already looks at when they are stuck. An outlined bar rather than a
   filled button: unmissable, but still visibly a different class of thing from
   Undo / End Turn, and separated from them so nobody hits it while reaching for
   End Turn. */
.ff-rulebook-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-md);
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--gold);
  background: rgba(12, 18, 30, 0.35);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  transition: background 0.15s ease, color 0.15s ease;
}

.ff-rulebook-link:hover,
.ff-rulebook-link:focus-visible {
  background: var(--gold);
  color: #10161b;
}

.ff-undo-button {
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--column-card, var(--bg-mid));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
}

.ff-undo-button:hover:not(:disabled):not(.disabled) {
  background: var(--bg-light);
  border-color: var(--silver);
  color: var(--cream);
  transform: none;
  box-shadow: none;
}

/* Nothing left to take back this turn — End Turn is the commit point. */
.ff-undo-button:disabled,
.ff-undo-button.disabled {
  background: var(--bg-light);
  border-color: var(--border);
  color: var(--text-muted);
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------------------------------------------------------------------------
   Lucky Fish price list — sits under the Lucky Fish button, on the orange.
   Three pips per player, marked with the coin cost of that fish (3 / 5 / 7);
   a pip fills with the player's colour once they have spent it.
   --------------------------------------------------------------------------- */

.ff-fish-strip {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-xs) 0 0;
  border-top: 1px dashed rgba(255, 232, 199, 0.30);
}

.ff-fish-strip-head {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-bottom: 2px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 240, 218, 0.8);
}

.ff-fish-strip-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.ff-fish-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 1px 2px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
}

.ff-fish-row--active {
  background: rgba(0, 0, 0, 0.28);
}

.ff-fish-row-name {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 240, 218, 0.92);
  font-family: 'Oswald', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.ff-fish-row-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.5);
}

.ff-fish-row-pips {
  display: flex;
  gap: 3px;
}

.ff-fish-pip {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(255, 240, 218, 0.85);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 232, 199, 0.35);
}

.ff-fish-pip--next {
  border-color: #ffd489;
  box-shadow: 0 0 6px rgba(255, 212, 137, 0.65);
  color: #ffe9c4;
}

.ff-fish-pip--spent {
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.45);
}

/* A fish this player does not own. See .ff-fish-slot--gone. */
.ff-fish-pip--gone {
  opacity: 0.4;
  border-style: dashed;
  text-decoration: line-through;
}

.ff-fish-row-supply {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  color: rgba(255, 240, 218, 0.9);
}

.ff-fish-row-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

/* ---------------------------------------------------------------------------
   Modal panels — the goal pickers are lists of cards to read and compare, so
   they open in the middle of the screen instead of at the foot of a 255px
   column. The host is the same #actionPanel element; only its presentation
   changes, so nothing about the render/dispatch flow moves.
   --------------------------------------------------------------------------- */

#actionPanel.ff-modal-host {
  position: fixed;
  inset: 0;
  z-index: 200;
  margin: 0;
  padding: var(--spacing-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 5, 2, 0.72);
  animation: ff-modal-fade 0.15s ease-out;
}

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

#actionPanel.ff-modal-host .ff-action-panel {
  width: min(780px, 100%);
  max-height: 84vh;
  overflow-y: auto;
  margin: 0;
  padding: var(--spacing-lg) var(--spacing-xl);
  background: var(--bg-card);
  border: 2px solid var(--accent-action);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
}

/* Undo the narrow-column stacking: in a modal there is room for real rows */
#actionPanel.ff-modal-host .ff-action-panel-header {
  flex-direction: row;
  align-items: baseline;
  gap: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border);
}

#actionPanel.ff-modal-host .ff-action-panel-title {
  font-size: 1.15rem;
}

#actionPanel.ff-modal-host .ff-action-panel-note {
  font-size: 0.85rem;
}

#actionPanel.ff-modal-host .ff-claim-list {
  font-size: 0.95rem;
}

#actionPanel.ff-modal-host .ff-claim-row {
  flex-direction: row;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) 0;
}

#actionPanel.ff-modal-host .ff-claim-name {
  min-width: 11em;
  font-size: 1rem;
}

#actionPanel.ff-modal-host .ff-claim-text {
  flex: 1 1 16em;
}

#actionPanel.ff-modal-host .ff-claim-detail {
  font-size: 0.85rem;
}

#actionPanel.ff-modal-host .ff-claim-buttons,
#actionPanel.ff-modal-host .ff-action-panel-buttons {
  flex-direction: row;
  align-items: center;
  gap: var(--spacing-sm);
}

#actionPanel.ff-modal-host .ff-action-panel-buttons {
  justify-content: flex-end;
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border);
}

#actionPanel.ff-modal-host .ff-panel-button {
  font-size: 0.85rem;
  padding: var(--spacing-sm) var(--spacing-lg);
  text-align: center;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Festival scoring breakdown. A festival pays every player at once and adds the
   caller's firefly bonus on top, so the modal shows the arithmetic rather than
   letting three scores jump unexplained.
   --------------------------------------------------------------------------- */

.ff-festival-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  background: rgba(8, 5, 2, 0.78);
  animation: ff-modal-fade 0.18s ease-out;
}

.ff-festival-card {
  width: min(900px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: var(--spacing-lg) var(--spacing-xl);
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
}

.ff-festival-head {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--gold);
}

.ff-festival-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.ff-festival-title {
  font-size: 1.4rem;
  margin: 0;
  color: var(--gold);
}

.ff-festival-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ff-festival-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ff-festival-table th {
  font-family: 'Oswald', sans-serif;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  color: var(--text-muted);
  padding: 0 var(--spacing-sm) 6px;
  border-bottom: 1px solid var(--border);
}

/* Per-piece column heads: the game's own art above each scoring column */
.ff-festival-table th.ff-fest-col {
  text-align: right;
}

.ff-festival-table th.ff-fest-col img {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
  margin: 0 0 2px auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.ff-fest-calc {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.1;
}

.ff-fest-none {
  color: var(--border-light);
}

.ff-festival-table td {
  padding: 6px var(--spacing-sm);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.ff-fest-row--blank {
  opacity: 0.45;
}

.ff-fest-player {
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.04em;
  color: var(--cream);
  white-space: nowrap;
}

.ff-fest-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-right: 6px;
  border: 1px solid rgba(0, 0, 0, 0.5);
}

.ff-fest-caller {
  margin-left: var(--spacing-sm);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--gold);
  color: #16130f;
}

.ff-fest-pieces {
  color: var(--text);
  font-size: 0.8rem;
}

.ff-fest-num {
  text-align: right;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.ff-fest-num strong {
  font-family: 'Oswald', sans-serif;
  font-size: 1.05rem;
  color: var(--cream);
}

.ff-fest-total strong {
  color: var(--gold);
  font-size: 1.15rem;
}

.ff-festival-notes {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.ff-festival-notes strong {
  color: var(--text);
}

.ff-festival-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--spacing-lg);
}

.ff-festival-ok {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  padding: var(--spacing-sm) var(--spacing-xl);
  background: var(--gold);
  border: none;
  border-radius: var(--radius-md);
  color: #16130f;
  cursor: pointer;
}

.ff-festival-ok:hover {
  background: #e8c063;
  transform: none;
  box-shadow: none;
}

/* The running instruction for whichever action mode is open */
/* The live "the game is waiting on you" prompt. It wears the same lime as the
   islands it is talking about, so the glow on the board and the sentence
   explaining it read as one thing. */
.ff-action-mode-info {
  padding: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  font-size: 0.85rem;
  line-height: 1.4;
  font-weight: 600;
  color: #f7ffe0;
  background: rgba(212, 255, 46, 0.14);
  border: 2px solid var(--select-lime);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 14px rgba(212, 255, 46, 0.35);
  animation: ff-prompt-pulse 1.5s ease-in-out infinite;
}

/* The way out of a half-made action. It sits inside the prompt because that is
   where the player is already looking, and it is the only control there. */
.ff-action-mode-cancel {
  display: block;
  margin-top: var(--spacing-sm);
  margin-left: auto;
  font-family: 'Oswald', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px var(--spacing-md);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--select-lime);
  border-radius: var(--radius-md);
  color: #f7ffe0;
  cursor: pointer;
}

.ff-action-mode-cancel:hover {
  background: var(--select-lime);
  color: var(--bg-dark, #10130c);
}

@keyframes ff-prompt-pulse {
  0%, 100% { box-shadow: 0 0 14px rgba(212, 255, 46, 0.3); }
  50%      { box-shadow: 0 0 22px rgba(212, 255, 46, 0.6); }
}

@media (prefers-reduced-motion: reduce) {
  .ff-action-mode-info { animation: none; }
}

.ff-end-turn-button {
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--column-card, var(--bg-mid));
  border: 2px solid var(--accent-action);
  border-radius: var(--radius-md);
  color: var(--cream);
  cursor: pointer;
}

.ff-end-turn-button:hover:not(:disabled):not(.disabled) {
  background: var(--accent-action);
  border-color: var(--accent-action);
  color: #16130f;
  transform: none;
  box-shadow: none;
}

.ff-end-turn-button:disabled,
.ff-end-turn-button.disabled {
  background: var(--bg-light);
  border-color: var(--border);
  color: var(--text-muted);
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------------------------------------------------------------------------
   Multi-step action panel (Move 3, Recruit workers)
   --------------------------------------------------------------------------- */

.ff-action-panel {
  background: var(--bg-card);
  border: 1px solid var(--copper);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-top: var(--spacing-sm);
}

.ff-action-panel-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
}

.ff-action-panel-title {
  font-family: 'Oswald', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--copper-light);
}

.ff-move-counter {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--gold);
}

.ff-move-coins {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ff-action-panel-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
}

.ff-action-panel-note em {
  color: var(--gold);
}

/* The second note on a two-part panel — currently the Private Goal panel's "bin a
   card" block. Ruled off from the block above it, because the two options cost
   completely different things (a side action against nothing at all) and a player
   skim-reading one block would take the wrong one. */
.ff-action-panel-note + .ff-action-panel-note {
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--border);
}

.ff-move-list {
  list-style: none;
  margin: 0 0 var(--spacing-sm) 0;
  padding: 0;
  font-size: 0.85rem;
}

.ff-move-list-empty {
  color: var(--text-muted);
  font-style: italic;
}

.ff-move-list-item {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-sm);
  padding: 2px 0;
}

.ff-move-list-index {
  color: var(--text-muted);
  min-width: 1.4em;
}

.ff-move-list-path {
  color: var(--cream);
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.04em;
}

.ff-move-list-cost {
  color: var(--gold);
  font-size: 0.8rem;
}

.ff-action-panel-buttons {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.ff-panel-button {
  font-family: 'Oswald', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--bg-mid);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
}

.ff-panel-button:hover:not(:disabled) {
  background: var(--bg-light);
  border-color: var(--copper);
  color: var(--cream);
}

.ff-panel-button--primary {
  border-color: var(--copper);
  color: var(--cream);
}

.ff-panel-button--primary:hover:not(:disabled) {
  background: var(--copper);
}

/* BAL-17 (§7.2) — "Bin for 3c", the free discard, which sits beside the Claim
   button on every private goal row. Deliberately quieter than the primary claim:
   claiming scores the card and binning throws it away, so the destructive one
   must not be the one the eye lands on. It stays visibly enabled when Claim is
   dead, though, because a card you cannot meet is exactly the card to bin. */
.ff-panel-button--discard {
  font-size: 0.7rem;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-style: dashed;
  color: var(--text-muted);
}

.ff-panel-button--discard:hover:not(:disabled) {
  border-style: solid;
  border-color: var(--gold);
  color: var(--cream);
}

.ff-panel-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* The panels live in the narrow action column now, so they stack rather than
   spreading across a wide row. */
.ff-action-column .ff-action-panel {
  background: var(--column-card, var(--bg-card));
  border-color: var(--accent-action);
  padding: var(--spacing-sm);
}

.ff-action-column .ff-action-panel-title {
  color: var(--accent-action);
}

.ff-action-column .ff-action-panel-header {
  flex-direction: column;
  gap: 2px;
}

.ff-action-column .ff-claim-row,
.ff-action-column .ff-claim-buttons,
.ff-action-column .ff-action-panel-buttons {
  flex-direction: column;
  align-items: stretch;
  gap: var(--spacing-xs);
}

.ff-action-column .ff-claim-name {
  min-width: 0;
}

.ff-action-column .ff-panel-button {
  padding: var(--spacing-xs) var(--spacing-sm);
  text-align: center;
}

/* Move 3 progress: three pips, filled as each movement lands */
.ff-move-pips {
  display: flex;
  gap: 5px;
  align-items: center;
}

.ff-move-pip {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 232, 199, 0.4);
}

.ff-move-pip--used {
  background: var(--accent-action);
  border-color: var(--accent-action);
}

.ff-move-pip--next {
  box-shadow: 0 0 6px rgba(255, 212, 137, 0.7);
  border-color: #ffd489;
}

/* Toll / status badges drawn on islands during Move 3 */
/* Toll / FREE / FULL, during Move 3. Sits on the island's bottom edge: the top
   edge is the island's name, and this badge is the one thing you are reading
   while the mode is open, so it is allowed to sit over the height and
   occupancy readouts for as long as it lasts. */
.ff-move-badge {
  position: absolute;
  bottom: 2%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: 'Oswald', sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.ff-move-badge--free {
  background: rgba(30, 132, 73, 0.9);
  color: var(--cream);
  border: 1px solid #2fd07a;
}

.ff-move-badge--toll {
  background: rgba(196, 114, 58, 0.92);
  color: var(--cream);
  border: 1px solid var(--gold);
}

.ff-move-badge--blocked {
  background: rgba(20, 18, 15, 0.88);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.ff-move-badge--source {
  background: rgba(212, 168, 67, 0.92);
  color: #16130f;
  border: 1px solid var(--gold);
}

.ff-move-delta {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 5;
  min-width: 22px;
  padding: 1px 5px;
  border-radius: 10px;
  background: rgba(20, 18, 15, 0.9);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

.ff-action-icon {
  grid-area: icon;
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

.ff-action-label {
  grid-area: label;
  align-self: end;
  font-family: 'Oswald', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

/* One line of rules, so the button says what it will actually do */
.ff-action-desc {
  grid-area: desc;
  align-self: start;
  text-transform: none;      /* the global button rule shouts; rules text should not */
  letter-spacing: 0;
  font-family: 'Crimson Pro', serif;
  font-size: 0.72rem;
  line-height: 1.25;
  color: rgba(255, 240, 218, 0.72);
}

/* On the light hover / armed state the description needs dark ink too */
.ff-action-button:hover:not(:disabled) .ff-action-desc,
.ff-action-button--active .ff-action-desc {
  color: rgba(22, 12, 3, 0.78);
}

/* SVG board styling */
svg.ff-board {
  width: 100%;
  height: 100%;
}

.ff-island {
  cursor: pointer;
  transition: all 0.2s ease;
}

.ff-island:hover {
  filter: brightness(1.2);
}

.ff-island--selectable {
  filter: brightness(1.3);
}

.ff-island--selected {
  filter: brightness(1.4) drop-shadow(0 0 8px var(--copper));
}

.ff-bridge {
  stroke: var(--text-muted);
  stroke-width: 3;
  fill: none;
  transition: all 0.2s ease;
}

.ff-bridge:hover {
  stroke-width: 5;
}

.ff-bridge--preview {
  stroke: var(--copper);
  stroke-dasharray: 4,4;
  stroke-width: 4;
}

.ff-worker-group {
  cursor: grab;
}

.ff-worker {
  transition: all 0.2s ease;
}

/* Animations */
@keyframes ff-pulse-bridge {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-card);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--copper);
}

/* ---------------------------------------------------------------------------
   Islands — art plus drawn-on information
   ---------------------------------------------------------------------------
   The `island_fancy_*` paintings carry no printed information at all, so
   everything a player needs is drawn over them by renderIslandInfoHtml():
   a name chip, a right-hand rail of the tile's fixed spec (VP per piece,
   the pagoda height a festival needs, the pagoda reward), and a centre plaza
   holding the live pieces.

   Every size here is set inline as a fraction of the island's own width, so
   these rules deal only with colour, weight and stacking. The one hard rule
   is contrast: this all sits on painted trees and stonework, so anything
   carrying a number gets an opaque backing or a heavy shadow — never both a
   thin font and a transparent background.
   --------------------------------------------------------------------------- */

/* The painting itself. Each one is framed by a margin of its own open water,
   which against the board's water pattern would read as a hard blue rectangle
   round every island. Feathering the four edges dissolves that frame, so the
   island's sea joins the board's sea. Two axis gradients rather than a radial
   one: a circle would bite the corners off the islands that are painted as
   rounded squares. */
.ff-island-art {
  position: absolute;
  z-index: 1;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  -webkit-mask-image:
    linear-gradient(to right,  transparent 0%, #000 9%, #000 91%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 9%, #000 91%, transparent 100%);
  mask-image:
    linear-gradient(to right,  transparent 0%, #000 9%, #000 91%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 9%, #000 91%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.ff-island-chip {
  position: absolute;
  z-index: 6;
  display: flex;
  align-items: baseline;
  gap: 0.28em;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.04em;
  color: var(--cream);
  background: rgba(12, 18, 30, 0.82);
  border: 1px solid rgba(212, 168, 67, 0.55);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  white-space: nowrap;
}

/* The size letter rides with the island's name rather than taking a chip of
   its own — S/M/L is only ever read alongside "which island is this". */
.ff-island-chip-size {
  font-size: 0.68em;
  font-weight: 500;
  color: var(--gold);
  opacity: 0.95;
}

.ff-island-rail {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  pointer-events: none;
}

.ff-island-spec {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 18, 30, 0.78);
  border: 1px solid rgba(212, 168, 67, 0.45);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  pointer-events: auto;   /* the title attribute is the long-form explanation */
}

.ff-island-spec img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5));
}

/* The reward paintings are the message, so they fill their chip. */
.ff-island-spec--reward img.ff-island-spec-reward-art {
  width: 94%;
  height: 94%;
}

/* A number sitting inside its icon — the VP lantern has a blank medallion
   painted into it, and this is what goes in the medallion. */
.ff-island-spec-value {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  color: #1a1206;
  text-shadow: 0 1px 0 rgba(255, 232, 180, 0.5);
  pointer-events: none;
}

/* A number sitting BESIDE its icon, bottom-right, for the "3+" festival
   requirement — the pagoda art has no clear space to write into. */
.ff-island-spec-badge {
  position: absolute;
  right: 4%;
  bottom: 2%;
  padding: 0 0.25em;
  border-radius: 0.35em;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  line-height: 1.3;
  color: #16130f;
  background: var(--gold);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

/* The plaza is the blank middle every painting leaves clear. A soft vignette
   rather than a panel: it lifts the pieces off the stonework without putting
   a hard-edged box on top of the art. */
.ff-island-plaza {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  border-radius: 18%;
  background: radial-gradient(ellipse at center,
    rgba(8, 14, 26, 0.46) 0%,
    rgba(8, 14, 26, 0.30) 58%,
    rgba(8, 14, 26, 0) 82%);
  pointer-events: none;
}

/* The pagoda tower: one icon per floor, growing up the island's left edge from
   a fixed baseline. Anchored bottom-left rather than centred so that a tower
   gaining a floor grows upward into empty sky instead of shuffling everything
   around it — the workers and the spec rail never move. */
.ff-island-pagoda {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  pointer-events: auto;   /* its title names the floors' owners */
}

/* A soft pool of shade under the tower. The floors are flat player colour, and
   a red one on an island painted in red canopy is the same value as its
   background — the outline alone still leaves it fighting the art. No border
   and no hard edge, so it reads as the tower's own shadow. */
.ff-island-pagoda::before {
  content: '';
  position: absolute;
  inset: -4% -18%;
  z-index: 0;
  border-radius: 45%;
  background: radial-gradient(ellipse at center,
    rgba(4, 8, 16, 0.62) 0%,
    rgba(4, 8, 16, 0.40) 52%,
    rgba(4, 8, 16, 0) 80%);
}

/* One floor, as the pagoda icon filled with its builder's colour. The icon is
   used as a MASK rather than tinted with a hue-rotate filter: at this size the
   only thing a player needs from a floor is unambiguously whose it is, and a
   mask gives the exact player colour where a hue rotation only ever gives a
   near miss. The double drop-shadow puts the outline back. */
/* One floor, in its builder's colour, WITH the icon's own black linework.

   The colour and the linework are two different jobs and need two different
   mechanisms:

   - RECOLOUR: the icon is painted over a flat `background-color` of the player
     colour and blended with `luminosity`. That keeps the artwork's lightness —
     every roof edge, every black outline, every bit of internal shading — and
     takes hue and saturation from the colour underneath. A plain mask instead
     discards all of that and leaves a flat blob, which is why an outer keyline
     alone could never rescue a red floor on a red island: the shape had no
     inside to read.
   - CLIP: `background-color` would otherwise flood the whole box, so the icon
     is also used as a mask to cut the result back to the pagoda's silhouette.

   Then four hard drop-shadows, one per direction, ring the outside in black so
   the tower separates from the island art as well. Each is applied to the
   result of the last, so they compound into a continuous outline rather than
   four separate offsets; the fifth is the cast shadow. --floor-outline is set
   inline per island so the keyline scales with the board rather than thinning
   out as the map grows. */
.ff-island-pagoda-floor {
  position: relative;
  flex-shrink: 0;
  background-image: url('images/icons/pagoda.png');
  background-blend-mode: luminosity;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center bottom;
  -webkit-mask-image: url('images/icons/pagoda.png');
  mask-image: url('images/icons/pagoda.png');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center bottom;
  mask-position: center bottom;
  filter:
    saturate(1.35)
    drop-shadow(var(--floor-outline, 1px) 0 0 #05070c)
    drop-shadow(calc(var(--floor-outline, 1px) * -1) 0 0 #05070c)
    drop-shadow(0 var(--floor-outline, 1px) 0 #05070c)
    drop-shadow(0 calc(var(--floor-outline, 1px) * -1) 0 #05070c)
    drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7));
}

/* The Sōrin cap. `position: relative` + z-index is not decoration: the tower's
   ::before shade pool is a positioned element, so anything static inside the
   tower paints UNDERNEATH it. The star and the floor count both need to be
   lifted clear of their own glow. Above the floors too, since the Sōrin caps
   the tower and should read as sitting on top of the topmost roof. */
.ff-island-sorin {
  position: relative;
  z-index: 20;
  color: var(--gold);
  line-height: 0.8;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
}

/* How many floors the tower has. Gold once it clears the island's printed
   festival minimum — height is only ONE of the four requirements in §5.4, so
   this says "tall enough", never "you may hold a festival". */
.ff-island-height {
  position: relative;
  z-index: 20;   /* clear of the tower's own ::before shade pool — see .ff-island-sorin */
  margin-top: 0.2em;
  min-width: 1.7em;
  text-align: center;
  border-radius: 0.4em;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  line-height: 1.35;
  color: var(--cream);
  background: rgba(12, 18, 30, 0.85);
  border: 1px solid rgba(212, 168, 67, 0.35);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.ff-island-height--met {
  color: #16130f;
  background: var(--gold);
  border-color: var(--gold);
}

/* Sealed: a festival has been held here, so the tower can never grow or score
   again. Reads as spent rather than as an achievement. */
.ff-island-height--sealed {
  color: rgba(255, 240, 218, 0.55);
  background: rgba(0, 0, 0, 0.55);
  border-color: rgba(212, 168, 67, 0.25);
}

.ff-island-workers {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  min-width: 0;
  overflow: hidden;   /* a full island must not spill workers into the sea */
}

.ff-island-worker {
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.75));
}

/* How full the island is, against its cap (§5.3). Sits in the plaza's
   bottom-right corner, out of the workers' way. */
.ff-island-occupancy {
  position: absolute;
  right: 2%;
  bottom: 0;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  line-height: 1.5;
  color: var(--cream);
  background: rgba(12, 18, 30, 0.78);
  border: 1px solid rgba(212, 168, 67, 0.4);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.ff-island-occupancy--full {
  color: #16130f;
  background: var(--gold);
  border-color: var(--gold);
}

/* ---------------------------------------------------------------------------
   Bridge starting markers
   ---------------------------------------------------------------------------
   Every LEGAL route gets a marker. A route the player cannot currently pay for
   is shown greyed and still, rather than hidden: a marker that silently
   vanishes when you are one coin short reads as "you can't build here at all",
   which is a different and much more discouraging message than "not yet".
   --------------------------------------------------------------------------- */

.ff-starting-location--unaffordable {
  filter: grayscale(0.85) brightness(0.6);
  opacity: 0.65;
}

.ff-starting-location--unaffordable:hover {
  filter: grayscale(0.5) brightness(0.8);
  opacity: 0.9;
}

/* What the bridge would cost, in coins — the number that decides whether the
   route is worth taking, on the marker rather than in a tooltip. */
.ff-starting-location-cost {
  position: absolute;
  right: -12%;
  bottom: -12%;
  min-width: 1.35em;
  padding: 0 0.2em;
  border-radius: 0.5em;
  font-family: 'Oswald', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  color: #16130f;
  background: var(--gold);
  border: 1px solid rgba(0, 0, 0, 0.55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.ff-starting-location--unaffordable .ff-starting-location-cost {
  color: var(--cream);
  background: rgba(120, 30, 30, 0.95);
  border-color: rgba(226, 114, 91, 0.7);
}

/* ---------------------------------------------------------------------------
   TABLET ACTION STRIP
   Below 1400px the action column is laid out as a row under the map (see the
   layout media queries near the top of this file). These rules must sit at the
   foot of the stylesheet: they override the action column's desktop rules at
   equal specificity, so the cascade is doing the work.
   --------------------------------------------------------------------------- */

@media (max-width: 1400px) {
  /* The action column, unwrapped: whose turn it is on the left, the eight
     action buttons across the middle, Undo / End Turn on the right. Any open
     panel spans the full width above them. */
  .ff-action-column {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 185px;
    /* The panel row is the only stretchy one: when the strip hits its cap it is
       what gives, and it scrolls inside itself. Leave all three rows `auto` and
       grid squeezes the panel's TRACK without resizing the panel — it then
       spills over the action buttons underneath it. */
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "mode  mode  mode"
      "panel panel panel"
      "turn  menu  controls";
    align-items: start;
    gap: var(--spacing-xs) var(--spacing-sm);
    padding: var(--spacing-sm);
    max-height: 42vh;
  }

  /* The heading named a column that no longer exists, and the strip has no
     vertical space to spare */
  .ff-action-column .ff-column-title { display: none; }

  /* Undo the column's side margins — the strip's own padding does that job */
  .ff-action-column > *:not(.ff-column-title):not(.ff-turn-controls) {
    margin-left: 0;
    margin-right: 0;
  }

  .ff-action-column #actionModeInfo { grid-area: mode; margin-bottom: 0; }

  /* Move 3 / Recruit / Crow open in here. It fills its row rather than sizing
     to its content, so a long panel scrolls instead of overflowing the strip. */
  .ff-action-column #actionPanel {
    grid-area: panel;
    align-self: stretch;
    min-height: 0;
    max-height: none;
  }

  /* An open panel now has a wide row rather than a narrow column, so it reads
     across: what it is, what to do, and its buttons on the right. Scoped off
     .ff-modal-host so the goal / fish panels keep their centred modal layout. */
  .ff-action-column #actionPanel:not(.ff-modal-host) .ff-action-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs) var(--spacing-md);
    margin-top: 0;
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .ff-action-column #actionPanel:not(.ff-modal-host) .ff-action-panel-header {
    flex-direction: row;
    align-items: baseline;
    gap: var(--spacing-sm);
    margin-bottom: 0;
  }

  .ff-action-column #actionPanel:not(.ff-modal-host) .ff-action-panel-note {
    flex: 1 1 240px;
    margin-bottom: 0;
  }

  /* Lists want the full width under the header rather than a share of the row */
  .ff-action-column #actionPanel:not(.ff-modal-host) .ff-move-list,
  .ff-action-column #actionPanel:not(.ff-modal-host) .ff-claim-list {
    flex: 1 0 100%;
    margin-bottom: 0;
  }

  .ff-action-column #actionPanel:not(.ff-modal-host) .ff-action-panel-buttons,
  .ff-action-column #actionPanel:not(.ff-modal-host) .ff-claim-buttons {
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
    margin-left: auto;
  }

  .ff-action-column #turnInfo {
    grid-area: turn;
    margin-bottom: 0;
  }

  .ff-action-column .ff-action-menu {
    grid-area: menu;
    display: flex;
    gap: var(--spacing-sm);
  }

  .ff-action-column .ff-action-group {
    flex: 1 1 0;
    margin-bottom: 0;
    min-width: 0;
  }

  /* Four buttons across instead of four down */
  .ff-action-column .ff-action-buttons {
    flex-direction: row;
  }

  /* Icon over label. The rules line is the first thing to go: it is what makes
     a button 56px tall, and that height comes straight out of the map. The
     text is still on the button's tooltip. */
  .ff-action-column .ff-action-button {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "icon"
      "label";
    justify-items: center;
    text-align: center;
    row-gap: 0;
    padding: var(--spacing-xs) 2px;
  }

  /* Sideways nudge on hover would push its neighbour; lift it instead */
  .ff-action-column .ff-action-button:hover:not(:disabled) {
    transform: translateY(-2px);
  }

  .ff-action-column .ff-action-desc { display: none; }

  .ff-action-column .ff-action-icon {
    width: 38px;
    height: 38px;
  }

  .ff-action-column .ff-action-label { font-size: 0.72rem; }

  /* The fish ladder lies down too: one player per cell, wrapping */
  .ff-action-column .ff-fish-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px var(--spacing-sm);
    margin-top: var(--spacing-xs);
  }

  .ff-action-column .ff-fish-strip-head {
    flex: 1 0 100%;
    margin-bottom: 0;
  }

  .ff-action-column .ff-fish-row { padding: 0; }

  /* No longer the foot of a scrolling column, so it stops sticking */
  .ff-action-column .ff-turn-controls {
    grid-area: controls;
    position: static;
    margin-top: 0;
    padding: 0;
    background: none;
    border-top: none;
  }
}

/* Phone-width strip: 150px + 185px of side columns leaves the buttons nothing,
   so the action row goes full width and the turn banner / turn controls share
   a line under it. */
@media (max-width: 700px) {
  .ff-action-column {
    grid-template-columns: minmax(0, 1fr) 170px;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas:
      "mode  mode"
      "panel panel"
      "menu  menu"
      "turn  controls";
    /* The page scrolls at this width, so the strip shows in full rather than
       becoming a second scroll area inside it */
    max-height: none;
  }

  /* Main action over side action rather than beside it */
  .ff-action-column .ff-action-menu { flex-wrap: wrap; }
  .ff-action-column .ff-action-group { flex: 1 1 260px; }
}

/* ===== Bug reporter ===================================================== */
/* ---------------------------------------------------------------------------
   The launcher and its modal live on <body>, outside #app, because the game
   rebuilds #app.innerHTML on every render. Everything here is prefixed
   `ff-bug-` and is additive: no existing rule is touched.
   --------------------------------------------------------------------------- */

/* --- the floating launcher ---
   Its real home is the bottom-left corner of the map, over open water — the
   one patch of the screen that never carries text. That corner moves with the
   grid, so `bug-report-ui.js` measures `.ff-board-area` and writes `left` and
   `bottom` inline; the right/bottom values here are only the fallback for when
   no board is on screen. z-index 150 puts it over the board (which tops out in
   the single digits) but under the game's own modals at 200/300 — a festival
   breakdown must never have a bug button sitting on top of it. */
.ff-bug-launch {
  position: fixed;
  right: max(var(--spacing-md), env(safe-area-inset-right));
  bottom: max(var(--spacing-md), env(safe-area-inset-bottom));
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 0.4em;
  padding: 6px var(--spacing-md);
  font-family: 'Oswald', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  /* Faded until wanted: it is a permanent fixture on a busy screen, so it
     should read as furniture rather than as a call to action. */
  opacity: 0.75;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ff-bug-launch:hover,
.ff-bug-launch:focus-visible {
  opacity: 1;
  color: var(--cream);
  border-color: var(--copper);
  box-shadow: var(--shadow-card-hover);
}

.ff-bug-launch:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.ff-bug-launch__glyph {
  font-size: 1rem;
  line-height: 1;
}

/* --- the modal --- */
.ff-bug-modal {
  position: fixed;
  inset: 0;
  z-index: 900;   /* above the game's own modals: reportable from anywhere */
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(var(--spacing-lg), env(safe-area-inset-top))
    max(var(--spacing-lg), env(safe-area-inset-right))
    max(var(--spacing-lg), env(safe-area-inset-bottom))
    max(var(--spacing-lg), env(safe-area-inset-left));
  /* Barely a scrim. The map IS the evidence — you cannot describe which island
     misbehaved through a 78% blackout — so this exists only to say "something
     is in front", not to hide anything. It keeps its default pointer-events on
     purpose: the board must stay unclickable while a report is open, or the
     player can change the very position they are reporting on. */
  background: rgba(6, 4, 2, 0.16);
  animation: ff-modal-fade 0.15s ease-out;
}

/* `hidden` has to beat the display above, or the modal is never actually shut */
.ff-bug-modal[hidden],
.ff-bug-error[hidden],
.ff-bug-status[hidden] {
  display: none;
}

.ff-bug-card {
  width: min(620px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--spacing-lg) var(--spacing-xl);
  /* Fully opaque, always. The surround went see-through; the form did not —
     the text you are typing has to stay crisp over a busy blue map. */
  background: var(--bg-card);
  border: 2px solid var(--copper);
  border-radius: var(--radius-lg);
  /* Heavier than before: with almost no dimming behind it, the drop shadow is
     what lifts the dialog off the board. */
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(0, 0, 0, 0.5);
}

/* Once the dialog has a position of its own it comes out of the overlay's
   centring flow and is pinned by the script, which also writes `width`, `left`,
   `top` and — crucially — a `max-height` sized to the space left below it, so
   the form's own buttons can never be dragged off the bottom of the screen. */
.ff-bug-card--placed {
  position: fixed;
  margin: 0;
}

/* Nothing should lag behind the pointer mid-drag */
.ff-bug-card--dragging {
  transition: none !important;
  will-change: transform;
  user-select: none;
}

/* Clicking the see-through surround deliberately does nothing (it used to
   dismiss, which quietly ate the form). This pulse is the acknowledgement.
   It animates the border and shadow, never the transform — the transform is
   the drag position and must not be clobbered. */
.ff-bug-card--nudge {
  animation: ff-bug-nudge 0.35s ease-out;
}

@keyframes ff-bug-nudge {
  0%   { border-color: var(--copper); box-shadow: 0 18px 60px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(0, 0, 0, 0.5); }
  40%  { border-color: var(--gold);   box-shadow: 0 18px 60px rgba(0, 0, 0, 0.72), 0 0 0 6px rgba(212, 168, 67, 0.28); }
  100% { border-color: var(--copper); box-shadow: 0 18px 60px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(0, 0, 0, 0.5); }
}

.ff-bug-head {
  padding-bottom: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border);
}

/* --- the title bar is the drag handle --- */
.ff-bug-head--draggable {
  /* Sticky, and this is load-bearing rather than cosmetic. Drag the dialog
     down far enough and its height is capped to the strip that is left; the
     card then scrolls internally — and autofocusing the first field scrolls
     the header, i.e. the handle, straight out of sight, leaving no way to drag
     it back. Pinned to the top of the scrollport, the handle is always there. */
  position: sticky;
  top: 0;
  z-index: 2;
  cursor: grab;
  /* Without this a touch-drag scrolls the card instead of moving the window */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  /* Pull the grab target out to the card's own padding so the whole top strip
     is draggable, not just the words */
  margin: calc(var(--spacing-lg) * -1) calc(var(--spacing-xl) * -1) var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-xl) var(--spacing-sm);
  border-radius: calc(var(--radius-lg) - 2px) calc(var(--radius-lg) - 2px) 0 0;
  background: var(--bg-mid);
}

.ff-bug-head--draggable.is-grabbing {
  cursor: grabbing;
}

.ff-bug-head__bar {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-sm);
}

.ff-bug-grip {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.ff-bug-head--draggable:hover .ff-bug-grip {
  color: var(--gold);
}

/* Spoken, not seen — the drag hint for anyone who cannot see the grip */
.ff-bug-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ff-bug-title {
  font-size: 1.3rem;
  margin: 0 0 4px;
  color: var(--copper-light);
}

.ff-bug-blurb {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* The "here is what we are recording" line. Deliberately quiet but boxed, so
   the player can satisfy themselves it caught the right turn. */
.ff-bug-summary {
  margin: 0 0 var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--silver);
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-board);
  border-radius: var(--radius-sm);
}

/* --- form --- */
.ff-bug-form {
  display: flex;
  flex-direction: column;
}

.ff-bug-field {
  display: block;
  margin-bottom: var(--spacing-md);
}

.ff-bug-label {
  display: block;
  margin-bottom: 4px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ff-bug-req {
  color: var(--copper-light);
}

.ff-bug-input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-family: 'Crimson Pro', serif;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--cream);
  background: var(--bg-mid);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.ff-bug-input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.ff-bug-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.25);
}

.ff-bug-textarea {
  resize: vertical;
  min-height: 4.5em;
}

.ff-bug-select {
  /* Some engines fall back to the system font on select elements; be explicit */
  font-family: 'Crimson Pro', serif;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.ff-bug-checkline {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

.ff-bug-check {
  width: 16px;
  height: 16px;
  accent-color: var(--copper);
  cursor: pointer;
}

.ff-bug-error {
  margin: 0 0 var(--spacing-sm);
  font-size: 0.82rem;
  color: var(--copper-light);
}

.ff-bug-status {
  margin: var(--spacing-sm) 0 0;
  font-size: 0.8rem;
  color: var(--accent-side);
}

.ff-bug-note {
  margin: 0 0 var(--spacing-md);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* The "are you sure" bar, shown only when Escape or Cancel would throw away
   typing. Inline rather than a native confirm(): a blocking dialog on top of a
   dialog is worse, and this one can be styled to look like it belongs. */
.ff-bug-discard {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-mid);
  border: 1px solid var(--copper);
  border-radius: var(--radius-sm);
}

.ff-bug-discard__text {
  flex: 1 1 200px;
  font-size: 0.8rem;
  color: var(--cream);
}

/* --- buttons --- */
.ff-bug-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.ff-bug-actions--wrap {
  flex-wrap: wrap;
}

.ff-bug-btn {
  font-family: 'Oswald', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-light);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ff-bug-btn:hover,
.ff-bug-btn:focus-visible {
  color: var(--cream);
  border-color: var(--copper);
}

.ff-bug-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.ff-bug-btn--primary {
  background: var(--copper);
  border-color: var(--copper);
  color: #16130f;
}

.ff-bug-btn--primary:hover,
.ff-bug-btn--primary:focus-visible {
  background: var(--copper-light);
  border-color: var(--copper-light);
  color: #16130f;
}

.ff-bug-btn--ghost {
  background: transparent;
}

.ff-bug-btn--danger {
  color: var(--player-red);
  border-color: rgba(192, 57, 43, 0.5);
}

.ff-bug-btn--danger:hover,
.ff-bug-btn--danger:focus-visible {
  color: var(--cream);
  background: var(--player-red);
  border-color: var(--player-red);
}

/* Armed = the second half of the two-click "Clear all" confirmation */
.ff-bug-btn--armed {
  background: var(--player-red);
  border-color: var(--player-red);
  color: var(--cream);
}

.ff-bug-btn--small {
  padding: 4px var(--spacing-sm);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}

.ff-bug-foot {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--border);
  text-align: right;
}

.ff-bug-link {
  padding: 2px 4px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
}

.ff-bug-link:hover,
.ff-bug-link:focus-visible {
  color: var(--gold);
}

/* --- confirmation facts --- */
.ff-bug-facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px var(--spacing-md);
  margin: 0 0 var(--spacing-md);
  font-size: 0.82rem;
}

.ff-bug-fact-term {
  font-family: 'Oswald', sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  align-self: center;
}

.ff-bug-fact-value {
  margin: 0;
  color: var(--cream);
  /* Filenames and report IDs are long and unbreakable; let them wrap rather
     than push the card sideways */
  overflow-wrap: anywhere;
}

/* --- archive list --- */
.ff-bug-empty {
  margin: 0 0 var(--spacing-md);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ff-bug-list {
  list-style: none;
  margin: 0 0 var(--spacing-md);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.ff-bug-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.ff-bug-row__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ff-bug-row__title {
  font-size: 0.88rem;
  color: var(--cream);
  overflow-wrap: anywhere;
}

.ff-bug-row__sub {
  font-family: 'Oswald', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ff-bug-row__actions {
  display: flex;
  gap: var(--spacing-xs);
  flex-shrink: 0;
}

/* --- tablet portrait ---
   The most recent layout work gave the map the screen on tablets; this modal
   has to behave the same way, so it goes near-full-width and lets its own body
   scroll rather than growing past the viewport. */
@media (max-width: 900px) {
  .ff-bug-card {
    width: 100%;
    max-height: 90vh;
    padding: var(--spacing-md) var(--spacing-lg);
  }

  /* The handle's bleed has to follow the card's padding, or the grab strip
     stops lining up with the top of the dialog */
  .ff-bug-head--draggable {
    margin: calc(var(--spacing-md) * -1) calc(var(--spacing-lg) * -1) var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-sm);
  }

  .ff-bug-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ff-bug-row__actions {
    justify-content: flex-end;
  }
}

/* --- phone strip ---
   Below 700px the label would eat the corner the action row now occupies, so
   the launcher shrinks to the beetle alone. */
@media (max-width: 700px) {
  .ff-bug-launch {
    padding: 8px 10px;
    border-radius: 50%;
  }

  .ff-bug-launch__label {
    /* Not `visibility` — the label must stop taking space, but it stays in the
       accessibility tree via the button's aria-label. */
    display: none;
  }

  .ff-bug-launch__glyph {
    font-size: 1.15rem;
  }

  .ff-bug-modal {
    padding:
      max(var(--spacing-sm), env(safe-area-inset-top))
      max(var(--spacing-sm), env(safe-area-inset-right))
      max(var(--spacing-sm), env(safe-area-inset-bottom))
      max(var(--spacing-sm), env(safe-area-inset-left));
  }

  .ff-bug-actions {
    flex-direction: column-reverse;
  }

  .ff-bug-actions .ff-bug-btn {
    width: 100%;
  }

  .ff-bug-row__actions .ff-bug-btn {
    width: auto;
  }
}

/* Respect a reduced-motion preference: the fade is decoration, not signal */
@media (prefers-reduced-motion: reduce) {
  .ff-bug-modal { animation: none; }
  .ff-bug-card--nudge { animation: none; }
  .ff-bug-launch,
  .ff-bug-btn { transition: none; }
}

/* ===== Bug reporter — "email us the file" callout ======================== */

/* The report is only useful once it reaches us, and the browser can get it no
   further than the player's Downloads folder. This block is the one part of the
   confirmation screen that has to be read, so it is the one part that is
   tinted: copper on a warm wash, matching the primary action colour. */
.ff-bug-callout {
  margin: 0 0 var(--spacing-md);
  padding: var(--spacing-md);
  border: 1px solid var(--copper);
  border-left-width: 3px;
  border-radius: var(--radius-md);
  background: rgba(196, 114, 58, 0.10);
}

.ff-bug-callout__title {
  margin: 0 0 6px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--copper-light);
}

.ff-bug-callout__body {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text);
}

/* The filename carries the player's own typed title, so it can be long and can
   contain anything. Break it anywhere rather than let it widen the dialog. */
.ff-bug-callout__file {
  font-weight: 600;
  color: var(--text-bright, var(--text));
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ff-bug-callout__mail {
  color: var(--copper-light);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ff-bug-callout__mail:hover,
.ff-bug-callout__mail:focus-visible {
  color: var(--gold);
}

/* "Email this report" is an <a>, not a <button>, so it needs the box model the
   button base takes for granted. */
a.ff-bug-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

a.ff-bug-btn:hover,
a.ff-bug-btn:focus-visible {
  text-decoration: none;
}

/* ---------------------------------------------------------------------------
   Race goals (goalMode 'race'). Four single cards replace the classic stacks.
   Each card is either the real artwork with the claimants' workers laid over its
   printed circles (--art), or an HTML card (--fallback) used until the art exists.
   Category colours match the printed band: pagoda red, bridge teal, worker blue.
   --------------------------------------------------------------------------- */

/* Setup: the small "new" flag beside the switch title */
.ff-setup__new-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.1em;
  vertical-align: 0.1em;
  color: #2b1f08;
  background: var(--gold);
  border-radius: 8px;
}

.ff-race-card {
  position: relative;
  margin-bottom: 8px;
  background: var(--sec-card, #fdf6dd);
  border: 2px solid var(--sec-edge, #b8860b);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--sec-ink-soft, #6d5716);
  font-size: 0.8rem;
  line-height: 1.3;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.ff-race-card--ready {
  border-color: #1b8f52;
}

/* Spent for this player (already claimed it) or no space left */
.ff-race-card--mine,
.ff-race-card--full {
  opacity: 0.72;
}

.ff-race-card--claimable {
  cursor: pointer;
  border-color: #1b8f52;
  box-shadow: 0 0 0 2px rgba(27, 143, 82, 0.45), 0 0 14px rgba(27, 143, 82, 0.55);
}

.ff-race-card--claimable:hover {
  box-shadow: 0 0 0 3px #1b8f52, 0 0 18px rgba(27, 143, 82, 0.75);
}

/* Fallback: title band in the category colour */
.ff-race-band {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.ff-race-band-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

.ff-race-name {
  flex: 1 1 auto;
  min-width: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
}

.ff-race-cat {
  flex: none;
  padding: 0 6px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
}

.ff-race-body {
  padding: 6px 8px 4px;
}

.ff-race-text {
  display: block;
  color: var(--sec-ink, #3b2a05);
  font-size: 0.8rem;
  line-height: 1.3;
}

.ff-race-spaces {
  display: flex;
  justify-content: space-around;
  margin-top: 8px;
}

.ff-race-space {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  border: 2px dashed var(--sec-edge, #b8860b);
}

.ff-race-space-vp {
  font-family: 'Oswald', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sec-ink, #3b2a05);
}

.ff-race-space--claimed {
  border: 2px solid var(--claimant, var(--sec-edge));
  background: color-mix(in srgb, var(--claimant, #888) 22%, #fff);
}

.ff-race-space--claimed img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.ff-race-space-vp--tag {
  position: absolute;
  right: -6px;
  bottom: -6px;
  min-width: 20px;
  padding: 0 3px;
  font-size: 0.7rem;
  line-height: 1.5;
  text-align: center;
  color: #fff;
  background: var(--claimant, #444);
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 10px;
}

/* A space that does not exist at this player count (the 4 VP space at two players) */
.ff-race-space--void,
.ff-race-art-void {
  background: repeating-linear-gradient(
    45deg, rgba(0, 0, 0, 0.16) 0 4px, rgba(0, 0, 0, 0.03) 4px 8px);
  border: 2px solid rgba(0, 0, 0, 0.25);
}

/* Art: the card face with workers laid over the printed circles */
.ff-race-art-title {
  padding: 2px 8px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sec-ink, #3b2a05);
  border-bottom: 1px solid var(--sec-edge, #b8860b);
}

.ff-race-art {
  position: relative;
  aspect-ratio: 1264 / 836;
  background: #2a2118;
}

.ff-race-art-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.ff-race-art-worker {
  position: absolute;
  height: auto;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

.ff-race-art-void {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ff-race-caption {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 8px 2px;
}

.ff-race-caption-cat {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px 0 3px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  border-radius: 8px;
}

.ff-race-caption-cat img {
  width: 13px;
  height: 13px;
  object-fit: contain;
}

.ff-race-note {
  padding: 0 8px;
  font-size: 0.68rem;
  font-style: italic;
  color: var(--sec-ink-soft, #6d5716);
}

.ff-race-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 8px 6px;
  font-size: 0.74rem;
}

.ff-race-progress strong {
  color: var(--sec-ink, #3b2a05);
}

/* The space the next claim will take */
.ff-race-space--next {
  border-style: solid;
  border-color: #9a6b06;
  background: #fff3c4;
}

/* Badges on a light card: the dark-theme ones in the Goal Zone are tuned for dark panels */
.ff-race-card .ff-goal-badge--met {
  background: #1b8f52;
  border: 1px solid #14663a;
  color: #f2fff7;
}

.ff-race-card .ff-goal-badge--unmet,
.ff-race-card .ff-goal-badge--spent {
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.28);
  color: #6a5730;
}

/* Taller than the classic panel list, so the host must not be capped at 60vh
   (the classic modal is, which clips its own backdrop - left as it was). */
.ff-action-column #actionPanel.ff-modal-host--race {
  max-height: none;
  overflow-y: visible;
}

/* Modal: the four cards at a size worth reading, two across */
.ff-race-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.ff-race-grid .ff-race-card {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.ff-race-card--large .ff-race-name { font-size: 1.1rem; }
.ff-race-card--large .ff-race-text { font-size: 0.92rem; }
.ff-race-card--large .ff-race-space { width: 56px; height: 56px; }
.ff-race-card--large .ff-race-space--claimed img { width: 38px; height: 38px; }

.ff-race-reason {
  padding: 4px 8px 6px;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--sec-ink-soft, #6d5716);
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}

/* End screen: who took which space of each race card */
.ff-end-race {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  text-align: left;
}

.ff-end-race h2 {
  margin: 0 0 var(--spacing-sm);
  font-size: 1rem;
  color: var(--gold);
}

.ff-end-race-card {
  display: grid;
  grid-template-columns: 9em 1fr;
  gap: 2px var(--spacing-md);
  padding: var(--spacing-xs) 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.ff-end-race-card:last-child { border-bottom: none; }
.ff-end-race-name { font-weight: 600; }
.ff-end-race-text { color: var(--text-muted); font-size: 0.75rem; }
.ff-end-race-claims { grid-column: 2; display: flex; flex-wrap: wrap; gap: var(--spacing-md); }
.ff-end-race-claim { display: inline-flex; align-items: center; gap: 4px; }
.ff-end-race-claim img { width: 18px; height: 18px; object-fit: contain; }
.ff-end-race-claim strong { color: var(--gold); }
