:root {
  --bg: #101012;
  --panel: #19191d;
  --line: #2b2b31;
  --text: #f2efe9;
  --muted: #9a978f;
  --accent: #ff4f2e;
  --accent-2: #ffc21a;
  --radius: 10px;
  --display: "Archivo Black", Impact, sans-serif;
  --body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
}
body.locked { overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(16, 16, 18, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--display);
  font-size: 18px;
  text-decoration: none;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.nav {
  display: flex; gap: 4px; margin-left: auto;
  overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.games-link { color: #101012; background: var(--accent-2); font-weight: 600; }
.nav a.games-link:hover { background: #ffd24d; color: #101012; }

/* Hero */
.hero {
  padding: clamp(56px, 12vw, 140px) clamp(16px, 4vw, 48px) clamp(40px, 7vw, 80px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(60% 90% at 85% 0%, rgba(255, 79, 46, 0.22), transparent 70%),
    radial-gradient(45% 70% at 10% 100%, rgba(255, 194, 26, 0.12), transparent 70%);
}
.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(44px, 11vw, 150px);
  line-height: 0.92;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.tagline {
  margin: 22px 0 0;
  max-width: 46ch;
  font-size: clamp(17px, 2.2vw, 22px);
  color: var(--muted);
}
.about { margin: 14px 0 0; max-width: 62ch; color: var(--muted); }

/* Sections */
.section { padding: clamp(40px, 7vw, 88px) clamp(16px, 4vw, 48px) 0; }
.section:last-child { padding-bottom: clamp(40px, 7vw, 88px); }
.section-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(26px, 4.4vw, 46px);
  line-height: 1.05;
  text-transform: uppercase;
}
.count {
  font-size: 13px; font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.blurb { margin: 0 0 24px; color: var(--muted); max-width: 60ch; }

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 15px;
}
.empty code {
  padding: 2px 6px; border-radius: 4px;
  background: var(--panel); color: var(--text);
  font-size: 13px;
}

/* Art grid (masonry) */
.grid { columns: 4 260px; column-gap: 14px; }
.tile {
  display: block; width: 100%;
  margin: 0 0 14px; padding: 0;
  position: relative;
  break-inside: avoid;
  border: 0; border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}
.tile img, .tile video { display: block; width: 100%; height: auto; }
.tile .label {
  position: absolute; inset: auto 0 0 0;
  padding: 28px 12px 10px;
  text-align: left; font-size: 14px; font-weight: 500;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  opacity: 0; transition: opacity 0.15s;
}
.tile:hover .label, .tile:focus-visible .label { opacity: 1; }
.tile:focus-visible, .game:focus-visible, .btn:focus-visible, .icon-btn:focus-visible {
  outline: 2px solid var(--accent-2); outline-offset: 2px;
}
.tile .badge {
  position: absolute; top: 10px; left: 10px;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 12px; font-weight: 600;
}

/* Games */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.game {
  display: flex; flex-direction: column;
  padding: 0; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  transition: transform 0.15s, border-color 0.15s;
}
.game:hover { transform: translateY(-3px); border-color: var(--accent-2); }
.game .cover {
  aspect-ratio: 16 / 9; width: 100%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-family: var(--display); font-size: 40px; color: #101012;
}
.game .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game .info { padding: 14px 16px 16px; }
.game .name { font-weight: 600; font-size: 17px; }
.game .desc { margin-top: 4px; color: var(--muted); font-size: 14px; }
.game .play { margin-top: 12px; color: var(--accent-2); font-weight: 600; font-size: 14px; }

/* Footer */
.footer {
  margin-top: clamp(40px, 7vw, 88px);
  padding: 28px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 14px;
}

/* Overlays */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6, 6, 8, 0.96);
  display: flex; align-items: center; justify-content: center;
}
.overlay[hidden] { display: none; }
.lb-figure {
  margin: 0; max-width: 100%;
  padding: 56px 64px 20px;
  display: flex; flex-direction: column; align-items: center;
  height: 100%;
}
#lb-media { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
#lb-media img, #lb-media video {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 4px;
}
#lb-caption { padding-top: 12px; color: var(--muted); font-size: 15px; text-align: center; }
.icon-btn {
  position: absolute;
  width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--panel);
  font-size: 26px; line-height: 1;
  display: grid; place-items: center;
}
.icon-btn:hover { border-color: var(--text); }
.icon-btn.close { top: 12px; right: 12px; }
.icon-btn.prev { left: 12px; top: 50%; transform: translateY(-50%); }
.icon-btn.next { right: 12px; top: 50%; transform: translateY(-50%); }

.player { flex-direction: column; align-items: stretch; justify-content: flex-start; }
.player-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.player-bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.btn {
  padding: 7px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent;
  font-size: 14px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--text); }
#player-frame { flex: 1; width: 100%; border: 0; background: #000; }

@media (max-width: 640px) {
  .topbar { gap: 12px; }
  .grid { columns: 2 140px; column-gap: 10px; }
  .tile { margin-bottom: 10px; }
  .lb-figure { padding: 60px 8px 16px; }
  .icon-btn.prev, .icon-btn.next { top: auto; bottom: 14px; transform: none; }
  #player-tab { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .game, .tile .label { transition: none; }
}
