/* Site chrome — nav, content pages, footer (ad-network-ready structure) */

.site-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg, #020804);
  color: var(--text, #b8f0c8);
}

.site-container {
  width: min(100%, 42rem);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* —— Header (content pages + injected) —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 0.65rem 1.25rem;
  background: rgba(2, 8, 4, 0.92);
  border-bottom: 1px solid var(--border, #1a3d1a);
  backdrop-filter: blur(6px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.site-header-return {
  margin: 0 0 0 auto;
  padding: 0.35rem 0.55rem;
  font-size: 0.65rem;
  white-space: nowrap;
}

.site-header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.site-header-brand:hover {
  color: var(--accent, #4ade80);
}

.site-header-brand .title {
  font-size: 1rem;
  margin: 0;
}

.site-header-badge {
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--warning, #fbbf24);
  border: 1px solid var(--warning, #fbbf24);
  padding: 0.1rem 0.35rem;
}

/* —— Burger + dropdown (game + site pages) —— */
.header-actions {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 120;
}

.terminal-header .header-actions {
  top: 0;
  right: 2.35rem;
}

.site-header .header-actions {
  position: relative;
  top: auto;
  right: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.site-header .header-actions .btn-sound-toggle {
  position: static;
  width: 2rem;
  height: 2rem;
}

.btn-site-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-family: var(--font);
  color: var(--accent);
  background: rgba(0, 12, 0, 0.65);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.btn-site-menu:hover,
.btn-site-menu[aria-expanded="true"] {
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.25);
}

.btn-site-menu-bars {
  display: block;
  width: 14px;
  height: 10px;
  background: linear-gradient(
    to bottom,
    currentColor 0,
    currentColor 2px,
    transparent 2px,
    transparent 4px,
    currentColor 4px,
    currentColor 6px,
    transparent 6px,
    transparent 8px,
    currentColor 8px,
    currentColor 10px
  );
}

.site-nav-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 12.5rem;
  padding: 0.35rem 0;
  background: rgba(4, 12, 6, 0.98);
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.site-nav-panel[hidden] {
  display: none;
}

.site-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav-list a {
  display: block;
  padding: 0.55rem 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-dim, #7cb88a);
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav-list a:hover {
  color: var(--accent);
  background: rgba(74, 222, 128, 0.08);
}

.site-nav-list a.is-active {
  color: var(--accent);
  background: rgba(74, 222, 128, 0.12);
  font-weight: 600;
}

.site-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0, 0, 0, 0.45);
}

.site-nav-backdrop[hidden] {
  display: none;
}

/* Menu panel must sit above backdrop (backdrop is fixed at root z-index 110). */
body.site-nav-open .app {
  position: relative;
  z-index: 115;
}

body.site-nav-open .site-header {
  z-index: 220;
}

body.site-nav-open .site-nav-panel {
  z-index: 125;
}

/* Game header: room for sound toggle + burger */
.terminal-header {
  padding-right: 4.75rem;
}

/* —— Content pages —— */
.site-main {
  flex: 1;
  padding: 2rem 0 3rem;
}

.site-main h1 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.site-main h2 {
  margin: 1.75rem 0 0.65rem;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fd4a0;
}

.site-main p,
.site-main li {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-dim);
}

.site-main ul,
.site-main ol {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}

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

.site-placeholder-note {
  margin-top: 2rem;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 2px;
}

.ads-slot {
  margin: 1.5rem auto;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  border: 1px dashed var(--border, #1a3d1a);
  border-radius: 2px;
  background: rgba(0, 6, 2, 0.4);
  max-width: 100%;
}

.ads-slot iframe,
.ads-slot ins {
  max-width: 100%;
}

.ads-slot-label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted, #4f8460);
}

.site-footer--game .ads-slot {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.ads-slot--top {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.ads-skyscraper {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  min-height: 600px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem;
  border: 1px dashed var(--border, #1a3d1a);
  border-radius: 2px;
  background: rgba(0, 6, 2, 0.55);
  z-index: 50;
  pointer-events: auto;
}

.ads-skyscraper iframe,
.ads-skyscraper ins {
  max-width: 100%;
}

.ads-skyscraper--left {
  left: 0.5rem;
}

.ads-skyscraper--right {
  right: 0.5rem;
}

/*
 * Show the skyscrapers from 1400px upward (most desktop monitors at 100%
 * browser zoom). Between 1400px and 1659px we shrink the game shell so it
 * never slides underneath the fixed-position ad columns. We use CSS `zoom`
 * (not `transform: scale`) so that descendant position:fixed overlays still
 * cover the full viewport correctly.
 */
@media (min-width: 1400px) {
  .ads-skyscraper {
    display: flex;
  }
}

@media (min-width: 1400px) and (max-width: 1499px) {
  .app {
    zoom: 0.78;
  }
}

@media (min-width: 1500px) and (max-width: 1599px) {
  .app {
    zoom: 0.84;
  }
}

@media (min-width: 1600px) and (max-width: 1659px) {
  .app {
    zoom: 0.9;
  }
}

.contact-list {
  list-style: none;
  padding: 0;
}

.contact-list li {
  margin-bottom: 0.5rem;
}

/* —— Footer —— */
.site-footer {
  padding: 1.25rem 0 1.75rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 6, 2, 0.6);
}

.site-footer--game {
  margin-top: 1rem;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-bottom: 0.75rem;
}

.site-footer-links a {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
}

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

.site-footer-copy {
  margin: 0;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* —— In-game site page overlay (game keeps running underneath) —— */
.site-page-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  background: var(--bg, #020804);
  color: var(--text, #b8f0c8);
}

.site-page-overlay.hidden {
  display: none;
}

.site-page-overlay-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.site-page-overlay-inner {
  padding-top: 1.25rem;
  padding-bottom: 3rem;
}

.site-return-to-game-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent, #4ade80);
  border: 1px solid var(--border, #1a3d1a);
  border-radius: 2px;
  background: rgba(74, 222, 128, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.site-return-to-game-link:hover {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.45);
}

.site-page-overlay-content.site-main {
  padding: 0 0 2rem;
}

.site-page-loading {
  color: var(--text-muted);
  font-size: 0.85rem;
}

body.site-page-open {
  overflow: hidden;
}

.app--site-page-open .terminal-header,
.app--site-page-open #game-screen,
.app--site-page-open .site-footer--game {
  visibility: hidden;
  pointer-events: none;
}

/* —— Cookie consent banner —— */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 650;
  padding: 0.85rem 1rem;
  background: rgba(4, 12, 6, 0.97);
  border-top: 1px solid var(--border, #1a3d1a);
  box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

.cookie-consent[hidden] {
  display: none;
}

.cookie-consent-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  width: min(100%, 56rem);
  margin: 0 auto;
}

.cookie-consent-copy {
  flex: 1 1 16rem;
  min-width: 0;
}

.cookie-consent-title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, #66ff66);
}

.cookie-consent-text {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--text-dim, #7cb88a);
}

.cookie-consent-text a {
  color: var(--accent, #66ff66);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-consent-text a:hover {
  color: #5eead4;
}

.cookie-consent-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.5rem;
}

.cookie-consent-btn {
  min-width: 5.5rem;
  padding: 0.45rem 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.cookie-consent-open {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 640px) {
  .cookie-consent-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-consent-actions {
    width: 100%;
  }

  .cookie-consent-btn {
    flex: 1;
  }
}

@media (max-width: 640px) {
  .site-nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    bottom: 0;
    min-width: min(85vw, 16rem);
    border-radius: 0;
    padding-top: 3rem;
  }

  .header-actions .site-nav-panel {
    top: 0;
  }
}
