/* ==========================================================
   MOON HOME MEDIA - main stylesheet
   Brand palette lives in :root below.
   ========================================================== */

:root {
  /* Moon Home Media brand palette */
  --bg: #0B0D0F;          /* Deep Charcoal */
  --bg-soft: #14161a;
  --card: #1a1b1c;        /* between charcoal and Warm Graphite */
  --card-hover: #2A2A2A;  /* Warm Graphite */
  --line: rgba(201, 184, 147, 0.18);
  --stone: #6B6659;       /* borders/decoration only, not small text */
  --text: #E8D7B7;        /* Warm Ivory */
  --muted: #C9B893;       /* Muted Sand */
  --accent: #D4AF7C;      /* Champagne Gold */
  --accent-2: #E8D7B7;
  --font-heading: "Montserrat", "Avenir Next", Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 14px;
  --max: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(212, 175, 124, 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: min(var(--max), 92%); margin: 0 auto; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(11, 13, 15, 0.82);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo .mark { width: 40px; height: 40px; flex: none; }
.wordmark { display: flex; flex-direction: column; line-height: 1; font-family: var(--font-heading); text-transform: uppercase; }
.wordmark b { font-weight: 600; font-size: 0.95rem; letter-spacing: 0.2em; color: var(--text); }
.wordmark i { font-style: normal; font-weight: 500; font-size: 0.6rem; letter-spacing: 0.62em; color: var(--accent); margin-top: 6px; }

.nav-links { display: flex; gap: 6px; list-style: none; }

.nav-links a {
  display: block;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: 0.2s;
}

.nav-links a:hover { color: var(--text); background: rgba(212, 175, 124, 0.1); }
.nav-links a.active { color: var(--bg); background: var(--accent); }

.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  padding: 80px 0 90px;
  background:
    linear-gradient(90deg, rgba(11,13,15,.92) 0%, rgba(11,13,15,.55) 45%, rgba(11,13,15,0) 75%),
    linear-gradient(180deg, rgba(11,13,15,0) 70%, var(--bg) 100%),
    url("../images/brand/moon-dunes-hero.jpg") 70% center / cover no-repeat,
    var(--bg);
  border-bottom: 1px solid var(--line);
}

.hero .container { width: min(var(--max), 92%); }
.hero > .container > * { max-width: 560px; }

.eyebrow {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero h1 span { color: var(--accent); }

.hero p { color: var(--muted); margin: 0 0 30px; font-size: 1.05rem; }
.hero p.eyebrow { color: var(--accent); font-size: 0.72rem; margin-bottom: 18px; }

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: 0.2s;
  border: 1px solid transparent;
}

.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); background: var(--accent-2); box-shadow: 0 8px 24px rgba(212, 175, 124, 0.3); }
.btn-ghost { border-color: var(--accent); color: var(--accent); margin-left: 8px; }
.btn-ghost:hover { background: rgba(212, 175, 124, 0.12); color: var(--text); }

/* ---------- Sections ---------- */
.section { padding: 50px 0; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 26px;
  gap: 16px;
}

.section-head h2 { font-family: var(--font-heading); font-weight: 600; font-size: 1.25rem; letter-spacing: 0.12em; text-transform: uppercase; }
.section-head p { color: var(--muted); font-size: 0.95rem; }
.section-head a { color: var(--accent); font-size: 0.95rem; font-weight: 500; white-space: nowrap; }

/* ---------- Category tiles (home) ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: 0.25s;
}

.tile:hover { background: var(--card-hover); transform: translateY(-4px); border-color: rgba(212, 175, 124, 0.55); }
.tile .icon { color: var(--accent); margin-bottom: 16px; }
.line-icon { width: 34px; height: 34px; display: block; }
.tile h3 { font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px; }
.tile p { color: var(--muted); font-size: 0.92rem; }

/* ---------- Page title ---------- */
.page-title { padding: 56px 0 10px; }
.page-title h1 { font-family: var(--font-heading); font-weight: 600; font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: 0.1em; text-transform: uppercase; }
.page-title h1::after { content: ""; display: block; width: 56px; height: 2px; background: var(--accent); margin-top: 14px; }
.page-title p { color: var(--muted); margin-top: 6px; }

/* ---------- Toolbar (search + chips) ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin: 26px 0 8px;
}

.search {
  flex: 1 1 240px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.95rem;
  outline: none;
  transition: 0.2s;
}

.search:focus { border-color: var(--accent); }

.sort {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.sort:focus { border-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.2s;
}

.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }

/* ---------- Media grid + cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 22px;
  padding: 20px 0 60px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: 0.25s;
  display: flex;
  flex-direction: column;
}

.grid .card { content-visibility: auto; contain-intrinsic-size: auto 380px; }

.card:hover { transform: translateY(-5px); background: var(--card-hover); border-color: rgba(212, 175, 124, 0.55); }

/* Cover: swap the gradient for a real image by adding
   <img src="images/yourfile.jpg" alt=""> inside .cover */
.cover {
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.cover img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.cover .ct {
  color: var(--text);
  font-family: var(--font-heading);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}

.cover .ct small { font-size: 0.78rem; font-weight: 500; color: var(--muted); }

.g1 { background: linear-gradient(160deg, #3a3326, #121110); }
.g2 { background: linear-gradient(160deg, #2e2f2a, #0e1011); }
.g3 { background: linear-gradient(160deg, #3d2f27, #131110); }
.g4 { background: linear-gradient(160deg, #2a2d2b, #0d0f10); }
.g5 { background: linear-gradient(160deg, #4a3d2a, #15130f); }
.g6 { background: linear-gradient(160deg, #343331, #101112); }

.card-body { padding: 14px 16px 18px; }
.card-body h3 { font-size: 1rem; line-height: 1.3; margin-bottom: 4px; }
.card-body .meta { color: var(--muted); font-size: 0.82rem; }

.tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(212, 175, 124, 0.14);
  color: var(--accent);
}

.empty { display: none; text-align: center; color: var(--muted); padding: 40px 0 80px; }

/* ---------- Calibre library banner (books page) ---------- */
.library-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding: 18px 22px;
  background: linear-gradient(90deg, rgba(212, 175, 124, 0.14), rgba(212, 175, 124, 0.03));
  border: 1px solid rgba(212, 175, 124, 0.4);
  border-radius: var(--radius);
  transition: 0.25s;
}

.library-banner:hover { transform: translateY(-2px); border-color: var(--accent); }
.library-banner .lb-icon { color: var(--accent); }
.library-banner .lb-text { flex: 1; display: flex; flex-direction: column; }
.library-banner small { color: var(--muted); font-size: 0.85rem; }
.library-banner .lb-arrow { color: var(--accent); font-size: 1.4rem; }

/* ---------- Fun page cards ---------- */
.fun-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 24px 0 70px;
}

.fun-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.fun-card h3 { font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; }
.fun-card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 18px; }
.fun-card .output {
  font-size: 1.1rem;
  min-height: 56px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px dashed var(--line);
}

.fun-card button { cursor: pointer; font-family: inherit; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 30px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .menu-btn { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 14px 4%;
    background: rgba(11, 13, 15, 0.98);
    border-bottom: 1px solid var(--line);
  }

  .nav-links.open { display: flex; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .hero { min-height: 480px; padding: 60px 0 70px; background-position: 70% center, center, 78% center, center; }
  .wordmark b { font-size: 0.82rem; letter-spacing: 0.16em; }
  .btn-ghost { margin: 10px 0 0; }
}

/* ---------- Accessibility ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* MUSIC:START (added by add_music.py) */
.grid.albums { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.grid.albums .card { contain-intrinsic-size: auto 300px; }
.cover.sq { aspect-ratio: 1 / 1; }
.card-body .meta + .meta { margin-top: 2px; }
@media (max-width: 720px) { .grid.albums { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
/* MUSIC:END */

/* GAMES:START (added by build_games_page.py) */
.cover .badge { position: absolute; top: 10px; left: 10px; z-index: 2; padding: 3px 10px; border-radius: 999px;
  background: var(--accent); color: var(--bg); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.notice { margin-top: 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: .92rem; }
.shelf[hidden] { display: none; }
.shelf-head { margin: 34px 0 4px; }
.shelf-head h2 { font-family: var(--font-heading, inherit); font-weight: 600; font-size: 1.05rem; letter-spacing: .1em; text-transform: uppercase; }
.shelf-head p { color: var(--muted); font-size: .95rem; margin-top: 2px; }
.shelf .grid { padding-top: 14px; padding-bottom: 20px; }
.grid[data-shelf-extra] .card { content-visibility: auto; contain-intrinsic-size: auto 380px; }
.shelf-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 4px; }
.shelf-tab { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: 600 1rem/1 inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.shelf-tab:hover { border-color: var(--accent); }
.shelf-tab .st-n { min-width: 24px; padding: 3px 8px; border-radius: 999px; background: rgba(212, 175, 124, .16); color: var(--accent); font-size: .8rem; text-align: center; }
.shelf-tab.star .st-name::before { content: "\2726  "; color: var(--accent); }
.shelf-tab.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.shelf-tab.active .st-n { background: rgba(0, 0, 0, .18); color: var(--bg); }
.shelf-tab.active.star .st-name::before { color: var(--bg); }
.container.original > .back { display: inline-flex; align-items: center; gap: 10px; margin: 44px 0 10px; padding: 13px 24px; font-size: 1.05rem !important; border: 1px solid var(--line);
  border-radius: 999px; background: var(--card); color: var(--text); font-weight: 600; font-size: .95rem; text-decoration: none; transition: border-color .15s, background .15s; }
.container.original > .back:hover { border-color: var(--accent); background: rgba(212, 175, 124, .1); }
.container.original > .page-title { padding-top: 22px !important; }
.om { position: fixed !important; z-index: 1001; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 520px); max-height: 84vh; overflow-y: auto;
  margin: 0 !important; background: #1a1c1f !important; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); padding-top: 26px !important; }
.om-back { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .62); }
.om-back[hidden] { display: none; }
.om-close { position: absolute; top: 8px; right: 10px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--text); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.om-close:hover { background: rgba(255, 255, 255, .08); }
html.om-lock { overflow: hidden; }
/* GAMES:END */

/* FUN:START */
html { scroll-padding-top: 84px; }
.fun-grid-wide { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.fun-wide { grid-column: 1 / -1; }
.fun-card .muted { color: var(--muted); }
.fun-card h3 { display: flex; align-items: center; gap: 14px; }
.fun-card__icon { flex: 0 0 auto; display: inline-grid; place-items: center; width: 52px; height: 52px; border: 1px solid rgba(212,175,124,.28); border-radius: 14px; background: linear-gradient(145deg, rgba(212,175,124,.09), rgba(11,13,15,.2)); color: var(--accent, #D4AF7C); transition: border-color .2s; }
.fun-card__icon .fun-icon { width: 32px; height: 32px; }
a.fun-card:hover .fun-card__icon { border-color: rgba(212,175,124,.55); }
.fun-h-icon .fun-card__icon { vertical-align: middle; margin-right: 14px; }
.fun-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.fun-controls .search { flex: 0 1 220px; width: auto; border-radius: 999px; padding: 10px 16px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.fun-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.fun-actions .btn-ghost { margin-left: 0; }
.fun-actions [hidden], .fun-card [hidden] { display: none !important; }
button.btn { cursor: pointer; font-family: inherit; }
button.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.btn:disabled { opacity: .6; cursor: default; }
.roulette-stage { display: grid; grid-template-columns: 180px 1fr; gap: 22px; align-items: center; margin: 4px 0 18px; }
.reel { width: 180px; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--bg-soft, #14161a); border: 1px solid var(--line); position: relative; }
.reel img, .reel-poster { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-poster { display: grid; place-items: center; font-size: 2.4rem; text-align: center; padding: 10px; font-weight: 600; font-size: 1rem; line-height: 1.3; }
.reel.spinning img { filter: blur(1.5px) saturate(1.2); transform: scale(1.04); }
.reel.landed { box-shadow: 0 0 0 2px var(--accent), 0 0 40px rgba(212, 175, 124, 0.25); }
.roulette-info h4 { font-size: 1.3rem; margin-bottom: 4px; line-height: 1.25; }
.roulette-info .meta { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.roulette-info p { margin-bottom: 14px; }
.roulette-info .btn { margin-left: 0; }
.moon-box { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.moon-text { line-height: 1.5; }
.moon-text strong { font-size: 1.15rem; display: block; }
.moon-text small { color: var(--muted); display: block; }
.fun-card .btn-ghost { margin-left: 0; }
.guess-frame { width: 190px; aspect-ratio: 2 / 3; margin: 0 auto 12px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-soft, #14161a); }
.guess-frame img { width: 100%; height: 100%; object-fit: cover; transition: filter .5s ease, transform .5s ease; }
.guess-score { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.guess-options { display: grid; gap: 8px; margin-bottom: 12px; }
.guess-options button { text-align: left; background: transparent; border: 1px solid var(--line); color: var(--text); padding: 10px 14px; border-radius: 12px; font: inherit; cursor: pointer; transition: .2s; }
.guess-options button:hover:not(:disabled) { border-color: var(--accent); background: rgba(255, 255, 255, .04); }
.guess-options button.right { border-color: #6fcf97; background: rgba(111, 207, 151, .15); }
.guess-options button.wrong { border-color: #eb6f6f; background: rgba(235, 111, 111, .12); }
.dice-row { display: flex; gap: 10px; margin-bottom: 14px; }
.dice-row .search { flex: 1; width: auto; border-radius: 12px; padding: 10px 14px; }
.dice-out { text-align: center; }
.die { display: inline-grid; place-items: center; min-width: 44px; height: 44px; margin: 3px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--accent); font-weight: 700; font-size: 1.15rem; }
.dice-total { display: block; margin-top: 6px; color: var(--muted); font-size: .95rem; }
.dice-history { margin-top: 12px; color: var(--muted); font-size: .85rem; line-height: 1.7; }
.rolling .die { animation: shake .12s linear infinite; }
@keyframes shake { 0% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } 100% { transform: rotate(-6deg); } }
.fun-link { display: block; transition: .25s; }
.fun-link:hover { transform: translateY(-4px); border-color: var(--accent); }
@media (max-width: 640px) { .roulette-stage { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
@media (prefers-reduced-motion: reduce) { .guess-frame img, .rolling .die { transition: none; animation: none; } }

/* hero */
.fun-hero { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius, 16px); margin: 0 0 8px; background: radial-gradient(circle at 82% 18%, rgba(212,175,124,.20), transparent 55%), radial-gradient(circle at 10% 90%, rgba(232,215,183,.07), transparent 50%), #0f1114; isolation: isolate; }
.fun-ribbon { position: absolute; inset: -30px -40px; display: flex; align-items: center; gap: 14px; transform: rotate(-4deg); opacity: .75; z-index: -2; }
.fun-ribbon[hidden] { display: none; }
.fun-ribbon-track { display: flex; gap: 14px; flex: 0 0 auto; animation: fun-drift 120s linear infinite; }
.fun-ribbon img { width: 110px; height: 165px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(212,175,124,.25); flex: 0 0 auto; }
.fun-ribbon img:nth-child(3n+1) { transform: translateY(14px); }
.fun-ribbon img:nth-child(3n+2) { transform: translateY(-16px); }
@keyframes fun-drift { to { transform: translateX(-100%); } }
.fun-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(11,13,15,.96) 0%, rgba(11,13,15,.88) 42%, rgba(11,13,15,.45) 100%); }
.fun-hero-in { padding: 54px 34px 34px; max-width: 640px; }
.fun-kicker { font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent, #D4AF7C); margin: 0 0 10px; }
.fun-hero-h { font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.08; margin: 0 0 12px; }
.fun-hero-p { color: var(--muted); font-size: 1.05rem; margin: 0 0 22px; max-width: 520px; }
.fun-hero-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.fun-hero-btns .btn { margin-left: 0; }
.fun-stats { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 26px 0 0; padding: 0; }
.fun-stats:empty { display: none; }
.fun-stats li { font-size: .85rem; padding: 6px 13px; border-radius: 999px; border: 1px solid rgba(212,175,124,.28); background: rgba(11,13,15,.55); color: var(--text); }
.fun-stats b { color: var(--accent, #D4AF7C); font-weight: 700; margin-right: 4px; }
/* section headings */
.fun-sec { display: flex; align-items: center; gap: 16px; font-size: .8rem; letter-spacing: .24em; text-transform: uppercase; color: var(--accent, #D4AF7C); margin: 44px 0 18px; font-weight: 700; }
.fun-sec::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(212,175,124,.4), transparent); }
/* livelier tiles */
.fun-link { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; }
.fun-link::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, #D4AF7C, rgba(212,175,124,0)); opacity: .7; transition: opacity .25s; }
.fun-link:hover::before { opacity: 1; }
.fun-link:hover { box-shadow: 0 14px 34px rgba(0,0,0,.35), 0 0 0 1px rgba(212,175,124,.25); }
.fun-link h3 { margin-bottom: 8px; }
.fun-badge { display: inline-block; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent, #D4AF7C); border: 1px solid rgba(212,175,124,.35); border-radius: 999px; padding: 3px 10px; margin: 0 0 10px; }
.fun-link p { flex: 1; }
.fun-go { margin-top: 6px; font-weight: 600; color: var(--accent, #D4AF7C); }
.fun-go::after { content: "\2192"; display: inline-block; margin-left: 8px; transition: transform .25s; }
.fun-link:hover .fun-go::after { transform: translateX(5px); }
.fun-pick { grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 900px) { .fun-pick { grid-template-columns: 1.7fr 1fr; } }
.fun-grid-wide.fun-play, .fun-grid-wide { align-items: stretch; }
.reel.idle img { filter: saturate(.7) brightness(.85); }
.reel.idle::after { content: "Spin to find out"; position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 8px 10px; text-align: center; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: #E8D7B7; background: linear-gradient(0deg, rgba(11,13,15,.9), transparent); }
@media (max-width: 640px) { .fun-hero-in { padding: 36px 20px 24px; } .fun-ribbon img { width: 84px; height: 126px; } .fun-sec { margin-top: 34px; } }
@media (prefers-reduced-motion: reduce) { .fun-ribbon-track { animation: none; } .fun-link, .fun-link::before, .fun-go::after { transition: none; } }
/* FUN:END */
/* THEATERS:START (added by build_theaters.py) */
.th-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 6px; }
.th-tab { display: inline-flex; align-items: center; padding: 12px 22px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-family: inherit; font-weight: 600; font-size: 1rem; line-height: 1; cursor: pointer; transition: border-color .15s, background .15s; }
.th-tab:hover { border-color: var(--accent); }
.th-tab.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
#theaters-pane[hidden], #lib-pane[hidden] { display: none; }
.th-zip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 22px 0 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.th-zip label { font-weight: 600; }
.th-zip input { width: 9.5em; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font-family: inherit; font-size: 1rem; letter-spacing: .08em; }
.th-zip input:focus { outline: none; border-color: var(--accent); }
.th-zip button { padding: 10px 20px; border-radius: 999px; border: 0; background: var(--accent); color: var(--bg); font-family: inherit; font-weight: 600; font-size: .95rem; line-height: 1; cursor: pointer; }
.th-zip .th-note { flex-basis: 100%; color: var(--muted); font-size: .9rem; margin: 0; }
.th-zip .th-note a { color: var(--accent); }
.th-zip.nudge { animation: th-nudge .6s; border-color: var(--accent); }
@keyframes th-nudge { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.th-head { margin: 30px 0 4px; }
.th-head h2 { font-family: var(--font-heading, inherit); font-weight: 600; font-size: 1.05rem; letter-spacing: .1em; text-transform: uppercase; }
.th-head p { color: var(--muted); font-size: .95rem; margin-top: 2px; }
.th-card { cursor: default; }
.th-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.th-find, .th-info { display: inline-block; padding: 8px 14px; border-radius: 999px; font-family: inherit; font-weight: 600; font-size: .82rem; line-height: 1; text-decoration: none; }
.th-find { background: var(--accent); color: var(--bg); }
.th-info { border: 1px solid var(--line); color: var(--text); }
.th-find:hover, .th-info:hover { filter: brightness(1.1); }
.th-card[data-qv] { cursor: pointer; }
.th-card .th-title { color: inherit; }
.no-cedar .th-cedar-only { display: none !important; }
.th-keep { color: var(--muted); }
.th-t5 { display: inline-block; margin: 8px 0 0; padding: 4px 10px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-size: .74rem; font-weight: 700; letter-spacing: .04em; line-height: 1.2; }
.th-bm { margin: 6px 0 0; color: var(--accent); font-size: .82rem; font-weight: 600; line-height: 1.4; }
.th-cedar { margin: 22px 0 4px; padding: 16px 18px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--card); }
.th-cedar h2 { font-family: var(--font-heading, inherit); font-weight: 600; font-size: 1.05rem; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 4px; }
.th-cedar p { color: var(--muted); font-size: .92rem; margin: 0 0 8px; }
.th-cedar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.th-cedar li { font-size: .95rem; line-height: 1.4; }
.th-cedar li span { color: var(--muted); font-size: .85rem; }
.th-cedar li b { color: var(--accent); font-size: .78rem; letter-spacing: .04em; margin-left: 6px; }
.th-cedar a { color: var(--accent); }
.th-credit { margin: 30px 0 10px; color: var(--muted); font-size: .8rem; }
.th-empty { color: var(--muted); margin: 14px 0; }
/* THEATERS:END */

/* REFINE:START (added by build_refine.py - delete this block to undo the visual refinement) */
:root {
  --gold-line: rgba(212, 175, 124, .28);
  --gold-wash: rgba(212, 175, 124, .1);
  --hairline: rgba(201, 184, 147, .12);
  --lift: 0 14px 34px rgba(0, 0, 0, .35);
  --frame-bg: linear-gradient(145deg, rgba(212, 175, 124, .09), rgba(11, 13, 15, .2));
}

/* ---- Background: the existing soft gold glow, plus one very faint one low on the left ---- */
body {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(212, 175, 124, .07), transparent 60%),
    radial-gradient(700px 420px at 0% 108%, rgba(212, 175, 124, .035), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* ---- Navigation ---- */
.site-header { border-bottom-color: var(--hairline); }
.nav-links { gap: 4px; }
.nav-links a { padding: 9px 15px; transition: color .2s, background-color .2s, box-shadow .2s; }
.nav-links a.active { background: var(--gold-wash); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(212, 175, 124, .5); }
.nav-links a.active:hover { background: rgba(212, 175, 124, .18); }
.nav-links a:focus-visible, .logo:focus-visible, .menu-btn:focus-visible { outline-offset: 2px; border-radius: 999px; }
.logo { min-height: 44px; }
.logo:focus-visible { border-radius: 10px; }
.wordmark b { white-space: nowrap; }
.menu-btn { width: 44px; height: 44px; transition: border-color .2s, background-color .2s; }
.menu-btn:hover { border-color: var(--accent); background: var(--gold-wash); }
@media (min-width: 721px) and (max-width: 1000px) {
  .nav-links { gap: 0; }
  .nav-links a { padding: 8px 10px; font-size: .72rem; letter-spacing: .1em; }
  .wordmark b { font-size: .85rem; letter-spacing: .16em; }
}
@media (max-width: 720px) {
  .nav-links { background: #0B0D0F; box-shadow: 0 24px 40px rgba(0, 0, 0, .55); padding-top: 10px; padding-bottom: 14px; }
  .nav-links li + li { border-top: 1px solid var(--hairline); }
  .nav-links a { padding: 14px 16px; border-radius: 10px; font-size: .8rem; }
}

/* ---- Page headings and section headings ---- */
.page-title { padding: 52px 0 8px; }
.page-title h1::after { width: 72px; background: linear-gradient(90deg, var(--accent) 0, var(--accent) 56px, rgba(212, 175, 124, 0) 100%); margin-top: 16px; }
.page-title p { margin-top: 12px; max-width: 64ch; }
.section-head { padding-bottom: 14px; border-bottom: 1px solid var(--hairline); }

/* ---- Cards and tiles ---- */
.tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tile { transition: transform .25s ease, background-color .25s ease, border-color .25s ease, box-shadow .25s ease; }
.tile:hover { transform: translateY(-3px); border-color: rgba(212, 175, 124, .5); box-shadow: var(--lift); }
.tile .icon { display: inline-grid; place-items: center; width: 52px; height: 52px; margin-bottom: 18px; border: 1px solid var(--gold-line); border-radius: 14px; background: var(--frame-bg); }
.tile .line-icon { width: 30px; height: 30px; }
.card { transition: transform .25s ease, background-color .25s ease, border-color .25s ease, box-shadow .25s ease; }
.card:hover { transform: translateY(-3px); border-color: rgba(212, 175, 124, .5); box-shadow: var(--lift); }
.cover { border-bottom: 1px solid var(--hairline); }
.tile:focus-visible, .card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- Buttons: one set of heights, borders, hover and focus ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 26px; line-height: 1; transition: transform .2s, background-color .2s, border-color .2s, color .2s, box-shadow .2s; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(212, 175, 124, .25); }
.btn-ghost, button.btn-ghost { background: transparent; color: var(--accent); border: 1px solid rgba(212, 175, 124, .55); }
.btn-ghost:hover, button.btn-ghost:hover { background: var(--gold-wash); color: var(--text); border-color: var(--accent); }
.btn:active { transform: none; }
.btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.btn[disabled], button.btn:disabled { opacity: .55; }

/* ---- Search box, sort menu, filter chips ---- */
.search, .sort { min-height: 46px; transition: border-color .2s, box-shadow .2s; }
.search:focus, .sort:focus, .search:focus-visible, .sort:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(212, 175, 124, .16); }
select.sort, select.search { -webkit-appearance: none; appearance: none; padding-right: 42px; background-image: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2012%208%27%20fill=%27none%27%20stroke=%27%23D4AF7C%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpath%20d=%27M1%201.5l5%205%205-5%27/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 17px center; background-size: 12px 8px; }
select option { background: #1a1b1c; color: #E8D7B7; }
.search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; cursor: pointer; background: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2012%2012%27%20fill=%27none%27%20stroke=%27%23D4AF7C%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27%3E%3Cpath%20d=%27M2%202l8%208M10%202l-8%208%27/%3E%3C/svg%3E") center / 10px no-repeat; opacity: .85; }
.chip { transition: color .2s, border-color .2s, background-color .2s; }
.chip:focus-visible { outline-offset: 2px; }

/* ---- Empty states ---- */
.empty { padding: 54px 20px 90px; font-size: 1rem; line-height: 1.6; }
.empty::before { content: ""; display: block; width: 60px; height: 60px; margin: 0 auto 18px; border: 1px solid var(--gold-line); border-radius: 16px; background: url("data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%20128%20128%22%20fill=%22none%22%20stroke=%22%23D4AF7C%22%20stroke-width=%223.2%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%3E%3Cpath%20d=%22M83%2024a43%2043%200%201%200%2017%2077A45%2045%200%200%201%2083%2024Z%22/%3E%3Cpath%20d=%22M27%2031l3%207%207%203-7%203-3%207-3-7-7-3%207-3%203-7ZM103%2028l2%205%205%202-5%202-2%205-2-5-5-2%205-2%202-5Z%22/%3E%3C/svg%3E") center / 32px no-repeat, var(--frame-bg); }
.reel-poster.empty { font-size: 0; }
.reel-poster.empty::before { content: ""; width: 60px; height: 60px; display: block; opacity: .6; background: url("data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%20128%20128%22%20fill=%22none%22%20stroke=%22%23D4AF7C%22%20stroke-width=%223.2%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%3E%3Ccircle%20cx=%2264%22%20cy=%2264%22%20r=%2242%22/%3E%3Cpath%20d=%22M64%2022v14M64%2092v14M22%2064h14M92%2064h14M64%2064l21-18M64%2064l-5%2027%22/%3E%3Ccircle%20cx=%2264%22%20cy=%2264%22%20r=%225%22%20fill=%22%23D4AF7C%22%20stroke=%22none%22/%3E%3C/svg%3E") center / contain no-repeat; }

/* ---- Footer ---- */
.site-footer { position: relative; border-top: 0; padding: 34px 0 38px; font-size: .88rem; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(212, 175, 124, .4) 50%, transparent); }
.footer-inner { align-items: center; }
.site-footer a { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: color .2s, text-decoration-color .2s; }
.site-footer a:hover { color: var(--text); text-decoration-color: var(--accent); }
/* REFINE:END */
