/* サンタのタワーディフェンス style.css — 構造とクラス名は docs/design.md を参照（土台は前作 santa-road と共通） */

:root {
  --c-ink: #3b2f2f;
  --c-ink-sub: #7a6a5e;
  --c-paper: #fffdf7;
  --c-bg: #fff8ea;
  --c-line: #eadcc0;

  --c-red: #e8413b;
  --c-red-deep: #b8302c;
  --c-green: #3fa66a;
  --c-green-deep: #2b7a4b;
  --c-gold: #ffc83d;
  --c-gold-deep: #d99a00;
  --c-night: #1b2960;
  --c-night-deep: #0b1438;
  --c-sky: #4fb3ee;
  --c-snow: #ffffff;
  --c-snow-shade: #d3e5f5;
  --c-wood: #dba468;
  --c-wood-deep: #a86e38;

  --font-base: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", "BIZ UDPGothic",
    "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --font-num: "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", "SF Pro Rounded",
    ui-rounded, system-ui, sans-serif;

  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 28px;
  --shadow-card: 0 4px 0 rgba(59, 47, 47, 0.12), 0 10px 24px rgba(59, 47, 47, 0.08);
  --btn-depth: 6px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  --hud-h: 52px;
  --tray-h: 92px;

  --dur-fast: 0.15s;
  --dur-mid: 0.35s;
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font-base);
  color: var(--c-ink);
  background-color: var(--c-night-deep);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  line-height: 1.5;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

button {
  font: inherit;
  color: inherit;
}

.num {
  font-family: var(--font-num);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.app {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: var(--c-bg);
}

/* ---------- 画面切替 ---------- */

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(16px + var(--safe-top)) calc(16px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(16px + var(--safe-left));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--dur-mid) ease, transform var(--dur-mid) ease, visibility 0s linear var(--dur-mid);
  overflow-y: auto;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity var(--dur-mid) ease, transform var(--dur-mid) ease, visibility 0s;
}

.screen__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.screen > :not(.screen__bg) {
  position: relative;
  z-index: 1;
}

/* ---------- ボタン ---------- */

.btn {
  --btn-bg: var(--c-red);
  --btn-edge: var(--c-red-deep);
  --btn-fg: #fff;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 12px 28px;
  border: 3px solid var(--c-ink);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 var(--btn-depth) 0 var(--btn-edge), 0 var(--btn-depth) 0 3px var(--c-ink);
  transform: translateY(0);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter var(--dur-fast);
}

.btn::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 18%;
  right: 18%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.btn:hover { filter: brightness(1.05); }

.btn:active,
.btn.is-pressed {
  transform: translateY(var(--btn-depth));
  box-shadow: 0 0 0 var(--btn-edge), 0 0 0 3px var(--c-ink);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.stage-card:focus-visible,
.tray-item:focus-visible {
  outline: 4px solid var(--c-gold);
  outline-offset: 4px;
}

.btn:disabled {
  filter: grayscale(0.8) opacity(0.6);
  cursor: not-allowed;
  transform: translateY(var(--btn-depth));
  box-shadow: 0 0 0 var(--btn-edge), 0 0 0 3px var(--c-ink);
}

.btn--block { display: flex; width: 100%; }
.btn--green { --btn-bg: var(--c-green); --btn-edge: var(--c-green-deep); }
.btn--gold { --btn-bg: var(--c-gold); --btn-edge: var(--c-gold-deep); --btn-fg: var(--c-ink); }
.btn--ghost { --btn-bg: var(--c-paper); --btn-edge: var(--c-line); --btn-fg: var(--c-ink); }
.btn--small { min-height: 40px; padding: 6px 16px; font-size: 15px; --btn-depth: 4px; }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 3px solid var(--c-ink);
  border-radius: 50%;
  background: var(--c-paper);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--c-ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background var(--dur-fast);
}

.icon-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--c-ink); }
.icon-btn.is-on { background: var(--c-gold); }

.icon-btn svg { width: 22px; height: 22px; fill: var(--c-ink); }

/* ---------- 共通カード ---------- */

.card {
  background: var(--c-paper);
  border: 3px solid var(--c-ink);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  padding: 16px;
}

/* ---------- ロゴ ---------- */

.logo {
  margin: 0;
  text-align: center;
  font-weight: 900;
  line-height: 1.1;
}

.logo__sub {
  display: inline-block;
  padding: 2px 14px;
  border: 3px solid var(--c-ink);
  border-radius: 999px;
  background: var(--c-green);
  color: #fff;
  font-size: clamp(16px, 3.6vmin, 24px);
  transform: rotate(-3deg);
}

.logo__main {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: 6px;
  font-size: clamp(40px, 11vmin, 84px);
}

.logo__char {
  display: inline-block;
  color: var(--c-snow);
  text-shadow:
    0 4px 0 var(--c-ink),
    3px 0 0 var(--c-ink), -3px 0 0 var(--c-ink),
    0 3px 0 var(--c-ink), 0 -3px 0 var(--c-ink),
    3px 3px 0 var(--c-ink), -3px 3px 0 var(--c-ink),
    3px -3px 0 var(--c-ink), -3px -3px 0 var(--c-ink);
  animation: logo-bob 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.12s);
}

.logo__char--red { color: var(--c-red); }
.logo__char--gold { color: var(--c-gold); }

/* ---------- タイトル ---------- */

.screen--title {
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(#7fc4f0, #e9f6ff 60%, #f6fbff);
  text-align: center;
}

.title__santa {
  width: clamp(110px, 26vmin, 200px);
  aspect-ratio: 1;
  animation: logo-bob 1.6s ease-in-out infinite;
}

.title__actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(320px, 100%);
}

.title__note {
  margin: 0;
  font-size: 13px;
  color: var(--c-ink-sub);
}


:root {
  --c-ice: #c9ecff;
  --c-ice-deep: #7cc4ef;
  --c-gang: #7a4fc4;
  --c-path: #efe6d8;
  --c-ground: #f6fbff;
  --hud-h: 56px;
}

/* ---------- ステージ選択 ---------- */

.screen--stages {
  gap: 14px;
  background: linear-gradient(#e9f6ff, #f6fbff);
}

.stages__head { display: flex; align-items: center; gap: 12px; }
.stages__title { flex: 1; margin: 0; font-size: 24px; font-weight: 900; }
.stages__total { display: inline-flex; align-items: center; gap: 4px; font-size: 18px; }

.stages__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 10px 10px 12px;
  border: 3px solid var(--c-ink);
  border-radius: var(--radius-m);
  background: var(--c-paper);
  box-shadow: 0 6px 0 var(--c-ink);
  cursor: pointer;
  animation: pop-in var(--dur-mid) var(--ease-pop) both;
  animation-delay: calc(var(--i, 0) * 0.06s);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.stage-card:active { transform: translateY(6px); box-shadow: 0 0 0 var(--c-ink); }
.stage-card__thumb { width: 100%; aspect-ratio: 9 / 10; border: 3px solid var(--c-ink); border-radius: var(--radius-s); background: var(--c-ground); }
.stage-card__num {
  position: absolute; top: -10px; left: -10px;
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 3px solid var(--c-ink); border-radius: 50%;
  background: var(--c-red); color: #fff; font-size: 18px;
}
.stage-card__name { font-size: 15px; font-weight: 800; }
.stage-card__stars { display: flex; gap: 2px; }
.stage-card.is-locked { cursor: not-allowed; filter: grayscale(0.9) opacity(0.6); }
.stage-card.is-locked::after {
  content: "🔒︎";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 34px;
}
.stage-card:focus-visible, .buy-item:focus-visible, .skill-btn:focus-visible { outline: 4px solid var(--c-gold); outline-offset: 4px; }

/* 星（小）: .star / .star.is-on */
.star {
  display: inline-block;
  width: 22px; height: 22px;
  background: var(--c-ink);
  clip-path: polygon(50% 0%, 62% 34%, 98% 35%, 69% 56%, 79% 91%, 50% 70%, 21% 91%, 31% 56%, 2% 35%, 38% 34%);
  position: relative;
}
.star::before {
  content: ""; position: absolute; inset: 3px;
  background: #e6dccb;
  clip-path: inherit;
}
.star.is-on::before { background: var(--c-gold); }

/* ---------- プレイ画面 ---------- */

.screen--play { padding: 0; background: var(--c-ground); overflow: hidden; }
.play__canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }

.hud {
  position: absolute;
  top: calc(8px + var(--safe-top));
  left: calc(8px + var(--safe-left));
  right: calc(8px + var(--safe-right));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }

.hud__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px 0 6px;
  border: 3px solid var(--c-ink);
  border-radius: 999px;
  background: var(--c-paper);
  box-shadow: 0 3px 0 var(--c-ink);
  font-size: 18px;
}
.hud__chip img { width: 28px; height: 28px; }
.hud__chip.is-bump { animation: count-bounce 0.35s var(--ease-pop); }
.hud__chip.is-hurt { animation: shake 0.4s ease; background: #ffe1dd; }
.hud__gifts.is-low .num { color: var(--c-red); }
.hud__wave { padding: 0 12px; font-size: 15px; font-weight: 800; }
.hud__wave .num { font-size: 18px; }
.hud__spacer { flex: 1; }
.hud__buttons { display: flex; gap: 6px; }
.hud__fast.is-on { background: var(--c-gold); }

.next-wave {
  position: absolute;
  right: calc(12px + var(--safe-right));
  bottom: calc(12px + var(--safe-bottom));
  z-index: 5;
}
.next-wave .btn { min-height: 48px; padding: 6px 18px; font-size: 17px; --btn-depth: 5px; }
.next-wave__bonus {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 0 8px; border: 2px solid var(--c-ink); border-radius: 999px;
  background: var(--c-gold); color: var(--c-ink); font-size: 14px;
}
.next-wave.is-ready .btn { animation: nudge 1.2s ease-in-out infinite; }

/* ---------- 必殺技ボタン（クールダウンの円） ---------- */

.skill-btn {
  --cd: 0;            /* 0=使える / 1=たまり始め（残り割合） */
  position: absolute;
  left: calc(12px + var(--safe-left));
  bottom: calc(12px + var(--safe-bottom));
  z-index: 5;
  width: 68px; height: 68px;
  padding: 0;
  border: 3px solid var(--c-ink);
  border-radius: 50%;
  background: var(--c-red);
  box-shadow: 0 5px 0 var(--c-red-deep), 0 5px 0 3px var(--c-ink);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.skill-btn img { width: 100%; height: 100%; border-radius: 50%; }
.skill-btn::after {
  content: "";
  position: absolute; inset: -3px;
  border-radius: 50%;
  background: conic-gradient(rgba(27, 41, 96, 0.62) calc(var(--cd) * 360deg), transparent 0);
  pointer-events: none;
}
.skill-btn:active:not(.is-cooling) { transform: translateY(5px); box-shadow: 0 0 0 var(--c-red-deep), 0 0 0 3px var(--c-ink); }
.skill-btn.is-cooling { cursor: default; filter: saturate(0.6); }
.skill-btn.is-ready { animation: ready-glow 1.4s ease-in-out infinite; }
.skill-btn__label {
  position: absolute; left: 50%; bottom: -12px; translate: -50% 0;
  padding: 0 8px; border: 2px solid var(--c-ink); border-radius: 999px;
  background: var(--c-paper); font-size: 12px; font-weight: 800; white-space: nowrap;
}
.skill-btn__time { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; color: #fff; font-size: 22px; text-shadow: 0 2px 0 var(--c-ink); }

/* ---------- ユニット購入メニュー（置けるマスの上に出る） ---------- */

.pop-menu {
  position: absolute;
  z-index: 10;
  translate: -50% calc(-100% - 14px);   /* left/top にマスの中心(px)を入れる */
  padding: 8px;
  border: 3px solid var(--c-ink);
  border-radius: var(--radius-m);
  background: var(--c-paper);
  box-shadow: 0 5px 0 var(--c-ink);
  animation: menu-pop 0.22s var(--ease-pop) both;
  transform-origin: 50% 100%;
}
.pop-menu::after {
  content: "";
  position: absolute; left: 50%; bottom: -12px;
  width: 18px; height: 18px;
  translate: -50% 0; rotate: 45deg;
  border-right: 3px solid var(--c-ink); border-bottom: 3px solid var(--c-ink);
  background: var(--c-paper);
}
.pop-menu.is-below { translate: -50% 14px; transform-origin: 50% 0; }
.pop-menu.is-below::after { bottom: auto; top: -12px; rotate: 225deg; }
.pop-menu__title { margin: 0 4px 6px; font-size: 14px; font-weight: 900; }

.buy-list { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.buy-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  width: 64px;
  padding: 4px 2px 3px;
  border: 3px solid var(--c-ink);
  border-radius: var(--radius-s);
  background: #fff;
  box-shadow: 0 4px 0 var(--c-ink);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.buy-item img { width: 52px; height: 52px; }
.buy-item__name { font-size: 10px; font-weight: 800; line-height: 1.2; text-align: center; }
.buy-item__cost {
  display: inline-flex; align-items: center; gap: 2px;
  margin-top: 2px; padding: 0 6px;
  border-radius: 999px; background: var(--c-gold);
  font-size: 13px;
}
.buy-item__cost::before { content: ""; width: 10px; height: 10px; border: 2px solid var(--c-ink); border-radius: 50%; background: #fff3c4; }
.buy-item:active:not(.is-poor) { transform: translateY(4px); box-shadow: 0 0 0 var(--c-ink); }
.buy-item.is-selected { background: #fff6d6; outline: 3px solid var(--c-gold); }
.buy-item.is-poor { cursor: not-allowed; background: #eee8de; }
.buy-item.is-poor img { filter: grayscale(1) opacity(0.5); }
.buy-item.is-poor .buy-item__cost { background: #d8cfc2; color: var(--c-red-deep); }
.buy-item.is-denied { animation: shake 0.35s ease; }

/* 説明行（選択中のユニットの説明・射程） */
.pop-menu__desc { max-width: 340px; margin: 6px 4px 0; font-size: 12px; color: var(--c-ink-sub); line-height: 1.4; }

/* ---------- 強化・売却メニュー ---------- */

.unit-menu { display: flex; align-items: stretch; gap: 8px; }
.unit-menu__info { display: flex; flex-direction: column; align-items: center; min-width: 84px; }
.unit-menu__info img { width: 60px; height: 60px; }
.unit-menu__name { font-size: 13px; font-weight: 900; }
.unit-menu__level { display: flex; gap: 2px; }
.unit-menu__level .star { width: 16px; height: 16px; }
.unit-menu__actions { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.unit-menu__actions .btn { min-height: 40px; padding: 4px 14px; font-size: 15px; --btn-depth: 4px; gap: 6px; }
.unit-menu__actions .btn .num { font-size: 15px; }
.unit-menu__actions .btn.is-poor { filter: grayscale(0.9) opacity(0.6); cursor: not-allowed; }
.unit-menu__max { padding: 4px 12px; border: 3px dashed var(--c-gold-deep); border-radius: 999px; color: var(--c-gold-deep); font-weight: 900; font-size: 14px; text-align: center; }

/* ---------- ウェーブ開始のバナー ---------- */

.wave-banner {
  position: absolute;
  left: 0; right: 0; top: 34%;
  z-index: 15;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none;
  animation: banner 2s ease both;
}
.wave-banner__ribbon {
  position: relative;
  padding: 8px 40px;
  border: 3px solid var(--c-ink);
  background: var(--c-red);
  color: #fff;
  font-size: clamp(26px, 8vmin, 40px);
  font-weight: 900;
  text-shadow: 0 3px 0 var(--c-ink);
  box-shadow: 0 5px 0 var(--c-ink);
}
.wave-banner__ribbon::before,
.wave-banner__ribbon::after {
  content: "";
  position: absolute; top: 10px; bottom: -10px; width: 26px;
  border: 3px solid var(--c-ink);
  background: var(--c-red-deep);
  z-index: -1;
}
.wave-banner__ribbon::before { left: -20px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 40% 50%); }
.wave-banner__ribbon::after { right: -20px; clip-path: polygon(0 0, 100% 0, 60% 50%, 100% 100%, 0 100%); }
.wave-banner__sub {
  margin-top: 10px; padding: 2px 14px;
  border: 3px solid var(--c-ink); border-radius: 999px;
  background: var(--c-paper); font-size: 15px; font-weight: 800;
}
.wave-banner--boss .wave-banner__ribbon { background: var(--c-gang); }
.wave-banner--boss .wave-banner__ribbon::before, .wave-banner--boss .wave-banner__ribbon::after { background: #55339a; }

/* ---------- オーバーレイ（ポーズ・勝利・敗北） ---------- */

.overlay {
  position: absolute; inset: 0; z-index: 20;
  display: grid; place-items: center;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  background: rgba(11, 20, 56, 0.55);
  animation: fade-in var(--dur-mid) ease both;
}
.overlay[hidden] { display: none; }

.sheet {
  position: relative;
  width: min(380px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 22px 20px 20px;
  border: 3px solid var(--c-ink);
  border-radius: var(--radius-l);
  background: var(--c-paper);
  box-shadow: 0 8px 0 var(--c-ink);
  text-align: center;
  animation: sheet-up var(--dur-mid) var(--ease-pop) both;
}
.sheet__santa { display: block; width: 150px; height: 150px; margin: -80px auto 0; }
.sheet__title { margin: 0 0 6px; font-size: 30px; font-weight: 900; line-height: 1.2; }
.sheet__lead { margin: 0 0 14px; font-size: 15px; color: var(--c-ink-sub); }
.sheet__actions { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.sheet--win .sheet__title { color: var(--c-green-deep); }
.sheet--lose { background: #eef3fb; }
.sheet--lose .sheet__title { color: var(--c-night); }

.result__stars { display: flex; justify-content: center; gap: 6px; margin: 6px 0 8px; }
.result-star {
  width: 64px; height: 64px;
  background: var(--c-ink);
  clip-path: polygon(50% 0%, 62% 34%, 98% 35%, 69% 56%, 79% 91%, 50% 70%, 21% 91%, 31% 56%, 2% 35%, 38% 34%);
  position: relative;
  animation: star-pop 0.5s var(--ease-pop) both;
  animation-delay: calc(0.3s + var(--i, 0) * 0.25s);
}
.result-star:nth-child(2) { translate: 0 -12px; width: 76px; height: 76px; }
.result-star::before { content: ""; position: absolute; inset: 5px; background: #e6dccb; clip-path: inherit; }
.result-star.is-on::before { background: var(--c-gold); }

.result__gifts {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 14px; border: 3px solid var(--c-ink); border-radius: 999px;
  background: #fff; font-size: 18px;
}
.result__gifts img { width: 28px; height: 28px; }

/* ---------- 汎用アニメ ---------- */

.fade-in { animation: fade-in var(--dur-mid) ease both; }
.shake { animation: shake 0.4s ease; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in {
  0% { opacity: 0; transform: scale(0.6); }
  60% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes menu-pop {
  0% { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes sheet-up {
  from { opacity: 0; transform: translateY(60px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes count-bounce {
  0% { transform: translateY(0); }
  50% { transform: translateY(-4px) scale(1.15); }
  100% { transform: translateY(0); }
}
@keyframes star-pop {
  0% { transform: scale(0) rotate(-40deg); }
  70% { transform: scale(1.25) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes banner {
  0% { opacity: 0; transform: translateX(-60%) scale(0.9); }
  18% { opacity: 1; transform: translateX(0) scale(1.05); }
  26%, 78% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateX(60%); }
}
@keyframes nudge {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -4px; }
}
@keyframes ready-glow {
  0%, 100% { box-shadow: 0 5px 0 var(--c-red-deep), 0 5px 0 3px var(--c-ink), 0 0 0 0 rgba(255, 200, 61, 0.8); }
  50% { box-shadow: 0 5px 0 var(--c-red-deep), 0 5px 0 3px var(--c-ink), 0 0 0 10px rgba(255, 200, 61, 0); }
}
@keyframes logo-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}
@keyframes shake {
  0%, 100% { translate: 0 0; }
  20% { translate: -6px 0; }
  40% { translate: 6px 0; }
  60% { translate: -4px 0; }
  80% { translate: 4px 0; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .screen { transform: none; }
  .wave-banner { animation: fade-in 0.01ms both; }
}
