/* Design tokens: the one place for RayKart's colours, sizes, type, corners and shadows. Menus,
   HUD and controls guide all read these (css/components.css builds the shared parts from them).
   Sizes are in rem, and the root size follows the window, so a big screen gets big menus. */
/* The game's typeface: Baloo 2 (SIL Open Font License 1.1, assets/fonts/OFL-Baloo2.txt), self-hosted -
   one variable file per script range covering the weights used (600 - 800); the system stack meanwhile */
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/fonts/baloo2-latin.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: "Baloo 2";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/fonts/baloo2-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* ---- colour: navy plates, light-blue rims, gold for what matters */
  --c-ink: #0d1730;            /* outlines, lettering stroke */
  --c-navy-900: #15223f;       /* plate bottom */
  --c-navy-800: #1c2c52;
  --c-navy-700: #2d4479;       /* plate top */
  --c-navy-600: #3b5596;
  --c-rim: #6fbaff;            /* plate rim */
  --c-rim-soft: #4a6bb0;       /* rim of quieter parts */
  --c-blue-top: #3f6fd0;
  --c-blue-bottom: #244a9c;
  --c-blue-shade: #142a5c;
  --c-gold: #ffc93a;
  --c-gold-top: #ffe066;
  --c-gold-bottom: #ffa51e;
  --c-gold-rim: #fff3c0;
  --c-gold-shade: #c27a00;
  --c-red-top: #ff7a6b;
  --c-red-bottom: #d8322a;
  --c-red-shade: #7d1712;
  --c-green: #3fe08a;
  --c-cyan: #35c8ff;
  --c-text: #f4f7ff;
  --c-text-soft: #c4d3f2;      /* secondary text: 7:1 on the plates */
  --c-text-dim: #93a7d3;
  --c-on-gold: #3b2400;
  --c-focus: #ffffff;           /* the focus ring: a 4 px outline in this (css/components.css) */
  --c-scrim: rgb(8 14 34 / 58%);

  /* ---- glass: see-through, frosted surfaces over the 3D scene (opaque under calm motion, reduced
     transparency, or where backdrop-filter is missing: see below) */
  --glass-filter: blur(18px) saturate(1.4);
  --glass-1: linear-gradient(rgb(45 68 121 / 62%), rgb(21 34 63 / 76%));   /* panels, sheets */
  --glass-2: rgb(8 16 36 / 46%);                                           /* wells inside a panel */
  --glass-3: linear-gradient(rgb(70 98 168 / 44%), rgb(28 44 82 / 58%));   /* cards on glass */
  --glass-rim: rgb(140 200 255 / 50%);
  --glass-shine: inset 0 1px 0 rgb(255 255 255 / 26%);
  --glass-scrim: radial-gradient(ellipse at center, rgb(8 14 34 / 30%), rgb(8 14 34 / 66%));

  /* ---- spacing (4 px grid at the usual size) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  /* the edge of the screen; menus keep this far from it */
  --gutter: clamp(12px, 2.2vmin, 40px);

  /* ---- corners */
  --r-sm: 0.625rem;
  --r-md: 0.875rem;
  --r-lg: 1.25rem;
  --r-pill: 999px;

  /* ---- lines */
  --line: 3px;
  --line-thin: 2px;

  /* ---- type: one family, bold and round; five sizes */
  --font: "Baloo 2", "Fredoka", "Nunito", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-md: 1.125rem;
  --t-lg: 1.375rem;
  --t-xl: 1.875rem;
  --t-2xl: 2.5rem;
  --stroke: 0.22em;            /* the dark outline round display lettering */

  /* ---- sizes of things you press */
  --hit: max(44px, 2.75rem);   /* the smallest a target may be */
  --hit-md: max(48px, 3.25rem);
  --hit-lg: max(56px, 4rem);

  /* ---- shadows */
  --sh-plate: 0 0 0 1.5px rgb(13 23 48 / 70%), 0 0.6rem 1.6rem rgb(0 0 0 / 32%), var(--glass-shine);
  --sh-raised: 0 0.3rem 0 var(--btn-shade, var(--c-blue-shade)), inset 0 3px 0 rgb(255 255 255 / 22%);
  --sh-pressed: 0 1px 0 var(--btn-shade, var(--c-blue-shade)), inset 0 3px 0 rgb(255 255 255 / 22%);
  --sh-glow-gold: 0 0 1rem rgb(255 200 60 / 70%);

  /* ---- motion */
  --ease-pop: cubic-bezier(0.2, 1.4, 0.4, 1);
  --dur-fast: 0.1s;
  --dur: 0.2s;
}

/* opaque glass: calm motion, a wish for less transparency, no backdrop-filter, or too slow here (html.solid) */
html.calm,
html.solid {
  --glass-filter: none;
  --glass-1: linear-gradient(rgb(45 68 121 / 96%), rgb(21 34 63 / 97%));
  --glass-2: rgb(8 16 36 / 70%);
  --glass-3: linear-gradient(rgb(59 85 150 / 96%), rgb(28 44 82 / 97%));
}

@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass-filter: none;
    --glass-1: linear-gradient(rgb(45 68 121 / 96%), rgb(21 34 63 / 97%));
    --glass-2: rgb(8 16 36 / 70%);
    --glass-3: linear-gradient(rgb(59 85 150 / 96%), rgb(28 44 82 / 97%));
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --glass-1: linear-gradient(rgb(45 68 121 / 96%), rgb(21 34 63 / 97%));
    --glass-2: rgb(8 16 36 / 70%);
    --glass-3: linear-gradient(rgb(59 85 150 / 96%), rgb(28 44 82 / 97%));
  }
}

/* seats at one screen: a colour and a shape each (● ▲ ■ ◆) */
:root {
  --p1: #ff8a3d;
  --p2: #3fb7ff;
  --p3: #57d657;
  --p4: #ff6fb1;
}

/* the root size: 16 px on an ordinary window, more on a big one, a little less on a very low one */
html {
  font-size: clamp(16px, calc(0.45vw + 0.85vh), 22px);
}

@media (max-height: 520px) {
  html {
    font-size: 14px;
  }
}

/* bigger text (settings) */
html.text-large {
  font-size: clamp(18px, calc(0.52vw + 0.98vh), 25px);
}

@media (max-height: 520px) {
  html.text-large {
    font-size: 16px;
  }
}
