:root {
  --background: #fdf8f8;
  --surface: #ffffff;
  --surface-muted: #f1edec;
  --surface-raised: #f7f3f2;
  --ink: #1c1b1b;
  --ink-muted: #444748;
  --outline: #c4c7c7;
  --outline-strong: #747878;
  --coral: #ff6b6b;
  --coral-deep: #ae2f34;
  --coral-soft: #ffdad8;
  --blue-soft: #dbeafe;
  --green-soft: #dcfce7;
  --shadow: 0 16px 40px rgba(26, 26, 26, 0.07);
  --shadow-soft: 0 4px 20px rgba(26, 26, 26, 0.04);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 107, 107, 0.1), transparent 28rem),
    linear-gradient(180deg, #fffefe 0%, var(--background) 28rem);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--background);
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 0 1px rgba(26, 26, 26, 0.04);
}

.screen {
  min-height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: screen-in 240ms ease-out both;
}

.screen.centered {
  justify-content: center;
  text-align: center;
}

.screen.scroll {
  min-height: 100dvh;
  padding-bottom: 116px;
}

.screen.error-screen {
  justify-content: space-between;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  gap: 16px;
}

.brand {
  font-family: "Outfit", sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  font-size: 20px;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.hero-graphic,
.emoji-orbit,
.conflict-graphic {
  width: min(72vw, 260px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(247, 243, 242, 0.9)),
    var(--surface-raised);
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero-graphic::before,
.emoji-orbit::before,
.conflict-graphic::before {
  content: "";
  position: absolute;
  inset: 26px;
  border: 1px solid rgba(26, 26, 26, 0.08);
  border-radius: inherit;
}

.hero-graphic::after {
  content: "📍";
  position: absolute;
  right: 26px;
  top: 28px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  font-size: 25px;
  transform: rotate(8deg);
}

.emoji-main {
  font-size: clamp(76px, 22vw, 104px);
  line-height: 1;
  transform: translateY(-2px);
}

.floating-chip {
  position: absolute;
  left: 22px;
  bottom: 34px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: 0 12px 22px rgba(255, 107, 107, 0.24);
}

.title-stack {
  display: grid;
  gap: 10px;
  text-align: center;
}

.display-title,
.page-title {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0;
}

.display-title {
  max-width: none;
  font-size: clamp(44px, 14vw, 58px);
  line-height: 0.95;
  text-transform: uppercase;
}

.page-title {
  font-size: clamp(38px, 12vw, 54px);
  line-height: 0.94;
}

.subtitle {
  margin: 0;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1.4;
}

.action-area {
  display: grid;
  gap: 12px;
}

.primary-button,
.accent-button,
.secondary-button,
.ghost-button {
  width: 100%;
  min-height: 58px;
  border-radius: 999px;
  padding: 15px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.1;
  transition:
    transform 140ms ease,
    opacity 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease;
}

.primary-button:active,
.accent-button:active,
.secondary-button:active,
.ghost-button:active,
.option-card:active,
.chip:active,
.stepper-button:active {
  transform: scale(0.98);
}

.primary-button {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 14px 28px rgba(26, 26, 26, 0.14);
}

.accent-button {
  background: var(--coral);
  color: #410006;
  box-shadow: 0 14px 28px rgba(255, 107, 107, 0.22);
}

.secondary-button {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--outline);
}

.ghost-button {
  min-height: 46px;
  background: transparent;
  color: var(--outline-strong);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.setup-main,
.transition-main,
.loading-main,
.result-main,
.conflict-main,
.error-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.setup-main {
  gap: 28px;
}

.section-card {
  padding: 22px;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(196, 199, 199, 0.36);
}

.label {
  display: block;
  margin: 0 0 10px 2px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.field {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  padding: 0 20px;
  font-size: 18px;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.field:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08);
}

.field.invalid {
  border-color: var(--coral-deep);
  box-shadow: 0 0 0 3px rgba(174, 47, 52, 0.1);
}

.field-error {
  min-height: 18px;
  margin: 8px 0 0 2px;
  color: var(--coral-deep);
  font-size: 13px;
  font-weight: 700;
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.stepper-button {
  width: 62px;
  height: 62px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 32px;
  font-weight: 700;
  transition:
    transform 140ms ease,
    background-color 140ms ease;
}

.stepper-button.plus {
  background: var(--ink);
  color: #fff;
}

.stepper-value {
  width: 58px;
  text-align: center;
  font-family: "Outfit", sans-serif;
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
}

.months {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 24px 8px;
  margin: 0 -24px;
  scrollbar-width: none;
}

.months::-webkit-scrollbar {
  display: none;
}

.duration-card {
  display: grid;
  gap: 18px;
}

.duration-head {
  display: flex;
}

.duration-head .label {
  margin-bottom: 0;
}

.duration-value {
  justify-self: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--coral-soft);
  color: #410006;
  font-size: 14px;
  font-weight: 800;
}

.duration-range {
  width: 100%;
  accent-color: var(--ink);
  appearance: none;
}

.duration-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-muted);
}

.duration-range::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: -10px;
  border: 4px solid var(--surface);
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 8px 18px rgba(26, 26, 26, 0.2);
  appearance: none;
}

.duration-range::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-muted);
}

.duration-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 4px solid var(--surface);
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 8px 18px rgba(26, 26, 26, 0.2);
}

.range-meta {
  display: flex;
  justify-content: space-between;
  color: var(--outline-strong);
  font-size: 12px;
  font-weight: 700;
}

.chip {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.chip.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.progress-line {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
  flex: 1;
}

.progress-line > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 200ms ease;
}

.traveler-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.badge {
  flex: 0 0 auto;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.question-group {
  display: grid;
  gap: 14px;
}

.question-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.question-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 24px;
  line-height: 1.15;
}

.question-title .emoji {
  font-size: 30px;
}

.question-note {
  margin: 6px 0 0;
  color: var(--outline-strong);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}

.selection-count {
  flex: 0 0 auto;
  min-width: 46px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option-card {
  min-height: 88px;
  border: 1px solid rgba(196, 199, 199, 0.74);
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.option-card.wide {
  grid-column: 1 / -1;
  min-height: 62px;
}

.option-card.selected {
  border: 2px solid var(--coral);
  background: #fff9f9;
  box-shadow: 0 12px 26px rgba(255, 107, 107, 0.12);
}

.option-card.disabled {
  opacity: 0.38;
  filter: grayscale(1);
}

.option-label {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.15;
}

.option-emoji {
  display: block;
  margin-bottom: 8px;
  font-size: 25px;
  line-height: 1;
}

.sticky-footer {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(100%, 430px);
  transform: translateX(-50%);
  padding: 16px 24px max(18px, env(safe-area-inset-bottom));
  background: rgba(253, 248, 248, 0.88);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(196, 199, 199, 0.4);
  z-index: 20;
}

.transition-main,
.loading-main,
.conflict-main,
.error-main {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 28px;
}

.transition-title {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: clamp(44px, 14vw, 62px);
  line-height: 0.95;
}

.handoff-card {
  width: 100%;
  padding: 22px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid rgba(196, 199, 199, 0.48);
  box-shadow: var(--shadow-soft);
}

.handoff-card .next-number {
  width: 78px;
  height: 78px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--coral-soft);
  color: #410006;
  font-family: "Outfit", sans-serif;
  font-size: 36px;
  font-weight: 800;
}

.loading-rings {
  position: relative;
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
}

.loading-rings::before,
.loading-rings::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(26, 26, 26, 0.1);
  animation: ring-pulse 2400ms ease-in-out infinite;
}

.loading-rings::after {
  inset: 18px;
  animation-delay: 400ms;
}

@keyframes ring-pulse {
  50% {
    transform: scale(0.9);
    opacity: 0.4;
  }
}

.loading-emoji {
  font-size: 78px;
  animation: bob 1900ms ease-in-out infinite;
}

@keyframes bob {
  50% {
    transform: translateY(-8px) rotate(-3deg);
  }
}

.loading-text {
  min-height: 68px;
  display: grid;
  place-items: center;
  transition: opacity 260ms ease;
}

.dots {
  display: flex;
  gap: 8px;
}

.dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--coral);
  animation: dot 900ms ease-in-out infinite;
}

.dots span:nth-child(2) {
  animation-delay: 120ms;
}

.dots span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes dot {
  50% {
    transform: translateY(-6px);
    opacity: 0.55;
  }
}

.result-main {
  gap: 22px;
}

.destination-hero {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.flag {
  font-size: 72px;
  line-height: 1;
}

.destination-title {
  margin: 0;
  max-width: 10ch;
  font-family: "Outfit", sans-serif;
  font-size: clamp(48px, 15vw, 68px);
  font-weight: 800;
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: 0;
}

.destination-country {
  margin: 0;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-catch {
  max-width: 310px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1.4;
  font-style: italic;
}

.divider {
  height: 1px;
  width: 100%;
  background: var(--outline);
  opacity: 0.64;
}

.bullet-list {
  display: grid;
  gap: 15px;
}

.result-bullet {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
}

.result-bullet .emoji {
  font-size: 27px;
  line-height: 1.1;
}

.result-bullet p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.38;
}

.result-bullet strong {
  color: var(--ink);
}

.conflict-graphic {
  width: min(62vw, 180px);
  background: linear-gradient(145deg, var(--coral-soft), #fff);
}

.conflict-title,
.error-title {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: clamp(34px, 11vw, 48px);
  line-height: 1;
}

.reason-card {
  width: 100%;
  padding: 22px;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1.42;
}

.error-detail {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 431px) {
  body {
    padding: 16px 0;
  }

  .app-shell {
    min-height: calc(100dvh - 32px);
    border-radius: 34px;
    overflow: hidden;
  }

  .screen {
    min-height: calc(100dvh - 32px);
  }

  .sticky-footer {
    bottom: 16px;
    border-radius: 0 0 34px 34px;
  }
}

@media (max-width: 360px) {
  .screen {
    padding-left: 18px;
    padding-right: 18px;
  }

  .display-title {
    font-size: 48px;
  }

  .page-title {
    font-size: 36px;
  }

  .options-grid {
    gap: 9px;
  }

  .option-card {
    min-height: 78px;
    border-radius: 20px;
    padding: 11px;
  }
}

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