:root {
  --accent-color: #2a9d8f;
  --input-bg: #323130;
  --input-color: #ece2d0;
  --input-picker: #222120;
  --option-hover-bg: #151514;
  --option-focus-bg: #0e0e0e;

  --nav-height: 62px;
  --panel-bg: rgba(255, 255, 255, .07);
  --panel-border: rgba(255, 255, 255, .13);
  --gold: #ffd166;
}

/* ---------- Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Segoe UI", Arial, sans-serif;
  min-height: 100vh;
  color: #fff;
  overflow-x: hidden;
}

/* ---------- Fullscreen slideshow ---------- */
.slideshow {
  position: fixed;
  inset: 0;
  z-index: -1;
}

.slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

/* Blurred fullscreen backdrop (fills any screen shape) */
.slide-bg {
  position: absolute;
  inset: -40px;                 /* hide blur edge artifacts */
  background-size: cover;
  background-position: center;
  filter: blur(20px) brightness(.55);
}

/* The poster, fullscreen edge-to-edge (horizontal/landscape images).
   `cover` fills the whole viewport; the blurred backdrop behind it
   only shows during transitions or for odd aspect ratios. */
.slide-fg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.slide.active { opacity: 1; }

.slideshow-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(10, 10, 25, 0.65), rgba(10, 10, 25, 0.8));
}

/* ---------- Main content ---------- */
.content {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Top padding clears the fixed nav so the title never sits under it. */
  padding: calc(var(--nav-height) + 32px) 20px 40px;
  text-align: center;
}

.title {
  /* Fluid: the long SEO headline must not wrap to three lines on a phone. */
  font-size: clamp(1.7rem, 6.5vw, 3rem);
  letter-spacing: 2px;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}

.subtitle {
  margin: 8px 0 32px;
  font-size: 1.2rem;
  opacity: .85;
}

/* ---------- Search bar ---------- */
.search-bar {
  display: flex;
  width: min(520px, 90vw);
  border-radius: 40px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
}

.search-bar input {
  flex: 1;
  padding: 14px 22px;
  border: none;
  outline: none;
  font-size: 1rem;
}

.search-bar button {
  padding: 14px 28px;
  border: none;
  background: #e63946;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.search-bar button:hover { background: #c1121f; }

.divider { margin: 28px 0 20px; opacity: .8; }

/* ---------- Filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: flex-end;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(6px);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.15);
}

.filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.filter label {
  font-size: .85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: .9;
}

/* Customizable select — adapted from https://codepen.io/sfrisk/pen/NPWELrw
   (uses Chrome's `appearance: base-select`; other browsers fall back
   to a normal styled dropdown automatically) */
.filter select {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 1rem;
  min-width: 150px;
  cursor: pointer;
  background-color: var(--input-bg);
  color: var(--input-color);
  border: 1px solid rgba(255, 255, 255, .25);
}

.filter select:focus {
  outline: 2px solid var(--accent-color);
  box-shadow: 0 0 4px 4px rgba(42, 157, 143, .45);
}

.filter select,
.filter select::picker(select) {
  appearance: base-select;
  color: var(--input-color);
}

.filter select::picker(select) {
  padding: 0.5rem;
  background: var(--input-picker);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
}

.filter select option {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
}

.filter select option:hover { background: var(--option-hover-bg); }

.filter select option:focus {
  background: var(--option-focus-bg);
  outline: 0;
  box-shadow: 0 0 2px 2px var(--accent-color);
}

.filter select option::checkmark {
  content: "\1F3B2"; /* 🎲 default */
  font-size: 1.1rem;
}

.filter select option.g-strategy::checkmark      { content: "\265F\FE0F"; }  /* ♟️ */
.filter select option.g-family::checkmark        { content: "\1F46A"; }       /* 👪 */
.filter select option.g-party::checkmark         { content: "\1F389"; }       /* 🎉 */
.filter select option.g-thematic::checkmark      { content: "\1F409"; }       /* 🐉 */
.filter select option.g-abstract::checkmark      { content: "\1F537"; }       /* 🔷 */
.filter select option.g-wargame::checkmark       { content: "\2694\FE0F"; }  /* ⚔️ */
.filter select option.g-children::checkmark      { content: "\1F9F8"; }       /* 🧸 */
.filter select option.g-customizable::checkmark  { content: "\1F0CF"; }       /* 🃏 */

.find-btn {
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  background: #2a9d8f;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.find-btn:hover { background: #21867a; }

/* ---------- Results ---------- */
.results {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(5, 5, 15, .92);
  overflow-y: auto;
  padding: 40px 20px;
}

.results.hidden { display: none; }

.results-inner {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}

.results h2 { margin-bottom: 24px; text-align: center; }

.close-btn {
  position: absolute;
  top: -10px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  opacity: .8;
}
.close-btn:hover { opacity: 1; }

.cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  display: flex;
  gap: 20px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 16px;
  align-items: center;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}

.card:hover {
  background: rgba(255,255,255,.13);
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.card img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #222;
}

.card .info { flex: 1; text-align: left; }

.card h3 { margin-bottom: 6px; font-size: 1.25rem; }

.card .year { opacity: .6; font-weight: 400; font-size: 1rem; }

.card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: .95rem;
  opacity: .9;
  margin-top: 6px;
}

.card .rating {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffd166;
  text-align: center;
  flex-shrink: 0;
  min-width: 80px;
}

.card .rating small {
  display: block;
  font-size: .7rem;
  font-weight: 400;
  opacity: .7;
}

.no-results { text-align: center; opacity: .8; font-size: 1.1rem; }

/* ---------- Game details modal ---------- */
.detail {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(5, 5, 15, .8);
  overflow-y: auto;
  padding: 5vh 20px;
}

.detail.hidden { display: none; }

.detail-card {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  background: #16151f;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 12px 48px rgba(0,0,0,.6);
}

.detail-card .close-btn { top: 8px; right: 14px; }

.detail-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.detail-header img {
  width: 220px;
  max-height: 220px;
  object-fit: contain;
  border-radius: 10px;
  background: #222;
  flex-shrink: 0;
}

.detail-head-info { flex: 1; text-align: left; }

.detail-head-info h2 { margin-bottom: 10px; font-size: 1.6rem; }

.detail-head-info .year { opacity: .6; font-weight: 400; font-size: 1.1rem; }

.detail-head-info .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: .95rem;
  opacity: .9;
}

.detail-rating {
  margin-top: 14px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffd166;
}

.detail-rating small { font-size: .85rem; font-weight: 400; opacity: .75; }

.detail-desc-title {
  margin-bottom: 10px;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: .8;
}

.detail-desc {
  white-space: pre-line;   /* keep paragraph breaks from BGG */
  line-height: 1.55;
  opacity: .92;
  text-align: left;
}

@media (max-width: 600px) {
  .detail-header { flex-direction: column; align-items: center; }
  .detail-head-info { text-align: center; }
  .detail-head-info .meta { justify-content: center; }
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
}

.pagination.hidden { display: none; }

.pagination button {
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  background: #2a9d8f;
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}

.pagination button:hover { background: #21867a; }

.pagination button:disabled {
  background: #444;
  cursor: default;
  opacity: .5;
}

.pagination span { opacity: .8; font-size: .95rem; }

@media (max-width: 600px) {
  .card { flex-direction: column; text-align: center; }
  .card .info { text-align: center; }
}

/* ================================================================
   Site chrome and content pages (About, Blog)
   ================================================================ */

/* ---------- Top navigation ---------- */
/* z-index sits below .results (10) and .detail (20) so the overlays
   on the landing page still cover it. */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--nav-height);
  padding: 0 clamp(16px, 4vw, 40px);
  background: linear-gradient(rgba(5, 5, 15, .7), rgba(5, 5, 15, 0));
}

body.page .site-nav {
  background: rgba(8, 8, 18, .72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-border);
}

.site-nav .brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .5px;
  white-space: nowrap;
  /* The landing page nav sits on bright artwork with no solid backing. */
  text-shadow: 0 1px 6px rgba(0, 0, 0, .85);
}

.nav-links {
  display: flex;
  gap: clamp(14px, 3vw, 28px);
}

.nav-links a {
  position: relative;
  color: #fff;
  text-decoration: none;
  font-size: .95rem;
  opacity: .8;
  padding: 4px 0;
  transition: opacity .15s;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .85);
}

.nav-links a:hover { opacity: 1; }

.nav-links a.active {
  opacity: 1;
  font-weight: 600;
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--accent-color);
  border-radius: 2px;
}

/* ---------- Content-page background ---------- */
/* Text needs a calmer backdrop than the landing hero. */
body.page .slideshow-overlay {
  background: linear-gradient(rgba(8, 8, 18, .88), rgba(8, 8, 18, .94));
}

body.page .slide-fg { filter: blur(3px); }

/* ---------- Page layout ---------- */
.page-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 48px) 20px 64px;
}

.back-link {
  margin-bottom: 24px;
  font-size: .9rem;
}

.back-link a {
  color: #fff;
  opacity: .7;
  text-decoration: none;
}

.back-link a:hover { opacity: 1; }

.page-head { margin-bottom: 44px; }

.eyebrow {
  color: var(--accent-color);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.page-head h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -.5px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}

.lead {
  margin-top: 18px;
  font-size: 1.15rem;
  line-height: 1.6;
  opacity: .85;
}

/* ---------- Long-form text (About + rendered Markdown) ---------- */
.prose {
  font-size: 1.05rem;
  line-height: 1.7;
  opacity: .93;
}

.prose > * + * { margin-top: 1.1em; }

.prose h2 {
  margin-top: 2.4em;
  margin-bottom: .2em;
  padding-bottom: .3em;
  font-size: 1.6rem;
  letter-spacing: -.3px;
  border-bottom: 1px solid var(--panel-border);
}

.prose h3 {
  margin-top: 1.9em;
  margin-bottom: -.3em;
  font-size: 1.2rem;
}

.prose h2:first-child,
.prose h3:first-child { margin-top: 0; }

.prose a {
  color: var(--accent-color);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover { color: #4bc0b1; }

.prose strong { color: #fff; }

.prose ul,
.prose ol { padding-left: 1.4em; }

.prose li + li { margin-top: .45em; }

.prose li::marker { color: var(--accent-color); }

.prose blockquote {
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent-color);
  font-style: italic;
  opacity: .9;
}

.prose code {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .1);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: .9em;
}

.prose pre {
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, .45);
  overflow-x: auto;
}

.prose pre code {
  padding: 0;
  background: none;
}

.prose hr {
  margin: 2.4em 0;
  border: none;
  border-top: 1px solid var(--panel-border);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

/* display:block lets a wide table scroll instead of stretching the page */
.prose table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}

.prose th,
.prose td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--panel-border);
}

.prose th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: .8;
  white-space: nowrap;
}

/* ---------- Card grids on the About page ---------- */
.feature-grid,
.usecase-grid {
  display: grid;
  gap: 16px;
  margin-top: 1.6em;
}

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

.feature,
.usecase {
  padding: 22px;
  border-radius: 14px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(6px);
}

.feature-icon {
  display: block;
  font-size: 1.7rem;
  margin-bottom: 10px;
}

.feature h3,
.usecase h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.feature p,
.usecase p {
  margin: 0;
  font-size: .97rem;
  line-height: 1.6;
  opacity: .85;
}

/* ---------- Blog index ---------- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-card {
  display: flex;
  gap: 22px;
  padding: 20px;
  border-radius: 14px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(6px);
  transition: background .15s, border-color .15s, transform .15s;
}

.post-card:hover {
  background: rgba(255, 255, 255, .12);
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.post-cover {
  flex-shrink: 0;
  width: 150px;
  height: 110px;
  border-radius: 10px;
  overflow: hidden;
  background: #222;
}

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

.post-body { flex: 1; min-width: 0; }

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: .65;
  margin-bottom: 10px;
}

.draft-flag {
  color: var(--gold);
  opacity: 1;
  font-weight: 700;
}

.post-card h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin-bottom: 8px;
}

.post-card h2 a {
  color: #fff;
  text-decoration: none;
}

.post-card h2 a:hover { color: var(--accent-color); }

.post-summary {
  font-size: .97rem;
  line-height: 1.6;
  opacity: .8;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  list-style: none;
  padding: 0;
}

.tags li {
  padding: 3px 11px;
  border-radius: 40px;
  background: rgba(42, 157, 143, .18);
  border: 1px solid rgba(42, 157, 143, .45);
  font-size: .78rem;
  letter-spacing: .5px;
  opacity: .95;
}

.article-tags { margin-top: 36px; }

.empty-state {
  text-align: center;
  opacity: .75;
  font-size: 1.1rem;
  padding: 40px 0;
}

/* ---------- Blog post ---------- */
.post-hero {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  margin-bottom: 40px;
}

.more-posts {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--panel-border);
}

.more-posts h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: .75;
  margin-bottom: 14px;
}

.more-posts ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.more-posts a {
  color: #fff;
  text-decoration: none;
  opacity: .85;
}

.more-posts a:hover {
  color: var(--accent-color);
  opacity: 1;
}

/* ---------- Call to action ---------- */
.cta {
  margin-top: 56px;
  padding: 32px 24px;
  text-align: center;
  border-radius: 16px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(6px);
}

.cta p {
  margin-bottom: 18px;
  font-size: 1.1rem;
  opacity: .9;
}

.cta-btn {
  display: inline-block;
  margin: 0 6px 8px;
  padding: 12px 30px;
  border-radius: 8px;
  background: var(--accent-color);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}

.cta-btn:hover { background: #21867a; }

.cta-btn.secondary {
  background: transparent;
  border: 1px solid var(--panel-border);
}

.cta-btn.secondary:hover { background: rgba(255, 255, 255, .1); }

/* ---------- Footer ---------- */
.site-footer {
  padding: 32px 20px 40px;
  text-align: center;
  font-size: .9rem;
  border-top: 1px solid var(--panel-border);
  background: rgba(5, 5, 15, .5);
}

.site-footer p + p { margin-top: 8px; }

.site-footer a {
  color: #fff;
  opacity: .8;
  text-decoration: none;
}

.site-footer a:hover {
  opacity: 1;
  color: var(--accent-color);
}

.footer-note { opacity: .55; font-size: .82rem; }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  /* The nav stacks into two rows here. Everything that offsets itself by
     --nav-height (.content, .page-wrap) picks the taller value up. */
  :root { --nav-height: 88px; }

  .site-nav {
    height: auto;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
  }

  .nav-links { font-size: .9rem; }

  .title { letter-spacing: .5px; }

  .post-card { flex-direction: column; }

  .post-cover { width: 100%; height: 160px; }
}
