/* Martian Mortars: the game's own palette (WorldTheme.Mars and the HUD in MainWindow.xaml). */
:root {
  --space: #0a0a12;        /* page ground, the HUD's lower gradient stop */
  --dusk: #2a140e;         /* the HUD's upper gradient stop */
  --panel: #1a1114;        /* raised cards */
  --edge: rgba(255, 255, 255, 0.1);
  --rust: #e8945a;         /* Mars surface light, the HUD accent */
  --rust-mid: #c1562b;
  --rust-dark: #4e1a0c;
  --trail: #ffb070;        /* shell trails */
  --you: #7cdb5a;          /* the player's Martian */
  --cpu: #b98cff;          /* the CPU's Martian */
  --dome: #9fe8ff;
  --gold: #ffd84a;
  --text: #e8e2d0;         /* the HUD ink */
  --muted: #a99a8c;
  --display: "Saira Condensed", Bahnschrift, "Arial Narrow", sans-serif;
  --body: Saira, Bahnschrift, "Segoe UI", sans-serif;
  --max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--space);
  color: var(--text);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rust); }
a:hover { color: var(--trail); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.05; margin: 0; text-transform: uppercase; letter-spacing: 0.01em; }
p { margin: 0; }
.rust { color: var(--rust); }
.defs { position: absolute; }
kbd, code {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  font: 600 13px/1.6 var(--body);
  color: var(--text);
  white-space: nowrap;
}
code { border-bottom-width: 1px; font-weight: 500; }

/* Buttons: the game's New Game button. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px 20px;
  border: 1px solid #f0a070; border-radius: 8px;
  background: linear-gradient(#b0491f, #7a2e14);
  color: #fff; font: 600 16px/1.2 var(--body); text-decoration: none;
  box-shadow: 0 6px 24px rgba(193, 86, 43, 0.35);
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}
.btn:hover { color: #fff; background: linear-gradient(#d45e2c, #943a18); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(212, 94, 44, 0.45); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn-ghost { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.25); box-shadow: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--rust); box-shadow: none; }
.btn-ghost svg { fill: currentColor; stroke: none; }
.btn-sm { padding: 7px 14px; font-size: 14px; box-shadow: none; }
.btn-lg { padding: 14px 26px; font-size: 18px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 12px max(16px, calc((100vw - var(--max)) / 2));
  background: rgba(10, 10, 18, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge);
}
.nav-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 800 22px/1 var(--display); text-transform: uppercase; }
.nav-brand:hover { color: var(--text); }
.nav-brand img { border-radius: 7px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; }
.nav-links a:hover { color: var(--text); }

/* Hero: the battlefield behind, darkened toward the text. */
.hero {
  position: relative;
  min-height: min(92vh, 860px);
  display: grid; align-items: center;
  padding: 80px 16px 120px;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(180deg, rgba(10, 10, 18, 0.55) 0%, rgba(10, 10, 18, 0.2) 45%, rgba(10, 10, 18, 0.35) 75%, var(--space) 100%),
    linear-gradient(90deg, rgba(10, 10, 18, 0.88) 0%, rgba(10, 10, 18, 0.55) 45%, rgba(10, 10, 18, 0) 75%),
    url("assets/img/hero.jpg") center 30% / cover no-repeat;
}
.stars { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.hero-inner { width: 100%; max-width: var(--max); margin: 0 auto; }
.eyebrow { color: var(--trail); font: 600 14px/1.4 var(--body); letter-spacing: 0.18em; text-transform: uppercase; }
.logo {
  margin: 10px 0 18px;
  font-size: clamp(56px, 11vw, 132px);
  line-height: 0.9;
  text-shadow: 0 4px 30px rgba(193, 86, 43, 0.45);
}
.logo .rust { display: block; background: linear-gradient(#ffb070, #c1562b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { max-width: 34ch; font-size: clamp(18px, 2.2vw, 22px); line-height: 1.5; color: #f3ece0; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-meta { margin-top: 18px; color: var(--muted); font-size: 14px; }
.usa {
  display: inline-flex; align-items: center; gap: 12px;
  margin: 18px 0 0; color: var(--text);
  font: 600 15px/1.3 var(--display); letter-spacing: 0.14em; text-transform: uppercase;
}
.usa .flag { width: 38px; height: 20px; border-radius: 2px; }
.flag { width: 21px; height: 11px; border-radius: 1px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15); flex: none; }

/* Sections */
.section { padding: 96px 16px; }
.section > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.section-alt { background: linear-gradient(180deg, var(--dusk) 0%, #160c0d 100%); border-block: 1px solid var(--edge); }
.section-head { margin-bottom: 48px; }
.section-head h2 { margin-top: 8px; font-size: clamp(38px, 6vw, 64px); }
.lede { margin-top: 16px; max-width: 60ch; color: #d6cdbd; font-size: 18px; }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  padding: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--edge); border-radius: 12px;
}
.feature-icon {
  display: grid; place-items: center;
  width: 48px; height: 48px; margin-bottom: 18px;
  border-radius: 10px;
  background: rgba(232, 148, 90, 0.12); border: 1px solid rgba(232, 148, 90, 0.4);
}
.feature-icon svg { width: 26px; height: 26px; fill: none; stroke: var(--rust); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: 26px; margin-bottom: 8px; }
.feature p { color: #cfc6b6; font-size: 16px; }

/* Hazards: the in-game warning banners. */
.hazards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.hazard { padding: 22px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--edge); border-radius: 12px; }
.hazard p { margin-top: 14px; color: #cfc6b6; font-size: 16px; }
.hazard-tag {
  display: inline-block; padding: 4px 12px;
  border: 1px solid; border-radius: 999px;
  font: 600 13px/1.4 var(--body); letter-spacing: 0.06em; text-transform: uppercase;
}
.tag-red { color: #ff8a8a; border-color: #e0484a; background: rgba(224, 72, 74, 0.14); }
.tag-blue { color: var(--dome); border-color: #5aa8d8; background: rgba(90, 168, 216, 0.14); }
.tag-amber { color: var(--gold); border-color: #c8a03a; background: rgba(200, 160, 58, 0.12); }
.tag-orange { color: var(--trail); border-color: var(--rust-mid); background: rgba(193, 86, 43, 0.16); }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.shot {
  position: relative; overflow: hidden;
  border-radius: 10px; border: 1px solid var(--edge);
  background: #000;
}
.shot img { width: 100%; transition: transform 0.4s, opacity 0.2s; }
.shot:hover img { transform: scale(1.03); }
.shot:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; }
.shot-wide { grid-column: 1 / -1; }

/* Controls */
.controls-wrap { overflow-x: auto; }
.controls { width: 100%; border-collapse: collapse; font-size: 16px; }
.controls th, .controls td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--edge); vertical-align: middle; }
.controls thead th { color: var(--trail); font: 600 13px/1.4 var(--body); letter-spacing: 0.14em; text-transform: uppercase; }
.controls tbody th { font-weight: 600; white-space: nowrap; }
.controls td { color: #cfc6b6; }

/* Download */
.download { padding-block: 110px; background: radial-gradient(ellipse at 50% 120%, rgba(193, 86, 43, 0.35), transparent 60%); }
.download-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 40px; align-items: center;
  padding: 40px;
  background: linear-gradient(160deg, rgba(42, 20, 14, 0.9), rgba(16, 10, 14, 0.95));
  border: 1px solid rgba(232, 148, 90, 0.35); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(193, 86, 43, 0.15);
}
.download-icon { width: 160px; height: 160px; border-radius: 34px; box-shadow: 0 10px 40px rgba(193, 86, 43, 0.35); }
.download-body h2 { margin-top: 8px; font-size: clamp(38px, 5vw, 56px); }
.download-body .lede { font-size: 17px; }
.specs { margin: 0; display: grid; gap: 12px; min-width: 230px; padding-left: 32px; border-left: 1px solid var(--edge); }
.specs div { display: grid; gap: 2px; }
.specs dt { color: var(--trail); font: 600 12px/1.4 var(--body); letter-spacing: 0.14em; text-transform: uppercase; }
.specs dd { margin: 0; font-size: 15px; }

/* Footer */
.footer { padding: 48px 16px 56px; text-align: center; color: var(--muted); border-top: 1px solid var(--edge); }
.footer p { margin: 6px 0; }
.footer p:first-child { color: var(--text); font: 800 20px/1.4 var(--display); text-transform: uppercase; letter-spacing: 0.04em; }
.footer p:first-child a { font: 500 15px var(--body); text-transform: none; letter-spacing: 0; }
.footer .made-in { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; letter-spacing: 0.04em; }
.footer .footer-small { font-size: 13px; }

/* Lightbox */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(5, 4, 8, 0.95);
  color: var(--text);
}
.lightbox[open] { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 8px; }
.lightbox figcaption { color: var(--muted); font-size: 15px; text-align: center; }
.lightbox button { background: none; border: 0; color: var(--text); cursor: pointer; font: 48px/1 var(--body); opacity: 0.7; }
.lightbox button:hover { opacity: 1; color: var(--rust); }
.lightbox-close { position: absolute; top: 14px; right: 22px; font-size: 40px !important; }

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

@media (max-width: 980px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .hazards { grid-template-columns: repeat(2, 1fr); }
  .download-card { grid-template-columns: auto 1fr; }
  .specs { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--edge); }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav .btn-sm { margin-left: auto; }
  .hero { min-height: auto; padding: 64px 16px 88px; }
  .hero-bg {
    background:
      linear-gradient(180deg, rgba(10, 10, 18, 0.75) 0%, rgba(10, 10, 18, 0.65) 60%, var(--space) 100%),
      url("assets/img/hero.jpg") 70% center / cover no-repeat;
  }
  .section { padding: 72px 16px; }
  .features, .hazards, .gallery { grid-template-columns: 1fr; }
  .download-card { grid-template-columns: 1fr; padding: 28px 20px; gap: 24px; }
  .download-icon { width: 96px; height: 96px; border-radius: 22px; }
  .btn-lg { width: 100%; }
  .controls th, .controls td { padding: 12px 10px; }
  .lightbox[open] { grid-template-columns: 40px 1fr 40px; }
}
