:root {
  --creamsicle: #ffd6a5;
  --creamsicle-deep: #ffb86b;
  --lavender: #cdb4db;
  --lavender-deep: #b79acf;
  --blush: #ffcad4;
  --blush-deep: #f4a7b9;
  --mint: #b8e0d2;
  --mint-deep: #a2d5c6;
  --denim: #a7c7e7;
  --denim-deep: #89b0d9;
  --text: #493a4f;
  --muted: #786e82;
  --border: rgba(138, 131, 159, 0.18);
  --shadow: 0 22px 50px rgba(145, 144, 184, 0.18);
  --shadow-soft: 0 12px 28px rgba(145, 144, 184, 0.14);
  --button-text: #4b375f;
  --danger: #934c56;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 214, 165, 0.8), transparent 30%),
    radial-gradient(circle at top right, rgba(205, 180, 219, 0.7), transparent 28%),
    radial-gradient(circle at bottom left, rgba(184, 224, 210, 0.6), transparent 25%),
    linear-gradient(180deg, #fffdfb 0%, #fff6fa 45%, #f7fbff 100%);
}

body.overlay-open {
  overflow: hidden;
}

.page-shell {
  position: relative;
  isolation: isolate;
}

.page-shell::before,
.page-shell::after {
  content: "";
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.page-shell::before {
  top: 90px;
  left: -90px;
  background: rgba(255, 202, 212, 0.7);
}

.page-shell::after {
  right: -80px;
  bottom: 40px;
  background: rgba(167, 199, 231, 0.7);
}

.app {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.card,
.wizard-shell {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 247, 0.92));
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero,
.instructions,
.wizard-shell {
  position: relative;
  overflow: hidden;
}

.hero::after,
.instructions::after,
.wizard-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 60%);
  pointer-events: none;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 28px;
  margin-bottom: 22px;
}

.hero-copy {
  max-width: 680px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.7rem, 4vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: 0.03em;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--lavender-deep);
  font-weight: bold;
}

.subtitle {
  max-width: 52ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.65;
}

.hero-actions {
  min-width: 260px;
  display: grid;
  gap: 10px;
  justify-items: end;
}

.music-note {
  margin: 0;
  max-width: 22ch;
  text-align: right;
  color: var(--muted);
  font-size: 0.92rem;
}

.instructions,
.wizard-shell {
  padding: 24px;
}

.instructions {
  margin-bottom: 22px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.journey-status {
  display: grid;
  gap: 12px;
}

#journey-progress {
  color: var(--muted);
  font-weight: bold;
}

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
  border: 1px solid rgba(138, 131, 159, 0.12);
}

.progress-fill {
  width: 16.66%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--blush), var(--denim));
  transition: width 0.24s ease;
}

.wizard-stage {
  position: relative;
  min-height: 690px;
}

.status-message {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 247, 248, 0.94);
  border: 1px solid rgba(148, 76, 86, 0.2);
  color: var(--danger);
  font-weight: bold;
}

.status-message.hidden {
  display: none;
}

.wizard-slide {
  display: none;
  animation: slideFade 0.28s ease;
}

.wizard-slide.active {
  display: block;
}

.result-slide.active {
  animation: slideDown 0.32s ease;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
}

.player-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px;
  margin-bottom: 22px;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 250, 247, 0.94)),
    linear-gradient(135deg, rgba(255, 214, 165, 0.18), rgba(205, 180, 219, 0.14));
  border: 1px solid rgba(183, 154, 207, 0.24);
  box-shadow: var(--shadow-soft);
}

.player-avatar {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  font-size: 2.8rem;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 202, 212, 0.9), rgba(255, 214, 165, 0.75));
  box-shadow: inset 0 2px 12px rgba(255, 255, 255, 0.45);
}

.player-card-copy h3 {
  margin: 0 0 4px;
}

.player-card-copy p,
.partner-intro,
.result p {
  line-height: 1.6;
}

.player-card-copy p {
  margin: 0 0 14px;
  color: var(--muted);
}

.summary-row + .summary-row,
.field-group + .field-group {
  margin-top: 16px;
}

.summary-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-group h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.field-group h3 span {
  color: var(--muted);
  font-weight: normal;
}

.choice-row,
.choice-grid,
.partner-list {
  display: grid;
  gap: 12px;
}

.choice-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-grid,
.partner-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-card,
.partner-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.choice-card input,
.partner-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card span,
.partner-card .card-content {
  display: block;
  border-radius: 18px;
  border: 1px solid rgba(138, 131, 159, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(251, 247, 255, 0.9));
  box-shadow: 0 10px 20px rgba(145, 144, 184, 0.08);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.choice-card span {
  padding: 14px 16px;
}

.choice-card:hover span,
.partner-card:hover .card-content {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(183, 154, 207, 0.45);
  box-shadow: 0 16px 28px rgba(145, 144, 184, 0.15);
}

.choice-card input:checked + span {
  border-color: rgba(137, 176, 217, 0.78);
  background: linear-gradient(135deg, rgba(167, 199, 231, 0.34), rgba(255, 202, 212, 0.3));
  box-shadow: 0 0 0 3px rgba(167, 199, 231, 0.22), 0 16px 28px rgba(145, 144, 184, 0.18);
}

.partner-card .card-content {
  height: 100%;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 250, 247, 0.94)),
    linear-gradient(135deg, rgba(255, 214, 165, 0.12), rgba(205, 180, 219, 0.12));
}

.partner-card input:checked + .card-content {
  transform: translateY(-4px) scale(1.015);
  border-color: rgba(244, 167, 185, 0.9);
  box-shadow: 0 0 0 3px rgba(244, 167, 185, 0.16), 0 18px 34px rgba(145, 144, 184, 0.2);
}

.portrait-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 12px;
}

.portrait-emoji {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 2rem;
  background: linear-gradient(145deg, rgba(255, 202, 212, 0.86), rgba(184, 224, 210, 0.76));
  box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.48);
}

.reaction-badge {
  align-self: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #9a5875;
  font-size: 0.82rem;
  font-weight: bold;
}

.partner-card h3,
.partner-card p,
.result h3,
.result p {
  margin: 0;
}

.partner-card h3 {
  margin-bottom: 6px;
  font-size: 1.25rem;
}

.meta,
.style-line {
  color: var(--muted);
  font-size: 0.95rem;
}

.blurb {
  margin-top: 10px;
}

.matchmake-stage {
  display: grid;
  gap: 18px;
  justify-items: start;
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 250, 247, 0.9)),
    linear-gradient(135deg, rgba(184, 224, 210, 0.18), rgba(205, 180, 219, 0.18));
  border: 1px solid rgba(138, 131, 159, 0.12);
}

.game-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 250, 247, 0.92)),
    linear-gradient(135deg, rgba(255, 202, 212, 0.16), rgba(167, 199, 231, 0.12));
  border: 1px solid rgba(138, 131, 159, 0.12);
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.game-result,
.reaction-status {
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(138, 131, 159, 0.12);
  line-height: 1.5;
}

.timing-track {
  position: relative;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(167, 199, 231, 0.45), rgba(255, 202, 212, 0.55));
  overflow: hidden;
  border: 1px solid rgba(138, 131, 159, 0.14);
}

.timing-zone {
  position: absolute;
  top: 0;
  left: 42%;
  width: 16%;
  height: 100%;
  background: rgba(184, 224, 210, 0.85);
}

.timing-marker {
  position: absolute;
  top: -6px;
  left: 0;
  width: 18px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--creamsicle-deep), var(--blush-deep));
  box-shadow: 0 8px 18px rgba(244, 167, 185, 0.3);
}

.meter-shell {
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(138, 131, 159, 0.14);
  overflow: hidden;
}

.meter-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--mint), var(--denim));
  transition: width 0.12s ease;
}

button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

button {
  color: var(--button-text);
  background: linear-gradient(135deg, var(--creamsicle), var(--blush));
  box-shadow: 0 12px 24px rgba(244, 167, 185, 0.24);
}

.ghost-button {
  color: var(--button-text);
  background: linear-gradient(135deg, rgba(205, 180, 219, 0.62), rgba(184, 224, 210, 0.72));
  box-shadow: 0 10px 20px rgba(137, 176, 217, 0.16);
}

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

button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.result {
  position: relative;
  min-height: 180px;
  border-radius: 22px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 247, 0.96)),
    linear-gradient(135deg, rgba(167, 199, 231, 0.1), rgba(255, 202, 212, 0.12));
  border: 1px solid rgba(138, 131, 159, 0.14);
  overflow: hidden;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.result.empty {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.result.error {
  border-color: rgba(148, 76, 86, 0.26);
  background: linear-gradient(180deg, rgba(255, 247, 248, 0.96), rgba(255, 250, 247, 0.96));
  color: var(--danger);
}

.result.dream::before,
.result.sparkle::before {
  content: "💖 ✨ 💐";
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 1.2rem;
  letter-spacing: 0.18em;
  opacity: 0.72;
  animation: floaty 2.4s ease-in-out infinite;
}

.result.runaway {
  animation: shake 0.45s ease-in-out 2;
}

.result.is-resetting {
  opacity: 0;
  transform: translateY(8px);
}

.result-score {
  margin: 0 0 10px;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1;
  color: var(--lavender-deep);
}

.result-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.result-icon {
  font-size: 1.5rem;
}

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

.breakdown-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(138, 131, 159, 0.12);
}

.breakdown-card strong {
  display: block;
  margin-bottom: 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(138, 131, 159, 0.12);
  color: var(--text);
  font-size: 0.9rem;
}

.chip.is-empty {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
}

.helper-text {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.result-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.result-actions.hidden {
  display: none;
}

.play-again-button {
  min-width: 180px;
  background: linear-gradient(135deg, var(--mint), var(--denim));
  box-shadow: 0 12px 24px rgba(137, 176, 217, 0.2);
}

.play-again-button:hover {
  box-shadow: 0 16px 28px rgba(137, 176, 217, 0.24);
}

.matchmaking-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(76, 62, 92, 0.32);
  backdrop-filter: blur(10px);
}

.matchmaking-overlay.hidden {
  display: none;
}

.gameplay-popup {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(76, 62, 92, 0.24);
  backdrop-filter: blur(8px);
}

.gameplay-popup.hidden {
  display: none;
}

.gameplay-popup-card {
  position: relative;
  width: min(460px, 100%);
  padding: 28px 24px;
  text-align: center;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 247, 0.96));
  box-shadow: 0 28px 60px rgba(76, 62, 92, 0.2);
  animation: slideDown 0.24s ease;
}

.gameplay-popup-card h2 {
  margin: 8px 0 10px;
}

.gameplay-popup-card p {
  margin: 0;
  line-height: 1.6;
}

.gameplay-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(138, 131, 159, 0.16);
  box-shadow: 0 10px 18px rgba(145, 144, 184, 0.14);
  font-size: 1.4rem;
  line-height: 1;
}

.gameplay-popup-close:hover {
  background: rgba(255, 202, 212, 0.72);
}

.popup-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 202, 212, 0.5), rgba(167, 199, 231, 0.42));
  border: 1px solid rgba(138, 131, 159, 0.12);
  font-weight: bold;
}

.matchmaking-card {
  width: min(440px, 100%);
  padding: 30px 24px;
  text-align: center;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 247, 0.94));
  box-shadow: 0 28px 60px rgba(76, 62, 92, 0.22);
}

.matchmaking-card h2 {
  margin: 10px 0 10px;
}

.matchmaking-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.loading-hearts {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 1.8rem;
}

.loading-hearts span {
  animation: bounce 1s ease-in-out infinite;
}

.loading-hearts span:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-hearts span:nth-child(3) {
  animation-delay: 0.3s;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  border-radius: 999px;
  opacity: 0.9;
  animation: confetti-fall 1.8s linear forwards;
  pointer-events: none;
}

.site-footer {
  margin-top: 22px;
  padding: 18px 12px 2px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.site-footer p {
  margin: 4px 0;
}

.site-footer a {
  color: inherit;
}

@keyframes slideFade {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.9;
  }
  100% {
    transform: translateY(240px) rotate(480deg);
    opacity: 0;
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-4px);
  }
}

@media (max-width: 920px) {
  .hero {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions {
    justify-items: start;
  }

  .music-note {
    text-align: left;
  }
}

@media (max-width: 720px) {
  .choice-row,
  .choice-grid,
  .partner-list,
  .breakdown {
    grid-template-columns: 1fr;
  }

  .player-card {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .wizard-nav {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .app {
    width: min(100% - 18px, 1180px);
    padding-top: 18px;
  }

  .hero,
  .instructions,
  .wizard-shell {
    padding: 18px;
    border-radius: 22px;
  }

  .hero h1 {
    line-height: 1.02;
  }

  .wizard-stage {
    min-height: 760px;
  }

  .result {
    padding: 18px;
  }
}
