:root {
  --pink: #ff6fd8;
  --cyan: #00d2ff;
  --dark-1: #0f0c29;
  --dark-2: #302b63;
  --dark-3: #24243e;
  --panel: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.13);
}

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

html {
  color-scheme: dark;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(135deg, var(--dark-1), var(--dark-2), var(--dark-3));
  color: #fff;
  font-family: Poppins, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

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

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.32;
  animation: float 14s ease-in-out infinite;
}

.blob:nth-child(1) {
  width: 420px;
  height: 420px;
  top: -12%;
  left: -8%;
  background: var(--pink);
}

.blob:nth-child(2) {
  width: 360px;
  height: 360px;
  right: -7%;
  bottom: -10%;
  background: #3813c2;
  animation-delay: -5s;
}

.blob:nth-child(3) {
  width: 300px;
  height: 300px;
  top: 42%;
  left: 48%;
  background: var(--cyan);
  animation-delay: -9s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(24px, -24px) scale(1.06); }
}

.top-bar {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(15, 12, 41, 0.72);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
}

.edition-badge {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.edition-badge:empty {
  display: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 38px;
  object-fit: contain;
}

.language-select {
  min-height: 34px;
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.language-select option {
  background: #1a1740;
  color: #fff;
}

.edition-badge {
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.admin-button {
  display: none;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  cursor: pointer;
}

body.admin-mode .admin-button {
  display: inline-flex;
}

.container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 92px 20px 42px;
}

.screen {
  display: none;
  width: 100%;
}

.screen.active {
  display: block;
  animation: enter 0.42s ease both;
}

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

.welcome,
.result {
  text-align: center;
}

.welcome-emojis {
  margin-bottom: 18px;
  font-size: clamp(2.5rem, 10vw, 3.4rem);
  letter-spacing: 0.08em;
}

.eyebrow {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 16px;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(2rem, 7vw, 3.2rem);
  font-weight: 900;
  line-height: 1.08;
}

.welcome-copy {
  max-width: 570px;
  margin: 0 auto 28px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 1.02rem;
  line-height: 1.7;
}

.privacy-note {
  max-width: 560px;
  margin: 18px auto 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.72rem;
  line-height: 1.55;
}

.button {
  min-height: 50px;
  padding: 13px 28px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.button.primary {
  padding-inline: 42px;
  background: linear-gradient(135deg, var(--pink), #3813c2);
  box-shadow: 0 10px 34px rgba(255, 111, 216, 0.32);
}

.button.secondary {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

.button.save {
  background: linear-gradient(135deg, var(--cyan), #3813c2);
  box-shadow: 0 8px 28px rgba(0, 210, 255, 0.24);
}

.progress {
  margin-bottom: 24px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.82rem;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.progress-fill {
  width: 12.5%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  transition: width 0.3s ease;
}

.question-card {
  padding: 34px 28px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.question-card h2 {
  margin-bottom: 24px;
  font-size: 1.25rem;
  line-height: 1.5;
}

.options {
  display: grid;
  gap: 11px;
}

.option {
  width: 100%;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
}

.option:hover,
.option.selected {
  border-color: rgba(255, 111, 216, 0.75);
  background: rgba(255, 111, 216, 0.12);
  transform: translateX(3px);
}

.result-card {
  width: min(100%, 540px);
  min-height: 760px;
  margin: 0 auto 24px;
  padding: 0 28px 34px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 34px;
  background:
    radial-gradient(circle at 88% 64%, rgba(0, 210, 255, 0.42), transparent 35%),
    linear-gradient(155deg, var(--result-1), #4968d6 48%, var(--result-2));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.result-image {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 315px;
  margin: 0 -28px 14px;
  overflow: hidden;
}

.result-image img {
  width: min(118%, 570px);
  max-width: none;
  margin-top: -86px;
  filter: saturate(1.08) contrast(1.04);
}

.result-label,
.flavor-heading {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.result-title {
  margin: 14px 0 20px;
  padding: 12px;
  background: linear-gradient(90deg, rgba(169, 50, 242, 0.82), rgba(0, 210, 216, 0.82));
  font-size: clamp(1.65rem, 6vw, 2.2rem);
  font-weight: 900;
  line-height: 1.15;
}

.result-desc {
  margin: 0 auto 30px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.98rem;
  line-height: 1.8;
}

.flavor-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 11px;
  margin: 18px 0 30px;
}

.flavor-tag {
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 0.9rem;
  font-weight: 700;
}

.result-brand {
  display: flex;
  justify-content: center;
  min-height: 28px;
}

.result-brand img {
  width: auto;
  height: 28px;
  object-fit: contain;
  opacity: 0.72;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 12, 41, 0.94);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-overlay {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  width: min(100%, 650px);
  max-height: 85vh;
  padding: 30px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(145deg, #1a1740, #252150);
}

.modal h2 {
  margin-bottom: 6px;
}

.modal-sub {
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.82rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 1.8rem;
}

.stat span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 28px;
  align-items: center;
  gap: 9px;
  margin: 9px 0;
  font-size: 0.72rem;
}

.bar-label {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
}

.modal-actions button {
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  cursor: pointer;
}

.modal-actions .danger {
  color: #ff8b8b;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 520px) {
  .top-bar { padding: 10px 14px; }
  .edition-badge { display: none; }
  .brand-logo { height: 34px; }
  .container { padding: 82px 14px 28px; }
  .question-card { padding: 26px 18px; }
  .result-card { min-height: 700px; padding: 0 18px 28px; border-radius: 28px; }
  .result-image { height: 270px; margin-inline: -18px; }
  .result-image img { width: 124%; margin-top: -70px; }
  .bar-row { grid-template-columns: 95px 1fr 24px; }
  .modal { padding: 24px 18px; }
}
