:root {
  --bg: #0d0610;
  --card: rgba(255, 255, 255, 0.97);
  --ink: #2b1224;
  --muted: #96798c;
  --rose: #e0447c;
  --rose-dark: #b52f61;
  --rose-soft: #fdf0f6;
  --border: #f4dce8;
}
:root[data-intent="business"] { --ink:#102a3a; --muted:#617c8c; --rose:#168aad; --rose-dark:#086788; --rose-soft:#edfaff; --border:#cce9f2; }
:root[data-intent="friendship"] { --ink:#352514; --muted:#8a7255; --rose:#e59a22; --rose-dark:#a96308; --rose-soft:#fff8e7; --border:#f2dfba; }
:root[data-intent="mentor"] { --ink:#281d49; --muted:#75698f; --rose:#7c5ce4; --rose-dark:#5437b4; --rose-soft:#f4f0ff; --border:#ded4fb; }
:root[data-intent="romantic"] { --ink:#2b1224; --muted:#96798c; --rose:#e0447c; --rose-dark:#b52f61; --rose-soft:#fdf0f6; --border:#f4dce8; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
button, input, .choice, .slot, .btn { -webkit-tap-highlight-color: transparent; outline: none; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--rose) 45%, transparent); outline-offset: 3px; }
html, body { min-height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(circle at 50% -20%, var(--world-c, #ff8fba) 0%, transparent 46%),
    linear-gradient(155deg, var(--world-a, #0b050d) 0%, var(--world-b, #170817) 52%, #09050d 100%);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23e0447c' d='M12 21c-.6 0-1.2-.2-1.6-.7C5.6 16.2 2 13 2 9.5 2 6.9 4 5 6.5 5c1.9 0 3.6 1 4.5 2.5C11.9 6 13.6 5 15.5 5 18 5 20 6.9 20 9.5c0 3.5-3.6 6.7-8.4 10.8-.4.5-1 .7-1.6.7z'/%3E%3C/svg%3E") 12 12, auto;
  transition: background .55s ease, color .25s ease;
}

html[data-intent]:not([data-intent="romantic"]) body { cursor: auto; }
html[data-intent]:not([data-intent="romantic"]) button,
html[data-intent]:not([data-intent="romantic"]) .choice,
html[data-intent]:not([data-intent="romantic"]) .slot,
html[data-intent]:not([data-intent="romantic"]) .btn { cursor: pointer; }

.ambience {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: .88;
  pointer-events: none;
  transform: scale(1.015);
  filter: saturate(1.08) contrast(1.04);
  transition: opacity .32s ease, filter .55s ease;
}

.ambience.changing-world { opacity: .34; filter: saturate(1.45) blur(5px); }
.no-webgl .ambience { display: none; }
button, input, .choice, .slot { cursor: inherit; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.confetti-piece {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 14px;
  opacity: 0;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: 0; transform: translateY(105vh) rotate(720deg); }
}

/* ambient background */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .3;
  mix-blend-mode: screen;
  z-index: 0;
  animation: drift 18s ease-in-out infinite alternate;
}
.b1 { width: 55vmax; height: 55vmax; top: -20vmax; right: -15vmax; background: var(--world-c, #7b154d); }
.b2 { width: 45vmax; height: 45vmax; bottom: -18vmax; left: -12vmax; background: var(--world-b, #381147); animation-delay: -6s; }
.b3 { width: 30vmax; height: 30vmax; top: 40%; left: 55%; background: var(--world-c, #bd376f); opacity: .18; animation-delay: -12s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-4vmax, 4vmax) scale(1.08); }
}
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 3px 3px;
}
.hearts { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.heart-float {
  position: absolute;
  font-size: 1.3rem;
  opacity: 0;
  filter: drop-shadow(0 2px 6px rgba(224,68,124,.4));
  animation: float 7s linear forwards;
}
@keyframes float {
  0% { opacity: 0; transform: translateY(0) scale(.6); }
  12% { opacity: .85; }
  100% { opacity: 0; transform: translateY(-92vh) scale(1.25) rotate(24deg); }
}

.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.card {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 28px;
  padding: 4.5rem 2.4rem 3rem;
  width: min(560px, 100%);
  min-height: 420px;
  box-shadow:
    0 40px 90px rgba(0,0,0,.55),
    0 0 0 1px rgba(224,68,124,.12),
    inset 0 1px 0 rgba(255,255,255,.8);
  position: relative;
  display: grid;
}
.progress-shell {
  position: absolute;
  top: 1rem;
  left: 1.35rem;
  right: 6.7rem;
  display: grid;
  gap: .38rem;
}
.progress-copy { display:flex; justify-content:space-between; align-items:center; gap:.8rem; color:var(--muted); font-size:.73rem; line-height:1.2; }
.progress-copy span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.progress-copy b { flex:none; color:var(--rose-dark); font-size:.68rem; letter-spacing:.035em; text-transform:uppercase; }
.progress-track { height:4px; overflow:hidden; border-radius:999px; background:var(--border); }
.progress-track i {
  display:block;
  width:100%;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg, color-mix(in srgb,var(--rose) 72%,#fff), var(--rose-dark));
  transform:scaleX(var(--progress,0));
  transform-origin:left center;
  transition:transform .38s ease;
}

.step {
  grid-area: 1 / 1;
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.6rem;
}
.step.active { display: flex; animation: pop .4s cubic-bezier(.2,.8,.3,1.1); }
@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.emoji { font-size: 3.2rem; line-height: 1; animation: bob 2.6s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
h1 {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.7rem;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.sub { color: var(--muted); font-size: .95rem; line-height: 1.6; }

.btn {
  border: 0;
  border-radius: 999px;
  font: 600 1rem 'Inter', sans-serif;
  padding: .95rem 2.2rem;
  min-height: 50px;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.8,.3,1.2), box-shadow .18s ease;
}
.btn.yes {
  background: linear-gradient(135deg, color-mix(in srgb, var(--rose) 78%, #fff), var(--rose-dark));
  color: #fff;
  box-shadow: 0 12px 28px rgba(224,68,124,.45), inset 0 1px 0 rgba(255,255,255,.3);
}
.btn.yes:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 16px 34px rgba(224,68,124,.55); }
.btn.yes:active { transform: scale(.97); }
.btn.ghost {
  background: none;
  color: var(--rose-dark);
  border: 1.5px solid var(--border);
}
.btn.ghost:hover { border-color: var(--rose); background: var(--rose-soft); transform: translateY(-1px); }
.btn.no {
  background: #f6ebf1;
  color: var(--muted);
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.05);
}
.btn-row.spread { display: flex; gap: 1rem; justify-content: center; align-items: center; flex-wrap: wrap; }
.nav-row { display: flex; gap: .8rem; justify-content: center; align-items: center; width: 100%; }
.nav-row .btn.yes { flex: 1; }
.nav-row .btn.back { flex: 0 0 auto; min-width: 118px; }
.btn.back {
  background: none;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn.back:hover { border-color: var(--rose); color: var(--rose-dark); background: var(--rose-soft); transform: translateY(-1px); }

.form { display: flex; flex-direction: column; gap: 1.1rem; width: 100%; }
.form label { display: flex; flex-direction: column; gap: .45rem; text-align: left; font-size: .875rem; color: var(--muted); font-weight: 600; letter-spacing: .015em; }
.form input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: .85rem 1.05rem;
  font: 500 1rem 'Inter', sans-serif;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.form input:focus { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(224,68,124,.12); }
.form input::placeholder { color: #c9aec0; }
#inp-date { text-align: center; }
#inp-date::-webkit-date-and-time-value { text-align: center; }

.slot-wrap { display: flex; flex-direction: column; gap: .45rem; text-align: center; }
.slot-label { font-size: .875rem; color: var(--muted); font-weight: 600; letter-spacing: .015em; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; justify-items: stretch; }
.slot {
  border: 2px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: .6rem .2rem;
  font: 600 .9rem 'Inter', sans-serif;
  color: var(--ink);
  cursor: pointer;
  transition: all .15s ease;
}
.slot:hover:not(:disabled) { border-color: var(--rose); background: var(--rose-soft); transform: translateY(-2px); }
.slot.selected, .slot.selected:hover {
  background: var(--rose-dark);
  border-color: var(--rose-dark);
  color: #fff;
  font-weight: 700;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(181,47,97,.4);
}
.slot.taken {
  background: #f6ebf1;
  color: #c9aec0;
  text-decoration: line-through;
  cursor: not-allowed;
}
.slot-hint { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .6rem;
  width: 100%;
}
.choice {
  position: relative;
  border: 2px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: .75rem .4rem .6rem;
  font: 600 .86rem 'Inter', sans-serif;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  transition: all .16s cubic-bezier(.2,.8,.3,1.2);
}
.choice::after {
  content:'✓';
  position:absolute;
  top:.5rem;
  right:.5rem;
  display:grid;
  place-items:center;
  width:1.25rem;
  height:1.25rem;
  border:1.5px solid var(--border);
  border-radius:50%;
  background:#fff;
  color:transparent;
  font-size:.65rem;
  transition:background .16s ease,color .16s ease,border-color .16s ease;
}
.choice.selected::after { border-color:#fff; background:#fff; color:var(--rose-dark); }
.choice span:first-child { font-size: 1.5rem; line-height: 1; }
.choice:hover {
  border-color: var(--rose);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(224,68,124,.15);
  background: var(--rose-soft);
}
.choice:active { transform: translateY(0) scale(.97); }
.choice.selected {
  border-color: var(--rose-dark);
  background: var(--rose-dark);
  color: #fff;
  transform: none;
  box-shadow: 0 8px 18px rgba(181,47,97,.35);
}
.choice.selected:hover { background: var(--rose-dark); }
.choice.spicy.selected { border-color: transparent; }

.choice.on-fire { animation: spicy-shake .3s ease-in-out 4; }
@keyframes spicy-shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}
.flame-particle {
  position: fixed;
  bottom: -30px;
  z-index: 60;
  pointer-events: none;
  animation: flame-rise ease-out forwards;
}
@keyframes flame-rise {
  0% { opacity: 0; transform: translateY(0) scale(.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-55vh) scale(1.3) rotate(14deg); }
}
.choice.spicy:hover { border-color: #ff2d55; box-shadow: 0 12px 26px rgba(255,45,85,.28); }

.summary {
  background: var(--rose-soft);
  border: 1px solid #f7dce9;
  border-radius: 18px;
  padding: 1.3rem 1.4rem;
  width: 100%;
  font-size: .95rem;
  line-height: 2;
  text-align: left;
}
.summary b { color: var(--rose-dark); }

.foot {
  position: fixed;
  bottom: .9rem;
  width: 100%;
  text-align: center;
  color: rgba(255,255,255,.4);
  font-size: .75rem;
  letter-spacing: .04em;
  z-index: 2;
}

.done-emoji { animation: celebrate 1s cubic-bezier(.2,.8,.3,1.2) 3, bob 2.6s ease-in-out 3s infinite; }
@keyframes celebrate {
  0% { transform: scale(0) rotate(-30deg); }
  60% { transform: scale(1.4) rotate(12deg); }
  100% { transform: scale(1) rotate(0); }
}

.shake { animation: shake .4s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

@media (max-width: 560px) {
  .card { padding: 4.2rem 1.3rem 2.6rem; min-height: 0; border-radius: 22px; }
  .stage { padding: 1rem; }
  .step { gap: 1.2rem; }
  .emoji { font-size: 2.6rem; }
  h1 { font-size: 1.4rem; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .choice { padding: .65rem .4rem; font-size: .84rem; }
  .choice span:first-child { font-size: 1.25rem; }
  .slots { grid-template-columns: repeat(4, 1fr); gap: .4rem; }
  .slot { padding: .55rem .1rem; font-size: .84rem; }
  .nav-row { flex-wrap: wrap; }
  .nav-row .btn { flex: 1 1 auto; min-width: 120px; }
  .foot { font-size: .68rem; }
}
@media (max-width: 360px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .slots { grid-template-columns: repeat(3, 1fr); }
  h1 { font-size: 1.3rem; }
}
