:root {
  --bg: #0b0b12;
  --bg-2: #12121c;
  --panel: rgba(24, 24, 39, 0.88);
  --panel-solid: #181827;
  --line: rgba(255, 255, 255, 0.11);
  --text: #f4f5fb;
  --muted: #9ca3b6;
  --cyan: #e11d48;
  --teal: #be123c;
  --magenta: #71717a;
  --amber: #d4d4d8;
  --success: #10b981;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body.site-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(225, 29, 72, 0.12), transparent 30%),
    linear-gradient(145deg, #0b0b12 0%, #12121c 54%, #08080d 100%);
  color: var(--text);
  font-family: "Source Sans 3", sans-serif;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  color: #fb7185;
}

h1,
h2,
h3,
.navbar-brand,
.eyebrow {
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0;
}

.site-nav {
  background: rgba(10, 10, 18, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.35rem;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--cyan);
  border-radius: 6px;
  color: #fff;
  background: var(--cyan);
  box-shadow: 0 0 22px rgba(225, 29, 72, 0.28);
}

.nav-search {
  width: min(22rem, 100%);
}

.nav-search i,
.hero-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  z-index: 2;
}

.nav-search .form-control,
.hero-search .form-control {
  padding-left: 2.75rem;
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  color: var(--text);
}

.form-control,
.form-select {
  background-color: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text);
  border-radius: var(--radius);
}

.form-control:focus,
.form-select:focus {
  background-color: rgba(255, 255, 255, 0.09);
  border-color: var(--cyan);
  color: var(--text);
  box-shadow: 0 0 0 0.2rem rgba(225, 29, 72, 0.16);
}

.form-select option {
  color: #12121c;
}

.btn {
  border-radius: 7px;
  font-weight: 700;
}

.btn-cyan {
  color: #fff;
  background: var(--cyan);
  border: 0;
  box-shadow: 0 0 18px rgba(225, 29, 72, 0.24);
}

.btn-cyan:hover {
  color: #fff;
  background: var(--teal);
  filter: none;
}

.btn-outline-info {
  color: var(--text);
  border-color: rgba(225, 29, 72, 0.55);
}

.btn-outline-info:hover,
.btn-outline-info:focus {
  color: #fff;
  background-color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 0 0.2rem rgba(225, 29, 72, 0.16);
}

.hero-section {
  padding: clamp(2rem, 5vw, 4rem) 0 1.25rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(20rem, 1.25fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  color: var(--cyan);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.hero-copy h1,
.page-header h1,
.detail-copy h1 {
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 0.92;
  max-width: 11ch;
  margin: 0.65rem 0 1rem;
}

.hero-copy h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
  max-width: 13ch;
  margin: 0.45rem 0 0.75rem;
}

.hero-copy p,
.page-header p,
.detail-copy p {
  color: var(--muted);
  font-size: 1.18rem;
  max-width: 42rem;
}

.hero-copy p {
  font-size: 1rem;
  max-width: 34rem;
}

.hero-search {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.hero-search .form-control {
  height: 3.5rem;
}

.autocomplete-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 30;
  background: #10101a;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.4);
}

.autocomplete-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.autocomplete-item img {
  width: 2.4rem;
  height: 3.1rem;
  object-fit: cover;
  border-radius: 4px;
}

.autocomplete-item small,
.compact-title small,
.related-list small {
  display: block;
  color: var(--muted);
}

.featured-carousel {
  min-height: 26rem;
}

.spotlight-card {
  display: block;
  position: relative;
  min-height: 26rem;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #10101a;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

.spotlight-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
}

.spotlight-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 25%, rgba(10, 10, 18, 0.97));
}

.spotlight-content {
  position: absolute;
  z-index: 2;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.5rem;
}

.spotlight-content span {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.spotlight-content h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: var(--text);
}

.spotlight-content p {
  color: var(--muted);
  max-width: 34rem;
}

.filter-band {
  padding: 1rem 0;
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.filter-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
}

.filter-chip,
.tag-chip,
.genre-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.filter-chip.active,
.filter-chip:hover,
.tag-chip:hover,
.genre-badge:hover {
  border-color: var(--cyan);
  color: #fff;
  background: var(--cyan);
}

.tag-chip {
  border-color: color-mix(in srgb, var(--tag-color), white 10%);
}

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

.content-stack {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
}

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

.section-heading h2,
.content-panel h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.section-link {
  font-weight: 700;
}

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

.game-grid.dense {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.game-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 18, 28, 0.86);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 0 34px rgba(225, 29, 72, 0.14);
}

.game-cover-link {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.game-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.game-card:hover .game-cover {
  transform: scale(1.05);
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 0.8rem;
  padding: 1rem;
  background: linear-gradient(180deg, transparent, rgba(7, 7, 12, 0.95));
  opacity: 0;
  transition: opacity 180ms ease;
}

.game-card:hover .game-overlay {
  opacity: 1;
}

.game-overlay p {
  color: var(--text);
  margin: 0;
}

.game-card-body {
  padding: 1rem;
}

.game-card h3 {
  font-size: 1.25rem;
  line-height: 1.1;
  margin: 0;
}

.game-card h3 a {
  color: var(--text);
}

.rating-pill {
  white-space: nowrap;
  color: var(--text);
  font-weight: 700;
}

.badge-row,
.game-meta,
.download-meta,
.detail-stats,
.detail-actions,
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.badge-row {
  margin: 0.85rem 0;
}

.genre-badge {
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
}

.game-meta,
.download-meta {
  color: var(--muted);
  font-size: 0.92rem;
  justify-content: space-between;
}

.home-lists-grid,
.split-feature {
  display: grid;
  grid-template-columns: minmax(14rem, 0.72fr) minmax(24rem, 1.56fr) minmax(14rem, 0.72fr);
  gap: 1.5rem;
}

.home-list-panel {
  min-width: 0;
}

.home-new-arrivals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.home-new-arrivals .game-card h3 {
  font-size: 1.05rem;
}

.home-new-arrivals .game-card-body {
  padding: 0.8rem;
}

.compact-list {
  display: grid;
  gap: 0.8rem;
}

.compact-game,
.related-list a,
.timeline-list a {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.compact-game img,
.related-list img {
  width: 2.8rem;
  height: 3.6rem;
  object-fit: cover;
  border-radius: 5px;
}

.rank {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--cyan);
  color: #fff;
  font-weight: 800;
}

.random-pick,
.filter-panel,
.content-panel,
.empty-state,
.error-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.random-pick {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: clamp(1.25rem, 3vw, 2.25rem);
}

.random-pick img {
  width: min(12rem, 34vw);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
}

.page-header {
  padding: clamp(3rem, 7vw, 5rem) 0 2rem;
  background:
    linear-gradient(180deg, rgba(225, 29, 72, 0.08), transparent),
    rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--line);
}

.filter-panel {
  padding: 1rem;
}

.pagination-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.empty-state,
.error-panel {
  padding: clamp(2rem, 5vw, 4rem);
  text-align: center;
}

.empty-state.compact {
  padding: 1.25rem;
}

.mods-header {
  background:
    radial-gradient(circle at 12% 0%, rgba(225, 29, 72, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
}

.mod-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
}

.mod-hub-card {
  position: relative;
  min-height: 15rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(8, 8, 13, 0.18), rgba(8, 8, 13, 0.96)),
    var(--hub-image);
  background-position: center;
  background-size: cover;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.mod-hub-card:hover {
  color: #fff;
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 0 34px rgba(225, 29, 72, 0.15);
}

.mod-hub-card span,
.mod-hub-card b {
  color: #fecdd3;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mod-hub-card h3 {
  margin: 0.35rem 0;
  font-size: 1.65rem;
}

.mod-hub-card p {
  max-height: 4.6rem;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
}

.mod-hub-card b {
  display: inline-flex;
  padding: 0.2rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--tag-color), white 20%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.mod-card .genre-badge[style],
.mod-hero .genre-badge[style] {
  border-color: color-mix(in srgb, var(--tag-color), white 14%);
}

.mod-download-row {
  border-left: 3px solid var(--cyan);
}

.media-header {
  background:
    radial-gradient(circle at 80% 0%, rgba(225, 29, 72, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
}

.media-card .game-cover-link {
  aspect-ratio: 2 / 3;
}

.media-download-row {
  border-left: 3px solid var(--cyan);
}

.season-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.9rem;
}

.season-card {
  display: grid;
  gap: 0.7rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.season-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 6px;
}

.season-card small,
.episode-row small {
  display: block;
  color: var(--muted);
}

.episode-list {
  display: grid;
  gap: 0.85rem;
}

.episode-row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}

.episode-row img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
}

.episode-row b {
  color: #fecdd3;
}

.tmdb-credit {
  color: var(--muted);
  font-size: 0.85rem;
}

.game-hero {
  position: relative;
  padding: clamp(3rem, 7vw, 6rem) 0 2rem;
  background-image: linear-gradient(90deg, rgba(10, 10, 18, 0.95), rgba(10, 10, 18, 0.58)), var(--hero-image);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}

.game-hero-grid,
.detail-layout {
  display: grid;
  grid-template-columns: minmax(14rem, 20rem) 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.detail-layout {
  grid-template-columns: minmax(0, 1fr) 22rem;
}

.detail-cover {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
}

.detail-copy h1 {
  max-width: 14ch;
}

.detail-stats {
  color: var(--muted);
  margin: 1.25rem 0;
}

.content-panel {
  padding: clamp(1rem, 3vw, 1.5rem);
  margin-bottom: 1.25rem;
}

.prose {
  color: #e4e6ef;
  line-height: 1.75;
}

.prose.small {
  font-size: 0.94rem;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.8rem;
}

.screenshot-button {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: transparent;
}

.screenshot-button img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.download-list {
  display: grid;
  gap: 0.8rem;
}

.download-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(225, 29, 72, 0.16);
  color: #fda4af;
}

.rating-form {
  display: flex;
  gap: 0.35rem;
}

.rating-form button {
  border: 0;
  background: transparent;
  color: #526172;
  font-size: 1.8rem;
}

.rating-form button.active,
.rating-form button:hover {
  color: var(--cyan);
}

.comment-form textarea {
  resize: vertical;
}

.comment-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.comment-item {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.8rem;
}

.comment-reply {
  margin-left: 2rem;
}

.comment-avatar {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  background: var(--cyan);
  color: #fff;
  font-weight: 800;
}

.comment-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  color: var(--muted);
}

.info-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 1rem;
}

.info-list dt {
  color: var(--muted);
}

.related-list,
.timeline-list {
  display: grid;
  gap: 0.7rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 2rem;
  background: rgba(1, 6, 12, 0.88);
}

.lightbox.open {
  display: grid;
}

.lightbox img {
  max-width: min(90vw, 70rem);
  max-height: 84vh;
  border-radius: var(--radius);
}

.lightbox button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 2rem;
}

.auth-page {
  min-height: calc(100vh - 10rem);
  display: grid;
  place-items: center;
  padding: 3rem 1rem;
}

.auth-card {
  width: min(100%, 28rem);
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.auth-card.wide {
  width: min(100%, 42rem);
}

.oauth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.auth-switch {
  margin: 1rem 0 0;
  color: var(--muted);
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.profile-avatar {
  width: 7rem;
  height: 7rem;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  background: rgba(5, 13, 25, 0.7);
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

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

@media (max-width: 991px) {
  .hero-grid,
  .home-lists-grid,
  .split-feature,
  .game-hero-grid,
  .detail-layout,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .featured-carousel,
  .spotlight-card {
    min-height: 26rem;
  }

  .detail-cover {
    max-width: 18rem;
  }
}

@media (max-width: 575px) {
  .hero-search,
  .download-row,
  .episode-row,
  .profile-top {
    flex-direction: column;
    align-items: stretch;
  }

  .episode-row {
    display: flex;
  }

  .hero-search .btn {
    width: 100%;
  }

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

  .game-card-body {
    padding: 0.8rem;
  }

  .game-card h3 {
    font-size: 1.05rem;
  }

  .random-pick {
    grid-template-columns: 1fr;
  }
}
