
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #10243a;
  --surface: #182f49;
  --surface-2: #203b59;
  --surface-3: #2b4b6d;
  --border: rgba(148, 163, 184, .13);
  --text: #f2f8ff;
  --muted: #b8cbe0;
  --cyan: #69bdf5;
  --purple: #69bdf5;
  --orange: #fb923c;
  --green: #8cd4a2;
  --pink: #bfcaff;
  --sidebar-width: 250px;
  --radius: 16px;
  --font: 'DM Sans', sans-serif;
  --heading: 'Space Grotesk', sans-serif;
}

body.light-theme {
  color-scheme: light;
  --bg: #eaf4fc;
  --surface: #ffffff;
  --surface-2: #dfeefb;
  --surface-3: #d1e3f4;
  --border: rgba(30, 41, 59, .12);
  --text: #162b43;
  --muted: #415b75;
  --cyan: #155486;
  --purple: #245889;
  --orange: #ea580c;
  --green: #16a34a;
  --pink: #414c96;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  transition: background .2s, color .2s;
}

button, input, select {
  font: inherit;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

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

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 28px 19px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--heading);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.6px;
  margin-bottom: 54px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #142a42;
  background: linear-gradient(135deg, var(--cyan), #8b9eea);
  font-size: 13px;
  box-shadow: 0 5px 22px rgba(105, 189, 245, .2);
}

.brand-accent {
  color: var(--cyan);
}

.sidebar-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.7px;
  margin: 0 0 13px 11px;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
  margin-bottom: 34px;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 43px;
  padding: 0 12px;
  color: var(--muted);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: .2s;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-link.active {
  color: var(--cyan);
  background: rgba(105, 189, 245, .10);
}

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-version {
  display: block;
  padding: 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.main-content {
  margin-left: var(--sidebar-width);
  min-width: 0;
}

.topbar {
  height: 76px;
  padding: 0 4%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.search-box {
  width: min(560px, 70%);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
}

.search-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  color: var(--text);
  border: 0;
  outline: none;
  font-size: 12px;
}

.search-box kbd {
  font-size: 9px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 6px;
  border-radius: 5px;
}

.icon-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 39px;
  height: 39px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
}

.icon-button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.menu-button {
  display: none;
}

.page-content {
  width: min(1500px, 100%);
  margin: auto;
  padding: 38px 4% 25px;
}

.welcome-section {
  margin-bottom: 30px;
}

.eyebrow {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}

h1, h2, h3 {
  font-family: var(--heading);
}

.welcome-section h1 {
  font-size: clamp(29px, 3vw, 43px);
  letter-spacing: -1.8px;
  line-height: 1.2;
  margin: 12px 0;
}

.gradient-text {
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome-section p,
.section-bottom p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 40px;
}

.stat-card {
  padding: 19px;
  min-height: 116px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stat-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

.stat-card strong {
  font-family: var(--heading);
  font-size: 29px;
  line-height: 1.2;
}

.stat-note {
  color: var(--muted);
  font-size: 10px;
}

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

.section-heading h2 {
  font-size: 22px;
  margin-top: 6px;
  letter-spacing: -.5px;
}

.featured-section {
  margin-bottom: 42px;
}

.featured-card {
  min-height: 235px;
  border-radius: 20px;
  padding: 35px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 85% 25%, rgba(173, 198, 255, .27), transparent 40%),
    radial-gradient(ellipse at 20% 100%, rgba(105, 189, 245, .17), transparent 45%),
    linear-gradient(115deg, #1b324c, #274568 55%, #243652);
  border: 1px solid rgba(173, 198, 255, .22);
}

.featured-card h2 {
  font-size: clamp(24px, 3vw, 35px);
  margin: 13px 0;
  color: #fff;
}

.featured-card p {
  max-width: 520px;
  color: #d4e7fb;
  font-size: 13px;
  line-height: 1.7;
}

.featured-tag {
  color: #a9dbff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.games-section {
  margin-bottom: 42px;
}

.text-link {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
}

.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-bar input,
.filter-bar select {
  height: 41px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9px;
  padding: 0 12px;
  outline: none;
  font-size: 11px;
}

.filter-bar input {
  flex: 1;
  min-width: 120px;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--cyan);
}

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

.game-card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform .2s, border-color .2s;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(105, 189, 245, .45);
}

.game-art {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #2c4b6c, #2d4665);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.game-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-art-placeholder {
  font-family: var(--heading);
  font-size: 34px;
  font-weight: 800;
  color: rgba(255, 255, 255, .35);
}

.game-info {
  padding: 15px;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.game-tag {
  padding: 4px 7px;
  background: var(--surface-2);
  border-radius: 5px;
  font-size: 9px;
  color: var(--muted);
}

.game-tag.upcoming {
  color: var(--orange);
}

.game-info h3 {
  font-size: 15px;
  margin-bottom: 9px;
  line-height: 1.4;
}

.game-date {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
}

.game-platforms {
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.game-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.watch-button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 10px;
}

.watch-button.saved {
  color: var(--green);
  border-color: var(--green);
}

.game-score {
  color: var(--purple);
  font-size: 10px;
  font-weight: 700;
}

.loading-state,
.empty-state {
  grid-column: 1 / -1;
  padding: 45px 15px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}

.data-notice {
  color: var(--muted);
  font-size: 10px;
  margin-top: 15px;
  line-height: 1.6;
}

.section-bottom {
  padding: 27px;
  border-radius: var(--radius);
  background: linear-gradient(110deg, rgba(105, 189, 245, .10), rgba(173, 198, 255, .12));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 45px;
}

.section-bottom h2 {
  font-size: 20px;
  margin: 8px 0;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 12px 18px;
  background: var(--cyan);
  color: #142a42;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
}

.primary-button:hover {
  filter: brightness(1.1);
}

.footer {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 10px;
}

.footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 17px;
}

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

.footer-note {
  width: 100%;
  text-align: center;
  margin-top: 10px;
}

@media (max-width: 1100px) {
  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  :root {
    --sidebar-width: 250px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s;
    box-shadow: 15px 0 40px rgba(0, 0, 0, .2);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-button {
    display: block;
    flex-shrink: 0;
  }

  .topbar {
    height: 65px;
    padding: 0 16px;
    gap: 10px;
  }

  .search-box {
    width: 100%;
  }

  .search-box kbd {
    display: none;
  }

  .page-content {
    padding: 27px 17px;
  }

  .welcome-section h1 {
    font-size: 30px;
  }

  .featured-card {
    min-height: 190px;
    padding: 23px;
  }

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

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

@media (max-width: 480px) {
  .stats-grid {
    gap: 9px;
  }

  .stat-card {
    padding: 13px;
    min-height: 105px;
  }

  .stat-card strong {
    font-size: 24px;
  }

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

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar input,
  .filter-bar select {
    width: 100%;
  }

  .section-heading h2 {
    font-size: 19px;
  }
}

/* =========================================
   SECONDARY PAGE CONSISTENCY FIX
========================================= */

/* Secondary page sidebar navigation */

.sidebar-nav a {
  display: flex;
  align-items: center;
  min-height: 43px;
  padding: 0 12px;
  color: var(--muted);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s, color .2s;
}

.sidebar-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.sidebar-nav a.active {
  color: var(--cyan);
  background: rgba(105, 189, 245, .10);
}

.sidebar-bottom a {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.sidebar-bottom a:hover {
  color: var(--cyan);
}

/* Secondary page topbar */

.topbar-title {
  flex: 1;
  min-width: 0;
}

.topbar-title h1 {
  margin-top: 3px;
  font-size: 25px;
  letter-spacing: -.7px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions input {
  width: min(260px, 25vw);
  height: 40px;
  padding: 0 11px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  font-size: 12px;
}

.topbar-actions input:focus {
  border-color: var(--cyan);
}

.mobile-menu-btn {
  display: none;
  width: 39px;
  height: 39px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
}

/* Shorter game artwork */

.game-art {
  aspect-ratio: 16 / 7;
}

/* Consistent card appearance */

.game-card {
  height: fit-content;
}

.game-info {
  min-height: 150px;
}

/* Responsive secondary pages */

@media (max-width: 760px) {
  .mobile-menu-btn {
    display: block;
  }

  .topbar-title h1 {
    font-size: 19px;
  }

  .topbar-actions input {
    width: min(150px, 30vw);
  }

  .sidebar-nav a {
    min-height: 43px;
  }
}

@media (max-width: 480px) {
  .topbar-title h1 {
    font-size: 16px;
  }

  .topbar-actions input {
    display: none;
  }
}

/* V1.1 */
.game-grid {grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));}
.content-wrap {width:100%;max-width:none;}
.detail-link,.load-more,.detail-close {font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:8px;cursor:pointer;}
.detail-link {text-align:left;} .load-more {grid-column:1/-1;}
.game-details {width:min(680px,90vw);max-height:85vh;overflow:auto;padding:24px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:14px;}
.game-details::backdrop {background:#000a;} .detail-close {float:right;}
.update-stamp {font-size:12px;color:var(--muted);margin:10px 0;}
