:root {
  color-scheme: dark;
  --ink: #f8f0d8;
  --ink-dim: #c9c5c8;
  --night-0: #040715;
  --night-1: #080d23;
  --night-2: #111a3a;
  --glass: rgba(7, 12, 34, 0.88);
  --glass-soft: rgba(11, 18, 48, 0.74);
  --gold: #e6bf67;
  --gold-hi: #ffe7a2;
  --scarlet: #ef4d5e;
  --scarlet-dark: #7f1f37;
  --cyan: #5ee8ee;
  --cyan-dark: #196f86;
  --line: rgba(230, 191, 103, 0.48);
  --shadow: rgba(0, 0, 0, 0.56);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #02040c;
  color: var(--ink);
  touch-action: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.shell {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  background:
    radial-gradient(circle at 50% 16%, rgba(45, 62, 126, 0.24), transparent 42%),
    #02040c;
}

.game-frame {
  position: relative;
  width: min(100vw, calc(100dvh * 0.5625));
  height: min(100dvh, calc(100vw * 1.77778));
  min-width: 320px;
  max-width: 540px;
  max-height: 960px;
  overflow: hidden;
  isolation: isolate;
  background: var(--night-0);
  border-inline: 1px solid rgba(230, 191, 103, 0.2);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.9);
}

.game-frame::before,
.game-frame::after {
  position: absolute;
  z-index: 11;
  top: 0;
  bottom: 0;
  width: 3px;
  content: "";
  pointer-events: none;
  background: linear-gradient(transparent, rgba(230, 191, 103, 0.72) 20%, rgba(230, 191, 103, 0.18) 80%, transparent);
}

.game-frame::before { left: 0; }
.game-frame::after { right: 0; }

.celestial-noise {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    radial-gradient(circle at 20% 16%, rgba(255, 255, 255, 0.7) 0 0.7px, transparent 1px),
    radial-gradient(circle at 74% 40%, rgba(255, 226, 154, 0.7) 0 0.6px, transparent 1px);
  background-size: 19px 23px, 31px 29px;
  mix-blend-mode: screen;
}

#gameCanvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#gameCanvas.is-dragging {
  cursor: grabbing;
}

.hud {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  pointer-events: none;
}

.hud button {
  pointer-events: auto;
}

.hud-top {
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr 44px;
  align-items: center;
  gap: 8px;
  min-height: 78px;
  padding: calc(8px + var(--safe-top)) 12px 12px;
  background: linear-gradient(180deg, rgba(3, 6, 19, 0.96) 0%, rgba(6, 10, 29, 0.79) 62%, transparent 100%);
}

.hero-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 96px;
  padding: 5px 9px 5px 5px;
  isolation: isolate;
}

.hero-chip::before {
  position: absolute;
  z-index: -1;
  inset: -5px -7px;
  content: "";
  pointer-events: none;
  opacity: 0.88;
  background: url("../assets/final/ui_frame_status.webp") center / 100% 100% no-repeat;
}

.hero-mark {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--gold-hi);
  font-size: 18px;
}

.hero-mark img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.hero-mark i,
.icon-button i,
.ultimate-icon i,
.skill-glyph i {
  display: none;
  font-style: normal;
}

.hero-mark img.is-missing + i,
.icon-button img.is-missing + i,
.ultimate-icon img.is-missing + i,
.skill-glyph img.is-missing + i {
  display: block;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.hero-copy b {
  color: var(--ink);
  font-family: Georgia, "Yu Mincho", serif;
  font-size: 11px;
  letter-spacing: 0.14em;
}

.hero-copy small {
  margin-top: 5px;
  color: var(--gold-hi);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.status-stack {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.meter-row {
  display: grid;
  grid-template-columns: 27px minmax(56px, 1fr) 42px;
  align-items: center;
  gap: 5px;
}

.meter-label,
.meter-row output {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 2px #000;
}

.meter-row output {
  overflow: hidden;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  text-align: right;
  text-overflow: clip;
  white-space: nowrap;
}

.meter-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  transform: skewX(-13deg);
  border: 1px solid rgba(248, 240, 216, 0.32);
  background: rgba(0, 0, 0, 0.66);
}

.meter-track::after {
  position: absolute;
  inset: 1px auto 1px 2px;
  width: 35%;
  content: "";
  opacity: 0.38;
  background: linear-gradient(90deg, #fff, transparent);
}

.meter-track i {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left;
  transition: transform 140ms linear;
}

.hp-row .meter-track i {
  background: linear-gradient(90deg, var(--scarlet-dark), var(--scarlet), #ff8b83);
}

.xp-row .meter-track i {
  transform: scaleX(0);
  background: linear-gradient(90deg, #3b8aa3, var(--cyan), #c4ffff);
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(8, 13, 37, 0.84);
  box-shadow: inset 0 0 0 2px rgba(230, 191, 103, 0.08);
}

.icon-button span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.icon-button img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.wave-ribbon,
.mission-clock {
  position: absolute;
  z-index: 4;
  top: calc(82px + var(--safe-top));
  pointer-events: none;
  text-shadow: 0 1px 3px #000;
}

.wave-ribbon {
  left: 12px;
  display: flex;
  width: 68px;
  height: 50px;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  padding: 17px 10px 8px;
  isolation: isolate;
}

.wave-ribbon::before {
  position: absolute;
  z-index: -1;
  inset: -7px;
  content: "";
  opacity: 0.9;
  background: url("../assets/final/ui_frame_wave.webp") center / contain no-repeat;
}

.wave-ribbon span,
.mission-clock small {
  color: var(--gold-hi);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.wave-ribbon b {
  font-family: Georgia, serif;
  font-size: 15px;
}

.mission-clock {
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: end;
}

.mission-clock output {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hud-bottom {
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
  min-height: 98px;
  padding: 20px 12px calc(10px + var(--safe-bottom));
  background: linear-gradient(0deg, rgba(3, 6, 19, 0.96) 0%, rgba(5, 9, 26, 0.68) 62%, transparent 100%);
}

.hint {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding-bottom: 8px;
  color: rgba(248, 240, 216, 0.68);
  font-size: 8px;
  white-space: nowrap;
}

.hint i {
  display: grid;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(230, 191, 103, 0.12);
}

.hint i img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.hint b {
  color: var(--gold-hi);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.ultimate {
  position: relative;
  display: grid;
  width: 150px;
  min-height: 64px;
  grid-template-columns: 48px 1fr;
  grid-template-rows: 1fr;
  align-items: center;
  padding: 7px 14px 7px 7px;
  isolation: isolate;
  cursor: pointer;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.42));
}

.ultimate::before {
  position: absolute;
  z-index: -1;
  inset: -3px;
  content: "";
  pointer-events: none;
  background: url("../assets/final/ui_frame_ultimate.webp") center / 100% 100% no-repeat;
}

.ultimate:disabled {
  cursor: default;
  filter: saturate(0.45);
  opacity: 0.72;
}

.ultimate.is-ready {
  animation: readyPulse 1.35s ease-in-out infinite;
}

.ultimate-ring {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  grid-column: 1;
  grid-row: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(230, 191, 103, 0.46);
  border-radius: 50%;
  background: conic-gradient(var(--cyan) var(--sp, 0%), rgba(255,255,255,0.08) 0);
}

.ultimate-ring::after {
  position: absolute;
  inset: 4px;
  content: "";
  border: 1px solid rgba(230, 191, 103, 0.42);
  border-radius: 50%;
  background: #0a102a;
}

.ultimate-icon {
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  color: var(--gold-hi);
  font-size: 20px;
  text-shadow: 0 0 8px rgba(255, 230, 154, 0.6);
}

.ultimate-icon img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.ultimate-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 5px;
  text-align: left;
}

.ultimate-copy b {
  overflow: hidden;
  max-width: 100%;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ultimate-copy small {
  margin-top: 4px;
  color: var(--cyan);
  font-size: 8px;
  font-weight: 900;
}

.overlay {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 5, 16, 0.83);
  backdrop-filter: blur(8px);
}

.overlay:not(.is-visible) {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.overlay.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.intro {
  overflow: hidden;
  align-content: center;
  padding: calc(42px + var(--safe-top)) 32px calc(24px + var(--safe-bottom));
  text-align: center;
  background:
    linear-gradient(180deg, rgba(3, 7, 23, 0.7), rgba(4, 8, 26, 0.92)),
    radial-gradient(circle at 50% 27%, rgba(126, 51, 87, 0.55), transparent 32%),
    #05091b;
  transition: opacity 360ms ease, visibility 360ms ease;
}

.intro::before,
.intro::after {
  position: absolute;
  width: 80%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.intro::before { top: 26px; }
.intro::after { bottom: 26px; }

.intro-stars {
  position: absolute;
  inset: 0;
  opacity: 0.48;
  background-image:
    radial-gradient(circle at 13% 16%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 83% 24%, var(--gold-hi) 0 1px, transparent 1.5px),
    radial-gradient(circle at 67% 75%, #fff 0 0.7px, transparent 1.2px),
    radial-gradient(circle at 20% 62%, var(--gold-hi) 0 0.7px, transparent 1.2px);
  background-size: 97px 113px, 139px 127px, 83px 79px, 111px 101px;
}

.intro > *:not(.intro-stars) {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-hi);
  font-family: Georgia, serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.25em;
}

.intro h1 {
  display: flex;
  margin: 4px 0 0;
  flex-direction: column;
  color: var(--ink);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(40px, 12vw, 64px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.08em;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.6), 0 0 22px rgba(238, 78, 94, 0.18);
}

.intro h1 span {
  padding-right: 0.9em;
  color: var(--gold-hi);
  font-size: 0.35em;
  letter-spacing: 0.18em;
}

.subtitle {
  margin: 9px 0 0;
  color: var(--scarlet);
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.34em;
}

.intro-rule {
  display: grid;
  width: min(240px, 80%);
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 18px auto;
  color: var(--gold);
}

.intro-rule i {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.intro-rule i:last-child {
  transform: scaleX(-1);
}

.intro-lead {
  margin: 0 0 18px;
  color: rgba(248, 240, 216, 0.86);
  font-family: "Yu Mincho", serif;
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: 0.05em;
}

.control-list {
  display: grid;
  gap: 6px;
  width: min(300px, 100%);
  margin: 0 auto 20px;
  padding: 0;
  list-style: none;
  text-align: left;
}

.control-list li {
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: auto auto;
  padding: 7px 10px;
  border-left: 1px solid var(--gold);
  background: linear-gradient(90deg, rgba(230, 191, 103, 0.09), transparent);
}

.control-list li > span {
  grid-row: 1 / 3;
  color: var(--gold-hi);
  font-family: Georgia, serif;
  font-size: 11px;
}

.control-list b {
  font-size: 10px;
  letter-spacing: 0.03em;
}

.control-list small {
  margin-top: 2px;
  color: rgba(248, 240, 216, 0.56);
  font-size: 8px;
}

.primary-button,
.secondary-button {
  min-width: 190px;
  min-height: 46px;
  padding: 11px 18px;
  cursor: pointer;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  font-weight: 900;
  letter-spacing: 0.05em;
}

.primary-button {
  color: #170b19;
  border: 1px solid #ffe5a0;
  background: linear-gradient(110deg, #d9a64c, #ffe8a8 45%, #e7b655);
  box-shadow: 0 8px 26px rgba(230, 191, 103, 0.2);
}

.primary-button:hover,
.primary-button:focus-visible {
  filter: brightness(1.08);
}

.primary-button:active {
  transform: translateY(1px);
}

.secondary-button {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(11, 18, 49, 0.76);
}

.build-note {
  margin: 12px 0 0;
  color: rgba(248, 240, 216, 0.35);
  font-family: Consolas, monospace;
  font-size: 7px;
  letter-spacing: 0.08em;
}

.modal {
  position: relative;
  width: min(100%, 420px);
  padding: 24px 20px;
  text-align: center;
  border: 1px solid var(--line);
  clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px);
  background:
    linear-gradient(135deg, rgba(230, 191, 103, 0.08), transparent 32%),
    rgba(6, 11, 31, 0.96);
  box-shadow: 0 30px 70px var(--shadow), inset 0 0 40px rgba(71, 96, 170, 0.08);
}

.modal::before,
.modal::after {
  position: absolute;
  width: 44px;
  height: 1px;
  content: "";
  background: var(--gold);
}

.modal::before { top: 8px; left: 12px; }
.modal::after { right: 12px; bottom: 8px; }

.modal h2 {
  margin: 5px 0 6px;
  font-family: "Yu Mincho", serif;
  font-size: 23px;
  letter-spacing: 0.06em;
}

.modal > p:not(.eyebrow) {
  margin: 0 0 18px;
  color: var(--ink-dim);
  font-size: 10px;
}

.skill-grid {
  display: grid;
  gap: 9px;
}

.skill-card {
  position: relative;
  display: grid;
  min-height: 82px;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 17px 10px 10px;
  overflow: hidden;
  isolation: isolate;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  border: 0;
  background: transparent;
}

.skill-card::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  background: url("../assets/final/ui_frame_skill.webp") center / 100% 100% no-repeat;
}

.skill-card::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  content: "";
  background: var(--skill-color, var(--cyan));
}

.skill-card:hover,
.skill-card:focus-visible {
  transform: translateX(2px);
  filter: brightness(1.16) drop-shadow(0 0 8px rgba(230, 191, 103, 0.24));
}

.skill-glyph {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: var(--gold-hi);
  font-size: 24px;
}

.skill-glyph img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.skill-copy {
  min-width: 0;
}

.skill-copy b {
  display: block;
  font-family: "Yu Mincho", serif;
  font-size: 13px;
}

.skill-copy small {
  display: block;
  margin-top: 5px;
  color: var(--ink-dim);
  font-size: 9px;
  line-height: 1.4;
}

.skill-rank {
  color: var(--gold-hi);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.pause-modal,
.result-modal {
  display: grid;
  justify-items: center;
  gap: 9px;
  max-width: 320px;
}

.pause-modal .eyebrow,
.result-modal .eyebrow,
.pause-modal h2,
.result-modal h2 {
  margin-bottom: 7px;
}

.deerflow-signature {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 8px;
  color: rgba(248, 240, 216, 0.34);
  font-family: Georgia, serif;
  font-size: 7px;
  letter-spacing: 0.12em;
  text-decoration: none;
  transition: color 160ms ease;
}

.deerflow-signature:hover,
.deerflow-signature:focus-visible {
  color: var(--gold-hi);
}

.result-score {
  display: flex;
  margin: 7px 0 5px;
  flex-direction: column;
}

.result-score small {
  color: var(--gold-hi);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.result-score output {
  font-family: Georgia, serif;
  font-size: 42px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.result-stats {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, 1fr);
  margin: 4px 0 12px;
}

.result-stats div {
  padding: 7px 4px;
  border-right: 1px solid rgba(230, 191, 103, 0.2);
}

.result-stats div:last-child { border: 0; }

.result-stats dt {
  color: var(--ink-dim);
  font-size: 8px;
}

.result-stats dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.cutin {
  position: absolute;
  z-index: 30;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: rgba(2, 4, 12, 0.22);
}

.cutin.is-active {
  display: block;
  animation: cutinFlash 760ms ease-out both;
}

.cutin-slice {
  position: absolute;
  left: -12%;
  width: 125%;
  height: 38%;
  transform: skewY(-9deg);
}

.cutin-slice-a {
  top: 28%;
  border-block: 2px solid var(--gold-hi);
  background:
    linear-gradient(90deg, rgba(108, 26, 55, 0.96), rgba(13, 29, 75, 0.96) 72%),
    #28142c;
  box-shadow: 0 0 26px rgba(230, 191, 103, 0.4);
}

.cutin-slice-b {
  top: 33%;
  height: 26%;
  opacity: 0.28;
  background: repeating-linear-gradient(90deg, transparent 0 22px, rgba(255,255,255,0.14) 23px 24px);
}

.cutin-character {
  position: absolute;
  z-index: 2;
  right: -2%;
  bottom: 12%;
  width: 66%;
  height: 72%;
  filter: drop-shadow(-5px 3px 0 rgba(255, 239, 207, 0.92)) drop-shadow(-11px 7px 12px rgba(0, 0, 0, 0.55));
}

.cutin-character img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
}

.cutin-character img.is-missing { display: none; }

.cutin-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: var(--gold-hi);
  font-size: 120px;
}

.cutin-character img.is-missing + .cutin-fallback { display: grid; }

.cutin-type {
  position: absolute;
  z-index: 3;
  left: 7%;
  top: 40%;
  display: flex;
  width: 58%;
  flex-direction: column;
  transform: rotate(-4deg);
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.7);
}

.cutin-type small {
  color: var(--gold-hi);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.cutin-type b {
  margin-top: 4px;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: clamp(25px, 8vw, 42px);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.cutin-type span {
  align-self: flex-start;
  margin-top: 7px;
  padding: 2px 8px;
  color: #180c1b;
  font-family: "Yu Mincho", serif;
  font-size: 12px;
  font-weight: 900;
  background: var(--gold-hi);
}

.telemetry {
  position: absolute;
  z-index: 7;
  right: 6px;
  bottom: calc(102px + var(--safe-bottom));
  display: flex;
  gap: 5px;
  padding: 2px 5px;
  pointer-events: none;
  color: rgba(248, 240, 216, 0.42);
  font-family: Consolas, monospace;
  font-size: 6px;
  background: rgba(1, 3, 10, 0.34);
}

.game-frame.is-shaking {
  animation: frameShake 240ms steps(2, end);
}

@keyframes readyPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(230, 191, 103, 0); }
  50% { box-shadow: 0 0 18px rgba(230, 191, 103, 0.48); }
}

@keyframes cutinFlash {
  0% { opacity: 0; transform: scale(1.08); }
  10% { opacity: 1; }
  82% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; }
}

@keyframes frameShake {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, -1px); }
}

@media (max-width: 370px), (max-height: 670px) {
  .hud-top { min-height: 70px; padding-inline: 9px; }
  .hero-mark { width: 30px; height: 30px; }
  .wave-ribbon, .mission-clock { top: calc(72px + var(--safe-top)); }
  .hint { display: none; }
  .hud-bottom { grid-template-columns: 1fr; justify-items: end; }
  .intro { padding-inline: 25px; }
  .intro-rule { margin-block: 12px; }
  .intro-lead { margin-bottom: 12px; line-height: 1.55; }
  .control-list { margin-bottom: 12px; }
  .control-list li { padding-block: 5px; }
  .skill-card { min-height: 66px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
