:root {
  --bg: #0b0908;
  --bg-soft: #12100e;
  --panel: rgba(29, 22, 17, .88);
  --panel-2: rgba(45, 31, 21, .72);
  --text: #f7efe4;
  --muted: #b8aa98;
  --gold: #e1a94b;
  --gold-2: #f5cc7b;
  --copper: #9d5c2b;
  --line: rgba(240, 198, 119, .18);
  --ok: #87d7a4;
  --shadow: 0 24px 80px rgba(0,0,0,.45);
  --radius: 22px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(157,92,43,.14), transparent 34rem),
    radial-gradient(circle at 90% 20%, rgba(225,169,75,.08), transparent 30rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }

.shell { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  backdrop-filter: blur(18px);
  background: rgba(11,9,8,.78);
  border-bottom: 1px solid var(--line);
}
.nav { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 900; letter-spacing: .12em; }
.brand img { width: 38px; height: 38px; object-fit: contain; }
.brand span { font-size: .95rem; }
.nav-links { display: flex; gap: 28px; align-items: center; color: var(--muted); font-size: .94rem; }
.nav-links a:hover { color: var(--text); }

.hero {
  position: relative;
  min-height: 690px;
  display: grid;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(11,9,8,.96) 0%, rgba(11,9,8,.86) 40%, rgba(11,9,8,.38) 72%, rgba(11,9,8,.72) 100%),
    linear-gradient(0deg, var(--bg) 0%, transparent 40%),
    url('../img/wanted-board.webp') center/cover no-repeat;
  opacity: .9;
}
.hero-content { position: relative; z-index: 1; padding: 84px 0 96px; max-width: 760px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--gold-2); font-weight: 800; font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 32px; height: 1px; background: var(--gold); }
.hero h1 { margin: 20px 0 18px; font-size: clamp(3.2rem, 8vw, 6.7rem); line-height: .91; letter-spacing: -.055em; max-width: 900px; }
.hero h1 em { color: var(--gold-2); font-style: normal; }
.hero p { color: #d5c9ba; font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 680px; margin: 0; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 14px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #231407; box-shadow: 0 10px 34px rgba(225,169,75,.16); }
.btn-ghost { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.04); color: var(--text); }
.btn-sm { padding: 10px 16px; font-size: .9rem; }

.section { padding: 92px 0; }
.section-head { display: flex; justify-content: space-between; gap: 32px; align-items: end; margin-bottom: 34px; }
.section-head h2 { margin: 8px 0 0; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; letter-spacing: -.035em; }
.section-head p { margin: 0; max-width: 520px; color: var(--muted); }

.featured {
  display: grid;
  grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr);
  gap: 0;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(37,26,18,.94), rgba(18,15,12,.94));
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.featured-media { min-height: 460px; position: relative; background: #17120e; }
.featured-media img { width: 100%; height: 100%; object-fit: cover; }
.featured-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 50%, rgba(19,15,12,.65)); }
.featured-copy { padding: clamp(32px, 5vw, 58px); display: flex; flex-direction: column; justify-content: center; }
.featured-copy h3 { margin: 12px 0 12px; font-size: clamp(2.6rem, 5vw, 4.6rem); letter-spacing: -.04em; }
.featured-copy p { color: var(--muted); margin: 0 0 24px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.pill { border: 1px solid var(--line); background: rgba(255,255,255,.03); color: #d9cbbb; border-radius: 999px; padding: 6px 10px; font-size: .75rem; font-weight: 750; }
.pill.ok { color: var(--ok); border-color: rgba(135,215,164,.25); background: rgba(135,215,164,.06); }

.games-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.game-card { min-height: 310px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; position: relative; }
.game-card.playable { display: grid; grid-template-rows: 1fr auto; }
.game-card .thumb { min-height: 205px; background: #19120d; overflow: hidden; }
.game-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.game-card:hover .thumb img { transform: scale(1.025); }
.game-card .card-copy { padding: 18px; }
.game-card h3 { margin: 0 0 4px; font-size: 1.3rem; }
.game-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.coming { display: grid; place-items: center; text-align: center; color: #887a6b; background: repeating-linear-gradient(-45deg, rgba(255,255,255,.018), rgba(255,255,255,.018) 10px, transparent 10px, transparent 20px); }
.coming strong { display: block; color: #a79989; letter-spacing: .12em; font-size: .8rem; text-transform: uppercase; }

.vision-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.vision-card { padding: 28px; border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 18px; }
.vision-card .num { color: var(--gold); font-size: .78rem; font-weight: 900; letter-spacing: .14em; }
.vision-card h3 { margin: 12px 0 8px; }
.vision-card p { margin: 0; color: var(--muted); }

.cta-band { padding: 42px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, rgba(157,92,43,.18), rgba(225,169,75,.06)); display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.cta-band h2 { margin: 0 0 6px; font-size: 2rem; }
.cta-band p { margin: 0; color: var(--muted); }

.site-footer { padding: 30px 0 42px; color: #827567; font-size: .86rem; border-top: 1px solid var(--line); }
.footer-row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* Game page */
.game-hero { padding: 72px 0 34px; }
.game-hero-grid { display: grid; grid-template-columns: 1fr .86fr; gap: 54px; align-items: center; }
.game-hero h1 { font-size: clamp(3.4rem, 7vw, 6rem); margin: 12px 0 16px; letter-spacing: -.055em; line-height: .92; }
.game-hero p { color: var(--muted); font-size: 1.05rem; max-width: 620px; }
.character-stack { min-height: 340px; position: relative; }
.character-stack img { position: absolute; object-fit: contain; filter: drop-shadow(0 24px 24px rgba(0,0,0,.5)); }
.character-stack .cowboy { width: 46%; left: 13%; bottom: 0; z-index: 2; }
.character-stack .cowgirl { width: 48%; right: 9%; bottom: 0; z-index: 1; }
.character-stack .ghost { width: 24%; right: 40%; top: 3%; opacity: .95; z-index: 0; }

.play-section { padding: 26px 0 70px; }
.game-shell { border: 1px solid var(--line); border-radius: 20px; background: #050504; overflow: hidden; box-shadow: var(--shadow); }
.game-topbar { min-height: 58px; padding: 10px 14px 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: #13100e; }
.game-topbar strong { font-size: .92rem; }
.game-topbar span { color: var(--muted); font-size: .78rem; }
.game-actions { display: flex; gap: 8px; }
.game-stage { aspect-ratio: 1672 / 941; position: relative; background: #080604 url('../img/wanted-board.webp') center/cover no-repeat; }
.game-stage::before { content:""; position:absolute; inset:0; background: rgba(5,3,2,.58); }
.play-gate { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 28px; }
.play-card { width: min(620px, 94%); padding: 32px; text-align: center; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; background: rgba(16,12,9,.9); backdrop-filter: blur(12px); }
.play-card h2 { margin: 10px 0 8px; font-size: clamp(2rem, 4vw, 3.2rem); }
.play-card p { color: var(--muted); margin: 0 auto 20px; max-width: 470px; }
.game-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; display: none; }
.game-stage.is-playing::before, .game-stage.is-playing .play-gate { display:none; }
.game-stage.is-playing .game-frame { display:block; }

.info-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; margin-top: 20px; }
.info-card { border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 16px; padding: 24px; }
.info-card h3 { margin: 0 0 12px; }
.info-card p, .info-card li { color: var(--muted); }
.info-card ul { margin: 0; padding-left: 20px; }
.key { border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.05); padding: 2px 7px; border-radius: 6px; color: var(--text); font-size: .82rem; }

/* Security-compatible utility classes: avoids inline style attributes so the portal can use a strict CSP. */
.section-head-spaced { margin-top: 72px; }
.cta-band-spaced { margin-top: 48px; }
.meta-top { margin-top: 22px; }
.eyebrow-center { justify-content: center; }

@media (max-width: 900px) {
  .featured, .game-hero-grid, .info-grid { grid-template-columns: 1fr; }
  .featured-media { min-height: 340px; }
  .featured-media::after { background: linear-gradient(0deg, rgba(19,15,12,.65), transparent 60%); }
  .games-grid, .vision-grid { grid-template-columns: 1fr; }
  .character-stack { min-height: 290px; }
  .section-head { align-items: start; flex-direction: column; }
  .cta-band { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 680px) {
  .shell { width: min(calc(100% - 24px), var(--max)); }
  .nav-links a:not(.btn) { display:none; }
  .hero { min-height: 620px; }
  .hero-content { padding-top: 64px; }
  .section { padding: 68px 0; }
  .game-hero { padding-top: 48px; }
  .game-topbar span { display:none; }
  .game-actions .btn-sm:first-child { display:none; }
  .play-card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* Emergency mobile controls for existing Godot web build. */
.mobile-pad-wrap {
  display: none;
  padding: 14px 16px 18px;
  border-top: 1px solid var(--line);
  background: #0d0a08;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.mobile-pad {
  width: 184px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(3, 56px);
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.mobile-key {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(241,195,107,.46);
  background: linear-gradient(180deg, #3b2516, #21140d);
  color: #f3ca78;
  font: 900 23px/1 system-ui, sans-serif;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.mobile-key:active { transform: translateY(1px) scale(.97); background: #5a351b; }
.mobile-pad-center {
  width: 24px;
  height: 24px;
  justify-self: center;
  border-radius: 50%;
  background: #342012;
  border: 1px solid rgba(241,195,107,.18);
}
.mobile-pad-label {
  margin-top: 9px;
  color: #8f806f;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .18em;
}
@media (hover: none), (pointer: coarse), (max-width: 820px) {
  .mobile-pad-wrap.is-visible { display: block; }
  .game-stage { aspect-ratio: 1672 / 941; }
}
