:root {
  --bg: #090c11;
  --bg-2: #10161e;
  --panel: #141b24;
  --panel-2: #1a2330;
  --line: #2a3544;
  --text: #e6edf5;
  --muted: #8b97a8;
  --accent: #8ec8f0;
  --accent-2: #c9a35a;
  --danger: #d47a6a;
  --ok: #8fbe7a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Figtree", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.7rem 1.4rem;
  background: rgba(9, 12, 17, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}
.brand img { width: 28px; height: 28px; image-rendering: pixelated; }
.brand:hover { text-decoration: none; color: var(--accent); }
nav.primary { display: flex; gap: 1rem; flex-wrap: wrap; }
nav.primary a { color: var(--muted); font-size: 0.92rem; }
nav.primary a:hover, nav.primary a.active { color: var(--text); text-decoration: none; }
.search-wrap { margin-left: auto; position: relative; min-width: 180px; }
.search-wrap input {
  width: min(280px, 42vw);
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  font: inherit;
}
.search-results {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: min(360px, 90vw);
  max-height: 420px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.search-results.open { display: block; }
.search-results a {
  display: block;
  padding: 0.55rem 0.8rem;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.search-results a:hover { background: var(--panel-2); text-decoration: none; }
.search-results small { color: var(--muted); display: block; }

.hero {
  position: relative;
  min-height: 72vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem 1.2rem 5rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: #0b1018 center / cover no-repeat;
  filter: saturate(0.85) contrast(1.05);
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9,12,17,0.35) 0%, rgba(9,12,17,0.72) 55%, var(--bg) 100%),
    radial-gradient(ellipse at 50% 30%, rgba(142,200,240,0.12), transparent 55%);
}
.hero-inner { position: relative; max-width: 720px; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(3.2rem, 9vw, 6.2rem);
  font-weight: 400;
  margin: 0 0 0.4rem;
  letter-spacing: 0.06em;
}
.hero p.lede {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 38rem;
  margin: 0 auto 1.6rem;
}
.cta-row { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; }
.cta-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}
.cta-note { margin: 0; color: var(--muted); font-size: 0.92rem; }
.btn {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: #0b1018; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); color: #0b1018; }
.play-wrap {
  position: relative;
  display: inline-flex;
  z-index: 1;
}
.play-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22rem;
  height: 9rem;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(255, 214, 90, 0.55), rgba(232, 176, 48, 0.18) 42%, transparent 72%);
  pointer-events: none;
  z-index: -1;
  animation: play-halo 2.4s ease-in-out infinite;
}
.btn.play {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  font-size: 1.5rem;
  padding: 1.15rem 2.45rem;
  border-radius: 12px;
  border: 1px solid #ffe7a8;
  color: #1a1204;
  background: linear-gradient(180deg, #ffe9a0 0%, #f0c44a 46%, #d4941c 100%);
  box-shadow:
    0 0 0 1px rgba(255, 236, 170, 0.7),
    0 0 22px 6px rgba(255, 206, 70, 0.55),
    0 0 56px 18px rgba(232, 176, 48, 0.32),
    0 14px 28px rgba(0, 0, 0, 0.45);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: play-glow 2.4s ease-in-out infinite;
}
.btn.play::before {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background: linear-gradient(
    115deg,
    transparent 36%,
    rgba(255, 255, 255, 0.62) 50%,
    transparent 64%
  );
  transform: translateX(-85%);
  animation: play-shine 2.8s ease-in-out infinite;
  pointer-events: none;
}
.btn.play::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  pointer-events: none;
}
.btn.play:hover {
  filter: brightness(1.08);
  color: #1a1204;
  border-color: #fff1c2;
  text-decoration: none;
}
.play-sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff6d0;
  box-shadow: 0 0 10px 3px rgba(255, 220, 110, 0.9);
  pointer-events: none;
  animation: play-twinkle 1.6s ease-in-out infinite;
}
.play-sparkle.s1 { top: -10px; right: 16%; }
.play-sparkle.s2 { top: 58%; left: -14px; width: 4px; height: 4px; animation-delay: 0.45s; }
.play-sparkle.s3 { bottom: -8px; right: -10px; width: 5px; height: 5px; animation-delay: 0.9s; }

@keyframes play-glow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 236, 170, 0.55),
      0 0 16px 4px rgba(255, 206, 70, 0.4),
      0 0 40px 12px rgba(232, 176, 48, 0.22),
      0 14px 28px rgba(0, 0, 0, 0.45);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 248, 210, 0.95),
      0 0 28px 10px rgba(255, 220, 90, 0.75),
      0 0 70px 22px rgba(255, 196, 60, 0.42),
      0 14px 28px rgba(0, 0, 0, 0.45);
  }
}
@keyframes play-halo {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(0.96); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}
@keyframes play-shine {
  0% { transform: translateX(-85%); }
  45%, 100% { transform: translateX(85%); }
}
@keyframes play-twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .play-wrap::before,
  .btn.play,
  .btn.play::before,
  .play-sparkle {
    animation: none;
  }
  .play-sparkle { opacity: 0.7; }
}

.wrap { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; }
.section-title {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  margin: 0 0 0.4rem;
}
.muted { color: var(--muted); }
.grid-3, .card-grid, .item-grid {
  display: grid;
  gap: 0.9rem;
}
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.item-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.card, .item-card, article.page {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}
.card h2, .card h3 { font-family: var(--serif); font-weight: 400; margin: 0 0 0.35rem; }
.item-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  min-height: 72px;
}
.item-card:hover { border-color: var(--accent); text-decoration: none; background: var(--panel-2); }
.item-card .name { font-weight: 600; display: block; }
.item-card .kind { color: var(--muted); font-size: 0.8rem; display: block; }

.icon-frame {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  background: #0c1118;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.icon-img, .px-icon {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.icon-missing { width: 20px; height: 20px; border-radius: 2px; background: #2a3544; }

.crumb { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.crumb a { color: var(--muted); }
.stats { display: grid; gap: 0.25rem; margin: 1rem 0; }
.stats div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding: 0.28rem 0; }
.stats span:last-child { color: var(--accent-2); }
.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  margin: 0 0.2rem 0.2rem 0;
}
.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0 1.2rem; }
.filters a, .filters button {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font: inherit;
  cursor: pointer;
}
.filters a.active, .filters button.active, .filters a:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }

.detail-head {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.detail-head h1 { font-family: var(--serif); font-weight: 400; margin: 0 0 0.2rem; font-size: 2.2rem; }
.detail-icon { width: 72px; height: 72px; }
.prose p { margin: 0.6rem 0; }
.prose ul { padding-left: 1.2rem; }
.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
}
.alpha { color: var(--accent-2); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; }
.lb-head { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; align-items: baseline; justify-content: space-between; margin-bottom: 0.8rem; }
.lb-status { color: var(--muted); font-size: 0.9rem; }
.lb-status[data-kind="ok"] { color: var(--ok); }
.lb-status[data-kind="wait"] { color: var(--accent-2); }
.lb-cats, .lb-boards { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.7rem; }
.lb-cats button, .lb-boards button {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font: inherit;
  cursor: pointer;
}
.lb-cats button.active, .lb-boards button.active, .lb-cats button:hover, .lb-boards button:hover {
  color: var(--text);
  border-color: var(--accent);
}
.lb-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; }
.lb-panel h2 { font-family: var(--serif); font-weight: 400; margin: 0 0 0.7rem; }
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th, .lb-table td { text-align: left; padding: 0.45rem 0.35rem; border-bottom: 1px solid var(--line); }
.lb-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
.lb-rank { width: 2.4rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-score { text-align: right !important; color: var(--accent-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.lb-table thead th:last-child { text-align: right; }
.lb-table tr.rank-1 .lb-rank, .lb-table tr.rank-1 .lb-name { color: #f0d36a; }
.lb-table tr.rank-2 .lb-rank, .lb-table tr.rank-2 .lb-name { color: #c9d0dc; }
.lb-table tr.rank-3 .lb-rank, .lb-table tr.rank-3 .lb-name { color: #d4a06a; }
.list-reset { list-style: none; padding: 0; margin: 0; }
.list-reset li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }

@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; }
  .search-wrap { width: 100%; margin-left: 0; }
  .search-wrap input { width: 100%; }
  .hero { min-height: 58vh; }
}
