@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f7f5f2;
  --text: #5c2e2e;
  --text-muted: #9a8f8f;
  --pink: #f4a7b9;
  --pink-dark: #e8899f;
  --lavender: #d4c5f0;
  --lavender-dark: #c4b0e8;
  --card-bg: #eeebf0;
  --white: #ffffff;
}

html,
body {
  min-height: 100vh;
}

body {
  font-family: "Nunito", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
}

#bg-lights {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg-light {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.18;
  will-change: transform;
}

.bg-light-yellow {
  width: min(70vw, 420px);
  height: min(70vw, 420px);
  background: #ffe08a;
  top: -8%;
  left: -12%;
}

.bg-light-blue {
  width: min(65vw, 380px);
  height: min(65vw, 380px);
  background: #8ecfff;
  top: 5%;
  right: -15%;
}

.bg-light-red {
  width: min(75vw, 440px);
  height: min(75vw, 440px);
  background: #ff9a9a;
  bottom: -12%;
  left: 25%;
}

#fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}

.fx-star {
  position: absolute;
  top: -30px;
  animation: starFall linear forwards;
  opacity: 0.85;
  filter: drop-shadow(0 0 4px rgba(255, 215, 100, 0.5));
}

@keyframes starFall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(105vh) rotate(360deg);
    opacity: 0.2;
  }
}

.fx-particle {
  position: absolute;
  pointer-events: none;
  animation: particleBurst var(--life) ease-out forwards;
  transform: translate(0, 0);
}

@keyframes particleBurst {
  0% {
    transform: translate(0, 0) scale(0.3) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--vx), var(--vy)) scale(1) rotate(var(--rot));
    opacity: 0;
  }
}

.page {
  width: 100%;
  max-width: 420px;
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeIn 0.4s ease;
  position: relative;
  z-index: 1;
}

.page.active {
  display: flex;
}

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

.hero-img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 20px;
  margin-bottom: 24px;
}

.hero-video {
  display: block;
  background: var(--card-bg);
}

.hero-video:not(.is-ready) {
  opacity: 0.75;
  animation: videoPulse 1.4s ease-in-out infinite;
}

@keyframes videoPulse {
  0%,
  100% {
    opacity: 0.65;
  }
  50% {
    opacity: 0.9;
  }
}

.hero-img.round {
  border-radius: 50%;
  width: 160px;
  height: 160px;
}

.hero-img.sponge {
  width: 180px;
  height: 180px;
  border-radius: 20px;
  object-fit: cover;
}

.emoji-header {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

h1 {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 12px;
}

h1.small {
  font-size: 1.35rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
  line-height: 1.5;
}

.buttons-area {
  position: relative;
  width: 100%;
  margin-top: 8px;
}

.buttons-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.btn-choice {
  font-size: 1.05rem;
  padding: 14px 36px;
  min-width: 130px;
}

.btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: scale(1.03);
}

.btn:active {
  transform: scale(0.98);
}

.btn-yes {
  background: var(--pink);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(244, 167, 185, 0.4);
}

.btn-yes:hover {
  background: var(--pink-dark);
}

.btn-no {
  background: var(--lavender);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(212, 197, 240, 0.5);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.touch-device .btn-no {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.btn-no.escaping {
  position: fixed;
  transition: none;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(212, 197, 240, 0.7);
  touch-action: none;
}

.btn-no.escaping:hover {
  transform: none;
}

.btn-continue {
  background: var(--pink);
  color: var(--text);
  font-size: 1rem;
  padding: 14px 36px;
  margin-top: 8px;
}

.btn-submit {
  background: var(--pink);
  color: var(--white);
  font-size: 1rem;
  padding: 16px 32px;
  width: 100%;
  margin-top: 8px;
}

.form-group {
  width: 100%;
  text-align: left;
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #ddd;
  border-radius: 14px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--white);
  color: var(--text);
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--pink);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.choice-item {
  background: var(--card-bg);
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 18px 8px 14px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  font-family: inherit;
}

.choice-item:hover {
  transform: scale(1.03);
}

.choice-item.selected {
  border-color: var(--pink);
  background: #fce8ee;
}

.choice-item .emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 6px;
}

.choice-item .name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.ps-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 16px;
  line-height: 1.5;
}

.finale-decor {
  font-size: 1.2rem;
  margin-top: 24px;
  letter-spacing: 4px;
  opacity: 0.7;
}

/* Admin page */
.admin-page {
  max-width: 720px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.admin-page h1 {
  margin-bottom: 24px;
}

.admin-empty {
  color: var(--text-muted);
  padding: 40px;
}

.response-card {
  background: var(--white);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  text-align: left;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.response-card .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.response-card .row {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.response-card .label {
  font-weight: 700;
  min-width: 70px;
}

.back-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--pink-dark);
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover {
  text-decoration: underline;
}

@media (max-width: 380px) {
  .choice-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  h1 {
    font-size: 1.3rem;
  }
}
