:root {
  --ink: #07140f;
  --felt: #146b4a;
  --felt-mid: #0f5a3e;
  --felt-deep: #0a3d2b;
  --header: #0b0b0b;
  --gold: #f5d547;
  --gold-hover: #ffe56a;
  --hint: #7b5ad4;
  --hint-hover: #8d6de0;
  --btn-green: #2a8a5c;
  --btn-green-hover: #32a06b;
  --cream: #f7f4ee;
  --muted: #9eb8ac;
  --line: rgba(255, 255, 255, 0.1);
  --danger: #e0564a;
  --ok: #4ecf8a;
  --card-face: #fffcf6;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --font: "Outfit", "Segoe UI", sans-serif;
  --radius: 14px;
  --display: "Playfair Display", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
::selection { background: var(--gold); color: #111; }

body {
  font-family: var(--font);
  background: var(--ink);
  color: var(--cream);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hover); }
img { max-width: 100%; display: block; }
button, input { font-family: inherit; }

.wrap {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 56px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}
.brand:hover { color: #fff; }
.brand-accent { color: var(--gold); font-weight: 800; }
.brand-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: block;
}

nav.primary {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
nav.primary::-webkit-scrollbar { display: none; }
nav.primary a {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 16px 10px 14px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
nav.primary a:hover { color: #fff; }
nav.primary a.active {
  color: #fff;
  border-bottom-color: var(--gold);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 6px 12px;
  min-width: 168px;
  flex-shrink: 0;
}
.search::before { content: "⌕"; color: rgba(255, 255, 255, 0.45); font-size: 0.95rem; }
.search input {
  background: transparent;
  border: 0;
  outline: 0;
  color: #fff;
  width: 100%;
  font: inherit;
  font-size: 0.86rem;
}
.search input::placeholder { color: rgba(255, 255, 255, 0.4); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 700;
  cursor: pointer;
}

/* ——— Homepage hero ——— */
.hero {
  margin: 28px 0 8px;
  padding: 44px 48px 40px;
  border-radius: 24px;
  background:
    radial-gradient(700px 280px at 88% -20%, rgba(245, 213, 71, 0.18), transparent 55%),
    radial-gradient(520px 260px at 0% 120%, rgba(20, 107, 74, 0.55), transparent 60%),
    linear-gradient(165deg, #123528 0%, #0b1c16 48%, #10261c 100%);
  border: 1px solid rgba(232, 201, 122, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: center;
  overflow: hidden;
  position: relative;
}
.hero-visual {
  position: relative;
  min-height: 268px;
  pointer-events: none;
  display: grid;
  place-items: end center;
  padding-bottom: 4px;
}
.hero-visual img {
  width: min(100%, 460px);
  height: auto;
  display: block;
}

.eyebrow {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.66rem;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 4.8vw, 3.4rem);
  line-height: 1.08;
  margin: 10px 0 12px;
  font-weight: 700;
  letter-spacing: -0.03em;
  max-width: 12ch;
}
.lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 52ch;
  margin: 0;
}
.hero-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 18px;
  font-size: 0.88rem;
}
.quick-links a { color: rgba(255, 255, 255, 0.72); font-weight: 500; }
.quick-links a:hover { color: var(--gold); }
.hero-stats {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.stat {
  flex: 1 1 0;
  min-width: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
}
.stat b {
  display: block;
  font-size: 1.3rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}
.stat span { color: var(--muted); font-size: 0.72rem; font-weight: 500; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin: 0 0 18px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.55rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.section-head .eyebrow { margin-bottom: 6px; }
.section-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}
.section-link:hover { color: var(--gold-hover); }
.section-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.felt-panel {
  position: relative;
  margin: 28px 0 8px;
  padding: 22px 20px 20px;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
}
.felt-panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 0;
  border-radius: 16px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(232, 201, 122, 0.22);
}
.felt-panel > * { position: relative; z-index: 1; }
.featured-panel {
  background:
    radial-gradient(720px 240px at 18% -20%, rgba(245, 213, 71, 0.2), transparent 55%),
    radial-gradient(520px 260px at 100% 120%, rgba(10, 40, 28, 0.7), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E"),
    linear-gradient(165deg, #16744f 0%, #0d3d2b 48%, #0a281c 100%);
  border: 1px solid rgba(232, 201, 122, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 22px 48px rgba(0, 0, 0, 0.32);
}
.catalog-panel {
  background:
    radial-gradient(640px 220px at 90% -30%, rgba(245, 213, 71, 0.08), transparent 50%),
    linear-gradient(180deg, #10261c 0%, #0a1812 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.catalog-panel::before {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.cats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.chip {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}
.chip.active, .chip:hover {
  border-color: transparent;
  color: #111;
  background: var(--gold);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
}
.featured {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
}

.card {
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  color: var(--cream);
  background: #0c1c16;
  box-shadow: 0 0 0 1px rgba(232, 201, 122, 0.14), 0 14px 28px rgba(0, 0, 0, 0.36);
  isolation: isolate;
  transition: transform 0.22s cubic-bezier(.2, .8, .2, 1), box-shadow 0.22s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 1px rgba(245, 213, 71, 0.45),
    0 0 24px rgba(245, 213, 71, 0.08),
    0 20px 36px rgba(0, 0, 0, 0.48);
  color: var(--cream);
  outline: none;
}
@media (hover: none) {
  .card:hover, .card:focus-visible { transform: none; }
  .card-play { display: none; }
}
.card-cover {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #08140f;
}
.card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  border-radius: inherit;
  transition: box-shadow 0.25s ease;
}
.card:hover .card-cover::after,
.card:focus-visible .card-cover::after {
  box-shadow:
    inset 0 0 0 1px rgba(245, 213, 71, 0.28),
    inset 0 -48px 64px rgba(0, 0, 0, 0.22);
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(.2, .8, .2, 1), filter 0.35s ease;
}
.card:hover .card-cover img,
.card:focus-visible .card-cover img {
  transform: scale(1.04);
  filter: brightness(0.88) saturate(0.92);
}
.card--hot {
  box-shadow: 0 0 0 1px rgba(245, 213, 71, 0.38), 0 16px 32px rgba(0, 0, 0, 0.4);
}
.card--hot:hover, .card--hot:focus-visible {
  box-shadow: 0 0 0 1px rgba(245, 213, 71, 0.8), 0 24px 44px rgba(0, 0, 0, 0.55);
}
.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  background: var(--gold);
  color: #111;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}
.card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 3;
  opacity: 0;
  padding-bottom: 54px;
  background:
    radial-gradient(ellipse 90% 80% at 50% 35%, rgba(6, 18, 12, 0.05) 0%, rgba(6, 18, 12, 0.42) 100%),
    linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.55) 100%);
  transition: opacity 0.28s ease;
}
.card:hover .card-play,
.card:focus-visible .card-play { opacity: 1; }
.card-play span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px 7px 13px;
  border-radius: 999px;
  background: rgba(8, 20, 15, 0.88);
  border: 1px solid rgba(245, 213, 71, 0.62);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  transform: translateY(10px);
  transition: transform 0.28s cubic-bezier(.2, .8, .2, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover .card-play span,
.card:focus-visible .card-play span {
  transform: translateY(0);
  border-color: rgba(245, 213, 71, 0.88);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.48),
    0 0 16px rgba(245, 213, 71, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.card-play span::before {
  content: "";
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent var(--gold);
}
.card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: block;
  padding: 52px 16px 16px;
  background: linear-gradient(180deg, transparent 12%, rgba(0, 0, 0, 0.72) 100%);
}
.card--hot .card-body {
  padding: 56px 16px 18px;
  background: linear-gradient(180deg, transparent 10%, rgba(0, 0, 0, 0.78) 100%);
}
.card--hot .card-play { padding-bottom: 58px; }
.card-body h3 {
  margin: 0;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.28;
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}
.card-body h3::before {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  margin-bottom: 8px;
  border-radius: 2px;
  background: var(--gold);
}
.card--hot .card-body h3 {
  font-size: 1.02rem;
}

.layout { display: block; padding-bottom: 40px; }
.prose { color: var(--muted); font-size: 1.02rem; }
.prose h1, .prose h2, .prose h3 { color: var(--cream); }
.prose h1 { margin-top: 0; font-size: clamp(1.9rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; }
.crumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--gold); }

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 40px 0 48px;
  margin-top: 56px;
  color: var(--muted);
  font-size: 0.88rem;
  background: #050a08;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr repeat(3, 1fr);
  gap: 22px;
}
.site-footer strong { color: #fff; display: block; margin-bottom: 8px; font-weight: 700; }
.site-footer a { color: var(--muted); display: inline-block; margin: 3px 0; }
.site-footer a:hover { color: var(--gold); }

/* ——— Game play stage ——— */
body.play-page {
  background: var(--felt-deep);
}
body.play-page .site-footer { margin-top: 0; }

.play-stage {
  background: var(--felt-deep);
  padding: 20px 16px 28px;
}

.play-shell {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(280px, 980px) minmax(140px, 1fr);
  gap: 20px;
  align-items: start;
  max-width: 1480px;
  margin: 0 auto;
}

.ad-rail {
  min-height: 40px;
}

.play-table {
  color: var(--cream);
  background:
    radial-gradient(900px 320px at 50% -8%, rgba(255, 255, 255, 0.1), transparent 52%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--felt) 0%, var(--felt-mid) 58%, var(--felt-deep) 100%);
  background-blend-mode: normal, overlay, normal;
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 18px 40px rgba(12, 40, 28, 0.28);
  padding: 6px 22px 26px;
  min-height: 560px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.play-bar {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
  padding: 12px 0 14px;
}
.play-identity { flex: 1; min-width: 160px; }
.play-identity .crumbs { color: rgba(255, 255, 255, 0.55); margin-bottom: 2px; }
.play-identity .crumbs a { color: rgba(255, 255, 255, 0.55); }
.play-identity .crumbs a:hover { color: var(--gold); }
.play-identity h1 {
  font-size: 1.12rem;
  margin: 0;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: #fff;
}
.play-identity .lede { display: none; }

.hud:empty { display: none; }
.hud {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.86);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 0.88rem;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 6px 12px;
}
.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.btn {
  background: var(--btn-green);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 9px 15px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: background 0.15s ease, transform 0.12s ease;
}
.btn:hover { background: var(--btn-green-hover); }
.btn:active { transform: translateY(1px); }
a.btn { display: inline-flex; align-items: center; color: #fff; }
a.btn:hover { color: #fff; }
.hero .btn.primary, .hero a.btn.primary {
  background: var(--gold);
  color: #111;
}
.hero .btn.primary:hover, .hero a.btn.primary:hover {
  background: var(--gold-hover);
  color: #111;
}
.btn.primary {
  background: var(--btn-green);
  color: #fff;
}
.btn.undo {
  background: var(--gold);
  color: #1a1400;
}
.btn.undo:hover { background: var(--gold-hover); }
.btn.hint {
  background: var(--hint);
  color: #fff;
}
.btn.hint:hover { background: var(--hint-hover); }
.btn.ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.board-frame {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 4px 0 8px;
  min-height: 460px;
  box-shadow: none;
  overflow: auto;
}

.play-copy {
  padding: 36px 0 8px;
  background: var(--ink);
}
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 14px; }

.catalog-hero {
  padding: 36px 0 8px;
}
.catalog-hero h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 8px 0 10px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

@media (max-width: 1100px) {
  .featured { grid-template-columns: repeat(2, 1fr); }
  .play-shell {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .ad-rail { display: none; }
}
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 28px 24px 26px;
    margin-top: 20px;
    border-radius: 18px;
  }
  .hero h1 { max-width: none; }
  .hero-visual { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .search { display: none; }
  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
    min-height: 40px;
    align-items: center;
  }
  nav.primary {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 56px;
    background: #111;
    flex-direction: column;
    padding: 8px 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .site-header.open nav.primary { display: flex; overflow: visible; }
  nav.primary a { padding: 12px 4px; border-bottom: 0; min-height: 44px; }
  nav.primary a.active { color: var(--gold); }
  .header-inner { position: relative; }
  .game-toolbar { margin-left: 0; }
  .play-identity h1 { font-size: 1.05rem; }
  .play-table { padding: 4px 12px 18px; border-radius: 14px; min-height: 420px; }
  .play-stage { padding: 12px 10px 20px; }
  .hero-actions .btn { min-height: 44px; padding: 11px 18px; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 24px); }
  .grid, .related { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .felt-panel { padding: 16px 12px 14px; border-radius: 18px; margin-top: 20px; }
  .felt-panel::before { inset: 7px; border-radius: 12px; }
  .featured { gap: 12px; }
  .card-body { padding: 40px 12px 14px; }
  .section-head { margin-bottom: 14px; }
  .section-head h2 { font-size: 1.35rem; }
  .cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: 0;
    padding: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .cats::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; min-height: 38px; }
}
@media (max-width: 560px) {
  .hero { padding: 22px 16px 20px; border-radius: 16px; }
  .hero h1 { font-size: 2.05rem; }
  .lede { font-size: 0.98rem; }
  .hero-stats { gap: 8px; }
  .stat { padding: 8px 8px; }
  .stat b { font-size: 1.15rem; }
  .stat span { font-size: 0.64rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 18px; }
  .quick-links { gap: 8px 12px; }
  .card-badge { top: 8px; left: 8px; font-size: 0.58rem; padding: 3px 7px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .card-cover img { transition: none; }
  .card:hover, .card:focus-visible { transform: none; }
}
