/* ---------- Tokens ---------- */
:root {
  --pink-50: #fff5f9;
  --pink-100: #ffe6f0;
  --pink-200: #ffd1e3;
  --pink-300: #ffb3d1;
  --pink-500: #ff7aa8;
  --rose-600: #e0457f;
  --plum: #5b2a47;
  --plum-soft: #8a5a75;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(224, 69, 127, 0.18);
  --radius: 28px;
  --font-display: "Fredoka", "Trebuchet MS", sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--plum);
  background-color: var(--pink-200);
  background-image:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.75) 0 90px, transparent 91px),
    radial-gradient(circle at 85% 10%, rgba(255, 255, 255, 0.55) 0 70px, transparent 71px),
    radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.55) 0 110px, transparent 111px),
    radial-gradient(rgba(255, 255, 255, 0.7) 2.5px, transparent 3px),
    linear-gradient(180deg, #ffdbe9 0%, #ffc4dc 100%);
  background-size: auto, auto, auto, 34px 34px, auto;
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ---------- Decoração flutuante ---------- */
.decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.decor span {
  position: absolute;
  opacity: 0.55;
  user-select: none;
  animation: float var(--dur, 9s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-14px) rotate(calc(var(--rot, 0deg) + 8deg)); }
}

/* ---------- Layout ---------- */
.app {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 24px 16px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.screen { display: none; }
.screen.is-active {
  display: block;
  /* centra na vertical; se o conteúdo for maior que o ecrã, faz scroll normalmente */
  margin-top: auto;
  margin-bottom: auto;
  width: 100%;
  animation: pop 0.35s ease-out;
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Cartões ---------- */
.card {
  position: relative;
  background: rgba(255, 255, 255, 0.88);
  border: 3px solid var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px;
  backdrop-filter: blur(4px);
}

.card--hero { text-align: center; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--plum);
}

h1 { font-size: clamp(2.2rem, 9vw, 3rem); color: var(--rose-600); }
h2 { font-size: clamp(1.5rem, 6vw, 1.9rem); }
h3 { font-size: 1.15rem; color: var(--rose-600); margin-bottom: 8px; }

p { margin: 0 0 12px; }

.muted { color: var(--plum-soft); }
.sub { margin: 14px 0 8px; color: var(--plum-soft); font-weight: 600; }
.hint { margin-top: 14px; color: var(--rose-600); font-weight: 700; }
.note { font-size: 0.92rem; color: var(--plum-soft); }

/* ---------- Botões ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  display: inline-block;
  font: 600 1.05rem var(--font-display);
  color: var(--white);
  background: linear-gradient(180deg, #ff8db5, var(--rose-600));
  border: 0;
  border-radius: 999px;
  padding: 13px 26px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 0 #b8325f, 0 10px 18px rgba(224, 69, 127, 0.3);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover { transform: translateY(-2px); }
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b8325f, 0 4px 8px rgba(224, 69, 127, 0.3);
}

.btn--ghost {
  color: var(--rose-600);
  background: var(--white);
  box-shadow: 0 6px 0 var(--pink-300), 0 10px 18px rgba(224, 69, 127, 0.15);
}
.btn--ghost:active { box-shadow: 0 2px 0 var(--pink-300); }

.btn--menu {
  width: 100%;
  text-align: left;
  padding: 15px 22px;
}

.btn:disabled { opacity: 0.6; cursor: wait; }

.menu {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.back {
  font: 600 0.95rem var(--font-display);
  color: var(--rose-600);
  background: var(--pink-100);
  border: 0;
  border-radius: 999px;
  padding: 7px 16px;
  margin-bottom: 14px;
  cursor: pointer;
}

.card--hero > .back { display: block; margin-left: 0; }

/* ---------- Focus visível ---------- */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--plum);
  outline-offset: 3px;
}

/* ---------- Gifs ---------- */
.gif-wrap {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}
.gif-wrap--top { margin: 0 0 16px; }

.gif {
  width: 240px;
  height: 240px;
  max-width: 100%;
  border: 0;
  border-radius: 22px;
  background: var(--pink-100);
}

/* ---------- Sobre mim ---------- */
.block {
  padding: 16px 0;
  border-top: 2px dashed var(--pink-200);
}
.block:first-of-type { border-top: 0; padding-top: 4px; }

.facts, .chips, .liked {
  list-style: none;
  margin: 0;
  padding: 0;
}

.facts li {
  padding: 6px 0;
}
.facts li span {
  display: inline-block;
  min-width: 78px;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--rose-600);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips li {
  background: var(--pink-100);
  border: 2px solid var(--pink-200);
  border-radius: 999px;
  padding: 4px 14px;
  font-weight: 600;
}
.chips--alt li {
  background: var(--white);
  border-color: var(--pink-500);
}

.nicks dt {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--rose-600);
  margin-top: 10px;
}
.nicks dd { margin: 2px 0 0; }

/* ---------- Frases ---------- */
.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.chip-btn {
  font: 600 1rem var(--font-display);
  color: var(--plum);
  background: var(--pink-100);
  border: 2px solid var(--pink-300);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}
.chip-btn[aria-pressed="true"] {
  background: var(--rose-600);
  border-color: var(--rose-600);
  color: var(--white);
}

.quote {
  margin: 18px 0 0;
  padding: 18px 20px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.4;
  text-align: center;
  background: var(--pink-100);
  border: 3px dashed var(--pink-500);
  border-radius: 22px;
  animation: pop 0.3s ease-out;
}

/* ---------- Formulários ---------- */
.field {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.field label,
.field legend,
.field .label {
  display: block;
  padding: 0;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--rose-600);
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: 600 1rem var(--font-body);
  color: var(--plum);
  background: var(--white);
  border: 2px solid var(--pink-300);
  border-radius: 16px;
  padding: 11px 14px;
}

textarea { resize: vertical; }

.opt {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin: 0 18px 4px 0 !important;
  font-family: var(--font-body) !important;
  font-weight: 700 !important;
  color: var(--plum) !important;
  cursor: pointer;
}
.opt input { accent-color: var(--rose-600); width: 20px; height: 20px; }

.chip-check { cursor: pointer; }
.chip-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.chip-check span {
  display: inline-block;
  padding: 7px 15px;
  font: 600 1rem var(--font-body);
  color: var(--plum);
  background: var(--pink-100);
  border: 2px solid var(--pink-300);
  border-radius: 999px;
}
.chip-check input:checked + span {
  background: var(--rose-600);
  border-color: var(--rose-600);
  color: var(--white);
}
.chip-check input:focus-visible + span {
  outline: 3px solid var(--plum);
  outline-offset: 3px;
}

/* listas com "+ adicionar" */
.multi-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.multi-remove {
  flex: 0 0 auto;
  width: 44px;
  font-size: 1.1rem;
  color: var(--rose-600);
  background: var(--pink-100);
  border: 2px solid var(--pink-300);
  border-radius: 14px;
  cursor: pointer;
}
.multi-add {
  font: 600 0.95rem var(--font-display);
  color: var(--rose-600);
  background: transparent;
  border: 2px dashed var(--pink-500);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
}

.form-error {
  color: #b3203f;
  font-weight: 700;
  text-align: center;
}

/* ---------- Resultado ---------- */
.percent {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(4.5rem, 24vw, 7rem);
  line-height: 1;
  color: var(--rose-600);
  margin: 10px 0 14px;
}
.result-msg {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.35;
  max-width: 24ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- O que gostei ---------- */
.liked li {
  padding: 16px 18px;
  margin-bottom: 14px;
  background: var(--pink-100);
  border-left: 8px solid var(--pink-500);
  border-radius: 18px;
}
.liked li:last-child { margin-bottom: 0; }
.liked p { margin: 0; }

/* ---------- Mistério ---------- */
.mystery-text {
  margin: 24px auto 8px;
  max-width: 30ch;
  font-weight: 700;
}

/* ---------- Estrelas ---------- */
.stars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 10px 0 20px;
}
.star {
  font-size: 2.8rem;
  line-height: 1;
  color: var(--pink-200);
  background: none;
  border: 0;
  padding: 2px 4px;
  cursor: pointer;
  text-shadow: 0 2px 0 rgba(224, 69, 127, 0.25);
  transition: transform 0.12s ease, color 0.12s ease;
}
.star.is-on { color: #ffb400; }
.star:hover { transform: scale(1.15); }

.card--hero .field { text-align: left; }

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  .decor span { animation: none; }
  .screen.is-active, .quote { animation: none; }
  .btn, .star { transition: none; }
}

@media (max-width: 380px) {
  .card { padding: 22px 16px; }
  .gif { width: 200px; height: 200px; }
}
