:root {
  color-scheme: light;
  --vvh: 100dvh;
  --bg: #edf2ff;
  --fg: #312783;
  --fg-soft: #3a4fa5;
  --muted: #5c6d92;
  --primary: #312783;
  --primary-bright: #3d82ff;
  --primary-grad: linear-gradient(130deg, #312783 0%, #2fb3ff 100%);
  --border: rgba(32, 64, 142, 0.12);
  --border-strong: rgba(32, 64, 142, 0.22);
  --shadow-soft: 0 26px 65px rgba(30, 63, 160, 0.14);
  --shadow-strong: 0 34px 80px rgba(19, 41, 110, 0.22);
  --glow: 0 0 0 1px rgba(86, 158, 255, 0.45);
}

@font-face {
  font-family: "Renai";
  src: url("./Renai_AR_190104_2-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Renai";
  src: url("./Renai_AR_190104_2-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Shelby";
  src: url("./shelby.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@keyframes blobDrift {
  0% {
    transform: translate3d(-20%, -16%, 0) rotate(-5deg);
  }
  25% {
    transform: translate3d(-30%, -32%, 0) rotate(37deg);
  }
  50% {
    transform: translate3d(-12%, -6%, 0) rotate(76deg);
  }
  75% {
    transform: translate3d(5%, -2%, 0) rotate(29deg);
  }
  100% {
    transform: translate3d(-20%, -16%, 0) rotate(-5deg);
  }
}

@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes stepContentEnter {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
  }
  50% {
    opacity: 1;
    transform: translateY(-4px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes stepContentLeave {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(0.98);
  }
}

@keyframes cityCardPulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.06);
  }
}

@keyframes heartbeatPulse {
  0% {
    font-variation-settings: "wght" 700;
  }
  15% {
    font-variation-settings: "wght" 900;
  }
  26% {
    font-variation-settings: "wght" 540;
  }
  40% {
    font-variation-settings: "wght" 820;
  }
  100% {
    font-variation-settings: "wght" 700;
  }
}

@keyframes stepFlowIn {
  0% {
    opacity: 0;
    transform: translate3d(28px, 18px, 0) scale(0.98);
  }
  60% {
    opacity: 1;
    transform: translate3d(-6px, 0, 0) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes stepFlowOut {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(-32px, -12px, 0) scale(0.98);
  }
}

@keyframes overlayFade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes overlayLineIn {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  60% {
    opacity: 1;
    transform: translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100dvh;
  background: var(--bg);
}

html {
  scroll-padding-top: calc(64px + env(safe-area-inset-top));
}

body {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--fg);
  background: #edf2ff;
  min-height: var(--vvh, 100dvh);
  height: var(--vvh, 100dvh);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 0;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  box-sizing: border-box;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto;
  width: 160vw;
  height: 160vw;
  background: radial-gradient(
      circle at 28% 28%,
      rgba(126, 222, 255, 1),
      transparent 19.33%
    ),
    radial-gradient(
      circle at 74% 40%,
      rgba(142, 66, 254, 1),
      transparent 15.55%
    ),
    radial-gradient(circle at 52% 72%, rgba(0, 68, 255, 1), transparent 18.91%);
  filter: blur(64px);
  -webkit-filter: blur(64px);
  opacity: 0.25;
  pointer-events: none;
  animation: blobDrift 25s cubic-bezier(0.6, 0.02, 0.35, 0.98) infinite
    alternate;
}

body.is-generating {
  overflow: hidden;
  overflow-y: auto;
}

.step-header {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: clamp(6px, 1.25vw, 12px);
  margin: 0 auto;
  padding: clamp(7px, 2vw, 13px) clamp(7px, 1.6vw, 12px);
  border-radius: clamp(9px, 1.6vw, 15px);
  background: #22186b;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 28px 70px rgba(19, 41, 110, 0.24);
  text-align: left;
}

.step-header::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--primary-grad);
  background-size: 220% 220%;
  animation: gradientFlow 10s ease-in-out infinite;
  z-index: -1;
}

.step-header__content {
  display: flex;
  flex-direction: column;
  gap: clamp(3px, 0.6vw, 7px);
  align-items: flex-start;
  max-width: min(100%, clamp(320px, 65vw, 820px));
}

.step-title {
  margin: 0;
  font-size: clamp(0.75rem, 1.5vw, 1.05rem);
  font-weight: 800;
  color: inherit;
  letter-spacing: 0.01em;
  white-space: nowrap;
  font-variation-settings: "wght" 760;
  display: inline-block;
  transform-origin: center;
  will-change: font-variation-settings;
  animation: heartbeatPulse 2.8s ease-in-out infinite;
  text-align: center;
}

.step-subtitle {
  margin: 0;
  font-size: clamp(1.25rem, 2.6vw, 1.85rem);
  font-weight: 700;
  color: var(--fg);
  text-align: left;
}

canvas[data-snow-canvas] {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 120;
}

main {
  position: relative;
  min-height: var(--vvh, 100dvh);
}

.app-shell {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 32px) clamp(16px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  gap: clamp(22px, 4vw, 38px);
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
}

.app-body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 48px);
  align-items: stretch;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
}

body:not([data-step="1"]) .app-body {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.steps[data-layout="compact"] {
  align-self: center;
}

.preview-column {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: clamp(420px, 70vh, 780px);
  gap: clamp(12px, 2vw, 18px);
  overflow: hidden;
}

.card-preview,
.city-slider {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 28px, 0) scale(0.98);
  filter: blur(6px);
  transition: opacity 0.55s cubic-bezier(0.25, 0.82, 0.25, 1),
    transform 0.55s cubic-bezier(0.25, 0.82, 0.25, 1),
    filter 0.55s cubic-bezier(0.25, 0.82, 0.25, 1), visibility 0s linear 0.55s;
  will-change: opacity, transform, filter;
}

.card-preview.is-visible,
.city-slider.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0px);
  transition: opacity 0.6s cubic-bezier(0.32, 0.88, 0.36, 1),
    transform 0.6s cubic-bezier(0.32, 0.88, 0.36, 1),
    filter 0.6s cubic-bezier(0.32, 0.88, 0.36, 1);
}

.card-preview {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: visible;
  min-height: 0;
}

.card-preview .canvas-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  height: 100%;
}

#cardCanvas {
  max-height: 100%;
  width: auto;
  max-width: 100%;
  aspect-ratio: 3 / 5;
  border-radius: clamp(22px, 3vw, 28px);
}

.content-column {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 4vw, 36px);
  min-height: 0;
}

.mobile-stage {
  display: none;
  width: 100%;
  align-items: stretch;
}

.mobile-stage > * {
  width: 100%;
}

.steps {
  flex: 1 1 auto;
  margin-top: 0;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  justify-content: flex-start;
  gap: clamp(24px, 4vh, 48px);
}

.step {
  position: relative;
  background: transparent;
  border: 0;
  margin: 0 auto;
  padding: 0;
  width: 100%;
  box-shadow: none;
  opacity: 0;
  transform: translateY(0);
  transition: none;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 28px);
  flex: 1 1 auto;
  min-height: 0;
  justify-content: flex-start;
}

.step.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.step.is-entering,
.step.is-leaving {
  z-index: auto;
  pointer-events: none;
}

.step[hidden] {
  display: none;
}

.step-lead {
  margin: 0;
  color: var(--fg-soft);
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  line-height: 1.6;
  text-align: left;
}

.step h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  color: var(--primary);
  letter-spacing: 0.015em;
  text-transform: none;
  text-align: left;
  font-weight: 800;
}

.step p {
  margin-bottom: 0;
  color: var(--fg-soft);
  line-height: 1.6;
  text-align: left;
}

.step strong {
  color: var(--primary);
}

.step__content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(16px, 3vw, 28px);
  justify-content: flex-start;
  will-change: transform, opacity;
  flex: 0 1 100%;
  min-height: 0;
  max-height: 100%;
}

.step__content > .step-nav {
  align-self: flex-start;
  width: auto;
}

.step__content > :not(.step-nav) {
  align-self: stretch;
}

.step[data-step="1"] .step__content > * {
  width: 100%;
}

.step[data-step="4"] .result-layout {
  width: min(100%, 960px);
  margin-inline: auto;
}

button,
.primary,
.secondary,
input,
textarea {
  font: inherit;
}

button,
.primary,
.secondary {
  cursor: pointer;
}

button.primary,
.primary {
  padding: 14px 32px;
  border-radius: 999px;
  border: 0;
  color: #fff;
  background: var(--primary-grad);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: 0.018em;
  box-shadow: 0 18px 34px rgba(30, 63, 160, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button.primary:hover,
.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 46px rgba(30, 63, 160, 0.26);
  filter: brightness(1.06);
}

button.primary.is-pressed,
.primary.is-pressed {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 10px 22px rgba(30, 63, 160, 0.22);
  filter: brightness(0.94);
  transition-duration: 0.12s;
}

button.primary:focus-visible,
.primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0), var(--glow);
}

button.secondary,
.secondary {
  padding: 12px 24px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96),
    rgba(242, 247, 255, 0.82)
  );
  border: 1px solid rgba(32, 64, 142, 0.18);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease;
}

button.secondary:hover,
.secondary:hover {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(255, 255, 255, 0.9)
  );
  border-color: rgba(61, 130, 255, 0.32);
  color: var(--primary);
  box-shadow: 0 18px 32px rgba(30, 63, 160, 0.14);
}

button.secondary.is-pressed,
.secondary.is-pressed {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 12px 24px rgba(30, 63, 160, 0.14);
  transition-duration: 0.12s;
}

button.secondary:focus-visible,
.secondary:focus-visible {
  outline: none;
  box-shadow: var(--glow);
}

.nav {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.step-nav {
  display: flex;
  justify-content: center;
  pointer-events: auto;
  transition: opacity 0.25s ease, transform 0.25s ease;
  flex: 0 0 auto;
  overflow: unset;
}
.step-nav__inner {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  position: relative;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.95),
    rgba(239, 245, 255, 0.82)
  );
  backdrop-filter: blur(24px);
  border-radius: 999px;
  padding: 12px;
  box-shadow: 0 18px 42px rgba(30, 63, 160, 0.18);
  border: 1px solid rgba(40, 82, 186, 0.16);
}

.step-nav__inner::before {
  content: "";
  position: absolute;
  inset: -60% -30%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(98, 147, 255, 0.35),
    rgba(98, 147, 255, 0) 55%
  );
  opacity: 0;
  transform: scale(0.75);
  filter: blur(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.step.is-entering .step-nav__inner::before {
  opacity: 1;
  transform: scale(1);
}
.step-nav .primary,
.step-nav .secondary {
  min-width: 120px;
  justify-content: center;
}
.step-nav.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.result-pills {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  width: 100%;
}

.result-pills .step-nav {
  width: 100%;
  justify-content: center;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
  justify-content: flex-start;
  overflow-x: unset;
}

textarea,
input {
  width: 100%;
  padding: 16px 20px;
  min-height: 56px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(40, 82, 186, 0.16);
  color: var(--fg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-size: 1rem;
  font-family: inherit;
}

textarea:focus,
input:focus {
  outline: none;
  border-color: rgba(47, 111, 235, 0.65);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--glow);
}

body.is-touch textarea:focus,
body.is-touch input:focus {
  border-color: rgba(47, 111, 235, 0.35);
  box-shadow: none;
}

textarea::placeholder,
input::placeholder {
  color: var(--muted);
}

.generate-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 40px);
  background: radial-gradient(
      120% 140% at 50% 40%,
      rgba(30, 52, 125, 0.32),
      rgba(15, 24, 64, 0.42)
    ),
    linear-gradient(180deg, rgba(11, 20, 54, 0.6), rgba(8, 15, 38, 0.55));
  backdrop-filter: blur(16px) saturate(1.05);
  z-index: 999;
  animation: overlayFade 0.32s ease forwards;
}

.generate-overlay[hidden] {
  display: none;
}

.generate-overlay__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 3vw, 24px);
  max-width: min(500px, 88vw);
  padding: clamp(34px, 6vw, 54px) clamp(28px, 5.6vw, 48px);
  border-radius: 32px;
  background: linear-gradient(
    150deg,
    rgba(255, 255, 255, 0.98),
    rgba(243, 248, 255, 0.92)
  );
  border: 1px solid rgba(121, 156, 255, 0.28);
  box-shadow: 0 40px 90px rgba(8, 14, 32, 0.6),
    0 0 0 1px rgba(86, 138, 255, 0.18);
  text-align: center;
  color: #17235a;
  font-weight: 600;
  line-height: 1.6;
  overflow: hidden;
}

.generate-overlay__dialog::before,
.generate-overlay__dialog::after {
  content: "";
  position: absolute;
  inset: auto;
  pointer-events: none;
  border-radius: inherit;
}

.generate-overlay__dialog::before {
  top: -35%;
  left: -20%;
  right: -18%;
  height: 200px;
  background: radial-gradient(
      circle at 28% 32%,
      rgba(117, 189, 255, 0.45),
      transparent 55%
    ),
    radial-gradient(
      circle at 72% 40%,
      rgba(255, 255, 255, 0.35),
      transparent 60%
    );
  filter: blur(34px);
  opacity: 0.65;
  mix-blend-mode: screen;
}

.generate-overlay__dialog::after {
  bottom: -30%;
  left: 10%;
  right: 10%;
  height: 260px;
  background: radial-gradient(
    120% 140% at 50% 120%,
    rgba(42, 92, 255, 0.25),
    transparent 65%
  );
  filter: blur(32px);
  opacity: 0.5;
}

.generate-overlay__spinner {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(
      135deg,
      rgba(47, 111, 235, 0.32),
      rgba(120, 205, 255, 0.28)
    ),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(20, 40, 96, 0.25),
    inset 0 0 16px rgba(255, 255, 255, 0.4);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.generate-overlay__spinner::before {
  content: "";
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(47, 111, 235, 0.28);
  border-top-color: var(--primary-bright);
  animation: spin 0.9s linear infinite;
}

.generate-overlay__spinner::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.4);
  filter: blur(6px);
  opacity: 0.5;
}

.generate-overlay__text {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2.4vw, 16px);
}

.generate-overlay__line {
  margin: 0;
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  opacity: 1;
  transform: translateY(0);
  color: rgba(25, 44, 102, 0.92);
  font-weight: 650;
  letter-spacing: 0.015em;
}

.generate-overlay__line--secondary {
  opacity: 0;
  transform: translateY(12px);
  color: rgba(25, 44, 102, 0.78);
  letter-spacing: 0.02em;
  font-weight: 600;
}

.generate-overlay.is-active .generate-overlay__line--secondary {
  animation: overlayLineIn 0.55s ease forwards;
  animation-delay: 0.35s;
}
.city-slider {
  border-radius: clamp(22px, 3vw, 32px);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.city-scroll {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: clamp(8px, 2.2vw, 16px);
  cursor: grab;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  height: 100%;
}

.city-scroll.is-dragging {
  scroll-snap-type: none;
  scroll-behavior: auto;
}

.city-scroll:active {
  cursor: grabbing;
}

.city-scroll::-webkit-scrollbar {
  display: none;
}

.city-track {
  display: flex;
  align-items: center;
  height: 100%;
  gap: clamp(22px, 4.5vw, 36px);
  padding: 0 clamp(22px, 5.5vw, 64px);
  overflow-x: unset;
}

.city-card {
  position: relative;
  flex: 0 0 auto;
  height: min(100%, clamp(320px, 70vh, 880px));
  aspect-ratio: 3 / 5;
  width: auto;
  border-radius: clamp(22px, 3vw, 30px);
  border: none;
  background: transparent;
  display: flex;
  overflow: hidden;
  padding: 0;
  box-shadow: var(--shadow-soft);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  scroll-snap-align: center;
}

.city-card::before,
.city-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
}

.city-card::before {
  background: linear-gradient(
    160deg,
    rgba(64, 124, 255, 0.18),
    rgba(47, 179, 255, 0.08)
  );
}

.city-card::after {
  border: 2px solid rgba(61, 130, 255, 0.3);
  box-shadow: 0 0 0 0 rgba(61, 130, 255, 0.18);
}

.city-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

body.is-touch .city-card:focus-visible {
  outline: none;
  outline-offset: 0;
}

.city-card.is-active {
  box-shadow: var(--shadow-strong);
  transform: scale(1.04);
}

.city-card.is-active::after {
  opacity: 1;
  transform: scale(1.06);
  border-color: rgba(61, 130, 255, 0.45);
  box-shadow: 0 22px 60px rgba(61, 130, 255, 0.24);
  animation: cityCardPulse 2.6s ease-in-out infinite;
}

.city-card.is-active:hover::after {
  transform: scale(1.08);
}

.city-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-strong);
}

.city-card:hover::after {
  opacity: 0.55;
  transform: scale(1.05);
}

.city-card:hover::before {
  opacity: 0.6;
  transform: scale(1);
}

.city-card.is-active::before {
  opacity: 0.85;
  transform: scale(1);
}

.city-card__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  flex: 1 1 auto;
}

.city-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(50px, 10vw, 120px);
  pointer-events: none;
  background: linear-gradient(to right, rgba(234, 240, 255, 0.25), transparent);
  z-index: 3;
}

.city-fade--left {
  left: 0;
}

.city-fade--right {
  right: 0;
  transform: scaleX(-1);
}

.city-hint {
  margin-top: 10px;
  margin-bottom: 12px;
  text-align: left;
  font-size: 0.95rem;
  color: var(--muted);
}

#countersText {
  margin: 0;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  font-weight: 700;
  color: var(--primary);
  background: rgba(49, 39, 131, 0.08);
  border-radius: 16px;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

#countersText::before {
  content: none;
}

.result-info__message {
  margin: 0;
  font-size: clamp(0.9rem, 2vw, 1rem);
  line-height: 1.6;
  color: var(--fg-soft);
}

/* actions block remains flex column via shared .actions rules */

@media (max-width: 1280px) {
  .app-shell {
    padding: clamp(14px, 3.6vw, 28px) clamp(14px, 4vw, 32px);
    gap: clamp(20px, 4vw, 36px);
  }

  .app-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
    gap: clamp(20px, 4vw, 36px);
  }

  .step-header {
    padding: clamp(12px, 3vw, 20px) clamp(12px, 2.6vw, 20px);
    gap: clamp(9px, 2vw, 18px);
  }

  #cardCanvas {
    height: min(100%, clamp(320px, 66vh, 640px));
  }
}

@media (max-width: 1024px) {
  .app-body {
    gap: clamp(18px, 5vw, 32px);
  }

  .card-preview {
    padding: clamp(16px, 4.8vw, 24px);
  }

  .step-header {
    padding: clamp(12px, 3.4vw, 18px);
    gap: clamp(9px, 2.2vw, 18px);
  }

  .city-track {
    padding: 0 clamp(20px, 6vw, 64px);
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding: clamp(14px, 6vw, 24px);
    gap: clamp(16px, 6vw, 28px);
  }

  .app-body {
    display: flex;
    flex-direction: column;
    gap: clamp(18px, 5vw, 32px);
  }

  .content-column {
    order: 1;
  }

  .preview-column {
    order: 2;
    width: 100%;
    min-height: auto;
    gap: clamp(16px, 4vw, 22px);
    height: 60%;
  }

  .step-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: clamp(10px, 3.4vw, 20px);
  }

  .step-header__content {
    align-items: center;
    max-width: 100%;
    gap: clamp(7px, 2.6vw, 14px);
  }

  .step-title {
    white-space: normal;
    font-size: clamp(1.3rem, 4vw, 1.7rem);
  }

  .step-subtitle,
  .step-lead,
  .step p,
  .city-hint {
    text-align: center;
  }

  .city-track {
    padding: 0 clamp(14px, 5vw, 40px);
    gap: clamp(14px, 5vw, 28px);
  }

  .city-card {
    height: min(100%, clamp(220px, 60vh, 400px));
  }

  #cardCanvas {
    height: min(100%, clamp(260px, 62vh, 480px));
  }

  .actions {
    width: 100%;
    justify-content: center;
  }

  .actions .primary,
  .actions .secondary {
    width: 100%;
    justify-content: center;
  }

  .step__content > .step-nav {
    align-self: center;
  }

  .card-preview,
  .city-slider {
    position: relative;
    inset: auto;
    transform: none;
    filter: none;
    transition: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: block;
  }

  body[data-step="1"] .card-preview {
    display: none;
  }

  body:not([data-step="1"]) .city-slider {
    display: none;
  }
}

@media (max-width: 720px) {
  .step {
    width: 100%;
  }

  .step-nav .primary,
  .step-nav .secondary {
    width: 100%;
  }

  .preview-column {
    display: none;
  }

  .mobile-stage {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 6vw, 24px);
    --mobile-stage-block-height: clamp(220px, 60vh, 420px);
  }

  .card-preview,
  .city-slider {
    display: none;
  }

  .mobile-stage .card-preview,
  .mobile-stage .city-slider {
    position: relative;
    inset: auto;
    transform: none;
    filter: none;
    transition: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    width: 100%;
  }

  .mobile-stage .city-slider {
    display: flex;
    flex-direction: column;
    min-height: var(--mobile-stage-block-height);
    height: var(--mobile-stage-block-height);
  }

  .mobile-stage .card-preview {
    display: flex;
    justify-content: center;
    padding: 0;
    min-height: var(--mobile-stage-block-height);
  }

  .mobile-stage .canvas-wrap {
    height: auto;
    max-width: 360px;
    margin: 0 auto;
    min-height: var(--mobile-stage-block-height);
    display: flex;
    align-items: center;
  }

  .mobile-stage #cardCanvas {
    width: auto;
    height: auto;
    max-height: var(--mobile-stage-block-height);
    max-width: min(100%, calc(var(--mobile-stage-block-height) * 0.6));
  }

  .mobile-stage .city-scroll {
    height: 100%;
    min-height: var(--mobile-stage-block-height);
    align-items: center;
    justify-content: center;
    padding: 0 clamp(12px, 6vw, 28px);
  }

  .mobile-stage .city-card {
    width: clamp(170px, 52vw, 220px);
    max-width: 220px;
    height: auto;
  }

  body[data-step="1"] .mobile-stage .city-slider {
    display: flex;
  }

  body[data-step="4"] .mobile-stage .card-preview {
    display: flex;
  }

  .city-track {
    gap: clamp(16px, 7vw, 28px);
    padding: 0 clamp(16px, 7vw, 40px);
  }

  #cardCanvas {
    height: auto;
    max-height: clamp(240px, 65vh, 460px);
  }

  .step-header {
    overflow: visible;
  }

  .step-title {
    font-size: clamp(1.1rem, 4.4vw, 1.5rem);
    line-height: 1.25;
  }

  .step[data-step="4"] .step__content {
    text-align: center;
    align-items: center;
  }

  .step[data-step="4"] h2,
  .step[data-step="4"] p,
  .step[data-step="4"] .result-info__message {
    text-align: center;
  }

  .step[data-step="4"] #countersText {
    width: 100%;
  }

}

@media (max-width: 540px) {
  .app-shell {
    padding: clamp(12px, 7vw, 20px);
    gap: clamp(12px, 7vw, 20px);
  }

  .app-body {
    gap: clamp(12px, 7vw, 20px);
  }

  .card-preview {
    padding: clamp(14px, 7vw, 20px);
  }

  .step-title {
    font-size: clamp(1.2rem, 4.2vw, 1.6rem);
  }

  .city-track {
    padding: 0 clamp(14px, 8vw, 32px);
    gap: clamp(14px, 7vw, 22px);
  }

  textarea,
  input {
    padding: 14px;
    font-size: 0.95rem;
  }

  #cardCanvas {
    height: min(100%, clamp(220px, 74vh, 360px));
  }
}

@media (min-width: 901px) {
  .result-pills {
    flex-direction: row;
    justify-content: center;
    gap: 24px;
  }

  .result-pills .step-nav {
    width: auto;
  }
}

@media (max-width: 400px) {
  .step-header {
    gap: 12px;
    padding: 14px;
  }

  .actions {
    gap: 10px;
  }

  .actions .primary,
  .actions .secondary {
    padding-block: 12px;
  }
}

.city-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(40, 82, 186, 0.24);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.95),
    rgba(240, 246, 255, 0.88)
  );
  color: var(--primary);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  box-shadow: 0 14px 32px rgba(15, 45, 115, 0.16);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
  z-index: 4;
}

.city-nav:hover {
  transform: translateY(calc(-50% - 2px));
  box-shadow: 0 18px 42px rgba(19, 41, 110, 0.22);
  border-color: rgba(61, 130, 255, 0.32);
}

.city-nav--prev {
  left: 18px;
}

.city-nav--next {
  right: 18px;
}

@media (min-width: 900px) {
  .city-nav {
    display: inline-flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
    background-size: auto;
  }

  .step {
    transition: none;
    transform: none;
  }

  .step.is-active {
    transform: none;
  }

  .step.is-entering .step__content,
  .step.is-entering .step-nav__inner,
  .step.is-entering .actions,
  .step.is-leaving .step__content,
  .step.is-leaving .step-nav__inner,
  .step.is-leaving .actions {
    animation: none !important;
  }

  .city-scroll {
    scroll-behavior: auto;
  }

  .city-scroll.is-dragging {
    scroll-behavior: auto;
  }

  .step-nav__inner::before {
    opacity: 0;
    transition: none;
  }

  .city-card::before,
  .city-card::after {
    animation: none !important;
    transition: none !important;
    opacity: 0;
  }

  .city-card:hover::after {
    animation: none;
  }

  body::before,
  .step-header::before {
    animation: none;
    background-position: 50% 50%;
  }

  .step-title {
    animation: none;
  }

  canvas[data-snow-canvas]:not([data-snow-override="true"]) {
    display: none;
  }
}

@media (max-width: 640px) {
  .step-header {
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(12px, 4vw, 18px);
    min-height: fit-content;
  }

  .step-header__content {
    max-width: 100%;
    align-items: flex-start;
  }

  .step-title {
    white-space: normal;
  }

  .step-nav {
    width: 100%;
  }
  .step-nav__inner {
    width: 100%;
    gap: 10px;
    padding: 10px 16px;
    justify-content: space-between;
  }
  .step-nav .primary,
  .step-nav .secondary {
    min-width: 0;
    flex: 1 1 auto;
  }
}
