:root {
  color-scheme: light;
  --paper: #fffdf8;
  --paper-warm: #f8efe0;
  --ink: #172026;
  --muted: #66707a;
  --line: #d6c6ae;
  --red: #e93c47;
  --blue: #1c6f8f;
  --green: #247a59;
  --yellow: #f5c542;
  --shadow: 0 14px 34px rgb(61 45 28 / 12%);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper-warm);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgb(233 60 71 / 10%) 0, rgb(28 111 143 / 9%) 360px, transparent 700px),
    var(--paper-warm);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

.app-shell,
.game-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 18px;
}

.masthead {
  padding: 22px 0 18px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: 2.35rem;
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  letter-spacing: 0;
}

.lede {
  max-width: 720px;
  margin: 14px 0 0;
  color: #3d4852;
  font-size: 1rem;
  line-height: 1.45;
}

.notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.notice.error {
  border-color: rgb(233 60 71 / 40%);
  color: #9b1c26;
}

.continue-panel,
.new-card-panel {
  display: grid;
  gap: 14px;
  align-items: center;
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.continue-panel {
  grid-template-columns: 1fr auto;
}

.continue-panel p,
.new-card-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.continue-panel button,
.name-form button,
.back-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--ink);
  font-weight: 800;
}

.continue-panel button,
.name-form button {
  padding: 0 16px;
}

.name-form {
  display: grid;
  gap: 8px;
}

.name-form label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.form-row input {
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #bac4ce;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.players-section {
  margin-top: 20px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-heading span,
.mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgb(31 157 117 / 14%);
  color: #0f684e;
  font-size: 0.74rem;
  font-weight: 900;
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.player-card,
.empty-state {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 24px rgb(23 32 38 / 8%);
}

.player-card {
  display: grid;
  gap: 6px;
  align-content: start;
}

.player-card:hover,
.tile:hover,
.continue-panel button:hover,
.name-form button:hover,
.back-button:hover {
  transform: translateY(-1px);
}

.player-name {
  font-weight: 900;
}

.player-progress,
.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.game-shell {
  display: grid;
  gap: 12px;
}

.game-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  background: linear-gradient(180deg, var(--paper-warm) 72%, rgb(248 239 224 / 0));
}

.game-header h1 {
  font-size: 1.42rem;
}

.back-button {
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.score-pill {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  min-height: 58px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgb(23 32 38 / 10%);
}

.score-pill span {
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1;
}

.score-pill small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.bingo-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 2px solid #111820;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--yellow), #ffffff 54%, rgb(31 157 117 / 20%));
}

.catalog-section {
  margin-top: 28px;
  padding-bottom: 30px;
}

.catalog-filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0 12px;
}

.catalog-filter {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.catalog-filter.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.catalog-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 24px rgb(61 45 28 / 8%);
}

.catalog-art {
  position: relative;
  display: block;
  width: 82px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgb(23 32 38 / 14%);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 52%), transparent 52%),
    #f2dfc2;
}

.catalog-art::before,
.catalog-art::after,
.catalog-art span {
  content: "";
  position: absolute;
  display: block;
}

.catalog-art::before {
  left: 18%;
  right: 18%;
  bottom: 24%;
  height: 2px;
  border-radius: 999px;
  background: rgb(23 32 38 / 74%);
  box-shadow:
    -13px 5px 0 8px rgb(23 32 38 / 66%),
    13px 5px 0 8px rgb(23 32 38 / 66%);
}

.catalog-art::after {
  left: 41%;
  top: 30%;
  width: 28%;
  height: 29%;
  border-top: 2px solid rgb(23 32 38 / 68%);
  border-right: 2px solid rgb(23 32 38 / 68%);
  transform: skew(-16deg);
}

.catalog-art span {
  left: 41%;
  top: 18%;
  width: 14px;
  height: 14px;
  border: 2px solid rgb(23 32 38 / 68%);
  border-radius: 999px;
}

.catalog-art.has-image {
  background: var(--paper);
}

.catalog-art.has-image::before,
.catalog-art.has-image::after,
.catalog-art.has-image span {
  display: none;
}

.catalog-art img,
.tile-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-category {
  margin: 0 0 5px;
  color: var(--red);
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.catalog-clue,
.catalog-hook {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.26;
}

.catalog-clue {
  margin-bottom: 5px;
  color: #3d4852;
  font-weight: 800;
}

.bingo-banner p {
  margin: 0;
  color: #263238;
  font-weight: 800;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgb(23 32 38 / 18%);
  border-radius: 999px;
  background: #ffffff;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--red));
  transition: width 180ms ease;
}

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  width: min(100%, 760px);
  margin: 0 auto;
}

.tile {
  position: relative;
  display: grid;
  grid-template-rows: 46% minmax(0, 1fr);
  min-width: 0;
  min-height: 88px;
  aspect-ratio: 0.74;
  overflow: hidden;
  padding: 5px;
  border: 1px solid #cfd7df;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: center;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.tile.is-seen {
  border-color: #0f684e;
  box-shadow: inset 0 0 0 2px rgb(31 157 117 / 80%);
}

.tile.is-seen::after {
  content: "SEEN";
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #0f684e;
  color: #ffffff;
  font-size: 0.54rem;
  font-weight: 950;
  line-height: 1;
}

.tile.is-free {
  border-color: #111820;
  background: linear-gradient(180deg, #ffffff, rgb(245 197 66 / 22%));
}

.tile-art {
  position: relative;
  display: block;
  min-height: 0;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 70%), transparent 48%),
    var(--tile-accent);
}

.tile-art::before {
  content: attr(data-initials);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 950;
  text-shadow: 0 1px 7px rgb(0 0 0 / 35%);
}

.tile-art::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 13%;
  height: 3px;
  border-radius: 999px;
  background: rgb(23 32 38 / 78%);
  box-shadow:
    -11px 5px 0 5px rgb(255 255 255 / 65%),
    11px 5px 0 5px rgb(255 255 255 / 65%),
    -11px 5px 0 8px rgb(23 32 38 / 74%),
    11px 5px 0 8px rgb(23 32 38 / 74%);
}

.tile-art span {
  position: absolute;
  left: 50%;
  top: 27%;
  width: 18%;
  height: 28%;
  border-top: 3px solid rgb(23 32 38 / 72%);
  border-right: 3px solid rgb(23 32 38 / 72%);
  transform: skew(-16deg);
}

.tile-art.has-image {
  background: var(--paper);
}

.tile-art.has-image::before,
.tile-art.has-image::after,
.tile-art.has-image span {
  display: none;
}

.tile-copy {
  display: grid;
  gap: 2px;
  align-content: center;
  min-width: 0;
  min-height: 0;
}

.tile-copy strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 950;
  line-height: 1.05;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tile-copy small {
  display: none;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.15;
}

.loading {
  margin: 32px 0;
  color: var(--muted);
  font-weight: 800;
}

@media (min-width: 680px) {
  .app-shell,
  .game-shell {
    padding: 30px;
  }

  h1 {
    font-size: 3.5rem;
  }

  .new-card-panel {
    grid-template-columns: minmax(0, 0.7fr) minmax(320px, 1fr);
  }

  .board {
    gap: 8px;
  }

  .tile {
    min-height: 132px;
    aspect-ratio: 0.92;
    padding: 8px;
  }

  .tile-copy strong {
    font-size: 0.82rem;
    line-height: 1.08;
    -webkit-line-clamp: 2;
  }

  .tile-copy small {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .catalog-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

@media (max-width: 420px) {
  .app-shell,
  .game-shell {
    padding: 12px;
  }

  h1 {
    font-size: 2.05rem;
  }

  .continue-panel,
  .form-row {
    grid-template-columns: 1fr;
  }

  .board {
    gap: 4px;
  }

  .tile {
    min-height: 80px;
    padding: 4px;
  }

  .tile-copy strong {
    font-size: 0.58rem;
  }
}

/* Field-guide visual layer */
body {
  background:
    repeating-linear-gradient(0deg, rgb(54 40 26 / 0.025) 0 1px, transparent 1px 32px),
    linear-gradient(180deg, #fbf4e6 0, #f2dfc2 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgb(31 24 18 / 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgb(31 24 18 / 0.025) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.72;
}

.app-shell,
.game-shell {
  width: min(100%, 1040px);
}

.masthead {
  position: relative;
  padding: 26px 0 22px;
  border-bottom: 2px solid rgb(31 24 18 / 82%);
}

.masthead::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -7px;
  width: min(270px, 70%);
  border-bottom: 2px solid rgb(31 24 18 / 50%);
  transform: rotate(-1deg);
}

h1,
.game-header h1,
.item-copy h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

h1 {
  color: #211915;
  font-size: clamp(2.4rem, 10vw, 5rem);
  line-height: 0.9;
}

.lede {
  max-width: 620px;
  color: #5a4634;
  font-weight: 700;
}

.eyebrow,
.panel-kicker,
.catalog-category {
  color: #a3362d;
}

.continue-panel,
.new-card-panel,
.player-card,
.empty-state,
.catalog-card,
.notice,
.score-pill,
.bingo-banner {
  border: 2px solid #211915;
  border-radius: 7px;
  background: #fffaf0;
  box-shadow: 5px 6px 0 rgb(33 25 21 / 14%);
}

.continue-panel,
.new-card-panel {
  margin: 18px 0;
}

.continue-panel button,
.name-form button,
.back-button,
.mark-button,
.sheet-close {
  border: 2px solid #211915;
  border-radius: 7px;
  background: #211915;
  color: #fffaf0;
  box-shadow: 3px 3px 0 rgb(33 25 21 / 16%);
  font-weight: 950;
}

.back-button,
.sheet-close {
  background: #fffaf0;
  color: #211915;
}

.form-row input {
  border: 2px solid #211915;
  background: #fffaf0;
  box-shadow: inset 2px 2px 0 rgb(33 25 21 / 7%);
}

.section-heading {
  border-bottom: 2px solid rgb(33 25 21 / 75%);
  padding-bottom: 8px;
}

.section-heading span,
.mini-badge,
.catalog-status {
  border: 1px solid rgb(33 25 21 / 65%);
  background: #f5c542;
  color: #211915;
  text-transform: uppercase;
}

.catalog-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 7px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 950;
}

.catalog-status.is-seen,
.mini-badge {
  background: #dbe8c6;
}

.catalog-filter {
  border: 2px solid #211915;
  background: #fffaf0;
  box-shadow: 2px 2px 0 rgb(33 25 21 / 12%);
}

.catalog-filter.is-active {
  background: #211915;
  color: #fffaf0;
}

.catalog-card {
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: start;
  width: 100%;
  min-height: 136px;
  color: var(--ink);
  text-align: left;
}

.catalog-title {
  display: block;
  margin: 0 0 6px;
  color: #211915;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.05;
}

.catalog-art {
  width: 92px;
  border: 2px solid #211915;
  background: #f6e8ce;
}

.catalog-art::before {
  background: #211915;
  box-shadow:
    -14px 5px 0 8px rgb(33 25 21 / 72%),
    14px 5px 0 8px rgb(33 25 21 / 72%);
}

.game-header {
  background: linear-gradient(180deg, #fbf4e6 72%, rgb(251 244 230 / 0));
}

.progress-track {
  height: 14px;
  border: 2px solid #211915;
  background: #fffaf0;
}

.progress-track span {
  background: repeating-linear-gradient(
    -45deg,
    #247a59 0 8px,
    #dbe8c6 8px 13px,
    #247a59 13px 21px
  );
}

.board {
  gap: 7px;
}

.tile {
  border: 2px solid #211915;
  border-radius: 7px;
  background: #fffaf0;
  box-shadow: 3px 4px 0 rgb(33 25 21 / 12%);
}

.tile.is-seen {
  border-color: #211915;
  box-shadow:
    inset 0 0 0 3px rgb(36 122 89 / 75%),
    3px 4px 0 rgb(33 25 21 / 12%);
}

.tile.is-seen::after {
  top: 7px;
  right: 5px;
  border: 2px solid #247a59;
  border-radius: 4px;
  background: #fffaf0;
  color: #247a59;
  transform: rotate(7deg);
}

.tile-art {
  border: 1px solid rgb(33 25 21 / 35%);
  background:
    linear-gradient(135deg, rgb(255 250 240 / 70%), transparent 54%),
    #f6e8ce;
}

.tile-art::before {
  color: #211915;
  text-shadow: none;
}

.tile-art::after {
  background: #211915;
  box-shadow:
    -11px 5px 0 5px rgb(255 250 240 / 70%),
    11px 5px 0 5px rgb(255 250 240 / 70%),
    -11px 5px 0 8px rgb(33 25 21 / 72%),
    11px 5px 0 8px rgb(33 25 21 / 72%);
}

.tile-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

.timeline-section {
  width: min(100%, 760px);
  margin: 14px auto 28px;
}

.timeline-empty {
  margin: 10px 0 0;
  color: #6d5742;
  font-size: 0.92rem;
  font-weight: 700;
}

.timeline-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.timeline-event {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.timeline-dot {
  width: 13px;
  height: 13px;
  margin-top: 9px;
  border: 2px solid #211915;
  border-radius: 999px;
  background: #fffaf0;
}

.timeline-dot.is-seen {
  background: #247a59;
}

.timeline-dot.is-unseen {
  background: #e93c47;
}

.timeline-event button {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgb(33 25 21 / 32%);
  border-radius: 7px;
  background: rgb(255 250 240 / 76%);
  color: #211915;
  text-align: left;
}

.timeline-event strong,
.timeline-event span {
  display: block;
}

.timeline-event span {
  margin-top: 2px;
  color: #6d5742;
  font-size: 0.78rem;
  font-weight: 800;
}

.item-sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: auto;
  background:
    repeating-linear-gradient(0deg, rgb(54 40 26 / 0.025) 0 1px, transparent 1px 32px),
    #fbf4e6;
}

.item-sheet-scroll {
  width: min(100%, 1040px);
  min-height: 100%;
  margin: 0 auto;
  padding: 14px;
}

.item-sheet-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  padding: 10px 0;
  background: linear-gradient(180deg, #fbf4e6 72%, rgb(251 244 230 / 0));
}

.sheet-close {
  min-height: 42px;
  padding: 0 14px;
}

.item-sheet-layout {
  display: grid;
  gap: 18px;
  align-items: start;
}

.item-illustration {
  position: relative;
  min-height: 260px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid #211915;
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgb(255 250 240 / 70%), transparent 54%),
    #f6e8ce;
  box-shadow: 7px 8px 0 rgb(33 25 21 / 14%);
}

.item-illustration span::before {
  content: attr(data-initials);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #211915;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 18vw, 6rem);
  font-weight: 800;
}

.item-illustration span::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 20%;
  height: 4px;
  border-radius: 999px;
  background: #211915;
  box-shadow:
    -32px 12px 0 22px rgb(33 25 21 / 72%),
    32px 12px 0 22px rgb(33 25 21 / 72%);
}

.item-illustration.has-image {
  background: #fffaf0;
}

.item-illustration img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.item-copy {
  padding-bottom: 12px;
}

.item-copy h2 {
  margin: 0;
  color: #211915;
  font-size: clamp(2.2rem, 12vw, 5rem);
  line-height: 0.9;
}

.item-clue {
  margin: 14px 0 0;
  color: #3f3027;
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1.22;
}

.item-hook {
  margin: 12px 0 0;
  color: #6d5742;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.item-copy ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.item-copy li {
  padding: 6px 9px;
  border: 1px solid rgb(33 25 21 / 45%);
  border-radius: 999px;
  background: #fffaf0;
  color: #3f3027;
  font-size: 0.8rem;
  font-weight: 900;
}

.mark-button {
  width: 100%;
  min-height: 54px;
  margin-top: 20px;
  font-size: 1rem;
}

.mark-button.is-seen {
  background: #fffaf0;
  color: #247a59;
  border-color: #247a59;
}

.item-state {
  margin: 18px 0 0;
  padding: 12px;
  border: 2px solid rgb(33 25 21 / 72%);
  border-radius: 7px;
  background: #fffaf0;
  color: #6d5742;
  font-weight: 900;
}

.item-history {
  margin: 28px 0;
}

@media (min-width: 760px) {
  .item-sheet-scroll {
    padding: 22px 30px 36px;
  }

  .item-sheet-layout {
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1fr);
    gap: 32px;
  }

  .mark-button {
    width: auto;
    min-width: 180px;
    padding: 0 24px;
  }
}

@media (max-width: 520px) {
  .catalog-card {
    grid-template-columns: 76px minmax(0, 1fr);
    min-height: 118px;
  }

  .catalog-art {
    width: 76px;
  }

  .catalog-hook {
    display: none;
  }

  .item-illustration {
    min-height: 230px;
  }
}

/* Illustration-first field guide rewrite */
:root {
  --paper: #fff8e7;
  --paper-warm: #fff1c8;
  --ink: #1d1714;
  --muted: #5d5048;
  --line: #1d1714;
  --red: #f05a42;
  --blue: #2474ff;
  --green: #19a974;
  --yellow: #ffd84d;
  --mint: #35d99d;
  --sky: #bdf0ff;
  --pink: #ff93b5;
  --shadow: 5px 5px 0 var(--ink);
}

html {
  background: var(--mint);
}

body {
  color: var(--ink);
  font-family:
    ui-rounded,
    "Arial Rounded MT Bold",
    "Trebuchet MS",
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 22%) 1px, transparent 1px),
    linear-gradient(0deg, rgb(255 255 255 / 18%) 1px, transparent 1px),
    var(--mint);
  background-size: 44px 44px;
}

body::before {
  content: none;
}

button,
input {
  letter-spacing: 0;
}

button {
  color: inherit;
}

.app-shell,
.game-shell {
  width: min(100%, 1160px);
  padding: clamp(12px, 3vw, 34px);
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0 18px;
  border: 0;
}

.masthead::after {
  display: none;
}

.eyebrow,
.panel-kicker {
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 5px 8px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--yellow);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

h1,
.game-header h1,
.item-copy h2,
.catalog-title,
.tile-copy strong {
  font-family: inherit;
  font-weight: 950;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  color: var(--ink);
  font-size: clamp(2.35rem, 5.8vw, 3.9rem);
  line-height: 0.9;
}

.lede {
  max-width: 560px;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 800;
}

.continue-panel,
.new-card-panel,
.player-card,
.empty-state,
.notice,
.score-pill,
.bingo-banner {
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.continue-panel,
.new-card-panel {
  margin: 18px 0;
  padding: clamp(14px, 3vw, 22px);
}

.continue-panel p,
.new-card-panel p,
.player-progress,
.empty-state p {
  color: var(--muted);
  font-weight: 800;
}

.continue-panel button,
.name-form button,
.back-button,
.sheet-close {
  min-height: 44px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 950;
}

.continue-panel button,
.name-form button {
  background: var(--yellow);
}

.back-button,
.sheet-close {
  padding: 0 13px;
  background: #ffffff;
}

.continue-panel button:hover,
.name-form button:hover,
.back-button:hover,
.sheet-close:hover,
.player-card:hover,
.catalog-card:hover,
.tile:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--ink);
}

.form-row input {
  min-height: 44px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 2px 2px 0 rgb(29 23 20 / 10%);
}

.name-form label {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.section-heading {
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--ink);
}

.section-heading h2 {
  font-size: 1.1rem;
  font-weight: 950;
}

.section-heading span,
.mini-badge {
  justify-content: center;
  min-width: 34px;
  min-height: 30px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--yellow);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 950;
}

.player-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.player-card {
  min-height: 104px;
}

.game-shell {
  gap: 16px;
}

.game-header {
  top: 0;
  z-index: 4;
  padding: 10px 0 14px;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 22%) 1px, transparent 1px),
    linear-gradient(0deg, rgb(255 255 255 / 18%) 1px, transparent 1px),
    var(--mint);
  background-size: 44px 44px;
}

.game-header h1 {
  font-size: clamp(1.35rem, 5vw, 2.8rem);
  line-height: 0.95;
}

.score-pill {
  min-width: 62px;
  min-height: 62px;
  background: var(--paper);
  transform: rotate(1.5deg);
}

.score-pill small {
  color: var(--muted);
}

.bingo-banner {
  background:
    linear-gradient(135deg, var(--yellow) 0 48%, var(--paper) 48% 100%);
}

.progress-track {
  height: 15px;
  border: 3px solid var(--ink);
  background: var(--paper);
}

.progress-track span {
  background: repeating-linear-gradient(
    -45deg,
    var(--green) 0 10px,
    #ffffff 10px 15px,
    var(--green) 15px 25px
  );
}

.board {
  width: min(100%, 980px);
  gap: clamp(5px, 1vw, 10px);
}

.tile {
  grid-template-rows: minmax(0, 1fr) 38px;
  min-height: 0;
  aspect-ratio: 0.76;
  padding: 4px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
}

.tile.is-free {
  background: var(--yellow);
}

.tile.is-seen {
  border-color: var(--ink);
  box-shadow:
    inset 0 0 0 4px var(--green),
    4px 4px 0 var(--ink);
}

.tile.is-seen::after {
  top: 7px;
  right: 5px;
  padding: 3px 5px;
  border: 2px solid var(--red);
  border-radius: 3px;
  background: var(--paper);
  color: var(--red);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.52rem;
  transform: rotate(-9deg);
}

.tile-art,
.catalog-art,
.item-illustration {
  display: grid;
  place-items: center;
}

.tile-art {
  min-height: 0;
  border: 0;
  border-radius: 4px;
  background: #fff3c4;
  background: color-mix(in srgb, var(--art-accent, var(--yellow)) 42%, #fffdf5);
}

.tile-art::before,
.tile-art::after,
.tile-art span,
.catalog-art::before,
.catalog-art::after,
.catalog-art span,
.item-illustration::before,
.item-illustration::after,
.item-illustration span::before,
.item-illustration span::after {
  display: none;
  content: none;
}

.tile-art.has-image,
.catalog-art.has-image,
.item-illustration.has-image {
  background: #ffffff;
}

.tile-art img,
.catalog-art img,
.item-illustration img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sketch-svg {
  width: 94%;
  height: 94%;
  overflow: visible;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 7;
}

.tile .sketch-svg {
  width: 96%;
  height: 96%;
  stroke-width: 6.8;
}

.catalog-art .sketch-svg {
  stroke-width: 7.5;
}

.item-illustration .sketch-svg {
  width: 88%;
  height: 88%;
  stroke-width: 5.8;
}

.sketch-svg circle,
.sketch-svg rect {
  vector-effect: non-scaling-stroke;
}

.tile-copy {
  align-content: center;
  padding: 4px 2px 0;
  border-top: 3px solid var(--ink);
}

.tile-copy strong {
  color: var(--ink);
  font-size: 0.61rem;
  line-height: 1.02;
  -webkit-line-clamp: 2;
}

.catalog-section {
  margin-top: 32px;
  padding-bottom: 46px;
}

.catalog-filters {
  gap: 14px;
  padding: 3px 0 16px;
}

.catalog-filter {
  min-height: 28px;
  padding: 0;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 950;
}

.catalog-filter.is-active {
  border-bottom-color: var(--ink);
  background: transparent;
  color: var(--ink);
}

.catalog-grid {
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 14px;
}

.catalog-card {
  position: relative;
  grid-template-columns: minmax(96px, 42%) minmax(0, 1fr);
  gap: 0;
  min-height: 170px;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--ink);
  color: var(--ink);
  text-align: left;
}

.catalog-card > div {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 12px;
}

.catalog-art {
  align-self: stretch;
  width: 100%;
  min-height: 164px;
  border: 0;
  border-right: 3px solid var(--ink);
  border-radius: 4px 0 0 4px;
  background: #fff3c4;
  background: color-mix(in srgb, var(--art-accent, var(--yellow)) 48%, #fffdf5);
}

.catalog-title {
  display: block;
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 0.98;
}

.catalog-clue {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.17;
}

.catalog-hook,
.catalog-category,
.item-copy ul {
  display: none;
}

.catalog-status {
  position: absolute;
  top: 8px;
  left: 8px;
  min-height: 22px;
  margin: 0;
  padding: 2px 6px;
  border: 2px solid var(--red);
  border-radius: 3px;
  background: var(--paper);
  color: var(--red);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 950;
  transform: rotate(-8deg);
}

.timeline-section {
  width: min(100%, 980px);
}

.timeline-event button {
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.timeline-event span,
.timeline-empty {
  color: var(--muted);
}

.timeline-dot {
  border-color: var(--ink);
  background: var(--paper);
}

.timeline-dot.is-seen {
  background: var(--green);
}

.timeline-dot.is-unseen {
  background: var(--red);
}

.item-sheet {
  background:
    linear-gradient(90deg, rgb(29 23 20 / 8%) 1px, transparent 1px),
    linear-gradient(0deg, rgb(29 23 20 / 6%) 1px, transparent 1px),
    var(--paper-warm);
  background-size: 42px 42px;
}

.item-sheet-scroll {
  width: min(100%, 1280px);
  padding: clamp(14px, 3vw, 42px);
}

.item-sheet-header {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 4px 0 12px;
  background: linear-gradient(180deg, var(--paper-warm) 70%, rgb(255 241 200 / 0));
}

.item-sheet-layout {
  min-height: calc(100vh - 144px);
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  gap: clamp(20px, 5vw, 64px);
  align-items: center;
}

.item-illustration {
  width: 100%;
  min-height: min(70vh, 760px);
  aspect-ratio: 4 / 3;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: #fff3c4;
  background: color-mix(in srgb, var(--art-accent, var(--yellow)) 54%, #fffdf5);
  box-shadow: 10px 10px 0 var(--ink);
}

.item-copy {
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 0;
}

.item-copy h2 {
  max-width: 11ch;
  color: var(--ink);
  font-size: clamp(2.1rem, 7vw, 5rem);
  line-height: 0.9;
}

.item-clue {
  max-width: 25rem;
  margin-top: 18px;
  color: var(--ink);
  font-size: clamp(1.2rem, 2.7vw, 2rem);
  font-weight: 950;
  line-height: 1.05;
}

.item-hook {
  max-width: 29rem;
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.34;
}

.seen-stamp {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  margin-top: 26px;
  padding: 12px;
  border: 5px solid var(--red);
  border-radius: 999px;
  background: var(--paper);
  color: var(--red);
  box-shadow: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-8deg);
}

.seen-stamp span {
  font-size: 1.45rem;
  line-height: 0.9;
}

.seen-stamp small {
  max-width: 74px;
  color: inherit;
  font-size: 0.58rem;
  line-height: 1.05;
}

.seen-stamp.is-seen {
  background: var(--red);
  color: var(--paper);
}

.seen-stamp:disabled {
  opacity: 0.66;
}

.item-state {
  margin-top: 22px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
}

.item-history {
  width: min(100%, 980px);
  margin: 32px auto 0;
}

@media (min-width: 760px) {
  .new-card-panel {
    grid-template-columns: minmax(0, 0.65fr) minmax(320px, 1fr);
  }

  .tile {
    grid-template-rows: minmax(0, 1fr) 46px;
    padding: 6px;
  }

  .tile-copy strong {
    font-size: 0.76rem;
  }
}

@media (max-width: 760px) {
  .item-sheet-layout {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 18px;
  }

  .item-illustration {
    min-height: min(42vh, 370px);
    aspect-ratio: 1;
    box-shadow: 6px 6px 0 var(--ink);
  }

  .item-copy h2 {
    max-width: 100%;
    font-size: clamp(2rem, 12vw, 3.8rem);
  }

  .item-clue {
    margin-top: 10px;
  }

  .item-hook {
    margin-top: 8px;
  }

  .seen-stamp {
    width: 116px;
    height: 116px;
    margin-top: 20px;
  }
}

@media (max-width: 520px) {
  .game-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .back-button {
    min-height: 40px;
    padding: 0 10px;
  }

  .score-pill {
    min-width: 54px;
    min-height: 54px;
  }

  .board {
    gap: 5px;
  }

  .tile {
    grid-template-rows: minmax(0, 1fr) 34px;
    padding: 3px;
  }

  .tile-copy {
    padding-top: 3px;
  }

  .tile-copy strong {
    font-size: 0.54rem;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .catalog-card {
    grid-template-columns: minmax(94px, 38%) minmax(0, 1fr);
    min-height: 142px;
  }

  .catalog-art {
    min-height: 136px;
  }

  .catalog-title {
    font-size: 1rem;
  }

  .catalog-clue {
    font-size: 0.82rem;
  }

  .item-sheet-scroll {
    padding: 12px;
  }
}
