/* Ultra Beam Blasters — theme tokens (Artist-owned).
   CSS custom properties only. The Designer's CSS consumes these and never hard-codes colors.
   See art/style-guide.md for usage rules.
   Fonts: Fredoka (display) + Nunito (body), SIL Open Font License (web/assets/fonts/OFL-*.txt).
   Self-hosted: one variable woff2 per family, latin subset, no third-party request.
   Preload both in index.html <head> (see web/assets/fonts/README.md).
   While a font loads, a metric-matched local Arial stands in, so text does not jump on swap. */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('assets/fonts/fredoka-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: 'Nunito';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/nunito-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;
}
/* Fallbacks sized to the real faces (measured in Chrome against Arial Bold: width, ascent, descent). */
@font-face {
  font-family: 'Fredoka Fallback';
  src: local('Arial Rounded MT Bold'), local('ArialRoundedMTBold'), local('Arial'), local('ArialMT');
  size-adjust: 93.9%;
  ascent-override: 103.3%;
  descent-override: 25.6%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Nunito Fallback';
  src: local('Arial'), local('ArialMT');
  size-adjust: 98.9%;
  ascent-override: 102.1%;
  descent-override: 35.4%;
  line-gap-override: 0%;
}

:root {
  /* ---- Elements: main (frame, fills), ink (outlines, text on light), light (art bg, panels), on (text/icons on main) ---- */
  --el-fire: #F2542D;
  --el-fire-ink: #8A1C0A;
  --el-fire-light: #FFE0D1;
  --el-fire-on: #2A1E2E;

  --el-ice: #3DB9E8;
  --el-ice-ink: #0B4F73;
  --el-ice-light: #DDF4FF;
  --el-ice-on: #2A1E2E;

  --el-leaf: #44A536;
  --el-leaf-ink: #1E5916;
  --el-leaf-light: #DFF4D4;
  --el-leaf-on: #2A1E2E;

  --el-electric: #FFC21A;
  --el-electric-ink: #6A4500;
  --el-electric-light: #FFF3C4;
  --el-electric-on: #2A1E2E;

  --el-water: #2F6FE0;
  --el-water-ink: #0F2F75;
  --el-water-light: #D9E6FF;
  --el-water-on: #FFFFFF;

  --el-rock: #B5895C;
  --el-rock-ink: #4A3420;
  --el-rock-light: #F0E4D3;
  --el-rock-on: #2A1E2E;

  /* ---- Surfaces & text ---- */
  --surface: #FFF8EC;        /* card face, panels (warm cream) */
  --surface-2: #F4E8D4;      /* inset zones, secondary panels */
  --surface-3: #E8D7BC;      /* pressed / disabled fill */
  --table: #2E2452;          /* play table (deep night-plum) */
  --table-2: #3D3270;        /* track, table panels */
  --table-ink: #FFF8EC;      /* text/icons on the table */
  --ink: #2A1E2E;            /* main text + art outline color (warm plum-black) */
  --ink-soft: #6B5F72;       /* secondary text on surfaces (5.6:1) */
  --line: #2A1E2E;           /* card and UI outlines */

  /* ---- Signals (always paired with an icon, never color alone) ---- */
  --accent: #D62F78;         /* buttons, your-turn, highlights (white text on it) */
  --accent-ink: #FFFFFF;
  --gold: #FFB400;           /* Super Move, evolution, wins */
  --good: #16805A;           /* you gain / you win */
  --bad: #C8203A;            /* you lose / rival hits */
  --focus: #1A8CFF;          /* keyboard / selection ring */

  /* ---- Type ---- */
  --font-display: 'Fredoka', 'Fredoka Fallback', ui-rounded, 'SF Pro Rounded', 'Arial Rounded MT Bold', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', 'Nunito Fallback', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-number: 'Fredoka', 'Fredoka Fallback', ui-rounded, 'Arial Rounded MT Bold', system-ui, sans-serif; /* push numbers */
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.5rem;
  --fs-xl: 2.25rem;
  --fs-xxl: 3.5rem;
  --fw-body: 600;
  --fw-bold: 800;
  --fw-display: 700;

  /* ---- Shape ---- */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-card: 18px;       /* card corner at ~240px card width */
  --radius-pill: 999px;
  --stroke: 3px;             /* outline weight for cards, buttons, panels */
  --stroke-bold: 5px;        /* selected card, big banners */
  --tap: 48px;               /* minimum touch target */

  /* ---- Depth (warm, soft, never grey-blue) ---- */
  --shadow-sm: 0 2px 0 rgba(42, 30, 46, 0.35);
  --shadow-md: 0 4px 0 rgba(42, 30, 46, 0.35), 0 8px 18px rgba(20, 10, 40, 0.25);
  --shadow-lg: 0 6px 0 rgba(42, 30, 46, 0.35), 0 16px 36px rgba(20, 10, 40, 0.35);
  --shadow-press: 0 1px 0 rgba(42, 30, 46, 0.35);
  --glow-gold: 0 0 0 4px rgba(255, 180, 0, 0.55), 0 0 28px rgba(255, 180, 0, 0.6);
  --glow-accent: 0 0 0 4px rgba(214, 47, 120, 0.45), 0 0 24px rgba(214, 47, 120, 0.5);

  /* ---- Motion ---- */
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 120ms;
  --dur-med: 240ms;
  --dur-slow: 480ms;

  /* ==== UI kit tokens (added for the UI visual kit; see art/ui/README.md) ==== */
  /* Button lips: the darker "3D" edge under every pressable thing. */
  --accent-lip: #96194F;     /* under --accent */
  --accent-hi: #F06AA4;      /* top highlight band on --accent */
  --gold-lip: #B26A00;       /* under --gold */
  --gold-hi: #FFE08A;
  --gold-ink: #2A1E2E;       /* text on gold (= --ink, 9.4:1) */
  --secondary-lip: #C9AE86;  /* under cream (--surface) buttons */
  --rival: #5B4BB0;          /* rival's turn, rival panel accents (cream text 6.6:1) */
  --rival-lip: #362A7A;
  --rival-ink: #FFF8EC;
  --soft: #8F81DA;           /* gentle lose screen, calm banners */
  --soft-lip: #5A4CAE;

  /* Disabled: flat, no lip, no glow (also lower opacity on images inside). */
  --disabled-fill: #DCD0BE;
  --disabled-ink: #8A7E92;
  --disabled-line: #B3A58F;

  /* Table furniture */
  --table-3: #231A40;        /* card tray trough, insets on the table */
  --table-line: #5D4FA3;     /* panel border on the table */
  --table-hi: #4B3E88;       /* top highlight line on table panels */
  --scrim: rgba(22, 14, 44, 0.74); /* behind dialogs / cover screen */

  /* Sizes (touch: everything pressable >= --tap) */
  --btn-h: 64px;             /* primary / secondary button height */
  --btn-h-lg: 80px;          /* hero buttons: Play, I'm ready, Join */
  --btn-h-sm: 52px;          /* compact (still >= --tap) */
  --btn-pad-x: 32px;
  --btn-lip: 6px;            /* lip depth; pressed = 2px */
  --btn-icon: 64px;          /* round icon button */
  --btn-icon-sm: 52px;
  --code-tile: 112px;        /* room-code display tile */
  --key-tile: 88px;          /* room-code keypad key */
  --avatar: 72px;            /* hero avatar circle in player panels */

  /* Depth recipes (lip = solid offset in the lip color, then the soft drop shadow) */
  --lip-accent: 0 var(--btn-lip) 0 var(--accent-lip), 0 calc(var(--btn-lip) + 6px) 16px rgba(20, 10, 40, 0.35);
  --lip-gold: 0 var(--btn-lip) 0 var(--gold-lip), 0 calc(var(--btn-lip) + 6px) 16px rgba(20, 10, 40, 0.35);
  --lip-secondary: 0 var(--btn-lip) 0 var(--secondary-lip), 0 calc(var(--btn-lip) + 6px) 16px rgba(20, 10, 40, 0.3);
  --lip-rival: 0 var(--btn-lip) 0 var(--rival-lip), 0 calc(var(--btn-lip) + 6px) 16px rgba(20, 10, 40, 0.35);
  --lip-pressed: 0 2px 0 var(--lip-color, var(--accent-lip));
  --hi-inset: inset 0 4px 0 rgba(255, 255, 255, 0.28); /* cel highlight on the top edge */
  --tray-inset: inset 0 6px 0 rgba(0, 0, 0, 0.28), inset 0 0 0 3px var(--table-line);

  /* Cel "gradients" (hard stops = 2 flat tones, never airbrushed) */
  --cel-gold: linear-gradient(180deg, var(--gold-hi) 0 38%, var(--gold) 38% 100%);
  --cel-accent: linear-gradient(180deg, var(--accent-hi) 0 38%, var(--accent) 38% 100%);
  --sunburst-gold: repeating-conic-gradient(from 0deg, rgba(255, 224, 138, 0.55) 0 10deg, rgba(255, 180, 0, 0) 10deg 20deg);

  /* Big-moment colors (banner art: web/assets/ui/banner-burst*.svg, banner-ribbon*.svg) */
  --moment-se: var(--el-fire);       /* super effective  -> banner-burst-fire */
  --moment-evolve: var(--gold);      /* evolve           -> banner-burst / banner-ribbon */
  --moment-super: var(--gold);       /* Super Move       -> banner-burst */
  --moment-rally: var(--accent);     /* Rally            -> banner-burst-accent */
  --moment-knock: var(--el-water);   /* knock-off        -> banner-burst-water */
  --moment-win: var(--gold);         /* win              -> banner-ribbon + win-bg.webp */
  --moment-lose: var(--soft);        /* lose (gentle)    -> banner-ribbon-soft + lose-bg.webp */

  /* Display text with an ink outline + lip (banners, big numbers): use with paint-order */
  --text-stroke: 6px;
  --text-lip: 0 5px 0 var(--ink);

  /* Motion for big moments */
  --dur-moment: 1400ms;      /* how long a big-moment banner stays up */
  --ease-bounce: cubic-bezier(0.18, 1.6, 0.4, 1);

  /* ==== Face-Off table (direction B, approved 2026-11-21; see art/ui/README.md) ==== */
  --arena: #170F2B;          /* arena base (behind the element light) */
  --arena-2: #22163E;        /* arena top, card back field */
  --arena-3: #120B22;        /* arena floor */
  --edge: #150E22;           /* hard outline on cards, medallions, buttons in the arena */
  --hud: rgba(14, 8, 28, 0.82);           /* HUD plates, beam rail, status chips */
  --hud-line: rgba(255, 255, 255, 0.12);  /* inner rim on HUD plates */
  --hud-ink: #F6EEDF;        /* text on HUD plates (15:1 on --hud) */
  --hud-soft: #B9A8E0;       /* small caps labels on HUD plates (8:1) */
  --spark: #FFE27A;          /* token, legal-move ring, math highlights */
  --card-drop: 0 1em 1.8em rgba(0, 0, 0, 0.5); /* card shadow; em = card font (width / 10) */

  /* ==== Card frame: design G "Corner + Tuck Foot" (Silas, #172 msg 382). Layers + contract: art/frames/README.md ==== */
  --card-ratio: 1.4;         /* height / width (print: 63 x 88 mm) */
  --card-tuck: 0.2;          /* Boost-only foot strip height / width; also the offset between tucked cards */
  --card-rim: 0.02;          /* inner element rim / width (evolved: 0.024, gold) */
  --card-corner: 0.075;      /* corner radius / width */
  --card-index: 0.3;         /* number badge size / width */
  --card-keyline: 3px;       /* outer --edge outline on screen */
}
