/* ===========================================================================
   HEXPLORERS - the four skins, as custom properties.

   Load after hexplorers.css. <html data-skin="noir|arcade|atlas|blossom">
   picks one (boardart.js's setSkin() sets it); with no attribute you get noir.
   Every skin defines the same generic names, so a UI built on them reskins
   by itself:
     --bg --stage --panel --panel-2 --line --text --muted --head --ink
     --accent --accent-ink --accent-2 --danger --good --glow --focus
     --res-food --res-wood --res-stone --res-cloth --res-clay --res-gold
     --p-red --p-blue --p-yellow --p-purple --p-white --p-black
     --tile-grass --tile-forest --tile-mountain --tile-water --tile-keep
     --font-head --font-body --font-ui --font-num
     --radius --radius-lg --shadow --border-w
     --pop-shadow --pop-shadow-lg --pop-drop (the overlays: toast, turn banner, new-version bar)
     --btn-r --btn-bw --btn-shadow --pill --caps --caps-track --name-ink (controls and labels; defaults in hexplorers.css)
   The board's own colours are in boardart.js (SKINS), kept to the same hexes.
   All fonts are served from fonts/ (the site allows no third-party fonts).
   ======================================================================== */

/* IM Fell English (Igino Marini) and Crimson Pro (Jacques Le Bailly): both SIL OFL 1.1 */
@font-face { font-family: 'IM Fell English'; src: url('fonts/imfell-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IM Fell English'; src: url('fonts/imfell-400i.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Crimson Pro'; src: url('fonts/crimsonpro-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Crimson Pro'; src: url('fonts/crimsonpro-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

/* ---- Velvet Noir (the default) ------------------------------------------ */
:root, :root[data-skin="noir"] {
  --bg: #0c0a10;
  --stage:
    radial-gradient(ellipse 60% 50% at 50% 42%, rgba(217,164,65,.13), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 115%, rgba(142,27,58,.32), transparent 70%),
    radial-gradient(ellipse at 50% 50%, #17111e, #0c0a10 80%);
  --panel: #1b1620;
  --panel-2: #251e2c;
  --line: #2b2331;
  --text: #ece3d6;
  --head: #ece3d6;
  --muted: #9d90a6;
  --ink: #1c1420;
  --accent: #d9a441;
  --accent-ink: #0c0a10;
  --accent-2: #3ee6c8;
  --danger: #ff7d8f;
  --good: #3ee6c8;
  --glow: rgba(62,230,200,.55);
  --focus: #3ee6c8;
  --res-food: #e2a24f; --res-wood: #a86b3c; --res-stone: #a4a8b3; --res-cloth: #b38ad8; --res-clay: #c4703f; --res-gold: #f2c230;
  --p-red: #d9443b; --p-blue: #3f74d8; --p-yellow: #f2c230; --p-purple: #9b5bd4; --p-white: #f3efe4; --p-black: #2b2b2b; --p-green: #2f9a58; --p-pink: #e872b0;
  --tile-grass: #7fa84e; --tile-forest: #37684a; --tile-mountain: #7f7d8e; --tile-water: #23889c; --tile-keep: #c9952e;
  --font-head: 'Limelight', Georgia, serif;
  --font-body: 'Barlow', 'Segoe UI', system-ui, sans-serif;
  --font-ui: 'VT323', 'Courier New', monospace;
  --font-num: 'VT323', 'Courier New', monospace;
  --radius: 0;
  --radius-lg: 0;
  --border-w: 1px;
  --shadow: 0 10px 30px rgba(0,0,0,.55);
  --pop-shadow: 2px 2px 0 #000; --pop-shadow-lg: 3px 3px 0 #000; --pop-drop: 0 6px 18px rgba(0,0,0,.5);
}

/* ---- Pixel Arcade --------------------------------------------------------- */
:root[data-skin="arcade"] {
  --bg: #0b1030;
  /* a deep blue night with a scatter of square stars */
  --stage:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' shape-rendering='crispEdges'%3E%3Cg fill='%23c9d6ff'%3E%3Crect x='7' y='11' width='2' height='2'/%3E%3Crect x='61' y='5' width='2' height='2' opacity='.6'/%3E%3Crect x='37' y='47' width='2' height='2' opacity='.5'/%3E%3Crect x='83' y='63' width='2' height='2'/%3E%3Crect x='19' y='79' width='2' height='2' opacity='.7'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(#0b1030, #16205a 70%, #1d2a70);
  --panel: #141a46;
  --panel-2: #1e2766;
  --line: #3a4590;
  --text: #f4f4ff;
  --head: #ffd23f;
  --muted: #9aa3d8;
  --ink: #120d24;
  --accent: #ffd23f;
  --accent-ink: #120d24;
  --accent-2: #3ef0ff;
  --danger: #ff4a6a;
  --good: #5ef06a;
  --glow: rgba(62,240,255,.6);
  --focus: #3ef0ff;
  --res-food: #ffb347; --res-wood: #c0834a; --res-stone: #b8bccc; --res-cloth: #c58bff; --res-clay: #e07a3c; --res-gold: #ffd23f;
  --p-red: #ff4a4a; --p-blue: #3d8bff; --p-yellow: #ffd23f; --p-purple: #b45cff; --p-white: #f4f4ff; --p-black: #3a3a52; --p-green: #14c46e; --p-pink: #ff6ec7;
  --tile-grass: #58b947; --tile-forest: #2f8f4e; --tile-mountain: #8a87a8; --tile-water: #2f78e8; --tile-keep: #f2b81f;
  --font-head: 'VT323', 'Courier New', monospace;
  --font-body: 'VT323', 'Courier New', monospace;
  --font-ui: 'VT323', 'Courier New', monospace;
  --font-num: 'VT323', 'Courier New', monospace;
  --radius: 0;
  --radius-lg: 0;
  --border-w: 3px;
  --shadow: 4px 4px 0 #05081c;      /* hard pixel drop, never blurred */
  --pop-shadow: 2px 2px 0 #05081c; --pop-shadow-lg: 3px 3px 0 #05081c; --pop-drop: var(--shadow);
  /* controls are chunky cartridges: a thick edge and the hard drop, like the panels */
  --btn-bw: 2px; --btn-shadow: 2px 2px 0 #05081c;
  --pill: 0;
}

/* ---- Explorer's Atlas ----------------------------------------------------- */
:root[data-skin="atlas"] {
  --bg: #e9dbb9;
  /* parchment: a warm wash, foxed at the edges, with a fine grain over it */
  --stage:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 75% 70% at 50% 45%, #f3e7cc, #e6d3a8 70%, #c9ad7c 100%);
  --panel: #f5ecd6;
  --panel-2: #fbf5e6;
  --line: #c7b08a;
  --text: #2f2216;
  --head: #3b2a1a;
  --muted: #6e583d;
  --ink: #3b2a1a;
  --accent: #b5452b;            /* vermilion, the cartographer's red ink */
  --accent-ink: #fbf5e6;
  --accent-2: #2f6f73;
  --danger: #a3262a;
  --good: #3f7a3a;
  --glow: rgba(181,69,43,.35);
  --focus: #2f6f73;
  --res-food: #d9a24a; --res-wood: #9a6a42; --res-stone: #8f8878; --res-cloth: #8e6ab0; --res-clay: #b0643a; --res-gold: #d9a82c;
  --p-red: #c0392b; --p-blue: #2f5fa7; --p-yellow: #e0a91c; --p-purple: #7b4a9e; --p-white: #f7f1e3; --p-black: #2a2622; --p-green: #3c7a3e; --p-pink: #c4577f;
  --tile-grass: #b8c784; --tile-forest: #7f9e6a; --tile-mountain: #bba88a; --tile-water: #8fb4c9; --tile-keep: #e0b44c;
  --font-head: 'IM Fell English', Georgia, serif;
  --font-body: 'Crimson Pro', Georgia, serif;
  --font-ui: 'IM Fell English', Georgia, serif;
  --font-num: 'Crimson Pro', Georgia, serif;
  --radius: 4px;
  --radius-lg: 10px;
  --border-w: 1px;
  --shadow: 0 2px 0 rgba(59,42,26,.12), 0 8px 22px rgba(80,55,25,.25);
  /* ink on paper casts no hard shadow */
  --pop-shadow: none; --pop-shadow-lg: 0 1px 0 rgba(255,255,255,.6); --pop-drop: var(--shadow);
  /* Fell capitals run wide and shout: labels keep their case; the yellow and white seats need ink to read on paper */
  --caps: none; --caps-track: .02em; --name-ink: 62%;
  --hud-lift: 0 1px 0 rgba(251,245,230,.85);
}

/* ---- Sugar Blossom -------------------------------------------------------- */
:root[data-skin="blossom"] {
  --bg: #fde6ef;
  /* a sweetshop wall: candy-pink, a scatter of little hearts and sparkles, a soft glow in the middle */
  --stage:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='%23ffffff' opacity='.75'%3E%3Cpath d='M20 27c-5-4-7-6-7-9a3.5 3.5 0 0 1 7-1a3.5 3.5 0 0 1 7 1c0 3-2 5-7 9z'/%3E%3Cpath d='M86 82c-4-3-5.5-4.6-5.5-7a2.7 2.7 0 0 1 5.5-.8a2.7 2.7 0 0 1 5.5 .8c0 2.4-1.5 4-5.5 7z'/%3E%3Cpath d='M92 20l1.6 4.4l4.4 1.6l-4.4 1.6l-1.6 4.4l-1.6-4.4l-4.4-1.6l4.4-1.6z'/%3E%3Cpath d='M30 92l1.2 3.3l3.3 1.2l-3.3 1.2l-1.2 3.3l-1.2-3.3l-3.3-1.2l3.3-1.2z'/%3E%3Ccircle cx='58' cy='52' r='2'/%3E%3Ccircle cx='110' cy='106' r='1.5'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse 70% 60% at 50% 45%, #fff3f8, #fde6ef 60%, #f9cfe0 100%);
  --panel: #fff6fa;
  --panel-2: #ffffff;
  --line: #f4c3d7;
  --text: #5b2a4c;
  --head: #d83a84;
  --muted: #9a6886;
  --ink: #7b3a63;
  --accent: #ff4f9a;
  --accent-ink: #ffffff;
  --accent-2: #8f6df0;
  --danger: #d4234f;
  --good: #23a57a;
  --glow: rgba(255,79,154,.4);
  --focus: #8f6df0;
  --res-food: #f29a5c; --res-wood: #c98a6e; --res-stone: #9a86c8; --res-cloth: #ff7fbd; --res-clay: #e8906a; --res-gold: #f0b030;
  --p-red: #f2456e; --p-blue: #4a86ec; --p-yellow: #ffc22e; --p-purple: #a35fe0; --p-white: #fffaf5; --p-black: #4a3a48; --p-green: #3fbf7f; --p-pink: #ff7cc8;
  --tile-grass: #b6e3a8; --tile-forest: #8fd0a8; --tile-mountain: #d3c2f0; --tile-water: #9fd6f2; --tile-keep: #ffd77a;
  /* round and friendly: Montserrat (the site's own) throughout, Bungee's candy capitals for the big titles */
  --font-head: 'Bungee', 'Montserrat', system-ui, sans-serif;
  --font-body: 'Montserrat', 'Montserrat Fallback', 'Segoe UI', system-ui, sans-serif;
  --font-ui: 'Montserrat', 'Montserrat Fallback', 'Segoe UI', system-ui, sans-serif;
  --font-num: 'Montserrat', 'Montserrat Fallback', 'Segoe UI', system-ui, sans-serif;
  --radius: 14px;
  --radius-lg: 22px;
  --border-w: 2px;
  --shadow: 0 3px 0 #f4c3d7, 0 10px 24px rgba(216,58,132,.16);
  /* a sticker's soft lift, never a hard black drop */
  --pop-shadow: 0 1px 0 #fff; --pop-shadow-lg: 0 2px 0 #fff; --pop-drop: 0 6px 18px rgba(216,58,132,.22);
  --btn-bw: 2px; --btn-shadow: 0 3px 0 #f4c3d7;
  /* labels keep their case (the caps shout in Montserrat); pale seats need some ink on the pink */
  --caps: none; --caps-track: .01em; --name-ink: 66%;
  --hud-lift: 0 1px 0 rgba(255,255,255,.9);
}

/* Bungee's capitals run wide: the big titles take a size that still fits a phone */
:root[data-skin="blossom"] .home-hero .hx-title { font-size: clamp(32px, 10vw, 50px); }
:root[data-skin="blossom"] .hx-modal .r-title h2 { font-size: clamp(22px, 6.6vw, 28px); }
:root[data-skin="blossom"] .hx-modal h2 { font-size: 26px; }
/* and Montserrat's numbers are wider than the pixel font's: the invite code spaces less */
:root[data-skin="blossom"] .inv-code b { font-weight: 700; letter-spacing: .08em; padding-left: .08em; }

/* ---- Polygon Vale (skin-relief.js) ---------------------------------------- */
/* a low-poly diorama under an old console's evening sky: slate-blue panels, a fogged horizon
   behind the board, a warm sun gold and a mint green, Bungee's blocky capitals for titles */
:root[data-skin="relief"] {
  --bg: #1f2c38;
  /* the sky over the diorama: a warm band low on the horizon, fog rising into blue, a few faceted clouds */
  --stage:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='160'%3E%3Cg fill='%23c9dcea' opacity='.07'%3E%3Cpath d='M20 40l18-9 22 3 14 8-30 4z'/%3E%3Cpath d='M150 104l14-7 20 2 12 6-26 3z'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse 80% 45% at 50% 108%, rgba(242,184,75,.22), transparent 70%),
    linear-gradient(#2c4256, #23384a 45%, #1c2a37);
  --panel: #263646;
  --panel-2: #2f4356;
  --line: #3e566c;
  --text: #edf1e7;
  --head: #f6dd9b;
  --muted: #9fb3c1;
  --ink: #1b2430;
  --accent: #f2b84b;
  --accent-ink: #1b2430;
  --accent-2: #7fdcc0;
  --danger: #ff8270;
  --good: #8edc6c;
  --glow: rgba(127,220,192,.5);
  --focus: #7fdcc0;
  --res-food: #e9a955; --res-wood: #b07a48; --res-stone: #a9adb6; --res-cloth: #b68ad8; --res-clay: #c4703f; --res-gold: #f2c230;
  --p-red: #d2463b; --p-blue: #3d74d0; --p-yellow: #f0c13a; --p-purple: #9a5ecf; --p-white: #f2efe6; --p-black: #32323c; --p-green: #36a058; --p-pink: #e675ad;
  --tile-grass: #7aa152; --tile-forest: #44703f; --tile-mountain: #8c877c; --tile-water: #3a8db0; --tile-keep: #c9a24a;
  --font-head: 'Bungee', 'Barlow', system-ui, sans-serif;
  --font-body: 'Barlow', 'Segoe UI', system-ui, sans-serif;
  --font-ui: 'Barlow', 'Segoe UI', system-ui, sans-serif;
  --font-num: 'Barlow', 'Segoe UI', system-ui, sans-serif;
  --radius: 6px;
  --radius-lg: 12px;
  --border-w: 1px;
  /* a bevel, like an old console's menus: lit on the top edge, a firm drop under */
  --shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 4px 0 rgba(10,16,22,.45), 0 10px 24px rgba(5,10,16,.4);
  --pop-shadow: 0 2px 0 #121b24; --pop-shadow-lg: 0 3px 0 #121b24; --pop-drop: 0 6px 18px rgba(5,10,16,.5);
  --btn-bw: 1px; --btn-shadow: 0 3px 0 #121b24;
  --caps: none; --caps-track: .01em;
  --hud-lift: 0 1px 2px rgba(5,10,16,.8);
  /* the page's own older names (skins.css bridge, below) */
  --ground: var(--bg); --bg-alt: var(--panel); --band: var(--panel); --brass: var(--accent); --teal: var(--accent-2); --neon: var(--accent);
  --pink: var(--accent); --pink-text: var(--accent); --green: var(--good); --yellow: var(--focus); --rose-text: var(--danger); --font-pixel: var(--font-ui);
}
/* Bungee's capitals run wide: the big titles take a size that still fits a phone */
:root[data-skin="relief"] .home-hero .hx-title { font-size: clamp(32px, 10vw, 50px); }
:root[data-skin="relief"] .hx-modal .r-title h2 { font-size: clamp(22px, 6.6vw, 28px); }
:root[data-skin="relief"] .hx-modal h2 { font-size: 26px; }
:root[data-skin="relief"] .inv-code b { font-weight: 600; letter-spacing: .08em; padding-left: .08em; }
/* the board: cues glow mint, the route's label in the body face, the colour-blind symbols a size down to suit the smaller pieces */
:root[data-skin="relief"] .ba-cue { filter: drop-shadow(0 0 3px var(--glow)); }
:root[data-skin="relief"] .rt-label { font-weight: 600; stroke: #142029; }
:root[data-skin="relief"] .ba-sym { font-size: 11px; stroke-width: 2.6px; }
/* the sky (sky.js; the sun, moon and stars are skin-relief.js's): a console sky, clear blue by day, a hazy horizon at dawn and dusk */
:root[data-skin="relief"] .sky { --track: rgba(242,184,75,.18); --track-dash: 3 7; }
:root[data-skin="relief"] .sky-wash[data-w="dawn"] { background:
  radial-gradient(ellipse 70% 28% at 10% var(--hz), rgba(255,170,100,.4), transparent 70%),
  linear-gradient(to bottom, rgba(140,170,210,.14), rgba(255,180,120,.16) var(--hz), transparent 60%); }
:root[data-skin="relief"] .sky-wash[data-w="day"] { background:
  linear-gradient(to bottom, rgba(120,180,230,.34), rgba(150,200,235,.16) var(--hz), transparent 58%); }
:root[data-skin="relief"] .sky-wash[data-w="dusk"] { background:
  radial-gradient(ellipse 70% 28% at 90% var(--hz), rgba(255,130,90,.42), transparent 70%),
  linear-gradient(to bottom, rgba(90,80,160,.26), rgba(220,120,110,.16) var(--hz), transparent 62%); }
:root[data-skin="relief"] .sky-wash[data-w="night"] { background: linear-gradient(to bottom, rgba(6,12,30,.66), rgba(8,14,32,.4) 45%, rgba(0,0,0,.2)); }
:root[data-skin="relief"] .sky-sun::before { background: radial-gradient(closest-side, rgba(255,214,120,.45), rgba(242,184,75,.14) 55%, transparent); }
:root[data-skin="relief"] .sky-moon::before { background: radial-gradient(closest-side, rgba(220,232,250,.32), rgba(127,220,192,.08) 55%, transparent); }

/* ---- bridge: the current page's own tokens follow the skin too ----------- */
:root[data-skin="arcade"], :root[data-skin="atlas"], :root[data-skin="blossom"] {
  --ground: var(--bg);
  --bg-alt: var(--panel);
  --band: var(--panel);
  --brass: var(--accent);
  --teal: var(--accent-2);
  --neon: var(--accent);
  --pink: var(--accent);
  --pink-text: var(--accent);
  --green: var(--good);
  --yellow: var(--focus);
  --rose-text: var(--danger);
  --font-pixel: var(--font-ui);
}
/* (the board's stage, --stage, is laid by ui.css's #boardwrap) */

/* ---- board art (boardart.js) ---------------------------------------------- */
.ba-ico { width: 1.25em; height: 1.25em; vertical-align: -.25em; flex: none; overflow: visible; }
.ba-sym { font: 700 13px/1 var(--font-body); fill: #fff; stroke: var(--ink); stroke-width: 3px; paint-order: stroke; pointer-events: none; }
.ba-sym-px { font: 18px/1 var(--font-ui); stroke-width: 4px; stroke-linejoin: miter; }
.ba-sym-ink { fill: #fbf5e6; stroke: #3b2a1a; }
.ba-sym-bl { fill: #fff; stroke: #7b3a63; }
.ba-hl, .ba-hle { cursor: pointer; }
.ba-hit { stroke: transparent; stroke-width: var(--hitw, 28px); }   /* screen px: edgeHit's line does not scale with the board (ui-board.js hitWidth) */
.ba-cue, .ba-ghost { pointer-events: none; }
:root:not([data-skin]) .ba-cue, :root[data-skin="noir"] .ba-cue { filter: drop-shadow(0 0 4px var(--glow)); }
@media (prefers-reduced-motion: no-preference) {
  .ba-hl > * { animation: ba-pulse 1.3s ease-in-out infinite; }
  .ba-hle > * { animation: ba-pulse 1.3s ease-in-out infinite; }
  .ba-cue { animation: ba-bob 1.6s ease-in-out infinite; }
  .ba-glint { transform-box: fill-box; animation: ba-glint 3.2s ease-in-out infinite; }
  .ba-glint:nth-of-type(2n) { animation-delay: -1.1s; animation-duration: 2.6s; }
  /* pixel things move in whole steps, never smoothly */
  :root[data-skin="arcade"] .ba-hl > *, :root[data-skin="arcade"] .ba-hle > * { animation: ba-blink 1s steps(1) infinite; }
  :root[data-skin="arcade"] .ba-cue { animation: ba-hop 1s steps(1) infinite; }
  /* boats ride the swell (the pieces layer only, not their icons), their wake rippling out under them */
  #board .ba-boat { transform-box: fill-box; transform-origin: 50% 90%; animation: ba-sway 3.4s ease-in-out infinite; }
  #board .ba-wake { transform-box: fill-box; transform-origin: center; animation: ba-wake 3.4s ease-in-out infinite; }
  /* life on the board, all slow and small: windmills turn, flags stir (each drawn round its hub or pole, boardart.js flagAt) */
  #board .ba-mill { transform-box: view-box; transform-origin: 0 0; animation: ba-spin 14s linear infinite; }
  #board .ba-flag { transform-box: view-box; transform-origin: 0 0; animation: ba-wave 2.6s ease-in-out infinite; }
  /* pixel things change frame by frame instead: the sails, flags and twinkles swap between two drawings */
  #board .ba-fa { animation: ba-fa 1.8s steps(1) infinite; }
  #board .ba-fb { animation: ba-fb 1.8s steps(1) infinite; }
  /* candy cues bounce like a heartbeat */
  :root[data-skin="blossom"] .ba-cue { transform-box: fill-box; transform-origin: center; animation: ba-beat 1.4s ease-in-out infinite; }
  /* ink doesn't glow: the atlas cue just breathes */
  :root[data-skin="atlas"] .ba-cue { animation: ba-breathe 2s ease-in-out infinite; }
}
@keyframes ba-pulse { 50% { opacity: .45; } }
@keyframes ba-bob { 50% { transform: translateY(-3px); } }
@keyframes ba-glint { 50% { transform: translateY(-5px); opacity: .4; } }
@keyframes ba-blink { 50% { opacity: .35; } }
@keyframes ba-hop { 50% { transform: translateY(-3px); } }
@keyframes ba-breathe { 50% { opacity: .55; } }
@keyframes ba-sway { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: translateY(1.5px) rotate(1.6deg); } }
@keyframes ba-wake { 0%, 100% { transform: scaleX(.9); opacity: .55; } 50% { transform: scaleX(1.12); opacity: 1; } }
@keyframes ba-spin { to { transform: rotate(360deg); } }
@keyframes ba-wave { 0%, 100% { transform: skewY(0) scaleX(1); } 50% { transform: skewY(7deg) scaleX(.88); } }
@keyframes ba-fa { 50% { opacity: 0; } }
@keyframes ba-fb { 0% { opacity: 0; } 50% { opacity: 1; } }
/* a pixel drawing's second frame shows only while it animates (the first stands alone in icons and under reduced motion) */
.ba-fb { opacity: 0; }
:root[data-skin="arcade"] #board .ba-wake { animation-timing-function: steps(2, jump-none); }
@keyframes ba-beat { 0%, 40%, 100% { transform: scale(1); } 15% { transform: scale(1.14); } 28% { transform: scale(.97); } }
:root[data-skin="arcade"] #board .ba-boat { animation-timing-function: steps(2, jump-none); }

/* ---- player fills (round 8) ---- */
/* a gradient or patterned colour on a chip (ui-game.js chipFill, boardart.js colourPaint): the ring paints it, and as the
   player's time runs down the spent part is laid over it in the ring's grey (opaque, so the pattern doesn't show through) */
.chip.cf .ring::before { background: conic-gradient(transparent calc(var(--left) * 360deg), color-mix(in srgb, var(--ui-text) 16%, var(--ui-bg)) 0), var(--cf); }
.chip.cf.low .ring::before { background: conic-gradient(var(--ui-danger) calc(var(--left) * 360deg), color-mix(in srgb, var(--ui-text) 16%, var(--ui-bg)) 0); }
:root[data-skin="arcade"] .chip.cf .ring::before { image-rendering: pixelated; }

/* ---- route ---- */
/* the roads a build travels along (boardart.js routeArt, drawn by ui-board.js): a preview while
   choosing where to build, and a short trace when any build lands */
.rt { pointer-events: none; }
.rt-label { font: 700 22px/1 var(--font-body); fill: var(--c); stroke: #0b0b12; stroke-width: 5px; paint-order: stroke; stroke-linejoin: round; }
:root[data-skin="arcade"] .rt-label { font: 22px/1 var(--font-ui); stroke: #120d24; stroke-linejoin: miter; }
:root[data-skin="atlas"] .rt-label { font-style: italic; stroke: #f6ecd2; fill: #3b2a1a; }
:root[data-skin="blossom"] .rt-label { stroke: #fff; fill: #7b3a63; font-weight: 800; }
/* the trace: shown, then faded; with motion it draws itself along the way first */
.rt-fx { animation: rt-fade 2.2s ease-in forwards; }
@keyframes rt-fade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .rt-fx .rt-draw { stroke-dasharray: 100; stroke-dashoffset: 100; animation: rt-draw .9s ease-out forwards; }
  .rt-fx .rt-dot { opacity: 0; animation: rt-dot .25s ease-out forwards; animation-delay: calc(var(--i) * 45ms); }
  :root[data-skin="arcade"] .rt-fx .rt-dot { animation-timing-function: steps(1, end); animation-delay: calc(var(--i) * 60ms); }
  .rt-pv .rt-march { animation: rt-march 1s linear infinite; }
  :root[data-skin="arcade"] .rt-pv .rt-dot { animation: ba-blink 1s steps(1) infinite; animation-delay: calc(var(--i) * -120ms); }
}
@keyframes rt-draw { to { stroke-dashoffset: 0; } }
@keyframes rt-dot { from { opacity: 0; } to { opacity: 1; } }
@keyframes rt-march { to { stroke-dashoffset: -15; } }

/* ---- cards ---- */
/* the capital's card (ui-sheets.js tilePop): a line of its lore, in the skin's own voice */
.pop .lore { font-style: italic; color: var(--ui-text, var(--text)); }
/* a tray item's whole card, on a long press (ui-sheets.js trayCard) */
.tray-card { display: grid; grid-template-columns: auto 1fr; gap: .35rem .8rem; margin: .5rem 0 .9rem; }
.tray-card dt { margin: 0; font: inherit; line-height: 1.5; color: var(--muted); }   /* over the site's own dt (branding.css) */
.tray-card dd { margin: 0; padding: 0; border: 0; line-height: 1.5; }
.tray-card .cost { display: inline-flex; gap: .3rem; }
.tray-card-sheet h2 svg { width: 1.4em; height: 1.4em; vertical-align: -.3em; }
