/**
 * Dead Reckoning — design system
 *
 * Lux Capital identity (Brown, black ink, Cool Gray 8, Pantone 485 red used
 * sparingly) + the Dead Reckoning key art (midnight sky, EU-star gold) + the
 * printed card system (Capability green, Budget blue, Award orange, SpaceY
 * black). Backstage screens are paper; stage screens are night sky.
 */

/* ---------- Brown (LL Brown, the typeface of riskgaming.com) ---------- */
@font-face { font-family: 'Brown'; font-weight: 300; font-style: normal; font-display: swap; src: url('../fonts/lineto-brown-light.woff2') format('woff2'); }
@font-face { font-family: 'Brown'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/lineto-brown-regular.woff2') format('woff2'); }
@font-face { font-family: 'Brown'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/lineto-brown-bold.woff2') format('woff2'); }
/* Italic = Brown's forward-leaning Italic cut, pinned explicitly so browsers
   never fake a slant. NOT "Reclining"/"Backslanted": those lean backward, which
   is what the app used until 2026-10-06 (Laurence spotted it). */
@font-face { font-family: 'Brown'; font-weight: 300; font-style: italic; font-display: swap; src: url('../fonts/lineto-brown-lightitalic.woff2') format('woff2'); }
@font-face { font-family: 'Brown'; font-weight: 400; font-style: italic; font-display: swap; src: url('../fonts/lineto-brown-italic.woff2') format('woff2'); }
@font-face { font-family: 'Brown'; font-weight: 700; font-style: italic; font-display: swap; src: url('../fonts/lineto-brown-bolditalic.woff2') format('woff2'); }

:root {
  /* Lux */
  --ink: #0d0d0d;
  --ink-2: #3a3a3d;
  --ink-3: #5c5d63;          /* secondary text on paper (darker than Cool Gray 8 for legibility) */
  --cool-gray: #8a8a8d;      /* Pantone Cool Gray 8: labels and rules only */
  --lux-red: #ff1c24;        /* Pantone 485: the mark, live dots, destructive actions */
  --lux-red-ink: #c8121a;

  /* Paper (backstage) */
  --paper: #f4f3ef;
  --paper-2: #ebe9e3;
  --sheet: #ffffff;
  --rule: #d6d4ce;
  --rule-strong: #b9b6ae;

  /* Night (stage) — sampled from the key art */
  --night: #03072a;
  --night-2: #0a1440;
  --night-3: #142056;
  --horizon: #265e77;
  --mist: #a9b6c8;           /* secondary text on night */
  --night-rule: rgba(255, 255, 255, 0.16);

  /* Dead Reckoning scenario accent: the EU-star gold of the key art and wordmark */
  --gold: #ffcb04;
  --gold-deep: #8a6700;      /* gold as text on paper */
  --ember: #ef7a2a;          /* the burning satellite */

  /* The printed card system */
  --cap: #00b053;  --cap-deep: #006146;  --cap-lime: #e1e31a;
  --budget: #205fa4; --budget-deep: #003b76;
  --award: #f26521; --award-deep: #a8430e;
  --spacey: #070504; --spacey-2: #312f2e;

  /* Type */
  --font: 'Brown', Arial, Helvetica, sans-serif;
  --fs-xs: 0.75rem; --fs-sm: 0.8125rem; --fs-md: 0.9375rem; --fs-lg: 1.125rem; --fs-xl: 1.5rem; --fs-2xl: 2rem;

  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(13, 13, 13, 0.06), 0 8px 24px rgba(13, 13, 13, 0.06);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-size-adjust: 100%; }
body { font-family: var(--font); font-weight: 400; line-height: 1.45; color: var(--ink); background: var(--paper); }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- labels: Lux's small spaced caps over a value ---------- */
.label {
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  height: 2.5rem; padding: 0 1rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-md); font-weight: 400; letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap;
  transition: background 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #262629; }
.btn-primary:disabled { background: var(--cool-gray); cursor: not-allowed; }
.btn-secondary { border: 1px solid var(--rule-strong); background: var(--sheet); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-quiet { padding: 0 0.6rem; color: var(--ink-2); }
.btn-quiet:hover { color: var(--ink); background: var(--paper-2); }
.btn-danger { border: 1px solid var(--lux-red); color: var(--lux-red-ink); background: var(--sheet); }
.btn-danger:hover { background: var(--lux-red); color: #fff; }
.btn-sm { height: 2rem; padding: 0 0.7rem; font-size: var(--fs-sm); }
.btn-icon { width: 2.25rem; padding: 0; }

/* ---------- inputs ---------- */
.input {
  width: 100%; height: 2.75rem; padding: 0 0.9rem;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--sheet); font-size: var(--fs-md);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.input::placeholder { color: #9a9a9e; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(13, 13, 13, 0.08); }
.input-code { text-transform: uppercase; letter-spacing: 0.22em; text-align: center; font-variant-numeric: tabular-nums; }
.input-code::placeholder { letter-spacing: 0.12em; }

/* ---------- pills & chips ---------- */
.code-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 4.8rem; height: 1.75rem; padding: 0 0.55rem;
  border-radius: var(--radius-sm); background: var(--paper-2);
  font-size: var(--fs-sm); letter-spacing: 0.12em; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.version-pill {
  display: inline-flex; align-items: center; height: 1.5rem; padding: 0 0.5rem;
  border-radius: var(--radius-sm); background: #fbeec4; color: #7a5a00;
  font-size: var(--fs-xs); letter-spacing: 0.04em;
}

/* ---------- icons, flags, people ---------- */
.icon { flex: none; }
.flag { width: 1.5em; height: 1em; border-radius: 2px; box-shadow: 0 0 0 1px rgba(13, 13, 13, 0.12); flex: none; overflow: hidden; }
.flag-esa {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold); color: var(--ink); font-weight: 700; letter-spacing: 0.06em;
}
.flag-esa > span { font-size: 0.5em; line-height: 1; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  color: #fff; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.02em;
  box-shadow: 0 0 0 2px var(--paper);
}

/* ---------- lockup ---------- */
.lockup { height: 2.35rem; width: auto; color: var(--ink); }
.lockup .lockup-rule { fill: var(--rule); }
.on-night .lockup { color: #fff; }
.on-night .lockup .lockup-rule { fill: rgba(255, 255, 255, 0.35); }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 1rem; bottom: 1rem; z-index: 100; display: flex; flex-direction: column; gap: 0.5rem; max-width: min(28rem, calc(100vw - 2rem)); }
.toast {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.7rem 0.9rem; border-radius: var(--radius);
  background: var(--ink); color: var(--paper); font-size: var(--fs-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  animation: toast-in 220ms var(--ease);
}
.toast-error { background: var(--lux-red-ink); }
.toast-warning { background: #5a3d00; }
.toast-action { margin-left: auto; color: var(--gold); font-size: var(--fs-sm); letter-spacing: 0.02em; text-decoration: underline; text-underline-offset: 3px; }
.toast.leaving { opacity: 0; transform: translateY(4px); transition: all 200ms var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- dialog ---------- */
.dialog-backdrop {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 1rem;
  background: rgba(13, 13, 13, 0.36); animation: fade-in 150ms var(--ease);
}
.dialog {
  width: min(30rem, 100%); padding: 1.6rem; border-radius: 8px;
  background: var(--sheet); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.dialog h2 { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.01em; margin-bottom: 0.5rem; }
.dialog p { color: var(--ink-2); font-size: var(--fs-md); margin-bottom: 1rem; }
.dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.2rem; }
@keyframes fade-in { from { opacity: 0; } }

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