:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #eff6ff;
  --border: #e2e8f0;
  --border-strong: #bfdbfe;
  --text: #0f172a;
  --text-muted: #475569;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --badge-bg: #eff6ff;
  --badge-text: #1e40af;
  --badge-border: #bfdbfe;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 10px 26px rgba(37, 99, 235, 0.12);
}

:root.dark {
  --bg: #0b1120;
  --surface: #111827;
  --surface-muted: #1e293b;
  --border: #1e293b;
  --border-strong: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --badge-bg: #172554;
  --badge-text: #bfdbfe;
  --badge-border: #1e3a8a;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 12px 28px rgba(56, 189, 248, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  line-height: 1.5;
  min-height: 100dvh;
}

.page-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  text-decoration: none;
  color: var(--text);
  border-radius: 0.65rem;
}

.brand-badge {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.75rem;
  background: var(--surface-muted);
  border: 1.5px solid var(--border-strong);
  color: var(--accent);
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-link,
.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.header-link:hover,
.theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.brand-link:focus-visible,
.header-link:focus-visible,
.theme-btn:focus-visible,
.game-card-link:focus-visible,
.footer-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Main */
main {
  flex: 1;
  padding: 2.25rem 1rem 3rem;
}

.hero {
  margin-bottom: 1.75rem;
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.4rem;
}

.hero h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.65rem, 3.6vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

.hero-lead {
  margin: 0;
  max-width: 40rem;
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* Game Catalog Grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.game-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.game-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  border-radius: 1rem;
}

.game-card-top {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.85rem;
}

.game-emblem {
  flex-shrink: 0;
  border-radius: 0.85rem;
}

.game-eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.game-title {
  margin: 0.15rem 0 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.game-desc {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  flex: 1;
}

.game-badges {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.game-badge {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
}

.game-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
}

/* Footer */
.site-footer {
  padding: 1.25rem 1rem 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.footer-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  border-radius: 0.25rem;
}

@media (prefers-reduced-motion: reduce) {
  .game-card,
  .header-link,
  .theme-btn {
    transition: none;
  }
  .game-card:hover {
    transform: none;
  }
}

@media (max-width: 480px) {
  .brand-title {
    font-size: 1.05rem;
  }
  .header-link,
  .theme-btn {
    padding: 0 0.6rem;
    font-size: 0.8rem;
  }
}
