:root {
  --bg-1: #1f062f;
  --bg-2: #41105d;
  --bg-3: #7e165e;
  --bg-4: #ff5fa2;
  --bg-5: #ff9b8a;
  --card: rgba(42, 13, 54, 0.70);
  --card-border: rgba(255, 225, 242, 0.24);
  --panel: rgba(255, 255, 255, 0.07);
  --panel-border: rgba(255, 235, 246, 0.14);
  --text: #fff8fc;
  --muted: #ffe1ef;
  --soft: #ffd6ea;
  --accent: #ff6fc2;
  --accent-2: #ffb29b;
  --accent-3: #c9b4ff;
  --danger: #ffd0e3;
  --success: #e3ffe9;
  --shadow: 0 36px 90px rgba(22, 2, 24, 0.48);
}

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

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 14%, rgba(255, 120, 194, 0.45), transparent 26%),
    radial-gradient(circle at 86% 10%, rgba(255, 176, 155, 0.34), transparent 24%),
    radial-gradient(circle at 85% 78%, rgba(210, 155, 255, 0.24), transparent 28%),
    radial-gradient(circle at 15% 80%, rgba(255, 114, 164, 0.20), transparent 24%),
    linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 24%, var(--bg-3) 52%, var(--bg-4) 78%, var(--bg-5) 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 220% 220%;
  animation: dreamyShift 16s ease-in-out infinite alternate;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
  animation: floatGlow 12s ease-in-out infinite;
}

body::before {
  top: -90px;
  left: -120px;
  background: rgba(255, 105, 180, 0.44);
}

body::after {
  right: -140px;
  bottom: -120px;
  background: rgba(255, 196, 153, 0.34);
  animation-delay: -6s;
}

.bg-vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 30%, rgba(34, 3, 31, 0.34) 100%),
    linear-gradient(rgba(255,255,255,0.02), rgba(255,255,255,0.02));
}

.bg-romance {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
  background:
    radial-gradient(circle at 22% 20%, rgba(255,255,255,0.14), transparent 8%),
    radial-gradient(circle at 74% 26%, rgba(255,255,255,0.10), transparent 7%),
    radial-gradient(circle at 30% 72%, rgba(255,255,255,0.08), transparent 6%),
    radial-gradient(circle at 82% 68%, rgba(255,255,255,0.08), transparent 8%);
}

.container {
  width: 100%;
  max-width: 900px;
  position: relative;
  z-index: 1;
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: 36px;
  padding: 54px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.03) 28%, rgba(255,255,255,0.02)),
    linear-gradient(135deg, rgba(255, 111, 194, 0.14), rgba(255, 178, 155, 0.08) 44%, rgba(201, 180, 255, 0.08)),
    var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 219, 239, 0.22), transparent 18%),
    radial-gradient(circle at 86% 18%, rgba(255, 214, 189, 0.16), transparent 16%),
    radial-gradient(circle at 78% 88%, rgba(201, 180, 255, 0.15), transparent 18%);
}

.card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 35px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.eyebrow,
h1,
.subtitle,
.message,
.footer-note,
.meta,
.clue-wrap {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin-bottom: 18px;
  font-size: 0.92rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffe5f2;
  text-shadow: 0 0 24px rgba(255, 143, 216, 0.30);
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.035em;
  max-width: 780px;
  margin-bottom: 16px;
  text-wrap: balance;
  color: transparent;
  background-image: linear-gradient(135deg, #fff8fc 0%, #ffd8ec 34%, #ffe6d3 65%, #f7d5ff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  text-shadow: 0 14px 34px rgba(34, 3, 31, 0.18);
}

.subtitle {
  max-width: 740px;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: clamp(1rem, 1.55vw, 1.16rem);
  line-height: 1.9;
}

.panel {
  position: relative;
  z-index: 1;
  border-radius: 28px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03) 40%, rgba(255,255,255,0.02)),
    linear-gradient(135deg, rgba(255, 111, 194, 0.10), rgba(255, 178, 155, 0.06) 42%, rgba(201, 180, 255, 0.05)),
    var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

input {
  flex: 1 1 280px;
  min-width: 0;
  height: 62px;
  padding: 0 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 235, 246, 0.18);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.09), rgba(255,255,255,0.04)),
    rgba(255,255,255,0.04);
  color: var(--text);
  outline: none;
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

input::placeholder {
  color: rgba(255, 248, 252, 0.52);
}

input:focus {
  border-color: rgba(255, 194, 228, 0.50);
  box-shadow:
    0 0 0 4px rgba(255, 126, 192, 0.12),
    0 12px 24px rgba(54, 7, 46, 0.10);
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.05));
  transform: translateY(-1px);
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease, opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-btn,
.continue-btn {
  height: 62px;
  padding: 0 26px;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 700;
}

.primary-btn {
  color: #3b0829;
  background: linear-gradient(135deg, #ff86c8 0%, #ffb39f 52%, #f6d2ff 100%);
  box-shadow:
    0 16px 34px rgba(50, 7, 33, 0.28),
    inset 0 1px 0 rgba(255,255,255,0.35);
}

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

.continue-btn {
  width: 100%;
  margin-top: 18px;
  display: none;
  color: var(--text);
  border: 1px solid rgba(255, 235, 246, 0.18);
  background: linear-gradient(135deg, rgba(255, 134, 200, 0.18), rgba(255, 179, 159, 0.12), rgba(201, 180, 255, 0.12));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 10px 26px rgba(42, 4, 27, 0.18);
}

.continue-btn.show {
  display: block;
}

.meta {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: #ffe4f0;
  font-size: 0.95rem;
}

.puzzle-tile {
    width: 80px !important;
    height: 80px !important;
    background-image: var(--puzzle-img);
    background-size: 240px 240px !important; /* 3 x 80px */
    border-radius: 6px;
    cursor: grab;
    touch-action: none;
    z-index: 10;
}

.puzzle-tile.dragging {
    pointer-events: none; /* Crucial para o JS detectar o que está embaixo */
    opacity: 0.8;
    transform: scale(1.1);
}

.puzzle-tile.locked {
    cursor: default;
    z-index: 5;
    border: 1px solid rgba(255,255,255,0.1);
}

.carousel-container {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.carousel-track {
    display: flex;
    gap: 15px;
    padding: 10px;
    min-width: max-content;
}

.message {
  min-height: 68px;
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 235, 246, 0.12);
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  display: flex;
  align-items: center;
  line-height: 1.75;
  font-size: 0.98rem;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.message.error {
  border-color: rgba(255, 208, 227, 0.24);
  background: linear-gradient(135deg, rgba(255, 160, 205, 0.10), rgba(255, 219, 202, 0.05));
}

.message.success {
  border-color: rgba(227, 255, 233, 0.24);
  background: linear-gradient(135deg, rgba(227, 255, 233, 0.10), rgba(255,255,255,0.04));
}

.clue-wrap {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px dashed rgba(255, 224, 239, 0.22);
  background: linear-gradient(135deg, rgba(255, 134, 200, 0.10), rgba(255, 179, 159, 0.06), rgba(201, 180, 255, 0.06));
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.clue-wrap.show {
  display: flex;
}

.clue-label {
  color: #ffe5f2;
  font-size: 0.9rem;
}

.clue-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  color: #fff0f8;
  text-shadow: 0 0 20px rgba(255, 214, 240, 0.18);
}

.footer-note {
  margin-top: 30px;
  text-align: center;
  color: rgba(255, 248, 252, 0.72);
  font-size: 0.92rem;
}

@keyframes floatGlow {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-22px) scale(1.06); }
}

@keyframes dreamyShift {
  0% {
    background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 50%;
  }
  100% {
    background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 100% 50%;
  }
}

@media (max-width: 720px) {
  body {
    padding: 18px;
  }

  .card {
    padding: 28px;
    border-radius: 28px;
  }

  .card::after {
    border-radius: 27px;
  }

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

  .meta,
  .clue-wrap {
    align-items: flex-start;
  }

  .clue-text {
    letter-spacing: 0.12em;
  }
}
