/* In Colours — TIC house style: black/white, Source Code Pro, pill buttons.
   The selected jacket colour (--ic-accent) is the only colour in the chrome. */
:root {
  --ic-accent: #ff5c1c;
  --ic-accent-hi: #ff5c1c;
  --ic-on-accent: #000;
  --ic-black: #000;
  --ic-white: #fff;
  --ic-grey: #888;
  --ic-font: "Source Code Pro", ui-monospace, monospace;
  --ic-font-ui: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --ic-safe-t: env(safe-area-inset-top, 0px);
  --ic-safe-b: env(safe-area-inset-bottom, 0px);
  --ic-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --snap: cubic-bezier(0.2, 0.9, 0.1, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overscroll-behavior: none; }
body.ic {
  background: #000;
  color: var(--ic-black);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  font-family: var(--ic-font);
  -webkit-font-smoothing: antialiased;
}
#stage canvas { position: fixed; inset: 0; display: block; width: 100%; height: 100%; }
[hidden] { display: none !important; }

/* ─── Shared pieces (title, HUD, pause, game over) ─────────────────────────── */

/* Word tiles: cut-out words, white or jacket colour, each a little turned. */
.ic-tile {
  display: inline-block;
  padding: 0.08em 0.3em 0.12em;
  white-space: nowrap;
  background: #fff;
  color: #000;
  transform: rotate(var(--r, 0deg)) skewX(-8deg);
}
.ic-tile--alt { background: var(--ic-accent); color: var(--ic-on-accent); }
@keyframes ic-tile-in { from { opacity: 0; transform: rotate(calc(var(--r, 0deg) + 14deg)) skewX(-8deg) scale(1.6); } }

/* Plate: the secondary button, a black skewed plate that flips white. */
.ic-plate {
  appearance: none;
  border: 3px solid #fff;
  background: #000;
  color: #fff;
  transform: skewX(-14deg);
  box-shadow: 6px 6px 0 #000;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.14s var(--pop), box-shadow 0.14s, background-color 0.14s, color 0.14s;
}
.ic-plate span {
  display: inline-block;
  transform: skewX(14deg);
  padding-left: 0.24em;
  font: italic 900 20px/1 var(--ic-font);
  letter-spacing: 0.24em;
  white-space: nowrap;
}
.ic-plate:hover,
.ic-plate:focus-visible {
  outline: none;
  background: #fff;
  color: #000;
  transform: skewX(-14deg) translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ic-accent-hi);
}
.ic-plate:active { transform: skewX(-14deg) translate(3px, 3px); box-shadow: 2px 2px 0 #000; }
.ic-plate:disabled { cursor: default; opacity: 0.6; }
.ic-plate b { font: inherit; }
.ic-plate svg {
  width: 0.9em;
  height: 0.9em;
  margin: 0 0.45em 0.12em -0.1em;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

/* Icon buttons: white shards with a hard shadow, like the select arrows inverted. */
.ic-icon-btn {
  position: fixed;
  top: max(14px, var(--ic-safe-t));
  z-index: 40;
  width: 42px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  filter: drop-shadow(3px 3px 0 #000);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.14s var(--pop);
}
.ic-icon-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  clip-path: polygon(14% 0, 100% 8%, 88% 100%, 0 90%);
  transition: background-color 0.14s;
}
.ic-icon-btn svg {
  position: relative;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #000;
  stroke-width: 2.4;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.ic-icon-btn:hover::before,
.ic-icon-btn:focus-visible::before { background: var(--ic-accent); }
.ic-icon-btn:hover svg,
.ic-icon-btn:focus-visible svg { stroke: var(--ic-on-accent); }
.ic-icon-btn:focus-visible { outline: none; }
.ic-icon-btn:active { transform: scale(0.88); }
.ic-mute { right: 14px; }
.ic-pause-btn { left: 14px; }
.ic-mute .ic-mute__off { display: none; }
.ic-mute[aria-pressed="true"] .ic-mute__on { display: none; }
.ic-mute[aria-pressed="true"] .ic-mute__off { display: block; }
.ic-mute[aria-pressed="true"]::before { background: #000; }
.ic-mute[aria-pressed="true"] svg { stroke: #fff; }

/* ─── Loader ──────────────────────────────────────────────────────────────── */
.ic-loader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: #000;
  color: #fff;
  transition: opacity 0.5s ease-out;
}
.ic-loader.is-done { opacity: 0; pointer-events: none; }
.ic-loader__inner { width: min(320px, 100vw - 48px); }
.ic-loader__mark { display: block; width: 100%; height: auto; margin-bottom: 26px; }
.ic-steps {
  list-style: none;
  min-height: 154px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  font: italic 700 11px/1 var(--ic-font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ic-steps li { padding: 3px 8px; color: rgba(255, 255, 255, 0.3); transform: skewX(-10deg); }
.ic-steps li.is-done { color: rgba(255, 255, 255, 0.55); }
.ic-steps li.is-active { background: #fff; color: #000; font-weight: 900; }
.ic-bar { height: 12px; margin-top: 18px; border: 2px solid #fff; transform: skewX(-14deg); overflow: hidden; }
.ic-bar__fill { height: 100%; width: 0; background: var(--ic-accent); transition: width 0.25s ease-out; }

/* ─── Title + character select: comic-pop (black/white stage, the rat carries colour) ─
   Landscape: brand top-left, hero left of centre (3D), pick card in the right column.
   Portrait (9:16): brand on top, hero in the middle, pick card stacked at the bottom. */
.ic-title {
  position: fixed;
  inset: 0;
  z-index: 20;
  color: #fff;
}
.ic-title.is-leaving { opacity: 0; transition: opacity 0.3s ease-out; }

/* Angled black bands top and bottom frame the stage. */
.ic-title__bands { position: absolute; inset: 0; pointer-events: none; }
.ic-band { position: absolute; left: -5%; width: 110%; background: #000; }
.ic-band--top { top: 0; height: clamp(54px, 13vh, 118px); clip-path: polygon(0 0, 100% 0, 100% 38%, 0 100%); }
.ic-band--bottom { bottom: 0; height: clamp(40px, 10vh, 96px); clip-path: polygon(0 62%, 100% 0, 100% 100%, 0 100%); }
.ic-band--bottom::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0; height: 100%;
  background: var(--ic-accent);
  clip-path: polygon(0 60%, 100% -2%, 100% 6%, 0 68%);
}
.ic-title.is-enter .ic-band--top { animation: ic-band-top 0.5s var(--snap) both; }
.ic-title.is-enter .ic-band--bottom { animation: ic-band-bottom 0.5s var(--snap) 0.05s both; }
@keyframes ic-band-top { from { transform: translateY(-105%) skewY(-3deg); } }
@keyframes ic-band-bottom { from { transform: translateY(105%) skewY(3deg); } }

/* Brand: the Rat'teryx In Colours lockup. */
.ic-brand {
  position: absolute;
  top: max(clamp(22px, 4vh, 44px), calc(var(--ic-safe-t) + 14px));
  left: clamp(10px, 2.4vw, 36px);
  display: grid;
  justify-items: start;
  pointer-events: none;
}
.ic-brand__name { margin: 0; line-height: 0; }
.ic-brand__mark {
  display: block;
  width: clamp(220px, 30vw, 420px);
  height: auto;
  filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.85));
  transform-origin: 20% 60%;
}
.ic-title.is-enter .ic-brand__mark { animation: ic-mark 0.55s var(--pop) both; }
@keyframes ic-mark { from { opacity: 0; transform: translateY(-18%) rotate(-6deg) scale(1.25); } }

/* Pick card: counter, ransom-note name, colour chips, the Run shard. */
.ic-pick {
  position: absolute;
  right: clamp(16px, 4vw, 64px);
  top: 50%;
  width: min(430px, 40vw);
  transform: translateY(-46%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}
.ic-title.is-enter .ic-pick { animation: ic-slide-in 0.55s var(--snap) 0.12s both; }
@keyframes ic-slide-in { from { opacity: 0; transform: translate(60px, -46%) skewX(-12deg); } }
.ic-pick__index {
  font: italic 900 clamp(30px, 3.8vw, 46px)/1 var(--ic-font);
  color: #fff;
  text-shadow: 4px 4px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  transform: rotate(-5deg);
}
.ic-pick__index i { color: var(--ic-accent-hi); font-style: normal; margin: 0 4px; }
.ic-pick__index span:last-child { font-size: 0.5em; opacity: 0.9; }
.ic-pick__index.is-flip span:first-child { display: inline-block; animation: ic-flip 0.32s var(--pop); }
@keyframes ic-flip { from { transform: rotateX(90deg) translateY(-30%); opacity: 0; } }
.ic-pick__card { position: relative; padding: 12px 22px 14px; transform: rotate(-3deg); filter: drop-shadow(6px 6px 0 #000); }
.ic-pick__backing {
  position: absolute;
  inset: 0;
  background: var(--ic-accent);
  transform: skewX(-14deg);
  clip-path: polygon(0 10%, 12% 0, 100% 4%, 97% 60%, 100% 100%, 30% 94%, 0 100%);
}
.ic-pick__card.is-swap .ic-pick__backing { animation: ic-backing 0.26s var(--snap); }
@keyframes ic-backing { from { clip-path: polygon(0 10%, 0 10%, 0 4%, 0 60%, 0 100%, 0 94%, 0 100%); } }
.ic-pick__name {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  font: italic 900 clamp(32px, 5vw, 62px)/1 var(--ic-font);
  letter-spacing: 0;
  white-space: nowrap;
}
.ic-rl {
  display: inline-block;
  padding: 0.04em 0.1em 0.08em;
  margin: 0 0.02em;
  transform: translateY(var(--y)) rotate(var(--r)) scale(var(--s));
}
.ic-rl--a { background: #000; color: #fff; }
.ic-rl--b { background: #fff; color: #000; box-shadow: 3px 3px 0 #000; }
.ic-rl--c { background: #fff; color: var(--ic-accent); box-shadow: inset 0 0 0 3px #000; }
.ic-pick__card.is-swap .ic-rl { animation: ic-slam 0.36s var(--pop) var(--d) both; }
@keyframes ic-slam {
  0% { opacity: 0; transform: translateY(var(--y)) rotate(calc(var(--r) + 18deg)) scale(1.9); }
  60% { opacity: 1; }
}

.ic-chips { display: flex; gap: 8px; align-items: center; }
.ic-chip {
  appearance: none;
  width: 30px;
  height: 22px;
  border: 2px solid #000;
  background: var(--c);
  transform: skewX(-16deg);
  cursor: pointer;
  touch-action: manipulation;
  transition: width 0.2s var(--pop), transform 0.2s var(--pop), border-color 0.15s;
}
.ic-chip[aria-checked="true"] { width: 54px; border-color: #fff; transform: skewX(-16deg) translateY(-4px); box-shadow: 0 0 0 2px #000, 5px 5px 0 #000; }
.ic-chip:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.ic-title.is-enter .ic-chip { animation: ic-chip-in 0.4s var(--pop) calc(0.3s + var(--d)) both; }
@keyframes ic-chip-in { from { opacity: 0; transform: skewX(-16deg) translateY(16px) scale(0.3); } }

/* Run: a skewed plate in the jacket colour over a white shard that twitches like print. */
.ic-run {
  position: relative;
  width: min(300px, 100%);
  height: 66px;
  margin-top: 6px;
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.ic-run__shard {
  position: absolute;
  inset: -16px -26px;
  background: #fff;
  animation: ic-jitter 0.36s steps(1) infinite;
}
@keyframes ic-jitter {
  0% { clip-path: polygon(4% 22%, 30% 4%, 62% 14%, 96% 0, 88% 46%, 100% 92%, 58% 82%, 26% 100%, 0 76%); }
  33% { clip-path: polygon(0 30%, 34% 0, 60% 10%, 100% 8%, 92% 50%, 96% 100%, 62% 88%, 22% 94%, 4% 70%); }
  66% { clip-path: polygon(6% 16%, 26% 8%, 66% 0, 94% 12%, 100% 56%, 90% 94%, 54% 100%, 30% 88%, 0 84%); }
}
.ic-run__plate {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--ic-accent);
  border: 3px solid #000;
  box-shadow: 7px 7px 0 #000;
  transform: skewX(-14deg);
  transition: transform 0.14s var(--pop), box-shadow 0.14s;
}
.ic-run__label {
  font: italic 900 32px/1 var(--ic-font);
  letter-spacing: 0.24em;
  color: var(--ic-on-accent);
  transform: skewX(14deg);
  padding-left: 0.24em;
}
.ic-title.is-enter .ic-run { animation: ic-run-in 0.5s var(--pop) 0.36s both; }
@keyframes ic-run-in { from { opacity: 0; transform: scale(0.4) rotate(-8deg); } }
.ic-run:focus-visible { outline: none; }
.ic-run:focus-visible .ic-run__plate,
.ic-run:hover .ic-run__plate { background: #000; transform: skewX(-14deg) translate(-2px, -2px); box-shadow: 10px 10px 0 var(--ic-accent); }
.ic-run:focus-visible .ic-run__label,
.ic-run:hover .ic-run__label { color: var(--ic-accent-hi); }
.ic-run:active .ic-run__plate { transform: skewX(-14deg) translate(4px, 4px); box-shadow: 2px 2px 0 #000; }

.ic-controls {
  padding: 3px 8px;
  background: #000;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.8);
  transform: skewX(-10deg);
}
.ic-controls__touch { display: none; }
@media (pointer: coarse) {
  .ic-controls__keys { display: none; }
  .ic-controls__touch { display: inline; }
}
.ic-legal {
  position: absolute;
  left: clamp(14px, 3vw, 40px);
  bottom: max(10px, var(--ic-safe-b));
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}
.ic-swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--ic-accent); }

/* Arrows: black shards at the stage edges. */
.rat-select-arrow {
  position: absolute;
  top: 50%;
  width: 54px;
  height: 64px;
  border: 0;
  background: #000;
  clip-path: polygon(18% 0, 100% 10%, 84% 100%, 0 88%);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 25;
  touch-action: manipulation;
  transform: translateY(-50%);
  transition: transform 0.16s var(--pop), background-color 0.16s;
}
.rat-select-arrow svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: square; stroke-linejoin: miter; }
.rat-select-arrow--prev { left: 8px; }
.rat-select-arrow--next { right: calc(clamp(16px, 4vw, 64px) + min(430px, 40vw) + 18px); }
.rat-select-arrow:hover { background: var(--ic-accent); }
.rat-select-arrow:active { transform: translateY(-50%) scale(0.88); }
.rat-select-arrow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Portrait / 9:16: stack everything; the hero stands in the middle band. */
@media (max-aspect-ratio: 3/4) {
  .ic-band--top { height: clamp(90px, 15vh, 140px); }
  .ic-band--bottom { height: 40vh; clip-path: polygon(0 16%, 100% 0, 100% 100%, 0 100%); background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.82) 30%); }
  .ic-band--bottom::after { clip-path: polygon(0 15%, 100% -1%, 100% 1%, 0 17%); }
  .ic-brand { left: 50%; transform: translateX(-50%); justify-items: center; }
  .ic-brand__mark { width: min(78vw, 340px); transform-origin: 50% 60%; }
  .ic-pick {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: max(14px, calc(var(--ic-safe-b) + 8px));
    width: auto;
    transform: none;
    align-items: center;
    gap: 10px;
  }
  .ic-title.is-enter .ic-pick { animation-name: ic-rise-in; }
  @keyframes ic-rise-in { from { opacity: 0; transform: translateY(50px) skewY(-4deg); } }
  .ic-pick__index { font-size: 26px; align-self: flex-start; margin-left: 8px; }
  .ic-pick__name { font-size: clamp(28px, 9.6vw, 46px); }
  .ic-run { width: 100%; max-width: 360px; height: 58px; }
  .ic-run__label { font-size: 28px; }
  .rat-select-arrow { top: 46%; }
  .rat-select-arrow--next { right: 8px; }
  .ic-legal { left: 12px; bottom: auto; top: max(12px, var(--ic-safe-t)); color: rgba(255, 255, 255, 0.45); }
}

/* Wipe: three slanted panels sweep across between menu and run. */
.ic-wipe { position: fixed; inset: 0; z-index: 55; pointer-events: none; overflow: hidden; visibility: hidden; }
.ic-wipe.is-on { visibility: visible; }
.ic-wipe i {
  position: absolute;
  top: -25%;
  bottom: -25%;
  left: 0;
  width: 135%;
  transform: translateX(-150%) skewX(-18deg);
}
.ic-wipe i:nth-child(1) { background: var(--ic-accent); }
.ic-wipe i:nth-child(2) { background: #fff; width: 22%; }
.ic-wipe i:nth-child(3) { background: #000; }
.ic-wipe.is-on i { animation: ic-wipe 0.68s cubic-bezier(0.75, 0, 0.25, 1) both; }
.ic-wipe.is-on i:nth-child(2) { animation-delay: 0.05s; }
.ic-wipe.is-on i:nth-child(3) { animation-delay: 0.09s; }
@keyframes ic-wipe {
  from { transform: translateX(-150%) skewX(-18deg); }
  to { transform: translateX(150%) skewX(-18deg); }
}

/* ─── HUD: score on a black plate, distance strip, skewed colour meter ─────── */
.ic-hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; color: #fff; }
.ic-hud__center {
  position: absolute;
  top: max(16px, var(--ic-safe-t));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.55s var(--ic-ease), opacity 0.55s var(--ic-ease), filter 0.55s var(--ic-ease);
}
.ic-hud__score {
  position: relative;
  isolation: isolate;
  padding: 5px 20px 6px;
  font: italic 900 clamp(34px, 4.4vw, 46px)/1 var(--ic-font);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.ic-hud__score::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #000;
  transform: skewX(-12deg);
  box-shadow: 5px 5px 0 var(--ic-accent-hi);
}
@media (max-width: 400px) {
  .ic-hud__score { padding: 4px 14px 5px; font-size: 30px; }
}
.ic-hud__score.is-pop { animation: ic-pop 0.12s ease-out; }
@keyframes ic-pop { 50% { transform: scale(1.1); } }
.ic-hud__line { display: flex; align-items: center; gap: 6px; }
.ic-hud__dist {
  padding: 3px 9px;
  background: #fff;
  color: #000;
  font: 700 11px/1.2 var(--ic-font);
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
  transform: skewX(-10deg);
}
.ic-hud__mult {
  padding: 3px 8px;
  background: var(--ic-accent);
  color: var(--ic-on-accent);
  font: italic 900 12px/1.2 var(--ic-font);
  transform: skewX(-10deg) rotate(-3deg);
  box-shadow: 2px 2px 0 #000;
}
.ic-meter { width: 150px; }
.ic-meter__track {
  position: relative;
  width: 100%;
  height: 10px;
  border: 2px solid #000;
  background: rgba(0, 0, 0, 0.4);
  transform: skewX(-14deg);
  overflow: hidden;
}
.ic-meter__lag, .ic-meter__fill { position: absolute; inset: 0; transform-origin: left center; transform: scaleX(0); }
.ic-meter__lag { background: #fff; }
.ic-meter__fill { background: var(--ic-accent-hi); }
.ic-meter.is-full .ic-meter__track { border-color: #fff; }
.ic-meter.is-warn .ic-meter__fill { animation: ic-blink 0.25s steps(2) infinite; }
@keyframes ic-blink { 50% { opacity: 0.3; } }
.ic-hud.is-crash-out .ic-hud__center { opacity: 0; filter: blur(3px); transform: translateX(-50%) translateY(-14px) scale(0.9); }
.ic-hud.is-paused > * { opacity: 0; transition: opacity 0.2s ease-out; }

/* Toasts: word tiles that slam in and lift away. */
.ic-toast {
  position: absolute;
  left: 50%;
  top: 30%;
  display: flex;
  gap: 0.3em;
  font: italic 900 clamp(22px, 3vw, 34px)/1.1 var(--ic-font);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%);
  filter: drop-shadow(4px 4px 0 #000);
}
.ic-toast.is-on { animation: ic-toast 1s ease-out forwards; }
.ic-toast.is-on .ic-tile { animation: ic-tile-in 0.28s var(--pop) var(--d) both; }
.ic-toast--small { font-size: 15px; }
.ic-toast--small.is-on { animation-duration: 0.6s; }
@keyframes ic-toast {
  0% { opacity: 0; }
  8% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -8px); }
}
@keyframes ic-toast-still { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* ─── Pause: the bands close in and the menu slides in where the pick card sits ─ */
.ic-pause {
  position: fixed;
  inset: 0;
  z-index: 30;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  animation: ic-fade 0.2s ease-out;
}
.ic-pause .ic-band--top { animation: ic-band-top 0.4s var(--snap) both; }
.ic-pause .ic-band--bottom { animation: ic-band-bottom 0.4s var(--snap) 0.04s both; }
.ic-pause__panel {
  position: absolute;
  right: clamp(16px, 4vw, 64px);
  top: 50%;
  width: min(320px, 80vw);
  transform: translateY(-46%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
  animation: ic-slide-in 0.45s var(--snap) 0.06s both;
}
.ic-pause__kicker {
  margin-bottom: 4px;
  font: italic 900 clamp(34px, 4.6vw, 54px)/1 var(--ic-font);
  filter: drop-shadow(5px 5px 0 #000);
}
.ic-pause__resume { width: 100%; height: 62px; margin: 0; }
.ic-pause__resume .ic-run__label { font-size: 26px; }
.ic-pause .ic-plate { width: 86%; height: 48px; margin-right: 10px; }
.ic-pause .ic-plate:last-child { margin-right: 20px; }
@media (max-aspect-ratio: 3/4) {
  .ic-pause__panel {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: max(28px, calc(var(--ic-safe-b) + 18px));
    width: auto;
    max-width: 360px;
    margin: 0 auto;
    transform: none;
    align-items: center;
    animation-name: ic-rise-in;
  }
  .ic-pause .ic-plate,
  .ic-pause .ic-plate:last-child { width: 100%; margin-right: 0; }
}

/* ─── Game over: Dum Surfer's pieces and order (score card, nickname + submit, top rats,
   buy, retry) dressed like the title. Landscape: score plate + actions left, leaderboard
   card right. Portrait: one column. The .lb-* / go-* hooks are driven by
   src/surfer/leaderboard.js, so keep those class names. */
.ic-go {
  position: fixed;
  inset: 0;
  z-index: 20;
  color: #fff;
  overflow: hidden;
  touch-action: none;
  background: radial-gradient(ellipse 80% 70% at 32% 50%, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.72));
  transition: opacity 0.85s ease;
}
.ic-go.overlay--go-fade { pointer-events: none; }
.ic-go.overlay--go-fade .ic-go__stack { visibility: hidden; }
.ic-go.overlay--go-fade .ic-band--top { animation: ic-band-top 0.5s var(--snap) 0.35s both; }
.ic-go.overlay--go-fade .ic-band--bottom { animation: ic-band-bottom 0.5s var(--snap) 0.4s both; }

.ic-go__stack {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 400px);
  grid-template-areas: "hero lb" "actions lb";
  align-content: center;
  justify-content: center;
  column-gap: clamp(32px, 5vw, 80px);
  row-gap: 34px;
  padding:
    max(clamp(96px, 17vh, 160px), calc(var(--ic-safe-t) + 80px))
    24px
    max(clamp(56px, 11vh, 110px), calc(var(--ic-safe-b) + 40px));
}
.ic-go__screen { display: contents; }

.ic-go__brand {
  position: absolute;
  top: max(clamp(22px, 4vh, 44px), calc(var(--ic-safe-t) + 14px));
  left: clamp(10px, 2.4vw, 36px);
  pointer-events: none;
}
.ic-go__mark {
  display: block;
  width: clamp(180px, 22vw, 320px);
  height: auto;
  filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.85));
  transform-origin: 20% 60%;
}

/* Score: a skewed black plate with a hard jacket-colour shadow; the cause slams in as a ransom note. */
.ic-go__hero {
  grid-area: hero;
  align-self: end;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 30px 34px 24px 38px;
}
.ic-go__hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #000;
  transform: skewX(-10deg);
  box-shadow: 10px 10px 0 var(--ic-accent-hi);
}
.ic-go__hero.go-hero-card--top::before { animation: ic-go-top 0.9s steps(2) infinite; }
@keyframes ic-go-top { 50% { box-shadow: 10px 10px 0 #fff; } }
.ic-go__kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.12em 0.34em;
  max-width: 100%;
  margin: -54px 0 0 -18px;
  font: italic 900 clamp(20px, 2.4vw, 30px)/1.1 var(--ic-font);
  transform: rotate(-4deg);
  filter: drop-shadow(4px 4px 0 #000);
}
.ic-go__score {
  position: relative;
  font: italic 900 clamp(72px, 9.5vw, 128px)/0.9 var(--ic-font);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  padding-right: 0.08em;
}
.ic-go__score.go-score--hot::after {
  content: "NEW BEST";
  position: absolute;
  left: 100%;
  top: 0.1em;
  margin-left: 10px;
  padding: 5px 8px;
  white-space: nowrap;
  font: italic 900 12px/1 var(--ic-font);
  letter-spacing: 0.14em;
  color: #000;
  background: #fff;
  box-shadow: 3px 3px 0 var(--ic-accent-hi);
  transform: rotate(8deg);
}
.ic-go__score.go-score--pulse { animation: ic-go-pulse 0.6s var(--pop); }
@keyframes ic-go-pulse { 40% { transform: scale(1.08) rotate(-2deg); } }
.ic-go__stats {
  padding: 4px 10px;
  background: #fff;
  color: #000;
  font: 700 11px/1.2 var(--ic-font);
  letter-spacing: 0.18em;
  transform: skewX(-10deg);
}
.ic-go__rank {
  padding: 4px 10px;
  background: var(--ic-accent);
  color: var(--ic-on-accent);
  font: italic 900 12px/1.2 var(--ic-font);
  letter-spacing: 0.2em;
  transform: skewX(-10deg) rotate(-2deg);
  box-shadow: 3px 3px 0 #000;
}

/* Buy is the title's Run shard; Retry is the shared plate. */
.ic-go__actions {
  grid-area: actions;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  padding-left: 26px;
}
.ic-go__buy { width: min(340px, 100%); }
.ic-go__buy .ic-run { width: 100%; height: 58px; margin: 0; }
.ic-go__buy .ic-run__label { font-size: 17px; letter-spacing: 0.14em; padding-left: 0.14em; white-space: nowrap; }
/* Retry and Share sit side by side under it. */
.ic-go__row { display: flex; gap: 18px; width: min(340px, 100%); }
.ic-go__actions .ic-plate { flex: 1; min-width: 0; height: 46px; }

/* Leaderboard: a white card taped on, black ink, the leader in the jacket colour. */
.ic-go__lb {
  grid-area: lb;
  align-self: center;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 20px 18px;
  background: #fff;
  color: #000;
  transform: rotate(1.5deg);
  box-shadow: 9px 9px 0 #000;
}
.ic-go__lb::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 22px;
  width: 64px;
  height: 18px;
  background: var(--ic-accent);
  box-shadow: 3px 3px 0 #000;
  transform: rotate(-6deg);
}
.ic-go .lb-row { display: flex; align-items: stretch; gap: 12px; }
.ic-go .lb-nick-wrap { position: relative; flex: 1; min-width: 0; }
.ic-go .lb-label {
  position: absolute;
  top: -9px;
  left: 10px;
  z-index: 1;
  padding: 2px 6px;
  background: #000;
  color: #fff;
  font: 700 9px/1 var(--ic-font);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transform: skewX(-10deg);
  pointer-events: none;
}
.ic-go .lb-input {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 3px solid #000;
  background: #fff;
  color: #000;
  font: 700 15px/1 var(--ic-font);
  letter-spacing: 0.04em;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 4px 4px 0 #000;
  transition: box-shadow 0.12s, transform 0.12s var(--pop);
}
.ic-go .lb-nick-btn.is-open,
.ic-go .lb-nick-btn:focus-visible { outline: none; box-shadow: 4px 4px 0 var(--ic-accent); transform: translate(-1px, -1px); }
.ic-go .lb-nick-display { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic-go .lb-nick-display--empty { color: rgba(0, 0, 0, 0.4); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.ic-go .lb-submit {
  flex-shrink: 0;
  padding: 0 16px;
  appearance: none;
  border: 3px solid #000;
  background: var(--ic-accent);
  color: var(--ic-on-accent);
  font: italic 900 13px/1 var(--ic-font);
  letter-spacing: 0.12em;
  white-space: nowrap;
  transform: skewX(-10deg);
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s var(--pop), box-shadow 0.12s, background-color 0.12s, color 0.12s;
}
.ic-go .lb-submit:hover,
.ic-go .lb-submit:focus-visible { outline: none; background: #000; color: var(--ic-accent-hi); }
.ic-go .lb-submit:active { transform: skewX(-10deg) translate(3px, 3px); box-shadow: 1px 1px 0 #000; }
.ic-go .lb-submit:disabled { opacity: 0.5; cursor: default; }
.ic-go .lb-toast { min-height: 1.3em; font: italic 700 11px/1.3 var(--ic-font); letter-spacing: 0.04em; }
.ic-go .lb-thanks {
  align-self: flex-start;
  padding: 6px 10px;
  background: var(--ic-accent);
  color: var(--ic-on-accent);
  font: italic 900 13px/1.2 var(--ic-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: skewX(-10deg) rotate(-1.5deg);
  box-shadow: 4px 4px 0 #000;
}
.ic-go .lb-heading {
  align-self: flex-start;
  padding: 3px 12px 4px;
  background: #000;
  color: #fff;
  font: italic 900 18px/1 var(--ic-font);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: skewX(-12deg) rotate(-2deg);
  box-shadow: 4px 4px 0 var(--ic-accent);
}
.ic-go .lb-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 6px;
  font: 700 13px/1 var(--ic-font);
  font-variant-numeric: tabular-nums;
}
.ic-go .lb-li {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1.8em 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  color: #fff;
}
.ic-go .lb-li::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #000;
  transform: skewX(-10deg);
}
.ic-go .lb-li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic-go .lb-li-rank { font: italic 900 16px/1 var(--ic-font); color: rgba(255, 255, 255, 0.55); text-align: right; }
.ic-go .lb-li--you { color: #000; }
.ic-go .lb-li--you::before { background: #fff; box-shadow: inset 0 0 0 3px #000; }
.ic-go .lb-li--you .lb-li-rank { color: rgba(0, 0, 0, 0.55); }
.ic-go .lb-li--top { color: var(--ic-on-accent); }
.ic-go .lb-li--top::before { background: var(--ic-accent); box-shadow: 4px 4px 0 #000; }
.ic-go .lb-li--top.lb-li--you::before { box-shadow: inset 0 0 0 3px #000, 4px 4px 0 #000; }
.ic-go .lb-li--top .lb-li-rank { color: inherit; }
.ic-go .lb-li--in { animation: ic-go-row 0.34s var(--snap) backwards; }
@keyframes ic-go-row { from { opacity: 0; transform: translateX(28px); } }

/* On-screen keyboard: black sheet, jacket-colour edge, keys centred on wide screens. */
.ic-go .lb-keyboard {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding:
    10px max(8px, env(safe-area-inset-right, 0px))
    max(10px, env(safe-area-inset-bottom, 0px))
    max(8px, env(safe-area-inset-left, 0px));
  background: #000;
  border-top: 4px solid var(--ic-accent-hi);
  transform: translateY(105%);
  transition: transform 0.24s var(--snap);
  pointer-events: none;
  touch-action: manipulation;
}
.ic-go .lb-keyboard.is-open { transform: none; pointer-events: all; }
.ic-go .lb-input-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: 640px;
  margin: 0 auto 10px;
  padding: 10px 12px;
  background: #fff;
  color: #000;
  font: 700 15px/1.2 var(--ic-font);
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  touch-action: pan-x;
  transform: skewX(-8deg);
}
.ic-go .lb-input-bar::-webkit-scrollbar { display: none; }
.ic-go .lb-input-bar-text:empty::before { content: attr(data-placeholder); color: rgba(0, 0, 0, 0.4); font-style: italic; }
.ic-go .lb-input-bar-caret {
  flex-shrink: 0;
  width: 3px;
  height: 1.1em;
  margin-left: 2px;
  background: var(--ic-accent);
  animation: ic-go-caret 1s steps(2, start) infinite;
}
@keyframes ic-go-caret { to { visibility: hidden; } }
.ic-go .lb-kb-row { display: flex; gap: 6px; justify-content: center; max-width: 640px; margin: 0 auto 6px; }
.ic-go .lb-kb-row:last-child { margin-bottom: 0; }
.ic-go .lb-kb-key {
  flex: 1 1 0;
  min-width: 0;
  max-width: 2.6rem;
  height: 2.4rem;
  border: 0;
  background: #1c1c1c;
  color: #fff;
  font: italic 900 13px/1 var(--ic-font);
  transform: skewX(-8deg);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.ic-go .lb-kb-key:active { background: var(--ic-accent); color: var(--ic-on-accent); }
.ic-go .lb-kb-key--wide { flex: 2.4 1 0; max-width: none; }
.ic-go .lb-kb-key--action { flex: 1.5 1 0; max-width: 5rem; background: #fff; color: #000; }
.ic-go .lb-kb-key--done { flex: 1.8 1 0; max-width: none; background: var(--ic-accent); color: var(--ic-on-accent); }

@media (prefers-reduced-motion: no-preference) {
  .ic-go.overlay--go-in .ic-go__mark { animation: ic-mark 0.55s var(--pop) backwards; }
  .ic-go.overlay--go-in .ic-go__hero { animation: ic-go-slam 0.5s var(--pop) 0.06s backwards; }
  .ic-go.overlay--go-in .ic-go__lb { animation: ic-go-card 0.55s var(--snap) 0.16s backwards; }
  .ic-go.overlay--go-in .ic-go__buy { animation: ic-run-in 0.5s var(--pop) 0.3s backwards; }
  .ic-go.overlay--go-in .ic-go__actions .ic-plate { animation: ic-go-pop 0.45s var(--pop) 0.4s backwards; }
  .ic-go.overlay--go-in .ic-go__row .ic-plate:last-child { animation-delay: 0.47s; }
  .ic-go__kicker.go-kicker--in .ic-tile { animation: ic-tile-in 0.32s var(--pop) calc(0.2s + var(--d)) both; }
}
@keyframes ic-go-slam { from { opacity: 0; transform: translateX(-60px) skewX(12deg); } }
@keyframes ic-go-card { from { opacity: 0; transform: translateX(60px) rotate(8deg); } }
@keyframes ic-go-pop { from { opacity: 0; transform: skewX(-14deg) scale(0.5); } }

@media (max-aspect-ratio: 3/4) {
  .ic-go__stack {
    grid-template-columns: min(100%, 400px);
    grid-template-areas: "hero" "lb" "actions";
    row-gap: 22px;
    padding:
      max(clamp(96px, 14vh, 130px), calc(var(--ic-safe-t) + 84px))
      20px
      max(16px, calc(var(--ic-safe-b) + 10px));
  }
  .ic-go__brand { left: 50%; transform: translateX(-50%); }
  .ic-go__mark { width: min(56vw, 250px); transform-origin: 50% 60%; }
  .ic-go__hero { align-self: auto; margin-right: 10px; padding: 26px 24px 18px 28px; }
  .ic-go__score { font-size: clamp(60px, 19vw, 96px); }
  .ic-go__lb { margin-right: 8px; padding: 18px 16px 14px; }
  .ic-go__actions { align-items: stretch; gap: 20px; padding-left: 12px; }
  .ic-go__buy,
  .ic-go__row { width: 100%; }
  .ic-go__buy .ic-run { height: 52px; }
  .ic-go__buy .ic-run__label { font-size: 15px; letter-spacing: 0.1em; padding-left: 0.1em; }
  .ic-go__actions .ic-plate { height: 48px; }
  .ic-go .lb-submit { padding: 0 12px; }
  .ic-go .lb-nick-display--empty { letter-spacing: 0.06em; }
}
@media (max-aspect-ratio: 3/4) and (max-height: 760px) {
  .ic-go__stack { row-gap: 14px; padding-top: max(112px, calc(var(--ic-safe-t) + 96px)); }
  .ic-go__mark { width: min(40vw, 170px); }
  .ic-go__score { font-size: clamp(52px, 15vw, 76px); }
  .ic-go .lb-list { gap: 4px; }
  .ic-go .lb-li { padding: 6px 12px; }
}
/* Phone landscape: no room for the lockup. */
@media (min-aspect-ratio: 3/4) and (max-height: 520px) {
  .ic-go__brand { display: none; }
  .ic-go__stack { row-gap: 18px; padding: max(18px, var(--ic-safe-t)) 24px max(14px, var(--ic-safe-b)); }
  .ic-go__hero { padding: 24px 28px 16px 32px; }
  .ic-go__kicker { margin-top: -44px; font-size: 18px; }
  .ic-go__score { font-size: clamp(48px, 13vh, 72px); }
  .ic-go__lb { gap: 8px; padding: 16px 16px 12px; }
  .ic-go .lb-list { gap: 3px; }
  .ic-go .lb-li { padding: 5px 12px; }
  .ic-go__buy .ic-run { height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .ic-go__hero.go-hero-card--top::before,
  .ic-go__score.go-score--pulse,
  .ic-go .lb-li--in { animation: none; }
  .ic-go .lb-keyboard { transition: none; }
}

@keyframes ic-fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .ic-title, .ic-pause, .ic-pause .ic-band, .ic-pause__panel { animation-duration: 0.01s; animation-delay: 0s; }
  .ic-toast.is-on { animation-name: ic-toast-still; }
  .ic-toast.is-on .ic-tile, .ic-go__kicker.go-kicker--in .ic-tile { animation: none; }
  .ic-title *, .ic-title.is-enter * { animation-duration: 0.01s !important; animation-delay: 0s !important; }
  .ic-run__shard { animation: none; clip-path: polygon(4% 22%, 30% 4%, 62% 14%, 96% 0, 88% 46%, 100% 92%, 58% 82%, 26% 100%, 0 76%); }
  .ic-wipe.is-on i { animation: none; }
  .ic-hud__center { transition: none; }
  .ic-hud.is-crash-out .ic-hud__center { filter: none; transform: translateX(-50%); }
}

/* Jacket modal over the game: solid panel, canvas hidden while it is open. */
#jacketModal.surfer-jacket-modal {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(10, 10, 16, 0.97);
}
body.jacket-modal-open canvas { visibility: hidden !important; }
