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

/* ---------- 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;
  padding: 40px 20px;
  text-align: center;
}

.title {
  font-size: 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) {
  .title { font-size: 2rem; }
  .card { flex-direction: column; text-align: center; }
  .card .info { text-align: center; }
}
