/* =========================================================================
   Hex & Roll — Design System
   Warm, playful light theme for a board-game strategy & tools site.
   ========================================================================= */

:root {
  --bg: #fdf8ee;
  --bg-soft: #f6efe1;
  --surface: #ffffff;
  --surface-2: #fbf6ec;
  --ink: #2c241b;
  --ink-soft: #5a4f42;
  --muted: #8a7c6b;
  --border: #ece2cf;
  --border-strong: #ddcfb4;

  --accent: #e07a3f;      /* terracotta */
  --accent-dark: #c4632b;
  --teal: #2a9d8f;
  --gold: #e9c46a;

  --shadow-sm: 0 1px 3px rgba(60, 45, 25, 0.08);
  --shadow-md: 0 6px 20px rgba(60, 45, 25, 0.10);
  --shadow-lg: 0 14px 40px rgba(60, 45, 25, 0.14);
  --shadow-accent: 0 18px 42px -14px rgba(224, 122, 63, 0.30);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  --maxw: 1200px;
  --nav-h: 66px;

  --font: "Outfit", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", "Georgia", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 620px at 82% -8%, #fbeede 0%, transparent 56%),
    radial-gradient(1000px 520px at 0% 0%, #eef4f1 0%, transparent 52%),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

img { max-width: 100%; }

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

/* ---------------- Nav ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(253, 248, 238, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.22rem;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--ink);
  color: var(--gold);
  border-radius: 9px;
  font-size: 1.1rem;
  transform: rotate(-6deg);
}
.brand .sub { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}
.nav-links a {
  padding: 8px 13px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.95rem;
}
.nav-links a:hover { background: var(--bg-soft); text-decoration: none; color: var(--ink); }
.nav-links a.active { color: var(--accent-dark); background: #fbe9dd; }
.nav-search {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: var(--font);
  font-size: 0.9rem;
  width: 170px;
  color: var(--ink);
}
.nav-search:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 800;
  font-family: var(--font);
  font-size: 0.97rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  z-index: 1;
  padding: 88px 0 72px;
  min-height: 55vh;
  display: flex;
  align-items: center;
  background: url("../img/hero-bg.webp") center/cover no-repeat #1d120b;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background:
    linear-gradient(90deg, rgba(28, 22, 16, 0.90) 0%, rgba(28, 22, 16, 0.62) 42%, rgba(28, 22, 16, 0.22) 70%, transparent 100%),
    linear-gradient(0deg, rgba(28, 22, 16, 0.72) 0%, transparent 50%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background-image:
    radial-gradient(circle, rgba(255, 247, 236, 0.08) 1.4px, transparent 1.6px);
  background-size: 26px 26px;
  opacity: 0.55;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; max-width: 760px; }
.eyebrow {
  display: inline-block;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 5px 13px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.5rem);
  line-height: 1.08;
  margin: 0 0 18px;
  letter-spacing: -1px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.22);
}
.hero h1 .accent { color: #f7c86b; }
.hero p.lead {
  font-size: 1.18rem;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 28px;
  max-width: 620px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.18);
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-search {
  margin-top: 26px;
  display: flex;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.96);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.hero-search input {
  flex: 1; border: 0; background: transparent;
  font-family: var(--font); font-size: 1rem; color: var(--ink);
  outline: none;
}
.hero-search .btn { padding: 10px 18px; }
.hero .btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(2px);
}
.hero .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.85);
}

.stats {
  display: flex; gap: 30px; margin-top: 40px; flex-wrap: wrap;
}
.stat .n { font-size: 1.7rem; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 1px 6px rgba(0,0,0,0.18); }
.stat .l { font-size: 0.85rem; color: rgba(255, 255, 255, 0.72); font-weight: 700; }

/* ---------------- Section ---------------- */
section.block { padding: 68px 0; }
.section-head { margin-bottom: 28px; }
.section-head h1, .section-head h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  margin: 0 0 6px; font-weight: 900; letter-spacing: -0.5px;
}
.section-head p { color: var(--ink-soft); margin: 0; font-size: 1.04rem; }
/* News section: put the BoardGameGeek CTA beside the heading */
.news-head { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; }
.news-head > div { min-width: 0; }
.news-bgg { white-space: nowrap; flex: 0 0 auto; }
.center { text-align: center; }
.center .section-head { max-width: 620px; margin-left: auto; margin-right: auto; }

section[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* ---------------- Cards grid ---------------- */
.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
}
.card {
  background: linear-gradient(180deg, #fffdf9 0%, #fdf6ea 100%);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 1px 2px rgba(60, 45, 25, 0.05), 0 10px 30px -14px rgba(60, 45, 25, 0.20);
  transition: transform 0.18s cubic-bezier(.2, .7, .3, 1), box-shadow 0.22s ease, border-color 0.18s ease;
  display: flex; flex-direction: column;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 2px 4px rgba(60, 45, 25, 0.06), var(--shadow-accent);
  border-color: rgba(224, 122, 63, 0.25);
  text-decoration: none;
}
.card .emoji {
  font-size: 2rem;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--surface-2);
  margin-bottom: 14px;
}
.card h3 { margin: 0 0 4px; font-size: 1.18rem; font-weight: 800; }
.card .aka { color: var(--muted); font-size: 0.85rem; font-weight: 700; margin-bottom: 10px; }
.card .blurb { color: var(--ink-soft); font-size: 0.94rem; margin: 0 0 14px; flex: 1; }
.meta-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-size: 0.76rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--border);
}
.chip.accent { background: #fbe9dd; color: var(--accent-dark); border-color: #f1d3bf; }
.chip.teal { background: #e1f1ee; color: #1d7a6e; border-color: #c4e6e0; }

/* ---------------- Tool cards ---------------- */
.tool-card {
  border-left: 5px solid var(--accent);
}
.tool-card .ic {
  font-size: 1.7rem;
  width: 50px; height: 50px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: #fbe9dd;
}

/* ---------------- Filters ---------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-sm);
}
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-group label { font-size: 0.78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.filter-group select, .filter-group input {
  font-family: var(--font);
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--ink);
  min-width: 130px;
}
.filter-group select:focus, .filter-group input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.filter-result { font-weight: 800; color: var(--ink-soft); margin-bottom: 14px; }

/* ---------------- Game detail ---------------- */
.game-hero {
  display: flex; gap: 22px; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-md);
  margin-bottom: 30px;
}
.game-hero .big-emoji {
  font-size: 3.2rem;
  width: 92px; height: 92px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 20px;
  background: var(--surface-2);
}
.game-hero h1 { margin: 0; font-size: 2rem; font-weight: 900; letter-spacing: -0.5px; }
.game-hero .aka { color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.game-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.detail-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 30px;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.panel h2 { margin: 0 0 14px; font-size: 1.3rem; font-weight: 900; }
.panel h3 { margin: 22px 0 10px; font-size: 1.05rem; font-weight: 800; color: var(--accent-dark); }
.panel p { color: var(--ink-soft); margin: 0 0 12px; }
.guide-list { margin: 0; padding-left: 0; list-style: none; }
.guide-list li {
  position: relative;
  padding: 10px 0 10px 30px;
  border-bottom: 1px dashed var(--border);
  color: var(--ink-soft);
}
.guide-list li:last-child { border-bottom: 0; }
.guide-list li::before {
  content: "✦";
  position: absolute; left: 4px; top: 10px;
  color: var(--accent);
  font-weight: 900;
}

/* ---------------- Calculator ---------------- */
.calc {
  background: linear-gradient(160deg, #fff 0%, #fdf4ea 100%);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-md);
}
.calc h3 { margin: 0 0 4px; font-size: 1.2rem; font-weight: 900; }
.calc .hint { color: var(--muted); font-size: 0.86rem; margin-bottom: 16px; }
.calc-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.calc-row:last-of-type { border-bottom: 0; }
.calc-row label { font-weight: 700; color: var(--ink-soft); font-size: 0.95rem; }
.calc-row .ctrl { display: flex; align-items: center; gap: 8px; }
.calc-row input[type="number"] {
  width: 70px; text-align: center;
  font-family: var(--font); font-size: 0.95rem; font-weight: 800;
  padding: 7px 6px;
  border: 1.5px solid var(--border-strong); border-radius: 9px;
  background: var(--surface); color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.calc-row input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.step-btn {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1.5px solid var(--border-strong); background: var(--surface-2);
  font-weight: 900; font-size: 1.1rem; cursor: pointer; color: var(--ink-soft);
  line-height: 1;
}
.step-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.calc-output {
  margin-top: 16px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex; align-items: baseline; justify-content: space-between;
}
.calc-output .big { font-size: 2rem; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.calc-output .label { font-size: 0.82rem; opacity: 0.8; font-weight: 700; }
.calc-note { margin-top: 10px; font-size: 0.85rem; color: var(--teal); font-weight: 800; }
.calc-note.warn { color: var(--accent-dark); }

/* ---------------- Recommend engine ---------------- */
.reco-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.reco-form .field { display: flex; flex-direction: column; gap: 7px; }
.reco-form label { font-weight: 800; font-size: 0.85rem; color: var(--ink-soft); }
.reco-form select {
  font-family: var(--font); font-size: 0.98rem; padding: 11px 12px;
  border-radius: 10px; border: 1.5px solid var(--border-strong);
  background: var(--surface-2); color: var(--ink);
}
.reco-form select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.reco-form .submit { align-self: end; }
.match-badge {
  font-size: 0.78rem; font-weight: 900;
  padding: 3px 10px; border-radius: 999px;
  background: #e1f1ee; color: #1d7a6e;
}
.match-badge.good { background: #d8f0d2; color: #2f7d2a; }
.match-badge.perfect { background: var(--gold); color: #5a4a14; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tab {
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  font-weight: 800; font-size: 0.9rem; border: 1.5px solid var(--border-strong);
  background: var(--surface-2); color: var(--ink-soft);
}
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab:hover { text-decoration: none; }

/* ---------------- Footer ---------------- */
.footer {
  margin-top: 50px;
  background: var(--ink);
  color: #efe7d8;
}
.footer .wrap { padding: 40px 20px; }
.footer .cols { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }
.footer h4 { color: var(--gold); font-size: 0.95rem; margin: 0 0 12px; letter-spacing: 0.4px; }
.footer a { color: #d9cdb8; display: block; padding: 3px 0; font-size: 0.92rem; }
.footer a:hover { color: #fff; }
.footer .brand-foot { font-weight: 900; font-size: 1.2rem; color: #fff; }
.footer .copy { margin-top: 26px; padding-top: 18px; border-top: 1px solid #43392c; font-size: 0.82rem; color: #b3a892; }

/* ---------------- Misc ---------------- */
.tag-row { display:flex; gap:8px; flex-wrap:wrap; margin-top:6px; }
.pill { font-size:0.72rem; font-weight:800; padding:3px 9px; border-radius:999px; background:var(--bg-soft); border:1px solid var(--border); color:var(--ink-soft); }
.empty { text-align:center; color: var(--muted); padding: 50px 0; font-weight:700; }
.note-banner {
  background: #fff7ec; border: 1px solid #f0dcbf; color: var(--accent-dark);
  border-radius: var(--radius-sm); padding: 14px 18px; font-weight: 700; margin-bottom: 24px;
}

@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; }
  .nav-search { display: none; }
  .game-hero { flex-direction: column; }
}
@media (max-width: 560px) {
  .nav-links a { padding: 8px 9px; font-size: 0.85rem; }
  .stats { gap: 18px; }
}

/* ---------------- News ---------------- */
.news { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ticker {
  display: flex; align-items: center; gap: 14px;
  background: var(--ink); color: #fff;
  border-radius: 999px; padding: 11px 18px 11px 18px;
  overflow: hidden; margin-bottom: 22px; box-shadow: var(--shadow-sm);
}
.ticker-label {
  flex: 0 0 auto; font-weight: 900; font-size: 0.78rem; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 7px;
  padding-right: 14px; border-right: 1px solid #43392c; white-space: nowrap;
}
.ticker-view {
  flex: 1; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 26px, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 26px, #000 calc(100% - 26px), transparent);
}
.tk-track {
  display: inline-flex; align-items: center; white-space: nowrap;
  animation: tk-scroll 42s linear infinite;
}
.ticker-view:hover .tk-track { animation-play-state: paused; }
.tk-item { color: #f3ead9; font-weight: 700; font-size: 0.92rem; padding: 0 4px; }
.tk-item:hover { color: var(--gold); text-decoration: none; }
.tk-dot { color: var(--accent); margin-right: 7px; }
.tk-sep { color: #6b5e4a; margin: 0 18px; }
@keyframes tk-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.news-status { font-size: 0.82rem; font-weight: 800; margin-bottom: 16px; color: var(--muted); }
.news-spin { color: var(--muted); }
.news-live { color: var(--teal); }
.news-curated { color: var(--accent-dark); }

.news-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.news-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; flex-direction: column;
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  text-decoration: none;
}
.news-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.news-date { font-size: 0.76rem; font-weight: 800; color: var(--muted); }
.news-card h3 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 800; line-height: 1.3; color: var(--ink); }
.news-ex { color: var(--ink-soft); font-size: 0.9rem; margin: 0 0 12px; flex: 1; }
.news-read { font-size: 0.82rem; font-weight: 800; color: var(--accent-dark); }
