/* NexGen — layout */

/* Top bar */
.nx-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(5, 20, 36, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(59, 74, 63, 0.2);
  box-shadow: 0 0 20px rgba(0, 255, 157, 0.1);
}

.nx-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px var(--nx-pad);
  min-height: 48px;
}

.nx-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--nx-aurora-bright);
  font-family: var(--nx-font-display);
  font-weight: 700;
  font-size: 0.8125rem;
  font-style: italic;
  letter-spacing: -0.01em;
  min-width: 0;
}

.nx-brand__logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(86, 255, 168, 0.3);
  background: var(--nx-surface);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  color: var(--nx-aurora-bright);
  flex-shrink: 0;
}

.nx-brand__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nx-topbar__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.nx-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--nx-aurora-dim);
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
}
.nx-icon-btn:hover { color: var(--nx-aurora); }
.nx-icon-btn:active { transform: scale(0.95); }
.nx-icon-btn.is-active { color: var(--nx-aurora); }

/* Home layout */
.nx-home {
  padding-top: 60px;
  padding-bottom: var(--nx-stack-md);
}

.nx-section {
  margin-bottom: var(--nx-stack-lg);
  padding-inline: var(--nx-pad);
}

.nx-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--nx-stack-md);
}

.nx-section__title {
  margin: 0;
  font-family: var(--nx-font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--nx-aurora-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nx-section__more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--nx-font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nx-aurora-bright);
}

/* Ad slots — fluid height follows GPT iframe */
.nx-ad-slot {
  margin-block: var(--nx-stack-md);
}

.nx-ad-slot__unit {
  width: 100%;
  min-height: 0;
}

.nx-ad-slot__unit--fluid {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  height: auto;
  overflow: hidden;
  line-height: 0;
}

.nx-ad-slot__unit--fluid > [id^="div-gpt-ad"],
.nx-ad-slot__unit--fluid > ins.adsbygoogle {
  display: inline-block !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin-inline: auto !important;
  line-height: normal;
  vertical-align: top;
}

.nx-ad-slot__unit--fluid iframe[id^="google_ads_iframe"] {
  display: block;
  max-width: 100%;
  margin-inline: auto;
  vertical-align: top;
}

.nx-ad-slot__unit--fluid > div[id$="__container__"] {
  max-width: 100% !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  margin-inline: auto !important;
}

.nx-ad-slot--catalog {
  margin-block: var(--nx-stack-sm);
}

/* Home — ambient background */
.nx-home {
  position: relative;
  isolation: isolate;
}

.nx-home-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.nx-home-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.24;
  filter: saturate(1.08);
}

.nx-home-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(5, 20, 36, 0.25) 0%, var(--nx-bg) 78%);
}

.nx-home > :not(.nx-home-bg) {
  position: relative;
  z-index: 1;
}

/* Hero slider */
.nx-hero-slider {
  position: relative;
  margin-bottom: var(--nx-stack-lg);
  padding-inline: var(--nx-pad);
}

.nx-hero-slider__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--nx-radius-xl);
  overflow: hidden;
  border: 1px solid rgba(86, 255, 168, 0.25);
  box-shadow: var(--nx-glow);
}

.nx-hero-slider__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.nx-hero-slider__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.nx-hero-slider__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nx-hero-slider__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--nx-bg) 0%, transparent 55%);
  pointer-events: none;
}

.nx-hero-slider__scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 255, 157, 0.05) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.4;
}

.nx-hero-slider__panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--nx-pad);
  z-index: 2;
}

.nx-hero-slider__glass {
  background: rgba(5, 20, 36, 0.55);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--nx-radius-lg);
  padding: var(--nx-stack-md);
  transform: skewX(-3deg);
}

.nx-hero-slider__glass-inner {
  transform: skewX(3deg);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--nx-stack-md);
}

.nx-hero-slider__badge {
  display: inline-block;
  padding: 4px 8px;
  margin-bottom: 6px;
  background: var(--nx-aurora-bright);
  color: var(--nx-cta-ink);
  font-family: var(--nx-font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  border-radius: var(--nx-radius-sm);
}

.nx-hero-slider__title {
  margin: 0 0 4px;
  font-family: var(--nx-font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--nx-aurora-bright);
  line-height: 1.1;
}

.nx-hero-slider__sub {
  margin: 0;
  font-size: 13px;
  color: var(--nx-text-muted);
}

.nx-hero-slider__dots {
  display: flex;
  justify-content: center;
  gap: var(--nx-stack-sm);
  margin-top: var(--nx-stack-md);
}

.nx-hero-slider__dot {
  height: 4px;
  border: none;
  border-radius: 999px;
  background: var(--nx-surface-highest);
  cursor: pointer;
  padding: 0;
  width: 8px;
  transition: width 0.2s, background 0.2s;
}
.nx-hero-slider__dot.is-active {
  width: 32px;
  background: var(--nx-aurora-bright);
}

/* Category hub */
.nx-cat-hub {
  padding-top: 60px;
  padding-bottom: var(--nx-stack-lg);
}

.nx-cat-hub__intro {
  padding: 0 var(--nx-pad) var(--nx-stack-lg);
}

.nx-cat-hub__title {
  margin: 0 0 var(--nx-stack-sm);
  font-family: var(--nx-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--nx-aurora-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nx-cat-hub__sub {
  margin: 0;
  color: var(--nx-text-muted);
  font-size: 14px;
  max-width: 280px;
}

.nx-chip-row {
  display: flex;
  gap: var(--nx-stack-sm);
  padding: 0 var(--nx-pad) var(--nx-stack-lg);
  overflow-x: auto;
  scrollbar-width: none;
}
.nx-chip-row::-webkit-scrollbar { display: none; }

.nx-mosaic {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--nx-gutter);
  padding: 0 var(--nx-pad);
}

.nx-signals {
  padding: var(--nx-stack-lg) var(--nx-pad) 0;
}

.nx-signals__head {
  display: flex;
  align-items: center;
  gap: var(--nx-stack-md);
  margin-bottom: var(--nx-stack-md);
}

.nx-signals__line {
  flex: 1;
  height: 1px;
  background: rgba(59, 74, 63, 0.3);
}

/* Detail — cyber odyssey */
.nx-detail-hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  padding-bottom: var(--nx-stack-lg);
  overflow: hidden;
}

.nx-detail-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.nx-detail-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
}

.nx-detail-hero__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--nx-bg) 0%, rgba(5, 20, 36, 0.2) 50%, transparent 100%);
  z-index: 1;
}

.nx-detail-hero__scanlines {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
  background-size: 100% 2px;
  opacity: 0.5;
}

.nx-detail-hero__content {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 60px var(--nx-pad) 0;
}

.nx-detail-ad {
  position: relative;
  z-index: 5;
}

.nx-detail-ad:not(:empty) {
  padding: var(--nx-stack-md) 0;
  background: var(--nx-bg);
}

.nx-detail-ad:not(:empty) + .nx-detail-main {
  margin-top: 0;
}

.nx-detail-main {
  padding: 0 var(--nx-pad) var(--nx-stack-lg);
  margin-top: calc(-1 * var(--nx-stack-lg));
  position: relative;
  z-index: 4;
}

.nx-sightings-scroll {
  display: flex;
  gap: var(--nx-stack-md);
  overflow-x: auto;
  padding-bottom: 8px;
  margin: 0 calc(-1 * var(--nx-pad));
  padding-inline: var(--nx-pad);
  scrollbar-width: none;
}
.nx-sightings-scroll::-webkit-scrollbar { display: none; }

.nx-bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--nx-stack-md);
}

/* Play */
body[data-page="play"] {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.nx-play-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--nx-bg-lowest);
  padding-top: 48px;
}

.nx-play-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--nx-stack-md);
  padding: 10px var(--nx-pad);
  background: rgba(1, 15, 31, 0.95);
  border-bottom: 1px solid var(--nx-border);
}

.nx-play-bar__title {
  font-family: var(--nx-font-display);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nx-play-frame-wrap { flex: 1; min-height: 0; }

.nx-play-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Footer */
.nx-foot {
  padding: var(--nx-stack-lg) var(--nx-pad) var(--nx-stack-md);
  border-top: 1px solid var(--nx-border);
  text-align: center;
}

.nx-foot__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 16px;
  margin-bottom: 12px;
}
.nx-foot__nav a { color: var(--nx-text-muted); font-size: 13px; }

.nx-foot__bottom {
  font-size: 12px;
  color: var(--nx-text-muted);
  margin: 0;
}

/* Prose */
.nx-prose {
  padding: 60px 0 var(--nx-stack-lg);
  max-width: var(--nx-shell);
  margin-inline: auto;
}
.nx-prose h1 {
  font-family: var(--nx-font-display);
  font-size: 1.75rem;
  margin: 0 0 16px;
  color: var(--nx-aurora-bright);
}
.nx-prose h2 {
  font-family: var(--nx-font-display);
  font-size: 1.1rem;
  margin: 24px 0 8px;
  color: var(--nx-text);
}
.nx-prose p, .nx-prose li {
  color: var(--nx-text-muted);
  overflow-wrap: anywhere;
}

/* Overlays */
.nx-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--nx-bg);
  padding: var(--nx-pad);
  padding-top: 60px;
  overflow-y: auto;
}

.nx-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: var(--nx-stack-md);
}

.nx-search-bar input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--nx-outline);
  border-radius: var(--nx-radius-lg);
  background: var(--nx-surface);
  color: var(--nx-text);
}

.nx-search-empty {
  text-align: center;
  color: var(--nx-text-muted);
  padding: 32px;
}

.nx-fav-backdrop,
.nx-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.nx-fav-backdrop.is-visible,
.nx-drawer-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.nx-fav-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100%, 360px);
  height: 100%;
  background: var(--nx-surface);
  z-index: 160;
  transform: translateX(100%);
  transition: transform 0.25s;
  overflow-y: auto;
  padding: 20px;
  border-left: 1px solid var(--nx-border);
}
.nx-fav-panel.is-open { transform: translateX(0); }

.nx-fav-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.nx-fav-panel__head h2 {
  margin: 0;
  font-family: var(--nx-font-display);
  font-size: 1.2rem;
}

.nx-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 88vw);
  background: var(--nx-surface);
  z-index: 160;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  border-left: 1px solid var(--nx-border);
}
.nx-drawer.is-open { transform: translateX(0); }

.nx-drawer__head {
  font-family: var(--nx-font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--nx-border);
  color: var(--nx-aurora-bright);
}

.nx-drawer__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--nx-text-muted);
  margin: 0 0 8px;
}

.nx-drawer__section { margin-bottom: 22px; }

.nx-drawer__link {
  display: block;
  width: 100%;
  padding: 12px 0;
  border: none;
  background: none;
  text-align: left;
  font: inherit;
  color: var(--nx-text);
  cursor: pointer;
  border-bottom: 1px solid var(--nx-border);
}
.nx-drawer__link.is-active { color: var(--nx-aurora-bright); font-weight: 700; }

.nx-game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--nx-gutter);
}

.nx-breadcrumb {
  font-size: 13px;
  color: var(--nx-text-muted);
  margin-bottom: 12px;
  padding-top: 60px;
}
.nx-breadcrumb a { color: var(--nx-aurora-dim); }

.nx-category-head { margin-bottom: 16px; }
.nx-category-head h1 {
  margin: 0 0 4px;
  font-family: var(--nx-font-display);
  font-size: 1.5rem;
  text-transform: uppercase;
}
.nx-category-count { margin: 0; color: var(--nx-text-muted); font-size: 14px; }

.nx-cat-grid-view {
  padding: 60px var(--nx-pad) var(--nx-stack-lg);
}

.nx-sentinel {
  text-align: center;
  padding: 16px;
  color: var(--nx-text-muted);
  font-size: 13px;
}
