/* TBG Studios — one stylesheet, no framework. Dark by design: the games are dark. */

:root {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1d242d;
  --line: #2a333e;
  --text: #e8edf2;
  --muted: #9aa7b4;
  --accent: #ffb238;
  --accent-hover: #ffc566;
  --accent-ink: #1a1206;
  --radius: 14px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); font-weight: 750; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.eyebrow {
  color: var(--accent); font-weight: 700; font-size: 0.8rem;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.75em;
}

.lead { font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: var(--muted); max-width: 40ch; }

/* ------------------------------------------------------------ top bar */

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(14, 17, 22, 0.82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; }
.brand:hover { color: var(--text); }
.topnav { display: flex; gap: 22px; }
.topnav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.topnav a:hover { color: var(--text); }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px;
  border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 750; line-height: 1.1; text-decoration: none; text-align: center;
  cursor: pointer; transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 24px rgba(255, 178, 56, 0.25); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line); color: var(--text); background: rgba(255, 255, 255, 0.04); }
.btn-ghost:hover { border-color: var(--muted); color: var(--text); }
.btn-link { color: var(--muted); padding-left: 8px; padding-right: 8px; }
.btn-link:hover { color: var(--text); }
.btn-sm { min-height: 40px; padding: 8px 18px; font-size: 0.92rem; }
.btn.is-disabled { opacity: 0.55; cursor: default; transform: none; }
.btn small { font-weight: 500; font-size: 0.72rem; color: var(--muted); margin-top: 3px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ------------------------------------------------------------ sections */

.section { padding: clamp(48px, 8vw, 88px) 0; }
.studio-hero + .section { padding-top: clamp(24px, 4vw, 48px); }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.prose { max-width: 68ch; }
.prose p { color: #cdd6df; }

.studio-hero {
  padding: clamp(56px, 10vw, 120px) 0 clamp(24px, 4vw, 48px);
  background:
    radial-gradient(900px 400px at 85% 0%, rgba(255, 178, 56, 0.16), transparent 60%),
    radial-gradient(700px 380px at 0% 100%, rgba(110, 200, 90, 0.10), transparent 60%);
}

/* ------------------------------------------------------------ game cards */

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: #3b4654; transform: translateY(-2px); }
.card-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }

/* A lone game gets the whole row: image beside the text instead of a small card in an empty grid. */
@media (min-width: 760px) {
  .card:only-child { grid-column: 1 / -1; flex-direction: row; }
  .card:only-child .card-media { flex: 0 0 58%; }
  .card:only-child .card-media img { height: 100%; }
  .card:only-child .card-body { padding: 32px; justify-content: center; }
  .card:only-child h3 { font-size: 1.6rem; }
  .card:only-child .card-actions { margin-top: 8px; }
}
.card-body h3 a { color: var(--text); text-decoration: none; }
.card-body p { color: var(--muted); }
.card-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.tags, .badges { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li, .badges li {
  font-size: 0.8rem; font-weight: 650; color: #c9d3dd;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
}

/* ------------------------------------------------------------ game hero */

.game-hero { position: relative; min-height: min(78vh, 760px); display: flex; align-items: flex-end; overflow: hidden; }
.game-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 30%; }
.game-hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(14, 17, 22, 0.92) 0%, rgba(14, 17, 22, 0.55) 45%, rgba(14, 17, 22, 0) 75%),
    linear-gradient(0deg, var(--bg) 0%, rgba(14, 17, 22, 0) 45%);
}
.game-hero-inner { position: relative; z-index: 1; padding-top: 120px; padding-bottom: clamp(40px, 7vw, 72px); }
.game-hero h1 { max-width: 14ch; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5); }
.game-hero .lead { color: #d4dce4; }
.game-hero .badges li { background: rgba(14, 17, 22, 0.65); }

@media (max-width: 720px) {
  .game-hero { min-height: 0; flex-direction: column; align-items: stretch; }
  .game-hero-bg { position: relative; height: auto; aspect-ratio: 16 / 9; object-position: 70% 50%; }
  .game-hero::after { background: linear-gradient(0deg, var(--bg) 0%, rgba(14, 17, 22, 0) 30%); height: calc(100vw * 9 / 16); }
  .game-hero-inner { padding-top: 0; margin-top: -32px; }
  .game-hero .actions .btn { flex: 1 1 100%; }
}

/* ------------------------------------------------------------ video */

.video { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; }
.video video, .video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; }
.yt { position: relative; display: block; aspect-ratio: 16 / 9; }
.yt img { width: 100%; height: 100%; object-fit: cover; }
.yt-play {
  position: absolute; inset: 50% auto auto 50%; width: 76px; height: 76px; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--accent); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.yt-play::after {
  content: ""; position: absolute; left: 31px; top: 24px;
  border-style: solid; border-width: 14px 0 14px 22px; border-color: transparent transparent transparent var(--accent-ink);
}

/* ------------------------------------------------------------ features */

.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.features li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.features h3 { color: var(--accent); }
.features p { color: var(--muted); margin: 0; }

/* ------------------------------------------------------------ gallery */

.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.gallery a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.25s ease; }
.gallery a:hover img { transform: scale(1.03); }

.lightbox { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 92vh; }
.lightbox::backdrop { background: rgba(5, 7, 10, 0.88); }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 8px; }
.lightbox-close {
  position: fixed; top: 14px; right: 18px; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 26px; line-height: 1; cursor: pointer;
}

/* ------------------------------------------------------------ how to play */

.split { display: grid; gap: 32px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 18px 48px; color: #cdd6df; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--accent); font-weight: 800; font-size: 0.9rem;
}

.facts { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 22px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 650; text-align: right; }

/* ------------------------------------------------------------ CTA band & footer */

.cta-band { text-align: center; background: linear-gradient(180deg, transparent, rgba(255, 178, 56, 0.08)); }
.cta-band .actions { justify-content: center; }

.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
