/* Honeycomb — pointy-top hex tiles, ghost grid, arrange-mode states.
   Ported from V:\_nginx\www\css\honeycomb.css and repaletted to WarmUp dark tokens. */

.wu-honeycomb-pane {
  position: relative;
  overflow: hidden;
}

/* Extended board (37 tiles, 7 rows) — same viewport-adaptive rule with the
   larger divisor (flower + ghost ring ≈ 8.1 hex-widths tall) */
.wu-board-extended {
  --hex-w: clamp(56px, calc((var(--vh) - 56px) / 8.2), 96px);
  /* Must re-declare: var() inside a custom property resolves where it's
     DECLARED (:root), so --hex-h would otherwise keep the standard-board
     height and stretch the extended tiles vertically. */
  --hex-h: calc(var(--hex-w) * 1.1547);
  --hex-gap: 4px;
}

@media (max-width: 720px) {
  .wu-board-extended {
    --hex-w: clamp(48px, calc((var(--vh) - 56px) / 8.2), 72px);
    --hex-h: calc(var(--hex-w) * 1.1547);
    --hex-gap: 2px;
  }
}

/* Ghost background grid — sits behind the active flower */
.wu-hex-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.wu-ghost-hex {
  position: absolute;
  width: var(--hex-w);
  height: var(--hex-h);
}
.wu-ghost-hex::before {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  /* 1px ring = the lattice line */
  background: var(--colour-grid-line);
}
.wu-ghost-hex::after {
  content: '';
  position: absolute;
  inset: 1px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  /* Matches the pane bg so cell fill and gap blend into one padding zone */
  background: var(--colour-grid-bg);
}

/* Stage centring wrapper — absolutely fills the pane so the flower is
   always centred regardless of the document height chain */
.wu-honeycomb-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  transition: opacity 180ms ease;
}

/* Crossfade between sub-flowers */
.wu-honeycomb-wrap.wu-fade-out {
  opacity: 0;
}

/* Absolute-positioned stage — width/height set by JS */
.wu-honeycomb-stage {
  position: relative;
  z-index: 1;
}

/* Tile wrapper. Hexes nest, so adjacent wraps overlap as rectangles —
   pointer events are disabled here and re-enabled on the hex-clipped hit
   layer below, so a tap only ever lands on the tile whose hexagon is
   visibly under the finger. */
.wu-hex-wrap {
  position: absolute;
  width: var(--hex-w);
  height: var(--hex-h);
  opacity: 0;
  animation: wu-fadeUp 0.5s forwards cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  touch-action: manipulation;
  /* No system copy/share callout on a held tile. */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Transparent hit layer — the tile's true (hexagonal) tap target */
.wu-hex-hit {
  position: absolute;
  inset: 0;
  z-index: 4;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
}

.wu-honeycomb-stage.no-animate .wu-hex-wrap {
  animation: none;
  opacity: 1;
}

@keyframes wu-fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wu-hex {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 220ms cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* Outline layer — resting outline carries the tile's own colour (softened);
   hover takes it to full strength. */
.wu-hex::before {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: color-mix(in srgb, var(--tile-color) 55%, var(--colour-border));
  transition: background 220ms ease;
}

/* Surface layer — inset = outline thickness. Pending tiles carry a whisper
   of their activity colour (8%); hover 18%, completed 28%, confirmed 55%. */
.wu-hex::after {
  content: '';
  position: absolute;
  inset: var(--hex-outline);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: color-mix(in srgb, var(--tile-color) 8%, var(--colour-surface));
  transition: background 220ms ease;
}

/* Inner content */
.wu-hex-inner {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Scales with the tile (v291, owner: "check the gap between the text and logo
     on the subflowers"). A flat 4px sat fine under a 20px home icon but reads
     as crowding under a sub-flower's 45px one — the icon grew with --hex-w and
     the space between them did not. Floored at the old value so small tiles are
     unchanged. */
  gap: max(var(--space-xs), calc(var(--hex-w) * 0.055));
  pointer-events: none;
  user-select: none;
  padding: 0 var(--space-md);
  text-align: center;
}

/* Icon + label scale with the TILE (--hex-w), not the viewport — vw-based
   sizing oversized icons on landscape tablets where tiles are vh-driven
   (worst on the extended board). Ratios match the old desktop look at the
   132px max tile. */
.wu-hex-icon {
  font-size: calc(var(--hex-w) * 0.3);
  line-height: 1;
}

.wu-hex-icon-img {
  width: calc(var(--hex-w) * 0.32);
  height: calc(var(--hex-w) * 0.32);
  object-fit: contain;
  display: block;
}

.wu-hex-label {
  /* Floor raised 8px → 10px (v288 audit). Sub-flowers and the games launcher
     RELY on their labels — Memory vs Survivor vs Stack is not readable from an
     emoji — so unlike the home flower they cannot simply drop them, which makes
     the floor the only lever. 8px was below the project's own legibility line. */
  font-size: clamp(10px, calc(var(--hex-w) * 0.085), var(--font-size-xs));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--colour-text-secondary);
  transition: color 220ms ease;
  line-height: 1.2;
}

/* Hover — suppressed in arrange mode, and ENTIRELY absent on .wu-static
   stages (the game boards): on touchscreens :hover sticks to the last-tapped
   tile, which left game tiles looking permanently "active" and masked their
   real state classes (owner report 2026-07-12). Nav flowers keep hover. */
body:not(.wu-edit-mode) .wu-honeycomb-stage:not(.wu-static) .wu-hex-wrap:not(.wu-locked):hover .wu-hex {
  transform: translateY(-4px);
  filter: drop-shadow(0 6px 16px color-mix(in srgb, var(--tile-color) 45%, transparent));
}
body:not(.wu-edit-mode) .wu-honeycomb-stage:not(.wu-static) .wu-hex-wrap:not(.wu-locked):hover .wu-hex::before {
  background: var(--tile-color);
}
body:not(.wu-edit-mode) .wu-honeycomb-stage:not(.wu-static) .wu-hex-wrap:not(.wu-locked):hover .wu-hex::after {
  background: color-mix(in srgb, var(--tile-color) 18%, var(--colour-surface));
}
body:not(.wu-edit-mode) .wu-honeycomb-stage:not(.wu-static) .wu-hex-wrap:not(.wu-locked):hover .wu-hex-label {
  color: var(--colour-text-primary);
}

/* Locked tile (sub-flower breadcrumb anchors) — distinct, never hover-lifted */
.wu-hex-wrap.wu-locked .wu-hex::before {
  background: var(--colour-accent);
}
.wu-hex-wrap.wu-locked .wu-hex::after {
  background: color-mix(in srgb, var(--colour-accent) 14%, var(--colour-surface));
}
.wu-hex-wrap.wu-locked .wu-hex-label {
  font-family: var(--font-display);
  /* Floor 9px → 10px. The v288 audit raised the general label to 10 and left
     the WORDMARK at 9, which only shows on a board whose hex lands between 84px
     (below that the wordmark is dropped entirely, further down) and 100px —
     a band nothing had been audited in until 🔺 Tangram's picker, where it
     measured 9.9px. Same floor as its sibling now, and it fixes the same band
     on 🧠 Memory, ⚔️ Survivor and the home chip. */
  font-size: clamp(10px, calc(var(--hex-w) * 0.1), var(--font-size-sm));
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.16em;
  color: var(--colour-text-primary);
}
.wu-hex-wrap.wu-locked { cursor: default; }

/* Centre brand tile only — solid amber hex + white star, matching the app icon
   (decision #56). Scoped to the brand tile so sub-flower anchors keep their
   accent look above. */
.wu-hex-wrap.wu-brand-tile .wu-hex::before {
  background: var(--colour-brand-deep);
}
.wu-hex-wrap.wu-brand-tile .wu-hex::after {
  background: var(--colour-brand);
}
.wu-hex-wrap.wu-brand-tile .wu-hex-icon,
.wu-hex-wrap.wu-brand-tile .wu-hex-label {
  color: #fff;
}
/* The brand tile's icon is ALWAYS the ★ text — never an image — so its box can
   take the tile's width instead of the narrow declared one every other icon
   needs for image sizing. Without this the ★, which this font draws about 1.4em
   wide, measured as overflowing its own box at every size (58px box, 64px glyph
   on a 150px tile) while sitting well inside a tile that clips nothing. It is
   the last piece of the "★ overflow" finding carried as deferred since #88, and
   it was a measurement artefact rather than a game problem. */
.wu-hex-wrap.wu-brand-tile .wu-hex-icon {
  width: 100%;
}
/* Once today's warm-up is done the centre is 🎮 Games (home.js). A colour emoji
   ignores `color`, so it is drawn as a white silhouette to sit on the amber like
   the ★ does, the same treatment as the games launcher's own 🎮. */
.wu-hex-wrap.wu-brand-tile.wu-centre-games .wu-hex-icon {
  filter: brightness(0) invert(1);
}

/* ── Completion states ──────────────────────────────────── */

.wu-hex-check {
  position: absolute;
  top: 26%;
  right: 24%;
  /* Floors, not bare ratios (v289 audit). On a phone sub-flower the badge fell
     to 5px — invisible, which defeats its entire job: decision #71 put this
     tick here so the child sees an exercise is already spent BEFORE starting it
     rather than after three minutes of work. */
  width: max(16px, calc(var(--hex-w) * 0.18));
  height: max(16px, calc(var(--hex-w) * 0.18));
  border-radius: 50%;
  background: var(--tile-color);
  color: var(--colour-bg);
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: max(10px, calc(var(--hex-w) * 0.105));
  font-weight: 800;
  line-height: 1;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.wu-hex-wrap.wu-completed .wu-hex-check,
.wu-hex-wrap.wu-confirmed .wu-hex-check { display: flex; }

/* A MARK rather than a count (🗺️ on a quest tile). Same corner, but it must not
   wear --colour-danger: red in this app means "needs attention", and a quest is
   simply what the tile IS. Surface-coloured with the tile's own outline so it
   reads as part of the tile, and floored like every other badge so it survives a
   compact board — which is exactly where it matters most, since labels are
   hidden there and the mark is then the ONLY thing distinguishing a quest from
   an ordinary tile of the same subject. */
.wu-hex-badge.wu-hex-badge-mark {
  background: var(--colour-surface);
  color: var(--colour-text-primary);
  border: 2px solid var(--tile-color);
  font-family: var(--font-body);
  font-size: max(11px, calc(var(--hex-w) * 0.115));
}

/* A mark may be an activity ICON, and several of this app's are SVG files.
   Sized against the badge rather than the hex so it can never outgrow its own
   pip on a large board. */
.wu-hex-badge-img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  display: block;
}

/* Count badge (e.g. Parent tile's pending confirmations) — top-right pip */
.wu-hex-badge {
  position: absolute;
  top: 20%;
  right: 18%;
  min-width: max(16px, calc(var(--hex-w) * 0.22));
  height: max(16px, calc(var(--hex-w) * 0.22));
  padding: 0 calc(var(--hex-w) * 0.04);
  border-radius: 999px;
  background: var(--colour-danger);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: calc(var(--hex-w) * 0.12);
  font-weight: 800;
  line-height: 1;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

/* Completed — child self-marked, awaiting parent confirmation (~28% fill) */
.wu-hex-wrap.wu-completed .wu-hex::before { background: var(--tile-color); }
.wu-hex-wrap.wu-completed .wu-hex::after {
  background: color-mix(in srgb, var(--tile-color) 28%, var(--colour-surface));
}
.wu-hex-wrap.wu-completed .wu-hex-label { color: var(--colour-text-primary); }

/* Confirmed — parent signed off at end of week (~55% fill, brighter) */
.wu-hex-wrap.wu-confirmed .wu-hex::before { background: var(--tile-color); }
.wu-hex-wrap.wu-confirmed .wu-hex::after {
  background: color-mix(in srgb, var(--tile-color) 55%, var(--colour-surface));
}
.wu-hex-wrap.wu-confirmed .wu-hex-label { color: var(--colour-text-primary); }

/* ── Arrange mode ───────────────────────────────────────── */

.wu-hex-wrap.wu-pressing:not(.wu-locked) .wu-hex::before {
  background: color-mix(in srgb, var(--colour-text-secondary) 60%, var(--colour-border));
}

.wu-hex-wrap.wu-selected .wu-hex {
  transform: translateY(-6px) scale(1.06);
  filter: drop-shadow(0 8px 20px color-mix(in srgb, var(--tile-color) 50%, transparent));
}
.wu-hex-wrap.wu-selected .wu-hex::before { background: var(--tile-color) !important; }
.wu-hex-wrap.wu-selected .wu-hex::after {
  background: color-mix(in srgb, var(--tile-color) 22%, var(--colour-surface)) !important;
}

.wu-hex-wrap.wu-swap-target .wu-hex::before {
  background: var(--tile-color);
  animation: wu-pulse 700ms ease-in-out infinite alternate;
}

@keyframes wu-pulse {
  from { opacity: 0.3; }
  to   { opacity: 0.65; }
}

/* Hint bar — also the explicit way OUT of arrange mode (✓ Done). It stays
   pointer-events:none when hidden so it can never swallow a tap on the flower;
   only the visible, arranging state accepts input. */
.wu-edit-hint {
  position: fixed;
  bottom: calc(var(--space-lg) + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: color-mix(in srgb, var(--colour-text-primary) 88%, transparent);
  color: var(--colour-bg);
  font-size: var(--font-size-xs);
  letter-spacing: 0.06em;
  padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-lg);
  border-radius: var(--radius-pill);
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 300;
  white-space: nowrap;
}

body.wu-edit-mode .wu-edit-hint {
  opacity: 1;
  pointer-events: auto;
}

.wu-edit-hint-done {
  min-height: 36px;
  padding: 0 var(--space-md);
  border: none;
  border-radius: var(--radius-pill);
  background: var(--colour-brand);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.wu-edit-hint-done:active { background: var(--colour-brand-deep); }

/* Help mode bar (#211) — the same shape as the arrange hint, and the same rule:
   hidden, it can never swallow a tap. Its own class so the two modes can never
   show each other's bar. */
.wu-help-bar {
  position: fixed;
  bottom: calc(var(--space-lg) + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  max-width: calc(100vw - 2 * var(--space-md));
  box-sizing: border-box;
  background: color-mix(in srgb, var(--colour-text-primary) 88%, transparent);
  color: var(--colour-bg);
  font-size: var(--font-size-xs);
  letter-spacing: 0.04em;
  padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-lg);
  border-radius: var(--radius-pill);
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 300;
}
body.wu-help-mode .wu-help-bar {
  opacity: 1;
  pointer-events: auto;
}
.wu-help-bar-text { flex: 1 1 auto; min-width: 0; }
.wu-help-bar .wu-help-q {
  display: inline-grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--colour-accent);
  color: #fff;
  font-weight: var(--font-weight-bold);
}
.wu-help-bar-done {
  flex: none;
  min-height: 44px;
  padding: 0 var(--space-md);
  border: none;
  border-radius: var(--radius-pill);
  background: var(--colour-brand);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.wu-help-bar-done:active { background: var(--colour-brand-deep); }

/* The ? chip is a toggle (#215) — FILLED in the accent while help mode is on,
   so the button itself says the mode is running. */
body.wu-help-mode .wu-rail .wu-help-chip,
body.wu-help-mode .wu-help-chip {
  background: var(--colour-accent);
  color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--colour-accent) 30%, transparent);
}
/* Tiles with a card pulse gently while help mode is on, so the child sees
   what can be asked about. */
/* EVERY TILE IN COLOUR while help mode is on (#216, owner: "colour is
   enough and it helps to make a difference between modes too"). A locked tile
   shows what it will look like; its card says the level it opens at, and a tap
   in help mode only ever opens the card. Back to grey when the mode ends. */
body.wu-help-mode .wu-honeycomb-wrap .wu-hex-wrap.wu-game-soon {
  filter: none;
  opacity: 1;
}
body.wu-help-mode .wu-honeycomb-wrap .wu-hex-wrap:not(.wu-locked) .wu-hex {
  animation: wu-help-pulse 1.6s ease-in-out infinite;
}
@keyframes wu-help-pulse {
  0%, 100% { filter: none; }
  50% { filter: brightness(1.08) saturate(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  body.wu-help-mode .wu-honeycomb-wrap .wu-hex-wrap .wu-hex { animation: none; }
}

/* Phone: the MAIN flower shows icons only (v273, owner: "on mobile remove text
   from the main flower tiles. Keep logo only as it is not easy to read").
   At the phone hex size the label renders around 5px — small enough to be
   noise rather than information, and it crowds the icon that actually carries
   the meaning. The icon grows into the space it frees.

   Scoped to the HOME pane deliberately: sub-flowers and games rely on their
   labels (Flashcard vs Matching vs Path is not readable from an emoji alone),
   and the locked centre chip keeps its wordmark as the app's own signature. */
/* Gated on the RESOLVED hex size, not the viewport (v287). `data-compact` is
   written by applyHexSize in honeycomb.js — the one function that owns
   --hex-w — so it accounts for the two things a width query cannot see: a
   landscape screen that is wide but short (hexes shrink, the query never
   fires, and the labels came back — owner report 2026-08-15), and an extended
   37-tile board, which is smaller again at the same viewport.

   Still scoped to the HOME flower: a sub-flower's label is the only thing that
   distinguishes Spell it from Matching from Path, none of which an emoji alone
   conveys, and the locked centre chip keeps its wordmark as the app's
   signature. Home tiles are the ones whose icon already carries the meaning. */
.wu-home .wu-honeycomb-stage[data-compact="1"] .wu-hex-wrap:not(.wu-locked) .wu-hex-label {
  display: none;
}
.wu-home .wu-honeycomb-stage[data-compact="1"] .wu-hex-wrap:not(.wu-locked) .wu-hex-icon {
  font-size: calc(var(--hex-w) * 0.42);
}
.wu-home .wu-honeycomb-stage[data-compact="1"] .wu-hex-wrap:not(.wu-locked) .wu-hex-icon-img {
  width: calc(var(--hex-w) * 0.44);
  height: calc(var(--hex-w) * 0.44);
}

/* The centre chip's WORDMARK goes too, but only when compact (v287, found by
   the cross-device screengrab pass): its size is clamp(9px, hex-w*0.1, 14px),
   so on an extended 37-tile board at phone size — 42px hexes — it is pinned at
   the 9px floor while the tile keeps shrinking, and "WARMUP" renders wider than
   the hex it sits in (captured mid-clip as "WARMUR"). The ★ alone is the app's
   mark at that size; it grows into the space the word leaves. */
/* NOT scoped to .wu-home, unlike the two rules above — and the comment above is
   the reason: "the ★ alone is the app's mark at that size" is true wherever the
   brand tile appears, and it has nothing to do with being on the home flower.
   The home scoping exists for ACTIVITY labels (Spell it vs Matching vs Path,
   which an emoji cannot convey); the wordmark is never load-bearing.
   🧠 Memory and ⚔️ Survivor both put the brand tile at their board's centre, so
   they were the two boards left with a 9px wordmark and a ★ wider than its own
   icon box — the finding carried as "deferred pending a game revamp" since #88.
   It needed no revamp; it needed this selector to say what it meant. */
.wu-honeycomb-stage[data-compact="1"] .wu-hex-wrap.wu-locked .wu-hex-label {
  display: none;
}
.wu-honeycomb-stage[data-compact="1"] .wu-hex-wrap.wu-locked .wu-hex-icon {
  font-size: calc(var(--hex-w) * 0.42);
  /* The box is made to tell the truth about the room the glyph has. As a flex
     item the icon sized to its CONTENT (38px inside a 74px tile), so the ★ —
     which this font draws about 1.4em wide — measured as "text overflows by
     13px" while sitting comfortably inside a tile that clips nothing. Nothing
     moves visually (it was already centred); what changes is that the audit now
     measures what it claims to. Per #121: fix a false positive at source rather
     than learn to ignore the finding. */
  width: 100%;
  text-align: center;
}
/* With the label gone, the inner's 16px side padding is pure loss — it exists
   to keep TEXT off the hex's slanted edges, and there is no text left. On a
   42px tile (⚔️ Survivor's 61-cell board on a phone) it was leaving a **10px**
   content box, so the ★ had nowhere to sit and spilled 5px however it was
   sized. This is the same squeeze on any compact tile whose label is hidden,
   so both cases get it. */
.wu-honeycomb-stage[data-compact="1"] .wu-hex-wrap.wu-locked .wu-hex-inner,
.wu-home .wu-honeycomb-stage[data-compact="1"] .wu-hex-wrap:not(.wu-locked) .wu-hex-inner {
  padding-inline: 0;
}

/* ── Celebration (Phase 6) ───────────────────────────────────────────────────
   The last unbuilt item of Phase 6. Completing a tile — the thing a child does
   four to eight times a day — previously just… filled a tile.

   Three rules shaped all of it:

   1. FREQUENCY SETS THE BUDGET. A tile completion happens up to 8 times a day,
      so it gets ~600ms, no overlay, and never blocks a tap. The weekly flower
      happens once, so it can afford a full second and a wave across the board.
   2. IT MUST FIRE ON THE EVENT, NOT THE STATE. `refresh()` rebuilds every tile,
      so a rule on `.wu-completed` would replay on page load, on every 30s sync
      pull and on every unrelated refresh. Hence the one-shot classes, added by
      honeycomb's `celebrate()`/`cheer()` and removed on animationend.
   3. HEXAGONS, NOT CONFETTI. The motif is already the hex; a halo in the tile's
      own colour belongs here in a way that particles would not. It also needs
      no assets, which an offline-first app with no build step cares about. */

/* The everyday moment: a pop, a ✓, and a halo in the tile's own colour. */
.wu-hex-wrap.wu-just-done .wu-hex {
  animation: wu-done-pop 560ms cubic-bezier(0.22, 1, 0.36, 1);
}
.wu-hex-wrap.wu-just-done .wu-hex-check {
  animation: wu-done-check 560ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* The halo lives on the WRAP: .wu-hex clips its own children, so anything drawn
   inside could never grow past the tile's edge. */
.wu-hex-wrap.wu-just-done::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--tile-color, var(--colour-accent));
  animation: wu-done-halo 620ms ease-out forwards;
  pointer-events: none;
  z-index: 0;
}

@keyframes wu-done-pop {
  0%   { transform: scale(1); }
  38%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes wu-done-check {
  0%   { transform: scale(0.2); opacity: 0; }
  55%  { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes wu-done-halo {
  from { transform: scale(1); opacity: 0.5; }
  to   { transform: scale(1.6); opacity: 0; }
}

/* The weekly payoff: a wave outward from the centre. The delay is per-tile,
   set from its measured distance to the stage centre (see honeycomb `cheer`). */
.wu-hex-wrap.wu-cheer .wu-hex {
  animation: wu-cheer-pop 700ms cubic-bezier(0.22, 1, 0.36, 1);
  animation-delay: var(--cheer-delay, 0ms);
}
@keyframes wu-cheer-pop {
  0%   { transform: scale(1); filter: brightness(1); }
  40%  { transform: scale(1.16); filter: brightness(1.18); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* The finished flower's confetti (#396). Rule 3 above said hexagons, not
   confetti; the owner asked for the landing page's burst in the app, so it is
   confetti made MOSTLY of hexes. Fixed to the viewport so it can fly over the
   🌼 sheet that opens at the same moment; never takes a tap. */
.wu-burst { position: fixed; z-index: 460; width: 0; height: 0; pointer-events: none; }
.wu-burst i {
  position: absolute; left: -5px; top: -7px; width: 10px; height: 14px; border-radius: 2px;
  opacity: 0; animation: wu-burst-fly 1.5s cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
}
.wu-burst i.wu-burst-hex {
  width: 14px; height: 16px; border-radius: 0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
@keyframes wu-burst-fly {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0) scale(0.4); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 90px)) rotate(var(--r)) scale(1); }
}

/* Respect the setting — and note honeycomb.css had NO reduced-motion block at
   all before this, so the arrange-mode pulse and the build-in fade were never
   covered either. Fixed here rather than left for the next person to find. */
@media (prefers-reduced-motion: reduce) {
  .wu-hex-wrap.wu-just-done .wu-hex,
  .wu-hex-wrap.wu-just-done .wu-hex-check,
  .wu-hex-wrap.wu-cheer .wu-hex,
  .wu-hex-wrap.wu-just-done::after {
    animation: none;
  }
  .wu-burst { display: none; }
  /* The ✓ must still ARRIVE — only its motion is dropped. */
  .wu-hex-wrap.wu-just-done .wu-hex-check { opacity: 1; }
  .wu-hex-wrap { animation-duration: 0.01ms; }
}

/* BEHIND AN ACTIVITY THE LATTICE IS WALLPAPER (#243, owner 2026-11-16: "hex
   background appears incomplete … fade the grid line colours so it's less
   prominent … colour too close to the text font colour"). The flower's slots
   used to stay empty while it hid behind a drill, leaving a flower-shaped
   hole; they are now drawn and shown only then. And the lines drop to half
   strength, so the question text is the darkest thing on the screen. The
   home and game boards keep the full line: there the lattice is the room the
   board lives in, not a background. */
.wu-ghost-under { visibility: hidden; }
.wu-hex-bg:has(~ .wu-honeycomb-wrap.wu-hidden) .wu-ghost-under { visibility: visible; }
/* The flower moved aside for the week/profile cards (#289): no hole left behind. */
.wu-flower-aside > .wu-hex-bg .wu-ghost-under { visibility: visible; }
.wu-hex-bg:has(~ .wu-honeycomb-wrap.wu-hidden) { opacity: 0.5; }

/* ── 🗂 Practice as a list (#256) ───────────────────────────────── wu-fl-
   The flower's 19 tiles with their names. Frosted like the App menu so the
   lattice still shows through. ON EVERY SCREEN since v549 (owner, 2026-11-18:
   "make the icon view the default for practice list as it gives further
   flexibility to extend the type of activities. (mobile, tablet, web)") — a
   flower is capped at 19 tiles, a list is not. Practice only: the home flower
   is the week itself, where position IS the information. */
.wu-fl { display: none; }

@media all {
  /* List mode: the flower steps back, the list takes the pane. */
  .wu-honeycomb-wrap.wu-fl-on > .wu-honeycomb-stage { visibility: hidden; }
  .wu-honeycomb-wrap.wu-fl-on > .wu-fl {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* The bottom keeps room for the phone's foot bar. The TOP clears the status bar (owner, on a Galaxy: "practice views need
       a small padding from the top. Level text is cropped") — the frameless
       page now starts at the screen's top edge, so the header needs the
       safe-area inset, plus breathing room. */
    padding: calc(var(--space-lg) + var(--safe-top)) var(--space-md) calc(var(--space-md) * 2 + 56px);
    background: color-mix(in srgb, var(--colour-surface) 55%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .wu-fl-head {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--colour-text-primary);
  }
  .wu-fl-medal { margin-left: auto; font-size: 1.4em; line-height: 1; }
  .wu-fl-sec { display: flex; flex-direction: column; gap: var(--space-xs); }
  .wu-fl-title {
    margin: 0;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--colour-text-secondary);
  }
  /* THREE ACROSS, icon over name (owner: "buttons with icon above and text
     below? 3 per row?") — the App menu's button shape, so the two read as
     one family; all 18 fit one screen without scrolling. */
  .wu-fl-rows {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
  }
  .wu-fl-row {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 76px;
    padding: 8px 4px 6px;
    border: 1px solid var(--colour-border);
    border-radius: var(--radius-button);
    background: var(--colour-surface);
    color: var(--colour-text-primary);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: var(--font-weight-bold);
    text-align: center;
    cursor: pointer;
  }
  .wu-fl-row:active { background: color-mix(in srgb, var(--colour-accent) 12%, var(--colour-surface)); }
  .wu-fl-ic {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--fl-c) 22%, var(--colour-surface));
    font-size: 18px;
    line-height: 1;
  }
  .wu-fl-img { width: 22px; height: 22px; }
  .wu-fl-name {
    flex: none;
    max-width: 100%;
    line-height: 1.15;
    /* Whole words only — "Subtraction" broke mid-word with the badge beside it. */
    overflow-wrap: normal;
  }
  .wu-fl-name small {
    display: block;
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: var(--font-weight-semibold);
    color: var(--colour-text-secondary);
  }
  /* The level pip sits in the BUTTON's top corner, clear of the icon (owner:
     "so it's not so on top of the icon itself"). */
  .wu-fl-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--colour-surface);
    border: 1px solid var(--colour-border);
    font-family: var(--font-mono);
    font-size: 10px;
    line-height: 1;
    color: var(--colour-text-primary);
  }
  .wu-fl-soon { opacity: 0.5; }
}

/* Wider screens: more across, bigger buttons, and the list held to a readable
   width in the middle of the pane rather than stretched edge to edge. */
@media (min-width: 600px) {
  .wu-honeycomb-wrap.wu-fl-on > .wu-fl {
    padding: var(--space-lg);
  }
  .wu-fl-head,
  .wu-fl-sec { width: 100%; max-width: 960px; margin-inline: auto; }
  /* SIX ACROSS (owner, 2026-11-18: "lets fit 6 items per row as it gives a good
     starting point for the layout") — six warm-ups fill exactly one row. */
  .wu-fl-rows { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-md); }
  .wu-fl-row { min-height: 104px; font-size: 15px; gap: 6px; }
  .wu-fl-ic { width: 46px; height: 46px; font-size: 24px; }
  .wu-fl-img { width: 30px; height: 30px; }
  .wu-fl-badge { top: 6px; right: 6px; }
}

/* NO INNER FRAME ON THE PRACTICE PAGE (owner, 2026-11-16: "remove the secondary
   frame on the practice view to get more width available") — the #239 rule for
   activities, applied where the list toggle is mounted: the pane runs edge to
   edge, so the list's three columns get the whole screen width. */
@media (orientation: portrait) {
  .wu-view-root > :has(> .wu-honeycomb-pane .wu-fl) { padding: 0; }
  /* The flower view starts under the status bar as well. */
  .wu-honeycomb-wrap:has(> .wu-fl) { padding-top: calc(var(--space-lg) + var(--safe-top)); }
  .wu-honeycomb-pane:has(.wu-fl) {
    border: none;
    border-radius: 0;
    min-height: var(--vh);
  }
}


/* ★ The animated mascot on the centre tile (#294). The SVG is the icon, so the
   white-silhouette filter the 🎮 emoji needed must not reach it — it would
   paint the eyes white too. */
.wu-hex-icon.wu-mascot-host { filter: none !important; width: 100%; display: flex; justify-content: center; }
/* The name is in the bar now (owner, 2026-11-21: "remove the text from the
   orange tile… animation can use all of the tile"), so the mascot gets the
   whole hex to roam in. The hex clips whatever wanders past its edge. */
.wu-hex-wrap:has(.wu-mascot) .wu-hex-label { display: none; }
.wu-mascot { width: calc(var(--hex-w) * 0.95); height: calc(var(--hex-w) * 0.95); display: block; overflow: visible; }
.wu-mascot-shape { fill: #fff; stroke: #fff; stroke-width: 6; stroke-linejoin: round; }
.wu-mascot-eye { fill: #5D3200; }
.wu-mascot-smile { fill: none; stroke: #5D3200; stroke-width: 2.6; stroke-linecap: round; transition: opacity .3s; }
.wu-mascot-pad { fill: var(--colour-brand, #FFB74D); opacity: 0; }

/* ══ 🌟 MIMI, THE HELPER (#300) ═══════════════════════════════════════════════
   A small orange hex in the bottom-right corner on a tablet or computer, off
   home. She replaces the exercise (?) and the Help chip there — one helper,
   not two buttons. A phone keeps those buttons (the corner is its keypads'
   thumb zone) and they wear a still Mimi face instead of the "?". */
.wu-mimi {
  position: fixed;
  right: calc(var(--space-md) + var(--safe-right));
  bottom: calc(var(--space-md) + var(--safe-bottom));
  z-index: 58;
  /* The screen's hex, not a fixed chip (#311): before she is placed, and in
     the corner when there is no lattice, she is the same size as on the grid. */
  width: var(--hex-w, 64px);
  height: calc(var(--hex-w, 64px) * 1.1547);
  --mimi-fig: calc(var(--hex-w, 64px) * 0.82);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 4px 10px rgba(43, 41, 38, 0.28));
  -webkit-tap-highlight-color: transparent;
}
.wu-mimi[hidden] { display: none; }
/* She fades between cells and screens rather than jumping (#325). */
.wu-mimi { transition: opacity 0.16s ease; }
.wu-mimi.wu-mimi-fading { opacity: 0; }
/* #329 — arriving on a new screen is a HOP: up from below, a little
   overshoot, settle. Intentional, so a new spot never reads as a glitch. */
.wu-mimi.wu-mimi-hop { animation: wu-mimi-hop 0.42s cubic-bezier(.3,1.5,.5,1); }
@keyframes wu-mimi-hop {
  0% { transform: translateY(18px) scale(0.7); }
  60% { transform: translateY(-6px) scale(1.06); }
  100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .wu-mimi { transition: none; } .wu-mimi.wu-mimi-hop { animation: none; } }
.wu-mimi-hex {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--colour-brand, #FFB74D);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transition: background 0.2s;
}
.wu-mimi-fig { width: 100%; height: 100%; display: grid; place-items: center; }
.wu-mimi-fig .wu-mascot { width: var(--mimi-fig, 58px); height: var(--mimi-fig, 58px); }
.wu-mimi:focus-visible { outline: none; }
.wu-mimi:focus-visible .wu-mimi-hex { background: var(--colour-accent); }
/* Help mode is on (Practice lists, the games launcher): she turns blue, the
   colour the ? used to fill with (#215). */
.wu-mimi-help-on .wu-mimi-hex { background: var(--colour-accent); }
@media (max-width: 599px), (max-height: 500px) {
  .wu-mimi { display: none !important; }
  /* …except in a running game, where no (?) chip carries her face: a round
     pill on the side bar (#366, mimi.js placePill). */
  .wu-mimi.wu-mimi-pill:not([hidden]) { display: block !important; z-index: 60; }
  /* A real circle, not a square CLIPPED to one: the inset ring was drawn on the
     square's edges and the clip left only scraps of it — the white "left over"
     on the perimeter (owner 2026-11-25). Now the ring follows the rim, like the
     bar's other circles. */
  .wu-mimi-pill .wu-mimi-hex {
    clip-path: none;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.55);
  }
  /* Her pill stands in for the help chip on the games menu (#372). */
  body:has(.wu-mimi.wu-mimi-pill:not([hidden])) .wu-rail .wu-help-chip { display: none !important; }
  /* At the FOOT of the side bar (#371): game pill top, ✕ under it, Mimi last. */
  .wu-mimi.wu-mimi-pill:not([hidden]) {
    top: auto !important;
    bottom: calc(var(--safe-bottom, 0px) + var(--space-md)) !important;
  }
}
@media (min-width: 600px) and (min-height: 501px) {
  body.wu-mimi-ready .wu-head-help,
  body.wu-mimi-ready .wu-help-chip { display: none !important; }
}

/* The still face in a phone's (?) and in a Help chip. */
.wu-mimi-face { width: 100%; height: 100%; display: block; }
.wu-head-help[data-mimi] {
  padding: 3px;
  border-color: transparent;
  background: var(--colour-brand, #FFB74D);
}
.wu-help-q[data-mimi] {
  display: inline-grid;
  width: 22px;
  height: 22px;
  padding: 2px;
  border-radius: 50%;
  background: var(--colour-brand, #FFB74D);
  box-sizing: border-box;
}

/* The intro: WarMUp → M M → Mimi. */
.wu-mimi-intro { align-items: center; text-align: center; }
.wu-mi-word {
  position: relative;
  align-self: stretch;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 52px;
  line-height: 1;
  color: var(--colour-brand-deep, #E08A00);
}
.wu-mi-l {
  display: inline-block;
  max-width: 1.2em;
  overflow: hidden;
  transition: transform 0.6s cubic-bezier(.5, 1.6, .5, 1), max-width 0.6s ease, opacity 0.4s ease;
}
/* #348: the letters ARE the name — W turns over into M, m stays m, i's grow in. */
.wu-mi-s1 .wu-mi-w { transform: rotate(180deg); }
.wu-mi-s2 .wu-mi-x { max-width: 0; opacity: 0; }
.wu-mi-i { max-width: 0; opacity: 0; transform: scale(0.4); }
.wu-mi-s3 .wu-mi-i { max-width: 0.6em; opacity: 1; transform: none; }
.wu-mi-fig {
  /* A REGULAR pointy-top hex is 1.1547× taller than wide (#384, owner: "is the
     hex proportion correct? appears skewed") — a square box under this
     clip-path drew it squashed. */
  width: 112px;
  height: calc(112px * 1.1547);
  margin: 4px auto 0;
  display: grid;
  place-items: center;
  background: var(--colour-brand, #FFB74D);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.4s ease, transform 0.6s cubic-bezier(.5, 1.6, .5, 1);
}
.wu-mi-fig.wu-mi-in { opacity: 1; transform: none; }
.wu-mi-fig .wu-mascot { width: 104px; height: 104px; }
@media (prefers-reduced-motion: reduce) {
  .wu-mi-l, .wu-mi-fig { transition: none; }
}

/* The pane's lattice under an exercise layer that draws its own (#300). */
.wu-hex-bg-covered { visibility: hidden; }

/* Mimi stands ABOVE a help card's blur (#300, owner 2026-11-21: "when the help
   modal is up and blurs the background mimi should stand above the blur as
   its mimi's assistance"). Sheets sit at 400. */
body:has(> .wu-help-backdrop) .wu-mimi { z-index: 401; }

/* 💬 Mimi says (#306) — a line that belongs to the exercise, spoken by the
   helper beside her instead of a toast at the top. The tail points at her. */
.wu-mimi-say {
  position: fixed;
  z-index: 402;
  max-width: min(260px, calc(100vw - 16px));
  box-sizing: border-box;
  padding: 10px 14px;
  background: var(--colour-surface);
  color: var(--colour-text-primary);
  border: 2px solid var(--colour-brand, #FFB74D);
  border-radius: 16px;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--colour-text-primary) 18%, transparent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.3;
  pointer-events: none;
  animation: wu-mimi-say-in 0.28s cubic-bezier(.5, 1.6, .5, 1);
}
.wu-mimi-say::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--colour-surface);
  border: 2px solid var(--colour-brand, #FFB74D);
  border-width: 0 2px 2px 0;
}
.wu-mimi-say-left::after { right: -8px; top: calc(var(--tail-y, 50%) - 7px); transform: rotate(-45deg); }
.wu-mimi-say-below::after { top: -8px; left: calc(var(--tail-x, 50%) - 7px); transform: rotate(-135deg); }
.wu-mimi-say-above::after { bottom: -8px; left: calc(var(--tail-x, 50%) - 7px); transform: rotate(45deg); }
@keyframes wu-mimi-say-in { from { opacity: 0; transform: scale(0.85); } }
.wu-mimi-talk .wu-mimi-hex { animation: wu-mimi-talk 0.5s ease; }
@keyframes wu-mimi-talk { 30% { transform: translateY(-6px) rotate(-4deg); } 60% { transform: translateY(0) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) {
  .wu-mimi-say, .wu-mimi-talk .wu-mimi-hex { animation: none; }
}

/* 🧭 Sentence Path words sized FROM THE HEX (#310, audit H). A word rode the
   flower's caption slot — ~9px uppercase inside a 100px stone, while the
   maths Path's numbers ride the big icon slot. On a Path board the caption
   IS the content, so it reads like content: the hex's size, sentence case. */
.wu-honeycomb-pane:has(.wu-path-bar) .wu-hex-label {
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  font-size: clamp(12px, calc(var(--hex-w) * 0.17), 24px);
  letter-spacing: 0;
  text-transform: none;
  color: var(--colour-text-primary);
  /* Never split a word: a long one gets a smaller size instead (the tile is
     tagged by length in path-puzzle.js). */
  overflow-wrap: normal;
  hyphens: none;
}
.wu-honeycomb-pane:has(.wu-path-bar) .wu-path-long .wu-hex-label { font-size: clamp(11px, calc(var(--hex-w) * 0.15), 21px); }
.wu-honeycomb-pane:has(.wu-path-bar) .wu-path-xlong .wu-hex-label { font-size: clamp(10px, calc(var(--hex-w) * 0.12), 18px); }
