@font-face {
  font-family: "Quicksand";
  src: url("../fonts/Quicksand-a7f2a267386825f4a80b8f8ad60f4731.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-heading: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-body: "Quicksand", "Trebuchet MS", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --bg: #030711;
  --bg-elevated: #0d1a2a;
  --bg-soft: #101f31;
  --surface: #102137;
  --surface-2: #132a46;
  --surface-3: #18375a;
  --text: #f4f8ff;
  --text-muted: #b6cae8;
  --heading: #ffffff;
  --line: #2c4668;
  --accent: #23f0c7;
  --accent-2: #ffd447;
  --accent-3: #4ea7ff;
  --danger: #ff7e7e;
  --shadow-soft: 0 14px 44px rgba(2, 6, 14, 0.42);
  --shadow-strong: 0 18px 60px rgba(1, 4, 10, 0.62);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;
  --space-1: 0.4rem;
  --space-2: 0.6rem;
  --space-3: 0.8rem;
  --space-4: 1rem;
  --space-5: 1.2rem;
  --space-6: 1.6rem;
  --space-7: 2rem;
  --space-8: 2.6rem;
  --max-w: 1280px;
}

[data-theme="light"] {
  --bg: #f4f8ff;
  --bg-elevated: #e7f1ff;
  --bg-soft: #dcecff;
  --surface: #ffffff;
  --surface-2: #f5faff;
  --surface-3: #e9f4ff;
  --text: #15273e;
  --text-muted: #415f87;
  --heading: #041126;
  --line: #bfd2eb;
  --accent: #00b993;
  --accent-2: #f2b100;
  --accent-3: #006fdd;
  --danger: #b83f56;
  --shadow-soft: 0 12px 30px rgba(9, 39, 78, 0.14);
  --shadow-strong: 0 20px 44px rgba(8, 36, 74, 0.18);
}

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

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font-body);
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

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

.site-shell {
  width: min(100% - 2rem, var(--max-w));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-4);
  min-height: 70px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #5b5cff) 0%, color-mix(in srgb, var(--accent) 64%, #394bff) 100%),
    url("/favicon.ico");
  background-size: cover, 64% 64%;
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.brand-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--heading);
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.search-inline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: min(430px, 100%);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: var(--radius-pill);
  padding: 0.45rem 0.8rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.search-inline:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

.search-input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.96rem;
  line-height: 1.2;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.icon-button,
.button {
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  background: color-mix(in srgb, var(--surface-2) 85%, transparent);
  color: var(--heading);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  font-size: 0.95rem;
}

.random-game-button {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  background: color-mix(in srgb, var(--surface-2) 76%, var(--accent) 12%);
}

.random-game-button:hover {
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 32%, transparent);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 40px;
  padding: 0 1rem;
}

.button-accent {
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 75%, black);
  color: #071320;
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: all 0.25s ease;
}

.button-accent:hover {
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 65%, transparent);
  transform: translateY(-2px);
}

.button-ghost {
  background: transparent;
}

.button-danger {
  color: var(--danger);
}

.button-pill {
  background: linear-gradient(180deg, #6d55ff 0%, #5b39ef 100%);
  border-color: #7e69ff;
  color: #eef1ff;
  min-height: 42px;
  padding-inline: 1.05rem;
  font-family: var(--font-heading);
  letter-spacing: 0.01em;
}

.button-pill:hover {
  box-shadow: 0 8px 20px rgba(97, 72, 255, 0.34);
}

.button-pill-danger {
  background: linear-gradient(180deg, #8f64ff 0%, #6f42ff 100%);
  border-color: #9e88ff;
}

.icon-button:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.primary-nav-wrap {
  padding-bottom: 0.65rem;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.nav-link {
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-2) 90%, transparent);
  padding: 0.45rem 0.9rem;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: #071320;
  border-color: color-mix(in srgb, var(--accent) 78%, black);
  background: var(--accent);
}

.page-main {
  padding: 1.2rem 0 3.2rem;
}

.hero {
  border: 1px solid color-mix(in srgb, var(--line) 40%, transparent);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-strong);
  padding: clamp(1.1rem, 2vw, 2rem);
  margin-bottom: var(--space-7);
  position: relative;
  overflow: clip;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inset;
  box-shadow: inset 0 -4px 0 var(--accent);
}

.hero-kicker {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--accent);
  margin: 0 0 0.55rem;
  position: relative;
  z-index: 1;
}

.hero-title {
  margin: 0 0 0.8rem;
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  line-height: 1.15;
  color: var(--heading);
}

.hero-copy {
  margin: 0 0 1rem;
  color: var(--text-muted);
  max-width: 72ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.chip {
  text-decoration: none;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  color: var(--text);
  padding: 0.34rem 0.72rem;
  font-weight: 700;
  font-size: 0.8rem;
}

.chip:hover {
  color: var(--heading);
  border-color: var(--accent);
}

/* Reserve ad area to reduce layout shift when ads load. */
ins.adsbygoogle,
.ad-slot {
  display: block;
  width: 100%;
  min-height: 250px;
  overflow: hidden;
}

@media (max-width: 640px) {
  ins.adsbygoogle,
  .ad-slot {
    min-height: 100px;
  }
}

.page-section {
  margin-top: var(--space-7);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  z-index: 9999;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.6rem;
}

.rich-article .article-prose {
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-soft);
  padding: clamp(1rem, 2.2vw, 1.5rem);
}

.rich-article .article-prose h3 {
  margin: 1.25rem 0 0.55rem;
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: clamp(1rem, 1.2vw, 1.25rem);
}

.rich-article .article-prose p {
  margin: 0.55rem 0;
  color: var(--text);
  line-height: 1.7;
}

.rich-article .article-prose ol {
  margin: 0.7rem 0 0;
  padding-left: 1.3rem;
}

.rich-article .article-prose li {
  margin: 0.8rem 0;
}

.rich-article .article-prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent);
  transition: all 0.2s ease;
}

.rich-article .article-prose a:hover {
  color: var(--accent-3);
  border-bottom: 1px solid var(--accent-3);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.section-title {
  margin: 0;
  font-family: var(--font-heading);
  color: var(--heading);
  font-size: clamp(1.04rem, 1.3vw, 1.5rem);
  letter-spacing: 0.02em;
}

.section-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: var(--radius-pill);
  padding: 0 0.6rem;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--surface-2) 90%, transparent);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.85rem;
}

.game-card {
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid color-mix(in srgb, var(--line) 40%, transparent);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: clip;
  text-decoration: none;
  min-height: 100%;
  transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}

.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  box-shadow: inset 0 -3px 0 transparent;
  transition: box-shadow 0.35s ease;
  pointer-events: none;
}

.game-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 25%, transparent),
              0 0 0 1px color-mix(in srgb, var(--accent) 80%, transparent);
}

.game-card:hover::after {
  box-shadow: inset 0 -4px 0 var(--accent);
}

.game-thumb-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-2) 74%, black);
}

.game-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.game-card:hover .game-thumb {
  transform: scale(1.05); /* Gentle depth zoom */
}

.game-card-body {
  padding: 0.65rem 0.72rem 0.74rem;
  z-index: 1;
  background: var(--surface);
}

.game-title {
  margin: 0;
  color: var(--heading);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.25;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 0.78rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--line) 40%, transparent);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 0.65rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 25px color-mix(in srgb, var(--accent) 25%, transparent),
              0 0 0 1px color-mix(in srgb, var(--accent) 80%, transparent);
}

.category-card img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
}

.category-card strong {
  display: block;
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: 0.94rem;
}

.category-card span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

body[data-page="home"] {
  --bg: #070915;
  --bg-elevated: #0c1023;
  --surface: #111631;
  --surface-2: #1a2140;
  --surface-3: #252e58;
  --line: #2b366b;
  --text: #e6ecff;
  --text-muted: #a5b3ea;
  --heading: #f5f9ff;
  --accent: #6c54ff;
  background:
    radial-gradient(circle at 86% -6%, rgba(96, 78, 255, 0.28), transparent 42%),
    radial-gradient(circle at 8% 120%, rgba(6, 168, 255, 0.12), transparent 38%),
    linear-gradient(180deg, #090b18 0%, #050714 100%);
}

body[data-page="home"] .site-header {
  background: color-mix(in srgb, #0f1224 95%, transparent);
  border-bottom-color: color-mix(in srgb, #27315e 70%, transparent);
}

body[data-page="home"] .home-shell {
  width: min(100% - 1rem, 1760px);
}

body[data-page="home"] .home-header-bar {
  grid-template-columns: auto 1fr;
}

body[data-page="home"] .home-header-bar .topbar-right {
  justify-content: flex-end;
}

body[data-page="home"] .home-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

body[data-page="home"] .home-icon-glyph {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: #b8c6f8;
  display: inline-flex;
  place-items: center;
}

body[data-page="home"] .home-icon-glyph svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body[data-page="home"] .home-icon-logo {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}

body[data-page="home"] .home-sidebar {
  position: sticky;
  top: 88px;
  border: 1px solid #2c376c;
  border-radius: 14px;
  background: #0f1530;
  padding: 0.8rem 0.65rem;
  max-height: calc(100vh - 100px);
  overflow: auto;
}

body[data-page="home"] .home-sidebar-nav {
  display: grid;
  gap: 0.25rem;
}

body[data-page="home"] .home-sidebar-sep {
  height: 1px;
  margin: 0.55rem 0;
  background: color-mix(in srgb, var(--line) 80%, transparent);
}

body[data-page="home"] .home-side-link {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  text-decoration: none;
  border-radius: 11px;
  color: var(--text);
  padding: 0.5rem 0.65rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

body[data-page="home"] .home-side-link:hover {
  background: color-mix(in srgb, var(--surface-3) 45%, transparent);
  border-color: color-mix(in srgb, var(--line) 60%, transparent);
}

body[data-page="home"] .home-side-link:hover .home-icon-glyph {
  color: #e7edff;
}

body[data-page="home"] .home-side-link.is-active {
  background: linear-gradient(180deg, #6a54ff 0%, #563eea 100%);
  color: #f3f6ff;
  border-color: #8476ff;
}

body[data-page="home"] .home-side-link.is-active .home-icon-glyph {
  color: #ffffff;
}

body[data-page="home"] .home-content {
  min-width: 0;
}

body[data-page="home"] .home-searchbar-wrap {
  margin-bottom: 1rem;
}

body[data-page="home"] .home-search-inline {
  width: 100%;
  max-width: none;
  background: #1a2140;
  border-color: #323f7e;
  min-height: 50px;
  padding-inline: 1rem;
}

body[data-page="home"] .home-search-inline .search-input {
  font-size: 1.1rem;
}

body[data-page="home"] .hero,
body[data-page="home"] .chip-list,
body[data-page="home"] .site-footer-grid > div:first-child {
  display: none;
}

body[data-page="home"] .page-section {
  margin-top: 1.1rem;
  content-visibility: auto;
  contain-intrinsic-size: 1px 520px;
}

body[data-page="home"] .section-head {
  margin-bottom: 0.55rem;
}

body[data-page="home"] .section-title {
  font-size: clamp(1.55rem, 2.1vw, 1.95rem);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

body[data-page="home"] .home-section-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(180deg, #6a54ff 0%, #4e39df 100%);
  color: #ffffff;
  display: inline-grid;
  place-items: center;
  box-shadow: 0 3px 8px rgba(17, 20, 46, 0.3);
  flex: 0 0 24px;
}

body[data-page="home"] .home-section-icon svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body[data-page="home"] .count-badge {
  border: 1px solid #7f6eff;
  background: #5a45eb;
  color: #f2f4ff;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  min-height: 30px;
  border-radius: 999px;
}

body[data-page="home"] .card-grid,
body[data-page="home"] .category-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.8rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.3rem;
}

body[data-page="home"] .card-grid::-webkit-scrollbar,
body[data-page="home"] .category-grid::-webkit-scrollbar {
  display: none;
}

body[data-page="home"] .game-card,
body[data-page="home"] .category-card {
  flex: 0 0 clamp(210px, 15vw, 285px);
  border-radius: 14px;
  border-color: #2a3671;
  background: #151d3d;
  box-shadow: none;
}

body[data-page="home"] .game-card:hover,
body[data-page="home"] .category-card:hover {
  transform: translateY(-2px);
  border-color: #7d70ff;
  box-shadow: 0 12px 24px rgba(12, 15, 37, 0.52);
}

body[data-page="home"] #recently-played-section {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
}

body[data-page="home"] #recently-played-section .section-head {
  margin: 0;
  min-height: 78px;
  border: 1px solid #2a3671;
  background: linear-gradient(180deg, #1c2245 0%, #151b39 100%);
  border-radius: 14px;
  padding: 0.82rem 0.95rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.16rem;
}

body[data-page="home"] #recently-played-section .section-title {
  margin: 0;
  font-size: 1.95rem;
  line-height: 1;
}

body[data-page="home"] #recently-played-section .section-title .home-section-icon {
  display: none;
}

body[data-page="home"] #recently-played-section .count-badge {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: #a8b9f2;
  font-size: 0.96rem;
  font-weight: 600;
  padding: 0;
  min-height: 0;
  border-radius: 0;
  cursor: pointer;
}

body[data-page="home"] #recently-played-section .count-badge:hover {
  color: #ffffff;
}

body[data-page="home"] #recently-played-section .card-grid {
  padding-bottom: 0;
  gap: 0.62rem;
}

body[data-page="home"] #recently-played-section .game-card {
  flex: 0 0 clamp(110px, 8.2vw, 172px);
  border-radius: 12px;
}

body[data-page="home"] #recently-played-section .game-thumb-wrap {
  border-radius: 12px;
}

body[data-page="home"] #recently-played-section .game-thumb {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

body[data-page="home"] #recently-played-section .game-card-body,
body[data-page="home"] #recently-played-section .game-title {
  display: none;
}

body[data-page="home"] .game-thumb-wrap {
  border-radius: 11px;
}

body[data-page="home"] .game-card-body {
  display: block;
  padding: 0.55rem 0.68rem 0.72rem;
  background: linear-gradient(180deg, rgba(9, 16, 40, 0.16) 0%, rgba(9, 16, 40, 0.38) 100%);
}

body[data-page="home"] .game-title {
  margin: 0;
  color: #dfe8ff;
  font-size: 1.03rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-page="home"] .category-card {
  display: grid;
  padding: 0;
  overflow: hidden;
}

body[data-page="home"] .category-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

body[data-page="home"] .category-card div {
  padding: 0.6rem 0.72rem 0.75rem;
}

body[data-page="home"] .site-footer {
  margin-top: 1.4rem;
  padding-top: 0.9rem;
}

body[data-page="home"] .home-article {
  border: 1px solid #243062;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(21, 27, 57, 0.96) 0%, rgba(14, 20, 46, 0.98) 100%);
  padding: 1.1rem 1.15rem;
}

body[data-page="home"] .home-article h3 {
  margin: 1rem 0 0.45rem;
  font-size: clamp(1.15rem, 1.55vw, 1.35rem);
  color: #f4f7ff;
}

body[data-page="home"] .home-article p,
body[data-page="home"] .home-article li {
  color: #d8e2ff;
  line-height: 1.65;
  font-size: 0.98rem;
}

body[data-page="home"] .home-article ol {
  margin: 0.25rem 0 0.2rem 1.1rem;
  padding: 0;
}

body[data-page="home"] .site-footer-grid {
  grid-template-columns: 1fr 1fr;
}

body[data-page="home"] .home-carousel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.4rem;
  align-items: center;
}

body[data-page="home"] .home-carousel-track {
  scroll-snap-type: x proximity;
}

body[data-page="home"] .home-carousel-track > * {
  scroll-snap-align: start;
}

body[data-page="home"] .home-carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid #6e60ff;
  background: #5a43eb;
  color: #f5f6ff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  display: inline-grid;
  place-items: center;
  transition: all 0.2s ease;
}

body[data-page="home"] .home-carousel-btn:hover:not(:disabled) {
  background: #6f59fa;
}

body[data-page="home"] .home-carousel-btn:disabled {
  opacity: 0.42;
  cursor: default;
}

[data-theme="light"] body[data-page="home"] {
  --bg: #f0f6ff;
  --bg-elevated: #dfeeff;
  --surface: #ffffff;
  --surface-2: #edf5ff;
  --surface-3: #d8e9ff;
  --line: #b8d0ef;
  --text: #163354;
  --text-muted: #48688f;
  --heading: #081f3b;
  --accent: #1e69d8;
  background:
    radial-gradient(circle at 85% 0%, rgba(69, 149, 255, 0.28), transparent 40%),
    linear-gradient(180deg, #f7fbff 0%, #e9f3ff 100%);
}

[data-theme="light"] body[data-page="home"] .site-header {
  background: color-mix(in srgb, #f6fbff 94%, transparent);
  border-bottom-color: #c5d8f1;
}

[data-theme="light"] body[data-page="home"] .home-search-inline {
  background: #ffffff;
  border-color: #bed3ef;
}

[data-theme="light"] body[data-page="home"] .home-sidebar {
  background: #ffffff;
  border-color: #c5d8f1;
  box-shadow: 0 10px 24px rgba(22, 61, 108, 0.08);
}

[data-theme="light"] body[data-page="home"] .home-side-link {
  color: #1a3d67;
}

[data-theme="light"] body[data-page="home"] .home-icon-glyph {
  color: #3f6ea8;
}

[data-theme="light"] body[data-page="home"] .home-side-link:hover {
  background: #edf5ff;
  border-color: #c5d8f1;
}

[data-theme="light"] body[data-page="home"] .home-side-link:hover .home-icon-glyph {
  color: #1f4f86;
}

[data-theme="light"] body[data-page="home"] .home-side-link.is-active {
  color: #ffffff;
  border-color: #5e8ee8;
  background: linear-gradient(180deg, #4e85ea 0%, #2f69d7 100%);
}

[data-theme="light"] body[data-page="home"] .home-side-link.is-active .home-icon-glyph {
  color: #ffffff;
}

[data-theme="light"] body[data-page="home"] .count-badge {
  background: #e8f1ff;
  border-color: #bfd2eb;
  color: #23518a;
}

[data-theme="light"] body[data-page="home"] #recently-played-section .section-head {
  border-color: #c8daef;
  background: linear-gradient(180deg, #f3f8ff 0%, #e8f1fd 100%);
}

[data-theme="light"] body[data-page="home"] #recently-played-section .count-badge {
  background: transparent;
  border: 0;
  color: #496f9e;
}

[data-theme="light"] body[data-page="home"] #recently-played-section .count-badge:hover {
  color: #183b63;
}

[data-theme="light"] body[data-page="home"] .game-card,
[data-theme="light"] body[data-page="home"] .category-card {
  border-color: #c8daef;
  background: #ffffff;
}

[data-theme="light"] body[data-page="home"] .game-card-body {
  background: linear-gradient(180deg, rgba(212, 228, 248, 0.12) 0%, rgba(212, 228, 248, 0.38) 100%);
}

[data-theme="light"] body[data-page="home"] .game-title {
  color: #1a3c66;
}

[data-theme="light"] body[data-page="home"] .home-article {
  border-color: #c8daef;
  background: linear-gradient(180deg, #f7fbff 0%, #edf5ff 100%);
}

[data-theme="light"] body[data-page="home"] .home-article h3 {
  color: #183b63;
}

[data-theme="light"] body[data-page="home"] .home-article p,
[data-theme="light"] body[data-page="home"] .home-article li {
  color: #2d4f76;
}

[data-theme="light"] body[data-page="home"] .home-carousel-btn {
  border-color: #b8d0ef;
  background: #ffffff;
  color: #205089;
}

[data-theme="light"] body[data-page="home"] .home-carousel-btn:hover:not(:disabled) {
  background: #e7f1ff;
}

.game-vote-widget {
  margin-top: 0.8rem;
  display: inline-flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.game-vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  color: var(--heading);
  min-height: 36px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
}

.game-vote-btn .vote-count {
  font-size: 0.88rem;
  color: var(--text-muted);
  min-width: 1.3em;
  text-align: right;
}

.legacy-vote-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: auto;
  padding: 0.35rem 0.72rem;
  min-width: 0;
}

.legacy-vote-btn svg {
  width: 16px;
  height: 16px;
}

.fullscreen-icon-button {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  background:
    radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 46%),
    color-mix(in srgb, var(--surface-2) 92%, transparent);
}

.fullscreen-icon-button svg {
  width: 18px;
  height: 18px;
  display: block;
}

.fullscreen-icon-button:hover {
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 24%, transparent);
}

.game-vote-btn.is-active[data-vote-action="like"] {
  border-color: color-mix(in srgb, #2bd487 70%, black);
  background: color-mix(in srgb, #2bd487 20%, var(--surface-2));
}

.game-vote-btn.is-active[data-vote-action="dislike"] {
  border-color: color-mix(in srgb, #f07b90 72%, black);
  background: color-mix(in srgb, #f07b90 18%, var(--surface-2));
}

.search-layout {
  display: grid;
  gap: 1rem;
}

.search-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.search-results-meta {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.empty-state {
  border: 1px dashed color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
  color: var(--text-muted);
  padding: 1.1rem;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.legal-article {
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-soft);
  padding: 1.25rem;
}

.legal-article h1,
.legal-article h2,
.legal-article h3 {
  font-family: var(--font-heading);
  color: var(--heading);
  line-height: 1.2;
}

.legal-article h1 {
  margin-top: 0;
  font-size: clamp(1.3rem, 2.3vw, 2rem);
}

.legal-article h2 {
  margin-top: 1.2rem;
  margin-bottom: 0.45rem;
  font-size: 1.05rem;
}

.legal-article p,
.legal-article li {
  color: var(--text);
}

.legal-article ul {
  margin: 0.3rem 0 0.85rem 1.1rem;
  padding: 0;
}

.legal-note {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.auth-layout {
  display: grid;
  gap: 0.9rem;
}

.auth-status {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  color: var(--text);
  font-weight: 600;
}

.auth-status[data-kind="error"] {
  color: #ffd8d8;
  border-color: color-mix(in srgb, var(--danger) 65%, transparent);
}

.auth-status[data-kind="success"] {
  color: color-mix(in srgb, var(--accent) 75%, white);
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.auth-card {
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  box-shadow: var(--shadow-soft);
  padding: 1rem;
}

.auth-card h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-heading);
  color: var(--heading);
  font-size: 1.08rem;
}

.auth-form {
  display: grid;
  gap: 0.55rem;
}

.auth-form label {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.auth-input {
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: var(--radius-sm);
  min-height: 40px;
  padding: 0 0.7rem;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.auth-user-line {
  margin: 0 0 0.45rem;
  color: var(--text);
}

[data-theme="light"] .auth-status[data-kind="error"] {
  color: #8b1027;
}

.site-footer {
  border-top: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  margin-top: 2rem;
  padding: 1.2rem 0 2rem;
}

.site-footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  align-items: start;
}

.site-footer h4 {
  margin: 0 0 0.45rem;
  font-family: var(--font-heading);
  color: var(--heading);
  font-size: 0.95rem;
}

.site-footer p,
.site-footer a {
  margin: 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.84rem;
  line-height: 1.45;
}

.site-footer a:hover {
  color: var(--accent);
}

.footer-copyright {
  margin-top: 0.8rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

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

@media (min-width: 1440px) {
  :root {
    --max-w: 1360px;
  }

  .card-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "search search";
    padding-top: 0.5rem;
  }

  .brand {
    grid-area: brand;
  }

  .topbar-right {
    grid-area: actions;
  }

  .topbar .search-inline {
    grid-area: search;
    width: 100%;
    margin-bottom: 0.4rem;
  }

  .card-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

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

  .site-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="home"] .home-layout {
    grid-template-columns: 1fr;
  }

  body[data-page="home"] .home-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  body[data-page="home"] .home-sidebar-nav {
    display: flex;
    flex-wrap: wrap;
  }

  body[data-page="home"] .home-side-link {
    font-size: 0.88rem;
  }
}

@media (max-width: 768px) {
  .site-shell {
    width: min(100% - 1.2rem, var(--max-w));
  }

  .primary-nav {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.2rem;
    flex-wrap: nowrap;
  }

  .primary-nav::-webkit-scrollbar {
    height: 6px;
  }

  .primary-nav::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--line) 84%, transparent);
    border-radius: var(--radius-pill);
  }

  .hero {
    border-radius: var(--radius-md);
  }

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

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

  .site-footer-grid {
    grid-template-columns: 1fr;
  }

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

  body[data-page="home"] .home-header-bar {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  body[data-page="home"] .home-header-bar .topbar-right {
    justify-content: flex-start;
  }

  body[data-page="home"] .home-header-bar .topbar-right .button-pill {
    display: none;
  }

  body[data-page="home"] .section-title {
    font-size: 1.45rem;
  }

  body[data-page="home"] .count-badge {
    font-size: 0.9rem;
  }

  body[data-page="home"] #recently-played-section {
    grid-template-columns: 1fr;
    gap: 0.58rem;
  }

  body[data-page="home"] #recently-played-section .section-head {
    min-height: 0;
  }

  body[data-page="home"] #recently-played-section .section-title {
    font-size: 1.5rem;
  }

  body[data-page="home"] #recently-played-section .game-card {
    flex-basis: clamp(128px, 43vw, 172px);
  }

  body[data-page="home"] .game-card,
  body[data-page="home"] .category-card {
    flex-basis: clamp(180px, 56vw, 250px);
  }
}

@media (max-width: 480px) {
  .topbar {
    gap: 0.55rem;
  }

  .brand-text {
    font-size: 0.9rem;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .button {
    min-height: 36px;
    padding-inline: 0.8rem;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .category-card img {
    width: 44px;
    height: 44px;
  }

  body[data-page="home"] .home-shell {
    width: min(100% - 0.65rem, 1760px);
  }

  body[data-page="home"] .home-side-link {
    padding: 0.45rem 0.56rem;
  }
}

@media (max-width: 360px) {
  html {
    font-size: 15px;
  }

  .site-shell {
    width: min(100% - 0.8rem, var(--max-w));
  }

  .chip-list {
    gap: 0.35rem;
  }

  .chip {
    font-size: 0.74rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
