@font-face {
  font-family: "Poppins";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/poppins-400.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/poppins-600.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/poppins-700.woff2") format("woff2");
}

:root {
  --night: #1E1A2B;
  --surface: #27223A;
  --border: #3A3350;
  --cream: #F7E9D7;
  --muted: #B9ADBF;
  --red: #C8372D;
  --red-dark: #8E2420;
  --gold: #F2A541;
  --shade: #4B3F72;
  --shade-dark: #2E2647;
  --fx-pad: 48px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  background: var(--night);
  color: var(--cream);
  font: 16px/1.5 "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.app {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Header */
.top { display: flex; align-items: center; gap: 10px; }
.home img { display: block; border-radius: 7px; }
.titles h1 { margin: 0; font-size: 1.5rem; line-height: 1.1; letter-spacing: -0.01em; }
.sub { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* HUD */
.hud { display: flex; justify-content: space-between; gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-right { align-items: flex-end; }
.label { color: var(--muted); font-size: 0.85rem; }
.label strong { color: var(--cream); font-weight: 700; }

.pips { display: flex; gap: 3px; }
.pip {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--border);
  transition: background 0.2s;
}
.pip.used { background: var(--muted); }
.pip.saved { background: var(--gold); }
.pip.retry-used { background: var(--red); }

/* Board */
.board-wrap {
  position: relative;
  width: min(100%, calc(100dvh - 300px));
  min-width: min(100%, 280px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.board, .slots { position: absolute; inset: 0; }

/* Empty cells show as faint sockets so gaps read as part of the board. */
.slot {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(100% / var(--n, 8));
  height: calc(100% / var(--n, 8));
  padding: 2.5px;
  transform: translate(calc(var(--x) * 100%), calc(var(--y) * 100%));
}
.slot::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 18%;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Looper edges: a shimmery gold rail (art/looper-rail*.png) with chevrons
   pointing off the board, and a light sweeping along it. */
.loop {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  border-radius: 4px;
  background: url("art/looper-rail.png") center top / 100% auto repeat-y;
  filter: drop-shadow(0 0 4px rgba(242, 165, 65, 0.55));
}
.loop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--sweep-dir, 180deg), transparent 0 35%, rgba(255, 246, 214, 0.95) 50%, transparent 65% 100%) 0 0 / 100% 300% no-repeat;
  mix-blend-mode: screen;
  animation: rail-shimmer 3.2s ease-in-out infinite;
}
@keyframes rail-shimmer {
  from { background-position: 0 100%; }
  to { background-position: 0 0%; }
}
.loop-left, .loop-right { top: 2%; bottom: 2%; width: 9px; }
.loop-left { left: -11px; }
.loop-right { right: -11px; transform: scaleX(-1); }
.loop-up, .loop-down {
  left: 2%;
  right: 2%;
  height: 9px;
  background-image: url("art/looper-rail-h.png");
  background-size: auto 100%;
  background-repeat: repeat-x;
  --sweep-dir: 90deg;
}
.loop-up, .loop-down { }
.loop-up::after, .loop-down::after { background-size: 300% 100%; animation-name: rail-shimmer-h; }
@keyframes rail-shimmer-h {
  from { background-position: 100% 0; }
  to { background-position: 0% 0; }
}
.loop-up { top: -11px; }
.loop-down { bottom: -11px; transform: scaleY(-1); }

/* Arrival edge of a one-way looper: a faint gold tint where things come back in. */
.arrive {
  position: absolute;
  pointer-events: none;
  border-radius: 4px;
  background: rgba(242, 165, 65, 0.16);
  box-shadow: 0 0 8px rgba(242, 165, 65, 0.18);
}
.arrive-left, .arrive-right { top: 2%; bottom: 2%; width: 4px; }
.arrive-left { left: -8px; }
.arrive-right { right: -8px; }
.arrive-up, .arrive-down { left: 2%; right: 2%; height: 4px; }
.arrive-up { top: -8px; }
.arrive-down { bottom: -8px; }

.fx {
  position: absolute;
  inset: calc(-1 * var(--fx-pad));
  width: calc(100% + 2 * var(--fx-pad));
  height: calc(100% + 2 * var(--fx-pad));
  pointer-events: none;
  z-index: 2;
}

.tile {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(100% / var(--n, 8));
  height: calc(100% / var(--n, 8));
  padding: 2.5px;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  perspective: 320px;
  transform: translate(calc(var(--x) * 100%), calc(var(--y) * 100%));
  /* Moves (rotate, shift) slide with a slight overshoot; shifts stagger via --move-delay. */
  transition: transform 0.3s cubic-bezier(0.3, 1.3, 0.55, 1) var(--move-delay, 0ms);
}
.tile:disabled { cursor: default; }
.tile:focus { outline: none; }
.tile:focus-visible .face { outline: 2px solid var(--gold); outline-offset: 1px; }

.card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  /* Resting side; flips are animated in main.js (flipCard), away from their source. */
  transform: rotateY(var(--base, 0deg));
}

/* Loop wrap-around: jump instead of sliding across the board. */
/* Scale the card, not the tile: the tile's own transform holds its board
   position, and scaling the tile would pull it toward the top-left corner. */
.tile.warp { transition: none; }
.tile.warp .card { animation: warp-in 0.3s ease-out; }
@keyframes warp-in { from { opacity: 0; scale: 0.6; } }

/* Removed by a bomb. */
.tile.gone { pointer-events: none; }
.tile.gone .card { animation: gone 1ms linear var(--gone-delay, 0ms) forwards; }
@keyframes gone { to { opacity: 0; } }

/* Blocked tap (e.g. shift with no gap): small wiggle, no move used. */
.tile.nope .card { animation: nope 0.3s; }
@keyframes nope {
  25% { translate: -3px 0; }
  75% { translate: 3px 0; }
}

.face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 18%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Faces are rendered art (tools/parflip-art/render.py): bevel lit from the
   top right, sunken gold dots on the sun side, engraved rings on the shade
   side. Special tiles use the plain base art with an icon on top. */
.face.front,
.face.back {
  background: center / 100% 100% no-repeat;
}
.face.front { background-color: var(--red); background-image: url("art/base-sun.png"); }
.face.back { background-color: var(--shade); background-image: url("art/base-shade.png"); transform: rotateY(180deg); }
.tile[data-kind="normal"] .face.front { background-image: url("art/normal-sun.png"); }
.tile[data-kind="normal"] .face.back { background-image: url("art/normal-shade.png"); }
.tile[data-kind="double"] .face.front { background-image: url("art/double-sun.png"); }
.tile[data-kind="double"] .face.back { background-image: url("art/double-shade.png"); }
/* The art's rounded corners carry the color; keep CSS color only as a load fallback. */
.face.front, .face.back { background-clip: padding-box; }

/* 2-flip fill: a semi-opaque fill with a bright line on its top edge.
   .half      rises from the bottom to the middle (the tile is halfway).
   .complete  second flip: rises to the top, then fades out quickly (main.js
              holds the card flip back until the fill reaches the top).
   .drain     undo from halfway: sinks back down. */
.tile[data-kind="double"] .face { overflow: hidden; }
.tile[data-kind="double"] .face::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: rgba(14, 10, 22, 0.58);
  box-shadow: 0 -2px 0 rgba(255, 236, 200, 0.8), 0 -5px 9px rgba(255, 236, 200, 0.22);
}
.tile.half[data-kind="double"] .face::before { animation: fill-half 0.4s ease-out var(--delay, 0ms) both; }
.tile.complete[data-kind="double"] .face::before { animation: fill-complete 0.62s ease-in-out var(--delay, 0ms) both; }
.tile.drain[data-kind="double"] .face::before { animation: fill-drain 0.3s ease-in both; }
.board.instant .face::before { animation-duration: 1ms !important; animation-delay: 0ms !important; }

@keyframes fill-half {
  from { height: 0; opacity: 1; }
  to { height: 50%; opacity: 1; }
}
@keyframes fill-complete {
  0% { height: 50%; opacity: 1; }
  30% { height: 100%; opacity: 1; }
  70% { height: 100%; opacity: 1; }
  100% { height: 100%; opacity: 0; }
}
@keyframes fill-drain {
  from { height: 50%; opacity: 1; }
  to { height: 0; opacity: 1; }
}

/* Special tile markings: icons replace the dot/ring. */
.face .icon {
  width: 62%;
  height: 62%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.face .icon .fill { fill: currentColor; stroke: none; }
.face.front { color: var(--gold); }
.face.back { color: rgba(247, 233, 215, 0.7); }
/* Linked: an animated sunburst around the dot/ring, in yellow, red or blue.
   Three rendered layers: a glowing halo that pulses, short spikes that spin
   one way and flicker, long spikes that spin the other way and flare. */
.burst {
  position: absolute;
  inset: -25%; /* sprites are 150% of the tile, centered on the mark */
  z-index: 2;
  pointer-events: none;
}
.burst i {
  position: absolute;
  inset: 0;
  background: center / 100% 100% no-repeat;
  mix-blend-mode: screen;
}
.link-yellow .halo { background-image: url("art/link-yellow-halo.png"); }
.link-yellow .rays-a { background-image: url("art/link-yellow-rays-a.png"); }
.link-yellow .rays-b { background-image: url("art/link-yellow-rays-b.png"); }
.link-red .halo { background-image: url("art/link-red-halo.png"); }
.link-red .rays-a { background-image: url("art/link-red-rays-a.png"); }
.link-red .rays-b { background-image: url("art/link-red-rays-b.png"); }
.link-blue .halo { background-image: url("art/link-blue-halo.png"); }
.link-blue .rays-a { background-image: url("art/link-blue-rays-a.png"); }
.link-blue .rays-b { background-image: url("art/link-blue-rays-b.png"); }

.burst .halo { animation: halo-pulse 2.4s ease-in-out infinite; }
.burst .rays-a { animation: spin-cw 14s linear infinite, flare-a 3.1s ease-in-out infinite; }
.burst .rays-b { animation: spin-ccw 9s linear infinite, flare-b 2.3s ease-in-out infinite; }
/* Offset each color so linked pairs on one board don't pulse in lockstep. */
.link-red i { animation-delay: -0.8s, -1.1s; }
.link-blue i { animation-delay: -1.6s, -2s; }

@keyframes spin-cw { to { rotate: 360deg; } }
@keyframes spin-ccw { to { rotate: -360deg; } }
@keyframes halo-pulse {
  0%, 100% { opacity: 0.75; scale: 0.96; }
  50% { opacity: 1; scale: 1.04; }
}
@keyframes flare-a {
  0%, 100% { opacity: 0.15; scale: 0.8; }
  30% { opacity: 1; scale: 1.05; }
  55% { opacity: 0.55; scale: 0.95; }
}
@keyframes flare-b {
  0%, 100% { opacity: 0.9; }
  20% { opacity: 0.2; }
  45% { opacity: 1; }
  70% { opacity: 0.35; }
}

/* Bomb and stone: no flipping card. */
.face.solid { backface-visibility: visible; }
/* Rotate tiles travel on a curve (Web Animations in main.js). */
.tile.arcing { transition: none; }

/* ---- Row / Column / Both flipper: pink art with grooves ---- */
.tile[data-kind="line"][data-axis="row"] .face.front { background-image: url("art/line-row-sun.png"); }
.tile[data-kind="line"][data-axis="row"] .face.back { background-image: url("art/line-row-shade.png"); }
.tile[data-kind="line"][data-axis="col"] .face.front { background-image: url("art/line-col-sun.png"); }
.tile[data-kind="line"][data-axis="col"] .face.back { background-image: url("art/line-col-shade.png"); }
.tile[data-kind="line"][data-axis="both"] .face.front { background-image: url("art/line-both-sun.png"); }
.tile[data-kind="line"][data-axis="both"] .face.back { background-image: url("art/line-both-shade.png"); }
.tile[data-kind="line"] .face.front { background-color: #EE8DB3; }
.tile[data-kind="line"] .face.back { background-color: #9B2B5C; }

/* Hint / tap: the flipper lights up while its pulse runs behind the tiles. */
.tile.lit .face { animation: lit 0.75s ease-out; }
@keyframes lit {
  0% { filter: none; box-shadow: 0 0 0 0 rgba(255, 190, 220, 0); }
  25% { filter: brightness(1.3) saturate(1.15); box-shadow: 0 0 14px 4px rgba(255, 170, 210, 0.75); }
  100% { filter: none; box-shadow: 0 0 0 0 rgba(255, 190, 220, 0); }
}

/* ---- Rotate: green dial (never flips) ---- */
.tile[data-kind="rotate"] .face.solid { background: url("art/rotate-base.png") center / 100% 100% no-repeat #3E9A5B; }
.dial-drift, .dial, .dial i { position: absolute; inset: 0; }
.dial i { background: center / 100% 100% no-repeat; }
.dial-body { background-image: url("art/rotate-dial.png"); }
.tile[data-dir="cw"] .dial-mark { background-image: url("art/rotate-mark-cw.png"); }
.tile[data-dir="ccw"] .dial-mark { background-image: url("art/rotate-mark-ccw.png"); }
.dial-drift { animation: dial-drift 5.5s ease-in-out infinite alternate; }
.dial { rotate: var(--dial, 0deg); transition: rotate 0.5s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes dial-drift {
  from { rotate: -4deg; }
  to { rotate: 4deg; }
}

/* ---- Shift: blue conveyor (never flips) ---- */
.tile[data-kind="shift"][data-dir="left"] .face.solid,
.tile[data-kind="shift"][data-dir="right"] .face.solid { background: url("art/shift-h.png") center / 100% 100% no-repeat #2F6FCF; }
.tile[data-kind="shift"][data-dir="up"] .face.solid,
.tile[data-kind="shift"][data-dir="down"] .face.solid { background: url("art/shift-v.png") center / 100% 100% no-repeat #2F6FCF; }
/* The channel is 2 chevrons long and 1 tall; the strip art is 4 chevrons long,
   so the strip is 200% wide and one full scroll is half its width. */
.conveyor {
  position: absolute;
  left: 17%;
  top: 17%;
  width: 66%;
  height: 66%;
  overflow: hidden;
  border-radius: 8%;
  clip-path: inset(25% 0 25% 0);
}
.surge, .chevrons { position: absolute; top: 25%; height: 50%; }
.surge { left: 0; width: 100%; top: 0; height: 100%; }
.chevrons {
  left: -100%;
  width: 200%;
  background: url("art/shift-chevrons.png") left center / 100% 100% repeat-x;
  animation: conveyor 3.2s linear infinite;
}
@keyframes conveyor { to { translate: 50% 0; } }
/* Tap: the chevrons rush forward. */
.tile.surging .surge { animation: surge 0.4s cubic-bezier(0.2, 0.7, 0.3, 1); }
@keyframes surge { from { translate: -100% 0; } }
/* Blocked: the chevrons judder against the wall. */
.tile.nope .surge { animation: judder 0.3s; }
@keyframes judder {
  20% { translate: 6% 0; }
  45% { translate: -3% 0; }
  70% { translate: 4% 0; }
}

/* ---- Bomb: charcoal tile, iron sphere, brass fuse (never flips) ---- */
.tile[data-kind="bomb"] .face.solid { background: url("art/bomb.png") center / 100% 100% no-repeat #2A2530; }
/* Fuse burning down just before the blast. */
.tile.fusing .face.solid { animation: fusing 0.2s ease-in forwards; }
@keyframes fusing {
  0% { filter: brightness(1); scale: 1; }
  60% { filter: brightness(1.6) saturate(1.4); scale: 1.08; }
  100% { filter: brightness(2.2); scale: 1.15; }
}

/* ---- Stone: a raised granite boulder, four variants (never flips) ---- */
.tile[data-kind="stone"] .face.solid { background: center / 100% 100% no-repeat; border-radius: 0; }
.tile[data-kind="stone"][data-variant="0"] .face.solid { background-image: url("art/stone-0.png"); }
.tile[data-kind="stone"][data-variant="1"] .face.solid { background-image: url("art/stone-1.png"); }
.tile[data-kind="stone"][data-variant="2"] .face.solid { background-image: url("art/stone-2.png"); }
.tile[data-kind="stone"][data-variant="3"] .face.solid { background-image: url("art/stone-3.png"); }
/* Hit by an effect it stops: a dull thud. */
.tile.thud .card { animation: thud 0.28s ease-out; }
@keyframes thud {
  0% { translate: 0 0; }
  30% { translate: 0 2px; scale: 0.97; }
  60% { translate: 0 -1px; }
  100% { translate: 0 0; scale: 1; }
}

/* Bomb blast jolts the board. */
.board-wrap.quake { animation: quake 0.35s ease-out; }
@keyframes quake {
  15% { translate: -4px 2px; }
  35% { translate: 3px -2px; }
  55% { translate: -2px 1px; }
  75% { translate: 1px 0; }
}

.tile[data-kind="stone"] { cursor: default; }

/* Legend */
.legend { display: grid; gap: 8px; margin: 0; padding: 0 14px 14px; list-style: none; }
.legend li { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; color: var(--muted); font-size: 0.88rem; }
.legend-sample { position: relative; width: 40px; height: 40px; }
.legend-tile { width: 100%; height: 100%; --x: 0; --y: 0; }
.loop-sample {
  position: absolute;
  left: 15px;
  top: 2px;
  bottom: 2px;
  width: 9px;
  border-radius: 4px;
  background: url("art/looper-rail.png") center top / 100% auto repeat-y;
  filter: drop-shadow(0 0 4px rgba(242, 165, 65, 0.55));
}

@media (hover: hover) {
  .tile:not(:disabled):hover .face { filter: brightness(1.12); }
}
.tile:not(:disabled):active .face { filter: brightness(1.25); }

.board.shake { animation: shake 0.42s; }
.board.dimmed .tile { animation: dim-pulse 0.9s ease-out; }
@keyframes dim-pulse { 30% { filter: brightness(0.55) saturate(0.6); } }
@keyframes shake {
  20% { translate: -6px 0; }
  40% { translate: 5px 0; }
  60% { translate: -4px 0; }
  80% { translate: 2px 0; }
}

/* Win: a gold wave spreads from the winning tap (delay set per tile by
   distance), brightening each tile; they stay a little brighter after. */
.tile.wave .face { animation: gold-wave 0.75s ease-out var(--wave-delay, 0ms) both; }
@keyframes gold-wave {
  0% { filter: none; box-shadow: 0 0 0 0 rgba(242, 165, 65, 0); }
  35% { filter: brightness(1.6) saturate(1.25) sepia(0.25); box-shadow: 0 0 14px 4px rgba(242, 165, 65, 0.8); }
  100% { filter: brightness(1.12) saturate(1.08); box-shadow: 0 0 0 0 rgba(242, 165, 65, 0); }
}

/* Status and actions */
.status { min-height: 5.5rem; text-align: center; }
.status-text { margin: 0 0 10px; color: var(--muted); }
.status-text strong { color: var(--cream); }

.share-preview {
  display: inline-block;
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font: 0.95rem/1.35 ui-monospace, "SF Mono", Menlo, monospace;
  text-align: left;
  white-space: pre;
}

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.button {
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: var(--cream);
  font: 600 0.95rem "Poppins", system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s, filter 0.15s, scale 0.1s;
}
.button:hover { filter: brightness(1.08); }
.button:active { scale: 0.97; }
/* The recommended next action. */
.button.primary { background: var(--gold); color: var(--night); }
/* Unavailable. */
.button:disabled { background: #57505E; color: rgba(247, 233, 215, 0.55); cursor: default; filter: none; scale: 1; }
/* After a failed attempt, Retry pulses to draw the eye. */
.button.pulse { animation: button-pulse 1.1s ease-in-out 3; }
@keyframes button-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 165, 65, 0.7); }
  50% { box-shadow: 0 0 0 8px rgba(242, 165, 65, 0); scale: 1.05; }
}
.button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Freeplay */
.freeplay {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.freeplay summary { padding: 10px 14px; font-weight: 600; cursor: pointer; }
.freeplay-form {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}
.freeplay-form label { display: grid; gap: 4px; color: var(--muted); font-size: 0.85rem; }
.freeplay-form select,
.freeplay-form input {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--night);
  color: var(--cream);
  font: 1rem "Poppins", system-ui, sans-serif;
}
.daily-link { color: var(--gold); font-size: 0.9rem; text-align: center; }

.fx-under { z-index: auto; } /* behind the board: slots, underlay, then tiles */

@media (prefers-reduced-motion: reduce) {
  .card, .tile { transition-duration: 1ms; }
  .burst i, .dial-drift, .chevrons, .tile.lit .face, .tile.wave .face, .loop::after, .board-wrap.quake, .tile.thud .card { animation: none !important; }
  .board.shake { animation: none; }
}

/* ---- Tutorial: a pulsing gold ring around the tile to tap ---- */
.tile.hint::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 3px solid var(--gold);
  border-radius: 24%;
  pointer-events: none;
  animation: hint-ring 1.2s ease-in-out infinite;
}
@keyframes hint-ring {
  0%, 100% { opacity: 1; scale: 1; }
  50% { opacity: 0.4; scale: 1.12; }
}

/* ---- First-time tips for special tiles ---- */
.tip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  background: var(--surface);
  color: var(--cream);
  font-size: 0.88rem;
  cursor: pointer;
  animation: tip-in 0.25s ease-out;
}
.tip strong { color: var(--gold); }
.tip .tip-close { margin-left: auto; color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
@keyframes tip-in { from { opacity: 0; translate: 0 -6px; } }
.tile.spotlight .face { box-shadow: 0 0 0 3px var(--gold), 0 0 14px 3px rgba(242, 165, 65, 0.6); }

.replay-tutorial {
  margin: 0 14px 14px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font: 0.9rem "Poppins", system-ui, sans-serif;
  text-decoration: underline;
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .tile.hint::after, .tip { animation: none; }
}
