:root {
  --bg: #07080f;
  --card: #0e1120;
  --text: #e8e4d8;
  --muted: #8a8fa8;
  --gold: #c9a84c;
  --purple: #7c5cff;
  --border: rgba(201,168,76,0.2);
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,.5);
}

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

/* [hidden] must always win — prevents display:flex on .game-cover overriding it */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: 'Cinzel', 'Georgia', serif;
  line-height: 1.2;
  color: var(--gold);
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.6rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; max-width: 70ch; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ── */
.site-header {
  background: rgba(7,8,15,0.95);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-logo {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.site-nav { display: flex; gap: 24px; }
.site-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}
.site-nav a:hover, .site-nav a[aria-current] { color: var(--gold); text-decoration: none; }

/* ── Game stage ── */
.game-section { padding: 32px 0 16px; }

.game-stage-wrapper {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.game-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  /* the simulator's start screen needs ~540px of height; 16:9 at 900px is only 506 */
  min-height: 540px;
  /* Never push below the fold; cap at viewport minus header+controls */
  max-height: calc(100vh - 160px);
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(124,92,255,0.15), var(--shadow-md);
}

.game-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 9%;
  gap: 20px;
  background: linear-gradient(160deg, #07080f 0%, #0a0d1e 60%, #0d0a1a 100%);
  cursor: pointer;
}

/* scrim so the play button stays readable over the cover art */
.game-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(7,8,15,0.05) 0%, rgba(7,8,15,0.35) 50%, rgba(7,8,15,0.85) 100%);
  pointer-events: none;
}

.game-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}

.play-btn {
  position: relative;
  z-index: 2;
  background: var(--gold);
  color: #07080f;
  border: none;
  border-radius: var(--radius);
  padding: 14px 40px;
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 4px 20px rgba(201,168,76,0.4);
  min-height: 44px;
}
.play-btn:hover { background: #e0bf6a; transform: translateY(-2px); }
.play-btn:active { transform: translateY(0); }

.cover-title {
  position: relative;
  z-index: 2;
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  background: #07080f;
  color: var(--muted);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Game controls ── */
.game-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  justify-content: flex-end;
}

.ctrl-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 16px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  min-height: 36px;
}
.ctrl-btn:hover { color: var(--gold); border-color: var(--gold); }
.ctrl-btn[aria-pressed="true"] { color: var(--gold); }

/* ── Content sections ── */
.content-section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.info-card h3 { margin-bottom: 12px; }

/* ── FAQ ── */
.faq-list { list-style: none; }
.faq-list li {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.faq-list li:last-child { border-bottom: none; }
.faq-q {
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 6px;
}
.faq-a { color: var(--text); font-size: 0.95rem; }

/* ── Related pages ── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.related-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s, transform 0.15s;
  display: block;
  text-decoration: none;
  color: var(--text);
}
.related-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  text-decoration: none;
}
.related-card h3 { color: var(--gold); margin-bottom: 8px; }
.related-card p { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* ── Footer ── */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 48px;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer-brand {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
}

.footer-nav { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-nav a { color: var(--muted); font-size: 0.85rem; }
.footer-nav a:hover { color: var(--gold); }

.footer-copy { color: var(--muted); font-size: 0.8rem; margin: 0; }

/* ── Page prose ── */
.page-hero {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
}
.page-hero h1 { margin-bottom: 12px; }
.page-hero .lead { color: var(--muted); font-size: 1.05rem; max-width: 70ch; }

.prose { max-width: 820px; padding: 40px 0; }
.prose h2 { margin-top: 2rem; margin-bottom: 0.75rem; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose strong { color: var(--gold); }

/* common */
@media (max-width: 640px) {
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.3rem; }
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 0.8rem; }
  .section-grid { grid-template-columns: 1fr; gap: 20px; }
  .related-grid { grid-template-columns: 1fr; }
  .play-btn { padding: 12px 28px; font-size: 1rem; }
  .game-controls { justify-content: center; }
  /* phones: let the stage use most of the screen; a 4:3 box is too short for the start screen */
  .game-stage { aspect-ratio: auto; height: 86vh; min-height: 620px; max-height: 760px; }
}


/* focus-visible */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── Language switcher ── */
.lang-switch { display: flex; gap: 6px; align-items: center; }
.lang-switch a {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  line-height: 1.2;
}
.lang-switch a:hover { color: var(--gold); text-decoration: none; }
.lang-switch a[aria-current="true"] { color: var(--gold); border-color: var(--border); }

@media (max-width: 640px) {
  .site-header .container { height: auto; min-height: 56px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; row-gap: 4px; }
  .lang-switch { gap: 2px; }
  .lang-switch a { padding: 3px 5px; font-size: 0.72rem; }
}

/* ── Ads ── */
/* Containers stay hidden until the loader flips them (see script.js); an empty
   slot would otherwise leave a gap on page types that do not carry ads. */
.ads-native-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 8px;
}
.ads-native {
  min-height: 96px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.ads-native iframe { max-width: 100%; }
.ads-social-holder { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; }

@media (max-width: 640px) {
  .ads-native-wrap { padding: 16px 12px 4px; }
}
