:root {
  --bg: #fbfaf6;
  --paper: #ffffff;
  --ink: #1f2a24;
  --muted: #68746c;
  --line: #dfe4dc;
  --header-bg: rgba(251, 250, 246, 0.94);
  --soft-band: #edf3ee;
  --media-bg: #eef2ed;
  --green: #22634d;
  --green-dark: #174838;
  --gold: #c58b2b;
  --red: #a54635;
  --shadow: 0 18px 42px rgba(35, 45, 39, 0.1);
}

[data-theme="dark"] {
  --bg: #111815;
  --paper: #18231e;
  --ink: #edf3ee;
  --muted: #aab8ae;
  --line: #2d3b34;
  --header-bg: rgba(17, 24, 21, 0.94);
  --soft-band: #17231e;
  --media-bg: #223029;
  --green: #68b08e;
  --green-dark: #8bc5a8;
  --gold: #e0b85f;
  --red: #d27868;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #111815;
    --paper: #18231e;
    --ink: #edf3ee;
    --muted: #aab8ae;
    --line: #2d3b34;
    --header-bg: rgba(17, 24, 21, 0.94);
    --soft-band: #17231e;
    --media-bg: #223029;
    --green: #68b08e;
    --green-dark: #8bc5a8;
    --gold: #e0b85f;
    --red: #d27868;
    --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  font-size: 18px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--green);
}

.theme-toggle {
  width: 48px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.theme-toggle-track {
  width: 48px;
  height: 28px;
  display: block;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef2ed;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle-thumb {
  width: 22px;
  height: 22px;
  position: absolute;
  left: 3px;
  top: 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: #5e6870;
  box-shadow: 0 2px 6px rgba(31, 42, 36, 0.24);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.theme-toggle-icon,
.theme-toggle-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.theme-toggle-icon svg {
  fill: currentColor;
}

.theme-toggle[data-resolved-theme="dark"] .theme-toggle-track {
  border-color: #39463f;
  background: #202622;
}

.theme-toggle[data-resolved-theme="dark"] .theme-toggle-thumb {
  transform: translateX(20px);
  background: #2f3732;
  color: #f3f6f1;
}

main {
  min-height: 70vh;
}

.hero,
.page,
.game-hero,
.section,
.site-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.hero {
  padding-top: 64px;
  padding-bottom: 40px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 44px;
  align-items: center;
}

.hero h1,
.game-hero h1,
.page h1 {
  margin: 0 0 18px;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero p,
.game-hero p,
.page p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.hero-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-panel img {
  width: 100%;
  display: block;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  font-size: 15px;
}

.primary-button {
  background: var(--green);
  color: #fff;
}

.primary-button:hover {
  background: var(--green-dark);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.primary-button.small {
  min-height: 38px;
  font-size: 14px;
}

.section {
  padding-top: 32px;
  padding-bottom: 54px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-head h2,
.content-grid h2,
.seo-block h2,
.related h2,
.page h2 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.16;
}

.section-head p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-list a,
.category-list span,
.game-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.category-list a:hover {
  border-color: var(--green);
  color: var(--green);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.game-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.game-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(35, 45, 39, 0.06);
}

.game-media {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--media-bg);
}

.game-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-card-body {
  padding: 16px;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.game-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.2;
}

.game-card h3 a,
.text-link {
  text-decoration: none;
}

.game-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.text-link {
  color: var(--green);
  font-weight: 800;
  font-size: 14px;
}

.info-band {
  background: var(--soft-band);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.info-grid {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.info-grid h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.info-grid p {
  margin: 0;
  color: var(--muted);
}

.game-hero {
  padding-top: 46px;
  padding-bottom: 30px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  align-items: center;
}

.game-hero img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.play-shell,
.content-grid,
.seo-block,
.related {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px;
}

.game-launch-panel {
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: center;
  padding: 28px;
}

.game-launch-panel img {
  width: 100%;
  border-radius: 8px;
  background: var(--media-bg);
}

.game-launch-panel h2 {
  margin: 0 0 8px;
  font-size: 30px;
}

.game-launch-panel p {
  max-width: 560px;
  margin: 0 0 18px;
  color: var(--muted);
}

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

.content-grid article,
.seo-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 22px;
}

.content-grid ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.seo-block p {
  margin: 0;
  color: var(--muted);
}

.seo-block p + p,
.content-grid p + p,
.page-card p + p {
  margin-top: 12px;
}

.faq-list {
  display: grid;
  gap: 16px;
}

.faq-item {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.faq-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.faq-item h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.page {
  padding-top: 48px;
  padding-bottom: 64px;
}

.page-card {
  max-width: 820px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 28px;
}

.page-card p,
.page-card li {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #17231e;
  color: #eef3ed;
}

.site-footer-inner {
  padding-top: 30px;
  padding-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  color: #cdd8cf;
  text-decoration: none;
  font-size: 14px;
}

@media (max-width: 860px) {
  .hero,
  .game-hero,
  .game-launch-panel,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .game-grid,
  .game-grid.compact,
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .hero {
    padding-top: 36px;
  }

  .hero h1,
  .game-hero h1,
  .page h1 {
    font-size: 38px;
  }

  .game-grid,
  .game-grid.compact,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .site-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}
