/* The kit on the web (SPEC 6.5): the same components, palette, type and
   extrusion as the game's screens. Values come from docs/design/TOKENS.md
   (L0 Foundations); nothing here is eyeballed.

   The extrusion is built the way the game builds it: the element IS the face,
   and the side hangs below it by E — a box-shadow, so it never moves the
   layout. The navy contour wraps the silhouette only; there is never a stroke
   between the face and its side (the outline law). */

:root {
  --navy: #26334D;
  --navy-side: #16203A;
  --white: #FFFFFF;
  --white-side: #DAD7CE;
  --gold: #FFC93C;
  --gold-side: #D99B12;
  --coral: #FB7185;
  --coral-side: #D14C61;
  --mint: #34D399;
  --mint-side: #21A97A;
  --paper: #F1EFEA;
  --well: #F5F2EA;
  --ground: #1F56C4;
  --disabled-outline: #8C93A3;
  --disabled-face: #DAD7CE;

  --contour: 3px;
  --bevel: inset 0 5px 0 rgba(255, 255, 255, .5);
  /* Over the world (the blue ground) the cast shadow deepens (Runtime sheet). */
  --cast: rgba(22, 32, 58, .34);
  --shadow-1: 0 12px 16px rgba(38, 51, 77, .20);
  --shadow-2: 0 18px 24px rgba(38, 51, 77, .24);
  --shadow-3: 0 28px 40px rgba(38, 51, 77, .28);

  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Barlow', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --skew: -7deg;
}

/* --- Type -------------------------------------------------------------------
   Condensed 800, uppercase, skewed -7deg: type only, surfaces never lean. */

.kit-type {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  display: inline-block;
  transform: skewX(var(--skew));
  line-height: 1;
}
.kit-type--micro { font-size: 13px; letter-spacing: .10em; }
.kit-type--chip { font-size: 16px; letter-spacing: .08em; }
.kit-type--hud { font-size: 20px; letter-spacing: .06em; }
.kit-type--button-sm { font-size: 24px; letter-spacing: .05em; }
.kit-type--card { font-size: 26px; letter-spacing: .05em; }
.kit-type--button { font-size: 28px; letter-spacing: .04em; }
.kit-type--section { font-size: 34px; letter-spacing: .03em; }
.kit-type--modal { font-size: 44px; letter-spacing: .02em; }
.kit-type--banner { font-size: 52px; letter-spacing: .015em; }
.kit-type--score { font-size: 76px; letter-spacing: .01em; }

/* --- The extruded object -----------------------------------------------------
   --face / --side: one pair of the palette. --e: the depth (L0 ladder: 3 chips,
   5 icon buttons, 6 panels, 8 primary CTA, 10 hero). --r: the radius. */

.kit-raised {
  --face: var(--white);
  --side: var(--white-side);
  --e: 6px;
  --r: 22px;
  --e-now: var(--e);
  position: relative;
  background: var(--face);
  border-radius: var(--r);
  margin-bottom: var(--e);
  box-shadow:
    0 var(--e-now) 0 0 var(--side),
    0 0 0 var(--contour) var(--navy),
    0 var(--e-now) 0 var(--contour) var(--navy),
    var(--bevel),
    0 calc(var(--e-now) * 2 + 4px) calc(var(--e-now) * 2.5 + 4px) var(--cast);
}

/* The gloss: reflected light on a molded surface — 36% of the height, 14px in
   from the contour, .70 to nothing, never touching the side. */
.kit-gloss::before {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  top: 6px;
  height: 36%;
  border-radius: calc(var(--r) - 8px) calc(var(--r) - 8px) 999px 999px / calc(var(--r) - 8px) calc(var(--r) - 8px) 60% 60%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0));
  pointer-events: none;
}

/* --- KitButton ------------------------------------------------------------- */

.kit-btn {
  --face: var(--gold);
  --side: var(--gold-side);
  --e: 8px;
  --r: 22px;
  --h: 74px;
  --ink: var(--navy);
  --e-now: var(--e);
  appearance: none;
  border: 0;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: var(--h);
  padding: 0 32px;
  margin-bottom: var(--e);
  border-radius: var(--r);
  background: var(--face);
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    0 var(--e-now) 0 0 var(--side),
    0 0 0 var(--contour) var(--navy),
    0 var(--e-now) 0 var(--contour) var(--navy),
    var(--bevel),
    0 calc(var(--e-now) * 2) calc(var(--e-now) * 2.5) var(--cast);
  transition: transform .09s cubic-bezier(.3, 1.6, .5, 1), box-shadow .09s cubic-bezier(.3, 1.6, .5, 1);
}
.kit-btn > .kit-type { pointer-events: none; }
.kit-btn--white { --face: var(--white); --side: var(--white-side); }
.kit-btn--mint { --face: var(--mint); --side: var(--mint-side); --ink: var(--white); }
.kit-btn--coral { --face: var(--coral); --side: var(--coral-side); --ink: var(--white); }
.kit-btn--navy { --face: var(--navy); --side: var(--navy-side); --ink: var(--white); }
.kit-btn--mint .kit-type,
.kit-btn--coral .kit-type,
.kit-btn--navy .kit-type { text-shadow: 0 2px 0 rgba(38, 51, 77, .35); }
.kit-btn--md { --h: 58px; --e: 6px; --r: 18px; padding: 0 24px; }
.kit-btn--sm { --h: 44px; --e: 5px; --r: 14px; padding: 0 18px; }
.kit-btn img, .kit-btn svg { width: 28px; height: 28px; flex: none; }
.kit-btn--sm img, .kit-btn--sm svg { width: 22px; height: 22px; }

@media (hover: hover) {
  .kit-btn:hover { transform: translateY(-2px); --e-now: calc(var(--e) + 2px); }
}
/* Pressed: the face sinks by E, the side collapses to 2, the bevel inverts. */
.kit-btn:active,
.kit-btn.is-pressed {
  transform: translateY(calc(var(--e) - 2px));
  --e-now: 2px;
  box-shadow:
    0 2px 0 0 var(--side),
    0 0 0 var(--contour) var(--navy),
    0 2px 0 var(--contour) var(--navy),
    inset 0 -4px 0 rgba(255, 255, 255, .35),
    0 4px 6px var(--cast);
}
.kit-btn:focus-visible { outline: 3px dashed var(--white); outline-offset: 8px; }
.kit-btn[disabled],
.kit-btn.is-disabled {
  cursor: default;
  transform: none;
  --face: var(--disabled-face);
  color: var(--disabled-outline);
  box-shadow: 0 0 0 var(--contour) var(--disabled-outline);
  margin-bottom: 0;
}

/* --- KitRound: round icon button (E 5) -------------------------------------- */

.kit-round {
  --face: var(--white);
  --side: var(--white-side);
  --e: 5px;
  --size: 56px;
  --e-now: var(--e);
  appearance: none;
  border: 0;
  cursor: pointer;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  margin-bottom: var(--e);
  border-radius: 50%;
  background: var(--face);
  box-shadow:
    0 var(--e-now) 0 0 var(--side),
    0 0 0 var(--contour) var(--navy),
    0 var(--e-now) 0 var(--contour) var(--navy),
    var(--bevel),
    0 calc(var(--e-now) * 2) calc(var(--e-now) * 2.5) var(--cast);
  transition: transform .09s ease-out;
}
.kit-round img, .kit-round svg { width: 55%; height: 55%; }
.kit-round--gold { --face: var(--gold); --side: var(--gold-side); }
.kit-round--mint { --face: var(--mint); --side: var(--mint-side); }
.kit-round:active { transform: translateY(calc(var(--e) - 2px)); --e-now: 2px; }

/* --- KitPanel: card / panel (E 6) ----------------------------------------- */

.kit-panel {
  --face: var(--white);
  --side: var(--white-side);
  --e: 6px;
  --r: 26px;
  --e-now: var(--e);
  position: relative;
  background: var(--face);
  color: var(--navy);
  border-radius: var(--r);
  margin-bottom: var(--e);
  box-shadow:
    0 var(--e-now) 0 0 var(--side),
    0 0 0 var(--contour) var(--navy),
    0 var(--e-now) 0 var(--contour) var(--navy),
    var(--bevel),
    0 calc(var(--e-now) * 2 + 6px) calc(var(--e-now) * 2.5 + 10px) var(--cast);
}
.kit-panel--gold { --face: var(--gold); --side: var(--gold-side); }
.kit-panel--mint { --face: var(--mint); --side: var(--mint-side); }
.kit-panel--navy { --face: var(--navy); --side: var(--navy-side); color: var(--white); }
.kit-panel--hero { --e: 10px; --r: 28px; }

/* --- KitChip: tags, small pills (E 3) -------------------------------------- */

.kit-chip {
  --face: var(--white);
  --side: var(--white-side);
  --e: 3px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  margin-bottom: var(--e);
  border-radius: 999px;
  background: var(--face);
  color: var(--navy);
  white-space: nowrap;
  box-shadow:
    0 var(--e) 0 0 var(--side),
    0 0 0 var(--contour) var(--navy),
    0 var(--e) 0 var(--contour) var(--navy),
    inset 0 3px 0 rgba(255, 255, 255, .5);
}
.kit-chip img, .kit-chip svg { width: 20px; height: 20px; }
.kit-chip--navy { --face: var(--navy); --side: var(--navy-side); color: var(--white); }
.kit-chip--gold { --face: var(--gold); --side: var(--gold-side); }
.kit-chip--mint { --face: var(--mint); --side: var(--mint-side); color: var(--white); }
.kit-chip--coral { --face: var(--coral); --side: var(--coral-side); color: var(--white); }

/* --- KitBadge: the coral counter on a corner ------------------------------- */

.kit-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--coral);
  color: var(--white);
  font: 800 18px/1 var(--font-display);
  box-shadow:
    0 3px 0 0 var(--coral-side),
    0 0 0 var(--contour) var(--navy),
    0 3px 0 var(--contour) var(--navy);
}

/* Gold preset: a word instead of a number ("Soon"), navy ink. */
.kit-badge--gold {
  top: -13px;
  right: -14px;
  height: 26px;
  padding: 0 10px;
  background: var(--gold);
  color: var(--navy);
  box-shadow:
    0 3px 0 0 var(--gold-side),
    0 0 0 var(--contour) var(--navy),
    0 3px 0 var(--contour) var(--navy);
}
.kit-badge--gold .kit-type { font-size: 13px; letter-spacing: .08em; }

/* --- KitField: a sunken well for text ------------------------------------- */

.kit-field {
  appearance: none;
  border: 0;
  height: 58px;
  padding: 0 20px;
  border-radius: 18px;
  background: var(--well);
  color: var(--navy);
  font: 600 19px/1 var(--font-body);
  box-shadow:
    0 0 0 var(--contour) var(--navy),
    inset 0 4px 0 rgba(38, 51, 77, .14);
  min-width: 0;
}
.kit-field::placeholder { color: rgba(38, 51, 77, .45); }
.kit-field:focus { outline: none; box-shadow: 0 0 0 var(--contour) var(--navy), 0 0 0 7px rgba(52, 211, 153, .55), inset 0 4px 0 rgba(38, 51, 77, .14); }
.kit-field.is-invalid { box-shadow: 0 0 0 var(--contour) var(--coral-side), 0 0 0 7px rgba(251, 113, 133, .45), inset 0 4px 0 rgba(38, 51, 77, .14); }

/* --- KitToken: the flat UI piece (Pieces sheet) -----------------------------
   The one family with no contour: a disc in the piece colour, a crescent of its
   darker tone along the bottom, a tight contact shadow; pitch = diameter x 1.3. */

.kit-token {
  --d: 20px;
  --crescent: 2px;
  display: grid;
  gap: calc(var(--d) * .3);
  grid-auto-rows: var(--d);
  grid-auto-columns: var(--d);
}
.kit-token > i {
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 calc(var(--crescent) * -1) 0 var(--cs), 0 2px 3px rgba(38, 51, 77, .18);
}
.kit-token--40 { --d: 40px; --crescent: 3px; }
.kit-token--14 { --d: 14px; --crescent: 1px; }

/* --- KitCoachToast --------------------------------------------------------- */

.kit-toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 16px;
  margin-bottom: 5px;
  border-radius: 13px;
  background: var(--mint);
  color: var(--white);
  box-shadow:
    0 5px 0 0 var(--mint-side),
    0 0 0 var(--contour) var(--navy),
    0 5px 0 var(--contour) var(--navy),
    var(--bevel);
}
.kit-toast .kit-type { font-size: 17px; letter-spacing: .08em; text-shadow: 0 2px 0 rgba(38, 51, 77, .35); }
.kit-toast img { width: 18px; height: 18px; }
.kit-toast--coral { background: var(--coral); box-shadow: 0 5px 0 0 var(--coral-side), 0 0 0 var(--contour) var(--navy), 0 5px 0 var(--contour) var(--navy), var(--bevel); }

/* --- KitGhostFinger: circle 56, contour 3, white .45, nothing else ---------- */

.kit-finger {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  box-shadow: 0 0 0 var(--contour) var(--navy);
  pointer-events: none;
}
.kit-finger.is-pressed {
  width: 48px;
  height: 48px;
  margin: 4px;
  background: rgba(255, 255, 255, .65);
  box-shadow: 0 0 0 var(--contour) var(--navy), 0 0 0 9px rgba(38, 51, 77, .18);
}
