/* Layout concept: a game-night table. A deep collard-green header band holds a fanned hand of
   three game cards; below it, plain sections read like the rules sheet inside the box. */
:root {
  --bg: #fffcf5;
  --surface: #ffffff;
  --ink: #14201b;
  --muted: #4e5b55;
  --line: #e3ded2;
  --band: #0e4a36;
  --on-band: #fff6e0;
  --on-band-muted: #c9d8cf;
  --gold: #f4b63f;
  --coral: #e2553a;
  --focus: #1f6fd1;
  /* Card faces stay printed-white in both themes, like a real deck */
  --card-face: #ffffff;
  --card-ink: #14201b;
  --card-shadow: 0 18px 40px rgba(8, 28, 20, 0.35);

  --font-display: "Bowlby One", "Arial Black", "Helvetica Neue", Impact, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.7rem;
  --step-3: clamp(2rem, 5vw, 2.8rem);
  --step-4: clamp(2.5rem, 7.5vw, 4.4rem);

  --radius: 14px;
  --wrap: 72rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1512;
    --surface: #14201b;
    --ink: #f2eee4;
    --muted: #a9b5ae;
    --line: #26342d;
    --band: #0f3a2b;
    --on-band: #fff6e0;
    --on-band-muted: #b9cbc1;
    --gold: #f6c25b;
    --coral: #f07457;
    --focus: #7fb2ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1512;
  --surface: #14201b;
  --ink: #f2eee4;
  --muted: #a9b5ae;
  --line: #26342d;
  --band: #0f3a2b;
  --on-band: #fff6e0;
  --on-band-muted: #b9cbc1;
  --gold: #f6c25b;
  --coral: #f07457;
  --focus: #7fb2ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}
img { max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.1; text-wrap: balance; margin: 0; }
h1, h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.005em; }
h3 { font-size: var(--step-1); font-weight: 800; }
p { margin: 0; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--gold); color: var(--card-ink);
  padding: 8px 14px; border-radius: 8px; z-index: 20; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header { background: var(--band); color: var(--on-band); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px; padding-block: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.02em; line-height: 1.05; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; font-weight: 600; color: var(--on-band-muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--on-band); text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 3px; }

/* ---------- Hero ---------- */
.hero { background: var(--band); color: var(--on-band); overflow: hidden; }
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 40px; align-items: center; padding-block: 40px 72px;
}
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.hero .eyebrow { color: var(--gold); }
.hero h1 { font-size: var(--step-4); }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero-lede { font-size: var(--step-1); color: var(--on-band-muted); max-width: 34ch; line-height: 1.45; }

/* The fanned hand of cards */
.hand { position: relative; height: 360px; min-width: 0; }
.game-card {
  position: absolute; left: 50%; top: 50%;
  width: min(220px, 58vw); aspect-ratio: 5 / 7; max-width: 100%;
  background: var(--card-face); color: var(--card-ink);
  border-radius: 16px; box-shadow: var(--card-shadow);
  padding: 18px; display: flex; flex-direction: column; gap: 10px;
  transform-origin: 50% 120%;
  transition: transform 0.35s ease;
}
.game-card .card-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; }
.game-card .card-big { font-family: var(--font-display); font-size: 1.55rem; line-height: 1.05; }
.game-card .card-small { font-size: 0.86rem; line-height: 1.35; }
.game-card .card-foot { margin-top: auto; font-family: var(--font-mono); font-size: 0.7rem; opacity: 0.7; }
.game-card .stripe { height: 8px; border-radius: 4px; }
.card-vote { transform: translate(-50%, -50%) translateX(-34%) rotate(-12deg); }
.card-decode { transform: translate(-50%, -50%) translateY(-6%); z-index: 2; }
.card-sing { transform: translate(-50%, -50%) translateX(34%) rotate(12deg); }
.hand:hover .card-vote { transform: translate(-50%, -50%) translateX(-44%) rotate(-16deg); }
.hand:hover .card-sing { transform: translate(-50%, -50%) translateX(44%) rotate(16deg); }
.card-vote .stripe { background: #e2553a; }
.card-decode .stripe { background: #f4b63f; }
.card-sing .stripe { background: #0e4a36; }
.vote-options { display: grid; gap: 6px; font-size: 0.85rem; }
.vote-options span { border: 1.5px solid #14201b; border-radius: 8px; padding: 4px 8px; font-weight: 700; }
.letters { font-family: var(--font-display); font-size: 2.1rem; letter-spacing: 0.06em; line-height: 1; }

/* ---------- Store buttons ---------- */
.store-row { display: flex; flex-wrap: wrap; gap: 12px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 18px 10px 14px;
  border-radius: 12px; text-decoration: none;
  background: #000000; color: #ffffff; border: 1.5px solid rgba(255, 255, 255, 0.35);
  font-family: var(--font-body);
}
.store-btn svg { width: 26px; height: 26px; flex: none; }
.store-btn .small { display: block; font-size: 0.72rem; line-height: 1.1; opacity: 0.85; }
.store-btn .big { display: block; font-size: 1.12rem; font-weight: 700; line-height: 1.15; }
.store-btn[aria-disabled="true"] { cursor: default; }
.store-note { font-size: var(--step--1); color: var(--on-band-muted); }
.store-note a { color: var(--on-band); }

/* ---------- Sections ---------- */
main section { padding-block: 64px; }
.section-head { display: grid; gap: 12px; max-width: 46rem; margin-bottom: 32px; }
.section-head .eyebrow { color: var(--coral); }
.section-head h2 { font-size: var(--step-3); }
.section-head p { color: var(--muted); font-size: var(--step-1); line-height: 1.5; }

.games-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.game-tile {
  display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; min-width: 0;
}
.game-tile .tag {
  justify-self: start; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line);
}
.game-tile h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--step-2); }
.game-tile p { color: var(--muted); }
.game-tile .facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--step--1); color: var(--muted); font-family: var(--font-mono); }
.text-link { font-weight: 700; color: var(--ink); text-decoration-color: var(--coral); text-decoration-thickness: 2px; }

.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.mode { border-top: 4px solid var(--gold); padding-top: 18px; display: grid; gap: 10px; min-width: 0; }
.mode:nth-child(2) { border-top-color: var(--coral); }
.mode p { color: var(--muted); }
.mode ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }

.occasions { background: var(--surface); border-block: 1px solid var(--line); }
.occasion-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.occasion-list li {
  font-weight: 700; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--ink);
}

.faq { display: grid; gap: 12px; max-width: 48rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.faq summary { font-weight: 700; cursor: pointer; font-size: var(--step-1); line-height: 1.35; }
.faq details p { margin-top: 10px; color: var(--muted); }

.cta-band { background: var(--band); color: var(--on-band); }
.cta-band .wrap { display: grid; gap: 20px; justify-items: start; }
.cta-band h2 { font-size: var(--step-3); }
.cta-band p { color: var(--on-band-muted); max-width: 40rem; }

/* ---------- Rules pages ---------- */
.page-hero { background: var(--band); color: var(--on-band); }
.page-hero .wrap { display: grid; gap: 14px; padding-block: 36px 48px; }
.page-hero .eyebrow { color: var(--gold); }
.page-hero h1 { font-size: var(--step-4); }
.page-hero p { color: var(--on-band-muted); font-size: var(--step-1); max-width: 40rem; line-height: 1.45; }
.quick-facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 6px 0 0; padding: 0; }
.quick-facts li { font-family: var(--font-mono); font-size: var(--step--1); padding: 4px 12px; border-radius: 999px; border: 1px solid var(--on-band-muted); }

.rules { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); gap: 48px; align-items: start; }
.rules-body { display: grid; gap: 40px; min-width: 0; }
.rules-body section { padding: 0; display: grid; gap: 14px; }
.rules-body h2 { font-size: var(--step-2); }
.rules-body p, .rules-body li { max-width: 65ch; }
.rules-body ol, .rules-body ul { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; }
.rules-body .callout { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.score-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.score-table th, .score-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.score-table th { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.sample-cards { display: grid; gap: 14px; position: sticky; top: 24px; }
.sample-cards h2 { font-size: var(--step-1); font-family: var(--font-body); font-weight: 800; }
.sample {
  background: var(--card-face); color: var(--card-ink); border-radius: 14px; padding: 16px;
  border: 1px solid var(--line); display: grid; gap: 8px; box-shadow: 0 6px 18px rgba(8, 28, 20, 0.12);
}
.sample .card-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.sample .card-big { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.1; }
.sample .stripe { height: 6px; border-radius: 3px; }
.other-games { display: flex; flex-wrap: wrap; gap: 10px 22px; }

/* ---------- Plain text pages ---------- */
.prose { max-width: 46rem; display: grid; gap: 18px; }
.prose h2 { font-size: var(--step-2); margin-top: 16px; }
.prose ul { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.prose .meta { color: var(--muted); font-family: var(--font-mono); font-size: var(--step--1); }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.copy-row code { font-family: var(--font-mono); background: var(--surface); border: 1px solid var(--line); padding: 6px 10px; border-radius: 8px; user-select: all; }
.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  padding: 8px 16px; border-radius: 10px; border: 1.5px solid var(--ink); background: var(--gold); color: var(--card-ink);
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-block: 28px 40px; color: var(--muted); font-size: var(--step--1); }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 0; padding: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); padding-block: 24px 48px; }
  .hand { height: 330px; }
  .games-grid { grid-template-columns: minmax(0, 1fr); }
  .rules { grid-template-columns: minmax(0, 1fr); }
  .sample-cards { position: static; }
}
@media (max-width: 620px) {
  .modes { grid-template-columns: minmax(0, 1fr); }
  .game-card { width: min(160px, 42vw); padding: 12px; gap: 8px; }
  .game-card .card-big { font-size: 1.1rem; }
  .game-card .card-small { font-size: 0.78rem; }
  .vote-options { font-size: 0.75rem; }
  .letters { font-size: 1.6rem; }
  .card-vote { transform: translate(-50%, -50%) translateX(-30%) rotate(-10deg); }
  .card-sing { transform: translate(-50%, -50%) translateX(30%) rotate(10deg); }
  .hand { height: 270px; }
  main section { padding-block: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .game-card { transition: none; }
  .hand:hover .card-vote { transform: translate(-50%, -50%) translateX(-34%) rotate(-12deg); }
  .hand:hover .card-sing { transform: translate(-50%, -50%) translateX(34%) rotate(12deg); }
}
