:root {
  --orange: #FF8A3D;
  --orange-hot: #FFA45C;
  --orange-deep: #E96516;
  --cream: #FFF3DE;
  --cream-deep: #FFE4BD;
  --ink: #321B10;
  --ink-soft: #6F4932;
  --space: #070B1D;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--space);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  color: var(--cream);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

button { font: inherit; }

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--space);
  touch-action: manipulation;
}

/* ---------- deep-space scene ---------- */
.scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(90% 60% at 50% 20%, #16204A 0%, #0A1028 48%, #050714 100%);
}

.scene-bg {
  position: absolute;
  inset: -2%;
  width: 104%;
  height: 104%;
  object-fit: cover;
  opacity: 0.96;
  transform: translateZ(0);
}

.scene-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(110% 70% at 50% 8%, rgba(255, 138, 61, 0.08) 0%, rgba(255, 138, 61, 0) 55%),
    radial-gradient(130% 85% at 50% 50%, rgba(4, 7, 20, 0) 38%, rgba(4, 7, 20, 0.6) 100%),
    linear-gradient(180deg, rgba(4, 7, 20, 0.08) 0%, rgba(4, 7, 20, 0) 24%, rgba(4, 7, 20, 0.32) 72%, rgba(4, 7, 20, 0.72) 100%);
}

#game {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ---------- hud ---------- */
.hud {
  position: absolute;
  top: calc(var(--safe-top) + 12px);
  left: 16px;
  right: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#app[data-state="ready"] .hud,
#app[data-state="ready"] .zone-chip,
#app[data-state="ready"] .play-hint {
  opacity: 0;
  transform: translateY(-10px);
  visibility: hidden;
}

.pill {
  height: 47px;
  border-radius: 18px;
  background: linear-gradient(180deg, #FFFCF4 0%, #FFF0D6 62%, #FFE4BD 100%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 #FFFFFF,
    inset 0 -2px 0 rgba(168, 99, 49, 0.12);
  display: flex;
  align-items: center;
  color: var(--ink);
}

.ore-pill {
  flex: 0 1 auto;
  min-width: 126px;
  padding: 0 14px 0 7px;
  gap: 8px;
}

.ore-gem {
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #FFF9EA;
  background: linear-gradient(145deg, #FFC079 0%, #FF8A3D 50%, #EE6614 100%);
  box-shadow:
    0 3px 8px rgba(236, 102, 20, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

.ore-gem .mp-icon { width: 18px; height: 18px; }

.pill-main {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.pill-main b {
  font-size: 21px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #352014;
  transition: transform 0.16s cubic-bezier(0.2, 1.6, 0.4, 1);
  transform-origin: left center;
}

.ore-pill.bump .pill-main b { transform: scale(1.2); }

.pill-main small {
  font-size: 10px;
  font-weight: 800;
  color: #94694D;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hull-pill {
  flex: 0 1 150px;
  min-width: 132px;
  padding: 0 12px 0 7px;
  gap: 7px;
}

.hull-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #FFF8EA;
  background: linear-gradient(145deg, #6FE5D5 0%, #2DB9B3 58%, #17777F 100%);
  box-shadow:
    0 3px 8px rgba(18, 116, 120, 0.38),
    inset 0 1px 1px rgba(255, 255, 255, 0.65);
}

.hull-icon .mp-icon { width: 17px; height: 17px; }

.hull-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hull-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  line-height: 1;
}

.hull-top small {
  font-size: 9px;
  font-weight: 800;
  color: #94694D;
  letter-spacing: 0.08em;
}

.hull-top b {
  font-size: 13px;
  font-weight: 900;
  color: #352014;
  font-variant-numeric: tabular-nums;
}

.hull-track {
  display: block;
  width: 100%;
  height: 7px;
  border-radius: 6px;
  overflow: hidden;
  background: #E7CFAB;
  box-shadow: inset 0 1px 2px rgba(80, 42, 18, 0.28);
}

.hull-track i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #FFC27A 0%, #FF8A3D 60%, #F06A19 100%);
  box-shadow: 0 0 8px rgba(255, 138, 61, 0.5);
  transition: width 0.26s ease, background 0.26s ease;
}

.hull-pill.danger .hull-track i {
  background: linear-gradient(90deg, #FF7E66 0%, #EF3C2A 100%);
  box-shadow: 0 0 9px rgba(255, 70, 48, 0.6);
}

.hull-pill.danger { animation: dangerPulse 1.1s ease-in-out infinite; }

.zone-chip {
  position: absolute;
  top: calc(var(--safe-top) + 67px);
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 184, 122, 0.28);
  background: rgba(9, 12, 30, 0.54);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #FFD8AF;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.zone-chip b {
  color: #FFF7EA;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.zone-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 10px var(--orange);
  animation: beacon 1.5s ease-in-out infinite;
}

/* ---------- ship ---------- */
.ship-wrap {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 4px);
  z-index: 3;
  width: clamp(138px, 40vw, 172px);
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.55));
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.3, 1);
  will-change: transform;
}

.ship-wrap.is-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(18px);
}

.ship-float {
  position: relative;
  z-index: 1;
  animation: shipFloat 3.6s ease-in-out infinite;
}

.ship-img {
  display: block;
  width: 100%;
  height: auto;
}

.ship-glow {
  position: absolute;
  left: 50%;
  bottom: 5%;
  width: 76%;
  height: 48%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 138, 61, 0.32) 0%, rgba(255, 138, 61, 0) 70%);
  filter: blur(8px);
  pointer-events: none;
}

.ship-wrap.hit .ship-float { animation: shipHit 0.42s cubic-bezier(0.25, 0.8, 0.3, 1); }
.ship-wrap.hit .ship-img { filter: brightness(1.55) saturate(0.7); }

/* ---------- play feedback ---------- */
.play-hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + clamp(152px, 44vw, 196px));
  z-index: 4;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 200, 148, 0.24);
  background: rgba(10, 13, 32, 0.68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #FFE2C2;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.play-hint .mp-icon { width: 15px; height: 15px; color: #FFB878; }
.play-hint.is-hidden { opacity: 0; transform: translateX(-50%) translateY(8px); }

.float-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.float-text {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #FFD18F;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 0 rgba(76, 30, 5, 0.5), 0 0 18px rgba(255, 138, 61, 0.65);
  animation: floatUp 0.95s cubic-bezier(0.15, 0.75, 0.3, 1) forwards;
  white-space: nowrap;
}

.float-text.small { font-size: 14px; color: #FFE7C6; }
.float-text.danger { color: #FF8B7A; text-shadow: 0 2px 0 rgba(70, 12, 6, 0.55), 0 0 18px rgba(255, 63, 40, 0.55); }

.hit-vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(120% 85% at 50% 82%, rgba(255, 58, 34, 0) 38%, rgba(255, 48, 25, 0.28) 72%, rgba(255, 30, 10, 0.58) 100%);
  transition: opacity 0.18s ease;
}

.hit-vignette.on {
  opacity: 1;
  transition: opacity 0.04s ease;
}

/* ---------- overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-top) + 14px) 20px calc(var(--safe-bottom) + 16px);
}

.overlay[hidden] { display: none; }

.start-overlay {
  background:
    radial-gradient(95% 50% at 50% 24%, rgba(6, 9, 24, 0.02) 0%, rgba(6, 9, 24, 0) 52%),
    linear-gradient(180deg, rgba(4, 7, 20, 0.52) 0%, rgba(4, 7, 20, 0.04) 21%, rgba(4, 7, 20, 0.18) 48%, rgba(5, 8, 22, 0.86) 76%, #05081A 100%);
  animation: overlayIn 0.45s ease both;
}

.start-safe {
  width: 100%;
  max-width: 440px;
  min-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 198, 142, 0.24);
  background: rgba(255, 238, 218, 0.08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #FFD1A1;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.brand-tag .mp-icon { width: 13px; height: 13px; }

.brand-sector {
  color: rgba(255, 227, 199, 0.46);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.hero-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 154px;
  max-height: 294px;
  margin: 0 -10px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 123, 38, 0.26) 0%, rgba(255, 123, 38, 0.06) 45%, rgba(255, 123, 38, 0) 72%);
  filter: blur(10px);
}

.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 167, 96, 0.18);
  pointer-events: none;
}

.orbit-a {
  width: 84%;
  height: 66%;
  transform: rotate(-16deg);
}

.orbit-b {
  width: 62%;
  height: 46%;
  border-style: dashed;
  border-color: rgba(255, 190, 132, 0.16);
  animation: orbitSpin 30s linear infinite;
}

.hero-art {
  position: relative;
  z-index: 1;
  display: block;
  width: min(90%, 390px);
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.5));
  animation: heroFloat 5.2s ease-in-out infinite;
}

.title-block {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  margin-top: -4px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 5px;
  color: #FFB26E;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
}

.title-block h1 {
  margin: 0;
  font-size: clamp(41px, 12.8vw, 58px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-indent: 0.1em;
  background: linear-gradient(180deg, #FFFDF7 2%, #FFF1D8 38%, #FFCE8D 68%, #FF8A3D 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #FFE7C6;
  filter:
    drop-shadow(0 3px 0 rgba(85, 36, 8, 0.42))
    drop-shadow(0 10px 24px rgba(255, 120, 38, 0.2));
}

.tagline {
  margin: 7px 0 0;
  color: #DAC9BA;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
}

.mission-card {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  margin-top: 15px;
  padding: 13px 14px 12px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: linear-gradient(152deg, #FFFBF2 0%, #FFF2D9 56%, #FFE6C1 100%);
  color: var(--ink);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 #FFFFFF,
    inset 0 -3px 0 rgba(163, 96, 44, 0.1);
  overflow: hidden;
}

.mission-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -44px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 138, 61, 0.24) 0%, rgba(255, 138, 61, 0) 68%);
  pointer-events: none;
}

.mission-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
}

.mission-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #FFF9ED;
  background: linear-gradient(145deg, #FFAE64 0%, #FF8A3D 56%, #ED6718 100%);
  box-shadow: 0 4px 10px rgba(231, 99, 20, 0.32), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.mission-mark .mp-icon { width: 18px; height: 18px; }

.mission-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mission-title b { font-size: 14px; line-height: 1.15; letter-spacing: 0.02em; }
.mission-title small { font-size: 9px; color: #A37758; letter-spacing: 0.05em; }

.mission-level {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #3A2115;
  color: #FFD6A8;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.mission-card p {
  position: relative;
  z-index: 1;
  margin: 9px 0 0;
  color: #72503A;
  font-size: 11.5px;
  line-height: 1.62;
}

.mission-stats {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 26px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed rgba(138, 82, 43, 0.22);
}

.mission-stats span { display: flex; flex-direction: column; gap: 2px; }
.mission-stats b {
  color: #E4651A;
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.mission-stats small { color: #A37758; font-size: 9px; font-weight: 600; letter-spacing: 0.04em; }

.btn-primary {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 58px;
  flex: 0 0 auto;
  margin-top: 14px;
  padding: 0 18px;
  border: 0;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #2D1407;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #FFB36F 0%, #FF8A3D 46%, #F06D1C 100%);
  box-shadow:
    0 7px 0 #B84B0C,
    0 16px 28px rgba(255, 116, 32, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.66),
    inset 0 -2px 0 rgba(160, 60, 8, 0.24);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  touch-action: manipulation;
}

.btn-primary .mp-icon { width: 21px; height: 21px; }

.btn-primary:active {
  transform: translateY(4px);
  filter: saturate(1.05);
  box-shadow:
    0 3px 0 #B84B0C,
    0 8px 16px rgba(255, 116, 32, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(160, 60, 8, 0.2);
}

.start-foot {
  flex: 0 0 auto;
  margin: 13px 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: rgba(255, 228, 201, 0.52);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.start-foot .mp-icon { width: 13px; height: 13px; }

/* ---------- game over ---------- */
.over-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(80% 55% at 50% 45%, rgba(7, 10, 28, 0.28) 0%, rgba(5, 8, 22, 0.9) 74%),
    linear-gradient(180deg, rgba(4, 7, 20, 0.55) 0%, rgba(4, 7, 20, 0.92) 100%);
  animation: overlayIn 0.3s ease both;
}

.over-card {
  width: 100%;
  max-width: 358px;
  padding: 21px 19px 14px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: linear-gradient(156deg, #FFFCF5 0%, #FFF1DA 54%, #FFE3BA 100%);
  color: var(--ink);
  text-align: center;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 #FFFFFF,
    inset 0 -4px 0 rgba(161, 94, 43, 0.1);
  animation: cardIn 0.4s cubic-bezier(0.2, 0.9, 0.25, 1.18) both;
}

.over-kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #FFDFB8;
  color: #B1490D;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.over-kicker .mp-icon { width: 12px; height: 12px; }

.over-card h2 {
  margin: 9px 0 0;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #342014;
}

.over-sub {
  margin: 4px 0 0;
  color: #9B7355;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.score-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 0;
  color: #E4651A;
}

.score-display .mp-icon {
  width: 22px;
  height: 22px;
  align-self: center;
  filter: drop-shadow(0 2px 3px rgba(190, 82, 20, 0.25));
}

.score-display b {
  font-size: 54px;
  line-height: 0.96;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.score-display span {
  color: #9B7355;
  font-size: 12px;
  font-weight: 700;
}

.best-line {
  margin: 5px 0 0;
  color: #9B7355;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.best-line b { color: #5C3924; font-size: 12px; font-variant-numeric: tabular-nums; }

.over-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 13px 0 15px;
  flex-wrap: wrap;
}

.over-stats span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(126, 78, 43, 0.09);
  color: #8C654B;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.over-stats b { color: #3A2115; font-weight: 800; font-variant-numeric: tabular-nums; }

.btn-again { height: 54px; margin-top: 0; font-size: 17px; border-radius: 18px; }

.text-btn {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #9A7155;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  touch-action: manipulation;
}

.text-btn:active { background: rgba(126, 78, 43, 0.08); }

/* ---------- toast ---------- */
.toast {
  position: absolute;
  left: 50%;
  top: calc(var(--safe-top) + 104px);
  z-index: 20;
  transform: translate(-50%, -8px);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 176, 110, 0.34);
  background: rgba(11, 15, 35, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #FFD8AF;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- animation ---------- */
@keyframes shipFloat {
  0%, 100% { transform: translateY(0) rotate(-0.4deg); }
  50% { transform: translateY(-6px) rotate(0.5deg); }
}

@keyframes shipHit {
  0% { transform: translateX(0) translateY(0); }
  18% { transform: translateX(-7px) translateY(2px); }
  38% { transform: translateX(6px) translateY(-2px); }
  58% { transform: translateX(-4px); }
  78% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0) rotate(-0.5deg); }
  50% { transform: translateY(-8px) rotate(0.4deg); }
}

@keyframes orbitSpin {
  from { transform: rotate(-16deg); }
  to { transform: rotate(344deg); }
}

@keyframes beacon {
  0%, 100% { opacity: 0.5; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes dangerPulse {
  0%, 100% { box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(239, 60, 42, 0.3); }
  50% { box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), 0 0 0 5px rgba(239, 60, 42, 0); }
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.72); }
  18% { opacity: 1; transform: translate(-50%, -58%) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -145%) scale(0.96); }
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cardIn {
  0% { opacity: 0; transform: translateY(24px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- responsive ---------- */
@media (max-height: 730px) {
  .hero-stage { min-height: 132px; max-height: 194px; }
  .title-block h1 { font-size: clamp(38px, 11.6vw, 50px); }
  .tagline { margin-top: 5px; font-size: 11px; }
  .mission-card { margin-top: 11px; padding: 11px 13px 10px; }
  .mission-card p { margin-top: 7px; font-size: 10.5px; line-height: 1.5; }
  .mission-stats { margin-top: 7px; padding-top: 7px; }
  .mission-stats b { font-size: 18px; }
  .btn-primary { height: 54px; margin-top: 11px; font-size: 17px; }
  .start-foot { margin-top: 9px; }
  .over-card { padding: 17px 17px 12px; }
  .score-display b { font-size: 46px; }
}

@media (max-height: 640px) {
  .hero-stage { min-height: 112px; max-height: 150px; }
  .brand-tag { padding: 5px 9px; font-size: 8px; }
  .title-block h1 { font-size: 36px; }
  .eyebrow { font-size: 9px; margin-bottom: 3px; }
  .tagline { font-size: 10px; }
  .mission-card p { display: none; }
  .mission-stats { margin-top: 6px; padding-top: 6px; border-top: 0; }
  .mission-stats b { font-size: 16px; }
  .start-foot { margin-top: 7px; }
  .over-card h2 { font-size: 25px; }
  .score-display b { font-size: 40px; }
  .over-stats { margin: 10px 0 12px; }
  .btn-again { height: 48px; }
}

@media (min-width: 560px) {
  .start-safe { max-width: 470px; }
  .mission-card { padding: 15px 17px 14px; }
  .mission-card p { font-size: 12.5px; }
}

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