/* ==========================================================================
   Sixfold shell polish — motion, result cards and the hidden word game.
   This file sits after the three original stylesheets so the release fixes can
   stay together without disturbing the 2.0 layout rules.
   ========================================================================== */

/* ---------- desktop breathing room around the header ---------- */

@media (min-width: 721px) {
  .play-head { gap: 14px; }
  .play-title-row { margin-top: 18px; }
  .play-head > .play-cart-row { margin-bottom: 2px; }
}

/* ---------- desktop motion ---------- */

.home-hero-art { perspective: 900px; }

@media (hover: hover) and (pointer: fine) {
  /* Gated on the page's Motion choice, not just the device query: Full on a
     reduced-motion desktop gets the pointer motion back, and Reduced on a
     normal desktop does not silently keep it. */
html[data-motion="full"] .home-six {
    transform: rotate(-3deg) rotateX(var(--six-tilt-x, 0deg)) rotateY(var(--six-tilt-y, 0deg));
    transform-style: preserve-3d;
    transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  /* The tilt is pointer-driven, so keep it on its own compositor layer only
     while the pointer is over the cover. A permanent will-change layer and a
     420ms transition made every mouse event retarget a long animation, which
     is what felt sticky on desktop. */
html[data-motion="full"] .home-six.is-tilting {
    transition-duration: 70ms;
    will-change: transform;
  }

html[data-motion="full"] .home-six-piece {
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    transition: transform 160ms var(--ease-out);
  }

html[data-motion="full"] .home-six-piece:hover {
    transform: translateY(-3px);
  }

html[data-motion="full"] .home-six-piece:active { transform: translateY(0) scale(0.975); }

html[data-motion="full"] .home-game {
    transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }

html[data-motion="full"] .home-game:hover { transform: translateY(-5px); }

/* The hover lift is more specific than the base :active rule, so without this
   a pressed card stayed lifted and never answered the finger. Keep the press
   later in the cascade and slightly compress the inner stage for depth. */
html[data-motion="full"] .home-game:active { transform: translateY(0); }

html[data-motion="full"] .home-game-stage { transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1); }
html[data-motion="full"] .home-game:hover .home-game-stage { transform: scale(1.015); }
html[data-motion="full"] .home-game:active .home-game-stage { transform: scale(0.985); }

html[data-motion="full"] .home-cta,
html[data-motion="full"] .home-surprise,
html[data-motion="full"] .hub-share,
html[data-motion="full"] .hub-look,
html[data-motion="full"] .play-btn,
html[data-motion="full"] .play-tool,
html[data-motion="full"] .games-home,
html[data-motion="full"] .result-share {
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    transition-duration: 240ms;
  }

html[data-motion="full"] .play-btn:hover:not(:active),
html[data-motion="full"] .play-tool:hover,
html[data-motion="full"] .games-home:hover { transform: translateY(-2px); }

html[data-motion="full"] .result-share:hover { transform: translateY(-1px); }

  /* Merge tiles already get will-change in styles.css. Promoting every water
     glass and every Minesweeper node created hundreds of compositor layers on
     desktop, especially on the Expert board, and made the game animations
     stutter. Transform transitions alone are enough here. */
}

/* A tap is a brief press, not an animation. Keeping it to transform only
   keeps the feedback composited: no ring, no filter, no shadow repaint. */
.home-six-piece.is-six-hit {
  transform: translateY(1px) scale(0.97);
}

.home-six.is-unlocking {
  animation: sixUnlock 320ms var(--ease-out) both;
}

@keyframes sixUnlock {
  0% { transform: rotate(-3deg) scale(1); }
  40% { transform: rotate(-3deg) scale(1.02); }
  72% { transform: rotate(-3deg) scale(0.997); }
  100% { transform: rotate(-3deg) scale(1); }
}

/* Merge tiles keep their responsive 150ms feel on touch, but a mouse gets a
   slightly longer, springier slide so a fast swipe no longer looks like a snap. */
@media (hover: hover) and (pointer: fine) {
html[data-motion="full"] .tile { transition: transform 170ms cubic-bezier(0.22, 1, 0.36, 1); }
}

/* A screen settles in with a short opacity hand-off. It used to travel 12px
   and scale from 99.2%, so the top of the page visibly shrank and jumped at
   the moment the hub was hidden. The board stays perfectly still. */
@keyframes sixfoldShellIn {
  from { opacity: 0; }
  to { opacity: 1; transform: none; }
}

/* A screen arrives once. The screens are display:none behind each other, so
   the browser would restart this lift on every re-entry; shell-settled is set
   when the reader leaves a screen, and its return is then a cut. */
.play-screen:not([hidden]):not(.shell-settled) .play-shell {
  animation: sixfoldShellIn 320ms var(--ease-out) both;
}

.play-win:not([hidden]),
.fruit-over-card:not([hidden]) {
  animation-duration: 380ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- hidden word game ---------- */

#wordle {
  --cart: var(--g6, #9a6bb5);
  /* A darker ink keeps the tiny cartridge label above 4.5:1 on purple. */
  --cart-ink: #14110d;
  --wordle-correct: #4c8a55;
  --wordle-present: #b38425;
  --wordle-absent: #746d61;
  --wordle-tile: color-mix(in srgb, var(--card) 62%, var(--page));
  --wordle-key: color-mix(in srgb, var(--panel) 42%, var(--card));
}

html[data-theme="dark"] #wordle {
  --wordle-correct: #4f9159;
  --wordle-present: #b78a2b;
  --wordle-absent: #5c5851;
  --wordle-tile: color-mix(in srgb, var(--card) 34%, var(--page));
  --wordle-key: color-mix(in srgb, var(--panel) 48%, var(--card));
}

.wordle-main {
  justify-content: center;
  gap: clamp(7px, 1.4dvh, 12px);
  /* Keep the last key row's 2px shadow inside the viewport; the row sits on
     the bottom edge of this flex stage. */
  overflow: visible;
}

.wordle-board-wrap {
  position: relative;
  width: min(100%, 310px, 40dvh);
  aspect-ratio: 5 / 6;
  flex: none;
}

.wordle-board {
  display: grid;
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: clamp(4px, 0.8dvh, 7px);
  width: 100%;
  height: 100%;
  outline: none;
}

.wordle-board:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
  border-radius: 10px;
}

.wordle-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(4px, 0.8dvh, 7px);
  min-height: 0;
}

.wordle-tile {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--wordle-tile);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: clamp(18px, 4.8dvh, 30px);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  transform: rotateX(0);
  backface-visibility: hidden;
  transition: background-color 160ms var(--ease-out), transform 140ms var(--ease-out);
}

.wordle-tile[data-filled="true"] {
  border-color: color-mix(in srgb, var(--ink) 30%, transparent);
  animation: wordleType 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

.wordle-row.is-current .wordle-tile[data-filled="false"] {
  border-color: color-mix(in srgb, var(--ink) 20%, transparent);
}

.wordle-tile[data-state="correct"] {
  border-color: var(--wordle-correct);
  background: var(--wordle-correct);
  color: #fffdf8;
}

.wordle-tile[data-state="present"] {
  border-color: var(--wordle-present);
  background: var(--wordle-present);
  color: #fffdf8;
}

.wordle-tile[data-state="absent"] {
  border-color: var(--wordle-absent);
  background: var(--wordle-absent);
  color: #fffdf8;
}

.wordle-tile.is-revealing {
  animation: wordleFlip 480ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
  animation-delay: calc(var(--i) * 82ms);
}

@keyframes wordleType {
  from { transform: scale(0.9); }
  65% { transform: scale(1.035); }
  to { transform: scale(1); }
}

@keyframes wordleFlip {
  0% { transform: rotateX(0deg); }
  48% { transform: rotateX(90deg); }
  52% { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

@keyframes wordleShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.wordle-row.is-shaking { animation: wordleShake 340ms ease-out; }

.wordle-status { min-height: 17px; }

.wordle-offline {
  width: min(100%, 380px);
  margin: -2px 0 0;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--wordle-present) 34%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--wordle-present) 9%, transparent);
  color: var(--muted-strong);
  font-size: 11.5px;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}

.wordle-offline[hidden] { display: none; }

.wordle-keyboard {
  display: grid;
  gap: clamp(5px, 0.9dvh, 7px);
  width: min(100%, 380px);
  flex: none;
  margin-top: 1px;
}

.wordle-key-row {
  display: flex;
  justify-content: center;
  gap: clamp(5px, 1vw, 7px);
}

/* Arabic, Hindi, Japanese, Korean and Chinese use the device's own input
   method instead of a cramped invented letter grid. The field keeps the same
   visual weight as a key row and the Enter key stays a separate action. */
.wordle-keyboard--ime {
  width: min(100%, 500px);
}

.wordle-ime {
  display: flex;
  align-items: stretch;
  gap: clamp(5px, 1vw, 7px);
  width: 100%;
  min-width: 0;
}

.wordle-ime-input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  height: clamp(38px, 5.2dvh, 48px);
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 7px;
  background: var(--wordle-key);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: clamp(15px, 2.2dvh, 19px);
  font-weight: 700;
  text-align: center;
}

.wordle-ime-input::placeholder {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  opacity: 1;
}

.wordle-ime-input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.wordle-ime .wordle-key {
  flex: 0 0 auto;
  min-width: 68px;
  padding-inline: 12px;
  font-size: clamp(10px, 1.4dvh, 12px);
}

.wordle-key {
  display: grid;
  place-items: center;
  flex: 1 1 0;
  min-width: 0;
  height: clamp(36px, 4.9dvh, 44px);
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 7px;
  background: var(--wordle-key);
  box-shadow: 0 2px 0 color-mix(in srgb, var(--ink) 9%, transparent);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: clamp(11px, 1.6dvh, 14px);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 110ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.wordle-key:hover { background: color-mix(in srgb, var(--wordle-key) 70%, var(--card)); }
.wordle-key:active { transform: translateY(1px) scale(0.97); }
.wordle-key:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.wordle-key--wide {
  flex-grow: 1.55;
  font-size: clamp(9px, 1.25dvh, 11px);
  letter-spacing: 0.02em;
}

/* The delete glyph is drawn by the font, not the label size: a backspace at the
   wide key's 9-11px label size read as a speck next to the letters. */
.wordle-key[data-key="Backspace"] {
  font-size: clamp(16px, 2.15dvh, 20px);
  line-height: 1;
}

/* Enter closes the letter keyboard now, so it carries the filled purple the
   footer action used to own. */
.wordle-key.wordle-key--enter {
  border-color: var(--cart);
  background: var(--cart);
  /* Darker than --cart-ink so the small Enter label clears 4.5:1 on the
     purple key (4.61:1 at 11.8px). */
  color: #14110d;
  font-weight: 900;
  box-shadow: 0 2px 0 color-mix(in srgb, var(--cart) 62%, #000);
}

.wordle-key.wordle-key--enter:hover { background: var(--cart); }

/* New game keeps the help button company, but stays a quiet secondary action
   so it cannot be mistaken for the purple Enter key. */
.wordle-shell .play-foot .play-actions { justify-content: flex-start; }
.wordle-shell .play-foot .play-actions .wordle-new {
  flex: 0 0 auto;
  min-height: 36px;
  padding-inline: 13px;
  font-size: 11px;
  color: var(--muted-strong);
}

.wordle-key[data-state="correct"] {
  background: var(--wordle-correct);
  color: #fffdf8;
}

.wordle-key[data-state="present"] {
  background: var(--wordle-present);
  color: #fffdf8;
}

.wordle-key[data-state="absent"] {
  background: var(--wordle-absent);
  color: #fffdf8;
  opacity: 0.78;
}

.wordle-result {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--page) 72%, transparent);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  z-index: 2;
}

.wordle-result[hidden] { display: none; }

.wordle-result-card {
  width: 100%;
  padding: 15px 14px 13px;
  border: 1px solid color-mix(in srgb, var(--ink) 13%, transparent);
  border-radius: 14px;
  background: var(--sheet-bg, var(--card));
  box-shadow: 0 4px 0 color-mix(in srgb, var(--ink) 9%, transparent), 0 24px 42px -30px rgba(0, 0, 0, 0.5);
  animation: sixfoldCardIn 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.wordle-result-card h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: clamp(21px, 3.2dvh, 27px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
}

.wordle-result-card > p:not(.game-tag):not(.wordle-result-stats) {
  margin: 7px 0 0;
  color: var(--muted-strong);
  font-size: 11.5px;
  line-height: 1.35;
}

.wordle-result-stats {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.35;
}

.wordle-result-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
}

.wordle-result-actions .play-btn { flex: 1; min-height: 38px; padding-inline: 10px; font-size: 11px; }
.wordle-result-actions .result-share { width: 38px; min-width: 38px; height: 38px; padding: 0; border-radius: 11px; }

/* Short portrait phones trade tile size for the keyboard, never information. */
@media (orientation: portrait) and (max-height: 680px) {
  .wordle-board-wrap { width: min(100%, 270px, 33dvh); }
  .wordle-key { height: 32px; }
  .wordle-main { gap: 5px; }
  .wordle-keyboard { gap: 4px; }
}

@media (max-width: 380px) {
  .wordle-board-wrap { width: min(100%, 286px, 39dvh); }
  /* The offline notice adds a third line at 320px, which pushed the last key
     row below the fixed play frame. Give that state a little more room. */
  #wordle:has(.wordle-offline:not([hidden])) .wordle-board-wrap {
    width: min(100%, 250px, 34dvh);
  }
  .wordle-key { height: 34px; border-radius: 6px; }
  .wordle-key-row { gap: 4px; }
  .wordle-status { font-size: 10.5px; }
}

html[data-motion="reduced"] .home-six,
html[data-motion="reduced"] .home-six.is-unlocking,
html[data-motion="reduced"] .home-six-piece,
html[data-motion="reduced"] .home-game,
html[data-motion="reduced"] .home-game-stage,
html[data-motion="reduced"] .play-screen:not([hidden]) .play-shell,
html[data-motion="reduced"] .play-win:not([hidden]),
html[data-motion="reduced"] .fruit-over-card:not([hidden]),
html[data-motion="reduced"] .wordle-tile,
html[data-motion="reduced"] .wordle-tile.is-revealing,
html[data-motion="reduced"] .wordle-row.is-shaking,
html[data-motion="reduced"] .wordle-key,
html[data-motion="reduced"] .wordle-result-card {
    animation: none;
    transition: none;
  }

html[data-motion="reduced"] .home-six-piece.is-six-hit { animation: none; }

/* ==========================================================================
   Inner-game audit — desktop Wordle keys, the 320px Minesweeper toolbar and
   the short-phone Wordle board. Scoped so phones keep their published layout.
   ========================================================================== */

/* On a laptop the five-letter keyboard was still 360px wide with 42px keys,
   so it read as a phone control. Give it a desk-sized row without touching
   the phone rules above. */
@media (min-width: 721px) and (min-height: 700px) {
  .wordle-main { gap: 14px; }
  .wordle-board-wrap { width: min(100%, 340px, 40dvh); }
  .wordle-keyboard { width: min(100%, 500px); gap: 7px; }
  .wordle-key-row { gap: 6px; }
  .wordle-key {
    height: clamp(46px, 5.6dvh, 54px);
    border-radius: 9px;
    font-size: clamp(14px, 1.85dvh, 17px);
  }
  .wordle-key--wide { font-size: clamp(11.5px, 1.5dvh, 13.5px); }
  .wordle-status { font-size: 12px; }
}

/* Middle-height phones keep a taller board and only trim the keyboard. */
@media (orientation: portrait) and (min-height: 621px) and (max-height: 680px) {
  .wordle-board-wrap { width: min(100%, 300px, 35dvh); }
  .wordle-key { height: 33px; }
  .wordle-main { gap: 4px; }
  .wordle-keyboard { gap: 4px; }
}

/* 568px-tall phones: six board rows, the status line, three key rows and the
   footer could not all fit, so the footer was pushed below the screen. */
@media (orientation: portrait) and (max-height: 620px) {
  .wordle-board-wrap { width: min(100%, 300px, 32dvh); }
  .wordle-main { gap: 3px; }
  .wordle-keyboard { gap: 4px; }
  .wordle-key { height: 32px; }
  .wordle-status { min-height: 12px; font-size: 10px; }
}

/* Short landscape has enough width for a larger letter keyboard if the info
   rail gives back a little space. This keeps keys separated on small phones. */
@media (orientation: landscape) and (max-height: 520px) {
  .wordle-shell { grid-template-columns: minmax(190px, 28vw) minmax(0, 1fr); }
  .wordle-main { width: 100%; max-width: 430px; gap: 4px; }
  /* Let the board use the short landscape height, but reserve enough room
     for the status line and three key rows. The old 40dvh cap left the board
     at only 156px on a 390px-tall phone while the keyboard stayed 430px wide. */
  .wordle-board-wrap {
    width: min(100%, 230px, calc((100dvh - 146px) * 0.8333));
  }
  .wordle-keyboard { width: 100%; max-width: 430px; gap: 4px; }
  .wordle-key { height: 30px; }
  .wordle-status { min-height: 12px; font-size: 10.5px; }
}

/* The narrowest phones: the Minesweeper toolbar ran past the right edge and
   the flag toggle sat half off-screen. The short word plus eight-pixel button
   padding brings it back inside the 320px frame, and the small segmented
   controls regain a proper tap height. */
@media (max-width: 380px) {
  .mines-toolbar { gap: 6px; }
  .mines-difficulty button { min-height: 34px; padding-inline: 4px; }
  .mines-flag-toggle { min-height: 34px; padding-inline: 8px; }
  /* The full label needs 46px more than a 320px screen has. The glyph plus
     "Flag" keeps the control inside the frame; the hidden words still give
     screen readers the full "Flag mode" name. */
  /* The landscape rule scopes its 9px label with #mines, so the class-level
     zero that hides the long word loses and the button reads "⚑ Flag mode
     Flag". Match that specificity here. */
  #mines .mines-flag-toggle[aria-pressed] { font-size: 0; }
  #mines .mines-flag-toggle > span { font-size: 13px; }
  #mines .mines-flag-toggle::after {
    content: "Flag";
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.03em;
  }
  .ttt-difficulty button { min-height: 34px; }
  .play-chip { min-height: 30px; }
}

/* At 320px the fruit HUD has room for the next fruit or the drag hint, not
   both; the status line and coach already teach the drag. */
@media (max-width: 340px) {
  .fruit-hint { display: none; }
}

/* Sheets on a phone: the theme and board-size segments were 35px tall and the
   shape map's share action 36px, both short for a thumb. */
@media (max-width: 430px) {
  .seg button { min-height: 42px; }
  .level-share-btn { min-height: 42px; }
}

/* Locked shapes fade to 45% so they recede. On the dark sheet the numbers all
   but vanished, so they keep a little more presence there. */

/* ---------- universal erase + result dialogs on small phones ---------- */

/* The quiet door to the full wipe. Red enough to read as destructive, not so
   red that it competes with the game colours above it. */
.sheet-card .wipe-open {
  width: 100%;
  margin-top: 10px;
  border: 1px solid color-mix(in srgb, #b74a34 42%, transparent);
  background: transparent;
  color: #a6402c;
}

.sheet-card .wipe-open:hover {
  background: color-mix(in srgb, #b74a34 8%, transparent);
}

html[data-theme="dark"] .sheet-card .wipe-open {
  color: #e78f78;
  border-color: color-mix(in srgb, #e78f78 42%, transparent);
}

html[data-theme="dark"] .sheet-card .wipe-open:hover {
  background: color-mix(in srgb, #e78f78 10%, transparent);
}

/* The Wordle result card lives inside the board, so at 320px it has very
   little width to work with. Tighten the card, keep the title readable and
   give both actions a thumb-sized height instead of the footer's 28px icon. */
@media (max-width: 430px) {
  .wordle-result { padding: 8px; }
  .wordle-result-card { padding: 13px 12px 12px; }
  .wordle-result-card h2 { font-size: clamp(19px, 6vw, 25px); }
  .wordle-result-card > p:not(.game-tag):not(.wordle-result-stats) { font-size: 11px; }
  .wordle-result-actions { gap: 6px; margin-top: 10px; }
  .wordle-result-actions .play-btn { min-height: 42px; padding-inline: 8px; font-size: 10.5px; }
  .wordle-result-actions .result-share {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 11px;
  }

  .play-win .play-btn { min-height: 42px; }
  .play-win .result-share {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 11px;
  }
  .result-share--labeled {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    gap: 0;
    border-radius: 11px;
  }
  .result-share--labeled .result-share-label { display: none; }
  .overlay-actions .btn { min-height: 42px; }
  .fruit-over-card .play-btn { min-height: 42px; }

  /* The fruit board is only ~205px wide at 320, which squeezed the run-over
     card to 160px and stacked its heading over three lines. On phones the
     overlay takes the whole screen instead, and its share action matches the
     other result dialogs. */
  .fruit-over {
    position: fixed;
    inset: 0;
    padding: 16px;
    z-index: 240;
  }
  .fruit-over-card .result-share {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 11px;
  }
}

/* Narrow phones: keep the promise row together and give card metadata room. */
@media (max-width: 430px) {
  .home-promises {
    font-size: 7.5px;
    gap: 3px 4px;
  }

  .home-promises span + span::before {
    content: none;
    margin: 0;
  }

  .home-promises span:not(:last-child)::after {
    content: "·";
    margin-left: 4px;
    color: var(--home-rule);
  }

  .home-game-meta {
    font-size: 7.5px;
    gap: 4px;
  }

  .home-game-play {
    font-size: 7.5px;
  }
}

/* ==========================================================================
   Winning moment — a result should feel earned, not like a status line.
   The four compact game results become one paper card with a stamped seal
   in the game's own colour. Merge and Wordle keep their own cards and get
   the same accent and paper chips. No sound, no long takeover.
   ========================================================================== */

.win-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: 0 auto 8px;
  padding: 3px 8px 2px;
  border: 1.5px solid color-mix(in srgb, var(--win-accent, var(--ink)) 62%, transparent);
  border-radius: 5px;
  color: color-mix(in srgb, var(--win-accent, var(--ink)) 72%, var(--ink));
  background: color-mix(in srgb, var(--win-accent, var(--ink)) 8%, var(--sheet-bg, var(--card)));
  font-family: var(--font-ui);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
  transform: rotate(-1.5deg);
  animation: winStampIn 360ms cubic-bezier(0.22, 1, 0.36, 1) 70ms both;
}

@keyframes winStampIn {
  from { opacity: 0; transform: translateY(-4px) rotate(-4deg) scale(0.9); }
  to { opacity: 1; transform: rotate(-1.5deg) scale(1); }
}

/* The fruit board has no result card when the chain tops out, so its seal
   sits over the stage and leaves with the next run. */
.fruit-stage > .win-stamp {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  z-index: 4;
  margin: 0 auto;
  pointer-events: none;
}

.overlay-card.has-win,
.wordle-result-card.has-win {
  border-color: color-mix(in srgb, var(--win-accent, var(--t64)) 38%, transparent);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--ink) 9%, transparent),
    0 22px 44px -30px var(--win-accent, rgba(0, 0, 0, 0.4));
}

.overlay-card > .win-stamp {
  display: flex;
  margin: 0 auto 9px;
}

/* The four compact results leave the 44px slot and become the moment. The
   grid lets the stamp, the sentence and the two actions line up without
   adding another wrapper element. */
.play-feedback .play-win:not([hidden]) {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(88vw, 360px);
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 32px);
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "stamp stamp"
    "body body"
    "next share";
  align-items: center;
  gap: 10px 8px;
  padding: 20px 18px 16px;
  z-index: 250;
  border: 1px solid color-mix(in srgb, var(--win-accent, var(--ink)) 34%, transparent);
  border-radius: 20px;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--win-accent, var(--t64)) 10%, transparent), transparent 48%),
    var(--sheet-bg, var(--card));
  box-shadow:
    0 0 0 100vmax color-mix(in srgb, var(--page) 66%, transparent),
    0 30px 60px -34px rgba(0, 0, 0, 0.62);
  text-align: center;
  animation: winCardIn 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.play-feedback .play-win > .win-stamp {
  grid-area: stamp;
  justify-self: center;
  margin: 0 0 2px;
}

.play-feedback .play-win p {
  grid-area: body;
  margin: 0;
  padding: 0;
  max-width: none;
  overflow: visible;
  color: var(--muted-strong);
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
}

.play-feedback .play-win p strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: clamp(20px, 5.8vw, 24px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.play-feedback .play-win .play-btn {
  grid-area: next;
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 12px;
}

.play-feedback .play-win .result-share {
  grid-area: share;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 94px;
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  background: transparent;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.play-feedback .play-win .result-share svg { width: 16px; height: 16px; }
.play-feedback .play-win .result-share-label { display: inline; }

@media (max-width: 430px) {
  .play-feedback .play-win .result-share {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
  }
  .play-feedback .play-win .result-share .result-share-label { display: none; }
}

.play-feedback .play-win.has-win::before {
  inset: 0 0 auto 0;
  width: auto;
  height: 4px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--win-accent, var(--t64)) 25%, transparent),
    var(--win-accent, var(--t64)),
    color-mix(in srgb, var(--win-accent, var(--t64)) 25%, transparent));
  background-size: 200% 100%;
  animation: winAccentSweep 900ms ease-out both;
}

@keyframes winAccentSweep {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

/* The pause before the next round is a clock, drawn as a thin edge under the
   action it will press. The button keeps the label its catalog gave it, so the
   countdown no longer leaks an English "Next 3s" into every language. */
.play-btn.is-counting {
  position: relative;
  overflow: hidden;
}

.play-btn.is-counting::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: inherit;
  background: currentColor;
  opacity: 0.34;
  transform: scaleX(var(--auto-next-left, 1));
  transform-origin: left center;
  transition: transform 120ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

html[dir="rtl"] .play-btn.is-counting::after { transform-origin: right center; }
html[data-motion="reduced"] .play-btn.is-counting::after { transition: none; }

/* The quiet way back to a result the reader closed, kept in the footer beside
   the game's own restart action. */
.play-result-chip {
  min-height: 38px;
  padding: 0 14px;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

@keyframes winCardIn {
  0% { opacity: 0; transform: translate(-50%, -47%) scale(0.96); }
  55% { opacity: 1; transform: translate(-50%, -50%) scale(1.012); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

html[data-motion="reduced"] .play-feedback .play-win:not([hidden]),
html[data-motion="reduced"] .play-feedback .play-win.is-victory,
html[data-motion="reduced"] .win-stamp,
html[data-motion="reduced"] .play-feedback .play-win.has-win::before {
    animation: none;
  }

/* A finished entrance animation must not leave a transform on the shell:
   a transformed ancestor becomes the containing block for the fixed win
   card and shifts it off-centre. */
.play-screen:not([hidden]) .play-shell {
  animation-fill-mode: none;
}

.play-screen:has(.play-win:not([hidden])) .play-shell {
  animation: none;
  transform: none;
}

/* ==========================================================================
   Motion pass — the launch, the return, the hidden card and the word game.
   These build on the existing paper/ink language; nothing here changes layout.
   ========================================================================== */

/* The collection cards follow the six-piece build instead of appearing all at
   once underneath the launch screen. */
@keyframes homeCardIn {
  from { opacity: 0; }
  70% { opacity: 1; }
  to { opacity: 1; }
}

/* 40ms steps instead of 50: the last card used to start at 390ms and land
     at 910ms, which read as the hub still loading. */
/* The cards arrive with the launch. hub-settled is set the first time the
   reader leaves the collection, so a return from a game is a cut back to a
   hub that is already built instead of a second entrance. */
html[data-motion="full"].home-ready:not(.hub-settled) .home-grid .home-game {
    /* Backwards, not both: the entrance may hold its first frame through the
       stagger delay, but once it lands the card must hand its transform back
       to :hover and :active. `both` kept the final `transform: none` winning
       forever, which is what made the six cards feel dead under a finger. */
    animation: homeCardIn 380ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }

html[data-motion="full"].home-ready .home-grid .home-game:nth-child(1) { animation-delay: 40ms; }

html[data-motion="full"].home-ready .home-grid .home-game:nth-child(2) { animation-delay: 80ms; }

html[data-motion="full"].home-ready .home-grid .home-game:nth-child(3) { animation-delay: 120ms; }

html[data-motion="full"].home-ready .home-grid .home-game:nth-child(4) { animation-delay: 160ms; }

html[data-motion="full"].home-ready .home-grid .home-game:nth-child(5) { animation-delay: 200ms; }

html[data-motion="full"].home-ready .home-grid .home-game:nth-child(6) { animation-delay: 240ms; }

/* Returning to the hub is a cut, not a second launch: the collection keeps
   the state it had and does not replay its entrance. Arriving in a game is a
   change of place rather than a cut, and the shell rise carries that
   (sixfoldShellIn in games.css). The screen root must stay opaque: it covers
   the merge board, so fading it let another game show through for a fifth of
   a second on every card and every die. */

/* The hidden game gets a more theatrical arrival than the public cards: a
   brief blur-and-lift before the board settles, still under 600ms. */
#wordle:not([hidden]):not(.shell-settled) .wordle-shell {
  animation: wordleArrive 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* A lift and fade only: the old blur filtered the whole screen every frame,
   which is exactly the paint work the WebView cannot afford. */
@keyframes wordleArrive {
  from { opacity: 0; transform: translateY(5px); }
  68% { opacity: 1; transform: translateY(-1px); }
  to { opacity: 1; transform: none; }
}

/* A result is a new beat even when the card was already in the DOM. The
   class is reset by wordle.js on every show, so the animation really replays. */
.wordle-result.is-revealed {
  animation: wordleVeilIn 220ms ease-out both;
}

.wordle-result.is-revealed .wordle-result-card {
  animation: wordleResultIn 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes wordleVeilIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes wordleResultIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  70% { opacity: 1; transform: translateY(-1px) scale(1.006); }
  to { opacity: 1; transform: none; }
}

/* ---------- hidden-game discovery card ---------- */

html.hidden-reveal-open,
html.hidden-reveal-open body {
  overflow: hidden;
}

.hidden-reveal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  transition: opacity 260ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hidden-reveal[hidden] { display: none; }
.hidden-reveal.is-open { opacity: 1; }
.hidden-reveal.is-closing { opacity: 0; pointer-events: none; }

.hidden-reveal-scrim {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--page) 70%, transparent);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.hidden-reveal-card {
  position: relative;
  width: min(100%, 390px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 22px 22px 18px;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 22px;
  background: var(--sheet-bg, var(--card));
  box-shadow: 0 4px 0 color-mix(in srgb, var(--ink) 9%, transparent),
    0 32px 64px -34px rgba(0, 0, 0, 0.55);
  text-align: center;
  opacity: 0;
  transform: translateY(14px) scale(0.96) rotate(-0.4deg);
}

.hidden-reveal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(90deg, #f3ecdf, #ee9563, #e7c364, #efb07a, #ec7c55, #e85f3b);
}

.hidden-reveal.is-open .hidden-reveal-card {
  animation: hiddenRevealIn 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hidden-reveal.is-closing .hidden-reveal-card {
  animation: hiddenRevealOut 240ms ease-in both;
}

@keyframes hiddenRevealIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95) rotate(-0.6deg); }
  68% { opacity: 1; transform: translateY(-2px) scale(1.012) rotate(0); }
  to { opacity: 1; transform: none; }
}

@keyframes hiddenRevealOut {
  to { opacity: 0; transform: translateY(8px) scale(0.98); }
}

.hidden-reveal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
}

.hidden-reveal-kicker,
.hidden-reveal-foot {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hidden-reveal-kicker { text-align: left; }

.hidden-reveal-pips {
  display: inline-flex;
  gap: 3px;
  flex: none;
}

.hidden-reveal-pips i {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--six-1);
}

.hidden-reveal-pips i:nth-child(2) { background: var(--six-2); }
.hidden-reveal-pips i:nth-child(3) { background: var(--six-3); }
.hidden-reveal-pips i:nth-child(4) { background: var(--six-4); }
.hidden-reveal-pips i:nth-child(5) { background: var(--six-5); }
.hidden-reveal-pips i:nth-child(6) { background: var(--six-6); }

.hidden-reveal-tiles {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 22px 0 17px;
}

.hidden-reveal-tile,
.hidden-reveal-tiles span {
  display: grid;
  place-items: center;
  width: clamp(38px, 12vw, 48px);
  aspect-ratio: 1;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--card);
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--ink) 10%, transparent);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: clamp(20px, 6vw, 25px);
  font-weight: 800;
  line-height: 1;
}

.hidden-reveal-tiles span.is-key {
  border-color: color-mix(in srgb, var(--g6, #9a6bb5) 70%, var(--ink));
  background: var(--g6, #9a6bb5);
  color: #fffdf8;
  transform: rotate(3deg);
}

.hidden-reveal-tiles span {
  opacity: 0;
  transform: translateY(10px) rotate(-4deg) scale(0.82);
  animation: hiddenTileIn 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hidden-reveal-tiles span:nth-child(1) { animation-delay: 120ms; }
.hidden-reveal-tiles span:nth-child(2) { animation-delay: 175ms; }
.hidden-reveal-tiles span:nth-child(3) { animation-delay: 230ms; }
.hidden-reveal-tiles span:nth-child(4) { animation-delay: 285ms; }

.hidden-reveal-tiles span.is-key {
  animation: hiddenTileIn 340ms var(--ease-out) 340ms both;
}

@keyframes hiddenTileIn {
  from { opacity: 0; transform: translateY(10px) rotate(-4deg) scale(0.82); }
  70% { opacity: 1; transform: translateY(-2px) rotate(1deg) scale(1.04); }
  to { opacity: 1; transform: none; }
}

.hidden-reveal-eyebrow {
  margin: 0 0 4px;
  color: var(--g6, #9a6bb5);
  font-family: var(--font-ui);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hidden-reveal h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: clamp(27px, 7.5vw, 34px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.hidden-reveal-copy {
  max-width: 28ch;
  margin: 9px auto 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.4;
}

.hidden-reveal-skip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  margin-top: 16px;
  border: 0;
  border-radius: 11px;
  background: var(--ink);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--ink) 32%, transparent);
  color: var(--page);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
}

.hidden-reveal-skip span { font-size: 17px; line-height: 0.7; }
.hidden-reveal-skip:active { transform: translateY(1px) scale(0.99); }
.hidden-reveal-skip:focus-visible { outline: 2px solid var(--g6, #9a6bb5); outline-offset: 3px; }

.hidden-reveal-foot {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 13px 0 0;
  font-size: 7.5px;
}

.hidden-reveal-foot span + span::before {
  content: "·";
  margin-right: 10px;
  color: var(--home-rule);
}

@media (max-width: 380px) {
  .hidden-reveal-card { padding: 20px 14px 15px; border-radius: 18px; }
  .hidden-reveal-card::before { border-radius: 18px 18px 0 0; }
  .hidden-reveal-tiles { gap: 6px; margin: 18px 0 15px; }
  .hidden-reveal h2 { font-size: 27px; }
  .hidden-reveal-copy { font-size: 11px; }
}

@media (max-height: 520px) {
  .hidden-reveal-card { max-width: 450px; padding: 16px 18px 13px; }
  .hidden-reveal-tiles { margin: 12px 0 10px; }
  .hidden-reveal-tiles span { width: 34px; font-size: 18px; }
  .hidden-reveal h2 { font-size: 24px; }
  .hidden-reveal-copy { margin-top: 5px; font-size: 10.5px; }
  .hidden-reveal-skip { min-height: 40px; margin-top: 10px; }
  .hidden-reveal-foot { margin-top: 8px; }
}

html[data-motion="reduced"].home-ready .home-grid .home-game,
html[data-motion="reduced"] #wordle:not([hidden]) .wordle-shell,
html[data-motion="reduced"] .wordle-result.is-revealed,
html[data-motion="reduced"] .wordle-result.is-revealed .wordle-result-card,
html[data-motion="reduced"] .hidden-reveal-card,
html[data-motion="reduced"] .hidden-reveal-tiles span {
    animation: none;
  }

html[data-motion="reduced"] .hidden-reveal,
html[data-motion="reduced"] .hidden-reveal-tiles span { transition: none; }

html[data-motion="reduced"] .hidden-reveal-card,
html[data-motion="reduced"] .hidden-reveal-tiles span { opacity: 1; transform: none; }

html[data-motion="reduced"] .hidden-reveal-tiles span.is-key { transform: rotate(3deg); }

html[data-motion="reduced"] .hidden-reveal.is-open .hidden-reveal-card { opacity: 1; transform: none; }

/* Touch targets must stay clickable even when the pointer is a finger rather
   than a mouse. The six pieces are intentionally not game buttons, so Safari
   needs the explicit touch affordance. */
.home-six-piece {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* The cover starts its build as the launch layer lifts, so the finished cover
   is never painted under the fading splash. home-build is the launch-only
   switch: its delays are set before the first frame and never retimed at the
   home-ready hand-off, which used to make the cover jump to near its end. */
html.home-build .six-1 { animation-delay: 60ms; }
html.home-build .six-2 { animation-delay: 110ms; }
html.home-build .six-3 { animation-delay: 160ms; }
html.home-build .six-4 { animation-delay: 210ms; }
html.home-build .six-5 { animation-delay: 260ms; }
html.home-build .six-6 { animation-delay: 310ms; }
html.home-build .home-six-caption { animation-delay: 340ms; }

/* Keep short descriptions from stranding a single word on their last line. */
.play-intro .sub,
.home-game-desc,
.header .sub {
  text-wrap: balance;
}

/* Longer settings copy reads better with a short final line avoided. */
.sheet-note {
  text-wrap: pretty;
}

/* ==========================================================================
   Low-end mode
   --------------------------------------------------------------------------
   `html.perf-lite` is set before the first paint by the inline script in
   index.html when the phone reports 2 GB of memory or fewer, four threads or
   fewer, or a data saver. It keeps every shape, colour and spacing; it only
   drops the full-screen backdrop blurs and the blurred arrival, which are the
   effects a weak GPU cannot composite at 60fps.
   ========================================================================== */

html.perf-lite .overlay,
html.perf-lite .sheet-backdrop,
html.perf-lite .wordle-result,
html.perf-lite .hidden-reveal-scrim,
html.perf-lite .fruit-over,
html.perf-lite .sudoku-result,
html.perf-lite .sudoku-paused {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* The sheet has no backdrop-filter in lite mode, so its normal 44% scrim is
   too transparent over a busy board. Keep a readable veil without asking a
   weak GPU to blur the whole viewport.

   Older WebViews (API 33 ships Chromium 109) parse `color-mix()` but compute
   it to transparent, so the scrim would have no background at all. Keep the
   opaque page colour as the fallback and only let the mix take over where it
   is actually supported. */
html.perf-lite .sheet-backdrop {
  background: var(--page);
}

@supports (background: color-mix(in srgb, red 50%, transparent)) {
  html.perf-lite .sheet-backdrop {
    background: color-mix(in srgb, var(--page) 96%, transparent);
  }
}

/* Without a blur behind them these veils have to be nearly opaque, or a busy
   board shows through the card that sits on top. */
html.perf-lite .overlay,
html.perf-lite .wordle-result,
html.perf-lite .hidden-reveal-scrim,
html.perf-lite .fruit-over,
html.perf-lite .sudoku-result,
html.perf-lite .sudoku-paused {
  background: color-mix(in srgb, var(--page) 96%, transparent);
}

html.perf-lite #wordle:not([hidden]):not(.shell-settled) .wordle-shell { animation-name: wordleArriveLite; }

@keyframes wordleArriveLite {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   Pointer and touch hygiene
   --------------------------------------------------------------------------
   Android's WebView keeps :hover on the element a finger last touched. The
   hover art here (a lit border, a lighter fill, a 2-5px lift) then stays on a
   button that is no longer being pressed until something else is tapped, which
   reads as a selection the reader cannot clear. Hover is decoration, so it is
   limited to devices that can actually hover; touch keeps :active for feedback.
   The focus ring is suppressed for touch too, because WebView marks a tapped
   button :focus-visible; a keyboard still gets the ring.
   ========================================================================== */

@media (hover: none) {
  .hub-share:hover,
  .hub-look:hover {
    transform: none;
    border-color: var(--home-rule);
    background: transparent;
  }

  .hub-focus:hover {
    transform: none;
    border-color: var(--home-rule);
    background: transparent;
  }

  .home-cta:hover {
    transform: none;
    box-shadow: 0 3px 0 rgba(33, 29, 24, 0.18);
  }

  .home-surprise:hover {
    border-color: var(--home-rule);
    background: transparent;
  }

  .home-game:hover,
  html[data-motion="full"] .home-game:hover {
    transform: none;
    border-color: var(--home-rule);
    box-shadow: 0 3px 0 var(--home-hard);
  }

  .home-game:hover .home-game-stage,
  .home-game:hover .home-game-arrow,
  html[dir="rtl"] .home-game:hover .home-game-arrow,
  .home-game:hover .home-game-play::after {
    transform: none;
  }

  html[dir="rtl"] .home-game:hover .home-game-arrow,
  html[dir="rtl"] .home-game:hover .home-game-play::after {
    transform: scaleX(-1);
  }

  html[data-motion="full"] .home-six-piece:hover { transform: none; }

  .hub-link:hover,
  .play-chip:hover { color: var(--muted); }

  .play-tool:hover { background: transparent; }
  .result-share:hover { background: var(--ghost-bg); }

  .games-home:hover,
  .play-chip:hover {
    background: transparent;
    color: var(--muted);
  }

  .play-tool:hover,
  .result-share:hover,
  .games-home:hover,
  html[data-motion="full"] .play-tool:hover,
  html[data-motion="full"] .games-home:hover,
  html[data-motion="full"] .result-share:hover { transform: none; }

  .app #new-game:hover,
  .play-screen .play-btn--solid:hover {
    background: var(--cart);
    color: var(--cart-ink);
  }

  .wordle-key:hover { background: var(--wordle-key); }
  .wordle-key.wordle-key--enter:hover { background: var(--cart); }

  .settings-summary:hover { background: var(--seg-bg, var(--panel)); }
  .setting-row:hover { background: var(--seg-bg, var(--panel)); }

  .sudoku-pad-key:hover { background: var(--panel); }
  .sudoku-tool:hover { background: var(--panel); }
  .sudoku-tool[aria-pressed="true"]:hover {
    background: color-mix(in srgb, var(--cart) 18%, var(--panel));
  }

  .daily-badge:hover { background: color-mix(in srgb, var(--t256) 38%, var(--panel)); }
  .daily-badge.is-earned:hover { background: color-mix(in srgb, var(--t256) 22%, var(--panel)); }
}

html[data-input="touch"] button:focus-visible,
html[data-input="touch"] a:focus-visible,
html[data-input="touch"] summary:focus-visible,
html[data-input="touch"] [tabindex]:focus-visible {
  outline: none !important;
}

/* The install block belongs to the browser: the APK is already installed, and
   the app never offers to add itself to the home screen. */
html.is-native #install-block { display: none !important; }

/* The build animation used fill-mode both, so its final transform kept winning
   over :active and a finished tile stopped pressing. The class lands on
   animationend (or its reduced-motion fallback); a tile being pressed keeps
   its own flash. */
html.six-settled.home-ready .home-six-piece { animation: none; }
