:root {
  --wash-deep: #0f3d36;
  --wash-mid: #1a6b5c;
  --wash-bright: #2ec4a5;
  --wash-foam: #e8f7f2;
  --wash-mist: #b8e4d6;
  --ink: #14352f;
  --map-ground: #d5ebe2;
  --map-road: #f4faf7;
  --you: #1f7aef;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

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

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

body {
  font-family: "Figtree", sans-serif;
  color: var(--ink);
  background: var(--wash-deep);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.screen[hidden] {
  display: none !important;
}

/* ——— Summon ——— */

.screen--summon {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.25rem;
  isolation: isolate;
  padding:
    max(1rem, var(--safe-top))
    max(1rem, var(--safe-right))
    max(1rem, var(--safe-bottom))
    max(1rem, var(--safe-left));
}

.summon__atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 35%, rgba(46, 196, 165, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 20% 80%, rgba(184, 228, 214, 0.2), transparent 50%),
    radial-gradient(ellipse 60% 45% at 85% 70%, rgba(15, 61, 54, 0.5), transparent 45%),
    linear-gradient(165deg, #145a4d 0%, #0f3d36 42%, #0a2e29 100%);
  animation: mist-drift 14s ease-in-out infinite alternate;
}

.summon__atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 28%, rgba(255, 255, 255, 0.12) 0 1.5px, transparent 2px),
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.1) 0 2px, transparent 3px),
    radial-gradient(circle at 44% 62%, rgba(255, 255, 255, 0.08) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 55%, rgba(255, 255, 255, 0.11) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 30% 78%, rgba(255, 255, 255, 0.09) 0 2px, transparent 3px);
  opacity: 0.7;
  animation: bubble-float 18s linear infinite;
}

@keyframes mist-drift {
  from {
    filter: hue-rotate(0deg) brightness(1);
  }
  to {
    filter: hue-rotate(8deg) brightness(1.06);
  }
}

@keyframes bubble-float {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-28px);
  }
}

.come-btn {
  position: relative;
  z-index: 1;
  width: min(72vmin, 340px);
  max-width: calc(100vw - 2.5rem);
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  animation: btn-breathe 3.2s ease-in-out infinite;
  transition: transform 0.15s var(--ease-soft);
}

.come-btn:focus-visible {
  outline: 3px solid rgba(232, 247, 242, 0.85);
  outline-offset: 10px;
}

.come-btn:active,
.come-btn.is-pressed {
  transform: scale(0.94);
  animation: none;
}

.come-btn__rim {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.55), transparent 28%),
    linear-gradient(160deg, #7ae0c8 0%, #1f8f78 38%, #0d4a40 72%, #146b5c 100%);
  box-shadow:
    0 28px 50px rgba(0, 0, 0, 0.45),
    0 10px 18px rgba(0, 0, 0, 0.28),
    inset 0 2px 1px rgba(255, 255, 255, 0.45),
    inset 0 -8px 16px rgba(0, 0, 0, 0.35);
}

.come-btn__face {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.08) 28%, transparent 48%),
    radial-gradient(circle at 70% 78%, rgba(0, 0, 0, 0.22), transparent 42%),
    linear-gradient(180deg, #3dd4b0 0%, #1fa98c 42%, #178a72 78%, #127561 100%);
  box-shadow:
    inset 0 10px 22px rgba(255, 255, 255, 0.28),
    inset 0 -16px 28px rgba(8, 48, 42, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: box-shadow 0.15s var(--ease-soft), transform 0.15s var(--ease-soft);
}

.come-btn:active .come-btn__face,
.come-btn.is-pressed .come-btn__face {
  box-shadow:
    inset 0 14px 28px rgba(8, 48, 42, 0.4),
    inset 0 -6px 12px rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: translateY(2px);
}

.come-btn__sheen {
  position: absolute;
  inset: 10% 14% auto;
  height: 28%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  filter: blur(1px);
  pointer-events: none;
  z-index: 2;
  opacity: 0.85;
}

.come-btn__label {
  position: relative;
  z-index: 1;
  max-width: 72%;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(1.25rem, 5.5vmin, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-align: center;
  color: #f4fffb;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25),
    0 2px 4px rgba(8, 40, 35, 0.35),
    0 8px 18px rgba(8, 40, 35, 0.25);
}

.try-crash-btn {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(232, 247, 242, 0.35);
  border-radius: 999px;
  padding: 0.65rem 1.15rem;
  background: rgba(8, 32, 28, 0.45);
  color: rgba(232, 247, 242, 0.92);
  font-family: "Figtree", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.try-crash-btn:focus-visible {
  outline: 2px solid rgba(232, 196, 90, 0.75);
  outline-offset: 3px;
}

.try-crash-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

@keyframes btn-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.025);
  }
}

/* ——— Map ——— */

.screen--map {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, #c8e8dc, transparent 55%),
    linear-gradient(180deg, #eaf6f1 0%, #c5dfd4 100%);
  padding: 0;
  animation: map-in 0.55s var(--ease-out) both;
}

@keyframes map-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.map-frame {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--map-ground);
}

.status {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 10;
  width: min(90vw, 22rem);
  max-width: calc(100% - 2rem);
  margin: 0;
  padding: 0 0.5rem;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(1.35rem, 6.2vmin, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--wash-deep);
  text-shadow:
    0 0 24px rgba(234, 246, 241, 0.95),
    0 0 48px rgba(234, 246, 241, 0.85),
    0 1px 0 rgba(255, 255, 255, 0.7);
  pointer-events: none;
}

.status.is-arrived {
  animation: map-in 0.4s var(--ease-out) both;
}

.map-canvas {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.45), transparent 40%),
    linear-gradient(160deg, #dcefe7, #c2ddd2);
}

.map-grid,
.trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.trail {
  pointer-events: none;
  z-index: 1;
}

.you-pin {
  position: absolute;
  left: 74%;
  top: 66%;
  z-index: 3;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
}

.you-pin__pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(32px, 6vmin, 42px);
  height: clamp(32px, 6vmin, 42px);
  margin: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(31, 122, 239, 0.22);
  animation: pulse 2s var(--ease-soft) infinite;
}

.you-pin__dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(12px, 2.4vmin, 16px);
  height: clamp(12px, 2.4vmin, 16px);
  margin: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7eb6ff, var(--you) 55%, #0d4fa8);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.95);
}

.you-pin__label {
  position: absolute;
  left: 50%;
  top: calc(50% + clamp(14px, 2.8vmin, 18px));
  transform: translateX(-50%);
  font-size: clamp(0.65rem, 1.8vmin, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--wash-deep);
  white-space: nowrap;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.75);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.85);
    opacity: 0;
  }
}

.danny {
  --danny-size: clamp(48px, 9vmin, 72px);
  position: absolute;
  left: 22%;
  top: 88%;
  z-index: 4;
  width: var(--danny-size);
  height: var(--danny-size);
  margin: 0;
  transform: translate(-50%, -50%);
  will-change: left, top;
}

.danny__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  border-radius: 50%;
  display: block;
  box-shadow:
    0 0 0 3px #fff,
    0 8px 20px rgba(15, 61, 54, 0.28);
  user-select: none;
  pointer-events: none;
}

.danny__ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(46, 196, 165, 0.55);
  opacity: 0;
  pointer-events: none;
}

.danny.is-moving .danny__photo {
  animation: danny-bob 0.7s ease-in-out infinite;
}

.danny.is-arrived .danny__photo {
  animation: arrive-pop 0.55s var(--ease-out) both;
}

.danny.is-arrived .danny__ring {
  animation: ring-burst 0.7s var(--ease-out) both;
}

@keyframes danny-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes arrive-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1.08);
  }
}

@keyframes ring-burst {
  0% {
    opacity: 0.9;
    transform: scale(0.85);
  }
  100% {
    opacity: 0;
    transform: scale(1.55);
  }
}

/* ——— Door ——— */

.screen--door.is-left {
  background: #000;
}

.screen--door.is-left .door-scene {
  display: none;
}

.danny-left {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  margin: 0;
  padding: 0 1rem;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(1.85rem, 7vmin, 2.75rem);
  letter-spacing: -0.03em;
  color: #f4ebe3;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 1;
  animation: map-in 0.4s var(--ease-out) both;
}

.danny-left.is-fading {
  animation: danny-left-fade 4.5s linear forwards;
}

@keyframes danny-left-fade {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%);
  }
}

.danny-left[hidden] {
  display: none;
}

.door-scene {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.door-behind {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 45%, #2a211c, transparent 70%),
    #0c0a08;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.door-danny-zoom {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  will-change: transform;
}

.door-danny {
  position: absolute;
  display: block;
  max-width: none;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.screen--door.is-open.is-rethink .door-danny {
  pointer-events: auto;
  cursor: pointer;
}

.screen--door.is-open .door-danny-zoom {
  animation: face-zoom 1.4s var(--ease-out) 0.35s both;
}

.door-wave {
  position: absolute;
  left: clamp(6%, 12vw, 18%);
  right: auto;
  bottom: clamp(18%, 22vh, 28%);
  z-index: 1;
  width: clamp(6.5rem, 24vmin, 11rem);
  height: auto;
  transform-origin: 30% 90%;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  user-select: none;
  opacity: 0;
}

.door-wave.is-waving {
  opacity: 1;
  animation: door-wave 0.22s ease-in-out infinite alternate;
}

.door-wave[hidden] {
  display: none;
}

@keyframes door-wave {
  from {
    transform: rotate(-28deg) scale(1);
  }
  to {
    transform: rotate(32deg) scale(1.06);
  }
}

@keyframes face-zoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.55);
  }
}

.door-panel {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  transform-origin: left center;
  transform-style: preserve-3d;
  -webkit-tap-highlight-color: transparent;
  transition: transform 1.15s cubic-bezier(0.65, 0.05, 0.2, 1);
  z-index: 2;
}

.door-panel:focus-visible {
  outline: 3px solid rgba(232, 196, 90, 0.7);
  outline-offset: -10px;
}

.screen--door.is-open .door-panel {
  transform: rotateY(-105deg);
  pointer-events: none;
}

.door-panel__wood {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0%, transparent 8%, transparent 92%, rgba(0, 0, 0, 0.2) 100%),
    linear-gradient(180deg, #6b4428 0%, #5a3820 18%, #4a2e1a 52%, #3d2616 78%, #2f1c10 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 170, 0.08),
    inset 8px 0 24px rgba(0, 0, 0, 0.35);
}

.door-panel__wood::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background:
    repeating-linear-gradient(
      92deg,
      transparent 0 11px,
      rgba(0, 0, 0, 0.08) 11px 12px,
      transparent 12px 23px,
      rgba(255, 220, 170, 0.04) 23px 24px
    );
}

.door-panel__panels {
  position: absolute;
  inset: 6% 10%;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 5%;
  pointer-events: none;
}

.door-panel__panels::before,
.door-panel__panels::after {
  content: "";
  border: clamp(2px, 0.4vmin, 3px) solid rgba(30, 18, 10, 0.55);
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 clamp(6px, 1.2vmin, 8px) rgba(90, 56, 32, 0.65),
    inset 0 0 0 clamp(8px, 1.5vmin, 10px) rgba(20, 12, 6, 0.4),
    inset 0 12px 28px rgba(0, 0, 0, 0.25),
    0 1px 0 rgba(255, 220, 170, 0.08);
  background: linear-gradient(160deg, rgba(255, 220, 170, 0.06), transparent 40%, rgba(0, 0, 0, 0.15));
}

.door-panel__handle {
  position: absolute;
  right: clamp(8%, 11vw, 14%);
  top: 50%;
  width: clamp(14px, 2.6vmin, 20px);
  height: clamp(14px, 2.6vmin, 20px);
  margin-top: 0;
  transform: translateY(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #f0d78a, #c9a227 55%, #8a6a12);
  box-shadow:
    0 0 0 3px #3d2616,
    0 4px 10px rgba(0, 0, 0, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.door-panel__handle::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  width: clamp(16px, 3vmin, 24px);
  height: clamp(4px, 0.9vmin, 6px);
  margin-top: 0;
  margin-right: -2px;
  transform: translateY(-50%);
  border-radius: 3px;
  background: linear-gradient(180deg, #d4b04a, #9a7818);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.door-hello {
  position: absolute;
  left: 50%;
  top: 38%;
  z-index: 3;
  margin: 0;
  padding: 0 0.15em;
  --hello-rot: 0deg;
  transform: translate(-50%, -40%) scale(0.55) rotate(var(--hello-rot));
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 11vmin, 4.25rem);
  letter-spacing: -0.04em;
  line-height: 1;
  color: #fff6e8;
  text-shadow:
    0 2px 0 rgba(60, 32, 12, 0.35),
    0 10px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  user-select: none;
  visibility: hidden;
}

.door-hello.is-on {
  visibility: visible;
  animation: door-hello-pop 1.15s var(--ease-out) both;
}

.screen--door.is-open .door-hello,
.screen--door.is-left .door-hello {
  display: none;
}

@keyframes door-hello-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.45) rotate(var(--hello-rot));
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -48%) scale(1.12) rotate(var(--hello-rot));
  }
  34% {
    transform: translate(-50%, -42%) scale(0.96) rotate(var(--hello-rot));
  }
  48% {
    transform: translate(-50%, -44%) scale(1.04) rotate(var(--hello-rot));
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -44%) scale(1) rotate(var(--hello-rot));
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -58%) scale(1.08) rotate(var(--hello-rot));
  }
}

/* ——— Wash ——— */

.screen--wash {
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, #2a4a42, transparent 65%),
    linear-gradient(165deg, #163832 0%, #0c2420 100%);
  animation: map-in 0.5s var(--ease-out) both;
  padding:
    max(1rem, var(--safe-top))
    max(1rem, var(--safe-right))
    max(1rem, var(--safe-bottom))
    max(1rem, var(--safe-left));
}

.wash-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.85rem, 2.5vmin, 1.25rem);
  width: min(100%, 28rem);
}

.wash-gif {
  width: min(70vmin, 360px, 100%);
  height: auto;
  max-height: min(62vh, 62dvh);
  object-fit: contain;
  image-rendering: auto;
  border-radius: 1rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.wash-gif:focus-visible {
  outline: 3px solid rgba(232, 196, 90, 0.7);
  outline-offset: 4px;
}

.wash-caption {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(1.15rem, 4.5vmin, 1.85rem);
  letter-spacing: -0.02em;
  color: var(--wash-foam);
  text-align: center;
}

/* ——— Died ——— */

.screen--died {
  background: #000;
  overflow: hidden;
  padding: 0;
}

.screen--died.is-in .died-crash-line {
  opacity: 0;
}

.screen--died.is-in .died-face-wrap {
  opacity: 1;
}

.screen--died.is-in .died-bottom {
  opacity: 1;
  transform: translateY(0);
}

.died-crash-line {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 1.5rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(1.55rem, 6.5vmin, 2.35rem);
  letter-spacing: -0.03em;
  color: #f2f2f2;
  text-align: center;
  background: #000;
  opacity: 1;
  transition: opacity 0.7s var(--ease-out);
  pointer-events: none;
}

.died-face-wrap {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s var(--ease-out);
  background: #000;
}

.died-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  filter: grayscale(1) contrast(1.08) brightness(0.92);
  user-select: none;
  pointer-events: none;
}

.died-face-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, transparent 28%, transparent 48%, rgba(0, 0, 0, 0.72) 78%, rgba(0, 0, 0, 0.92) 100%);
  pointer-events: none;
}

.died-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding:
    1.5rem
    max(1.25rem, var(--safe-right))
    max(1.75rem, var(--safe-bottom))
    max(1.25rem, var(--safe-left));
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.9s var(--ease-out) 0.55s,
    transform 0.9s var(--ease-out) 0.55s;
  text-align: center;
}

.died-message {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(1.55rem, 6.5vmin, 2.35rem);
  letter-spacing: -0.03em;
  color: #f2f2f2;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.65);
}

.flowers-btn {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0.75rem 1.35rem;
  background: rgba(255, 255, 255, 0.1);
  color: #f7f7f7;
  font-family: "Figtree", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s var(--ease-soft), background 0.15s var(--ease-soft);
}

.flowers-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.flowers-btn:active {
  transform: scale(0.96);
}

.flowers-btn:focus-visible {
  outline: 2px solid rgba(232, 196, 90, 0.8);
  outline-offset: 3px;
}

.tip-flower {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-size: clamp(1.6rem, 7vmin, 2.5rem);
  line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  /* Fast near the button, eases out toward the top. */
  animation: tip-flower-fly 2.6s cubic-bezier(0.05, 0.7, 0.15, 1) forwards;
  will-change: transform, opacity;
}

@keyframes tip-flower-fly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7) rotate(var(--spin));
  }
  12% {
    opacity: 1;
    transform: translate(
        calc(-50% + (var(--drift) * 0.28)),
        calc(-50% - (var(--lift) * 0.22))
      )
      scale(1.06) rotate(var(--spin));
  }
  45% {
    opacity: 1;
    transform: translate(
        calc(-50% + (var(--drift) * 0.7)),
        calc(-50% - (var(--lift) * 0.62))
      )
      scale(1) rotate(var(--spin));
  }
  100% {
    opacity: 0;
    transform: translate(
        calc(-50% + var(--drift)),
        calc(-50% - var(--lift))
      )
      scale(0.94) rotate(var(--spin));
  }
}

/* ——— Bye ——— */

.screen--bye {
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 35%, #2a4a42, transparent 65%),
    linear-gradient(165deg, #163832 0%, #0c2420 100%);
  animation: map-in 0.5s var(--ease-out) both;
  padding:
    max(1rem, var(--safe-top))
    max(1rem, var(--safe-right))
    max(1rem, var(--safe-bottom))
    max(1rem, var(--safe-left));
}

.bye-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 3vmin, 1.5rem);
  width: min(100%, 28rem);
}

.bye-photo {
  width: min(72vmin, 320px, 100%);
  height: auto;
  max-height: min(48vh, 48dvh);
  object-fit: contain;
  border-radius: 1.25rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.bye-total {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(1.35rem, 5.5vmin, 2rem);
  letter-spacing: -0.03em;
  color: #f5d76e;
  text-align: center;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.bye-btn {
  width: min(58vmin, 260px);
}

/* ——— Rate ——— */

.screen--rate {
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, #2a4a42, transparent 65%),
    linear-gradient(165deg, #163832 0%, #0c2420 100%);
  animation: map-in 0.45s var(--ease-out) both;
  padding:
    max(1rem, var(--safe-top))
    max(1rem, var(--safe-right))
    max(1rem, var(--safe-bottom))
    max(1rem, var(--safe-left));
  overflow: hidden;
}

.screen--rate.is-celebrate {
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(245, 215, 110, 0.35), transparent 60%),
    linear-gradient(165deg, #1a4a3e 0%, #0c2420 100%);
}

.screen--rate.is-celebrate .rate-content {
  width: 100%;
  max-width: none;
  min-height: 100%;
}

.screen--rate.is-celebrate .rate-outcome {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  gap: 0;
}

.screen--rate.is-celebrate .rate-stars {
  position: fixed;
  inset: 0;
  display: block;
  margin: 0;
  pointer-events: none;
  z-index: 1;
}

.screen--rate.is-celebrate .rate-star.is-dancing {
  position: absolute;
  font-size: clamp(3.5rem, 16vmin, 7rem);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  will-change: transform;
}

.screen--rate.is-celebrate .rate-star.is-dancing:nth-child(1) {
  left: 6%;
  top: 8%;
  animation: rate-celebrate-star-1 0.28s ease-in-out infinite alternate;
}

.screen--rate.is-celebrate .rate-star.is-dancing:nth-child(2) {
  right: 5%;
  top: 14%;
  animation: rate-celebrate-star-2 0.34s ease-in-out infinite alternate;
}

.screen--rate.is-celebrate .rate-star.is-dancing:nth-child(3) {
  left: 42%;
  top: 34%;
  animation: rate-celebrate-star-3 0.3s ease-in-out infinite alternate;
}

.screen--rate.is-celebrate .rate-star.is-dancing:nth-child(4) {
  left: 10%;
  bottom: 18%;
  animation: rate-celebrate-star-4 0.26s ease-in-out infinite alternate;
}

.screen--rate.is-celebrate .rate-star.is-dancing:nth-child(5) {
  right: 8%;
  bottom: 22%;
  animation: rate-celebrate-star-5 0.32s ease-in-out infinite alternate;
}

.screen--rate.is-celebrate .rate-thanks {
  position: absolute;
  bottom: clamp(1.75rem, 9vmin, 3.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  margin: 0;
  width: min(92%, 24rem);
}

.rate-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.85rem, 2.5vmin, 1.2rem);
  width: min(100%, 26rem);
  min-height: min(52vh, 22rem);
}

.rate-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.85rem, 2.5vmin, 1.2rem);
  width: 100%;
}

.rate-form[hidden],
.rate-outcome[hidden],
.rate-rejected[hidden],
.rate-thanks[hidden],
.rate-thanks__check[hidden] {
  display: none !important;
}

.rate-outcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.85rem, 2.5vmin, 1.2rem);
  width: 100%;
  text-align: center;
}

.rate-outcome .rate-stars {
  margin-bottom: 0.25rem;
}

.rate-title {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 6vmin, 2.25rem);
  letter-spacing: -0.03em;
  color: var(--wash-foam);
  text-align: center;
}

.rate-stars {
  display: flex;
  gap: clamp(0.35rem, 1.5vmin, 0.65rem);
}

.rate-star {
  border: 0;
  padding: 0.15rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.22);
  font-size: clamp(2.2rem, 9vmin, 3.25rem);
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s var(--ease-soft), transform 0.12s var(--ease-soft);
  -webkit-tap-highlight-color: transparent;
}

.rate-star.is-on,
.rate-star.is-preview {
  color: #f5d76e;
  text-shadow: 0 0 18px rgba(245, 215, 110, 0.55);
}

.rate-star.is-dancing {
  color: #f5d76e;
  text-shadow: 0 0 22px rgba(245, 215, 110, 0.75);
}

.rate-star:active {
  transform: scale(0.92);
}

.rate-comment-label {
  align-self: stretch;
  font-family: "Figtree", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: rgba(232, 247, 242, 0.7);
}

.rate-comment {
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid rgba(232, 247, 242, 0.22);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  background: rgba(8, 32, 28, 0.55);
  color: var(--wash-foam);
  font-family: "Figtree", sans-serif;
  font-size: 1rem;
  line-height: 1.4;
  resize: vertical;
  min-height: 5.5rem;
}

.rate-comment:focus-visible {
  outline: 2px solid rgba(232, 196, 90, 0.7);
  outline-offset: 2px;
}

.rate-submit {
  margin-top: 0.25rem;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.75rem;
  background: linear-gradient(165deg, #f0d078 0%, #c9a227 45%, #8a6a12 100%);
  color: #2a1c08;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
}

.rate-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.rate-submit:not(:disabled):active {
  transform: scale(0.97);
}

.rate-rejected {
  margin: 0.5rem 0 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(1.75rem, 7vmin, 2.5rem);
  letter-spacing: -0.03em;
  color: #f07167;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  animation: map-in 0.35s var(--ease-out) both;
}

.rate-thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin: 0.35rem 0 0;
  animation: map-in 0.35s var(--ease-out) both;
}

.rate-thanks__check {
  display: grid;
  place-items: center;
  width: clamp(3.25rem, 12vmin, 4.25rem);
  height: clamp(3.25rem, 12vmin, 4.25rem);
  border-radius: 50%;
  background: linear-gradient(165deg, #3dd6a5 0%, #1a9a72 100%);
  color: #f4fffa;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(1.75rem, 7vmin, 2.35rem);
  line-height: 1;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.rate-thanks__text {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(1.25rem, 5vmin, 1.75rem);
  letter-spacing: -0.03em;
  color: var(--wash-foam);
  text-align: center;
}

.rate-burst {
  display: none;
}

@keyframes rate-celebrate-star-1 {
  from {
    transform: scale(0.08);
    opacity: 0.55;
  }
  to {
    transform: scale(4.2);
    opacity: 1;
  }
}

@keyframes rate-celebrate-star-2 {
  from {
    transform: scale(3.6);
    opacity: 1;
  }
  to {
    transform: scale(0.1);
    opacity: 0.5;
  }
}

@keyframes rate-celebrate-star-3 {
  from {
    transform: scale(0.12) translate(-8%, -6%);
    opacity: 0.6;
  }
  to {
    transform: scale(3.8) translate(6%, 8%);
    opacity: 1;
  }
}

@keyframes rate-celebrate-star-4 {
  from {
    transform: scale(3.2) translate(5%, 0);
    opacity: 1;
  }
  to {
    transform: scale(0.09) translate(-4%, -10%);
    opacity: 0.55;
  }
}

@keyframes rate-celebrate-star-5 {
  from {
    transform: scale(0.11);
    opacity: 0.5;
  }
  to {
    transform: scale(4);
    opacity: 1;
  }
}

.tip-btn {
  position: relative;
  z-index: 2;
  width: min(72vw, 220px);
  height: clamp(52px, 10vmin, 64px);
  border: 0;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s var(--ease-soft);
}

.tip-btn:focus-visible {
  outline: 3px solid rgba(232, 247, 242, 0.75);
  outline-offset: 6px;
}

.tip-btn:active,
.tip-btn.is-pressed {
  transform: scale(0.96);
}

.tip-btn__rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.55), transparent 35%),
    linear-gradient(165deg, #f0d078 0%, #c9a227 35%, #8a6a12 70%, #b8922a 100%);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.4),
    0 4px 10px rgba(0, 0, 0, 0.28),
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -6px 12px rgba(0, 0, 0, 0.35);
}

.tip-btn__face {
  position: absolute;
  inset: 5px 6px;
  border-radius: inherit;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.1) 28%, transparent 48%),
    radial-gradient(circle at 70% 80%, rgba(0, 0, 0, 0.2), transparent 45%),
    linear-gradient(180deg, #f5d76e 0%, #e0b83a 40%, #c9a227 78%, #b8921f 100%);
  box-shadow:
    inset 0 6px 14px rgba(255, 255, 255, 0.28),
    inset 0 -10px 18px rgba(90, 60, 8, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: box-shadow 0.12s var(--ease-soft), transform 0.12s var(--ease-soft);
}

.tip-btn:active .tip-btn__face,
.tip-btn.is-pressed .tip-btn__face {
  box-shadow:
    inset 0 10px 18px rgba(90, 60, 8, 0.35),
    inset 0 -4px 8px rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: translateY(1px);
}

.tip-btn__sheen {
  position: absolute;
  inset: 8px 14px auto;
  height: 38%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  pointer-events: none;
  opacity: 0.8;
}

.tip-btn__label {
  position: relative;
  z-index: 1;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(0.95rem, 3.4vmin, 1.15rem);
  letter-spacing: -0.02em;
  color: #3d2a05;
  text-shadow:
    0 1px 0 rgba(255, 235, 170, 0.55),
    0 1px 2px rgba(90, 60, 8, 0.2);
}

.tip-total {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(0.95rem, 3.4vmin, 1.2rem);
  letter-spacing: -0.02em;
  color: rgba(232, 247, 242, 0.85);
  text-align: center;
}

.tip-total.is-bump {
  animation: tip-total-bump 0.35s var(--ease-out);
}

@keyframes tip-total-bump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.12);
    color: #f5d76e;
  }
  100% {
    transform: scale(1);
  }
}

.tip-bursts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 20;
}

.tip-cent {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(1.85rem, 8vmin, 2.85rem);
  letter-spacing: -0.03em;
  color: #ffe566;
  -webkit-text-stroke: 1px rgba(90, 60, 8, 0.35);
  text-shadow:
    0 0 12px rgba(255, 229, 102, 0.95),
    0 0 28px rgba(245, 215, 110, 0.75),
    0 2px 0 rgba(255, 245, 200, 0.85),
    0 8px 20px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  animation: tip-cent-fly 1.15s var(--ease-out) forwards;
  will-change: transform, opacity;
}

@keyframes tip-cent-fly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(-12deg);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, calc(-50% - 12px)) scale(1.35) rotate(6deg);
  }
  55% {
    opacity: 1;
    transform: translate(calc(-50% + var(--drift) * 0.35), calc(-50% - 70px)) scale(1) rotate(var(--spin));
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift)), calc(-50% - 140px)) scale(0.85) rotate(var(--spin));
  }
}

.tip-heart {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-size: clamp(1.6rem, 7vmin, 2.5rem);
  line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  animation: tip-cent-fly 1.15s var(--ease-out) forwards;
  will-change: transform, opacity;
}

@media (orientation: landscape) and (max-height: 500px) {
  .come-btn {
    width: min(68vmin, 260px);
  }

  .wash-gif {
    max-height: min(58vh, 58dvh);
  }

  .wash-content {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .summon__atmosphere,
  .summon__atmosphere::before,
  .come-btn,
  .you-pin__pulse,
  .danny.is-moving .danny__photo {
    animation: none;
  }

  .screen--map,
  .status.is-arrived,
  .danny.is-arrived .danny__photo,
  .danny.is-arrived .danny__ring,
  .screen--wash,
  .screen--bye,
  .screen--rate,
  .screen--died .died-face-wrap,
  .screen--died .died-bottom,
  .danny-left {
    animation: none;
  }

  .screen--died .died-face-wrap,
  .screen--died .died-bottom {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .screen--died .died-crash-line {
    display: none;
  }

  .danny-left.is-fading {
    animation: none;
    opacity: 0;
  }

  .door-hello.is-on {
    animation: none;
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -44%) scale(1) rotate(var(--hello-rot));
  }

  .door-panel {
    transition: none;
  }

  .screen--door.is-open .door-danny-zoom {
    animation: none;
    transform: scale(1.35);
  }

  .door-wave.is-waving {
    animation: none;
    opacity: 1;
    transform: rotate(8deg);
  }

  .rate-star.is-dancing {
    animation: none !important;
    transform: none;
    opacity: 1;
  }

  .screen--rate.is-celebrate .rate-stars {
    position: static;
    display: flex;
    gap: 0.5rem;
  }

  .screen--rate.is-celebrate .rate-star.is-dancing {
    position: static;
    font-size: clamp(2.2rem, 9vmin, 3.25rem);
  }

  .screen--rate.is-celebrate .rate-outcome {
    position: static;
    height: auto;
  }

  .screen--rate.is-celebrate .rate-thanks {
    position: static;
    transform: none;
    width: 100%;
  }

  .screen--door.is-open .door-panel {
    transform: rotateY(-90deg);
  }

  .tip-cent,
  .tip-heart,
  .tip-flower {
    animation: none;
    opacity: 1;
  }

  .tip-total.is-bump {
    animation: none;
  }
}
