:root {
  color-scheme: dark;
  --bg: #111318;
  --header-bg: rgba(17, 19, 24, 0.9);
  --footer-bg: #0d0f14;
  --input-bg: #0d0f14;
  --modal-bg: #080a0e;
  --panel: #1b1f28;
  --panel-soft: #222836;
  --text: #f5f7fb;
  --muted: #aab2c5;
  --line: #303849;
  --accent: #35d07f;
  --accent-strong: #22b96c;
  --danger: #ff6767;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fb;
  --header-bg: rgba(246, 248, 251, 0.92);
  --footer-bg: #ffffff;
  --input-bg: #ffffff;
  --modal-bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #eef2f7;
  --text: #111827;
  --muted: #5d6678;
  --line: #d9e0ea;
  --accent: #12864c;
  --accent-strong: #0e6f3e;
  --danger: #c83349;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(53, 208, 127, 0.16), transparent 34rem), var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #07110c;
  font-size: 0.8rem;
}

.header-actions,
.main-nav,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.main-nav a,
.site-footer a {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
}

.main-nav a:hover,
.site-footer a:hover {
  color: var(--text);
}

.search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.search-input {
  width: min(28vw, 22rem);
  min-width: 13rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.75rem 1rem;
  background: var(--input-bg);
  color: var(--text);
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(53, 208, 127, 0.14);
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 1.5rem;
  padding: clamp(2rem, 6vw, 5rem) 0 2rem;
}

.hero h1 {
  max-width: 760px;
  margin: 0.15rem 0 0.75rem;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 0.96;
}

.hero-copy {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.muted,
.empty-state {
  color: var(--muted);
}

.section-block {
  padding: 2.25rem 0 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2 {
  margin: 0.15rem 0 0;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

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

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.category-chip,
.text-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.65rem 0.95rem;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.category-chip.is-active {
  border-color: var(--accent);
  background: rgba(53, 208, 127, 0.16);
  color: var(--accent);
}

.text-button,
.theme-toggle {
  color: var(--muted);
}

.theme-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  background: var(--panel);
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
}

.compact-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.game-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.game-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--panel-soft);
}

.game-card-body {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
}

.game-title {
  margin: 0;
  min-height: 2.5rem;
  font-size: 1rem;
  line-height: 1.25;
}

.game-category {
  margin: -0.35rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
}

.primary-button,
.favorite-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  padding: 0.72rem 1rem;
  background: var(--accent);
  color: #06120c;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.favorite-button {
  min-width: 3rem;
  padding: 0.72rem;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
}

.favorite-button.is-favorite {
  border-color: rgba(255, 103, 103, 0.6);
  color: var(--danger);
}

.empty-state {
  display: none;
  margin: 1rem 0 0;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.empty-state.is-visible {
  display: block;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--footer-bg);
}

.site-footer p {
  margin: 0;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 1rem;
}

.modal.is-open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.modal-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(18rem, 1fr) auto;
  width: min(1100px, 100%);
  height: min(760px, 92vh);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--modal-bg);
  box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--panel);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.icon-button {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.content-page {
  max-width: 900px;
  padding: 1.25rem 0 4rem;
}

.content-page h2 {
  margin: 1.65rem 0 0.55rem;
  font-size: 1.45rem;
}

.content-page p,
.content-page li {
  color: var(--muted);
  line-height: 1.75;
}

.content-page ul {
  padding-left: 1.25rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(18rem, 1fr);
  gap: 2rem;
  max-width: 1050px;
}

.contact-form {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.contact-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--text);
  font-weight: 800;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.78rem 0.85rem;
  background: var(--input-bg);
  color: var(--text);
}

@media (max-width: 780px) {
  .site-header {
    align-items: stretch;
    gap: 0.8rem;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "search search"
      "nav theme";
    gap: 0.7rem;
    align-items: center;
  }

  .search-input {
    grid-area: search;
    width: 100%;
    min-width: 0;
  }

  .main-nav {
    grid-area: nav;
    width: 100%;
    flex-wrap: wrap;
  }

  .theme-toggle {
    grid-area: theme;
    justify-self: end;
    min-width: 2.5rem;
    padding-inline: 0.75rem;
  }

  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .site-footer nav {
    width: 100%;
    flex-wrap: wrap;
  }

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

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

  .contact-layout {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 520px) {
  .site-header {
    padding: 0.7rem 0.75rem;
    gap: 0.55rem;
  }

  .brand {
    gap: 0.45rem;
    font-size: 0.92rem;
  }

  .brand-mark {
    width: 1.9rem;
    height: 1.9rem;
    font-size: 0.72rem;
  }

  .header-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
  }

  .main-nav {
    gap: 0.45rem;
  }

  .main-nav a {
    font-size: 0.86rem;
  }

  .theme-toggle {
    min-width: 2.2rem;
    padding: 0.5rem 0.6rem;
    font-size: 0.95rem;
  }
}
