:root {
  color-scheme: light;
  --ink: #352331;
  --muted: #7d6175;
  --rose: #f43f7f;
  --rose-dark: #c0265f;
  --lavender: #8b5cf6;
  --peach: #ffd6bf;
  --glass: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.84);
  --border: rgba(255, 255, 255, 0.72);
  --shadow: 0 24px 70px rgba(108, 39, 91, 0.18);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  margin: 0;
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  background:
    linear-gradient(135deg, rgba(255, 244, 249, 0.76), rgba(246, 232, 255, 0.72)),
    url("../assets/romantic-bg.png") center / cover fixed;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell,
.results-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px 28px;
}

.photo-rail {
  position: fixed;
  top: 50%;
  z-index: 3;
  display: grid;
  gap: clamp(12px, 2vh, 22px);
  transform: translate3d(0, -50%, 0);
  pointer-events: none;
  opacity: 1;
  transition: opacity 260ms ease;
  will-change: transform, opacity;
}

.photos-hidden .photo-rail {
  opacity: 0;
}

.photo-rail-left {
  left: max(18px, calc((100vw - 1260px) / 2));
}

.photo-rail-right {
  right: max(18px, calc((100vw - 1260px) / 2));
}

.photos-swapped .photo-rail-left {
  left: auto;
  right: max(18px, calc((100vw - 1260px) / 2));
}

.photos-swapped .photo-rail-right {
  right: auto;
  left: max(18px, calc((100vw - 1260px) / 2));
}

.photo-rail img {
  width: clamp(92px, 10.5vw, 150px);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 7px solid rgba(255, 255, 255, 0.82);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 40px rgba(114, 49, 92, 0.18);
  opacity: 0;
  visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: opacity, scale;
}

.photo-rail img.photo-visible {
  visibility: visible;
  opacity: 1;
}

.photo-rail img.photo-enter {
  animation: photoPop 460ms ease both;
}

.celebrating .photo-rail {
  opacity: 1;
}

.celebrating .photo-rail img {
  visibility: visible;
  opacity: 1;
}

.swapping-photos .photo-rail-left {
  animation: railSwapDown 2600ms ease-in-out both;
}

.swapping-photos .photo-rail-right {
  animation: railSwapUp 2600ms ease-in-out both;
}

.photo-rail-left img:nth-child(1),
.photo-rail-left img:nth-child(1).photo-visible {
  transform: rotate(-7deg);
}

.photo-rail-left img:nth-child(2),
.photo-rail-left img:nth-child(2).photo-visible {
  transform: translateX(18px) rotate(6deg);
}

.photo-rail-left img:nth-child(3),
.photo-rail-left img:nth-child(3).photo-visible {
  transform: translateX(4px) rotate(-5deg);
}

.photo-rail-right img:nth-child(1),
.photo-rail-right img:nth-child(1).photo-visible {
  transform: rotate(6deg);
}

.photo-rail-right img:nth-child(2),
.photo-rail-right img:nth-child(2).photo-visible {
  transform: translateX(-18px) rotate(-7deg);
}

.photo-rail-right img:nth-child(3),
.photo-rail-right img:nth-child(3).photo-visible {
  transform: translateX(-4px) rotate(5deg);
}

.experience,
.results-panel {
  position: relative;
  z-index: 2;
  width: min(940px, 100%);
  min-height: min(650px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 3vw, 32px);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: var(--glass);
  box-shadow:
    0 0 0 1px rgba(244, 63, 127, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.46),
    var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar,
.results-header,
.navigation,
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  position: relative;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding-top: 8px;
}

.is-confirmed .topbar {
  display: none;
}

.topbar > div:first-child {
  width: 100%;
}

.topbar > div:first-child .eyebrow {
  position: absolute;
  top: 0;
  left: 0;
}

.topbar .progress-wrap {
  width: min(320px, 100%);
  text-align: center;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--rose-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  line-height: 1.04;
}

h1 {
  font-size: clamp(1.9rem, 4.2vw, 3.7rem);
}

h2 {
  font-size: clamp(1.8rem, 4.3vw, 3.6rem);
}

.progress-wrap {
  width: min(230px, 40vw);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}

.progress-track {
  height: 9px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--lavender));
  transition: width 280ms ease;
}

.screen {
  flex: 1;
  display: grid;
  align-content: center;
  padding: clamp(14px, 2.6vw, 30px) 0;
  min-height: 0;
  overflow: visible;
}

.screen-enter {
  animation: fadeUp 360ms ease both;
}

.welcome-card,
.summary-card,
.confirmation-card {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.welcome-card p,
.confirmation-card p,
.save-hint {
  color: var(--muted);
  font-size: clamp(0.98rem, 1.7vw, 1.08rem);
  line-height: 1.55;
}

.choice-row {
  position: relative;
  width: min(560px, 100%);
  min-height: 128px;
  display: block;
  margin: 24px auto 0;
}

.choice-row .primary-button,
.choice-row .ghost-button {
  min-width: 130px;
}

.choice-row .primary-button {
  position: absolute;
  left: calc(50% - 146px);
  top: 50%;
  transform: translateY(-50%);
}

.choice-row .primary-button:hover {
  transform: translateY(calc(-50% - 2px));
}

.runaway-button {
  position: absolute;
  left: calc(50% + 16px);
  top: 50%;
  transform: translateY(-50%);
}

.runaway-button.is-running {
  transform: none;
  transition: left 140ms ease, top 140ms ease, transform 180ms ease;
}

.lead {
  margin-top: 18px;
  font-weight: 700;
}

.heart-mark {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, var(--rose), var(--lavender));
  box-shadow: 0 14px 34px rgba(244, 63, 127, 0.28);
  font-size: 2rem;
  animation: pulse 2.4s ease-in-out infinite;
}

.field-block {
  width: min(620px, 100%);
  display: grid;
  gap: 10px;
  margin: 0 auto;
}

.time-step {
  display: grid;
  gap: 12px;
}

.activity-step {
  display: grid;
  gap: 16px;
}

.food-step {
  display: grid;
  gap: 12px;
}

.meal-step {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0 auto;
}

.meal-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 40px rgba(114, 49, 92, 0.1);
}

.meal-icon {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 230, 241, 0.78));
  box-shadow: 0 12px 30px rgba(114, 49, 92, 0.12);
  font-size: 2.4rem;
}

.meal-card h3 {
  margin: 0;
  font-size: 1.35rem;
  text-align: center;
}

.slider-choice {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: min(320px, 100%);
  min-height: 56px;
  margin: 0 auto;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.74), 0 10px 24px rgba(114, 49, 92, 0.08);
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}

.slider-choice span {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 999px;
  transition: color 180ms ease;
}

.slider-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.slider-choice i {
  position: absolute;
  z-index: 1;
  top: 6px;
  left: 6px;
  width: calc(50% - 6px);
  height: calc(100% - 12px);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--rose), var(--lavender));
  box-shadow: 0 10px 24px rgba(244, 63, 127, 0.24);
  transition: transform 180ms ease;
}

.slider-choice input:not(:checked) ~ .no-label,
.slider-choice input:checked ~ .yes-label {
  color: white;
}

.slider-choice input:checked + i {
  transform: translateX(100%);
}

.step-note {
  width: fit-content;
  margin: 0 auto;
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--rose-dark);
  background: rgba(255, 255, 255, 0.64);
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(114, 49, 92, 0.08);
}

label {
  color: var(--muted);
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  background: var(--glass-strong);
  color: var(--ink);
  box-shadow: 0 10px 34px rgba(114, 49, 92, 0.09);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

input,
select {
  min-height: 58px;
  padding: 0 18px;
}

textarea {
  min-height: 180px;
  resize: vertical;
  padding: 18px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(244, 63, 127, 0.52);
  box-shadow: 0 0 0 4px rgba(244, 63, 127, 0.12), 0 14px 40px rgba(114, 49, 92, 0.12);
}

.option-grid,
.extras-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.option-card {
  min-height: 132px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  box-shadow: 0 14px 40px rgba(114, 49, 92, 0.1);
  text-align: center;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.option-card:hover,
.option-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(244, 63, 127, 0.45);
  box-shadow: 0 18px 44px rgba(114, 49, 92, 0.16);
}

.option-card.selected {
  border-color: rgba(244, 63, 127, 0.74);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 4px rgba(244, 63, 127, 0.12), 0 18px 44px rgba(114, 49, 92, 0.16);
}

.option-card span {
  font-size: 2.1rem;
}

.option-card strong {
  font-size: 1.08rem;
}

.option-card small {
  max-width: 22ch;
  color: var(--muted);
  line-height: 1.45;
}

.time-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(620px, 100%);
  margin: 0 auto;
}

.time-grid .option-card {
  min-height: 78px;
  padding: 12px 14px;
}

.time-grid .option-card span {
  display: none;
}

.time-grid .option-card strong {
  font-size: 1rem;
}

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

.activity-grid .option-card {
  min-height: 128px;
  padding: 16px 12px;
}

.activity-grid .option-card span {
  font-size: 2rem;
}

.activity-grid .option-card strong {
  font-size: 1rem;
}

.activity-grid .option-card small {
  font-size: 0.8rem;
}

.custom-activity {
  width: min(560px, 100%);
}

.custom-food {
  width: min(560px, 100%);
}

.food-step .option-grid {
  gap: 12px;
}

.food-step .option-card {
  min-height: 118px;
  padding: 14px 12px;
}

.food-step .option-card span {
  font-size: 1.75rem;
}

.food-step .option-card small {
  font-size: 0.78rem;
}

.food-step .custom-food {
  gap: 8px;
}

.food-step .custom-food input {
  min-height: 48px;
}

.snacks-step .step-note {
  margin-bottom: -2px;
}

.extras-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.toggle-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 34px rgba(114, 49, 92, 0.09);
}

.toggle-row input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--rose);
  box-shadow: none;
}

.summary-card {
  width: min(720px, 100%);
  display: grid;
  gap: 12px;
  align-self: start;
  max-height: min(420px, calc(100vh - 230px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
}

.summary-row {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
  text-align: left;
}

.summary-row span {
  color: var(--muted);
  font-weight: 800;
}

.summary-row strong {
  max-width: 68%;
  text-align: right;
  line-height: 1.45;
}

.navigation {
  margin-top: auto;
  padding-top: 8px;
}

.primary-button,
.ghost-button {
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  padding: 0 26px;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--rose), var(--lavender));
  box-shadow: 0 14px 30px rgba(244, 63, 127, 0.28);
}

.ghost-button {
  color: var(--rose-dark);
  background: rgba(255, 255, 255, 0.62);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.loading {
  position: relative;
  color: transparent;
}

.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 22px;
  height: 22px;
  margin: auto;
  border: 3px solid rgba(255, 255, 255, 0.48);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.confirmation-card {
  padding: 30px 0;
}

.confirmation-card.success {
  animation: successPop 520ms ease both;
}

.confirmation-card.success p {
  color: var(--rose-dark);
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  font-weight: 900;
  line-height: 1.25;
}

.confirmation-card.success .heart-mark {
  animation: pulse 900ms ease-in-out 3;
}

.confirmation-card.error .heart-mark {
  background: linear-gradient(135deg, #fb7185, #f59e0b);
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(53, 35, 49, 0.22);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(430px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 70px rgba(108, 39, 91, 0.24);
  text-align: center;
  animation: fadeUp 220ms ease both;
}

.modal-card h2 {
  font-size: 2rem;
}

.modal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

.results-shell {
  align-items: start;
  overflow: auto;
}

.results-panel {
  min-height: auto;
}

.status-text {
  margin: 18px 0;
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

th,
td {
  padding: 16px;
  border-bottom: 1px solid rgba(125, 97, 117, 0.14);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--rose-dark);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: var(--ink);
  line-height: 1.45;
}

.delete-button {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: #9f1239;
  background: rgba(255, 228, 230, 0.82);
  font-size: 0.85rem;
  font-weight: 900;
  transition: transform 180ms ease, opacity 180ms ease;
}

.delete-button:hover {
  transform: translateY(-1px);
}

.delete-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

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

@keyframes photoPop {
  from {
    opacity: 0;
    scale: 0.88;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}

@keyframes celebrationPhoto {
  0% {
    opacity: 0;
    scale: 0.82;
  }
  55% {
    opacity: 1;
    scale: 1.08;
  }
  100% {
    opacity: 1;
    scale: 1;
  }
}

@keyframes photoGlow {
  0%,
  100% {
    box-shadow: 0 18px 40px rgba(114, 49, 92, 0.18);
  }
  50% {
    box-shadow: 0 22px 52px rgba(244, 63, 127, 0.34);
  }
}

@keyframes successPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes railSwapDown {
  0% {
    opacity: 1;
    transform: translate3d(0, -50%, 0);
  }
  45% {
    opacity: 0;
    transform: translate3d(0, 90vh, 0);
  }
  55% {
    opacity: 0;
    transform: translate3d(0, -115vh, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, -50%, 0);
  }
}

@keyframes railSwapUp {
  0% {
    opacity: 1;
    transform: translate3d(0, -50%, 0);
  }
  45% {
    opacity: 0;
    transform: translate3d(0, -115vh, 0);
  }
  55% {
    opacity: 0;
    transform: translate3d(0, 90vh, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, -50%, 0);
  }
}

@media (max-width: 560px) {
  .app-shell,
  .results-shell {
    padding: 12px;
  }

  .experience,
  .results-panel {
    min-height: calc(100vh - 24px);
    border-radius: 22px;
  }

  .topbar,
  .results-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    align-items: center;
    text-align: center;
    padding-top: 22px;
  }

  .topbar > div:first-child .eyebrow {
    top: 0;
    left: 0;
  }

  .progress-wrap {
    width: 100%;
    text-align: left;
  }

  .topbar .progress-wrap {
    text-align: center;
  }

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

  .extras-grid {
    grid-template-columns: 1fr;
  }

  .option-card {
    min-height: 112px;
    padding: 14px 10px;
  }

  .option-card span {
    font-size: 1.7rem;
  }

  .option-card small {
    font-size: 0.78rem;
  }

  .summary-row {
    display: grid;
    gap: 6px;
  }

  .summary-row strong {
    max-width: 100%;
    text-align: left;
  }

  .navigation {
    position: sticky;
    bottom: 0;
    padding-top: 12px;
  }

  .primary-button,
  .ghost-button {
    flex: 1;
    padding: 0 18px;
  }
}

@media (max-width: 1180px) {
  .photo-rail {
    opacity: 0.28;
  }

  .photo-rail-left {
    left: 10px;
  }

  .photo-rail-right {
    right: 10px;
  }

  .photos-swapped .photo-rail-left {
    left: auto;
    right: 10px;
  }

  .photos-swapped .photo-rail-right {
    right: auto;
    left: 10px;
  }

  .photo-rail img {
    width: 82px;
  }
}

@media (max-width: 980px) {
  .photo-rail {
    display: none;
  }
}

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