/* ResonanceDream Games — BGames-inspired layout, custom theme */

:root {
  /* Theme (changed from BGames #095169 teal) */
  --rd-theme: #1e2a4a;
  --rd-theme-deep: #152038;
  --rd-theme-soft: #2a3d66;
  --rd-accent: #d4a574;
  --rd-accent-hot: #e8c9a0;
  --rd-cyan: #7eb8c9;
  --rd-cyan-hot: #a8d5e0;
  --rd-lime: #c8e07a;
  --rd-new: #3dff3a;
  --rd-danger: #ed1c24;
  --rd-ink: #0a0a0a;
  --rd-text: #e8f0f5;
  --rd-text-soft: #aff0f5;
  --rd-muted: #b5b5b5;
  --rd-panel: #121212;
  --rd-card-hover: #d4a574;
  /* Card chrome (BGames: matching edge + title bar; theme-shifted from #00c6c2) */
  --rd-card-edge: #7eb8c9;
  --rd-card-bar: #7eb8c9;
  --font-display: "Rajdhani", BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Quicksand", BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-body: 28px;
  --nav-h: 4.5rem;
  --container: 1344px;
  --container-wide: 1744px;
}

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

iframe {
  margin: 0 auto;
}

html {
  background-color: var(--rd-ink);
  color: var(--rd-text);
  font-size: 16px;
  min-width: 300px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  color: var(--rd-text-soft);
  background: var(--rd-ink);
}

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

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.container.is-fullhd {
  max-width: var(--container-wide);
}

.container.is-max-widescreen {
  max-width: var(--container);
}

/* ——— Loading ——— */
html.is-loading,
body.is-loading {
  overflow: hidden;
}

.site-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, var(--rd-theme-soft), var(--rd-ink));
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.site-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-loading__card {
  text-align: center;
  padding: 2rem;
}

.site-loading__logo {
  width: 160px;
  margin: 0 auto 1rem;
}

.site-loading__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: #fff;
  margin: 0;
}

.site-loading__text {
  color: var(--rd-accent);
  margin: 0.35rem 0 1.25rem;
  font-weight: 600;
}

.site-loading__track {
  width: 140px;
  height: 4px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.site-loading__track span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rd-accent), var(--rd-cyan));
  animation: loadSlide 1.1s ease-in-out infinite;
}

@keyframes loadSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

/* ——— Navbar ——— */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--nav-h);
  background: linear-gradient(180deg, var(--rd-theme) 0%, var(--rd-theme-deep) 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  overflow: visible;
}

.navbar .container {
  display: flex;
  align-items: center;
  min-height: var(--nav-h);
  gap: 0.5rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.navbar-brand .logo-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0;
}

.navbar-brand .logo-link img {
  height: 42px;
  width: 42px;
  flex-shrink: 0;
}

.brand-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: #fff;
  line-height: 1.1;
}

.brand-wordmark strong {
  display: block;
  font-size: 1.05em;
  color: #fff;
}

@media (max-width: 420px) {
  .brand-wordmark {
    font-size: 0.95rem;
  }
}

.navbar-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 8px;
  padding: 0.6rem;
}

.navbar-burger span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.navbar-menu {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-width: 0;
}

.navbar-start {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.navbar-start::-webkit-scrollbar {
  display: none;
}

.navbar-item {
  display: flex;
  align-items: center;
  position: static;
}

.navbar-link,
.navbar-item > a.nav-cat {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.9rem;
  height: var(--nav-h);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  color: #fff;
  border-radius: 0;
  white-space: nowrap;
  background: transparent;
  transition: color 0.15s ease;
}

/* BGames-style hover: cyan underline + center caret (no fill) */
.navbar-link::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0.55rem;
  height: 3px;
  border-radius: 2px;
  background: var(--rd-card-edge);
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.navbar-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.15rem;
  width: 0;
  height: 0;
  margin: 0;
  border-style: solid;
  border-width: 7px 7px 0 7px;
  border-color: var(--rd-card-edge) transparent transparent transparent;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.navbar-item.has-dropdown:hover .navbar-link,
.navbar-item.has-dropdown.is-active .navbar-link,
.navbar-link:hover,
.nav-cat:hover {
  background: transparent;
  color: #fff;
}

.navbar-item.has-dropdown:hover .navbar-link::before,
.navbar-item.has-dropdown.is-active .navbar-link::before,
.navbar-link:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

.navbar-item.has-dropdown:hover .navbar-link::after,
.navbar-item.has-dropdown.is-active .navbar-link::after {
  opacity: 1;
}

.navbar-dropdown {
  display: none;
  position: absolute;
  top: calc(100% - 2px);
  left: 50%;
  transform: translateX(-50%);
  width: min(1120px, calc(100vw - 2rem));
  padding: 0;
  background: transparent;
  z-index: 60;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55));
}

.navbar-item.has-dropdown.is-active .navbar-dropdown {
  display: block;
}

@media (min-width: 1024px) {
  .navbar-item.has-dropdown:hover .navbar-dropdown {
    display: block;
  }
}

.mega-panel {
  display: grid;
  grid-template-columns: 1.55fr 0.9fr;
  gap: 1.25rem;
  padding: 1.15rem 1.25rem 1.25rem;
  border-radius: 22px;
  border: 3px solid var(--rd-lime);
  background: linear-gradient(160deg, rgba(21, 32, 56, 0.96), rgba(10, 14, 24, 0.98));
  box-shadow:
    0 0 0 1px rgba(200, 224, 122, 0.25),
    0 0 28px rgba(126, 184, 201, 0.28),
    inset 0 0 40px rgba(126, 184, 201, 0.06);
}

.mega-col-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  color: #fff;
}

.mega-games-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.mega-games-grid .tile-card {
  grid-row: auto;
  grid-column: auto;
  height: auto;
  border-width: 2px;
  border-radius: 12px;
}

.mega-games-grid .tile-card .image {
  aspect-ratio: 16 / 10;
  flex: none;
  min-height: 72px;
}

.mega-games-grid .tile-card .content {
  min-height: 1.9rem;
  padding: 0.55rem 0.35rem 0.4rem;
}

.mega-games-grid .tile-card .name {
  font-size: 0.78rem;
}

.mega-games-grid .tile-card:hover {
  transform: scale(1.04);
}

.mega-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mega-tags {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  flex: 1;
  align-content: start;
}

.mega-tag {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0 0.7rem;
  overflow: hidden;
  border-radius: 10px;
  border: 2px solid var(--rd-card-edge);
  background: rgba(126, 184, 201, 0.18);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  transition: background 0.15s ease, transform 0.15s ease;
}

.mega-tag:hover {
  background: rgba(126, 184, 201, 0.35);
  transform: translateY(-1px);
}

.mega-tag span {
  position: relative;
  z-index: 1;
}

.mega-tag img {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 42%;
  object-fit: cover;
  opacity: 0.7;
  mask-image: linear-gradient(90deg, transparent, #000 35%);
}

.mega-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  margin-top: 1rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.35rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #9fd0db, var(--rd-card-edge));
  color: #0a1620;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: capitalize;
  box-shadow: 0 0 18px rgba(126, 184, 201, 0.45);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.mega-all-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.mega-loading,
.mega-empty {
  grid-column: 1 / -1;
  padding: 1.5rem 0.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
  font-size: 0.9rem;
}

.navbar-end {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}

.search-btn,
.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  transition: background 0.15s;
}

.search-btn:hover,
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ——— Shell / sections ——— */
.site-shell {
  flex: 1;
  background: var(--rd-theme);
  border-bottom-left-radius: var(--radius-body);
  border-bottom-right-radius: var(--radius-body);
  color: #fff;
  padding: 1.25rem 0 2rem;
  overflow: hidden;
}

.section {
  padding: 1rem 0 1.5rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
}

.section-title span {
  color: var(--rd-accent);
}

.filter-tabs {
  display: inline-flex;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.22);
  padding: 0.25rem;
  border-radius: 999px;
}

.filter-tabs button {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.filter-tabs button.is-active {
  background: var(--rd-accent);
  color: var(--rd-ink);
}

/* ——— Game grid & tiles (BGames card chrome) ——— */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 8px;
  grid-auto-flow: dense;
  gap: 0.45rem;
}

@media (min-width: 640px) {
  .games-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
  }
}

@media (min-width: 900px) {
  .games-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .games-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

@media (min-width: 1400px) {
  .games-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

@media (min-width: 1700px) {
  .games-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
}

/* Category page: compact uniform tiles */
.games-grid--category {
  grid-auto-rows: auto;
  grid-auto-flow: row;
  gap: 0.5rem;
}

.games-grid--category .tile-card,
.games-grid--category .tile-card.is-wide,
.games-grid--category .tile-card.is-tall,
.games-grid--category .tile-card.is-big {
  grid-column: auto;
  grid-row: auto;
  height: auto;
}

.games-grid--category .tile-card .image {
  flex: none;
  aspect-ratio: 16 / 10;
  min-height: 0;
}

.tile-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  grid-row: span 11;
  padding: 0;
  border: 2px solid var(--rd-card-edge);
  border-radius: 12px;
  overflow: hidden;
  background: #0a1218;
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
  will-change: transform;
}

.tile-card.is-wide {
  grid-column: span 2;
  grid-row: span 10;
}

.tile-card.is-tall {
  grid-row: span 20;
}

.tile-card.is-big {
  grid-column: span 2;
  grid-row: span 20;
}

@media (max-width: 639px) {
  .tile-card.is-wide {
    grid-column: span 2;
    grid-row: span 10;
  }

  .tile-card.is-tall {
    grid-row: span 11;
  }

  .tile-card.is-big {
    grid-column: span 2;
    grid-row: span 16;
  }
}

.tile-card .image {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.28);
}

.tile-card .image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile-card .content {
  position: relative;
  margin: 0;
  flex: 0 0 auto;
  min-height: 1.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.35rem 0.4rem;
  background: var(--rd-card-bar);
  transition: background-color 0.18s ease;
}

.tile-card .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.15;
  color: #fff;
  text-align: center;
  transition: color 0.18s ease;
}

.tile-card .name span {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hover: white chrome + dark title (badge stays visible) */
.tile-card:hover {
  border-color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  transform: scale(1.04) translateZ(0);
  z-index: 2;
}

.tile-card:hover .content {
  background: #fff;
}

.tile-card:hover .name {
  color: #0a0a0a;
}

.badge {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -50%);
  z-index: 3;
  border-radius: 9999px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1rem;
  padding: 0.02rem 0.55rem;
  text-transform: capitalize;
  white-space: nowrap;
  pointer-events: none;
}

.badge.is-new {
  background: linear-gradient(180deg, #3dff3a, #1db81a);
  box-shadow:
    inset 0 2px 0 0 #9dff9b,
    2px 2px 3px 0 rgba(10, 10, 10, 0.45);
}

.badge.is-best {
  background: linear-gradient(180deg, var(--rd-accent), #b07d45);
  box-shadow: 2px 2px 3px 0 rgba(10, 10, 10, 0.45);
}

.skeleton-tile {
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  border: 2px solid rgba(126, 184, 201, 0.35);
  background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.14), rgba(255,255,255,0.06));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ——— Category / tag cards ——— */
.tag-grid {
  margin-top: 0.5rem;
}

.tags-title {
  margin-bottom: 0.85rem;
}

.tags-title a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  text-transform: uppercase;
  color: #fff;
}

.tags-title span {
  color: var(--rd-accent);
}

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

@media (min-width: 700px) {
  .tags-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tag-card {
  position: relative;
  display: flex;
  align-items: center;
  height: 2.75rem;
  padding: 0 0.85rem;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.15s ease, background 0.15s ease;
}

.tag-card:hover {
  transform: translateY(-2px);
  background: rgba(212, 165, 116, 0.25);
}

.tag-card span {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.tag-card img {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 45%;
  object-fit: cover;
  opacity: 0.55;
  mask-image: linear-gradient(90deg, transparent, #000 40%);
}

/* ——— Side panels (last played / favourites) ——— */
.utility-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.utility-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--rd-cyan-hot);
}

.utility-chip strong {
  color: #fff;
  margin-left: 0.15rem;
}

/* ——— SEO footer description ——— */
.footer-description {
  background: var(--rd-panel);
  color: var(--rd-muted);
  padding: 2.5rem 0 2rem;
  text-align: center;
  z-index: 1;
}

.footer-description .content {
  max-width: 920px;
  margin: 0 auto;
}

.footer-description h1,
.footer-description h2 {
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.footer-description h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

.footer-description h2 {
  font-size: 1.2rem;
  margin: 1.75rem 0 0.75rem;
}

.footer-description p {
  margin: 0 0 0.85rem;
  line-height: 1.7;
  font-size: 0.95rem;
}

/* ——— Site footer ——— */
.section.footer {
  background: #050505;
  padding: 2rem 0 2.5rem;
  color: var(--rd-muted);
}

.footer-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem 2rem;
  margin-bottom: 1.25rem;
}

.footer-menu a {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: #fff;
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

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

.footer-copyright {
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.8;
}

.footer-asset {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.footer-asset img {
  height: 48px;
  width: 48px;
  opacity: 0.9;
}

/* ——— Search overlay ——— */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 10, 10, 0.86);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1rem 2rem;
}

.search-overlay.is-open {
  display: flex;
}

.search-box {
  width: min(640px, 100%);
  background: var(--rd-theme);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.search-box input {
  width: 100%;
  height: 3rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  padding: 0 1rem;
  font-size: 1rem;
  outline: none;
}

.search-box input:focus {
  border-color: var(--rd-accent);
}

.search-games-results {
  margin-top: 0.75rem;
  max-height: 50vh;
  overflow: auto;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem;
  border-radius: 8px;
}

.search-result:hover {
  background: rgba(255, 255, 255, 0.08);
}

.search-result img {
  width: 72px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

.search-result span {
  font-family: var(--font-display);
  font-weight: 700;
}

/* ——— Inner pages ——— */
.page-shell {
  flex: 1;
  background: var(--rd-theme);
  border-bottom-left-radius: var(--radius-body);
  border-bottom-right-radius: var(--radius-body);
  padding: 1.5rem 0 2.5rem;
}

.page-card {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 16px;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--rd-accent);
  margin-bottom: 1rem;
}

.back-link:hover {
  color: var(--rd-accent-hot);
}

.detail-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .detail-layout {
    grid-template-columns: 340px 1fr;
    align-items: start;
  }
}

.detail-cover {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: rgba(0, 0, 0, 0.3);
}

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

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 3rem;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--rd-accent-hot), var(--rd-accent));
  color: var(--rd-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-play:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-like {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 3rem;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
}

.btn-like:hover {
  border-color: var(--rd-accent);
  color: var(--rd-accent);
}

.prose-rd h1,
.prose-rd h2 {
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
}

.prose-rd h1 { font-size: 1.75rem; margin: 0 0 1rem; }
.prose-rd h2 { font-size: 1.2rem; margin: 1.5rem 0 0.6rem; }
.prose-rd p,
.prose-rd li {
  color: rgba(232, 240, 245, 0.82);
  line-height: 1.7;
}
.prose-rd ul { padding-left: 1.2rem; }
.prose-rd a { color: var(--rd-accent); text-decoration: underline; }

/* ——— Play page ——— */
.play-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #050505;
}

.play-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--rd-theme);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.play-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.08);
}

.play-bar__btn:hover {
  background: var(--rd-accent);
  color: var(--rd-ink);
}

.play-bar__center {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.play-bar__logo {
  height: 28px;
  width: auto;
}

.play-bar__title {
  font-family: var(--font-display);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-stage {
  position: relative;
  flex: 1;
  background: #000;
  min-height: 60vh;
}

.play-stage__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.play-stage__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: radial-gradient(circle at center, var(--rd-theme-soft), #000);
  z-index: 2;
}

.play-stage__loading.is-hidden {
  display: none;
}

.play-stage__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}

.play-stage__hint {
  color: var(--rd-muted);
  font-size: 0.9rem;
}

/* ——— Mobile nav (accordion — BGames style) ——— */
.nav-chevron {
  display: none;
}

.mobile-cat-panel {
  display: none;
}

@media (max-width: 1023px) {
  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 50;
  }

  body {
    padding-top: var(--nav-h);
  }

  .navbar-burger {
    display: inline-flex;
    order: -1;
  }

  .navbar-menu {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    flex-direction: column;
    padding: 0.75rem 0.65rem 1.25rem;
    max-height: none;
    height: calc(100dvh - var(--nav-h));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #152038;
    box-shadow: inset 3px 0 0 0 #b8ff3c, inset -3px 0 0 0 #b8ff3c;
    z-index: 49;
  }

  .navbar-menu.is-active {
    display: flex;
  }

  html.nav-open,
  body.nav-open {
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
  }

  body.nav-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
  }

  body.nav-open .navbar-menu {
    touch-action: pan-y;
  }

  .navbar-start {
    flex-direction: column;
    width: 100%;
    overflow: visible;
    gap: 0.65rem;
  }

  .navbar-item {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  /* Collapsed = capsule bar (radius only safe when content is hidden) */
  .navbar-item.has-dropdown {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: #243656;
    border-radius: 1.25rem;
    overflow: hidden;
    border: none;
  }

  /* Expanded = large rounded card (header on top, list below) */
  .navbar-item.has-dropdown.is-active {
    border-radius: 1.65rem;
    background: #1c2d4a;
  }

  .navbar-link,
  .navbar-item > a.nav-cat {
    position: relative;
    display: flex;
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    min-height: 3.15rem;
    justify-content: center;
    align-items: center;
    padding: 0.95rem 2.75rem;
    font-size: 1.12rem;
    font-weight: 700;
    text-transform: capitalize;
    letter-spacing: 0.01em;
    color: #e8f7ff;
    background: transparent;
  }

  .navbar-link::before,
  .navbar-link::after {
    display: none !important;
  }

  .navbar-link__label {
    display: block;
    text-align: center;
  }

  .nav-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 1.05rem;
    top: 50%;
    width: 1.1rem;
    height: 1.1rem;
    transform: translateY(-50%);
    color: #e8f7ff;
  }

  .nav-chevron svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
  }

  .navbar-item.has-dropdown.is-active .nav-chevron svg {
    transform: rotate(180deg);
  }

  .navbar-item.has-dropdown.is-active .navbar-link {
    color: #e8f7ff;
  }

  .navbar-dropdown {
    position: static !important;
    display: none !important;
    width: 100% !important;
    max-width: none;
    transform: none !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    filter: none;
    margin: 0;
    padding: 0 1rem 1.05rem;
    background: transparent;
    flex: 0 0 auto;
  }

  /* Ignore sticky :hover on touch devices — only .is-active opens */
  .navbar-item.has-dropdown:hover .navbar-dropdown {
    display: none !important;
  }

  .navbar-item.has-dropdown.is-active .navbar-dropdown,
  .navbar-item.has-dropdown.is-active:hover .navbar-dropdown {
    display: block !important;
  }

  .mega-panel {
    display: none !important;
  }

  .mobile-cat-panel {
    display: block;
    padding-top: 0.15rem;
  }

  .mobile-cat-title {
    margin: 0 0 0.85rem;
    padding: 0 0.15rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.2;
    color: #fff;
    text-align: left;
  }

  .mobile-cat-title em {
    font-style: normal;
    color: #b8ff3c;
  }

  .mobile-game-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }

  .mobile-game-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    text-decoration: none;
  }

  .mobile-game-row img {
    width: 78px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.3);
  }

  .mobile-game-row span {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: #f2fbff;
    line-height: 1.25;
  }

  .mobile-all-link {
    display: none;
  }

  .navbar-end {
    width: 100%;
    margin: 0.5rem 0 0;
    justify-content: flex-end;
  }

  .site-shell,
  .page-shell {
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
  }
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.empty-state a {
  color: var(--rd-accent);
  text-decoration: underline;
}
