/* ==========================================================================
   TIGERRUN — styles
   ========================================================================== */
:root {
  --bg: #07080a;
  --bg-2: #0c0e0d;
  --panel: #101311;
  --ink: #f3ebde;
  --muted: #a39b8d;
  --dim: #6c665c;
  --orange: #ff8a1e;
  --orange-hi: #ffb04f;
  --orange-lo: #c75a00;
  --green: #3dff7a;
  --green-lo: #17a84a;
  --gold: #ffc93c;
  --red: #ff3b3b;
  --line: #000;
  --px: 4px;
  --f-pixel: "Press Start 2P", ui-monospace, monospace;
  --f-body: "VT323", ui-monospace, monospace;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 22px;
  line-height: 1.25;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; }
a { color: inherit; }
button { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--orange); color: #140a02; }

/* --------------------------------------------------------------- boot */
.boot {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg);
  transition: clip-path .7s steps(10), opacity .2s .6s;
  clip-path: inset(0 0 0 0);
}
.boot.is-done { clip-path: inset(50% 0 50% 0); opacity: 0; pointer-events: none; }
.boot__inner { display: grid; justify-items: center; gap: 16px; }
.boot__label { margin: 0; font-family: var(--f-pixel); font-size: 11px; letter-spacing: 2px; color: var(--orange); }
.boot__bar { width: 180px; height: 12px; border: 3px solid var(--orange); padding: 2px; }
.boot__bar i { display: block; height: 100%; width: 0; background: var(--orange); animation: bootfill .75s steps(12) forwards; }
@keyframes bootfill { to { width: 100%; } }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* --------------------------------------------------------------- logo */
.logo-mark { display: inline-block; width: 40px; height: 40px; flex: none; filter: drop-shadow(0 0 10px rgba(255, 138, 30, .45)); }
.logo-mark svg, .logo-mark img { width: 100%; height: 100%; shape-rendering: crispEdges; }
.logo-mark img { object-fit: cover; border: 2px solid #000; box-shadow: 2px 2px 0 #000; }
.logo-mark--boot { width: 72px; height: 72px; animation: bob .5s steps(2) infinite; }
.logo-mark--sm { width: 32px; height: 32px; }
.logo-mark--lg { width: 64px; height: 64px; }
@keyframes bob { 50% { transform: translateY(-4px); } }

/* --------------------------------------------------------------- buttons */
.px-btn {
  --c: var(--orange); --c-hi: var(--orange-hi); --c-lo: var(--orange-lo); --t: #160a01;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 18px;
  font-family: var(--f-pixel); font-size: 12px; letter-spacing: 1px; line-height: 1;
  text-decoration: none; text-transform: uppercase; white-space: nowrap;
  color: var(--t);
  background: var(--c);
  border: 3px solid var(--line);
  box-shadow:
    inset 3px 3px 0 var(--c-hi),
    inset -3px -3px 0 var(--c-lo),
    4px 4px 0 0 var(--line);
  cursor: pointer;
  user-select: none;
  transition: transform .12s steps(2), box-shadow .12s steps(2), filter .2s;
}
.px-btn:hover { transform: translate(-2px, -2px); box-shadow: inset 3px 3px 0 var(--c-hi), inset -3px -3px 0 var(--c-lo), 6px 6px 0 0 var(--line), 0 0 24px -4px var(--c); }
.px-btn:active { transform: translate(3px, 3px); box-shadow: inset 3px 3px 0 var(--c-lo), inset -3px -3px 0 var(--c-hi), 0 0 0 0 var(--line); }
.px-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.px-btn--green { --c: var(--green); --c-hi: #b5ffcd; --c-lo: var(--green-lo); --t: #03160a; }
.px-btn--ghost { --c: #17191b; --c-hi: #2c3034; --c-lo: #0a0b0c; --t: var(--ink); }
.px-btn--ghost:hover { --t: var(--orange-hi); }
.px-btn--sm { padding: 9px 12px; font-size: 10px; gap: 8px; }
.px-btn--lg { padding: 16px 26px; font-size: 14px; }
.px-btn--xl { padding: 20px 30px; font-size: 16px; }
.px-btn--block { width: 100%; white-space: normal; line-height: 1.5; text-align: center; }
.px-btn[disabled], .px-btn.is-disabled {
  --c: #2a2d30; --c-hi: #3a3e42; --c-lo: #17191b; --t: #6f7378;
  cursor: not-allowed; transform: none; box-shadow: inset 3px 3px 0 var(--c-hi), inset -3px -3px 0 var(--c-lo), 4px 4px 0 0 var(--line);
}
.ico { width: 14px; height: 14px; fill: currentColor; shape-rendering: crispEdges; flex: none; }
.ico--play { width: 14px; height: 18px; }
.px-btn--xl .ico { width: 18px; height: 18px; }

/* --------------------------------------------------------------- header */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 clamp(14px, 3vw, 32px);
  padding-top: env(safe-area-inset-top);
  transition: background .3s, border-color .3s;
  border-bottom: 3px solid transparent;
}
.topbar.is-scrolled { background: rgba(7, 8, 10, .88); backdrop-filter: blur(6px); border-bottom-color: #000; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__text { display: grid; gap: 5px; }
.brand__text strong { font-family: var(--f-pixel); font-size: 15px; letter-spacing: 1px; color: var(--ink); text-shadow: 2px 2px 0 #000; }
.brand__text small { font-family: var(--f-pixel); font-size: 9px; color: var(--orange); letter-spacing: 1px; }
.topbar__nav { display: flex; gap: 10px; align-items: center; }

/* --------------------------------------------------------------- hero / game */
.hero {
  position: relative;
  height: 100vh; height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: #050608;
  isolation: isolate;
}
.hero.is-playing { touch-action: none; cursor: pointer; }
.hero__canvas { position: absolute; left: 0; top: 0; image-rendering: pixelated; image-rendering: crisp-edges; }
.hero__vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0,0,0,.55) 100%),
    linear-gradient(to bottom, rgba(0,0,0,.5), transparent 18%);
}
/* scanlines */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.14) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

/* HUD */
.hud {
  position: absolute; z-index: 5;
  top: calc(var(--header-h) + env(safe-area-inset-top) + 6px); left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 8px; align-items: stretch;
  opacity: 0; visibility: hidden; transition: opacity .4s, visibility 0s .4s;
}
.hero.is-playing .hud, .hero.is-over .hud { visibility: visible; transition: opacity .4s; }
.hero.is-playing .hud, .hero.is-over .hud { opacity: 1; }
.hud__box {
  display: grid; gap: 6px; align-content: center;
  padding: 8px 12px;
  background: rgba(8, 9, 10, .78);
  border: 3px solid #000;
  box-shadow: inset 0 0 0 2px #24282b, 3px 3px 0 #000;
  min-width: 108px;
}
.hud__box span { font-family: var(--f-pixel); font-size: 8px; color: var(--muted); letter-spacing: 1px; }
.hud__box b { font-family: var(--f-pixel); font-size: 13px; color: var(--ink); font-weight: 400; letter-spacing: 1px; }
.hud__box:first-child b { color: var(--gold); text-shadow: 0 0 10px rgba(255, 201, 60, .5); }
.hud__box--dist b { color: var(--green); text-shadow: 0 0 10px rgba(61, 255, 122, .45); }
.hud__meter { height: 6px; background: #000; border: 1px solid #2a2e31; }
.hud__meter i { display: block; height: 100%; width: 0; background: var(--green); box-shadow: 0 0 8px var(--green); }
.hud__mute {
  width: 46px; display: grid; place-items: center;
  background: rgba(8, 9, 10, .78); color: var(--ink);
  border: 3px solid #000; box-shadow: inset 0 0 0 2px #24282b, 3px 3px 0 #000;
  cursor: pointer;
}
.hud__mute:hover { color: var(--orange); }
.hud__mute svg { width: 20px; height: 20px; fill: currentColor; shape-rendering: crispEdges; }
.hud__mute .snd-x { display: none; }
.hud__mute[aria-pressed="true"] .snd-wave { display: none; }
.hud__mute[aria-pressed="true"] .snd-x { display: block; fill: var(--red); }

/* overlays */
.overlay {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: calc(var(--header-h) + 60px) 16px 15vh;
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transform: translateY(12px);
  transition: opacity .35s ease, transform .35s ease, visibility 0s .35s;
}
.overlay.is-shown { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity .35s ease, transform .35s ease; }
.overlay--start { padding-bottom: 22vh; }
.overlay--start, .overlay--pause { pointer-events: none; }
.overlay.is-shown .px-btn { pointer-events: auto; }
.overlay--pause { background: rgba(5, 6, 8, .6); }
.overlay--pause.is-shown { pointer-events: auto; }
.overlay--over { background: rgba(5, 6, 8, .55); }

.overlay__kicker {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 22px; padding: 8px 12px;
  font-family: var(--f-pixel); font-size: 9px; letter-spacing: 1.5px; color: var(--green);
  background: rgba(0,0,0,.6); border: 2px solid #1d3a26;
}
.dot { width: 8px; height: 8px; background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 1.2s steps(1) infinite; }
.overlay__title {
  margin: 0;
  font-family: var(--f-pixel); font-weight: 400;
  font-size: clamp(20px, 4.4vw, 54px);
  line-height: 1.35; letter-spacing: 1px;
  color: var(--ink);
  text-shadow: 4px 4px 0 #000, 0 0 30px rgba(255, 138, 30, .25);
}
.overlay__title span { color: var(--orange); text-shadow: 4px 4px 0 #000, 0 0 34px rgba(255, 138, 30, .55); }
.overlay__title--sm { font-size: clamp(18px, 3.2vw, 34px); }
.overlay__title--red { color: var(--red); text-shadow: 4px 4px 0 #000, 0 0 30px rgba(255, 59, 59, .5); }
.overlay__sub { margin: 18px 0 30px; font-size: clamp(22px, 2.2vw, 30px); color: var(--ink); text-shadow: 2px 2px 0 #000; }
.overlay__hint { margin: 26px 0 0; font-family: var(--f-pixel); font-size: 9px; letter-spacing: 1px; color: var(--muted); text-shadow: 2px 2px 0 #000; line-height: 2; }
kbd { font-family: inherit; color: var(--ink); padding: 3px 6px; border: 2px solid #3a3e42; background: #000; }
.overlay--start .px-btn--xl { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: inset 3px 3px 0 var(--c-hi), inset -3px -3px 0 var(--c-lo), 4px 4px 0 0 var(--line), 0 0 40px 4px rgba(255,138,30,.45); } }

.over-card {
  display: grid; justify-items: center;
  padding: 34px clamp(18px, 4vw, 44px) 30px;
  background: rgba(10, 11, 12, .92);
  border: 4px solid #000;
  box-shadow: inset 0 0 0 3px #2a1210, 8px 8px 0 #000, 0 0 60px -10px rgba(255, 59, 59, .35);
  max-width: 560px; width: 100%;
}
.over-card .overlay__sub { margin: 14px 0 22px; color: var(--muted); }
.over-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin-bottom: 18px; }
.over-stats div { display: grid; gap: 8px; padding: 12px 6px; background: #000; border: 2px solid #24282b; }
.over-stats span { font-family: var(--f-pixel); font-size: 8px; color: var(--muted); }
.over-stats b { font-family: var(--f-pixel); font-weight: 400; font-size: 14px; color: var(--gold); }
.over-badge { margin: 0 0 20px; font-family: var(--f-pixel); font-size: 10px; color: var(--green); visibility: hidden; animation: blink .6s steps(1) infinite; }
.over-badge.is-on { visibility: visible; }

.toast-center {
  position: absolute; left: 50%; top: 34%; z-index: 4;
  transform: translate(-50%, -50%) scale(.6);
  font-family: var(--f-pixel); font-size: clamp(14px, 2.2vw, 22px); color: var(--green);
  text-shadow: 3px 3px 0 #000, 0 0 20px rgba(61, 255, 122, .6);
  opacity: 0; pointer-events: none; white-space: nowrap;
}
.toast-center.is-on { animation: pop 1.3s steps(14) forwards; }
@keyframes pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  25%, 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}

/* --------------------------------------------------------------- strip */
.strip {
  position: relative; z-index: 1;
  background: #0b0906;
  border-top: 4px solid #000;
  border-bottom: 4px solid #000;
  box-shadow: inset 0 3px 0 #2b1a0a;
  padding: 26px 16px;
  text-align: center;
}
.strip p { margin: 0; font-size: clamp(20px, 2vw, 26px); color: var(--muted); }
.strip span { color: var(--ink); }

/* --------------------------------------------------------------- sections */
.contract, .about { padding: clamp(64px, 9vw, 110px) 16px; }
.contract {
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(255, 138, 30, .09), transparent 70%),
    var(--bg);
}

.metal-card {
  position: relative;
  max-width: 760px; margin: 0 auto;
  padding: clamp(26px, 4vw, 44px);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #2b2f33 0%, #1b1e21 45%, #131517 100%);
  border: 4px solid #000;
  box-shadow:
    inset 0 4px 0 #474d53,
    inset 4px 0 0 #393e43,
    inset 0 -4px 0 #0c0d0e,
    inset -4px 0 0 #101213,
    10px 10px 0 #000,
    0 0 80px -20px rgba(255, 138, 30, .45);
}
.rivet { position: absolute; width: 8px; height: 8px; background: #6b737b; box-shadow: inset -2px -2px 0 #2a2e32, inset 2px 2px 0 #a5adb5; }
.rivet--tl { top: 12px; left: 12px; } .rivet--tr { top: 12px; right: 12px; }
.rivet--bl { bottom: 12px; left: 12px; } .rivet--br { bottom: 12px; right: 12px; }
.metal-card__head { display: flex; align-items: center; gap: 14px; justify-content: center; text-align: center; }
.metal-card h2 { margin: 0; font-family: var(--f-pixel); font-weight: 400; font-size: clamp(14px, 2.2vw, 22px); line-height: 1.5; text-shadow: 3px 3px 0 #000; }
.status {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 22px auto 26px; width: max-content; max-width: 100%;
  padding: 10px 16px;
  font-family: var(--f-pixel); font-size: 12px; color: var(--orange);
  background: #0a0a0a; border: 3px solid #000; box-shadow: inset 0 0 0 2px #3b2208;
}
.status__led { width: 10px; height: 10px; background: var(--orange); box-shadow: 0 0 10px var(--orange); animation: blink 1s steps(1) infinite; }
.status.is-live { color: var(--green); box-shadow: inset 0 0 0 2px #14401f; }
.status.is-live .status__led { background: var(--green); box-shadow: 0 0 10px var(--green); }

.ca-row { display: flex; gap: 12px; align-items: stretch; }
.ca-field {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: #050606;
  border: 3px solid #000;
  box-shadow: inset 3px 3px 0 #000, inset -2px -2px 0 #2a2e32;
}
.ca-field__label { font-family: var(--f-pixel); font-size: 9px; color: var(--dim); padding: 4px 6px; border: 2px solid #26292c; }
.ca-field code { font-family: var(--f-body); font-size: 22px; color: var(--ink); overflow-wrap: anywhere; }
.ca-field.is-empty code { color: var(--dim); font-style: italic; }
.warn { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 26px; font-size: 19px; color: var(--muted); }
.ico--warn { width: 16px; height: 16px; fill: var(--gold); margin-top: 3px; }

/* about */
.about { background: var(--bg-2); border-top: 4px solid #000; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 1080px; margin: 0 auto; }
.card {
  position: relative;
  padding: 30px 24px 28px;
  background: var(--panel);
  border: 3px solid #000;
  box-shadow: inset 0 0 0 2px #1f2321, 6px 6px 0 #000;
  transition: transform .18s steps(3), box-shadow .18s steps(3);
}
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--accent, var(--orange)); }
.card:nth-child(2) { --accent: var(--red); }
.card:nth-child(3) { --accent: var(--green); }
.card:hover { transform: translate(-3px, -3px); box-shadow: inset 0 0 0 2px #1f2321, 9px 9px 0 #000, 0 0 40px -12px var(--accent, var(--orange)); }
.card__icon { width: 64px; height: 64px; margin-bottom: 20px; padding: 8px; background: #000; border: 2px solid #26292c; }
.card__icon svg, .card__icon img { width: 100%; height: 100%; shape-rendering: crispEdges; }
.card__icon img { object-fit: cover; }
.card:hover .card__icon svg, .card:hover .card__icon img { animation: bob .4s steps(2) infinite; }
.card h3 { margin: 0 0 12px; font-family: var(--f-pixel); font-weight: 400; font-size: 18px; color: var(--accent, var(--orange)); text-shadow: 3px 3px 0 #000; }
.card p { margin: 0; font-size: 23px; color: var(--ink); }
.about__note { max-width: 760px; margin: 48px auto 0; text-align: center; font-size: clamp(22px, 2.2vw, 28px); color: var(--muted); }

/* footer */
.footer { position: relative; background: #050605; }
.footer__grass {
  height: 16px;
  background:
    linear-gradient(90deg, #1f3a17 0 8px, #2c5221 8px 16px) 0 0 / 16px 8px repeat-x,
    linear-gradient(#1a120b, #1a120b) 0 8px / 100% 8px no-repeat;
  border-top: 4px solid #000;
}
.footer__inner { display: grid; justify-items: center; gap: 22px; padding: 56px 16px 40px; text-align: center; }
.footer__tag { margin: 0; font-family: var(--f-pixel); font-size: clamp(12px, 1.8vw, 16px); line-height: 1.7; color: var(--ink); text-shadow: 3px 3px 0 #000; }
.footer__social { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.footer__small { margin: 0; font-family: var(--f-pixel); font-size: 10px; color: var(--orange); }
.footer__legal { margin: 0; max-width: 560px; font-size: 17px; color: var(--dim); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  transform: translate(-50%, calc(100% + 40px));
  padding: 12px 18px;
  font-family: var(--f-pixel); font-size: 10px; color: #03160a;
  background: var(--green); border: 3px solid #000; box-shadow: 4px 4px 0 #000;
  transition: transform .3s steps(5);
  pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); }
.toast.is-warn { background: var(--orange); color: #160a01; }

/* reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease var(--d, 0s), transform .6s cubic-bezier(.2,.8,.2,1) var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* --------------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .cards { grid-template-columns: 1fr; max-width: 520px; }
  .hud__box { min-width: 0; padding: 7px 9px; }
  .hud__box b { font-size: 11px; }
}
@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .hide-sm { display: none; }
  .brand__text strong { font-size: 12px; }
  .brand__text small { font-size: 8px; }
  .logo-mark { width: 34px; height: 34px; }
  .topbar__nav { gap: 8px; }
  .px-btn--sm { padding: 9px 10px; }
  .hud { gap: 5px; left: 16px; right: 16px; transform: none; justify-content: center; }
  .hud__box { flex: 1; padding: 6px 7px; gap: 5px; }
  .hud__box span { font-size: 7px; }
  .hud__box b { font-size: 10px; letter-spacing: 0; }
  .hud__mute { width: 40px; flex: none; }
  .overlay { padding-top: calc(var(--header-h) + 80px); }
  .overlay--start { padding-bottom: 30vh; }
  .overlay__kicker { font-size: 8px; }
  .overlay__hint { font-size: 8px; }
  .px-btn--xl { padding: 18px 22px; font-size: 14px; }
  .ca-row { flex-direction: column; }
  .ca-field__label { display: none; }
  .metal-card .px-btn--xl { font-size: 12px; padding: 16px 12px; }
  .metal-card h2 { font-size: 13px; }
  .metal-card__head .logo-mark { display: none; }
  .status { font-size: 10px; }
  .over-stats b { font-size: 11px; }
  .footer__tag { max-width: 300px; }
}
@media (max-width: 420px) {
  .hide-xs { display: none; }
  .topbar { gap: 8px; padding: 0 12px; }
  .brand { gap: 8px; }
  .brand__text strong { font-size: 10px; }
  .brand__text small { font-size: 7px; }
  .logo-mark { width: 28px; height: 28px; }
  .topbar__nav { gap: 6px; }
  .px-btn--sm { padding: 8px 9px; font-size: 9px; }
  .overlay__title { font-size: 19px; }
  .overlay__sub { margin: 14px 0 22px; font-size: 21px; }
  .overlay__kicker { margin-bottom: 16px; letter-spacing: .5px; font-size: 7px; }
  .overlay__hint { font-size: 7px; }
  .overlay--start { padding-top: calc(var(--header-h) + 20px); }
}
@media (max-width: 340px) {
  .brand__text { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .overlay--start .px-btn--xl, .dot, .status__led, .logo-mark--boot { animation: none; }
}
