/* Catnnections
   ------------------------------------------------------------------------
   Palette note: the four difficulty hues do double duty — they colour the
   groups AND the rank ladder. That is a rhyme, not a collision: purple means
   "hardest" in both places. Form keeps them apart (tiles are squares, the
   ladder is a bar), so the two readings never compete for the same glyph.

   The player never sees a number. The bar and the rank name are the score.
*/

:root {
  --ink: #14161a;
  --ink-soft: #5b6270;
  --ink-faint: #6c737f;
  --ground: #fbfaf7;
  --surface: #ffffff;
  --tile: #eeedea;
  --tile-hover: #e5e4e0;
  --line: #d9d8d3;
  --line-strong: #b9b8b2;

  --yellow: #e3b93b;
  --green: #86ac4a;
  --blue: #7c9de0;
  --purple: #a86fbd;

  --yellow-fill: #f6df84;
  --green-fill: #b3d074;
  --blue-fill: #adc4ef;
  --purple-fill: #cf9fdd;

  --yellow-wash: #fdf6dd;
  --green-wash: #eef5e0;
  --blue-wash: #e9eefb;
  --purple-wash: #f5ebf9;

  /* Text-on-ground variants. The fills above are backgrounds and are far too
     light to be read as type on cream — these are the same hues walked dark
     until each clears 4.5:1. Never use a -fill token for text. */
  --yellow-ink: #8a7124;
  --green-ink: #607c35;
  --blue-ink: #5b73a4;
  --purple-ink: #9261a4;

  --danger: #c2452f;

  --cat-eye: #8ad17f;
  --cat-nose: #e58fa6;
  --cat-line: #8c8478;

  --radius: 10px;
  --radius-lg: 16px;
  --gap: 8px;
  --shadow: 0 1px 2px rgba(20, 22, 26, 0.06), 0 4px 12px rgba(20, 22, 26, 0.04);
  --dur: 220ms;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink: #ecedf0;
    --ink-soft: #a2a8b6;
    --ink-faint: #7f8693;
    --ground: #14161a;
    --surface: #1c1f25;
    --tile: #272b33;
    --tile-hover: #31353f;
    --line: #343943;
    --line-strong: #4a505c;

    --yellow-wash: #2e2a1c;
    --green-wash: #232c1e;
    --blue-wash: #1e2432;
    --purple-wash: #2a2033;

    --yellow-ink: #e3b93b;
    --green-ink: #86ac4a;
    --blue-ink: #7c9de0;
    --purple-ink: #a970be;
    --danger: #ce6856;
    --cat-eye: #7cf08a;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.25);
  }
}

:root[data-theme='dark'] {
  --ink: #ecedf0;
  --ink-soft: #a2a8b6;
  --ink-faint: #7f8693;
  --ground: #14161a;
  --surface: #1c1f25;
  --tile: #272b33;
  --tile-hover: #31353f;
  --line: #343943;
  --line-strong: #4a505c;

  --yellow-wash: #2e2a1c;
  --green-wash: #232c1e;
  --blue-wash: #1e2432;
  --purple-wash: #2a2033;

  --yellow-ink: #e3b93b;
  --green-ink: #86ac4a;
  --blue-ink: #7c9de0;
  --purple-ink: #a970be;
  --danger: #ce6856;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.5 ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}

/* ---- Masthead ---------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

/* The Tasks Cat rides currentColor, so she is black on the light ground and
   white on the dark one with no second asset. */
.wordmark-cat {
  width: 30px;
  height: 32px;
  flex: none;
  color: var(--ink);
  /* She swaps expression by swapping <use> targets, so soften the cut. */
  transition: opacity 160ms var(--ease);
}
.wordmark-tail { color: var(--ink-faint); font-weight: 600; }

.puzzle-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-align: right;
  line-height: 1.25;
}
.puzzle-byline { display: block; font-size: 12px; font-weight: 500; color: var(--ink-faint); }

/* ---- Rank ladder -------------------------------------------------------
   Quiet at rest, loud on change. The fill is linear in RANK, not in score,
   so the exponential thresholds at the top compress into equal segments and
   promotion keeps a steady rhythm all the way up.
   ------------------------------------------------------------------------ */

.ladder { margin-bottom: 18px; }

.ladder-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  min-height: 20px;
}

.rank-name {
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.01em;
  transition: color var(--dur) var(--ease);
}
.rank-name[data-tier='yellow'] { color: var(--yellow-ink); }
.rank-name[data-tier='green']  { color: var(--green-ink); }
.rank-name[data-tier='blue']   { color: var(--blue-ink); }
.rank-name[data-tier='purple'] { color: var(--purple-ink); }

.rank-note { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.track {
  position: relative;
  height: 12px;
  border-radius: 99px;
  background: var(--tile);
  border: 1px solid var(--line);
  overflow: hidden;
}

.track-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--yellow-fill);
  transition: width 620ms var(--ease), background-color var(--dur) var(--ease);
}
.track-fill[data-tier='yellow'] { background: var(--yellow-fill); }
.track-fill[data-tier='green']  { background: var(--green-fill); }
.track-fill[data-tier='blue']   { background: var(--blue-fill); }
.track-fill[data-tier='purple'] { background: var(--purple-fill); }

.track-ticks {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
}
.track-ticks i {
  flex: 1;
  border-right: 1px dashed var(--line-strong);
  opacity: 0.55;
}
.track-ticks i:last-child { border-right: 0; }

.ladder.surge .track-fill { animation: surge 620ms var(--ease); }
@keyframes surge {
  0%   { filter: brightness(1); }
  35%  { filter: brightness(1.35); }
  100% { filter: brightness(1); }
}

/* ---- Solved groups ----------------------------------------------------- */

.solved-list { display: grid; gap: var(--gap); margin-bottom: var(--gap); }

.solved {
  border-radius: var(--radius);
  padding: 12px 14px;
  text-align: center;
  color: #14161a;
  animation: land 420ms var(--ease);
}
.solved[data-tier='yellow'] { background: var(--yellow-fill); }
.solved[data-tier='green']  { background: var(--green-fill); }
.solved[data-tier='blue']   { background: var(--blue-fill); }
.solved[data-tier='purple'] { background: var(--purple-fill); }

.solved-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.solved-words {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.82;
  margin-top: 2px;
}
.solved-flag {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.7;
}

@keyframes land {
  from { transform: scale(0.97); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ---- Board ------------------------------------------------------------- */

/* Offscreen ruler for tile text, so app.js can read a word's width in em.
   Measured at 9px, the same value as the font floor below, because a word's
   width in em is not constant across sizes — glyph advances grid-fit to whole
   pixels, making text ~10% relatively wider at 9px than at 100px. Measuring at
   the floor yields the widest em a word can have, so the fit errs small rather
   than wrapping. Weight 800 is the heaviest a tile renders (painted), so a fit
   survives a paint. Keep these declarations in step with .tile below — that is
   what makes the measurement match the tile instead of approximating it. */
.text-probe {
  position: absolute;
  left: -9999px;
  top: 0;
  visibility: hidden;
  white-space: pre;
  pointer-events: none;
  font-family: inherit;
  font-weight: 800;
  font-size: 9px; /* EM_PROBE in app.js, and the floor below — keep all three in step */
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin-bottom: 18px;
  /* Makes 100cqw inside a tile mean "the board's width", which is what lets
     the tile text size itself without script measuring anything. */
  container-type: inline-size;
}

.tile {
  position: relative;
  aspect-ratio: 1 / 0.82;
  min-height: 62px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--tile);
  color: var(--ink);
  /* A long word shrinks to fit rather than breaking across two lines.
     --em is the word's real rendered width in em, measured in app.js; --avail
     is how much room a tile has for it, derived from the board's own inline
     size so it stays right at every width with no media query and no layout
     read from script. A font size of --avail / --em is exactly the size at
     which the word spans the tile, and min() keeps short words from being
     scaled UP to fill it. The floor stops a pathological entry from going
     unreadable; overflow-wrap below is the last resort past that. */
  /* 10px is the tile's own chrome (2px border + 3px padding, both sides); the
     extra 2px is slack, because sizing a word to exactly its container's width
     leaves sub-pixel rounding to decide whether it wraps. */
  --avail: calc((100cqw - 3 * var(--gap)) / 4 - 12px);
  --tile-font: clamp(11px, 3.2vw, 15px);
  font-weight: 700;
  font-size: max(9px, min(var(--tile-font), calc(var(--avail) / var(--em, 1))));
  line-height: 1.15; font-family: inherit;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow-wrap: anywhere;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease),
    transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@media (hover: hover) and (pointer: fine) {
  .tile:hover { background: var(--tile-hover); }
}
.tile:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
/* Press: quick ease-in to a real squish. Release inherits the springier
   transition above, so it pops back with a little overshoot. */
.tile:active {
  transform: scale(0.9);
  transition: transform 90ms cubic-bezier(0.4, 0, 0.6, 1);
}

/* Painted = conviction. A ring and a wash, never the full fill — the
   saturated fill is reserved for groups that are actually won. */
.tile[data-paint] { font-weight: 800; }
.tile[data-paint='0'] { border-color: var(--yellow); background: var(--yellow-wash); }
.tile[data-paint='1'] { border-color: var(--green);  background: var(--green-wash); }
.tile[data-paint='2'] { border-color: var(--blue);   background: var(--blue-wash); }
.tile[data-paint='3'] { border-color: var(--purple); background: var(--purple-wash); }

.tile[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}

.tile.shake { animation: shake 380ms var(--ease); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

/* ---- Mistake dots ------------------------------------------------------
   Also the stake meter. A dot arms when the pending submission puts it at
   risk, so the size of the bet is shown by what it could cost — never by a
   projected score. The final group arms nothing, because nothing is at risk.
   ------------------------------------------------------------------------ */

.dots-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  min-height: 26px;
}
.dots { display: flex; gap: 9px; }

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink-soft);
  border: 2px solid transparent;
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.dot[data-state='spent'] { background: transparent; border-color: var(--line-strong); }
.dot[data-state='armed'] {
  background: var(--danger);
  animation: arm 900ms ease-in-out infinite;
}
@keyframes arm {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.28); }
}

/* ---- Controls ---------------------------------------------------------- */

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border-radius: 99px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 650; font-size: 14px; line-height: 1; font-family: inherit;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease),
    transform 140ms var(--ease), opacity 140ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { background: var(--tile); }
}
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }

.btn-icon { padding: 0; width: 44px; }

.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
}
.btn-quiet svg { width: 19px; height: 19px; }

/* The submit button gets hot as the stake grows. No number — heat. */
.btn-submit {
  background: var(--ink);
  color: var(--ground);
  border-color: var(--ink);
  padding: 0 22px;
  font-weight: 750;
}
@media (hover: hover) and (pointer: fine) {
  .btn-submit:hover:not(:disabled) { background: var(--ink); filter: brightness(1.15); }
}
.btn-submit[data-stake='2'] { box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 22%, transparent); }
.btn-submit[data-stake='3'] { box-shadow: 0 0 0 5px color-mix(in oklab, var(--danger) 32%, transparent); }
.btn-submit[data-stake='4'] {
  box-shadow: 0 0 0 7px color-mix(in oklab, var(--danger) 42%, transparent);
  animation: charged 1.1s ease-in-out infinite;
}
@keyframes charged {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

/* ---- Palette ----------------------------------------------------------- */

.palette {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px;
  border-radius: 99px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  width: fit-content;
  margin: 0 auto 8px;
}

.swatch {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 140ms var(--ease), border-color 140ms var(--ease);
}
.swatch i {
  display: block;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  transition: transform 140ms var(--ease);
}
.swatch[data-tier='0'] i { background: var(--yellow-fill); }
.swatch[data-tier='1'] i { background: var(--green-fill); }
.swatch[data-tier='2'] i { background: var(--blue-fill); }
.swatch[data-tier='3'] i { background: var(--purple-fill); }

.swatch[aria-checked='true'] { border-color: var(--ink); }
.swatch[aria-checked='true'] i { transform: scale(1.16); }
.swatch:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.swatch:disabled { cursor: default; }
.swatch:disabled i { transform: scale(0.72); opacity: 0.35; }

/* A solved colour is spent. The check says "done" rather than leaving a
   faded circle that just reads as broken. */
.swatch-check {
  position: absolute;
  width: 20px;
  height: 20px;
  color: var(--ink);
  pointer-events: none;
}

.swatch-count {
  position: absolute;
  bottom: -1px;
  right: -1px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--ground);
  font-weight: 700; font-size: 10px; line-height: 17px; font-family: inherit;
  text-align: center;
}
.swatch-count[data-state='complete'] { background: var(--green); }
.swatch-count[data-state='over'] { background: var(--danger); }

/* ---- Flash message ----------------------------------------------------- */

.flash {
  min-height: 22px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.flash[data-kind='missed'] { color: var(--danger); }
.flash[data-kind='landed'] { color: var(--green-ink); }
.flash[data-kind='repeat'] { color: var(--ink-faint); }

/* ---- Footer bar -------------------------------------------------------- */

.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.mode-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 99px;
  background: var(--tile);
  border: 1px solid var(--line);
}
.mode-switch button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 650; font-size: 12.5px; line-height: 1; font-family: inherit;
  cursor: pointer;
}
.mode-switch button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.mode-switch button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

.link-btn {
  border: 0;
  background: none;
  padding: 6px 2px;
  color: var(--ink-soft);
  font-weight: 600; font-size: 13px; line-height: 1; font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .link-btn:hover { color: var(--ink); }
}
.link-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---- Result ------------------------------------------------------------ */

.result {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
  animation: land 420ms var(--ease);
}
.result-rank {
  font-size: 30px;
  font-weight: 820;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.result-rank[data-tier='yellow'] { color: var(--yellow-ink); }
.result-rank[data-tier='green']  { color: var(--green-ink); }
.result-rank[data-tier='blue']   { color: var(--blue-ink); }
.result-rank[data-tier='purple'] { color: var(--purple-ink); }
.result-sub { font-size: 13.5px; color: var(--ink-soft); margin-top: 4px; }
.result-grid {
  font-size: 21px;
  line-height: 1.22;
  letter-spacing: 2px;
  margin: 14px 0 4px;
}
.result-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

.crown {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 11px;
  border-radius: 99px;
  background: var(--purple-fill);
  color: #14161a;
  font-weight: 800; font-size: 11px; line-height: 1.6; font-family: inherit;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* ---- Builder ----------------------------------------------------------- */

.builder-intro { margin-bottom: 20px; }
.builder-intro h1 {
  font-size: 25px;
  font-weight: 820;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
}
.builder-intro p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

input[type='text'], textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500; font-size: 16px; line-height: 1.4; font-family: inherit;
  transition: border-color 140ms var(--ease);
}
input[type='text']:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
textarea { resize: vertical; min-height: 92px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }

.group-card {
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  border-left-width: 6px;
  background: var(--surface);
  padding: 13px;
  margin-bottom: 10px;
}
.group-card[data-tier='0'] { border-left-color: var(--yellow); }
.group-card[data-tier='1'] { border-left-color: var(--green); }
.group-card[data-tier='2'] { border-left-color: var(--blue); }
.group-card[data-tier='3'] { border-left-color: var(--purple); }

.group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
}
.group-rank {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}
.group-head input { flex: 1; }

.word-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
@media (min-width: 460px) { .word-grid { grid-template-columns: repeat(4, 1fr); } }

.word-grid input { padding: 9px 10px; font-size: 15px; text-transform: uppercase; }
/* Typed words go uppercase; placeholders shouldn't shout. */
.word-grid input::placeholder { text-transform: none; }

.problems { margin: 14px 0; padding: 0; list-style: none; }
.problems li {
  font-size: 13px;
  padding: 7px 11px;
  border-radius: 8px;
  margin-bottom: 5px;
  background: color-mix(in oklab, var(--danger) 10%, var(--surface));
  color: var(--danger);
  font-weight: 600;
}
.problems li[data-kind='warning'] {
  background: color-mix(in oklab, var(--yellow) 16%, var(--surface));
  color: var(--ink);
}

.saved-link {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: var(--radius);
  background: var(--green-wash);
  border: 1.5px solid var(--green);
}
.saved-link code {
  flex: 1;
  font: 500 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}

.my-puzzles { margin-top: 30px; }
.my-puzzles h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 8px;
}
/* A second heading follows a run of rows, so it needs its own breathing room. */
.my-puzzles h2:not(:first-child) {
  margin-top: 22px;
}
.puzzle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}
.puzzle-row a { color: var(--ink); font-weight: 650; font-size: 14.5px; text-decoration: none; flex: 1; }
@media (hover: hover) and (pointer: fine) {
  .puzzle-row a:hover { text-decoration: underline; }
}
.puzzle-row time { font-size: 12px; color: var(--ink-faint); }

.empty {
  padding: 26px 18px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
}

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

@media (prefers-reduced-motion: reduce) {
  /* Not a blanket kill: every state change still reads, it just stops moving.
     Armed dots switch to a ring instead of a pulse; the charged submit button
     keeps its glow but stops breathing. */
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 90ms !important;
  }
  .dot[data-state='armed'] { outline: 2px solid var(--danger); outline-offset: 2px; }
  .btn-submit[data-stake='4'] { box-shadow: 0 0 0 7px color-mix(in oklab, var(--danger) 55%, transparent); }
}
