/* Sedecordle Wordle
   Colors are tokens on :root. Light is the default; dark applies via the
   system setting unless the player picked a theme (data-theme on <html>). */

:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #eeebe3;
  --text: #1c1f26;
  --muted: #5d6270;
  --line: #d9d5ca;
  --tile: #ffffff;
  --tile-line: #cfcabd;
  --key: #dedad0;
  --key-text: #1c1f26;
  --correct: #3d8b55;
  --present: #c99a1e;
  --absent: #7d828c;
  --miss: #b33a3a;
  --accent: #2a64cc;
  --accent-text: #ffffff;
  --focus: #2f6fdf;
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.08), 0 6px 20px rgba(20, 20, 30, 0.06);
  --radius: 10px;
  --header-h: 52px;
  /* One width for the whole site: header, content, game and footer all
     line up on the same left and right edges (16px gutters inside). */
  --wrap: 880px;
  --gutter: max(16px, calc((100% - var(--wrap)) / 2 + 16px));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151d;
    --surface: #181e29;
    --surface-2: #222a38;
    --text: #e7eaf0;
    --muted: #9aa3b4;
    --line: #2c3545;
    --tile: #161c26;
    --tile-line: #333d4f;
    --key: #3a4456;
    --key-text: #f2f4f8;
    --correct: #4a9e62;
    --present: #c9a227;
    --absent: #3c4454;
    --accent: #6a9cff;
    --accent-text: #0d1220;
    --focus: #8fb4ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #11151d;
  --surface: #181e29;
  --surface-2: #222a38;
  --text: #e7eaf0;
  --muted: #9aa3b4;
  --line: #2c3545;
  --tile: #161c26;
  --tile-line: #333d4f;
  --key: #3a4456;
  --key-text: #f2f4f8;
  --correct: #4a9e62;
  --present: #c9a227;
  --absent: #3c4454;
  --accent: #6a9cff;
  --accent-text: #0d1220;
  --focus: #8fb4ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

/* Colorblind: orange / blue. */
:root.cb {
  --correct: #e8702a;
  --present: #3a9ad9;
}

/* High contrast: stronger edges, and shapes as well as colors (see .tile::after). */
:root.hc {
  --line: currentColor;
  --tile-line: #6b7080;
  --correct: #1f7a3a;
  --present: #b07d00;
}
:root.hc.cb {
  --correct: #d35400;
  --present: #1f6fb2;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 52px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

a {
  color: var(--accent);
}
a:hover {
  text-decoration-thickness: 2px;
}
button,
select,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
img,
svg {
  vertical-align: middle;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 8px;
  top: -40px;
  background: var(--accent);
  color: var(--accent-text);
  padding: 6px 12px;
  border-radius: 6px;
  z-index: 50;
}
.skip:focus {
  top: 8px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand svg {
  width: 28px;
  height: 28px;
}
.brand span small {
  font-weight: 600;
  color: var(--muted);
}
/* Links that don't fit wrap onto a second row, which is clipped, so long
   labels (Polish, German) never push the icons past the site width. Every
   link is also in the menu. */
.top-nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 2px;
  min-width: 0;
  height: 34px;
  overflow: hidden;
  margin-left: 8px;
}
.top-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 6px 10px;
  line-height: 22px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}
.top-nav a:hover {
  background: var(--surface-2);
}
.top-nav a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--accent);
}
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
}
.icon-btn:hover {
  background: var(--surface-2);
}
.icon-btn svg {
  width: 22px;
  height: 22px;
}

/* Menu: a <details> element, so it works without JavaScript. */
.menu {
  position: relative;
}
.menu > summary {
  list-style: none;
  cursor: pointer;
}
.menu > summary::-webkit-details-marker {
  display: none;
}
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(320px, calc(100vw - 32px));
  max-height: calc(100dvh - var(--header-h) - 24px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 40;
}
.menu-label,
.foot-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 10px 8px 4px;
  font-weight: 700;
}
.menu-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.menu-panel li a {
  display: block;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.menu-panel li a:hover,
.menu-panel li a[aria-current] {
  background: var(--surface-2);
}
.menu-langs {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.lang-hint {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: var(--surface-2);
  font-size: 0.92rem;
}
.lang-hint[hidden] {
  display: none;
}
.lang-hint button {
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
}

/* ---------- Game ---------- */

.game {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
}
.game-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 0 6px;
}
.page-title {
  font-size: 1.3rem;
  margin: 14px 0 4px;
}
.game-bar h1 {
  font-size: 1.15rem;
  margin: 0;
  line-height: 1.3;
}
.game-bar .label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.counters {
  display: flex;
  gap: 14px;
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.counters b {
  color: var(--text);
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 8px;
}
.tabs a,
.tabs button {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}
.tabs a[aria-current="true"],
.tabs a[aria-current="page"],
.tabs button[aria-selected="true"] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

#jump {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 4px;
  padding: 6px 0;
  background: var(--bg);
}
.jump-btn {
  display: grid;
  place-items: center;
  height: 30px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.jump-btn.solved {
  background: var(--correct);
  color: #fff;
}
.jump-btn.failed {
  background: var(--miss);
  color: #fff;
}
.jump-btn.locked {
  opacity: 0.4;
}

#boards {
  --len: 5;
  --gap: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  padding: 4px 0 12px;
  align-items: start;
}
.board.locked {
  min-height: 90px;
}
.board {
  position: relative;
  container-type: inline-size;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
  scroll-margin-top: calc(var(--header-h) + 48px);
  transition: border-color 0.2s, opacity 0.2s;
}
.board.solved {
  border-color: var(--correct);
}
.board.failed {
  border-color: var(--miss);
}
.board.focus {
  box-shadow: 0 0 0 3px var(--focus);
}
.board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border: 0;
  background: none;
  padding: 0 4px 3px;
  font-size: clamp(11px, 6cqw, 13px);
  font-weight: 700;
  color: var(--muted);
}
.board.solved .board-head {
  color: var(--correct);
}
.board.failed .board-info {
  color: var(--miss);
  letter-spacing: 0.08em;
}
.rows {
  display: grid;
  gap: 2px;
}
.row {
  display: grid;
  grid-template-columns: repeat(var(--len), 1fr);
  gap: 2px;
}
.tile {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--tile);
  border: 1px solid var(--tile-line);
  border-radius: 3px;
  font-weight: 800;
  font-size: calc(55cqw / var(--len));
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
}
.tile.filled {
  border-color: var(--muted);
}
.row.current .tile {
  border-color: color-mix(in srgb, var(--muted) 60%, var(--tile-line));
}
.tile.c,
.tile.p,
.tile.a {
  border-color: transparent;
  color: #fff;
}
.tile.c {
  background: var(--correct);
}
.tile.p {
  background: var(--present);
}
.tile.a {
  background: var(--absent);
}
.row.given .tile {
  opacity: 0.85;
}
.row.after .tile {
  opacity: 0.25;
}
/* A board is only as tall as the guesses played on it plus the row being
   typed, so all 16 fit on screen early in the game. */
.row.empty,
:root.compact .board.solved .row.after {
  display: none;
}
.board.locked .rows {
  visibility: hidden;
}
.board-lock {
  position: absolute;
  inset: 40px 8px auto;
  display: none;
  place-items: start center;
  text-align: center;
  color: var(--muted);
  font-size: clamp(11px, 6cqw, 13px);
  font-weight: 600;
}
.board.locked .board-lock {
  display: grid;
}

/* Shapes for high contrast: a dot for "present", a bar for "correct". */
:root.hc .tile.p::after,
:root.hc .tile.c::after {
  content: "";
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 2px;
}
:root.hc .tile.p::after {
  width: 14%;
  height: 14%;
  border-radius: 50%;
}
:root.hc .tile.c::after {
  width: 45%;
  height: 7%;
}

.flip {
  animation: flip 0.42s ease both;
}
@keyframes flip {
  0% {
    transform: rotateX(90deg);
  }
  100% {
    transform: rotateX(0);
  }
}
.shake {
  animation: shake 0.36s;
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-4px);
  }
  40%,
  80% {
    transform: translateX(4px);
  }
}
:root.noanim *,
:root.noanim *::before {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .flip,
  .shake {
    animation: none;
  }
}

.game.loading #boards {
  opacity: 0.5;
}

/* ---------- Keyboard ---------- */

#keyboard {
  position: sticky;
  bottom: 0;
  z-index: 20;
  max-width: 620px;
  margin: 0 auto;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  background: var(--bg);
  box-shadow: 0 0 0 100vmax var(--bg);
  clip-path: inset(0 -100vmax);
  display: grid;
  gap: 6px;
  touch-action: manipulation;
}
.key-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}
.key {
  position: relative;
  flex: 1 1 0;
  max-width: 56px;
  height: 56px;
  border: 0;
  border-radius: 6px;
  background: var(--key);
  color: var(--key-text);
  font-weight: 800;
  font-size: 1.05rem;
  text-transform: uppercase;
  padding: 0;
  overflow: hidden;
}
.key.wide {
  flex: 1.6 1 0;
  max-width: 86px;
  font-size: 0.78rem;
}
.key .map {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
}
.key .map i.c {
  background: var(--correct);
}
.key .map i.p {
  background: var(--present);
}
.key .map i.a {
  background: var(--absent);
}
.key .label {
  position: relative;
  text-shadow: 0 0 3px var(--key), 0 0 6px var(--key);
}
.key.dead {
  opacity: 0.35;
}
/* A focused board colors the whole key. */
.key.focused .map {
  display: none;
}
.key.fc {
  background: var(--correct);
  color: #fff;
}
.key.fp {
  background: var(--present);
  color: #fff;
}
.key.fa {
  background: var(--absent);
  color: #fff;
  opacity: 0.6;
}
.key.fc .label,
.key.fp .label,
.key.fa .label {
  text-shadow: none;
}
.enter-left .key.enter {
  order: -1;
}
.enter-left .key.back {
  order: 99;
}
.key:active {
  filter: brightness(0.9);
}

/* ---------- Toast ---------- */

#toast {
  position: fixed;
  top: calc(var(--header-h) + 60px);
  left: 50%;
  transform: translate(-50%, -6px);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Dialogs ---------- */

dialog {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: rgba(10, 12, 18, 0.55);
}
.dlg-title {
  margin: 0 0 10px;
  font-size: 1.3rem;
  font-weight: 800;
}
.dlg-sub {
  margin: 18px 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.dialog-close {
  position: absolute;
  right: 10px;
  top: 10px;
}
.legend {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.legend div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.legend .tile {
  width: 34px;
  font-size: 1.1rem;
  container-type: normal;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.share-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.share-links a {
  font-size: 0.85rem;
  padding: 8px;
}
#end-grid {
  white-space: pre;
  font-size: 0.95rem;
  line-height: 1.5;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px 12px;
  overflow-x: auto;
}
#end-words {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
}
#end-words li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
}
#end-words .n {
  color: var(--muted);
  width: 1.6em;
  text-align: right;
  font-size: 0.85rem;
}
#end-words a {
  font-weight: 800;
  letter-spacing: 0.05em;
}
#end-words .g {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
}
#end-words li.miss a {
  color: var(--miss);
}
#end-countdown b {
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  gap: 6px;
}
.stats-row b {
  display: block;
  font-size: 1.7rem;
  line-height: 1.2;
}
.stats-row span {
  font-size: 0.75rem;
  color: var(--muted);
}
.dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0;
  font-size: 0.85rem;
}
.dist-row span {
  width: 3.2em;
  text-align: right;
  color: var(--muted);
}
.dist-row .bar {
  background: var(--absent);
  color: #fff;
  padding: 1px 6px;
  text-align: right;
  border-radius: 3px;
  font-weight: 700;
}
.dist-row .bar.current {
  background: var(--correct);
}
.dist-row .bar.lost.current {
  background: var(--miss);
}
.setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.setting small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}
.setting input[type="checkbox"] {
  appearance: none;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--key);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.setting input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.setting input[type="checkbox"]:checked {
  background: var(--correct);
}
.setting input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}
.setting select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.file-btn input {
  display: none;
}

/* ---------- Custom / archive ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 12px 0 20px;
}
.panel textarea {
  width: 100%;
  min-height: 180px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--tile);
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.panel input[type="text"],
.panel select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--tile);
}
:root.no-game .game-play,
:root:not(.no-game) #custom-form {
  display: none;
}
.month h2 {
  font-size: 1.05rem;
  margin: 18px 0 8px;
}
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  max-width: 460px;
}
.cal .wd {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
}
.cal .day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  position: relative;
}
.cal .day.won {
  background: var(--correct);
  border-color: var(--correct);
  color: #fff;
}
.cal .day.won::after {
  content: "✓";
  position: absolute;
  top: 1px;
  right: 4px;
  font-size: 0.7rem;
}
.cal .day.lost {
  border-color: var(--miss);
  color: var(--miss);
}
.cal .day.today {
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* ---------- Content ---------- */

.content {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 24px 16px 40px;
}
.game + .content {
  border-top: 1px solid var(--line);
  margin-top: 16px;
}
.content h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.2;
  margin: 8px 0 12px;
}
.content h2 {
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 32px 0 10px;
}
.content h3 {
  font-size: 1.1rem;
  margin: 22px 0 8px;
}
.content p,
.content li {
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
}
.content .lead {
  font-size: 1.1rem;
}
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--muted);
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
}
.breadcrumbs li + li::before {
  content: "›";
  margin-right: 6px;
}
.breadcrumbs a {
  color: var(--muted);
}
.faq details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 8px 0;
  background: var(--surface);
}
.faq summary {
  font-weight: 700;
  cursor: pointer;
}
.faq details p {
  margin: 8px 0 0;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.answer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.answer-card .card-title {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  min-height: 32px;
}
.hint button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.82rem;
  font-weight: 600;
}
.hint button:disabled {
  opacity: 0.55;
  cursor: default;
}
.hint .val {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hint .val a {
  color: inherit;
}
.word-tiles {
  display: inline-flex;
  gap: 2px;
}
.word-tiles span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: var(--correct);
  color: #fff;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}
.notice {
  background: var(--surface-2);
  border-left: 4px solid var(--present);
  padding: 10px 14px;
  border-radius: 6px;
}
.cta {
  margin: 24px 0;
}
.day-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0;
}
.day-nav .btn {
  white-space: normal;
}
.link-list {
  columns: 2 220px;
  padding-left: 1.2em;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 28px var(--gutter) 36px;
  font-size: 0.9rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 24px;
}
.site-footer .foot-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 8px;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer li {
  margin: 4px 0;
}
.site-footer a {
  color: var(--text);
  text-decoration: none;
}
.site-footer a:hover {
  text-decoration: underline;
}
.footer-langs {
  margin: 20px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.footer-langs a[aria-current] {
  font-weight: 800;
}
.footer-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .top-nav {
    display: none;
  }
}
/* Phones: boards stay 4 across like a 4x4 map, so all 16 are in view and
   the jump bar isn't needed. */
@media (max-width: 760px) {
  /* Title on one line; puzzle label and counters share the line under it. */
  .game-bar {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 0 10px;
    padding: 8px 0 6px;
  }
  .game-bar > div:first-child {
    display: contents;
  }
  .game-bar h1 {
    grid-column: 1 / -1;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .game-bar .label {
    font-size: 0.78rem;
  }
  .counters {
    justify-content: flex-end;
    gap: 10px;
    font-size: 0.75rem;
    white-space: nowrap;
  }
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 5px;
    padding: 0 0 6px;
  }
  .tabs::-webkit-scrollbar {
    display: none;
  }
  .tabs a,
  .tabs button {
    flex: none;
    padding: 4px 11px;
    font-size: 0.8rem;
  }
  #jump {
    display: none;
  }
  #boards {
    --gap: 5px;
    padding: 2px 0 8px;
  }
  .board {
    padding: 2px;
    border-width: 1.5px;
    border-radius: 7px;
    scroll-margin-top: calc(var(--header-h) + 8px);
  }
  .board-head {
    padding: 0 2px 1px;
    font-size: 10px;
    line-height: 1.3;
  }
  .rows,
  .row {
    gap: 1px;
  }
  .tile {
    border-radius: 2px;
    font-size: calc(62cqw / var(--len));
  }
  /* 7+ letter words would make tiles too small four across. */
  #boards.long {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .board.locked {
    min-height: 64px;
  }
  .board-lock {
    inset: 18px 2px auto;
    font-size: 9px;
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-inner > :first-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 420px) {
  .game {
    padding: 0 8px;
  }
  /* Short phones (iPhone SE) get shorter keys so more boards stay visible. */
  .key {
    height: clamp(40px, 7dvh, 52px);
    font-size: 1rem;
  }
  .key-row {
    gap: 4px;
  }
  .brand span small {
    display: none;
  }
  .site-header {
    gap: 6px;
    padding: 0 8px 0 16px;
  }
  .brand {
    min-width: 0;
    gap: 8px;
  }
  .brand span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-actions {
    gap: 0;
  }
  .icon-btn {
    width: 38px;
  }
}
@media (min-width: 761px) {
  .board {
    padding: 5px;
  }
}
/* Full-width layout: 8 across, so all 16 boards sit in two rows. */
@media (min-width: 880px) {
  #boards {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
  #boards.long {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- No-JS and answer content ---------- */

.noscript {
  margin: 12px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border-left: 4px solid var(--present);
}
.answer-list {
  padding-left: 1.6em;
}
.answer-list li {
  margin: 6px 0;
}
.answer-list strong {
  letter-spacing: 0.06em;
}
.credit {
  font-size: 0.85rem;
  color: var(--muted);
}
.faq h3 {
  font-size: 1.05rem;
  margin: 18px 0 4px;
}
.faq p {
  margin: 0 0 8px;
}
.day-list {
  padding-left: 1.2em;
  font-size: 0.95rem;
}
.day-list li {
  margin: 4px 0;
}
.answer-card .card-title {
  margin: 0 0 6px;
}
main > .breadcrumbs {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 16px 16px 0;
}

/* ---------- Blog ---------- */

.byline {
  color: var(--muted);
  font-size: 0.88rem;
  margin: -4px 0 16px;
}
.byline a {
  color: inherit;
}
.content .lead p {
  font-size: 1.08rem;
}
.toc {
  margin: 20px 0 8px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.toc-title {
  margin: 0 0 6px;
  font-weight: 700;
}
.toc ol {
  margin: 0;
  padding-left: 1.3em;
}
.toc li {
  margin: 3px 0;
}
.tip {
  padding: 12px 16px;
  border-left: 4px solid var(--correct);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-2);
}
.table-wrap {
  overflow-x: auto;
  margin: 12px 0 16px;
}
.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.content th,
.content td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
.content th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.post-card {
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--line);
}
.post-card h2 a {
  color: var(--text);
  text-decoration: none;
}
.post-card h2 a:hover {
  text-decoration: underline;
}
