:root {
  --bg-1: #0b3d2e;
  --bg-2: #145a41;
  --card: rgba(255, 255, 255, 0.12);
  --card-border: rgba(255, 255, 255, 0.18);
  --text: #f7f7f2;
  --muted: #dfe9dd;
  --accent: #f5d27b;
  --accent-2: #fff3d1;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 35%),
    radial-gradient(circle at top right, rgba(245, 210, 123, 0.16), transparent 30%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  overflow-x: hidden;
  position: relative;
}

.floating-lights {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.22) 0 2px, transparent 2px),
    radial-gradient(circle, rgba(245,210,123,0.14) 0 1px, transparent 1px);
  background-size: 120px 120px, 80px 80px;
  animation: drift 16s linear infinite;
  opacity: 0.6;
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(-120px); }
}

.app-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 32px);
}

.card {
  width: min(720px, 100%);
  max-width: 100%;
  display: none;
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 28px;
  padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow);
  text-align: center;
}

.card.active {
  display: block;
  animation: fadeUp 0.45s ease;
}

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

.moon {
  width: clamp(72px, 18vw, 100px);
  height: clamp(72px, 18vw, 100px);
  margin: 0 auto 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff9e8, #f5d27b 60%, #ddba65);
  position: relative;
  box-shadow: 0 0 40px rgba(245, 210, 123, 0.35);
}

.moon::after {
  content: "";
  position: absolute;
  width: calc(100% - 14px);
  height: calc(100% - 14px);
  border-radius: 50%;
  top: 7px;
  left: 22%;
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
}

h2 {
  font-size: clamp(1.6rem, 4.6vw, 2.4rem);
}

h3 {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
}

.lead {
  color: var(--muted);
  font-size: clamp(0.96rem, 2vw, 1rem);
  line-height: 1.8;
  margin: 18px auto 0;
  max-width: 620px;
}

.lead.small {
  font-size: 0.95rem;
  max-width: 520px;
}

.message-box,
.thr-box {
  margin-top: 24px;
  padding: clamp(16px, 2.5vw, 22px);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255,255,255,0.12);
  text-align: left;
}

.message-box p,
.thr-box p {
  margin: 0;
  line-height: 1.9;
  color: var(--text);
  word-break: break-word;
}

.thr-label {
  color: var(--accent-2);
  font-size: 0.95rem;
  margin-bottom: 8px !important;
}

.thr-sub {
  margin-top: 12px !important;
  color: var(--muted) !important;
}

.actions,
.choice-area {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.actions.stacked {
  flex-direction: column;
  align-items: center;
}

.choice-area {
  position: relative;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  overflow: hidden;
  padding: 12px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  min-height: 52px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  max-width: 100%;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ffe8aa);
  color: #1d2c22;
  box-shadow: 0 12px 30px rgba(245, 210, 123, 0.28);
}

.btn-secondary {
  background: rgba(255,255,255,0.12);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.18);
}

.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px dashed rgba(255,255,255,0.28);
}

#forgiveBtn {
  position: relative;
  z-index: 2;
}

#runawayBtn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  white-space: nowrap;
}

.tiny-note {
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(12, 31, 24, 0.92);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 14px 40px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
  z-index: 100;
  text-align: center;
  max-width: calc(100vw - 24px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.confetti-piece {
  position: fixed;
  top: -20px;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  opacity: 0.9;
  z-index: 999;
  animation-name: confettiFall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes confettiFall {
  from {
    transform: translateY(-5vh) rotate(0deg);
    opacity: 1;
  }
  to {
    transform: translateY(110vh) rotate(680deg);
    opacity: 0.15;
  }
}

@media (max-width: 640px) {
  .app-shell {
    align-items: stretch;
    padding: 10px;
  }

  .card {
    border-radius: 22px;
    padding: 18px 14px;
  }

  .lead {
    line-height: 1.7;
  }

  .actions,
  .actions.stacked {
    gap: 12px;
  }

  .actions .btn,
  .actions.stacked .btn,
  #forgiveBtn,
  #runawayBtn {
    width: 100%;
  }

  .choice-area {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    min-height: auto;
    padding: 0;
    overflow: visible;
  }

  #runawayBtn {
    position: relative;
    left: 0;
    top: 0;
    transform: translateX(0);
    right: auto;
    white-space: normal;
  }

  .toast {
    bottom: max(16px, env(safe-area-inset-bottom));
    font-size: 0.92rem;
  }
}
