/* Launch-day overlay: isolated so it can be removed after launch. */
body.launch-lock {
  overflow: hidden;
}

.launch-overlay {
  --launch-cream: #fff8e8;
  --launch-gold: #f4b942;
  --launch-red: #b72f2a;
  --launch-red-dark: #751b19;
  --launch-navy: #172f40;
  position: fixed;
  inset: 0;
  z-index: 10000;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  color: var(--launch-cream);
  background:
    radial-gradient(circle at 50% 42%, rgba(244, 185, 66, .25), transparent 32%),
    radial-gradient(circle at 8% 86%, rgba(102, 80, 122, .5), transparent 29%),
    linear-gradient(145deg, #102d3e, #171a2d 55%, #40203b);
  font-family: Arial, Helvetica, sans-serif;
  isolation: isolate;
}

.launch-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .32;
  background-image: radial-gradient(circle, #fff 0 1px, transparent 1.7px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, #000, transparent 92%);
}

.launch-overlay.is-leaving {
  animation: launch-fade-out .85s ease forwards;
  pointer-events: none;
}

.launch-topbar {
  position: absolute;
  z-index: 8;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.launch-control {
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 999px;
  color: #fff;
  background: rgba(10, 24, 35, .72);
  font: inherit;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .06em;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.launch-control:hover { background: rgba(255,255,255,.16); }
.launch-control:focus-visible,
.launch-button:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 4px;
}

.launch-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(300px, 1.18fr) minmax(180px, 1fr);
  align-items: center;
  gap: clamp(16px, 3vw, 46px);
  width: min(1400px, 100%);
  min-height: 100%;
  margin: auto;
  padding: max(78px, calc(env(safe-area-inset-top) + 68px)) clamp(18px, 4vw, 64px) max(24px, env(safe-area-inset-bottom));
}

.launch-character {
  position: relative;
  margin: 0;
  height: min(69vh, 690px);
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 28px 65px rgba(0,0,0,.42), 0 0 42px rgba(244,185,66,.15);
  transform: rotate(var(--tilt));
  transition: filter .4s ease;
}

.launch-character--left { --tilt: -2deg; }
.launch-character--right { --tilt: 2deg; }
.launch-character img { width: 100%; height: 100%; object-fit: cover; }
.launch-character--left img { object-position: center 73%; }
.launch-character--right img { object-position: center 67%; }
.launch-character::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,16,25,.18), transparent 28%, transparent 75%, rgba(10,16,25,.35));
  pointer-events: none;
}

.launch-center { position: relative; z-index: 4; text-align: center; }
.launch-kicker {
  margin: 0 0 12px;
  color: #ffd979;
  font-size: clamp(.75rem, 1.3vw, 1rem);
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.launch-title {
  max-width: 720px;
  margin: 0 auto 12px;
  color: #fff;
  font-size: clamp(2rem, 4.8vw, 4.9rem);
  line-height: .96;
  text-wrap: balance;
  text-shadow: 0 5px 0 rgba(0,0,0,.16), 0 0 28px rgba(244,185,66,.2);
}
.launch-subtitle { margin: 0 0 clamp(20px, 4vh, 38px); color: #f6e8c8; font-size: clamp(1rem, 1.8vw, 1.3rem); }
.launch-button {
  position: relative;
  width: min(100%, 520px);
  min-height: clamp(98px, 15vh, 142px);
  padding: 20px clamp(22px, 4vw, 48px);
  border: 5px solid #ffdf95;
  border-radius: 34px;
  color: #fff;
  background: linear-gradient(#dc4840, var(--launch-red));
  box-shadow: 0 12px 0 var(--launch-red-dark), 0 22px 38px rgba(0,0,0,.45), inset 0 3px 0 rgba(255,255,255,.35);
  font: inherit;
  font-size: clamp(1.15rem, 2.3vw, 2rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: .02em;
  cursor: pointer;
  text-shadow: 0 2px 0 rgba(0,0,0,.25);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.launch-button:hover { transform: translateY(-4px) scale(1.015); filter: brightness(1.08); box-shadow: 0 16px 0 var(--launch-red-dark), 0 28px 45px rgba(0,0,0,.48), inset 0 3px 0 rgba(255,255,255,.35); }
.launch-button:active,
.launch-button.is-pressed { transform: translateY(9px) scale(.985); box-shadow: 0 3px 0 var(--launch-red-dark), 0 10px 18px rgba(0,0,0,.4), inset 0 3px 8px rgba(0,0,0,.18); }
.launch-button[disabled] { cursor: default; }

.launch-overlay.is-counting .launch-scene-copy,
.launch-overlay.is-counting .launch-button { opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.launch-overlay.is-counting .launch-character { filter: brightness(.62) blur(1px); animation: launch-cheer .72s ease-in-out infinite alternate; }
.launch-countdown,
.launch-announcement {
  position: absolute;
  z-index: 6;
  inset: 50% auto auto 50%;
  width: min(92vw, 850px);
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.launch-number {
  display: block;
  color: #fff;
  font-size: clamp(9rem, 28vw, 22rem);
  font-weight: 900;
  line-height: .8;
  text-shadow: 0 0 28px var(--launch-gold), 0 8px 0 rgba(0,0,0,.2);
  animation: launch-count 1s cubic-bezier(.2,.78,.25,1) both;
}
.launch-announcement { display: none; color: #fff; font-size: clamp(2.2rem, 6vw, 6rem); font-weight: 900; line-height: .98; text-wrap: balance; text-shadow: 0 0 35px #f8bc47, 0 5px 0 rgba(0,0,0,.2); }
.launch-overlay.is-celebrating .launch-announcement { display: block; animation: launch-reveal .7s cubic-bezier(.2,.8,.2,1) both; }
.launch-overlay.is-celebrating .launch-character { filter: brightness(1.12); animation: launch-cheer .45s ease-in-out infinite alternate; }
.launch-overlay.is-celebrating::after { content: ""; position: absolute; inset: 0; z-index: 5; background: #fff; pointer-events: none; animation: launch-flash .75s ease-out forwards; }
.launch-effects { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; pointer-events: none; }

@keyframes launch-count { 0% { opacity: 0; transform: scale(.55); } 30% { opacity: 1; transform: scale(1.08); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.2); } }
@keyframes launch-reveal { from { opacity: 0; transform: scale(.65); } to { opacity: 1; transform: scale(1); } }
@keyframes launch-cheer { from { transform: rotate(var(--tilt)) translateY(0); } to { transform: rotate(var(--tilt)) translateY(-10px); } }
@keyframes launch-flash { 0% { opacity: .85; } 100% { opacity: 0; } }
@keyframes launch-fade-out { to { opacity: 0; visibility: hidden; } }

@media (max-width: 820px) {
  .launch-stage { grid-template-columns: 1fr 1.2fr 1fr; gap: 9px; padding-inline: 10px; }
  .launch-character { height: min(55vh, 520px); border-radius: 18px; }
  .launch-center { align-self: center; }
  .launch-title { font-size: clamp(1.65rem, 6vw, 3rem); }
  .launch-button { min-height: 104px; border-radius: 26px; }
}

@media (max-width: 600px) {
  .launch-stage { grid-template: minmax(120px, 27vh) auto minmax(110px, 25vh) / 1fr; gap: 8px; padding: max(68px, calc(env(safe-area-inset-top) + 58px)) 14px max(10px, env(safe-area-inset-bottom)); }
  .launch-character { width: min(76vw, 350px); height: 100%; margin: auto; border-width: 2px; }
  .launch-character--left { transform: rotate(-1deg); }
  .launch-character--right { transform: rotate(1deg); }
  .launch-character--left img { object-position: center 74%; }
  .launch-character--right img { object-position: center 70%; }
  .launch-center { grid-row: 2; }
  .launch-kicker { display: none; }
  .launch-title { margin-bottom: 5px; font-size: clamp(1.45rem, 7vw, 2.3rem); }
  .launch-subtitle { margin-bottom: 12px; font-size: 1rem; }
  .launch-button { width: min(92vw, 410px); min-height: 88px; padding: 14px 20px; border-width: 4px; border-radius: 22px; font-size: clamp(1rem, 4.8vw, 1.35rem); box-shadow: 0 8px 0 var(--launch-red-dark), 0 15px 24px rgba(0,0,0,.42), inset 0 3px 0 rgba(255,255,255,.35); }
  .launch-control { padding: 8px 12px; font-size: .72rem; }
  .launch-announcement { font-size: clamp(2rem, 11vw, 4rem); }
}

@media (prefers-reduced-motion: reduce) {
  .launch-overlay *, .launch-overlay *::before, .launch-overlay *::after { scroll-behavior: auto !important; }
  .launch-character, .launch-overlay.is-counting .launch-character, .launch-overlay.is-celebrating .launch-character { animation: none; }
  .launch-number { animation-name: launch-count-calm; }
  .launch-overlay.is-celebrating::after { display: none; }
  @keyframes launch-count-calm { 0%, 100% { opacity: 0; } 15%, 85% { opacity: 1; } }
}
