:root {
  --bg: #efe4d2;
  --bg-top: #fcf7ef;
  --panel: rgba(255, 250, 244, 0.92);
  --ink: #1c1711;
  --muted: #6d6459;
  --line: rgba(28, 23, 17, 0.1);
  --accent: #e86b38;
  --green: #1c7568;
  --shadow: 0 18px 42px rgba(61, 38, 19, 0.12);
  --glow-accent: rgba(232, 107, 56, 0.18);
  --glow-green: rgba(28, 117, 104, 0.18);
  --chip-bg: rgba(28, 23, 17, 0.06);
  --brand-bg: rgba(255, 255, 255, 0.72);
  --texture: url("/img/white.webp");
}

body[data-theme="dark"] {
  --bg: #171b21;
  --bg-top: #222831;
  --panel: rgba(30, 35, 43, 0.92);
  --ink: #f5efe6;
  --muted: #b9b1a6;
  --line: rgba(245, 239, 230, 0.12);
  --accent: #ff8a4c;
  --green: #2d9f90;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  --glow-accent: rgba(255, 138, 76, 0.16);
  --glow-green: rgba(45, 159, 144, 0.18);
  --chip-bg: rgba(255, 255, 255, 0.06);
  --brand-bg: rgba(255, 255, 255, 0.04);
  --texture: url("/img/black.webp");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    var(--texture) 0 0 / 420px 420px repeat,
    radial-gradient(circle at top left, var(--glow-accent), transparent 28%),
    radial-gradient(circle at bottom right, var(--glow-green), transparent 28%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
}

.home-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 72px 0 32px;
}

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.hero-card,
.game-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: 1.8fr 260px;
  gap: 18px;
  padding: 24px;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--green);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: "Rubik Mono One", monospace;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding: 12px 20px 12px 12px;
  border: 1px solid rgba(28, 23, 17, 0.08);
  border-radius: 999px;
  background: var(--brand-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.site-brand__logo {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 20px;
  flex: 0 0 auto;
}

.site-brand__name {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.hero-copy {
  margin-top: 16px;
  max-width: 54ch;
  color: var(--muted);
  font-size: 1rem;
}

.hero-badge {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(28, 117, 104, 0.12), var(--brand-bg));
  border: 1px solid rgba(28, 117, 104, 0.14);
}

.hero-badge span,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 800;
}

.hero-badge span {
  min-width: 48px;
  margin-bottom: 10px;
  background: var(--ink);
  color: #fff;
}

.hero-badge p {
  color: var(--muted);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.game-card {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.game-card__top,
.game-card__meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.game-card h2 {
  font-size: 1.7rem;
}

.game-card p {
  color: var(--muted);
  line-height: 1.5;
}

.pill {
  background: var(--chip-bg);
}

.pill--muted {
  color: var(--muted);
}

.game-card__meta span {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  font-size: 0.9rem;
}

.primary-link,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  font-weight: 800;
  text-decoration: none;
}

.primary-link {
  background: linear-gradient(135deg, var(--accent), #ff8d58);
  color: #fff;
}

.ghost-button {
  border: 0;
  background: var(--chip-bg);
  color: var(--muted);
}

.game-card--active {
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(255, 244, 230, 0.9)),
    var(--panel);
}

body[data-theme="dark"] .game-card--active {
  background:
    linear-gradient(180deg, rgba(35, 41, 50, 0.98), rgba(30, 35, 43, 0.96)),
    var(--panel);
}

body[data-theme="dark"] .hero-badge span {
  background: #11151b;
  color: #fff3e7;
}

@media (max-width: 860px) {
  .theme-toggle {
    top: 12px;
    right: 12px;
    padding: 10px 14px;
  }

  .hero-card,
  .games-grid {
    grid-template-columns: 1fr;
  }

  .site-brand {
    width: 100%;
    justify-content: center;
  }

  .site-brand__logo {
    width: 56px;
    height: 56px;
    border-radius: 18px;
  }

  .site-brand__name {
    font-size: 1.25rem;
  }
}
