/* ============================================================================
   CAPE CLASH - icons.css
   ----------------------------------------------------------------------------
   Sizing / alignment for the CapeIcons SVG set (public/js/icons.js).

   Everything is scoped to .ci, so linking this file changes nothing until
   something actually puts a .ci element on the page. No resets, no globals.

   Default box is 1em square, so an icon dropped inside a button matches the
   button's font-size the way the emoji it replaces used to.
   ========================================================================== */

.ci {
  display: inline-block;
  width: 1em;
  height: 1em;
  line-height: 0;
  vertical-align: -0.15em;   /* sits on the text baseline like an emoji did */
  flex: none;                /* never squashed inside a flex row            */
  overflow: visible;         /* round joins can poke a hair past the box    */
  -webkit-user-select: none;
  user-select: none;
}

.ci > svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ---- fixed sizes -------------------------------------------------------
   Use these when the icon must NOT follow the font-size (canvas overlays,
   HUD chips, icon-only buttons).                                          */
.ci-12 { width: 12px; height: 12px; }
.ci-14 { width: 14px; height: 14px; }
.ci-16 { width: 16px; height: 16px; }
.ci-18 { width: 18px; height: 18px; }
.ci-20 { width: 20px; height: 20px; }
.ci-24 { width: 24px; height: 24px; }
.ci-28 { width: 28px; height: 28px; }
.ci-32 { width: 32px; height: 32px; }
.ci-40 { width: 40px; height: 40px; }
.ci-48 { width: 48px; height: 48px; }
.ci-64 { width: 64px; height: 64px; }

/* ---- colour ------------------------------------------------------------
   CapeIcons.svg()/el() default to each icon's house colour, so an icon looks
   right with no CSS at all. Pass { color: 'currentColor' } to hand control
   back to CSS - then the icon inherits whatever `color` is in scope and the
   two-tone shade is derived with color-mix().                              */
.ci-inherit { color: inherit; }

/* Nudge helpers for label rows: "<icon> SOUND ON" style buttons. */
.ci-lead  { margin-right: 0.35em; }
.ci-trail { margin-left: 0.35em; }

/* Optical alignment inside all-caps Bangers labels, which sit high. */
.ci-caps { vertical-align: -0.05em; }

/* ---- states ------------------------------------------------------------ */
.ci-dim     { opacity: 0.45; }
/* one energy-icon convention: the SUMMON button keeps a full-strength bolt, tray cost
   chips (cost-per-level-up on each lineup card) show the number with a smaller bolt at
   60% opacity so the number, not the icon, carries the read. */
.ci-60      { opacity: 0.6; }
.ci-flip    { transform: scaleX(-1); }

/* A gentle idle pulse for "ready" affordances (ultimate charged, ability up).
   Respects the OS reduced-motion setting. */
@keyframes ci-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}
.ci-pulse { animation: ci-pulse 1.1s ease-in-out infinite; }

@keyframes ci-spin { to { transform: rotate(360deg); } }
.ci-spin { animation: ci-spin 2.4s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  .ci-pulse, .ci-spin { animation: none; }
}
/* Paired class half - body.cc-rm covers the in-game REDUCED MOTION switch too. */
body.cc-rm .ci-pulse, body.cc-rm .ci-spin { animation: none; }
