/* San Andreas name-day party. HUD colours come from the game's CHudColours
   table; a few are lifted for contrast on phone screens (raw value noted). */

@font-face {
  font-family: 'Sofia Sans Extra Condensed';
  font-style: normal;
  font-display: swap;
  font-weight: 1 1000;
  src: url(/fonts/sofia-sans-extra-condensed-greek-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Sofia Sans Extra Condensed';
  font-style: normal;
  font-display: swap;
  font-weight: 1 1000;
  src: url(/fonts/sofia-sans-extra-condensed-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sofia Sans Extra Condensed';
  font-style: italic;
  font-display: swap;
  font-weight: 1 1000;
  src: url(/fonts/sofia-sans-extra-condensed-greek-wght-italic.woff2) format('woff2-variations');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Sofia Sans Extra Condensed';
  font-style: italic;
  font-display: swap;
  font-weight: 1 1000;
  src: url(/fonts/sofia-sans-extra-condensed-latin-wght-italic.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Play';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/play-greek-400-normal.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Play';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/play-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Play';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(/fonts/play-greek-700-normal.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Play';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(/fonts/play-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Pirata One';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/pirata-one-latin-400-normal.woff2) format('woff2');
}

:root {
  color-scheme: dark;
  --ink: #0d0a10;
  --night: #1a1220;
  --panel: rgba(10, 7, 12, 0.82);
  --line: rgba(244, 236, 223, 0.16);
  --text: #f4ecdf;
  --muted: #bfb2a2;
  --gold: #e3a832;        /* "Mission passed" on screen; raw HUD gold #906210 */
  --money: #5fae47;       /* raw HUD money #36682C */
  --red: #b4191d;
  --blue: #accbf1;        /* area names, menu highlight */
  --grey: #e1e1e1;        /* "wasted" */
  --grove: #46c800;
  --cream: #e2c063;
  --font-pd: 'Sofia Sans Extra Condensed', 'Arial Narrow', sans-serif;
  --font-goth: 'Pirata One', 'Old English Text MT', serif;
  --font-ui: 'Play', system-ui, sans-serif;
  --outline: 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000,
    1.4px 1.4px 0 #000, -1.4px 1.4px 0 #000, 1.4px -1.4px 0 #000, -1.4px -1.4px 0 #000;
  --outline-thin: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(120% 60% at 50% 0%, #3a2440 0%, var(--night) 45%, var(--ink) 100%) fixed, var(--ink);
  color: var(--text);
  font: 400 17px/1.5 var(--font-ui);
  overflow-wrap: anywhere;
}
a { color: var(--blue); }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* Shared type: Pricedown-like heavy condensed with the game's black outline */
.pd {
  font-family: var(--font-pd);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-shadow: var(--outline);
}

/* ── Loading screen / hero ─────────────────────────────────────────────── */
.loading {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 12px 0;
}
.art {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 6px solid #f4ecdf;
  outline: 3px solid #000;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  background: #2d2350;
  container-type: size; /* the logo scales with the art box (cqh units) */
}
.scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sign text { font: 700 13px/1 var(--font-ui); letter-spacing: 2.5px; }

.logo {
  position: absolute;
  left: 0;
  right: 0;
  top: 6%;
  text-align: center;
  pointer-events: none;
}
.logo-grand {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  margin: 0;
  font: 900 28px / 0.86 var(--font-pd);
  font-size: min(9cqh, 11cqw);
  text-transform: uppercase;
  color: #fff;
  text-shadow: var(--outline), 0 6px 14px rgba(0, 0, 0, 0.45);
}
.logo-grand span { display: block; }
.logo-grand span:nth-child(2) { font-size: 1.18em; }
.logo-sa {
  margin: -0.12em 0 0;
  font: 400 52px / 1 var(--font-goth);
  font-size: min(17cqh, 19cqw);
  color: #fff;
  text-shadow: 3px 0 0 #000, -3px 0 0 #000, 0 3px 0 #000, 0 -3px 0 #000, 2px 2px 0 #000, -2px 2px 0 #000,
    2px -2px 0 #000, -2px -2px 0 #000, 0 8px 18px rgba(0, 0, 0, 0.5);
  transform: rotate(-4deg);
}
.logo-sub {
  display: inline-block;
  margin: 0.3em 0 0;
  padding: 2px 12px;
  background: #000;
  font: 700 14px / 1.3 var(--font-ui);
  font-size: max(12px, 3.7cqh);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.logo-sub b { color: var(--gold); }

.loadbar {
  height: 14px;
  margin: 14px 4px 0;
  border: 2px solid #000;
  background: #2a1a12;
  box-shadow: 0 0 0 2px #f4ecdf;
}
.loadbar i { display: block; height: 100%; width: 0; background: linear-gradient(#f2b35e, #b4591d); transition: width 0.12s linear; }
.loadtip {
  min-height: 3em;
  margin: 10px 4px 0;
  color: var(--muted);
  font-size: 15px;
}

/* While loading, the art fills the phone screen like the game's loading screen */
body.is-loading .loading { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
body.is-loading .art { aspect-ratio: 3 / 4; }
body.is-loading main, body.is-loading .foot { display: none; }
body:not(.is-loading) .loadbar, body:not(.is-loading) .loadtip { display: none; }

/* ── Main column ──────────────────────────────────────────────────────── */
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 12px 24px;
  outline: none;
}
.panel {
  position: relative;
  margin-top: 16px;
  padding: 20px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: rise 0.5s ease both;
}
.panel:nth-of-type(2) { animation-delay: 0.08s; }
.panel:nth-of-type(3) { animation-delay: 0.16s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.notice { text-align: center; }
.notice .big { margin: 6px 0 12px; font-size: 48px; color: var(--grey); text-transform: uppercase; }

/* HUD strip, top right as in the game */
.hud {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 0 4px;
}
.hud-weapon {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 50%;
  border: 3px solid #000;
  background: radial-gradient(circle at 40% 35%, #5a4a3a, #1a1410);
  display: grid;
  place-items: center;
}
.hud-weapon svg { width: 38px; height: 38px; }
.hud-stack { display: grid; justify-items: end; gap: 2px; }
.hud-stack p { margin: 0; }
.hud-clock { font: 900 30px/1 var(--font-pd); color: var(--grey); text-shadow: var(--outline); letter-spacing: 0.04em; }
.hud-bar { width: 132px; height: 10px; border: 2px solid #000; background: #3d0a0b; }
.hud-bar i { display: block; height: 100%; width: 100%; background: var(--red); }
.hud-money { font: 900 32px/1 var(--font-pd); color: var(--money); text-shadow: var(--outline); letter-spacing: 0.03em; font-variant-numeric: tabular-nums; }
.hud-stars { font-size: 22px; line-height: 1; color: #f5c542; text-shadow: var(--outline-thin); letter-spacing: 1px; }
.hud-stars span { display: inline-block; animation: flash 1.6s ease-in-out infinite; }
.hud-stars span:nth-child(2n) { animation-delay: 0.2s; }
@keyframes flash { 50% { opacity: 0.35; } }

/* Mission briefing */
.mission-kicker { margin: 0; color: var(--gold); font: 700 14px/1 var(--font-ui); letter-spacing: 0.2em; text-transform: uppercase; }
.mission-title { margin: 6px 0 14px; font-size: clamp(40px, 12vw, 58px); color: var(--gold); text-transform: uppercase; }
.greeting { margin: 0 0 8px; font: 900 26px/1.1 var(--font-pd); color: var(--blue); text-shadow: var(--outline-thin); }
.brief { margin: 0 0 12px; }
.brief em { font-style: normal; color: var(--cream); }
.objective {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: #000;
  font: 700 18px/1.45 var(--font-ui);
  text-shadow: var(--outline-thin);
}
.objective b { color: var(--blue); }
.current {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-left: 4px solid var(--money);
  background: rgba(70, 200, 0, 0.1);
  font-weight: 700;
}
.current.no { border-left-color: var(--grey); background: rgba(225, 225, 225, 0.08); }

/* Pause-menu headings and the Stats screen */
.menu-title {
  margin: 0 0 14px;
  font: 900 clamp(34px, 10vw, 44px) / 1 var(--font-pd);
  color: var(--blue);
  text-shadow: var(--outline);
  text-transform: uppercase;
}
.statlist { margin: 0; }
.stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.stat dt { flex: none; color: var(--muted); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.stat dt::after { content: ''; }
.stat dd { margin: 0 0 0 auto; text-align: right; font-weight: 700; }
.stat-actions { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.radar {
  flex: none;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--text);
  text-decoration: none;
  font: 700 13px/1 var(--font-ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.radar svg { width: 92px; height: 92px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)); transition: transform 0.2s; }
.radar:hover svg { transform: rotate(-8deg) scale(1.04); }
.cal { display: grid; gap: 8px; flex: 1; }
.tip { margin: 16px 0 0; color: var(--muted); font-size: 15px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 18px;
  border: 2px solid #000;
  background: #f4ecdf;
  color: #000;
  font: 700 16px/1.2 var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); box-shadow: none; font-size: 14px; min-height: 44px; }
.btn.primary { width: 100%; margin-top: 16px; background: var(--gold); font-size: 18px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: 4px 4px 0 #000; }
.btn.is-busy { animation: pulse 0.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.6; } }

/* RSVP menu: items light up like the game's pause menu */
.choices { display: grid; gap: 10px; }
.choice {
  position: relative;
  min-height: 60px;
  padding: 12px 16px 12px 44px;
  border: 2px solid var(--line);
  background: rgba(0, 0, 0, 0.55);
  font: 900 26px/1 var(--font-pd);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-shadow: var(--outline-thin);
  color: var(--grey);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.choice::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid currentColor;
  transform: rotate(45deg);
}
.choice:hover { color: #fff; border-color: rgba(244, 236, 223, 0.4); }
.choice[aria-checked='true'] { color: var(--blue); border-color: var(--blue); background: rgba(172, 203, 241, 0.12); }
.choice[aria-checked='true']::before { background: currentColor; }
.choice.yes[aria-checked='true'] { color: #8fe36a; border-color: var(--grove); background: rgba(70, 200, 0, 0.12); }

.count { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.count-label { font-weight: 700; }
.stepper { display: flex; align-items: center; border: 2px solid var(--line); background: #000; }
.step { width: 48px; height: 48px; border: 0; background: transparent; font: 900 26px/1 var(--font-pd); cursor: pointer; }
.step:disabled { opacity: 0.3; cursor: default; }
.stepper output { min-width: 40px; text-align: center; font: 900 30px/1 var(--font-pd); color: var(--money); text-shadow: var(--outline-thin); }

.note { display: grid; gap: 6px; margin-top: 16px; font-weight: 700; }
.note small { color: var(--muted); font-weight: 400; }
.note textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--line);
  background: #000;
  font-weight: 400;
  resize: vertical;
}
.note textarea:focus { border-color: var(--blue); outline: none; }
.form-error { margin: 12px 0 0; color: #ff8a8a; font-weight: 700; }

/* Result screens */
.result {
  width: min(92vw, 520px);
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: center;
}
.result::backdrop { background: rgba(0, 0, 0, 0.7); }
.result-inner { padding: 28px 16px; }
.result-title { margin: 0; font-size: clamp(56px, 18vw, 92px); text-transform: uppercase; }
.result.yes .result-title { color: var(--gold); animation: slam 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.result.no .result-title { color: var(--grey); font-size: clamp(72px, 24vw, 120px); text-transform: lowercase; animation: fade 1.2s ease both; }
.result-respect { margin: 6px 0 0; font: 900 34px/1 var(--font-pd); color: #fff; text-shadow: var(--outline); text-transform: uppercase; animation: fade 0.6s 0.4s ease both; }
.result-text { margin: 20px auto 22px; max-width: 34ch; font-weight: 700; text-shadow: var(--outline-thin); }
@keyframes slam { from { opacity: 0; transform: scale(1.8); } }
@keyframes fade { from { opacity: 0; } }

/* "wasted" washes the page out to grey, as in the game */
body.is-wasted .loading, body.is-wasted main { filter: grayscale(1) brightness(0.7); transition: filter 1s; }

.foot {
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 16px max(28px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.foot p { margin: 6px 0; }

@media (min-width: 720px) {
  body { font-size: 18px; }
  .loading { padding-top: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
