/* LeeGameHub — site styles */
:root {
  /* Pulled from the Lee Game Hub logo */
  --navy: #1f3451;
  --navy-2: #2a4469;
  --green: #528753;
  --orange: #dd6722;
  --yellow: #f8bd33;
  --teal: #3f7f7f;
  --cream: #f7f6f1;          /* logo background */

  /* Roles */
  --red: var(--orange);      /* legacy name: primary accent */
  --gold: var(--yellow);
  --blue: var(--teal);
  --paper: #efece2;
  --card: #ffffff;
  --ink: #1b2638;
  --muted: #66707f;
  --line: #e3dfd3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 52, 81, .06), 0 4px 14px rgba(31, 52, 81, .07);
  --display: "Nunito", -apple-system, "Segoe UI", sans-serif;
  --serif: var(--display);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --stripe: linear-gradient(90deg, var(--green) 0 25%, var(--orange) 25% 50%, var(--yellow) 50% 75%, var(--teal) 75%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.2; margin: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); font-size: .9rem; }
code { background: rgba(31,52,81,.07); padding: 1px 6px; border-radius: 5px; font-size: .88em; }
[hidden] { display: none !important; }

/* Sarcastic FUN */
.fun {
  font-style: normal;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--red);
}

/* ---------- Header ---------- */
.site-header {
  background: var(--cream);
  color: var(--navy);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 5px solid;
  border-image: var(--stripe) 1;
  box-shadow: 0 2px 10px rgba(31, 52, 81, .06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); text-decoration: none; }
.brand-mark { height: 48px; width: auto; display: block; }
.brand-text {
  font-family: var(--display); font-weight: 900; font-size: 1.45rem;
  text-transform: uppercase; letter-spacing: .02em;
}

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: var(--navy);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: .98rem;
}
.site-nav a:hover { background: rgba(31,52,81,.07); }
.site-nav a.active { background: var(--navy); color: #fff; }
.site-nav i { opacity: .75; margin-right: 4px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--navy); font-size: 1.4rem; cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  background: var(--cream);          /* matches the logo so it sits seamlessly */
  color: var(--navy);
  padding: 28px 0 40px;
  border-bottom: 1px solid var(--line);
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: center; }
.hero-logo { width: 100%; max-width: 520px; height: auto; display: block; margin: 0 auto; }
.hero h1 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 900; color: var(--navy); }
.hero h1 span { display: block; color: var(--orange); font-weight: 800; }
.hero-sub { font-size: 1.08rem; color: var(--muted); margin: 12px 0 22px; }
.hero .fun { color: var(--orange); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
  border-radius: var(--radius);
  padding: 16px 18px;
  color: #fff;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.12);
}
.stat-num { display: block; font-family: var(--display); font-weight: 900; font-size: 2.3rem; line-height: 1; }
.stat-label { display: block; margin-top: 6px; font-size: .9rem; font-weight: 600; opacity: .92; }
.stat-green  { background: var(--green); }
.stat-teal   { background: var(--teal); }
.stat-yellow { background: var(--yellow); color: var(--navy); }
.stat-orange { background: var(--orange); }
.stat .fun, .hero .stat .fun { color: inherit; }

/* ---------- Panels ---------- */
main { padding: 40px 20px 64px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  scroll-margin-top: 90px;
}
.panel-head, .section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.panel h2, .section-head h2 { font-size: 1.35rem; color: var(--navy); }
.panel h2 i, .section-head h2 i { color: var(--red); margin-right: 6px; font-size: .9em; }
.sub-head { font-size: 1rem; color: var(--navy); margin: 22px 0 8px; }

.spotlight {
  background: linear-gradient(135deg, #fff 0%, #f7f7f5 100%);
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 10px;
  padding: 18px 20px;
}
.spotlight-game { font-family: var(--display); font-weight: 800; font-size: 1.6rem; color: var(--navy); }
.spotlight-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; color: var(--muted); font-size: .92rem; }
.spotlight-notes { font-family: var(--serif); font-style: italic; color: var(--muted); margin: 12px 0 0; }
.winner-badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 12px;
  background: var(--navy); color: #fff;
  padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .92rem;
}
.winner-badge i { color: var(--gold); }

.play-list { list-style: none; margin: 0; padding: 0; }
.play-list li {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .95rem;
}
.play-list li:last-child { border-bottom: 0; }
.play-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.play-winner { color: var(--navy); font-weight: 600; }
.play-winner i, .card-plays i { color: var(--gold); }

.leaderboard { list-style: none; margin: 0; padding: 0; }
.leaderboard li {
  display: grid; grid-template-columns: 32px minmax(70px, 1fr) 2fr auto; gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.rank {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: .85rem;
  background: #ecece8; color: var(--navy);
}
.rank-1 .rank { background: var(--gold); color: var(--navy); }
.rank-2 .rank { background: var(--teal); color: #fff; }
.rank-3 .rank { background: var(--orange); color: #fff; }
.lb-name { font-weight: 600; }
.lb-bar { height: 8px; background: #ecece8; border-radius: 99px; overflow: hidden; }
.lb-bar span { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.lb-stat { font-size: .85rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb-stat strong { color: var(--ink); }

.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.mini-stats div {
  background: var(--paper); border-radius: 10px; padding: 12px 14px; font-size: .88rem; color: var(--muted);
}
.mini-stats span { display: block; font-family: var(--serif); font-size: 1.6rem; color: var(--navy); line-height: 1.1; }

.empty { text-align: center; padding: 26px 10px; }
.empty > i { font-size: 2.2rem; color: var(--gold); margin-bottom: 8px; }
.empty p { margin: 4px 0; }

/* ---------- Collection ---------- */
.collection { margin-top: 48px; scroll-margin-top: 96px; }
.section-head h2 { font-size: 1.8rem; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.search { flex: 1 1 240px; position: relative; }
.search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input, .select select {
  width: 100%; font: inherit; color: var(--ink);
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 9px 12px;
}
.search input { padding-left: 38px; }
.search input:focus, .select select:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
.select { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.select select { width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; flex-basis: 100%; }
.chip {
  font: inherit; font-size: .86rem; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 6px 13px; border-radius: 999px;
}
.chip:hover { border-color: var(--navy); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.active .fun { color: var(--gold); }
.chip i { opacity: .7; margin-right: 3px; }

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.game-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.game-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(31,52,81,.12); }
.card-top { display: flex; gap: 12px; align-items: flex-start; }
.card-thumb {
  flex: none; width: 64px; height: 64px; border-radius: 10px;
  object-fit: cover; background: var(--paper);
  border: 1px solid var(--line);
}
.card-initial {
  display: grid; place-items: center; border: 0;
  background: var(--accent); color: var(--accent-ink, #fff);
  font-family: var(--serif); font-size: 1.6rem; font-weight: 700;
}
.game-card h3 { font-size: 1.1rem; color: var(--navy); padding-top: 4px; }
.card-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.card-facts li { font-size: .86rem; color: #3d4250; }
.card-facts i { color: var(--muted); width: 18px; text-align: center; margin-right: 4px; }
.card-exp { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.exp-label {
  flex-basis: 100%; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.tag-exp { background: color-mix(in srgb, var(--accent) 12%, white); color: var(--ink); font-weight: 500; }
.tag-exp i { color: var(--accent); margin-right: 3px; }
.card-foot {
  margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
}
.tag { font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.tag-known { background: rgba(82,135,83,.14); color: var(--green); }
.tag-learning { background: rgba(221,103,34,.12); color: var(--red); }
.card-plays { font-size: .8rem; color: var(--ink); text-align: right; line-height: 1.4; }
.card-plays.muted { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 5px solid; border-image: var(--stripe) 1; background: var(--navy); color: rgba(255,255,255,.7); padding: 28px 0; font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-brand { font-family: var(--display); font-weight: 900; text-transform: uppercase; color: #fff; font-size: 1.1rem; margin-right: 12px; }
.footer-tag { font-style: italic; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: rgba(255,255,255,.8); text-decoration: none; }
.footer-links a:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner, .two-col { grid-template-columns: 1fr; }
  .hero { padding: 20px 0 32px; }
  .hero-logo { max-width: 380px; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  main { padding: 32px 16px 48px; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 77px; left: 0; right: 0;
    flex-direction: column; background: var(--cream); padding: 8px 16px 16px;
    border-bottom: 5px solid; border-image: var(--stripe) 1;
  }
  .brand-text { font-size: 1.15rem; }
  .brand-mark { height: 40px; }
  .nav-open .site-nav { display: flex; }
  .stat-num { font-size: 2rem; }
  .leaderboard li { grid-template-columns: 28px 1fr auto; }
  .lb-bar { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Collection page ---------- */
.page-hero {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding: 34px 0 30px;
}
.page-hero-inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 900; color: var(--navy); }
.page-hero .hero-sub { margin: 6px 0 0; max-width: 640px; }
.page-hero-tip { margin: 0; font-size: .9rem; color: var(--muted); }
.page-hero-tip i { color: var(--teal); }
.collection-page { padding-top: 28px; }
.collection-page .collection { margin-top: 0; }
.result-count { margin-left: auto; }

.game-card { cursor: pointer; }
.game-card:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* Box art thumbnail with zoom affordance */
.thumb-wrap { position: relative; flex: none; display: block; line-height: 0; }
.thumb-wrap .card-thumb { cursor: zoom-in; transition: transform .15s ease; }
.game-card:hover .thumb-wrap .card-thumb { transform: scale(1.05); }
.zoom-badge {
  position: absolute; right: -5px; bottom: -5px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: .62rem; line-height: 22px; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); opacity: 0; transition: opacity .15s;
}
.game-card:hover .zoom-badge { opacity: 1; }

/* Hover preview */
.hover-preview {
  position: fixed; z-index: 60; pointer-events: none;
  background: #fff; padding: 6px; border-radius: 14px;
  box-shadow: 0 18px 50px rgba(31,52,81,.28), 0 0 0 1px var(--line);
  opacity: 0; transform: scale(.94); transition: opacity .15s ease, transform .15s ease;
}
.hover-preview.show { opacity: 1; transform: scale(1); }
.hover-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; display: block; }

/* Detail view */
body.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(20,30,46,.72); backdrop-filter: blur(3px); animation: lbFade .15s ease; }
.lb-panel {
  position: relative; width: min(920px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.35);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  border-top: 6px solid; border-image: var(--stripe) 1;
  animation: lbPop .18s ease;
}
@keyframes lbFade { from { opacity: 0; } }
@keyframes lbPop { from { opacity: 0; transform: scale(.96); } }
.lb-art { background: var(--cream); display: grid; place-items: center; aspect-ratio: 1; }
.lb-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-initial {
  width: 46%; aspect-ratio: 1; border-radius: 22px; display: grid; place-items: center;
  font: 900 clamp(3rem, 9vw, 6rem) var(--display);
}
.lb-info { padding: 30px 28px 28px; display: flex; flex-direction: column; gap: 14px; }
.lb-info h2 { font-size: 1.8rem; font-weight: 900; color: var(--navy); padding-right: 36px; }
.lb-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 1rem; }
.lb-facts i { width: 22px; color: var(--muted); }
#lb-exps { display: flex; flex-wrap: wrap; gap: 6px; }
#lb-exps:empty, .lb-status:empty { display: none; }
.lb-history {
  margin-top: auto; background: var(--paper); border-radius: 12px; padding: 14px 16px;
  display: grid; gap: 3px; font-size: .95rem;
}
.lb-winner { margin-top: 4px; font-weight: 700; color: var(--navy); }
.lb-winner i { color: var(--yellow); }
.lb-btn {
  position: absolute; z-index: 2; border: 0; cursor: pointer;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: var(--navy);
  font: 400 1.9rem/1 var(--sans); display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.lb-btn:hover { background: #fff; color: var(--orange); }
.lb-btn[hidden] { display: none; }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); padding-bottom: 4px; }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); padding-bottom: 4px; }

/* Home page collection teaser */
.collection-teaser {
  margin-top: 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 28px; align-items: center;
}
.collection-teaser h2 { font-size: 1.5rem; color: var(--navy); }
.collection-teaser h2 i { color: var(--orange); margin-right: 6px; font-size: .9em; }
.collection-teaser p { margin: 8px 0 18px; }
.btn-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--navy); color: #fff; text-decoration: none;
  font: 800 1rem var(--display); padding: 12px 20px; border-radius: 10px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.2);
}
.btn-cta:hover { background: var(--orange); }
.teaser-shelf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.shelf-item { aspect-ratio: 1; border-radius: 12px; overflow: hidden; display: block; text-decoration: none; box-shadow: var(--shadow); transition: transform .15s; }
.shelf-item:hover { transform: translateY(-3px) rotate(-1deg); }
.shelf-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shelf-item span { width: 100%; height: 100%; display: grid; place-items: center; font: 900 2rem var(--display); }

@media (max-width: 760px) {
  .lb-panel { grid-template-columns: 1fr; max-height: calc(100vh - 24px); }
  .lightbox { padding: 12px; }
  .lb-art { aspect-ratio: auto; max-height: 52vh; }
  .lb-art img { max-height: 52vh; object-fit: contain; }
  .lb-initial { width: 40%; margin: 24px 0; }
  .lb-info { padding: 20px; }
  .lb-info h2 { font-size: 1.45rem; }
  .lb-prev, .lb-next { top: 26vh; }
  .collection-teaser { grid-template-columns: 1fr; }
  .result-count { margin-left: 0; }
}
