/* Design tokens, reset, typography and scrollbars.
   The palette is sampled from the game's own UI sprites (see
   tools/extract-assets/README.md); change it there first, then here. */

@font-face {
  font-family: 'ONI Display';
  src: url('../assets/fonts/LeagueSpartan-Bold.otf') format('opentype');
  font-display: swap;
}
@font-face {
  font-family: 'ONI Body';
  src: url('../assets/fonts/NotoSans-Regular.ttf') format('truetype');
  font-display: swap;
}

:root {
  /* Exact colours from the game's ColorStyleSetting assets (manifest.json). */
  --space-0: #12131c;
  --space-1: #1b1d2b;
  --panel: #2c3043;            /* between the title bar and the action bar */
  --panel-raised: #40445c;     /* action bar */
  --panel-deep: #1c1f2c;
  --panel-head: #24283c;       /* dark title bar */
  --panel-line: #585f7c;
  --outline: #0e0f16;          /* the game's thick black outlines */

  --btn: #3e4357;              /* button: inactive */
  --btn-hover: #585f7c;        /* button: hover */
  --btn-active: #808bb2;       /* button: active */
  --btn-disabled: #6a6966;
  --toggle-hover: #737a98;     /* button_bold_toggle_selection: hover */

  --pink: #874566;             /* buttonPink: inactive, selected toggles */
  --pink-hi: #9d5579;          /* buttonPink: hover */
  --pink-active: #ca739f;      /* buttonPink: active */
  --pink-head: #a44878;        /* pink header sprite */

  --ink: #ffffff;
  --ink-soft: #c9cbd8;
  --ink-mute: #9497ad;
  --ink-dark: #1a1b24;

  --warn: #fbb03b;             /* highlight */
  --bad: #f44a47;
  --good: #1aba00;
  --good-text: #4fd236;
  --so: #ffd300;               /* Spaced Out! accent */
  --cyan: #63c9d8;
  --lilac: #808bb2;

  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 3px 0 rgba(0, 0, 0, 0.45), 0 10px 26px rgba(0, 0, 0, 0.4);
  /* web_button: a darker L on the bottom and right edges */
  --bevel: inset -2px -3px 0 rgba(0, 0, 0, 0.28), inset 2px 2px 0 rgba(255, 255, 255, 0.07);
  --frame: 0 0 0 2px var(--outline);

  --font-display: 'ONI Display', 'Trebuchet MS', 'Segoe UI', sans-serif;
  --font-body: 'ONI Body', 'Noto Sans', 'Segoe UI', system-ui, sans-serif;

  --gap: 16px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--space-0);
  background-image:
    radial-gradient(1200px 700px at 78% -10%, rgba(130, 70, 150, 0.35), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(40, 90, 140, 0.3), transparent 60%),
    linear-gradient(180deg, var(--space-1), var(--space-0));
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

/* A slow, faint starfield behind everything; static when motion is reduced. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(1px 1px at 33% 72%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 58% 34%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1px 1px at 81% 61%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 92% 12%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 7% 88%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(1px 1px at 46% 94%, rgba(255, 255, 255, 0.4), transparent 60%),
    radial-gradient(1px 1px at 69% 8%, rgba(255, 255, 255, 0.55), transparent 60%);
  background-size: 420px 420px;
  animation: drift 240s linear infinite;
  opacity: 0.7;
}
@keyframes drift {
  to {
    background-position: 420px 840px;
  }
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: normal;
  line-height: 1.1;
}

p {
  margin: 0;
}

a {
  color: var(--pink-hi);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--ink);
}

img {
  display: block;
  max-width: 100%;
  image-rendering: auto;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--warn);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Scrollbars in the game's style: a slim lilac thumb on a recessed track. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--lilac) var(--panel-deep);
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--panel-deep);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--lilac), #8378ad);
  border-radius: 10px;
  border: 2px solid var(--panel-deep);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--pink);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

::selection {
  background: var(--pink);
  color: #fff;
}

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