/* scoutthings.com — design system
   Field-guide aesthetic: warm, outdoorsy, kid-forward, flat, rounded. */

:root {
  --rust-900: #712B13;
  --rust-700: #993C1D;
  --coral: #D85A30;
  --coral-300: #F0997B;
  --coral-200: #F5C4B3;
  --cream: #FAECE7;

  --forest-900: #173404;
  --forest-700: #27500A;
  --green: #639922;
  --green-300: #97C459;
  --green-200: #C0DD97;
  --mint: #EAF3DE;

  --amber-900: #633806;
  --amber-700: #854F0B;
  --amber: #BA7517;
  --amber-300: #EF9F27;
  --amber-200: #FAC775;
  --sand: #FAEEDA;

  --paper: #FBF7F2;
  --ink: #2C2A26;
  --muted: #7A736B;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;

  --max-width: 1120px;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.2; }

p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; cursor: pointer; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--coral);
  color: var(--cream);
}

.btn-secondary {
  background: transparent;
  color: var(--cream);
  border-color: var(--coral-300);
}

.btn-outline {
  background: transparent;
  color: var(--rust-700);
  border-color: var(--coral-300);
}

.btn-outline:hover { background: var(--cream); }

.btn svg { width: 18px; height: 18px; }

/* ---------- header ---------- */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--coral-200);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--rust-700);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark svg { width: 20px; height: 20px; }

.brand-word {
  font-weight: 500;
  font-size: 17px;
  color: var(--rust-900);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  font-size: 15px;
  color: var(--ink);
  font-weight: 400;
}

.main-nav a:hover { color: var(--rust-700); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 6px;
  color: var(--rust-900);
}

.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 720px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--coral-200);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 20px 16px;
  }

  .main-nav.open { display: flex; }

  .main-nav a {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid var(--cream);
  }

  .nav-toggle { display: inline-flex; }
}

/* ---------- hero ---------- */

.hero {
  background: var(--rust-900);
  color: var(--cream);
  padding: 64px 0 72px;
}

.hero .eyebrow { color: var(--coral-300); margin-bottom: 14px; }

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  max-width: 14ch;
}

.hero p.tagline {
  margin-top: 16px;
  font-size: 18px;
  color: var(--coral-200);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

/* ---------- sections ---------- */

section { padding: 56px 0; }

.section-head { margin-bottom: 28px; }

.section-head .eyebrow { color: var(--rust-700); display: block; margin-bottom: 8px; }

.section-head h2 { font-size: 28px; color: var(--ink); }

/* ---------- the trail (patch badges) ---------- */

.trail-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

@media (max-width: 720px) {
  .trail-row { grid-template-columns: repeat(3, 1fr); }
}

.patch-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.patch {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  border: 2px solid var(--coral-300);
  color: var(--rust-700);
  transition: transform 0.15s ease;
}

.patch svg { width: 34px; height: 34px; }

.patch-link:hover .patch { transform: translateY(-2px); }

.patch-current {
  background: var(--coral);
  border: 3px solid var(--rust-700);
  color: var(--cream);
}

.patch-name { font-size: 14px; font-weight: 500; color: var(--ink); }
.patch-grade { font-size: 12px; color: var(--muted); }

/* ---------- oath panel ---------- */

.oath-panel {
  background: var(--forest-900);
  color: var(--mint);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.oath-panel .eyebrow { color: var(--green-300); margin-bottom: 12px; }

.oath-panel blockquote {
  margin: 0;
  font-size: 19px;
  line-height: 1.55;
  color: var(--mint);
  max-width: 62ch;
}

.oath-panel .oath-motto {
  margin-top: 18px;
  font-weight: 500;
  color: var(--green-300);
}

.oath-panel .btn { margin-top: 24px; }

@media (max-width: 720px) {
  .oath-panel { padding: 28px; }
}

/* ---------- reference cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 720px) {
  .card-grid { grid-template-columns: 1fr; }
}

.ref-card {
  background: #fff;
  border: 1px solid var(--coral-200);
  border-radius: var(--radius-md);
  padding: 26px;
}

.ref-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--rust-700);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.ref-card-icon svg { width: 22px; height: 22px; }

.ref-card h3 { font-size: 17px; margin-bottom: 8px; }
.ref-card p { color: var(--muted); font-size: 14px; margin-bottom: 14px; }

.ref-card a.link {
  font-size: 14px;
  font-weight: 500;
  color: var(--rust-700);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ref-card a.link svg { width: 15px; height: 15px; }

/* ---------- trading post strip ---------- */

.trading-post {
  background: var(--sand);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.trading-post .eyebrow { color: var(--amber-700); }
.trading-post h2 { color: var(--amber-900); margin-top: 8px; }

.category-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

@media (max-width: 720px) {
  .category-tiles { grid-template-columns: 1fr; }
}

.category-tile {
  background: #fff;
  border: 1px solid var(--amber-200);
  border-radius: var(--radius-md);
  padding: 18px;
}

.category-tile h4 {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amber-700);
  margin-bottom: 10px;
}

.shop-item { padding: 8px 0; border-top: 1px solid var(--sand); }
.shop-item:first-child { border-top: none; padding-top: 0; }

.shop-item a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.shop-item a:hover { color: var(--amber-900); }

.shop-item p { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- year detail page ---------- */

.year-header {
  background: var(--rust-900);
  color: var(--cream);
  padding: 48px 0;
}

.year-header .wrap {
  display: flex;
  align-items: center;
  gap: 22px;
}

.year-header .patch {
  width: 88px;
  height: 88px;
  background: var(--coral);
  border: 3px solid var(--coral-300);
  color: var(--cream);
  flex-shrink: 0;
}

.year-header h1 { font-size: 34px; }

.year-header .year-meta {
  margin-top: 6px;
  color: var(--coral-200);
  font-size: 15px;
}

.year-header .current-flag {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--coral);
  color: var(--cream);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

@media (max-width: 640px) {
  .year-header .wrap { flex-direction: column; align-items: flex-start; }
}

/* milestones timeline */

.timeline { position: relative; padding-left: 28px; }

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--coral-200);
}

.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -28px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--coral-300);
}

.timeline-dot.done { background: var(--coral); border-color: var(--rust-700); }

.timeline-item h4 { font-size: 15px; font-weight: 500; }
.timeline-item time { font-size: 13px; color: var(--muted); }

.timeline-empty {
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
}

/* photo wall */

.photo-wall {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 720px) {
  .photo-wall { grid-template-columns: repeat(2, 1fr); }
}

.photo-tile {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--cream);
}

.photo-tile img { width: 100%; height: 100%; object-fit: cover; }

.photo-tile.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--coral-300);
  border: 1px dashed var(--coral-300);
}

.photo-tile.placeholder svg { width: 28px; height: 28px; }

.photo-wall-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

/* adventures earned */

.pill-row { display: flex; flex-wrap: wrap; gap: 10px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sand);
  color: var(--amber-900);
  border: 1px solid var(--amber-200);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
}

.pill svg { width: 15px; height: 15px; color: var(--amber-700); }

.pill-empty { color: var(--muted); font-size: 14px; }

/* prev/next nav */

.rank-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--coral-200);
  padding-top: 28px;
  margin-top: 12px;
}

.pager-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--rust-700);
  font-weight: 500;
}

.pager-link svg { width: 18px; height: 18px; }

.pager-link.next { margin-left: auto; text-align: right; }

.pager-spacer { flex: 1; }

/* ---------- gear / health / about / oath-law pages ---------- */

.page-header {
  background: var(--rust-900);
  color: var(--cream);
  padding: 48px 0;
}

.page-header h1 { font-size: 32px; }
.page-header p { margin-top: 10px; color: var(--coral-200); max-width: 52ch; }

.list-card {
  background: #fff;
  border: 1px solid var(--coral-200);
  border-radius: var(--radius-md);
  padding: 26px;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--cream);
  font-size: 15px;
}

.checklist li:first-child { border-top: none; }

.checklist svg { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; margin-top: 2px; }

.print-btn { margin-top: 20px; }

@media print {
  .site-header, .site-footer, .print-btn { display: none; }
}

/* ---------- campfire story ---------- */

.campfire-panel {
  background: var(--forest-900);
  color: var(--mint);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.campfire-panel .eyebrow { color: var(--green-300); margin-bottom: 12px; }
.campfire-panel h2 { color: var(--mint); font-size: 26px; margin-bottom: 10px; }
.campfire-panel > p { color: var(--green-200); max-width: 56ch; margin-bottom: 28px; }

.story-form { display: grid; gap: 18px; max-width: 420px; }

.field-group { display: flex; flex-direction: column; gap: 6px; }

.field-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--green-300);
}

.meal-panel .field-group label { color: var(--amber-300); }

.field-group input[type="text"],
.field-group input[type="number"],
.field-group select {
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--green-200);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
}

.meal-panel .field-group input[type="number"],
.meal-panel .field-group select {
  border-color: var(--amber-200);
}

.field-group input[type="text"]:focus,
.field-group input[type="number"]:focus,
.field-group select:focus {
  outline: 2px solid var(--green-300);
  outline-offset: 1px;
}

.meal-panel .field-group input:focus,
.meal-panel .field-group select:focus {
  outline-color: var(--amber-300);
}

.story-form .btn-primary {
  background: var(--green);
  color: var(--forest-900);
  justify-self: start;
  margin-top: 4px;
}

.story-error {
  background: rgba(216, 90, 48, 0.16);
  border: 1px solid var(--coral-300);
  color: var(--coral-200);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 20px;
}

.story-result {
  background: rgba(250, 247, 242, 0.06);
  border: 1px solid var(--green-700);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-top: 8px;
}

.story-result h3 {
  color: var(--amber-300);
  font-size: 20px;
  margin-bottom: 14px;
}

.story-result .story-body {
  white-space: pre-wrap;
  line-height: 1.7;
  color: var(--mint);
  font-size: 15px;
}

.story-again { margin-top: 24px; }

/* ---------- meal planner ---------- */

.meal-panel {
  background: var(--amber-900);
  color: var(--sand);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.meal-panel .eyebrow { color: var(--amber-300); margin-bottom: 12px; }
.meal-panel h2 { color: var(--sand); font-size: 26px; margin-bottom: 10px; }
.meal-panel > p { color: var(--amber-200); max-width: 56ch; margin-bottom: 28px; }

.meal-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  max-width: 520px;
}

.meal-form .btn-primary {
  background: var(--amber-300);
  color: var(--amber-900);
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 4px;
}

.meal-result {
  background: #fff;
  border: 1px solid var(--amber-200);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-bottom: 8px;
}

.meal-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.meal-result-head h3 { font-size: 22px; color: var(--rust-900); }

.meal-safe-pill { background: var(--mint); border-color: var(--green-200); color: var(--forest-700); flex-shrink: 0; }
.meal-safe-pill svg { color: var(--green); }

.meal-closest-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

.meal-tags {
  display: flex;
  gap: 10px;
  margin: 16px 0 24px;
  flex-wrap: wrap;
}

.meal-tag {
  background: var(--sand);
  color: var(--amber-900);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.meal-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 720px) {
  .meal-columns { grid-template-columns: 1fr; }
  .meal-form { grid-template-columns: 1fr; }
}

.meal-columns h4 {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amber-700);
  margin-bottom: 12px;
}

.meal-ingredients li {
  font-size: 14px;
  padding: 6px 0;
  border-top: 1px solid var(--cream);
}
.meal-ingredients li:first-child { border-top: none; }

.meal-gear { margin-top: 12px; margin-bottom: 8px; }
.meal-gear.pill-row .pill { font-size: 12px; padding: 5px 12px; }

.meal-instructions {
  list-style: decimal;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meal-instructions li { font-size: 14px; line-height: 1.5; }

/* ---------- footer ---------- */

.site-footer {
  background: var(--paper);
  border-top: 1px solid var(--coral-200);
  padding: 36px 0;
}

.site-footer .footer-line {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 10px;
}

.site-footer .disclosure {
  font-size: 12px;
  color: var(--muted);
  max-width: 68ch;
  margin-top: 4px;
}

/* ---------- games hub ---------- */

.game-card-grid {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  .game-card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .game-card-grid { grid-template-columns: 1fr; }
}

a.game-card {
  display: block;
  transition: transform 0.15s ease;
}

a.game-card:hover { transform: translateY(-2px); }

/* ---------- shared game panel ---------- */

.game-panel {
  background: #fff;
  border: 1px solid var(--coral-200);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 640px;
}

.game-status {
  font-size: 15px;
  font-weight: 500;
  color: var(--rust-700);
  margin-bottom: 18px;
  min-height: 20px;
}

.game-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 14px;
  cursor: pointer;
}

.game-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* ---------- tic-tac-toe ---------- */

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 84px);
  grid-template-rows: repeat(3, 84px);
  gap: 8px;
  margin-bottom: 20px;
}

.ttt-cell {
  background: var(--cream);
  border: 1px solid var(--coral-200);
  border-radius: var(--radius-sm);
  font-size: 34px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ttt-cell:disabled { cursor: default; }
.ttt-cell.ttt-x { color: var(--rust-700); }
.ttt-cell.ttt-o { color: var(--forest-700); }
.ttt-cell.ttt-win { background: var(--coral-200); }

/* ---------- playing cards (war + solitaire) ---------- */

.card-face {
  width: 66px;
  height: 94px;
  background: #fff;
  border: 1px solid var(--coral-200);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(44, 42, 38, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  font-size: 13px;
  font-weight: 600;
}

.card-face span:last-child { align-self: flex-end; transform: rotate(180deg); }
.card-face-suit { align-self: center !important; font-size: 20px; transform: none !important; }

.card-face.red { color: #C0392B; }
.card-face.black { color: var(--ink); }

.card-back {
  width: 66px;
  height: 94px;
  border-radius: 8px;
  background: var(--rust-700);
  border: 1px solid var(--rust-900);
  background-image: repeating-linear-gradient(45deg, var(--coral) 0, var(--coral) 6px, var(--rust-700) 6px, var(--rust-700) 12px);
}

.card-slot {
  width: 66px;
  height: 94px;
  border-radius: 8px;
  border: 1.5px dashed var(--coral-300);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--coral-300);
  font-size: 22px;
}

/* ---------- war ---------- */

.war-table {
  display: flex;
  gap: 32px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.war-side h4 {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 10px;
}

.war-card-slot { display: flex; gap: 8px; }

.war-log {
  margin-top: 20px;
  border-top: 1px solid var(--cream);
  padding-top: 14px;
}

.war-log li {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0;
}

/* ---------- checkers ---------- */

.ck-scoreline {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.ck-board {
  display: grid;
  grid-template-columns: repeat(8, 44px);
  grid-template-rows: repeat(8, 44px);
  border: 2px solid var(--rust-900);
  width: max-content;
  margin-bottom: 20px;
}

.ck-square {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ck-light { background: var(--sand); }
.ck-dark { background: var(--rust-700); }
.ck-square.ck-legal::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green-300);
  opacity: 0.85;
}
.ck-square.ck-selected { box-shadow: inset 0 0 0 3px var(--amber-300); }

.checker-piece {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  box-shadow: 0 2px 3px rgba(0,0,0,0.35);
}

.checker-piece.red { background: var(--coral); border: 2px solid var(--rust-900); }
.checker-piece.black { background: var(--ink); border: 2px solid #000; }
.checker-piece.king::after {
  content: "★";
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 15px;
  color: var(--amber-300);
}

/* ---------- chess ---------- */

.cx-layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.cx-board-wrap { position: relative; }

.cx-board {
  display: grid;
  grid-template-columns: repeat(8, 52px);
  grid-template-rows: repeat(8, 52px);
  border: 2px solid var(--rust-900);
  width: max-content;
}

.cx-square {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.cx-light { background: var(--sand); }
.cx-dark { background: var(--rust-700); }
.cx-square.cx-selected { box-shadow: inset 0 0 0 3px var(--amber-300); }
.cx-square.cx-check { box-shadow: inset 0 0 0 3px var(--coral); }
.cx-square.cx-legal::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green-300);
  opacity: 0.75;
}

.chess-piece { font-size: 36px; line-height: 1; user-select: none; }
.chess-piece.white { color: var(--cream); -webkit-text-stroke: 1.5px var(--ink); }
.chess-piece.black { color: var(--ink); }
.chess-piece.small { font-size: 18px; }

.cx-captured { min-width: 90px; }
.cx-captured-label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 8px; }
.cx-captured-row { display: flex; flex-wrap: wrap; gap: 2px; }

.chess-promotion {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(250, 247, 242, 0.95);
  border-radius: var(--radius-sm);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.chess-promotion.open { display: flex; }

.chess-promotion button {
  background: var(--cream);
  border: 1px solid var(--coral-300);
  border-radius: var(--radius-full);
  padding: 8px 20px;
  font-size: 16px;
}

/* ---------- solitaire ---------- */

.sol-top-row {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.sol-spacer { flex: 1; min-width: 20px; }

.sol-pile { position: relative; }

.sol-tableau-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.sol-tableau-pile {
  position: relative;
  width: 66px;
  min-height: 94px;
}

.sol-card-slot {
  position: absolute;
  left: 0;
  right: 0;
}

.sol-card-slot .selected { box-shadow: 0 0 0 3px var(--amber-300); }

/* ---------- 404 ---------- */

.error-page {
  padding: 96px 0;
  text-align: center;
}

.error-page .eyebrow { color: var(--rust-700); }
.error-page h1 { font-size: 30px; margin-top: 10px; }
.error-page p { margin-top: 12px; color: var(--muted); }
.error-page .btn { margin-top: 24px; }
