/* Kena Tiang web pages: the game's "Bomb Squad Garage" look (design-system/MASTER.md):
   dark grunge, hazard tape, steel plates in Saira Stencil One, an LCD readout. */
@font-face {
  font-family: "Saira Stencil One";
  src: url("/fonts/SairaStencilOne-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "DSEG7 Classic";
  src: url("/fonts/DSEG7Classic-BoldItalic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
:root {
  --bg: #0e0f10;
  --surface: #1a1c1e;
  --raised: #26292c;
  --line: #3a3f44;
  --text: #f2f2ee;
  --text-2: #a3a8ad;
  --hazard: #ffd400;
  --on-hazard: #111111;
  --boom: #ff4d3d;
  --safe: #2bd67b;
  --info: #4da3ff;
  --card-face: #fafaf7;
  --card-red: #d7263d;
  --card-black: #1b1b1b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.2px),
    linear-gradient(170deg, rgba(255, 255, 255, 0.03), transparent 40%),
    radial-gradient(ellipse at 20% 0%, #1d2023 0%, transparent 60%);
  background-size: 14px 14px, 100% 100%, 100% 100%;
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, "PingFang SC", "Noto Sans SC", sans-serif;
}
a { color: var(--hazard); }
a:focus-visible { outline: 3px solid var(--hazard); outline-offset: 3px; border-radius: 4px; }
.stencil { font-family: "Saira Stencil One", Impact, "Arial Black", sans-serif; letter-spacing: 0.04em; }

/* Hazard tape: the seam between the doors. */
.tape {
  height: 22px;
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 18px, var(--on-hazard) 18px 36px);
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.35);
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px max(16px, env(safe-area-inset-left)); max-width: 1040px; margin: 0 auto; }
.topbar nav { display: flex; gap: 20px; }
.topbar nav a { display: inline-block; padding: 10px 0; } /* a 44px target */
.brand { font-family: "Saira Stencil One", Impact, sans-serif; font-size: 22px; color: var(--text); text-decoration: none; letter-spacing: 0.06em; }

/* Steel plates hanging on chains. */
.plate {
  display: inline-block;
  padding: 10px 28px 6px;
  background: linear-gradient(#5c6167, #3b3f44);
  border: 3px solid #2a2d31;
  outline: 2px solid #787e85;
  outline-offset: -8px;
  border-radius: 6px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-weight: 400;
  margin: 0;
}

/* The hero runs the full width of the page, so the gears turn off the page's
   own edge. Its text stays in the 1040px column. */
.hero { position: relative; isolation: isolate; overflow: hidden; text-align: center; padding: 48px 16px 44px; }
.hero-inner { max-width: 1040px; margin: 0 auto; }
.hero .plate { font-size: clamp(40px, 11vw, 88px); line-height: 1; }
.hero .tagline { margin: 24px auto 0; max-width: 560px; font-size: clamp(18px, 4.5vw, 22px); color: var(--text); }
.gear { position: absolute; z-index: -1; fill: #4a4f55; opacity: 0.3; }
.gear.one { width: 240px; right: -110px; top: 24px; }
.gear.two { width: 180px; left: -80px; bottom: -50px; fill: #3e4247; }
@media (min-width: 760px) {
  /* Room beside the column: one gear each side of the title, in full. */
  .gear { opacity: 0.55; }
  .gear.one { width: 300px; right: auto; left: calc(50% + 330px); top: 8px; }
  .gear.two { width: 220px; left: auto; right: calc(50% + 360px); bottom: -48px; }
}

.lcd {
  display: inline-block;
  margin-top: 28px;
  padding: 10px 18px;
  background: #0b1a10;
  border: 2px solid var(--line);
  border-radius: 8px;
  font-family: "DSEG7 Classic", ui-monospace, monospace;
  font-weight: 700;
  font-style: italic;
  font-size: 34px;
  color: #7dff9a;
  text-shadow: 0 0 10px rgba(125, 255, 154, 0.45);
}

/* Store badges: each store's own artwork, unaltered, both at one height and
   with at least a quarter of that height clear around them. The App Store
   badge comes first (Apple's marketing guidelines ask for that). */
.store-badges { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px; margin: 32px auto 0; }
.store-badge { display: inline-flex; border-radius: 9px; }
.store-badge img { display: block; width: auto; height: clamp(48px, 5vw, 56px); }
.store-badge:focus-visible { border-radius: 9px; }

.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; max-width: 1040px; margin: 0 auto; padding: 40px 16px; }
.mode { display: flex; flex-direction: column; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.mode .plate { font-size: 30px; padding: 6px 18px 2px; }
.mode p { color: var(--text-2); margin: 16px 0 0; }
/* The outcome sits on the card's bottom edge, so the two cards end level. */
.mode .outcome { margin-top: auto; padding-top: 16px; font-family: "Saira Stencil One", Impact, sans-serif; font-size: 22px; }
.boom { color: var(--boom); }
.safe { color: var(--safe); }

/* Classic, drawn: the range the bomb hides in, after a few misses. */
.range { width: 100%; max-width: 420px; margin-top: 20px; }
.range-track { display: block; position: relative; height: 14px; border-radius: 7px; background: var(--raised); border: 1px solid var(--line); overflow: hidden; }
.range-live { position: absolute; top: 0; bottom: 0; left: 24%; right: 26%; background: repeating-linear-gradient(-45deg, var(--hazard) 0 8px, #d9b400 8px 16px); }
.range-ticks { display: block; position: relative; height: 20px; margin-top: 8px; font-family: "DSEG7 Classic", ui-monospace, monospace; font-style: italic; font-weight: 700; font-size: 14px; line-height: 20px; color: var(--text-2); }
.range-ticks b { position: absolute; top: 0; transform: translateX(-50%); }
.range-ticks b:first-child { left: 0; transform: none; }
.range-ticks b:last-child { right: 0; transform: none; }
.range-ticks .live { color: var(--text); }

/* Poker, drawn: two posts and the card pulled from the machine. Cards keep
   the game's 222:323 ratio. */
.hand { display: flex; align-items: flex-start; gap: 12px; margin-top: 20px; padding-bottom: 10px; }
.pcard { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 54px; aspect-ratio: 222 / 323; border-radius: 6px; background: var(--card-face); color: var(--card-black); font-weight: 800; line-height: 1; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }
.pcard b { font-size: 21px; }
.pcard i { margin-top: 3px; font-style: normal; font-size: 18px; }
.pcard.red { color: var(--card-red); }
.pcard.back { background: var(--card-black); color: var(--text); border: 2px solid var(--card-face); transform: translateY(10px) rotate(-5deg); }
.pcard.back b { font-family: "Arial Black", Arial, sans-serif; font-size: 16px; }

.features { max-width: 1040px; margin: 0 auto; padding: 8px 16px 48px; }
.features h2 { font-family: "Saira Stencil One", Impact, sans-serif; font-weight: 400; font-size: 28px; letter-spacing: 0.04em; }
.features ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.features li { background: var(--surface); border-left: 4px solid var(--hazard); border-radius: 8px; padding: 12px 14px; color: var(--text); }
.note { color: var(--text-2); font-size: 14px; max-width: 760px; }

/* The closing call: the same badges, for whoever read to the end. */
.cta { text-align: center; padding: 48px 16px 56px; }
.cta .plate { font-size: clamp(26px, 6vw, 40px); line-height: 1.1; padding: 8px 22px 4px; }
.cta p { margin: 16px 0 0; color: var(--text-2); }
.cta .store-badges { margin-top: 24px; }

.doc { max-width: 760px; margin: 0 auto; padding: 32px 16px 48px; }
.doc h1 { font-family: "Saira Stencil One", Impact, sans-serif; font-weight: 400; font-size: clamp(30px, 7vw, 44px); line-height: 1.15; letter-spacing: 0.03em; }
.doc h2 { margin-top: 2em; font-size: 22px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.doc blockquote { margin: 1.5em 0; padding: 4px 16px; border-left: 4px solid var(--hazard); background: var(--surface); border-radius: 0 8px 8px 0; color: var(--text-2); }
.doc li { margin: 6px 0; }
.doc strong { color: #fff; }
/* The other languages of a legal page. */
.langs { max-width: 760px; margin: 0 auto; padding: 8px 16px 0; font-size: 14px; color: var(--text-2); }
.langs a { display: inline-block; padding: 10px 0; }
.langs [aria-current] { color: #fff; }

.center { text-align: center; padding: 56px 16px; max-width: 640px; margin: 0 auto; }
.center h1 { font-family: "Saira Stencil One", Impact, sans-serif; font-weight: 400; font-size: clamp(30px, 8vw, 46px); line-height: 1.1; margin: 0 0 12px; }
.center p { color: var(--text-2); }
.code { font-family: "DSEG7 Classic", ui-monospace, monospace; font-style: italic; font-weight: 700; color: var(--hazard); letter-spacing: 0.08em; }

.footer { border-top: 1px solid var(--line); color: var(--text-2); font-size: 14px; text-align: center; padding: 24px 16px max(24px, env(safe-area-inset-bottom)); }
.footer a { display: inline-block; padding: 6px 0; color: var(--text-2); }
/* The trademark lines the two badges ask for. */
.legal { display: block; max-width: 720px; margin: 12px auto 0; font-size: 12px; line-height: 1.5; }

@media (prefers-reduced-motion: no-preference) {
  .gear.one { animation: spin 40s linear infinite; }
  .gear.two { animation: spin 30s linear infinite reverse; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .store-badge { transition: transform 150ms ease-out; }
  .store-badge:hover { transform: translateY(-2px); }
  .store-badge:active { transform: translateY(1px); }
}
@media (prefers-contrast: more) {
  :root { --text-2: #d6d9dc; --line: #8a9096; }
}
