/* ---------- game collection ---------- */

[hidden] { display: none !important; }

body[data-screen="hub"] .app,
body[data-screen="water"] .app,
body[data-screen="sudoku"] .app,
body[data-screen="fruit"] .app,
body[data-screen="ttt"] .app,
body[data-screen="mines"] .app {
  pointer-events: none;
}

.hub {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* One flat page colour, exactly the colour written to theme-color. */
  background: var(--page);
  color: var(--ink);
  -webkit-overflow-scrolling: touch;
}

/* The dark home stays on the same flat page colour as the phone chrome. */

.hub-shell {
  width: min(100%, 960px);
  min-height: 100%;
  margin: 0 auto;
  padding: calc(var(--sa-top) + clamp(22px, 4vw, 34px))
    calc(var(--sa-right) + clamp(18px, 4.5vw, 40px))
    calc(var(--sa-bottom) + 22px)
    calc(var(--sa-left) + clamp(18px, 4.5vw, 40px));
  display: flex;
  flex-direction: column;
}

.hub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hub-brand {
  display: inline-flex;
  align-items: center;
}

.hub-word {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.hub h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(42px, 8.2vw, 78px);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.045em;
  text-transform: none;
  text-wrap: balance;
}

.hub h1 span { display: block; }

.mini-merge {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 132px;
}

.mini-tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-tile-low);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.mini-2 { background: var(--t2); }
.mini-4 { background: var(--t4); }
.mini-8 { background: var(--t8); color: #3b3833; }
.mini-16 { background: var(--t16); color: #3b3833; }

.mini-water {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  height: 116px;
}

.mini-tube {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  width: 30px;
  height: 76px;
  padding: 3px 2px 1px;
  border: 1.5px solid color-mix(in srgb, var(--ink) 30%, transparent);
  border-top-width: 2.5px;
  border-radius: 4px 4px 15px 15px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.03) 38%, rgba(255, 255, 255, 0.16)),
    color-mix(in srgb, var(--card) 30%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    inset 3px 0 6px -4px rgba(255, 255, 255, 0.5),
    0 8px 12px -12px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.mini-tube::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.04));
}

.mini-tube::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 9px;
  z-index: 3;
  width: 2px;
  height: 38%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent);
}

.mini-tube:nth-child(1) { transform: translateY(-9px); }
.mini-tube:nth-child(2) { height: 96px; }
.mini-tube:nth-child(3) { height: 62px; }

.mini-tube i {
  position: relative;
  z-index: 1;
  display: block;
  flex: 0 0 25%;
  width: 100%;
  min-height: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.02) 32% 70%, rgba(0, 0, 0, 0.14)),
    var(--mini-liquid, transparent);
}

.mini-tube i:first-child { border-radius: 1px 1px 12px 12px; }

.mini-tube i:last-child::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 1px;
  right: 1px;
  height: 4px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.06));
  pointer-events: none;
}

.mini-tube i.g1 { --mini-liquid: var(--g1, #e85f3b); }
.mini-tube i.g2 { --mini-liquid: var(--g2, #e3a92f); }
.mini-tube i.g3 { --mini-liquid: var(--g3, #8bbd54); }
.mini-tube i.g4 { --mini-liquid: var(--g4, #39a9a1); }
.mini-tube i.g5 { --mini-liquid: var(--g5, #5b8fd5); }

.mini-cluster {
  position: relative;
  width: 154px;
  height: 128px;
}

/* Number Merge reuses the fruit cluster's geometry so both thumbnails sit in
   the same frame at every breakpoint. */
.mini-num {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--mini-accent) 24%, #f6f1e8);
  box-shadow: inset 0 0 0 3px var(--mini-accent);
  color: #2c2723;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.n1 { width: 34px; height: 34px; left: 59px; top: 84px; font-size: 13px; --mini-accent: var(--g1, #d95151); }
.n2 { width: 42px; height: 42px; left: 88px; top: 58px; font-size: 15px; --mini-accent: var(--g2, #e98a36); }
.n3 { width: 52px; height: 52px; left: 38px; top: 38px; font-size: 17px; --mini-accent: var(--g3, #76a84c); }
.n4 { width: 44px; height: 44px; left: 6px; top: 72px; font-size: 14px; --mini-accent: var(--g5, #5b8fd5); }
.n5 { width: 30px; height: 30px; left: 116px; top: 22px; font-size: 10px; --mini-accent: var(--g6, #8b63b9); }

html[data-fruit-numbers="on"] .mini-fruit-cluster { display: none; }
html:not([data-fruit-numbers="on"]) .mini-number-cluster { display: none; }

.mini-fruit {
  position: absolute;
  display: block;
  border-radius: 50%;
  box-shadow: inset -4px -5px 0 rgba(0, 0, 0, 0.12), inset 4px 4px 0 rgba(255, 255, 255, 0.16);
}

.mini-fruit::after {
  content: "";
  position: absolute;
  width: 18%;
  height: 9%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  left: 22%;
  top: 18%;
  transform: rotate(-35deg);
}

.f1 { width: 34px; height: 34px; left: 59px; top: 84px; background: var(--g1, #d95151); }
.f2 { width: 42px; height: 42px; left: 88px; top: 58px; background: var(--g2, #e98a36); }
.f3 { width: 52px; height: 52px; left: 38px; top: 38px; background: var(--g6, #8b63b9); }
.f4 { width: 44px; height: 44px; left: 6px; top: 72px; background: var(--g3, #76a84c); }
.f5 { width: 30px; height: 30px; left: 116px; top: 22px; background: var(--g7, #d9b62b); }

.mini-ttt {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: 114px;
  height: 114px;
  padding: 6px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 55%, transparent);
}

.mini-ttt i {
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--cell);
  color: var(--t64);
  font-size: 27px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.mini-ttt i.x { color: var(--g5, #5b8fd5); }
.mini-ttt i.o { color: var(--g4, #39a9a1); }


.mini-mines {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: 118px;
  height: 118px;
  padding: 7px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 58%, transparent);
}

.mini-mines i {
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--cell);
  color: var(--muted);
  font-size: 18px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.mini-mines .mines-open { color: var(--g5, #4e79c4); background: color-mix(in srgb, var(--page) 52%, var(--panel)); }
.mini-mines .mines-flag { color: var(--t64); }
.mini-mines .mines-mine { color: var(--g1); background: color-mix(in srgb, var(--g1) 18%, var(--panel)); }

.game-tag {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hub-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: auto;
  padding-top: clamp(28px, 5vh, 54px);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The build label belongs to the collection, not to a game in progress. */
.hub-version {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* A small way back from a game to the collection. */
.games-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  cursor: pointer;
}

.games-home svg {
  width: 13px;
  height: 13px;
  flex: none;
}

.games-home:hover { color: var(--ink); }

.games-home:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.title-block .games-home { margin-bottom: 3px; }

.play-tools {
  display: flex;
  align-items: center;
  gap: 5px;
}

.play-tool {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: var(--ghost-bg);
  box-shadow: var(--ghost-shadow);
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms var(--ease-out), opacity 150ms var(--ease-out);
}

.play-tool svg {
  width: 17px;
  height: 17px;
  display: block;
}

.play-tool .exit { display: none; }
.play-tool.is-off { color: var(--muted); }
.play-tool.is-off .waves { display: none; }
.play-tool.is-off .slash { display: block; }
.play-tool .slash { display: none; }
.play-tool:active { transform: translateY(1px) scale(0.96); }
.play-tool:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

@media (max-width: 420px) {
  .play-tool { width: 36px; height: 36px; }
  .play-tools { gap: 4px; }
}

html[data-motion="reduced"] .play-tool { transition: none; }

/* ---------- shared game screen ---------- */

.play-screen {
  position: fixed;
  inset: 0;
  z-index: 31;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(62% 46% at 50% 38%, color-mix(in srgb, var(--panel) 30%, transparent), transparent 76%),
    var(--page);
  color: var(--ink);
  -webkit-overflow-scrolling: touch;
}

html[data-theme="dark"] .play-screen { background: var(--page); }

.play-shell {
  width: min(100%, 720px);
  min-height: 100%;
  margin: 0 auto;
  padding: calc(var(--sa-top) + 20px)
    calc(var(--sa-right) + 16px)
    calc(var(--sa-bottom) + 18px)
    calc(var(--sa-left) + 16px);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 3vh, 24px);
}

.play-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.play-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.play-intro { min-width: 0; }

.play-intro h1 {
  margin-top: 2px;
  font-size: clamp(31px, 8vw, 42px);
  letter-spacing: 0.01em;
}

.play-intro h1:focus { outline: none; }

.play-intro .sub { max-width: 30ch; }

.play-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
  gap: 7px;
  width: 180px;
  flex: none;
}

.play-stat {
  min-width: 0;
  padding: 7px 8px 6px;
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  text-align: center;
}

.play-stat strong {
  display: block;
  margin-top: 1px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.play-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.play-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.play-win {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 460px);
  padding: 10px 10px 10px 16px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--card-shadow);
}

.play-win p {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.35;
}

.play-win strong { color: var(--ink); }

/* A quiet icon beside the result action, so sharing stays possible without
   adding another full-width button to a compact card. */
.result-share {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--ghost-bg);
  color: var(--ink);
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms var(--ease-out), background-color 150ms var(--ease-out);
}

.result-share svg { width: 16px; height: 16px; display: block; }
.result-share:hover { background: var(--card); }
.result-share:active { transform: scale(0.94); }
.result-share:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Several result cards have room for a visible Share label. */
.result-share--labeled {
  width: auto;
  min-width: 34px;
  padding: 0 10px 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 11px;
}

.result-share--labeled .result-share-label {
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
}

.fruit-over-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fruit-over-actions .play-btn { flex: 1; }

.play-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.play-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  white-space: nowrap;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms var(--ease-out);
}

.play-btn:active { transform: translateY(1px) scale(0.985); }

.play-btn--solid {
  background: var(--btn-bg);
  color: var(--btn-ink);
  box-shadow: var(--btn-shadow);
}

.play-btn--ghost {
  background: var(--ghost-bg);
  color: var(--ink);
  box-shadow: var(--ghost-shadow);
}

.play-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.play-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

/* ---------- water sort ---------- */

.water-board {
  position: relative;
  width: min(100%, 430px);
  padding: 16px 12px 14px;
  border-radius: 26px;
  background:
    radial-gradient(70% 80% at 50% 0%, color-mix(in srgb, white 34%, transparent), transparent 72%),
    var(--panel);
  box-shadow: var(--board-shadow);
  overflow: hidden;
}

.water-board::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 6px;
  height: 1px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, white 20%, transparent);
}

.water-board::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(55% 55% at 50% 32%, rgba(255, 255, 255, 0.16), transparent 75%);
}

html[data-theme="dark"] .water-board {
  background:
    radial-gradient(70% 80% at 50% 0%, rgba(255, 255, 255, 0.035), transparent 72%),
    var(--panel);
}

.water-tubes {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--water-cols, 5), minmax(0, 1fr));
  align-items: end;
  justify-content: center;
  gap: clamp(10px, 2.6vw, 18px) clamp(6px, 2vw, 12px);
  width: 100%;
  padding: 4px 2px;
}

.water-tube {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  padding: 0 0 2px;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.water-tube:disabled { cursor: default; }

.water-glass {
  position: relative;
  display: block;
  width: min(100%, 62px);
  height: clamp(116px, 29vw, 148px);
  padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--ink) 30%, transparent);
  border-top-width: 3px;
  border-radius: 5px 5px 28px 28px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.02) 38%, rgba(255, 255, 255, 0.14)),
    color-mix(in srgb, var(--card) 35%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    inset 5px 0 9px -6px rgba(255, 255, 255, 0.5),
    inset -4px 0 8px -7px rgba(0, 0, 0, 0.22),
    inset 0 -12px 18px -16px rgba(0, 0, 0, 0.35),
    0 10px 14px -14px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transform-origin: 50% 100%;
  transition: transform 180ms var(--ease-spring);
}

.water-liquid {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  z-index: 1;
  height: calc(var(--fill, 1) * 25% - 3px);
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border-radius: 1px 1px 25px 25px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 -2px 5px rgba(0, 0, 0, 0.08);
  transform-origin: 50% 100%;
}

.water-drain {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: calc(var(--fill, 0) * 25% - 1px);
  z-index: 2;
  height: calc(var(--poured, 1) * 25%);
  overflow: hidden;
  border-radius: 1px 1px 0 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.02) 30% 70%, rgba(0, 0, 0, 0.16)),
    linear-gradient(to top,
      var(--drain-below, var(--drain)) 0,
      color-mix(in srgb, var(--drain-below, var(--drain)) 58%, var(--drain)) 3px,
      var(--drain) 8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  pointer-events: none;
  transform-origin: 50% 100%;
  animation: sourceDrain var(--pour-ms, 400ms) var(--ease-out) both;
}

.water-drain::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 0;
  right: 0;
  height: 7px;
  border-radius: 50% 50% 38% 38% / 90% 90% 18% 18%;
  background:
    radial-gradient(ellipse at 50% 100%, transparent 0 54%, rgba(255, 255, 255, 0.28) 62%, rgba(255, 255, 255, 0.03) 82%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 78%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
  pointer-events: none;
}

html[data-theme="dark"] .water-glass {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.01) 38%, rgba(255, 255, 255, 0.05)),
    color-mix(in srgb, var(--card) 25%, transparent);
}

.water-glass::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  height: 4px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.04));
}

.water-glass::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 8px;
  z-index: 2;
  width: 3px;
  height: 42%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent);
  opacity: 0.55;
  pointer-events: none;
}

.water-shine {
  position: absolute;
  top: 12%;
  left: 7%;
  z-index: 3;
  width: 3px;
  height: 36%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.water-seg {
  position: relative;
  display: block;
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.02) 30% 70%, rgba(0, 0, 0, 0.16)),
    linear-gradient(to top,
      var(--liquid-below, var(--liquid)) 0,
      color-mix(in srgb, var(--liquid-below, var(--liquid)) 58%, var(--liquid)) 3px,
      var(--liquid) 8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.water-seg:first-child {
  border-radius: 0 0 23px 23px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.02) 30% 70%, rgba(0, 0, 0, 0.16)),
    linear-gradient(180deg, var(--liquid) 0 58%, var(--liquid-deep));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -5px 9px -7px rgba(0, 0, 0, 0.32);
}

.water-seg.water-surface::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 0;
  right: 0;
  z-index: 2;
  height: 7px;
  border-radius: 50% 50% 38% 38% / 90% 90% 18% 18%;
  background:
    radial-gradient(ellipse at 50% 100%, transparent 0 54%, rgba(255, 255, 255, 0.28) 62%, rgba(255, 255, 255, 0.03) 82%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 78%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
  pointer-events: none;
}

.water-tube.is-selected .water-glass {
  transform: translateY(-10px) rotate(-2.5deg);
  border-color: color-mix(in srgb, var(--t64) 60%, var(--ink));
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--t64) 26%, transparent),
    0 18px 24px -18px rgba(0, 0, 0, 0.65);
}

.water-tube.is-target .water-glass {
  border-color: color-mix(in srgb, var(--t64) 88%, var(--ink));
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--t64) 25%, transparent),
    0 8px 18px -10px rgba(0, 0, 0, 0.4);
}

.water-tube.is-target::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--t64);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--t64) 18%, transparent);
  transform: translateX(-50%);
  animation: targetPulse 1.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.water-tube.is-pouring .water-glass {
  transform: translateY(-13px) rotate(var(--pour-tilt, -5deg));
  animation: waterTip var(--pour-ms, 500ms) cubic-bezier(0.22, 0.8, 0.3, 1) both;
}
.water-tube.is-receiving .water-liquid { animation: waterRise var(--pour-ms, 400ms) var(--ease-out) both; }
.water-tube.is-receiving .water-glass { animation: receivePulse 360ms ease-out; }
.water-tube.is-receiving .water-seg.water-surface::before { animation: waterSurfaceSettle var(--pour-ms, 400ms) var(--ease-out) both; }
.water-tube.is-invalid { animation: tubeShake 320ms ease-out; }

.water-tube:focus-visible .water-glass {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.water-tube:active .water-glass { transform: translateY(1px) scale(0.985); }
.water-tube.is-selected:active .water-glass { transform: translateY(-6px) rotate(-2.5deg) scale(0.985); }

.water-pour-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 45;
  pointer-events: none;
  overflow: visible;
}

.water-pour-layer path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: waterStream var(--pour-ms, 440ms) cubic-bezier(0.22, 0.75, 0.3, 1) forwards;
}

/* Avoid a filter layer on an animated SVG stream; the path is already thin
   enough and the blur cost was visible on desktop during every pour. */

.water-pour-splash,
.water-pour-ring,
.water-pour-drop { opacity: 0; }

.water-pour-splash {
  transform-box: fill-box;
  transform-origin: center;
  animation: waterSplash var(--pour-ms, 460ms) ease-out forwards;
}

.water-pour-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: waterRipple var(--pour-ms, 460ms) ease-out forwards;
}

.water-pour-drop {
  transform-box: fill-box;
  transform-origin: center;
  animation: waterDrop 420ms cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}

@keyframes waterRipple {
  0% { opacity: 0.5; transform: scale(0.25); }
  65% { opacity: 0.16; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.55); }
}

@keyframes waterDrop {
  0% { opacity: 0; transform: translate(0, 0) scale(0.4); }
  18% { opacity: 0.9; }
  52% { opacity: 0.8; transform: translate(var(--drop-x-mid), var(--drop-y-mid)) scale(1); }
  100% { opacity: 0; transform: translate(var(--drop-x), 12px) scale(0.55); }
}

@keyframes waterRise {
  from { clip-path: inset(calc(100% - var(--before-fill, 0) * 25%) 0 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes sourceDrain {
  from { transform: scaleY(1); }
  to { transform: scaleY(0); }
}

@keyframes waterSplash {
  0% { opacity: 0.55; transform: scale(0.35); }
  45% { opacity: 0.5; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.9); }
}

@keyframes receivePulse {
  0% { transform: scale(0.98); }
  55% { transform: scale(1.035); }
  100% { transform: scale(1); }
}

@keyframes waterSurfaceSettle {
  0% { transform: translateY(3px) scaleX(0.84) skewX(-4deg); opacity: 0.6; }
  35% { transform: translateY(-1px) scaleX(1.08) skewX(2deg); opacity: 1; }
  65% { transform: translateY(0) scaleX(0.97) skewX(-1deg); opacity: 1; }
  100% { transform: none; opacity: 1; }
}

@keyframes waterTip {
  0% { transform: translateY(0) rotate(0deg); }
  18% { transform: translateY(-15px) rotate(var(--pour-tilt, -5deg)); }
  100% { transform: translateY(-13px) rotate(var(--pour-tilt, -5deg)); }
}

@keyframes targetPulse {
  0%, 100% { opacity: 0.55; transform: translateX(-50%) scale(0.9); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

@keyframes tubeShake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-4px); }
  44% { transform: translateX(4px); }
  66% { transform: translateX(-3px); }
  82% { transform: translateX(2px); }
}

@keyframes waterStream {
  0% { stroke-dashoffset: 1; opacity: 0; }
  8% { opacity: 1; }
  58% { stroke-dashoffset: 0; opacity: 1; }
  86% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

@media (max-width: 420px) {
  .water-board { padding: 13px 9px 12px; border-radius: 22px; }
  .water-glass { height: clamp(108px, 30vw, 138px); }
  .water-tubes { gap: 10px 7px; }
  .water-tube.is-selected .water-glass { transform: translateY(-8px) rotate(-2deg); }
}

html[data-motion="reduced"] .water-glass,
html[data-motion="reduced"] .water-liquid,
html[data-motion="reduced"] .water-drain,
html[data-motion="reduced"] .water-seg,
html[data-motion="reduced"] .water-seg.water-surface::before,
html[data-motion="reduced"] .water-tube.is-target::after,
html[data-motion="reduced"] .water-tube.is-receiving .water-seg.water-surface::before { transition: none; animation: none; }

html[data-motion="reduced"] .water-pour-layer { display: none; }

/* ---------- fruit merge ---------- */

.fruit-main { justify-content: center; }

.fruit-stage {
  position: relative;
  width: min(100%, 360px);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--board-shadow);
  overflow: hidden;
}

.fruit-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 35px;
  padding: 9px 14px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.fruit-next-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* The next-fruit labels are small and secondary; on the panel tint the plain
   muted tone lands at 4.04:1, so nudge it darker while keeping the hierarchy. */
.fruit-next-label,
#fruit-next-name {
  color: color-mix(in srgb, var(--ink) 72%, var(--muted));
}

.fruit-next-dot {
  display: inline-block;
  width: 19px;
  height: 19px;
  margin: 0 1px;
  border-radius: 50%;
  background: #d95151;
  box-shadow: inset -2px -3px 0 rgba(0, 0, 0, 0.14);
}

.fruit-hint {
  color: color-mix(in srgb, var(--ink) 72%, var(--muted));
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#fruit-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  outline: none;
  cursor: crosshair;
}

#fruit-canvas:focus {
  outline: none;
}

/* The canvas is keyboard-playable, so it needs a ring the player can see. */
#fruit-canvas:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -3px;
  border-radius: 12px;
}

.fruit-over {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: color-mix(in srgb, var(--page) 72%, transparent);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  /* A veil, not a wall: on phones this layer goes full-screen, and a tap on
     the header or the footer must still reach the control under the dimmer.
     Only the card itself takes the pointer. */
  pointer-events: none;
}

.fruit-over-card {
  width: min(100%, 260px);
  padding: 21px 20px 20px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  text-align: center;
  pointer-events: auto;
}

.fruit-over-card h2 {
  margin: 8px 0 6px;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.fruit-over-card p:not(.game-tag) {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.fruit-over-card strong { color: var(--ink); }
.fruit-over-card .play-btn { width: 100%; }

@media (max-width: 420px) {
  .fruit-stage { width: min(100%, 360px); border-radius: 22px; }
  .fruit-hud { min-height: 32px; padding-top: 8px; }
}

/* ---------- tic tac toe ---------- */

.ttt-main { gap: 14px; }

.ttt-difficulty {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border-radius: 999px;
  background: var(--seg-bg);
  box-shadow: var(--ghost-shadow);
}

.ttt-difficulty button {
  min-height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.ttt-difficulty button[aria-pressed="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--card-shadow);
}

.ttt-difficulty button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: min(100%, 340px);
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--board-shadow);
}

.ttt-cell {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 14px;
  background: var(--cell);
  color: var(--ink);
  font: inherit;
  font-size: clamp(38px, 12vw, 56px);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms var(--ease-out), transform 120ms var(--ease-out);
}

html[data-theme="dark"] .ttt-cell { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }

.ttt-cell.is-x { color: var(--t64); }
.ttt-cell.is-o { color: #3fa9a0; }

.ttt-cell.is-win {
  background: color-mix(in srgb, var(--t64) 18%, var(--cell));
  box-shadow: inset 0 0 0 2px var(--t64);
}

.ttt-cell:disabled { cursor: default; }

.ttt-cell:not(:disabled):hover { background: color-mix(in srgb, var(--t64) 9%, var(--cell)); }
.ttt-cell:not(:disabled):active { transform: scale(0.96); }

.ttt-cell:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- minesweeper ---------- */

.mines-main { gap: 11px; }

.mines-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: min(100%, 360px);
}

.mines-difficulty {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border-radius: 999px;
  background: var(--seg-bg);
  box-shadow: var(--ghost-shadow);
}

.mines-difficulty button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.mines-difficulty button[aria-pressed="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--card-shadow);
}

.mines-difficulty button:focus-visible,
.mines-flag-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.mines-flag-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: var(--ghost-bg);
  box-shadow: var(--ghost-shadow);
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  touch-action: manipulation;
}

.mines-flag-toggle span { color: var(--t64); font-size: 14px; line-height: 1; }
.mines-flag-toggle.is-on {
  background: var(--ink);
  color: var(--page);
  box-shadow: var(--btn-shadow);
}

.mines-flag-toggle.is-on span { color: var(--t8); }

.mines-board-wrap {
  width: min(100%, 360px);
  padding: 8px;
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--board-shadow);
}

#mines[data-difficulty="medium"] .mines-board-wrap { width: min(100%, 440px, calc(100cqh - 12px)); }
#mines[data-difficulty="hard"] .mines-board-wrap { width: min(100%, 720px); overflow-x: auto; overflow-y: hidden; }

.mines-board {
  display: grid;
  grid-template-columns: repeat(var(--mines-cols, 9), minmax(0, 1fr));
  grid-template-rows: repeat(var(--mines-rows, 9), minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  aspect-ratio: var(--mines-cols, 9) / var(--mines-rows, 9);
  touch-action: manipulation;
}

/* Rows exist for the accessibility tree; display:contents keeps every cell a
   direct grid item of the board, so the field layout is unchanged. */
.mines-row { display: contents; }

.mines-cell {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: var(--cell);
  color: var(--ink);
  font: inherit;
  font-size: clamp(15px, 4.8vw, 20px);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 120ms var(--ease-out), transform 100ms var(--ease-out), color 120ms var(--ease-out);
}

.mines-cell:not(.is-open):not(.is-flagged):hover {
  background: color-mix(in srgb, var(--t64) 10%, var(--cell));
}

.mines-cell:active { transform: scale(0.94); }

.mines-cell.is-open {
  background: color-mix(in srgb, var(--page) 54%, var(--panel));
  cursor: default;
}

.mines-cell.is-open:not(.is-empty):hover { background: color-mix(in srgb, var(--page) 54%, var(--panel)); }
.mines-cell.is-empty { background: color-mix(in srgb, var(--page) 35%, var(--panel)); }
.mines-cell.is-flagged { color: var(--t64); font-size: clamp(14px, 4.4vw, 19px); }
.mines-cell.is-flagged::after { content: ""; position: absolute; }

.mines-cell.has-1 { color: #4e79c4; }
.mines-cell.has-2 { color: #4b8d59; }
.mines-cell.has-3 { color: #c94b35; }
.mines-cell.has-4 { color: #7b59a8; }
.mines-cell.has-5 { color: #a45e29; }
.mines-cell.has-6 { color: #2c8e8d; }
.mines-cell.has-7 { color: #34322e; }
.mines-cell.has-8 { color: #777066; }

html[data-theme="dark"] .mines-cell.has-1 { color: #8fb5ff; }
html[data-theme="dark"] .mines-cell.has-2 { color: #8fd59c; }
html[data-theme="dark"] .mines-cell.has-3 { color: #ff9b84; }
html[data-theme="dark"] .mines-cell.has-4 { color: #c7a2ef; }
html[data-theme="dark"] .mines-cell.has-5 { color: #f0b481; }
html[data-theme="dark"] .mines-cell.has-6 { color: #7ed8d4; }
html[data-theme="dark"] .mines-cell.has-7 { color: #f2e9dc; }
html[data-theme="dark"] .mines-cell.has-8 { color: #bdb2a3; }

.mines-cell.is-mine {
  background: color-mix(in srgb, var(--g1) 22%, var(--panel));
  color: var(--g1);
  font-size: clamp(14px, 4.4vw, 19px);
}

.mines-cell.is-detonated {
  background: var(--g1);
  color: #fff7f3;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, #fff7f3 55%, transparent);
}

.mines-cell.is-wrong {
  background: color-mix(in srgb, var(--warn) 16%, var(--panel));
  color: var(--warn);
}

.mines-cell:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  z-index: 2;
}

.mines-board[data-cols="16"] { gap: 3px; }
.mines-board[data-cols="16"] .mines-cell { border-radius: 5px; font-size: clamp(10px, 2.7vw, 14px); }
.mines-board[data-cols="30"] { gap: 2px; min-width: 540px; }
.mines-board[data-cols="30"] .mines-cell { border-radius: 3px; font-size: clamp(8px, 2vw, 12px); }

.mines-result { width: min(100%, 360px); }

@media (max-width: 420px) {
  .mines-toolbar { width: 100%; }
  .mines-difficulty button { padding: 0 10px; }
  .mines-flag-toggle { padding: 0 10px; font-size: 9.5px; }
  .mines-board-wrap { border-radius: 19px; padding: 7px; }
}

html[data-motion="reduced"] .mines-cell { transition: none; }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .mini-merge { width: 124px; }
  .mini-water { height: 108px; }
  .mini-cluster { transform: scale(0.9); }
}

@media (max-width: 420px) {
  .hub h1 { font-size: clamp(40px, 11.5vw, 52px); }
  .play-title-row { gap: 10px; }
  .play-intro h1 { font-size: clamp(28px, 8vw, 36px); }
  .play-stats { width: 142px; }
  .play-stat strong { font-size: 18px; }
  .play-win { align-items: flex-start; flex-direction: column; }
  .play-win .play-btn { width: 100%; }
  .play-foot { align-items: flex-start; flex-direction: column; }
  .play-note { text-align: left; }
  .water-glass { height: clamp(138px, 40vw, 174px); }
  .ttt-board { width: min(100%, 310px); }
}

@media (orientation: landscape) and (max-height: 560px) {
  .play-shell {
    width: min(100%, 860px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "head board"
      "foot board";
    align-items: center;
    gap: 10px 24px;
    padding-top: calc(var(--sa-top) + 14px);
    padding-bottom: calc(var(--sa-bottom) + 12px);
  }

  .play-head {
    grid-area: head;
    align-self: start;
    gap: 7px;
  }

  .play-title-row { display: block; }
  .play-intro .sub { display: none; }
  .play-stats { width: auto; margin-top: 10px; }
  .play-main { grid-area: board; gap: 8px; }
  .play-status { max-width: 44vw; }
  .play-win { width: min(44vw, 290px); }
  .play-foot {
    grid-area: foot;
    align-self: end;
    align-items: flex-start;
    flex-direction: column;
  }
  .play-note { display: none; }
  .water-glass { height: min(52vh, 170px); }
  .ttt-board { width: min(44vw, 290px); }
  .fruit-stage { width: min(44vw, 290px); }
}

html[data-motion="reduced"] .water-glass,
html[data-motion="reduced"] .ttt-cell,
html[data-motion="reduced"] .play-btn { transition: none; }


/* ---------- collection v2 layout ---------- */

.play-shell {
  width: min(100%, 620px);
  gap: clamp(10px, 2.6vh, 20px);
}

.play-main {
  flex: 1;
  justify-content: center;
  gap: 10px;
}

.play-foot { margin-top: 0; }

.play-title-row {
  align-items: center;
  margin-top: 1px;
  gap: 10px;
}

.play-intro { min-width: 0; }
.play-intro h1 {
  white-space: nowrap;
  font-size: clamp(24px, 6.5vw, 34px);
}

.play-stats { width: 152px; }

@media (max-width: 720px) {
  .mini-mines { width: 126px; height: 126px; }
}

@media (max-width: 420px) {
  .play-shell { gap: 10px; padding-top: calc(var(--sa-top) + 15px); }
  .play-intro h1 { font-size: clamp(24px, 6.8vw, 31px); }
  .play-stats { width: 138px; }
  .play-stat strong { font-size: 18px; }
  .play-status { font-size: 11px; min-height: 16px; }
  .play-win { width: 100%; }
  .water-glass { height: clamp(128px, 38vw, 164px); }
  .fruit-stage { max-width: 100%; }
  .mines-board-wrap { width: min(100%, 380px); }
}

@media (max-width: 520px) {
  .play-title-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
  }
  .play-stats {
    display: flex;
    width: auto;
    min-width: 0;
    margin-top: 0;
    grid-template-columns: none;
  }
  .play-intro h1 { font-size: clamp(23px, 7.5vw, 29px); }
  .play-stat .label { font-size: 7.5px; letter-spacing: 0.06em; }
}

@media (orientation: landscape) and (max-height: 560px) {
  .water-board { width: min(42vw, 360px); }
  .fruit-stage { width: min(40vw, 300px); }
  .mines-board-wrap { width: min(40vw, 300px); }
  .mines-toolbar { width: min(40vw, 300px); }
  .mines-difficulty button { padding-inline: 8px; }
}


@media (min-height: 760px) and (max-width: 720px) {
  .mines-board-wrap { width: min(100%, 380px); }
  .mines-toolbar { width: min(100%, 380px); }
}

/* Final portrait sizing: tall, readable Water Sort glasses and a centred last row. */
@media (orientation: portrait) and (max-width: 720px) {
  .water-glass { height: clamp(150px, 19vh, 176px); }
  .water-board { justify-content: center; }
}


/* Let a short final Water Sort row sit centred instead of leaving a hole on the right. */
.water-tubes {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  align-content: center;
  justify-content: center;
}

.water-tube {
  flex: 0 0 calc(33.333% - 8px);
}

.water-tubes[data-count="4"] .water-tube,
.water-tubes[data-count="7"] .water-tube,
.water-tubes[data-count="8"] .water-tube {
  flex-basis: calc(25% - 8px);
}
/* ==========================================================================
   Collection v4 — quieter chrome, game-first boards
   The shell now reads like one designed product rather than six templates:
   compact inline scores, a single tool cluster, editorial difficulty tabs,
   and boards that own the screen on small phones and in landscape.
   ========================================================================== */

/* ---------- hub ---------- */

.hub h1 {
  font-size: clamp(38px, 10vw, 56px);
  letter-spacing: -0.05em;
}

.mini-merge { width: 112px; }
.mini-water { height: 106px; }
.mini-cluster { transform: scale(0.9); }

.hub-foot {
  padding-top: 26px;
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

.hub-version {
  margin-top: 8px;
  font-size: 9px;
  letter-spacing: 0.1em;
}

/* One shared tool cluster instead of three floating white cards. */

.play-tools {
  gap: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 48%, transparent);
  box-shadow: none;
}

.play-tool {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.play-tool + .play-tool { margin-left: 1px; }
.play-tool:hover { background: color-mix(in srgb, var(--card) 82%, transparent); }
.play-tool:active { transform: scale(0.94); }

/* ---------- shared play shell ---------- */

.play-shell {
  gap: clamp(8px, 2dvh, 14px);
  padding-top: calc(var(--sa-top) + 16px);
}

.play-head { gap: 10px; }

.play-title-row {
  align-items: flex-end;
  gap: 12px;
  margin-top: 0;
}

.play-intro .game-tag {
  margin: 0 0 3px;
  font-size: 8.5px;
}

.play-intro h1 {
  font-size: clamp(23px, 6.5vw, 31px);
  line-height: 0.94;
  letter-spacing: 0.005em;
  white-space: nowrap;
}

.play-intro .sub {
  max-width: 34ch;
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.38;
}

.play-stats {
  display: flex;
  width: auto;
  flex: none;
  align-items: stretch;
  gap: 0;
}

.play-stat {
  min-width: 36px;
  padding: 0 0 0 10px;
  border-radius: 0;
  background: none;
  box-shadow: none;
  text-align: right;
}

.play-stat + .play-stat {
  margin-left: 9px;
  padding-left: 9px;
  border-left: 1px solid var(--line);
}

.play-stat .label {
  font-size: 8px;
  letter-spacing: 0.13em;
}

.play-stat strong {
  margin-top: 2px;
  font-size: 20px;
  line-height: 1;
}

.play-main { gap: 10px; }

.play-status {
  max-width: 46ch;
  min-height: 16px;
  font-size: 11px;
}

.play-win {
  width: min(100%, 430px);
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: none;
}

.play-win .play-btn { min-height: 38px; }

.play-foot {
  min-height: 42px;
  align-items: center;
  gap: 10px;
}

.play-actions {
  flex-wrap: nowrap;
  gap: 7px;
}

.play-btn {
  min-height: 42px;
  padding: 0 16px;
  font-size: 11.5px;
}

.play-note {
  max-width: 180px;
  font-size: 10.5px;
}

/* ---------- tic tac toe ---------- */

.ttt-main { gap: 12px; }

.ttt-difficulty {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 360px);
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.ttt-difficulty button {
  position: relative;
  min-height: 36px;
  padding: 0 6px;
  border-radius: 0;
  background: transparent;
  white-space: nowrap;
}

/* In two-player mode the levels still switch back to the computer, so they
   stay readable instead of being dimmed like disabled controls. */
.ttt-difficulty button.is-inactive:hover { color: var(--ink); }

.ttt-difficulty button[aria-pressed="true"] {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.ttt-difficulty button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: -1px;
  left: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

.ttt-board {
  width: min(100%, 360px);
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 24px;
  background: var(--panel);
}

.ttt-cell {
  min-height: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-size: clamp(46px, 14vw, 64px);
  box-shadow: none;
}

html[data-theme="dark"] .ttt-cell { box-shadow: none; }
.ttt-cell:nth-child(3n) { border-right: 0; }
.ttt-cell:nth-child(n + 7) { border-bottom: 0; }

.ttt-cell:not(:disabled):hover {
  background: color-mix(in srgb, var(--t64) 8%, transparent);
}

.ttt-cell.is-win {
  background: color-mix(in srgb, var(--t64) 16%, transparent);
  box-shadow: none;
}

.ttt-board { position: relative; }

.ttt-strike {
  position: absolute;
  z-index: 3;
  display: block;
  height: 3px;
  border-radius: 999px;
  background: var(--ink);
  opacity: 0.8;
  pointer-events: none;
  transform-origin: 0 50%;
  animation: tttStrike 260ms ease-out both;
}

@keyframes tttStrike {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

html[data-motion="reduced"] .ttt-strike { animation: none; }

.ttt-cell:focus-visible {
  z-index: 2;
  outline-offset: -3px;
}

/* ---------- minesweeper ---------- */

.mines-toolbar {
  width: min(100%, 360px);
  gap: 10px;
}

.mines-difficulty {
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mines-difficulty button {
  position: relative;
  min-height: 36px;
  padding: 0 11px;
  border-radius: 0;
  background: transparent;
}

.mines-difficulty button[aria-pressed="true"] {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.mines-difficulty button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

.mines-flag-toggle {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
}

.mines-flag-toggle.is-on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--page);
}

.mines-board-wrap {
  width: min(100%, 360px);
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 20px;
}

.mines-board { gap: 3px; }
.mines-cell { border-radius: 5px; }

/* ---------- water + fruit frames ---------- */

.water-board,
.fruit-stage {
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.fruit-hud {
  min-height: 34px;
  padding: 8px 12px 0;
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.fruit-hint {
  font-size: 8px;
  letter-spacing: 0.09em;
}

/* Footer hints are useful on desktop, but they are not worth a second
   footer row on a phone where the sub-line already teaches the controls. */
@media (max-width: 520px) {
  .play-note { display: none; }
}

@media (max-width: 380px) {
  .play-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .play-intro { flex: 1 1 100%; }

  .play-stats {
    width: 100%;
    justify-content: flex-start;
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid var(--line);
  }

  .play-stat {
    min-width: 0;
    padding-left: 0;
    text-align: left;
  }

  .play-stat + .play-stat {
    margin-left: 15px;
    padding-left: 15px;
  }

  .play-intro h1 { font-size: clamp(23px, 7.4vw, 28px); }
  .play-actions { gap: 6px; }
  .play-btn { padding-inline: 14px; }
}

@media (min-width: 700px) {
  .ttt-board { width: min(100%, 390px); }
  .mines-board-wrap,
  .mines-toolbar { width: min(100%, 390px); }
  .water-board { width: min(100%, 460px); }
  .fruit-stage { width: min(100%, 390px); }
}

@media (orientation: landscape) and (max-height: 560px) {
  .play-shell {
    grid-template-columns: minmax(0, 1fr) minmax(230px, auto);
    gap: 8px 26px;
    padding-top: calc(var(--sa-top) + 12px);
    padding-bottom: calc(var(--sa-bottom) + 10px);
  }

  .play-head { gap: 6px; }
  .play-title-row { display: block; }
  .play-intro h1 { font-size: clamp(23px, 4.8vh, 31px); }
  .play-intro .sub { display: none; }

  .play-stats {
    display: flex;
    width: auto;
    margin-top: 9px;
    padding-top: 0;
    border-top: 0;
    justify-content: flex-start;
  }

  .play-stat {
    min-width: 0;
    padding-left: 0;
    text-align: left;
  }

  .play-stat + .play-stat {
    margin-left: 12px;
    padding-left: 12px;
  }

  .play-main {
    width: auto;
    justify-content: center;
    gap: 8px;
  }

  .play-foot {
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-start;
  }

  .play-actions { flex-wrap: nowrap; }
  .play-note { display: none; }
  .ttt-board { width: min(44vw, 300px); }
  .mines-board-wrap,
  .mines-toolbar { width: min(44vw, 300px); }
  .fruit-stage { width: min(34vw, 230px); }

  /* Two rows of full-height glasses are taller than a landscape phone.
     Keep the colours readable but give the footer back its space. */
  .water-board {
    width: min(44vw, 320px);
    padding: 10px 8px 9px;
  }

  .water-tubes { gap: 8px 6px; }
  .water-glass { height: min(25vh, 100px); }
}

html[data-motion="reduced"] .play-tool { transition: none; }

/* =====================================================================
   v1.6 — one fixed play frame, square boards, palette everywhere
   ===================================================================== */

/* The appearance sheet is shared by every game, so it has to sit above the
   fixed play screens (z-index 31) rather than behind them — and above the
   share toast (70), the daily finish note (75) and the update banner (120),
   which used to float over an open panel. */
.sheet { z-index: 130; }

.play-screen {
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

.play-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(6px, 1.6dvh, 12px);
  padding-top: calc(var(--sa-top) + 14px);
  padding-bottom: calc(var(--sa-bottom) + 10px);
}

.play-head { min-width: 0; }

.play-main {
  height: 100%;
  min-height: 0;
  gap: clamp(4px, 1.1dvh, 9px);
  justify-content: center;
  overflow: hidden;
}

/* The stage takes exactly the space the header, tools and feedback leave.
   Boards are measured against the stage, never against the page. */
.board-stage {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  container-type: size;
}

/* Status and win/loss card share one reserved slot: showing a result never
   pushes the board, footer or the New round button out of the viewport. */
.play-feedback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 44px;
  min-height: 44px;
  flex: none;
}

.play-feedback > * { grid-area: 1 / 1; }
.play-feedback .play-status { min-height: 0; margin: 0; }

.play-feedback .play-win {
  width: min(100%, 430px);
  height: 44px;
  min-height: 0;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 6px 5px 12px;
}

.play-feedback .play-win p {
  min-width: 0;
  max-width: none;
  overflow: hidden;
  font-size: 10.5px;
  line-height: 1.25;
}

.play-feedback .play-win .play-btn {
  width: auto;
  flex: none;
  min-height: 34px;
  padding: 0 12px;
  font-size: 10.5px;
  white-space: nowrap;
}

/* ---------- tic tac toe ---------- */

/* Explicit rows are the fix for the first/second-move stretch: with auto rows
   the cells grew once they contained a mark and the bottom row was clipped. */
#ttt-board {
  width: min(100%, 360px, 100cqh);
  max-height: 100%;
  flex: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

#ttt-board .ttt-cell {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  font-size: clamp(30px, 16vmin, 64px);
}

.ttt-cell.is-x { color: var(--g1, var(--t64)); }
.ttt-cell.is-o { color: var(--g4, #3fa9a0); }
.ttt-cell.is-win { background: color-mix(in srgb, var(--g1, var(--t64)) 16%, transparent); }

/* ---------- minesweeper ---------- */

.mines-board-wrap {
  width: min(100%, 360px, calc(100cqh - 12px));
  max-height: 100%;
  flex: none;
}

.mines-board {
  width: 100%;
  grid-template-rows: repeat(var(--mines-rows, 9), minmax(0, 1fr));
}

.mines-cell {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  overflow: hidden;
}

.mines-cell.has-1 { color: var(--g5, #4e79c4); }
.mines-cell.has-2 { color: var(--g3, #4b8d59); }
.mines-cell.has-3 { color: var(--g1, #c94b35); }
.mines-cell.has-4 { color: var(--g6, #7b59a8); }
.mines-cell.has-5 { color: var(--g2, #a45e29); }
.mines-cell.has-6 { color: var(--g4, #2c8e8d); }
.mines-cell.has-7 { color: var(--ink); }
.mines-cell.has-8 { color: var(--muted); }

html[data-theme="dark"] .mines-cell.has-1 { color: color-mix(in srgb, var(--g5, #8fb5ff) 58%, #fff); }
html[data-theme="dark"] .mines-cell.has-2 { color: color-mix(in srgb, var(--g3, #8fd59c) 58%, #fff); }
html[data-theme="dark"] .mines-cell.has-3 { color: color-mix(in srgb, var(--g1, #ff9b84) 58%, #fff); }
html[data-theme="dark"] .mines-cell.has-4 { color: color-mix(in srgb, var(--g6, #c7a2ef) 58%, #fff); }
html[data-theme="dark"] .mines-cell.has-5 { color: color-mix(in srgb, var(--g2, #f0b481) 58%, #fff); }
html[data-theme="dark"] .mines-cell.has-6 { color: color-mix(in srgb, var(--g4, #7ed8d4) 58%, #fff); }
html[data-theme="dark"] .mines-cell.has-7 { color: var(--ink); }
html[data-theme="dark"] .mines-cell.has-8 { color: var(--muted); }

/* ---------- water, sudoku, fruit ---------- */

.water-board {
  width: min(100%, 430px);
  max-height: 100%;
  padding: 12px 10px 11px;
}

.water-glass { height: min(38cqh, 160px); }
.water-tubes[data-count="3"] .water-glass { height: min(62cqh, 200px); }

.fruit-stage {
  width: min(100%, 390px, calc(80cqh - 28px));
  max-height: 100%;
}

/* ---------- compact portrait headers ---------- */

/* Keep the title and the stat rail in a single row on a 320 px phone. */
@media (max-width: 380px) {
  .play-title-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 8px;
  }

  .play-intro { flex: 1 1 auto; }

  .play-stats {
    display: flex;
    width: auto;
    flex: none;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .play-stat { padding-left: 7px; text-align: right; }
  .play-stat + .play-stat { margin-left: 6px; padding-left: 7px; }
  .play-intro h1 { font-size: clamp(21px, 6.4vw, 26px); }
  /* The old narrow-screen rule hid the how-to line; it stays on the page. */
  .play-intro .sub { display: block; font-size: 9.5px; line-height: 1.25; }
}

/* Short screens trade decorative spacing for board space, not information. */
@media (max-height: 700px) {
  .play-shell {
    gap: 6px;
    padding-top: var(--pb-gutter-top);
    padding-bottom: var(--pb-gutter-bottom);
  }

  .play-head { gap: 5px; }
  .play-tools { padding: 2px; }
  .play-tool { width: 34px; height: 34px; }
  .play-tool svg { width: 15px; height: 15px; }
  .play-intro .game-tag { margin-bottom: 2px; font-size: 7.5px; }
  .play-intro h1 { font-size: clamp(20px, 5.8vw, 27px); }
  .play-intro .sub { margin-top: 2px; font-size: 10px; line-height: 1.25; }
  .play-stat .label { font-size: 7px; }
  .play-stat strong { font-size: 17px; }
  .play-main { gap: 4px; }
  .ttt-difficulty button,
  .mines-difficulty button,
  .mines-flag-toggle { min-height: 30px; }
  .play-feedback { height: 40px; min-height: 40px; }
  .play-feedback .play-win { height: 40px; min-height: 0; padding-top: 4px; padding-bottom: 4px; }
  .play-feedback .play-win .play-btn { min-height: 32px; }
  .play-foot { min-height: 38px; }
  .play-btn { min-height: 38px; }
}


/* Side-by-side landscape, including desktop windows that are wider than they
   are tall. The board column owns the full height; the left column keeps the
   title, stats, controls and hint visible. */
@media (orientation: landscape) and (max-height: 760px) {
  .play-shell {
    width: min(100%, 620px);
    grid-template-columns: minmax(0, 1fr) minmax(0, auto);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "head board"
      "foot board";
    align-items: center;
    gap: 4px 20px;
    padding-top: var(--pb-gutter-top);
    padding-bottom: var(--pb-gutter-bottom);
  }

  .play-head {
    grid-area: head;
    align-self: end;
    gap: 5px;
    min-width: 0;
  }

  .play-title-row { display: block; margin: 0; }
  .play-intro .sub { display: block; }

  .play-stats {
    display: flex;
    width: auto;
    margin-top: 7px;
    padding-top: 0;
    border-top: 0;
    justify-content: flex-start;
  }

  .play-stat { min-width: 0; padding-left: 0; text-align: left; }
  .play-stat + .play-stat { margin-left: 10px; padding-left: 10px; }

  .play-main {
    grid-area: board;
    width: min(320px, 54vw);
    height: 100%;
    gap: 4px;
  }

  .play-foot {
    grid-area: foot;
    align-self: start;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .play-note { display: block; max-width: none; }

  #ttt-board { width: min(100%, 300px, 100cqh); }
  .mines-board-wrap { width: min(100%, 300px, calc(100cqh - 12px)); }
  .fruit-stage { width: min(100%, 300px, calc(76cqh - 30px)); }
  .water-board { width: 100%; }
  .ttt-difficulty,
  .mines-toolbar { width: 100%; }
  .water-glass { height: min(32cqh, 120px); }
  .water-tubes[data-count="3"] .water-glass { height: min(52cqh, 150px); }
  .water-tubes { gap: 6px 5px; }
  .mines-difficulty button { padding-inline: 8px; }
}

/* =====================================================================
   v1.7 — landscape and desktop composition
   ===================================================================== */

/* Landscape laptops and tablets: the top bar owns a full-width row, the info
   rail has room for every control, and the board column uses the full height.
   This replaces the cramped 620px two-column frame from 1.6. */
@media (orientation: landscape) and (min-height: 500px) {
  .play-shell {
    position: relative;
    width: min(100%, 1080px);
    height: 100%;
    min-height: 0;
    padding: calc(var(--sa-top) + 66px)
      calc(var(--sa-right) + 28px)
      calc(var(--sa-bottom) + 16px)
      calc(var(--sa-left) + 28px);
    display: grid;
    grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "head board"
      ". board"
      "foot board";
    align-items: start;
    gap: 12px 40px;
  }

  .play-head {
    grid-area: head;
    display: block;
    align-self: start;
    width: 100%;
    min-width: 0;
  }

  .play-title-row {
    display: block;
    width: 100%;
    margin: 0;
  }

  .play-intro h1 {
    font-size: clamp(32px, 3.2vw, 42px);
    line-height: 0.98;
    white-space: normal;
    overflow-wrap: break-word;
  }

  .play-intro .sub {
    display: block;
    max-width: 30ch;
    margin-top: 7px;
    font-size: 13.5px;
    line-height: 1.4;
  }

  .play-stat .label { font-size: 9.5px; }
  .play-stat strong { font-size: 23px; }

  .play-btn { min-height: 44px; font-size: 12.5px; }
  .play-tool { width: 44px; height: 44px; }
  .play-tool svg { width: 20px; height: 20px; }

  .play-note {
    max-width: 34ch;
    font-size: 11.5px;
    line-height: 1.35;
  }

  .play-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
    width: min(100%, 300px);
    margin-top: 18px;
    padding-top: 13px;
    gap: 8px;
    border-top: 1px solid var(--line);
    justify-content: stretch;
  }

  .play-stat {
    min-width: 0;
    padding: 0;
    text-align: left;
  }

  .play-stat + .play-stat {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .play-main {
    grid-area: board;
    align-self: stretch;
    width: 100%;
    max-width: 620px;
    height: 100%;
    min-height: 0;
    justify-self: center;
    gap: 10px;
  }

  .play-foot {
    grid-area: foot;
    align-self: end;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }

  .play-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .play-note {
    display: block;
    max-width: 32ch;
    text-align: left;
  }

  .ttt-difficulty,
  .mines-toolbar {
    width: min(100%, 460px);
    margin-inline: auto;
  }

  .board-stage {
    width: 100%;
    min-height: 0;
  }

  #ttt-board { width: min(100%, 430px, 100cqh); }
  .mines-board-wrap { width: min(100%, 440px, calc(100cqh - 10px)); }
  .fruit-stage { width: min(100%, 390px, calc(84cqh - 30px)); }
  .water-board { width: min(100%, 470px); }
  .water-glass { height: min(38cqh, 170px); }
  .water-tubes[data-count="3"] .water-glass { height: min(52cqh, 200px); }

  .play-feedback { height: 44px; min-height: 44px; }
  .play-feedback .play-win { width: min(100%, 460px); }
}

/* Compact laptops and small tablets: give the board the room back instead of
   letting the fixed info rail squeeze it. */
@media (orientation: landscape) and (min-height: 500px) and (max-width: 820px) {
  .play-shell {
    grid-template-columns: minmax(210px, 40vw) minmax(0, 1fr);
    gap: 24px;
  }

  .play-intro h1 { font-size: clamp(26px, 4.6vw, 32px); }
}

/* Short landscape phones: compact top bar and rail, board still owns the
   height. The info column is wide enough that Undo / Restart / New shape can
   wrap instead of sliding underneath the board. */
@media (orientation: landscape) and (max-height: 520px) {
  .play-shell {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: var(--pb-gutter-top)
      calc(var(--sa-right) + 12px)
      var(--pb-gutter-bottom)
      calc(var(--sa-left) + 12px);
    display: grid;
    grid-template-columns: minmax(230px, 31vw) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "head board"
      "foot board";
    align-items: start;
    gap: 6px 18px;
  }

  .play-head {
    grid-area: head;
    display: flex;
    flex-direction: column;
    align-self: start;
    width: 100%;
    min-width: 0;
    gap: 6px;
  }

  .play-tools { padding: 2px; }
  .play-tool { width: 34px; height: 34px; }
  .play-tool svg { width: 15px; height: 15px; }

  .play-title-row {
    display: block;
    width: 100%;
    margin: 0;
  }

  .play-intro h1 {
    font-size: clamp(24px, 3.6vw, 34px);
    line-height: 0.98;
    white-space: normal;
    overflow-wrap: break-word;
  }

  .play-intro .sub {
    display: block;
    max-width: 30ch;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.32;
  }

  .play-stats {
    display: flex;
    width: auto;
    margin: 6px 0 0;
    padding: 0;
    border: 0;
    gap: 0;
  }

  .play-stat {
    min-width: 0;
    padding-left: 0;
    text-align: left;
  }

  .play-stat + .play-stat {
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid var(--line);
  }

  .play-stat .label { font-size: 9px; }
  .play-stat strong { font-size: 19px; }

  .play-main {
    grid-area: board;
    align-self: stretch;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    justify-self: stretch;
    gap: 4px;
  }

  .play-foot {
    grid-area: foot;
    align-self: end;
    width: 100%;
    min-height: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .play-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .play-btn {
    min-height: 38px;
    padding: 0 13px;
    font-size: 12px;
  }

  .play-note {
    display: block;
    max-width: 32ch;
    text-align: left;
    font-size: 10.5px;
    line-height: 1.28;
  }

  .ttt-difficulty,
  .mines-toolbar {
    width: min(100%, 340px);
    margin-inline: auto;
  }

  .ttt-difficulty button,
  .mines-difficulty button {
    min-height: 34px;
    padding-inline: 8px;
    font-size: 10.5px;
  }

  .mines-flag-toggle {
    min-height: 34px;
    padding-inline: 8px;
    font-size: 10.5px;
  }

  .mines-toolbar { gap: 6px; }
  .board-stage { width: 100%; min-height: 0; }

  #ttt-board { width: min(100%, 380px, 100cqh); }
  .mines-board-wrap { width: min(100%, 380px, calc(100cqh - 8px)); }
  .fruit-stage { width: min(100%, 340px, calc(84cqh - 30px)); }
  .water-board { width: min(100%, 430px); padding: 8px 8px 7px; }
  .water-glass { height: min(60cqh, 190px); }
  .water-tubes[data-count="3"] .water-glass { height: min(72cqh, 220px); }
  .water-tubes { gap: 6px 5px; }

  .play-feedback { height: 42px; min-height: 42px; }
  .play-feedback .play-win { height: 42px; min-height: 0; padding: 4px 5px 4px 10px; }
  .play-feedback .play-win p { font-size: 10.5px; line-height: 1.2; }
  .play-feedback .play-win .play-btn { min-height: 34px; padding: 0 10px; font-size: 10.5px; }
  .play-feedback .play-win .result-share { width: 28px; height: 28px; }
  .play-feedback .play-win .result-share svg { width: 14px; height: 14px; }
}

/* The narrowest landscape phones trade the back label for the icon; the
   control keeps its accessible name. */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 760px) {
  .games-home span { display: none; }
  .games-home {
    width: 30px;
    height: 30px;
    padding: 0;
    justify-content: center;
  }
  .play-tools .play-tool { width: 32px; height: 32px; }
  .play-tools .play-tool svg { width: 14px; height: 14px; }
}

/* Very large desktop windows get a slightly wider rail and board so the
   composition does not look lost in the middle of the screen. */
@media (orientation: landscape) and (min-width: 1300px) and (min-height: 700px) {
  .play-shell {
    width: min(100%, 1220px);
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 48px;
  }

  .play-intro h1 { font-size: clamp(34px, 2.5vw, 42px); }

  #ttt-board { width: min(100%, 480px, 100cqh); }
  .mines-board-wrap { width: min(100%, 490px, calc(100cqh - 10px)); }
  .fruit-stage { width: min(100%, 430px, calc(84cqh - 30px)); }
  .water-board { width: min(100%, 520px); }
}

/* ==========================================================================
   v1.8 — one collection, one chrome
   Colour belongs to the collection, not to each game. The homepage holds the
   only appearance control; every game keeps the same back, stat cards and
   bottom tool row as Merge.
   ========================================================================== */

/* ---------- homepage ---------- */

.hub-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.hub-share {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--card) 76%, transparent);
  box-shadow: var(--card-shadow);
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.hub-share svg { width: 18px; height: 18px; display: block; }

.hub-share:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--ink) 20%, transparent);
  background: var(--card);
}

.hub-share:active { transform: scale(0.96); }
.hub-share:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.hub-look {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 8px;
  min-height: 42px;
  padding: 5px 9px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 76%, transparent);
  box-shadow: var(--card-shadow);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.hub-look:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--ink) 20%, transparent);
  background: var(--card);
}

.hub-look:active { transform: scale(0.985); }

.hub-look:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.hub-look-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: none;
  gap: 1px;
  line-height: 1.2;
  text-align: left;
}

.hub-look-copy span {
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hub-look-copy strong {
  max-width: 12ch;
  overflow: visible;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.hub-look-chevron {
  margin-right: 1px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.hub h1 {
  max-width: 14ch;
  font-size: clamp(38px, 7.4vw, 64px);
}

.sheet-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 480px) {
  .hub-look { padding-right: 8px; }
}


/* ---------- shared game header ---------- */

.play-head > .games-home {
  align-self: flex-start;
  margin-bottom: 1px;
}

.play-title-row {
  align-items: flex-end;
  gap: 12px;
}

/* The same compact card row as Merge's score strip. */
.play-stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  width: min(46%, 190px);
  gap: 5px;
  flex: none;
}

.play-stat,
.play-stat + .play-stat {
  min-width: 0;
  margin: 0;
  padding: 6px 7px 5px;
  border: 0;
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  text-align: center;
}

.play-stat .label {
  font-size: 8px;
  letter-spacing: 0.12em;
}

.play-stat strong {
  margin-top: 1px;
  font-size: 18px;
  line-height: 1.1;
}

/* ---------- shared game footer ---------- */

.play-foot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
}

.play-tools {
  display: flex;
  grid-column: 1;
  grid-row: 1;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.play-tool {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--ghost-bg);
  box-shadow: var(--ghost-shadow);
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms var(--ease-out), background-color 150ms var(--ease-out);
}

.play-tool svg { width: 19px; height: 19px; display: block; }
.play-tool:hover { background: var(--card); }
.play-tool:active { transform: translateY(1px) scale(0.96); }
.play-tool:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.play-tool.is-off { color: var(--muted); }
.play-tool.is-off .waves { display: none; }
.play-tool.is-off .slash { display: block; }
.play-tool .slash { display: none; }
.play-tool .exit { display: none; }

.play-actions {
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.play-btn { padding-inline: 15px; }

.play-note {
  grid-column: 1 / -1;
  grid-row: 2;
  max-width: none;
  text-align: center;
}

@media (max-width: 420px) {
  .play-stats { width: min(47%, 178px); }
  .play-tools { gap: 6px; }
  .play-tool { width: 38px; height: 38px; border-radius: 11px; }
  .play-tool svg { width: 17px; height: 17px; }
  .play-btn { min-height: 40px; padding-inline: 13px; }
}

@media (max-width: 380px) {
  .play-title-row { display: block; }
  .play-stats { width: 100%; margin-top: 9px; }
  .play-foot { grid-template-columns: 1fr; gap: 8px; }
  .play-tools { grid-row: 1; }
  .play-actions { grid-column: 1; grid-row: 2; justify-content: flex-start; }
  .play-note { grid-row: 3; text-align: left; }
}

/* The landscape rail is narrow by design, so the tools and actions become
   two calm rows instead of trying to share a row. */
@media (orientation: landscape) and (min-height: 500px) {
  .play-shell { padding-top: calc(var(--sa-top) + 22px); }

  .play-stats {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    width: min(100%, 300px);
    margin: 12px 0 0;
    padding: 0;
    border: 0;
    gap: 5px;
  }

  .play-stat,
  .play-stat + .play-stat {
    margin: 0;
    padding: 6px 7px 5px;
    border: 0;
    text-align: center;
  }

  .play-foot {
    grid-template-columns: 1fr;
    align-content: start;
    align-items: flex-start;
    gap: 7px;
  }

  .play-tools { grid-row: 1; }
  .play-actions { grid-column: 1; grid-row: 2; justify-content: flex-start; }
  .play-note { grid-row: 3; text-align: left; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .play-head > .games-home { min-height: 28px; }
  .play-tool { width: 30px; height: 30px; border-radius: 9px; }
  .play-tool svg { width: 14px; height: 14px; }
  .play-tools { gap: 5px; }
  .play-stat,
  .play-stat + .play-stat { padding: 4px 5px; }
  .play-stat strong { font-size: 16px; }
}

@media (orientation: landscape) and (max-height: 390px) {
  .play-note { display: none; }
}

html[data-motion="reduced"] .hub-look { transition: none; }

@media (orientation: landscape) and (max-height: 520px) {
  .play-foot {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .play-tools { grid-row: 1; }
  .play-actions { grid-column: 1; grid-row: 2; justify-content: flex-start; }
  .play-note { grid-row: 3; text-align: left; }
}

/* Short landscape has a full-width stat row under the title in the rail. */
@media (orientation: landscape) and (max-height: 520px) {
  .play-stats { width: 100%; }
}

/* The narrowest phone keeps Merge's three cards beside the title without a
   three-pixel horizontal spill. */
@media (max-width: 340px) {
  .header { gap: 8px; }
  .title-block { min-width: 0; }
  .scores { width: 168px; gap: 5px; }
}

/* Portrait starts at the same quiet top inset as Merge. */
@media (orientation: portrait) {
  .play-shell { padding-top: calc(var(--sa-top) + 20px); }
}

/* Keep the three game actions on one row at normal phone widths; the labels
   still have a full-height tap target. */
@media (max-width: 420px) {
  .play-tool { width: 40px; height: 40px; }
  .play-actions { gap: 6px; }
  .play-btn { padding-inline: 10px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .play-actions { gap: 6px; }
  .play-actions .play-btn { padding-inline: 10px; }
}

/* Compact actions: tighter labels, still a 40px tap target. */
@media (max-width: 420px) {
  .play-foot .play-actions { gap: 4px; }
  .play-foot .play-actions .play-btn { padding-inline: 8px; }
}

/* ==========================================================================
   v1.9 — a scoped reset per game and a plain back arrow. Kept together so
   these shared controls stay in step.
   ========================================================================== */

/* The arrow is the whole control: a quiet square that reads instantly and
   leaves the title row the space it needs on narrow phones. */
.games-home {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ghost-bg);
  box-shadow: none;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 150ms var(--ease-out), transform 120ms var(--ease-out);
}

.games-home::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 14px;
}

.games-home svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.games-home:hover {
  background: var(--card);
  color: var(--ink);
}

.games-home:active { transform: scale(0.96); }

.games-home:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 12px;
}

.title-block .games-home {
  margin-bottom: 5px;
}

.play-head {
  gap: 8px;
}

.play-head > .games-home {
  margin-bottom: 0;
}

.hub-actions { gap: 9px; }

/* The reset is deliberately quiet until it is needed. */
#merge-reset,
.play-reset {
  color: var(--muted);
}

#merge-reset:hover,
#merge-reset:focus-visible,
.play-reset:hover,
.play-reset:focus-visible {
  color: var(--warn);
}

/* A compact confirmation instead of a second tap. It keeps the destructive
   action explicit and names the one game that will be cleared. */
.sheet-card--confirm {
  width: min(100%, 420px);
}

.reset-actions {
  display: flex;
  margin-top: 20px;
}

.reset-confirm {
  width: 100%;
  min-height: 48px;
  border: 0;
  background: #b74a34;
  color: #fff7f3;
  font-weight: 800;
}

.reset-confirm:hover {
  background: #a33f2b;
}

html[data-theme="dark"] .reset-confirm {
  background: #c75a42;
}

html[data-theme="dark"] .reset-confirm:hover {
  background: #d2684f;
}

.reset-confirm:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* On phones the Look control keeps its name instead of showing only the
   current palette, so the universal colour settings are never a guess. */
@media (max-width: 520px) {
  .hub-actions { gap: 8px; }
  .hub-share { width: 40px; height: 40px; }
  .hub-look {
    gap: 6px;
    padding: 4px 9px 4px 5px;
  }
}

@media (max-width: 360px) {
  .games-home { width: 36px; height: 36px; }
  .hub-share { width: 38px; height: 38px; }
}

html[data-motion="reduced"] .hub-share,
html[data-motion="reduced"] .games-home { transition: none; }

/* Copy feedback for sharing. It floats above the build label, never moves
   layout, and is announced politely rather than stealing focus. */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sa-bottom) + 22px);
  z-index: 70;
  max-width: min(86vw, 360px);
  padding: 11px 17px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--page);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
  pointer-events: none;
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

html[data-motion="reduced"] .toast { transition: none; }

/* ==========================================================================
   Landscape legibility
   The short-landscape rail carries the title, description, stats, tools and
   actions. Keep those at reading size and let the footer sit on the bottom
   edge instead of shrinking into the top corner.
   ========================================================================== */

/* On the narrowest phones the full name and three actions need more room
   than the header has. Keep the name, give the appearance control its icon,
   and leave the full label to screen readers. */
@media (max-width: 380px) {
  .hub-top { gap: 10px; }
  .hub-brand { gap: 8px; }
  .hub-word { font-size: 10.5px; letter-spacing: 0.13em; }
  .hub-actions { gap: 8px; }
  /* The pill keeps its palette name: two dots on their own say nothing. The
     chevron is hidden by the pill's own ladder in home.css. */
  .hub-look { gap: 6px; padding-inline: 8px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .play-tools .play-tool { width: 34px; height: 34px; border-radius: 10px; }
  .play-tools .play-tool svg { width: 15px; height: 15px; }
  .play-actions .play-btn {
    min-height: 38px;
    padding-inline: 13px;
    font-size: 12px;
  }
  .play-note { font-size: 10.5px; line-height: 1.3; }
  .play-head .sub { font-size: 13px; line-height: 1.4; }
  .play-stat .label { font-size: 9px; }
  .play-stat strong { font-size: 18px; }
  .ttt-difficulty button,
  .mines-difficulty button,
  .mines-flag-toggle { min-height: 38px; font-size: 12px; }
  .play-feedback .play-win p { font-size: 11px; }
  .play-feedback .play-win .play-btn { font-size: 11.5px; }
  .water-glass { height: min(34cqh, 110px); }
  .water-tubes[data-count="3"] .water-glass { height: min(52cqh, 170px); }
}

/* Very small portrait phones have just enough room for a taller test tube if
   the board gives back a few pixels of padding. Half the stage minus the
   padding and row gap keeps the second row clear of the footer, including
   on a 320x480 screen. */
@media (orientation: portrait) and (max-width: 380px) {
  .water-board { padding: 6px 8px 5px; }
  .water-tubes { gap: 3px 5px; padding: 1px; }
  .water-glass { width: min(100%, 56px); height: min(calc(50cqh - 9px), 120px); }
}

/* ---------- first-play coach ---------- */

.coach {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 6px 7px 6px 9px;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 13px;
  background: var(--card);
  background: color-mix(in srgb, var(--card) 84%, var(--page));
  box-shadow: var(--card-shadow);
  color: var(--ink);
  text-align: left;
}

.coach-step {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  padding: 0 5px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--muted-strong);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
}

.coach-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
}

.coach-skip {
  flex: none;
  min-width: 36px;
  height: 30px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
}

.coach-skip:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.coach-skip:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

.coach.coach-in { animation: coachIn 220ms var(--ease-out) both; }

.status.has-coach .status-line,
.status.has-coach .key-hint { display: none; }

.play-feedback.has-coach .play-status,
.play-feedback.has-coach .play-win { visibility: hidden; }

.play-feedback .coach {
  grid-area: 1 / 1;
  height: 100%;
  min-height: 0;
  padding: 4px 6px 4px 9px;
}

.play-feedback .coach-text { font-size: 11px; line-height: 1.22; }

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

@media (max-width: 380px) {
  .coach { gap: 6px; padding-inline: 8px 4px; }
  .coach-step { min-width: 26px; padding-inline: 3px; font-size: 8px; }
  .coach-text { font-size: 10.5px; }
  .coach-skip { min-width: 32px; padding-inline: 4px; font-size: 8.5px; }
}

html[data-motion="reduced"] .coach.coach-in { animation: none; }

/* ==========================================================================
   Portrait phone controls — one centred group, like Merge
   The board used to consume the whole middle row, which pinned every game's
   controls to the screen edge. Grouping the board, feedback and footer lets
   the whole cluster sit with Merge's breathing room at the bottom.
   ========================================================================== */

.play-body { display: contents; }

@media (orientation: portrait) and (max-width: 720px) {
  /* min-content keeps the body row from clamping: a column that genuinely
     needs more height grows the shell and scrolls instead of spilling its
     footer into the bottom gutter. */
  .play-shell { grid-template-rows: auto minmax(min-content, 1fr); }

  /* auto + min-height keeps the centred layout on screens that fit, and lets
     a tall column grow the shell (so the screen scrolls) instead of pushing
     the footer past the bottom gutter, where the blur band would sit on it. */
  .play-body {
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    height: auto;
    min-height: 100%;
    gap: 10px;
  }

  .play-main {
    height: auto;
    flex: 0 0 auto;
    overflow: visible;
  }

  /* On the shortest phones the centred column can still be taller than the
     viewport, so the shell keeps the footer inside the bottom gutter by
     trimming the two rows that are pure breathing room. */
  .play-body { gap: 8px; }


  /* Portrait measures against the page rather than the stage: the column has
     to be able to grow past its padding, and size containment would hide that
     overflow from the scroller. cqh therefore resolves to the viewport here. */
  .board-stage {
    flex: 0 0 auto;
    container-type: normal;
  }


  .play-body > .play-foot {
    width: 100%;
    flex: none;
  }
}

/* Keep tall boards from outgrowing the centred group on short phones. These
   caps only bind when the phone is shorter than a typical modern handset. */
@media (orientation: portrait) and (max-width: 720px) {
  .fruit-stage { width: min(100%, 390px); }
}

/* At 380px and below the footer and tools share one compact row. This keeps
   the cluster short enough for 360x640 and 320x568 screens. */
@media (orientation: portrait) and (max-width: 380px) {
  .play-body > .play-foot {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px;
  }

  .play-body > .play-foot .play-tools { grid-row: 1; gap: 3px; }
  .play-body > .play-foot .play-tool { width: 36px; height: 36px; }
  .play-body > .play-foot .play-tools svg { width: 16px; height: 16px; }

  .play-body > .play-foot .play-actions {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 3px;
  }

  .play-body > .play-foot .play-btn {
    min-height: 38px;
    padding-inline: clamp(4px, 1.8vw, 7px);
    font-size: clamp(10px, 3.05vw, 11.5px);
  }

  .play-body > .play-foot .play-note { display: none; }
}

/* Every other game now uses Merge's control geometry: 11px action corners
   and 44px tool buttons on portrait phones. The compact 320–380px row keeps
   its smaller controls so all three actions still fit. */
.play-btn { border-radius: 11px; }
.play-tool { border-radius: 12px; }

@media (orientation: portrait) and (min-width: 381px) {
  .play-body > .play-foot .play-tools { gap: 8px; }
  .play-body > .play-foot .play-tool {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .play-body > .play-foot .play-tools svg { width: 21px; height: 21px; }
  .play-body > .play-foot .play-actions { gap: 8px; }
  .play-body > .play-foot .play-actions .play-btn { min-height: 44px; }
}

/* A one-off recovery notice for the Chrome Android install regression. It is
   only shown on GitHub Pages in Chrome 154–156, and gives those visitors the
   page-prompt route while they update to 157 or newer. */
.install-fix {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 10px;
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--warn, #b74a34) 24%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--warn, #b74a34) 7%, var(--panel));
}

.install-fix[hidden],
.install-fix-install[hidden] { display: none; }

.install-fix-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 9px;
  background: var(--warn, #b74a34);
  color: #fff7f3;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.install-fix-copy {
  flex: 1 1 205px;
  min-width: 0;
}

.install-fix-title {
  margin: 0;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.install-fix-note {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.install-fix-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  width: 100%;
}

.install-fix-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 12px;
  text-decoration: none;
}

@media (orientation: portrait) and (max-width: 340px) {
  .fruit-stage { width: min(100%, 390px, 52cqh); }
}

/* ==========================================================================
   v1.10 — sheets and settings panels share the footer control geometry
   The footer actions are 11px and the icon tools 12px, so the sheets and
   result dialogs use those same corners instead of a second, larger radius.
   ========================================================================== */

.sheet-card { border-radius: 12px 12px 0 0; }

@media (orientation: landscape) {
  .sheet-card { border-radius: 12px; }
}

.sheet-done { border-radius: 11px; }
.seg { border-radius: 12px; }
.seg button { border-radius: 8px; }

.sheet-card .btn,
.sheet-card .install-btn,
.sheet-card .contact-link,
.reset-confirm { border-radius: 11px; }

.overlay-card,
.fruit-over-card,
.install-fix { border-radius: 12px; }

.result-share { border-radius: 11px; }

/* The hub's quiet About link keeps the collection's footer typography and a
   full-height tap target without reading as another game control. */
.hub-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 4px;
}

.hub-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  transition: color 150ms var(--ease-out);
}

.hub-link:hover { color: var(--ink); }
.hub-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.hub-meta .hub-version { margin: 0; }

/* The install notice can be dismissed for good, so it never becomes a
   permanent badge on a phone that has already been updated or installed. */
.install-fix {
  position: relative;
  padding-right: 42px;
}

.install-fix-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.install-fix-close::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 12px;
}

.install-fix-close:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.install-fix-close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ==========================================================================
   v1.0.4 — a clearer About door. The About row is a real control now,
   not quiet footer text.
   ========================================================================== */

.hub-meta {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.hub-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-transform: none;
  transition: transform 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

.hub-link:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--ink) 18%, var(--line));
  background: var(--card);
  color: var(--ink);
}

.hub-link:active { transform: translateY(0) scale(0.985); }
.hub-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 11px; }
.hub-link-icon { width: 16px; height: 16px; display: block; flex: none; color: var(--muted); }
.hub-link-chevron {
  margin-left: 2px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
  transition: transform 150ms var(--ease-out);
}
.hub-link:hover .hub-link-chevron { transform: translateX(2px); }
.hub-meta .hub-version { margin: 0; }

/* The chapter label is also the door to the shape map. */
.play-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  margin: 0 0 3px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ghost-bg);
  color: var(--muted);
  font-family: inherit;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  transition: color 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

.play-chip:hover { color: var(--ink); background: var(--card); }
.play-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.play-chip-chevron {
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
}

@media (max-width: 380px) {
  .result-share--labeled {
    width: 28px;
    min-width: 28px;
    height: 28px;
    padding: 0;
    gap: 0;
    border-radius: 11px;
  }
  .result-share--labeled .result-share-label { display: none; }
}

/* ==========================================================================
   Home — the pocket puzzle annual
   A flat, printed-shelf cover for the six games. The page itself stays one
   colour, so the browser and phone chrome always match --page exactly.
   ========================================================================== */

.hub h1 {
  max-width: none;
  font-size: clamp(42px, 10.2vw, 76px);
  line-height: 0.9;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

.hub-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: clamp(30px, 5vh, 48px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hub-foot span { white-space: nowrap; }
.hub-foot span:nth-child(2) { text-align: center; }
.hub-foot span:last-child { text-align: right; }

@media (min-width: 760px) {
  .hub h1 { font-size: clamp(52px, 7.6vw, 76px); }
}

@media (max-width: 360px) {
  .hub h1 { font-size: 41px; }
  .mini-merge { width: 92px; gap: 6px; }
  .mini-water { transform: scale(0.82); transform-origin: bottom; }
  .mini-cluster { transform: scale(0.78); }
  .mini-ttt { width: 92px; height: 92px; gap: 4px; }
  .mini-mines { width: 94px; height: 94px; gap: 4px; }
  .hub-foot { font-size: 7.5px; letter-spacing: 0.04em; }
}

/* ---------- what's new ---------- */

.whats-new {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 18px;
  padding: 10px 8px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.whats-new[hidden] { display: none; }

[dir="rtl"] .whats-new { padding-right: 0; padding-left: 8px; }

.whats-new-details { flex: 1; min-width: 0; }

.whats-new-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.25;
  list-style: none;
  text-transform: uppercase;
  cursor: pointer;
}

.whats-new-label::-webkit-details-marker { display: none; }

.whats-new-label::after {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  margin-top: -2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  /* Only transform animates: easing margin-top moved the caret by layout and
     let it drift out of step with the rotation. */
  transition: transform 150ms var(--ease-out);
}

.whats-new-details[open] .whats-new-label::after {
  transform: translateY(4px) rotate(-135deg);
}

html[data-motion="reduced"] .whats-new-label::after { transition: none; }

.whats-new-label:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.whats-new-list {
  display: grid;
  gap: 3px;
  margin: 5px 0 0;
  padding: 0;
  list-style: none;
  color: color-mix(in srgb, var(--ink) 70%, var(--muted));
  font-size: 11px;
  line-height: 1.4;
}

.whats-new-list li {
  position: relative;
  padding-left: 9px;
}

.whats-new-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
}

.whats-new-close {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.whats-new-close:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 24%, var(--line));
}

.whats-new-close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* The ring stays 28px; the touch target around it is a full 44px. */
.whats-new-close::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
}

@media (max-width: 420px) {
  .whats-new { gap: 8px; }
  .whats-new-mark { display: none; }
}

html[data-motion="reduced"] .whats-new-label::after { transition: none; }

/* Keep the install notice in the same printed language as the shelf. */
.install-fix {
  margin-top: 24px;
  padding: 13px 8px 0 0;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--warn, #b74a34) 42%, var(--line));
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.install-fix-mark {
  width: 22px;
  height: 22px;
  margin-top: 0;
}


/* ---------- cartridge identity inside every game ---------- */

.app { --cart: var(--six-1); --cart-ink: var(--home-accent-ink, #211d18); }
#sudoku { --cart: var(--six-2); --cart-ink: var(--home-accent-ink, #211d18); }
#ttt { --cart: var(--six-3); --cart-ink: var(--home-accent-ink, #211d18); }
#mines { --cart: var(--six-4); --cart-ink: var(--home-accent-ink, #211d18); }
#water { --cart: var(--six-5); --cart-ink: var(--home-accent-ink, #211d18); }
#fruit { --cart: var(--six-6); --cart-ink: var(--home-accent-ink, #211d18); }
html[data-theme="dark"] #mines { --cart-ink: #1b1815; }

.play-cart-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.play-cart-row .games-home { flex: none; }

.title-block .play-cart-row { margin-bottom: 5px; }

.play-cart {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--cart-ink) 14%, transparent);
  border-radius: 7px;
  background: var(--cart);
  box-shadow: inset 0 -2px 0 rgba(33, 29, 24, 0.16);
  color: var(--cart-ink);
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.play-cart-num {
  opacity: 1;
  font-variant-numeric: tabular-nums;
}

/* A strip of the same colour runs through each score card. */
.app .score,
.play-screen .play-stat {
  box-shadow: var(--card-shadow), inset 0 3px 0 var(--cart);
}

/* Primary actions become the game's cartridge colour. */
.app #new-game,
.play-screen .play-btn--solid {
  background: var(--cart);
  color: var(--cart-ink);
  box-shadow: 0 8px 18px -10px rgba(33, 29, 24, 0.6), inset 0 -2px 0 rgba(33, 29, 24, 0.16);
}

.app #new-game:hover,
.play-screen .play-btn--solid:hover {
  background: color-mix(in srgb, var(--cart) 90%, #211d18);
  /* Darkening the cartridge also darkens the ink, keeping the hover state at
     the same contrast as the resting button on every palette. */
  color: #15120f;
}

@media (orientation: landscape) and (max-height: 520px) {
  .play-cart-row { gap: 6px; }
  .play-cart {
    min-height: 22px;
    padding-inline: 7px;
    gap: 5px;
    font-size: 7px;
  }
}

/* ==========================================================================
   2.0 polish
   Share cards wear the same paper, ink edge and six-colour accent as the
   hub; the fruit thumbnail gets real silhouettes; victories get one small
   burst. All motion is optional under prefers-reduced-motion.
   ========================================================================== */

/* Result / share cards across all six games. */
.play-win {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--ink) 13%, transparent);
  border-radius: 15px;
  background: var(--sheet-bg, var(--card));
  box-shadow: 0 2px 0 color-mix(in srgb, var(--ink) 8%, transparent);
  overflow: hidden;
}

.play-win::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--cart, var(--game-accent, var(--t64)));
}

.play-win p { padding-left: 2px; }

.play-win strong {
  font-family: var(--font-ui);
  font-weight: 800;
  letter-spacing: -0.015em;
}

.play-win .play-btn {
  border-radius: 10px;
  box-shadow: none;
}

.play-win .result-share {
  border-color: color-mix(in srgb, var(--ink) 15%, transparent);
  border-radius: 10px;
  background: transparent;
}

.fruit-over-card {
  border: 1px solid color-mix(in srgb, var(--ink) 13%, transparent);
  border-radius: 20px;
  background: var(--sheet-bg, var(--card));
  box-shadow: 0 4px 0 color-mix(in srgb, var(--ink) 9%, transparent), 0 26px 44px -30px rgba(0, 0, 0, 0.45);
}

/* The home thumbnail follows the refined fruit set: cherry, orange, grapes,
   pear and strawberry, each with its own silhouette and stem. */
.mini-fruit {
  border-radius: 50%;
  box-shadow: inset -4px -5px 0 rgba(0, 0, 0, 0.14), inset 3px 4px 0 rgba(255, 255, 255, 0.2);
}

.mini-fruit::after {
  content: "";
  position: absolute;
  width: 19%;
  height: 9%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
  left: 23%;
  top: 19%;
  transform: rotate(-35deg);
}

.f1 {
  width: 30px;
  height: 30px;
  left: 60px;
  top: 86px;
  background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--g7) 64%, #fff), var(--g1) 60%, color-mix(in srgb, var(--g1) 68%, #000));
  box-shadow: 13px 5px 0 -3px var(--g2), inset -4px -5px 0 rgba(0, 0, 0, 0.16);
}

.f1::before {
  content: "";
  position: absolute;
  left: 13px;
  top: -13px;
  width: 17px;
  height: 14px;
  border-top: 2px solid var(--ink-tile-low);
  border-right: 2px solid var(--ink-tile-low);
  border-radius: 0 12px 0 0;
  transform: rotate(-8deg);
}

.f2 {
  width: 38px;
  height: 38px;
  left: 92px;
  top: 56px;
  background: radial-gradient(circle at 33% 28%, color-mix(in srgb, var(--g7) 60%, #fff), var(--g2) 58%, color-mix(in srgb, var(--g2) 64%, #000));
}

.f2::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 9px;
  left: 21px;
  top: -5px;
  border-radius: 70% 10% 70% 10%;
  background: var(--ink-tile-low);
  transform: rotate(-24deg);
}

.f3 {
  width: 48px;
  height: 48px;
  left: 36px;
  top: 32px;
  border-radius: 46% 54% 48% 52%;
  background-color: var(--g4);
  background-image:
    radial-gradient(circle at 29% 22%, var(--g7) 0 19%, transparent 20%),
    radial-gradient(circle at 56% 18%, var(--g5) 0 19%, transparent 20%),
    radial-gradient(circle at 22% 46%, var(--g5) 0 19%, transparent 20%),
    radial-gradient(circle at 48% 44%, var(--g7) 0 20%, transparent 21%),
    radial-gradient(circle at 72% 43%, var(--g2) 0 18%, transparent 19%),
    radial-gradient(circle at 37% 68%, var(--g5) 0 19%, transparent 20%),
    radial-gradient(circle at 63% 69%, var(--g7) 0 18%, transparent 19%);
  box-shadow: inset -5px -6px 0 rgba(0, 0, 0, 0.18);
}

.f3::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 11px;
  left: 24px;
  top: -6px;
  border-radius: 70% 10% 70% 10%;
  background: var(--ink-tile-low);
  transform: rotate(-30deg);
}

.f4 {
  width: 40px;
  height: 46px;
  left: 6px;
  top: 68px;
  border-radius: 48% 48% 46% 46% / 42% 42% 58% 58%;
  background: radial-gradient(circle at 38% 30%, color-mix(in srgb, var(--g7) 68%, #fff), var(--g3) 55%, color-mix(in srgb, var(--g3) 64%, #000));
}

.f4::before {
  content: "";
  position: absolute;
  width: 3px;
  height: 9px;
  left: 20px;
  top: -7px;
  border-radius: 3px;
  background: var(--ink-tile-low);
  transform: rotate(7deg);
}

.f5 {
  width: 30px;
  height: 32px;
  left: 114px;
  top: 24px;
  border-radius: 50% 50% 46% 46% / 44% 44% 58% 58%;
  background-color: var(--g6);
  background-image: radial-gradient(var(--g7) 0 1px, transparent 1.4px);
  background-size: 7px 8px;
}

.f5::before {
  content: "";
  position: absolute;
  width: 17px;
  height: 9px;
  left: 7px;
  top: -4px;
  background: var(--ink-tile-low);
  clip-path: polygon(50% 0, 62% 55%, 100% 35%, 74% 78%, 50% 60%, 26% 78%, 0 35%, 38% 55%);
}

/* A screen settles in rather than snapping. */
@keyframes sixfoldShellIn {
  from { opacity: 0; }
  to { opacity: 1; transform: none; }
}

.play-screen:not([hidden]):not(.shell-settled) .play-shell {
  animation: sixfoldShellIn 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sixfoldCardIn {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.play-win:not([hidden]),
.fruit-over-card:not([hidden]) {
  animation: sixfoldCardIn 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Victory: a small lift of paper chips from the result card, plus one soft
   card pop. No overlay, no sound, no long takeover. */
.victory-layer {
  position: fixed;
  inset: 0;
  z-index: 260;
  overflow: hidden;
  pointer-events: none;
}

.victory-bit {
  position: absolute;
  display: block;
  border-radius: 2px;
  transform: translate(-50%, -50%);
  animation: victoryBit 780ms cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes victoryBit {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.35) rotate(0); }
  14% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.9) rotate(var(--rot));
  }
}

.play-win.is-victory,
.fruit-over-card.is-victory,
.overlay-card.is-victory {
  animation: victoryCard 360ms var(--ease-out);
}

@keyframes victoryCard {
  0% { transform: scale(0.985); }
  42% { transform: scale(1.014); }
  100% { transform: scale(1); }
}

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"] .play-win.is-victory,
html[data-motion="reduced"] .fruit-over-card.is-victory,
html[data-motion="reduced"] .overlay-card.is-victory {
    animation: none;
  }


html[data-motion="reduced"] .victory-layer { display: none; }

/* On phones the three difficulty choices and the flag toggle each need a
   readable row. German and French labels are wider than English, so wrap the
   controls instead of letting the last word run past the screen. */
@media (max-width: 520px) {
  .mines-toolbar { flex-wrap: wrap; }
  .mines-difficulty { flex: 1 0 100%; justify-content: space-between; }
  .mines-flag-toggle { width: 100%; justify-content: center; }
}

/* Keep the game title and its two compact stats on one line on phone widths
   where they fit. The older stacked header left too little height for the
   board and footer on short screens. */
@media (orientation: portrait) and (min-width: 381px) and (max-width: 520px) {
  .play-title-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
  }

  .play-stats {
    display: flex;
    width: auto;
    min-width: 0;
    margin-top: 0;
  }
}


/* ---------- short portrait phones ----------
   A 320x568 screen with a 44/34 inset leaves the game column 78px less wall
   than a bare phone of the same size. Rather than let the footer slide under
   the bottom band, the two boards that can shrink without losing tap accuracy
   give up height, and the water glasses drop their decorative padding. The
   caps are measured from the usable height (viewport minus both insets), not
   from a fixed pixel offset, so a phone with smaller insets simply gets a
   bigger board. The constants are the rest of the column: the head, the
   feedback line, the footer and the four gaps (314px). The fruit field is a
   360 × 450 canvas, so its width is 0.8 of the height it can afford, plus the
   296px the rest of its column needs. */
@media (orientation: portrait) and (max-width: 720px) and (max-height: 700px) {
  #ttt-board {
    width: min(100%, 360px, calc(100dvh - var(--sa-top) - var(--sa-bottom) - 314px));
  }
  /* Fruit Merge sits 9px past a 320 × 568 screen and 28px past a 360 × 640 one
     with the old flat cap. Its canvas is 4:5, so the width has to come from the
     height the column can spare, not from the viewport width. */
  .fruit-stage {
    width: min(100%, 390px, max(140px, calc((100dvh - var(--sa-top) - var(--sa-bottom) - 296px) * 0.8)));
  }
  .play-screen .water-glass { height: clamp(92px, 24vw, 148px); }
  .play-screen .water-board { padding: 10px 10px 8px; }
}

/* ---------- what's new, refreshed ---------- */

/* One considered card instead of a bare line: a soft surface, a release dot,
   check-marked items and a close target that reads as a control. The collapsed
   state stays a single row, so the collection is never pushed down. */
.whats-new {
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 58%, transparent);
  box-shadow: 0 14px 30px -28px rgba(18, 16, 13, 0.75);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}

.whats-new.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  /* Scoped to the exit: the card stays in the flow so the hub does not jump
     out from underneath a detached copy of it. */
  transition: opacity 160ms cubic-bezier(0.4, 0, 1, 1), transform 180ms cubic-bezier(0.4, 0, 1, 1);
  will-change: opacity, transform;
}

html[data-motion="reduced"] .whats-new { transition: none; }

.whats-new-label {
  gap: 8px;
  font-size: 9.5px;
  letter-spacing: 0.09em;
}

.whats-new-label::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--t8);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--t8) 18%, transparent);
}

.whats-new-list {
  gap: 7px;
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.45;
}

.whats-new-list li { padding-inline-start: 19px; }

.whats-new-list li::before {
  content: "";
  inset-inline-start: 0;
  top: 0.22em;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--t8) 15%, transparent);
}

.whats-new-list li::after {
  content: "";
  position: absolute;
  inset-inline-start: 4px;
  top: 0.42em;
  width: 3px;
  height: 5.5px;
  border-right: 1.4px solid var(--t8);
  border-bottom: 1.4px solid var(--t8);
  transform: rotate(42deg);
}

html[data-motion="full"] .whats-new-details.is-opening .whats-new-list li {
  animation: whats-new-item 240ms var(--ease-out) both;
}

html[data-motion="full"] .whats-new-details.is-opening .whats-new-list li:nth-child(2) { animation-delay: 35ms; }
html[data-motion="full"] .whats-new-details.is-opening .whats-new-list li:nth-child(3) { animation-delay: 70ms; }
html[data-motion="full"] .whats-new-details.is-opening .whats-new-list li:nth-child(4) { animation-delay: 105ms; }
html[data-motion="full"] .whats-new-details.is-opening .whats-new-list li:nth-child(5) { animation-delay: 140ms; }

@keyframes whats-new-item {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: none; }
}

.whats-new-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--seg-bg) 80%, transparent);
  color: var(--muted-strong);
  font-size: 15px;
  line-height: 1;
}

.whats-new-close:hover { color: var(--ink); }
