/* Veeramani — site styles. Theme mirrors the game: sky, hills, sand, army olive. */
:root {
  --sky-1: #7cc8f2;
  --sky-2: #fbe9c8;
  --hill-far: #a9bccb;
  --hill-near: #8fae5a;
  --sand: #d9bf8c;
  --sand-d: #c4a46d;
  --olive: #4b5320;
  --olive-d: #2f3816;
  --olive-l: #6b7a35;
  --ink: #1d2414;
  --muted: #56604a;
  --paper: #fffaf0;
  --card: #ffffff;
  --line: #e6dcc6;
  --accent: #ffb300;
  --accent-d: #c78400;
  --danger: #e64a19;
  --navy: #26375f;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(47, 56, 22, 0.12);
  --font-display: "Black Ops One", "Arial Black", Impact, system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--olive); text-underline-offset: 3px; }
a:hover { color: var(--danger); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(47, 56, 22, 0.94);
  backdrop-filter: saturate(140%) blur(6px);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 3px solid var(--accent);
}
.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--accent); background: var(--accent); }
.brand span { font-family: var(--font-display); font-size: 22px; letter-spacing: 1px; }
.brand:hover { color: var(--accent); }
.nav { margin-left: auto; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: #eef2de;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav .nav-play { background: var(--accent); color: var(--ink); }
.nav .nav-play:hover { background: #ffc94d; color: var(--ink); }

/* ---------- Hero / battlefield ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 28px 16px 0;
  background: linear-gradient(180deg, var(--sky-1) 0%, #b8e0f5 45%, var(--sky-2) 100%);
}
.hero::before, .hero::after { /* drifting clouds */
  content: "";
  position: absolute;
  top: 40px;
  width: 180px;
  height: 46px;
  background: #fff;
  border-radius: 999px;
  opacity: 0.75;
  box-shadow: 40px -18px 0 4px #fff, 90px 0 0 -2px #fff;
  animation: drift 60s linear infinite;
}
.hero::after { top: 110px; transform: scale(0.7); animation-duration: 85s; animation-delay: -40s; opacity: 0.55; }
@keyframes drift { from { left: -240px; } to { left: 110%; } }
.sun {
  position: absolute;
  top: 26px;
  right: 9%;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6c2 0%, #ffe48a 55%, rgba(255, 228, 138, 0) 72%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; text-align: center; }
.kicker {
  display: inline-block;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--olive-d);
  background: rgba(255, 255, 255, 0.7);
  padding: 4px 12px;
  border-radius: 999px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 6.4vw, 68px);
  line-height: 1.05;
  margin: 12px 0 8px;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 3px 3px 0 var(--olive-d), 6px 6px 0 rgba(47, 56, 22, 0.35);
}
.hero h1 .accent { color: var(--accent); }
.tagline { margin: 0 auto 20px; max-width: 640px; font-size: clamp(16px, 2.2vw, 19px); color: #24301a; font-weight: 500; }

/* ---------- Game stage ---------- */
.stage-wrap { max-width: 1100px; margin: 0 auto; }
.stage {
  position: relative;
  border: 6px solid var(--olive-d);
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #7cc8f2, #fbe9c8 87%, #d9bf8c 87%);
  box-shadow: 0 8px 0 var(--olive-d), 0 18px 40px rgba(47, 56, 22, 0.35);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.stage::after { /* corner rivets */
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  z-index: 4;
  background:
    radial-gradient(circle at 0 0, #8b956a 3px, transparent 4px) top left / 14px 14px no-repeat,
    radial-gradient(circle at 100% 0, #8b956a 3px, transparent 4px) top right / 14px 14px no-repeat;
}
.stage-wrap:fullscreen {
  max-width: none; width: 100%; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 12px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  overflow: auto;
  background: linear-gradient(180deg, #7cc8f2, #fbe9c8);
}
.stage-wrap:-webkit-full-screen {
  max-width: none; width: 100%; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 12px 16px 8px; overflow: auto;
  background: linear-gradient(180deg, #7cc8f2, #fbe9c8);
}
/* iPhone: no Fullscreen API for elements, so the stage covers the viewport instead */
.stage-wrap.fake-fs {
  position: fixed; inset: 0; z-index: 1000;
  max-width: none; width: 100%; height: 100%; height: 100dvh; margin: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, #7cc8f2, #fbe9c8);
}
html.fs-lock, html.fs-lock body { overflow: hidden; }
html.fs-lock .hero-inner { z-index: 1001; } /* lift the stage's stacking context above the sticky topbar */
/* Exit button: only shown while full screen, sits above the touch catcher */
.fs-exit {
  display: none;
  position: fixed; z-index: 6;
  top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left));
  -webkit-appearance: none; appearance: none;
  border: 0; border-radius: 50%;
  width: 44px; height: 44px; padding: 0;
  font: 800 20px/1 var(--font-body);
  color: #fff; background: rgba(20, 26, 10, 0.72);
  cursor: pointer;
}
.fs-exit:hover { background: rgba(20, 26, 10, 0.9); }
.stage-wrap:fullscreen .fs-exit { display: block; }
.stage-wrap:-webkit-full-screen .fs-exit, .stage-wrap.fake-fs .fs-exit { display: block; }
/* Full screen = game + touch controls + ✕ only */
.stage-wrap:fullscreen .share-bar, .stage-wrap:-webkit-full-screen .share-bar,
.stage-wrap:fullscreen .hud, .stage-wrap:-webkit-full-screen .hud,
.stage-wrap.fake-fs .share-bar, .stage-wrap.fake-fs .hud { display: none; }

/* Engine elements */
.interstitial-wrapper { /* height reserved before the canvas exists (no layout shift) */
  position: relative; width: 100%; margin: 0; padding: 0;
  aspect-ratio: 4 / 1; min-height: 150px;
}
@media (max-width: 559px) { .interstitial-wrapper { aspect-ratio: auto; height: 188px; } } /* 1.25x zoom: 150 x 1.25 */
.runner-container { position: relative; width: 100%; line-height: 0; }
.runner-canvas { display: block; margin: 0 auto; }
.controller { position: absolute; inset: 0; z-index: 2; background: transparent; }
.icon-offline, #main-content { display: none; }
.hidden { display: none !important; }

/* Overlays on the stage */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  text-align: center;
  background: rgba(20, 26, 10, 0.42);
  color: #fff;
  animation: fade 0.25s ease-out;
}
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.overlay h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(20px, 3.6vw, 34px); letter-spacing: 1px; text-shadow: 2px 2px 0 #000; }
.overlay p { margin: 0; font-weight: 600; text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6); font-size: clamp(13px, 1.8vw, 16px); }
#start-overlay { cursor: pointer; }
.score-line { display: flex; gap: 18px; font-weight: 800; font-size: clamp(15px, 2.2vw, 19px); }
.score-line b { color: var(--accent); font-size: 1.25em; }
.badge-new {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  animation: pop 0.6s ease-out;
}
@keyframes pop { 0% { transform: scale(0.3); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* Buttons */
.btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 12px;
  font: 800 16px/1 var(--font-body);
  cursor: pointer;
  text-decoration: none;
  background: var(--accent);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--accent-d);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s;
}
.btn:hover { background: #ffc94d; color: var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--accent-d); }
.btn-big { font-size: clamp(17px, 2.6vw, 22px); padding: 14px 32px; border-radius: 14px; }
.btn-ghost { background: rgba(255, 255, 255, 0.92); box-shadow: 0 4px 0 #b9ae95; }
.btn-ghost:hover { background: #fff; }
.btn-icon { width: 44px; padding: 0; font-size: 19px; }
.wa { background: #25d366; color: #fff; }
.wa:hover { background: #1fb457; color: #fff; }
.xx { background: #111; color: #fff; }
.xx:hover { background: #333; color: #fff; }
.fb { background: #1877f2; color: #fff; }
.rd { background: #ff4500; color: #fff; }
.rd:hover { background: #e03d00; color: #fff; }
.ico { width: 20px; height: 20px; fill: currentColor; }
.fb:hover { background: #0f62cf; color: #fff; }

/* Share bar: one slim row of icons under the HUD/controls, after the first run */
.share-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--olive-d);
  animation: fade 0.3s ease-out;
}
.sh {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  transition: transform 0.08s ease;
}
.sh:active { transform: scale(0.92); }
.sh svg { width: 22px; height: 22px; fill: currentColor; }
.share-bar[hidden] { display: none; }

/* HUD under the stage */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 18px 4px 14px;
}
.best {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--olive-d);
  background: rgba(255, 255, 255, 0.75);
  padding: 6px 14px;
  border-radius: 12px;
}
.hint { font-size: 14px; color: #3a4626; font-weight: 600; }
.hint kbd {
  font: 700 12px/1 var(--font-body);
  background: #fff;
  border: 1px solid #c9bea6;
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 3px 7px;
}
.hud-buttons { display: flex; gap: 8px; }

/* Touch controls (phones/tablets only) */
.touch-controls { display: none; justify-content: space-between; gap: 12px; padding: 14px 0 0; }
.touch-controls .btn { flex: 0 1 46%; min-height: 64px; font-size: 18px; touch-action: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.touch-controls .duck { background: var(--olive-l); color: #fff; box-shadow: 0 4px 0 var(--olive-d); }
@media (hover: none) and (pointer: coarse) {
  .touch-controls { display: flex; }
  .kb { display: none; }
}
@media (hover: hover) { .tc { display: none; } }

/* Ground strip under the hero */
.ground {
  position: relative;
  z-index: 1;
  height: 64px;
  margin: 0 -16px;
  background:
    radial-gradient(circle at 12% 30%, rgba(0, 0, 0, 0.12) 2px, transparent 3px) 0 0 / 46px 22px,
    linear-gradient(180deg, var(--sand) 0 38%, var(--sand-d) 38% 100%);
  border-top: 2px solid #5b5340;
}
.hills {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  bottom: 64px;
  height: 46%;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Article ---------- */
.content { background: var(--paper); padding: 40px 16px 64px; }
.article { max-width: 780px; margin: 0 auto; }
.article h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(25px, 3.6vw, 34px);
  line-height: 1.2;
  color: var(--olive-d);
  margin: 52px 0 14px;
  letter-spacing: 0.5px;
}
.article h3 { font-size: 21px; line-height: 1.35; margin: 30px 0 8px; color: var(--ink); }
.article p { margin: 0 0 18px; }
.article ul, .article ol { padding-left: 1.3em; margin: 0 0 20px; }
.article li { margin-bottom: 8px; }
.lead { font-size: 19px; color: #2c3820; }
.meta { font-size: 14px; color: var(--muted); margin-bottom: 24px; }

.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 6px solid var(--olive);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 28px 0;
  box-shadow: var(--shadow);
}
.toc strong { display: block; font-family: var(--font-display); font-weight: 400; color: var(--olive-d); font-size: 19px; margin-bottom: 6px; }
.toc ol { margin: 0; columns: 2; column-gap: 28px; }
.toc li { break-inside: avoid; margin-bottom: 4px; font-size: 15px; }
@media (max-width: 600px) { .toc ol { columns: 1; } }

.controls-table { width: 100%; border-collapse: collapse; margin: 6px 0 24px; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: 16px; }
.controls-table th, .controls-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.controls-table th { background: var(--olive); color: #fff; font-weight: 700; }
.controls-table tr:last-child td { border-bottom: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 10px 0 26px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(47, 56, 22, 0.18); }
.card svg { display: block; height: 54px; width: auto; margin-bottom: 8px; }
.card h3 { margin: 0 0 6px; font-size: 19px; }
.card p { margin: 0; font-size: 15.5px; color: #3d4733; }
.card .how { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 800; color: var(--danger); text-transform: uppercase; letter-spacing: 1px; }

.callout {
  background: #fff6db;
  border: 1px solid #f2dc9b;
  border-left: 6px solid var(--accent);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 22px 0;
}
.callout p:last-child { margin-bottom: 0; }

.tips { counter-reset: tip; list-style: none; padding: 0 !important; }
.tips li {
  counter-increment: tip;
  position: relative;
  padding: 14px 16px 14px 62px;
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.tips li::before {
  content: counter(tip);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--olive);
  color: #fff;
  font-family: var(--font-display);
  display: grid;
  place-items: center;
}

.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 48px 16px 18px;
  font-weight: 700;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  color: var(--olive);
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 18px 16px; margin: 0; }

.cta {
  text-align: center;
  background: linear-gradient(180deg, var(--sky-1), var(--sky-2));
  border-radius: 20px;
  padding: 32px 20px;
  margin: 44px 0 10px;
  border: 4px solid var(--olive-d);
}
.cta h2 { margin-top: 0; color: #fff; text-shadow: 2px 2px 0 var(--olive-d); }

/* Top ad: fixed 300x100 unit on the sky, kept well above the game area. */
.ad-top {
  background: var(--sky-1);
  text-align: center;
  padding: 10px 16px 4px;
  min-height: 182px; /* label + 100px unit + note, reserved so nothing shifts */
}
.ad-top .ad-label { color: #1f3a4d; }
.ad-note {
  display: table; margin: 8px auto 0; padding: 6px 12px; text-align: center; /* own line, centred under the ad */
  font-size: 13px; line-height: 18px; font-weight: 700; color: var(--ink);
  background: #fff; border: 2px solid var(--accent); border-radius: 999px;
  box-shadow: 0 2px 0 var(--accent-d);
}

/* Disclaimer under the game */
.warning-box {
  margin: 0 0 28px;
  padding: 12px 16px;
  border-left: 5px solid var(--accent);
  border-radius: 10px;
  background: #fff4d6;
  color: var(--ink);
}
.warning-box strong { display: block; margin-bottom: 4px; }
.warning-box p { margin: 0; font-size: 15px; }

/* Ad slots: space reserved so nothing jumps when the ad loads (no CLS). */
.ad-slot {
  margin: 80px auto 36px; /* keeps the unit 200px+ clear of the game controls */
  min-height: 232px; /* label + 300x200 unit */
  padding: 8px;
  border-radius: 12px;
  background: #f6efdf;
  text-align: center;
}
.ad-label { display: block; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #5f5643; margin-bottom: 6px; }

/* ---------- Footer ---------- */
.footer { background: var(--olive-d); color: #dfe5c8; padding: 36px 16px; font-size: 15px; }
.footer-inner { max-width: 1160px; margin: 0 auto; display: grid; gap: 18px; }
.footer a { color: #fff; }
.footer .links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer small { color: #b7c09a; line-height: 1.6; }

/* Scroll reveal (skipped for reduced motion) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero::before, .hero::after { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .btn { transition: none; }
}

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  #over { gap: 6px; }
  #over h2 { display: none; }
  .btn-big { padding: 10px 22px; min-height: 40px; }
  .hero::before, .hero::after { opacity: 0.35; }
  .brand span { font-size: 19px; }
}
@media (max-width: 480px) {
  .brand span { display: none; }
}
@media (max-width: 640px) {
  .nav a { padding: 7px 9px; font-size: 14px; }
  .nav .nav-hide-sm { display: none; }
  .hero { padding-top: 18px; }
  .stage { border-width: 4px; border-radius: 14px; }
  .hud { justify-content: center; }
  .hint { width: 100%; text-align: center; order: 3; }
  .ground { height: 44px; }
  .hills { bottom: 44px; }
}

/* ---------- Sub-pages ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  padding: 34px 16px 0;
  background: linear-gradient(180deg, var(--sky-1) 0%, #b8e0f5 50%, var(--sky-2) 100%);
  text-align: center;
}
.page-hero-inner { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; padding-bottom: 40px; }
.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(32px, 5.6vw, 56px);
  line-height: 1.1;
  margin: 10px 0;
  color: #fff;
  text-shadow: 3px 3px 0 var(--olive-d), 6px 6px 0 rgba(47, 56, 22, 0.35);
}
.page-hero .hills { bottom: 64px; height: 60%; }
.crumbs { font-size: 14px; font-weight: 600; color: #2c3820; }
.crumbs a { color: var(--olive-d); }
.more { margin-top: 26px; font-weight: 600; }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.16); color: #fff; }
@media (max-width: 640px) { .page-hero .hills { bottom: 44px; } }
