:root {
  --ink: #2b292a;
  --ink-soft: #5e5956;
  --ink-faint: #918b86;
  --paper: #f8f5ee;
  --paper-light: #fcfaf6;
  --paper-dark: #e8e2d6;
  --rule: #2b292a;
  --hair: #d8d0c1;
  --red-ink: #a3241c;
  --marker: #f3df87;
  --marker-strong: #e8c33d;
  --wrong: #c8553d;
  --clue-bg: #fcf6c6;
  --line-teal: #3f9a9c;
  --masthead: "UnifrakturMaguntia", "Old English Text MT", serif;
  --display: "Newsreader", Georgia, serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --sans: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --cs: 36px; /* grid cell size, set from JS */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.5;
  background-color: var(--paper);
  /* Near-white paper with a faint cream tint and a light newsprint grain. */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .26 0 0 0 .32 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.004' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .7 0 0 0 0 .6 0 0 0 0 .42 0 0 0 .7 -.4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23b)' opacity='.18'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

a { color: inherit; }
button, select, input { font: inherit; color: inherit; }

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

.masthead {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}
.masthead::after {
  content: "";
  grid-column: 1 / -1;
  margin-top: 4px;
  border-bottom: 4px double var(--rule);
}
.mast-side {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--cond);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.25;
}
.mast-left { align-items: flex-start; }
.mast-left #dateline { color: var(--ink); font-weight: 600; }
.mast-right { align-items: flex-end; text-align: right; }
.mast-right .wallet { white-space: nowrap; }
.mast-right .wallet b { color: var(--ink); font-weight: 700; }
.mast-right .wallet .link { margin-left: 6px; }
.mast-controls { display: flex; align-items: center; gap: 14px; }
.lang-picker select {
  border: 0;
  background: transparent;
  font-family: var(--cond);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.title {
  margin: 0;
  font-family: var(--masthead);
  font-weight: 400;
  font-size: clamp(40px, 5.6vw, 68px);
  line-height: 1;
  text-align: center;
}
.title a { text-decoration: none; }

.link { font-size: 12px; color: var(--ink); }
.lang-picker select {
  border: 0;
  background: transparent;
  font-family: var(--cond);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  padding: 0 2px;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.title {
  margin: 14px 0 2px;
  font-family: var(--masthead);
  font-weight: 400;
  font-size: clamp(46px, 7.4vw, 86px);
  line-height: 1;
}
.title a { text-decoration: none; }
.link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--hair);
  font-family: var(--cond);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.link:hover { text-decoration-color: var(--ink); }

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 20px 56px;
}

/* ---------- Generic pieces ---------- */

.kicker {
  margin: 0 0 4px;
  font-family: var(--cond);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red-ink);
}
.section-kicker { margin: 0 0 8px; font-family: var(--cond); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.meta { margin: 0; font-family: var(--cond); font-size: 12px; font-weight: 500; letter-spacing: .08em; color: var(--ink-soft); text-transform: uppercase; }
.muted { color: var(--ink-soft); }
.dropcap::first-letter { float: left; font-family: var(--display); font-weight: 600; font-size: 2.9em; line-height: .85; margin: 4px 6px 0 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--ink);
  background: transparent;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .12s, color .12s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--paper-dark); }
.btn.primary { background: var(--ink); color: var(--paper-light); }
.btn.primary:hover { background: #000; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn .count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--marker); color: var(--ink); font-size: 12px; }

.field { display: block; margin: 0; }
.field > span { display: block; font-family: var(--cond); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 3px; color: var(--ink-soft); }
.field input, .field select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--hair);
  border-bottom-color: var(--ink);
  background: var(--paper-light);
  font-family: var(--serif);
  font-size: 15px;
}
.error-text { color: var(--red-ink); font-style: italic; font-size: 14px; min-height: 1.2em; margin: 0; }

/* ---------- Auth ---------- */

.auth { max-width: 400px; margin: 18px auto; }
.auth .lead { font-family: var(--display); font-size: 19px; font-style: italic; line-height: 1.35; text-align: center; margin: 0 0 18px; }
.auth .field { margin-bottom: 12px; }
.tabs { display: flex; border-bottom: 1px solid var(--rule); margin-bottom: 16px; }
.tabs button {
  flex: 1;
  padding: 7px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { border-bottom-color: var(--ink); }

/* ---------- Front page ---------- */

.front { display: flex; flex-direction: column; }

.lead {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}
.headline {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.08;
  letter-spacing: -.01em;
}
.standfirst { margin: 0 0 14px; font-size: 16px; font-style: italic; color: var(--ink-soft); }
.new-form { display: flex; flex-direction: column; gap: 16px; }
.field-label { display: block; font-family: var(--cond); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 5px; color: var(--ink-soft); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: end; }
.lang-field { display: block; min-width: 0; }
.lang-field select {
  width: 100%; appearance: none; -webkit-appearance: none; cursor: pointer;
  padding: 2px 22px 4px 0; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0;
  font-family: var(--display); font-weight: 600; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%232b292a' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 2px center;
}
.lang-field select:hover { border-bottom-color: var(--red-ink); }
.lang-field select:focus-visible { outline: none; background-color: var(--clue-bg); }
.swap {
  width: 34px; height: 34px; margin-bottom: 4px; border: 1px solid var(--ink); border-radius: 50%;
  background: var(--paper-light); font-size: 16px; line-height: 1; cursor: pointer; transition: transform .25s, background .12s;
}
.swap:hover { background: var(--clue-bg); transform: rotate(180deg); }
.choices { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.form-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--hair); }
.form-foot .meta { min-width: 0; }
.btn.start { width: 100%; padding: 12px 18px; font-size: 14px; letter-spacing: .16em; background: var(--red-ink); border-color: var(--red-ink); color: #fff; }
.btn.start:hover { background: #861c15; border-color: #861c15; }
.btn.start span { transition: transform .15s; }
.btn.start:hover span { transform: translateX(4px); }
.new-form .error-text:empty { display: none; }

/* Vintage illustrations: multiplied onto the paper so their cream edges vanish. */
.art { display: block; width: 100%; height: auto; object-fit: cover; mix-blend-mode: multiply; filter: sepia(.12) saturate(.9) contrast(.97); }
.lead-side { border-left: 1px solid var(--hair); padding-left: 28px; display: flex; flex-direction: column; gap: 12px; }
.lead-art { aspect-ratio: 4 / 3; }
.col-art { aspect-ratio: 16 / 9; margin-bottom: 10px; }
.how-head .how-art { aspect-ratio: 4 / 3; margin-bottom: 6px; }

.lead-photo { margin: 0; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; align-items: center; border-top: 1px solid var(--hair); padding-top: 10px; }
.lead-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; filter: saturate(.85); }
.lead-photo figcaption { font-size: 13px; line-height: 1.35; color: var(--ink-soft); }
.lead-photo figcaption .kicker { display: block; }
.lead-photo figcaption b { color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 17px; margin-right: 4px; }

.columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.columns .col { padding: 0 22px; border-left: 1px solid var(--hair); display: flex; flex-direction: column; }
.columns .col:first-child { padding-left: 0; border-left: 0; }
.columns .col:last-child { padding-right: 0; }
.col-head { margin: 0 0 4px; font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.15; }
.col-text { margin: 0 0 6px; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.actions-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }

.puzzle-list { list-style: none; margin: 0; padding: 0; }
.puzzle-list li { border-bottom: 1px solid var(--paper-dark); }
.puzzle-list li:last-child { border-bottom: 0; }
.puzzle-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 5px 0; text-decoration: none; font-size: 14px; line-height: 1.3; }
.puzzle-list a:hover { background: rgba(243, 223, 135, .25); }
.puzzle-list .meta { font-size: 11px; }
.puzzle-list small { font-size: 12px; }
.puzzle-list .done { color: var(--red-ink); font-style: italic; }
.puzzle-list a > span:last-child { white-space: nowrap; font-family: var(--cond); font-size: 13px; letter-spacing: .04em; }

.how-strip { padding: 14px 0 0; display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 22px; align-items: start; }
.how { columns: 3; column-gap: 22px; column-rule: 1px solid var(--hair); }
.how p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.45; color: var(--ink-soft); break-inside: avoid; }

/* ---------- Lobby choices ---------- */

/* Options borrow the puzzle's own look: teal grid lines, yellow clue fill. */
.opt { border: 0; padding: 0; margin: 0; min-width: 0; }
.opt legend { padding: 0; }
.opt legend em { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--ink); }
.opt input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.opt label { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.opt label:has(input:focus-visible) { outline: 2px solid var(--marker-strong); outline-offset: 2px; }

.sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sizes label {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 9px; align-items: center;
  min-height: 44px; padding: 5px 9px; border: 1px solid var(--hair); background: var(--paper-light); line-height: 1.1;
  transition: border-color .12s, background .12s;
}
.sizes label:hover { border-color: var(--ink-soft); }
.sizes b { font-family: var(--display); font-weight: 600; font-size: 15px; align-self: end; }
.sizes small { grid-column: 2; font-family: var(--cond); font-size: 11px; letter-spacing: .06em; color: var(--ink-soft); align-self: start; }
.mini {
  grid-row: 1 / 3; display: block; --c: 3px;
  width: calc(var(--w) * var(--c) + 1px); height: calc(var(--h) * var(--c) + 1px);
  background:
    linear-gradient(var(--line-teal) 1px, transparent 1px) 0 0 / var(--c) var(--c),
    linear-gradient(90deg, var(--line-teal) 1px, transparent 1px) 0 0 / var(--c) var(--c),
    #fff;
  opacity: .55; transition: opacity .12s;
}
.mini-small { --w: 6; --h: 8; }
.mini-medium { --w: 8; --h: 10; }
.mini-large { --w: 10; --h: 12; }
.sizes label:has(input:checked) { border-color: var(--ink); background: var(--clue-bg); box-shadow: inset 0 0 0 1px var(--ink); }
.sizes label:has(input:checked) .mini { opacity: 1; }

.levels { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line-teal); background: var(--line-teal); gap: 1px; }
.levels label { display: flex; align-items: center; justify-content: center; height: 44px; background: #fff; transition: background .12s; }
.levels label:hover { background: var(--paper-light); }
.levels sup { position: absolute; top: 3px; left: 4px; font-family: var(--cond); font-size: 9.5px; line-height: 1; color: var(--ink-soft); }
.levels b { font-family: var(--cond); font-weight: 600; font-size: 19px; letter-spacing: .02em; }
.levels label:has(input:checked) { background: var(--clue-bg); box-shadow: inset 0 0 0 2px var(--ink); }
.levels label:has(input:checked) b { color: var(--red-ink); }

.tag { display: inline-block; padding: 0 5px; border: 1px solid var(--hair); font-family: var(--cond); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.board { width: 100%; border-collapse: collapse; font-family: var(--cond); font-size: 15px; }
.board th, .board td { padding: 5px 4px; border-bottom: 1px solid var(--paper-dark); text-align: left; }
.board tr.me { background: var(--marker); }
.hard { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 14px; }
.hard li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; border-bottom: 1px solid var(--paper-dark); padding-bottom: 4px; }

@media (max-width: 980px) {
  .lead { grid-template-columns: minmax(0, 1fr) 280px; }
  .choices { grid-template-columns: minmax(0, 1fr); }
  .how-strip { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
@media (max-width: 760px) {
  .masthead { padding: 10px 16px 0; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
  .title { grid-column: 1 / -1; order: -1; }
  .mast-side { font-size: 11px; }
  .mast-left #issue, .mast-right #ear-hints-label { display: none; }
  .mast-right { flex-direction: row; align-items: center; gap: 12px; }
  main { padding: 14px 16px 48px; }
  .lead { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .lead-side { border-left: 0; padding-left: 0; }
  .lead-art, .col-art { aspect-ratio: 2 / 1; object-position: 50% 30%; }
  .how-head { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; }
  .how-head .how-art { margin: 0; }
  .columns { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .columns .col, .columns .col:first-child, .columns .col:last-child { padding: 14px 0; border-left: 0; border-top: 1px solid var(--hair); }
  .columns .col:first-child { border-top: 0; }
  .how { columns: 1; }
}

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

/* The game screen drops the masthead; the grid is the page. */
body.in-game .masthead { display: none; }
body.in-game main { padding-top: 10px; }

.game { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.toolbar {
  width: 100%;
  max-width: 760px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
}
.toolbar .spacer { flex: 1; }
.tool {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--ink);
  background: var(--paper-light);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.tool.strong { background: var(--ink); color: var(--paper-light); }
.tool:disabled { opacity: .45; }
.tool .count { background: var(--marker); color: var(--ink); border-radius: 9px; padding: 0 6px; font-size: 12px; }

.grid-wrap { width: 100%; max-width: 760px; overflow-x: auto; display: flex; -webkit-overflow-scrolling: touch; }
.grid {
  --line: #3f9a9c;
  --clue-fill: #fcf6c6;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(var(--w), var(--cs));
  grid-template-rows: repeat(var(--h), var(--cs));
  gap: 1px;
  background: var(--line);
  border: 2px solid var(--line);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.cell { position: relative; min-width: 0; min-height: 0; -webkit-tap-highlight-color: transparent; }

.cell.clue { background: var(--clue-fill); display: flex; flex-direction: column; overflow: hidden; }
.ct {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  overflow: hidden;
  cursor: pointer;
  color: #111;
  text-align: center;
}
.ct + .ct { border-top: 1px solid var(--line); }
.ct span { display: block; width: 100%; white-space: nowrap; }
.ct.current { background: #f4e27a; }
.ct.done span { color: #8d8a7a; }

.cell.shaded { background: var(--clue-fill); }

.photo { position: relative; background: #fff; overflow: hidden; cursor: pointer; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .badge {
  position: absolute;
  left: 3px;
  top: 3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--line);
  color: #fff;
  font: 700 12px/18px var(--sans);
  text-align: center;
}
.photo .caption {
  position: absolute;
  right: 3px;
  bottom: 3px;
  max-width: calc(100% - 6px);
  padding: 1px 5px;
  background: rgba(255, 255, 255, .88);
  color: #111;
  font: 400 11px/1.3 "Roboto Condensed", "Arial Narrow", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo.current { outline: 3px solid #f4c430; outline-offset: -3px; }

.cell.letter {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: "Arimo", Arial, "Helvetica Neue", sans-serif;
  font-weight: 400;
  font-size: calc(var(--cs) * .6);
  line-height: 1;
  color: #111;
}
.cell.letter.in-word { background: #fdf3b5; }
.cell.letter.active { background: #f6d84a; }
.cell.revealed .l { color: var(--red-ink); }
.cell.revealed::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  border-style: solid;
  border-width: 0 0 7px 7px;
  border-color: transparent transparent var(--red-ink) transparent;
}
.cell.wrong .l { color: var(--wrong); text-decoration: line-through; }

.arr {
  position: absolute;
  width: max(8px, calc(var(--cs) * .2));
  height: max(8px, calc(var(--cs) * .2));
  color: var(--line);
  fill: var(--line);
  pointer-events: none;
}
.arr svg { display: block; width: 100%; height: 100%; }
.arr-right { left: 0; transform: translateY(-50%); }
.arr-right.at-mid { top: 50%; }
.arr-right.at-top { top: 25%; }
.arr-right.at-bottom { top: 75%; }
.arr-down { top: 0; left: 50%; transform: translateX(-50%); }
.arr-down-right { left: 1px; top: 0; }
.arr-right-down { left: 0; top: 1px; }

/* The printed grid carries the clues; this line only helps on small screens. */
.clue-line { display: none; font-family: var(--sans); font-size: 15px; text-align: center; }
@media (max-width: 600px) { .clue-line { display: block; } }

.special-letters { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.special-letters button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--ink);
  background: var(--paper-light);
  font-family: "Arimo", Arial, sans-serif;
  font-size: 18px;
  cursor: pointer;
}
.pos { font-style: italic; color: var(--ink-soft); font-size: .9em; }

.credits { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 12px; }
.credits li { display: flex; gap: 8px; align-items: center; }
.credits img { width: 36px; height: 36px; object-fit: cover; flex: none; }
@media (max-width: 480px) { .tool-label { display: none; } }

/* ---------- Modals & ads ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 19, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal {
  width: min(460px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--paper-light);
  border: 1.5px solid var(--ink);
  box-shadow: 0 12px 40px rgba(43, 41, 42, .25);
  padding: 22px;
  position: relative;
}
.modal h2 { font-family: var(--display); font-weight: 600; margin: 0 0 8px; font-size: 26px; }
.modal .close { position: absolute; top: 8px; right: 10px; background: none; border: none; font-size: 24px; cursor: pointer; }
.modal .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.products { display: grid; gap: 10px; margin-top: 14px; }
.product {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
}
.product.sub { border-width: 2.5px; border-style: double; border-width: 4px; }
.product b { font-family: var(--display); font-size: 18px; }
.mock-note { font-size: 13px; font-style: italic; color: var(--ink-faint); margin-top: 12px; }

.ad {
  text-align: center;
  border: 4px double var(--ink);
  padding: 22px 16px;
  background:
    repeating-linear-gradient(45deg, transparent 0 9px, rgba(28, 25, 19, .04) 9px 10px),
    var(--paper);
}
.ad .ad-label { font-family: var(--sans); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; }
.ad .ad-title { font-family: var(--display); font-weight: 900; font-size: 34px; line-height: 1.1; margin: 10px 0; }
.ad .timer { font-family: var(--sans); font-weight: 700; font-size: 15px; margin-top: 12px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper-light);
  padding: 10px 16px;
  font-family: var(--sans);
  font-size: 14px;
  z-index: 60;
  max-width: calc(100% - 32px);
}

#kbd {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  font-size: 16px; /* avoids iOS zoom on focus */
  border: 0;
  padding: 0;
}

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

@media (max-width: 700px) {
  body { font-size: 16px; }
}
@media (max-width: 480px) {
  .btn { padding: 9px 12px; }
}
