:root {
  --ink: #2a1a2e;
  --cream: #fff6ef;
  --rose: #ff6b8b;
  --rose-deep: #e2456a;
  --gold: #ffd28a;
  --teal: #38c6b4;
  --glass: rgba(255, 255, 255, 0.16);
  --glass-strong: rgba(255, 255, 255, 0.3);
  --shadow: 0 20px 60px rgba(40, 15, 40, 0.35);
}

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

html,
body {
  height: 100%;
}

body {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  color: var(--cream);
  background: #1c1020 url("https://assets.friendortrend.dedyn.io/createbg.jpg") center / cover no-repeat fixed;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, rgba(28, 16, 32, 0.62), rgba(28, 16, 32, 0.82));
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(94vw, 540px);
  text-align: center;
}

.logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
  animation: floaty 4s ease-in-out infinite;
}

.logo-sm {
  width: 54px;
  height: 54px;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2.2rem;
  margin: 14px 0 6px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.tagline {
  opacity: 0.85;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 26px;
}

.card {
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-strong);
  border-radius: 26px;
  padding: 30px 26px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.6s ease both;
}

.btn {
  border: none;
  border-radius: 16px;
  padding: 15px 22px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(120deg, var(--rose), var(--rose-deep));
  color: #fff;
  box-shadow: 0 12px 30px rgba(226, 69, 106, 0.45);
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.14);
  color: var(--cream);
  border: 1px solid var(--glass-strong);
  width: 100%;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.24);
}

.field {
  width: 100%;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1px solid var(--glass-strong);
  background: rgba(255, 255, 255, 0.14);
  color: var(--cream);
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 16px;
  text-align: center;
}

.field::placeholder {
  color: rgba(255, 246, 239, 0.6);
}

.field:focus {
  outline: none;
  border-color: var(--gold);
}

/* Quiz play */
.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
  margin-bottom: 20px;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--rose));
  transition: width 0.4s ease;
}

.q-count {
  font-size: 0.8rem;
  letter-spacing: 1px;
  opacity: 0.8;
  margin-bottom: 12px;
}

.q-text {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  margin-bottom: 22px;
  min-height: 2.4em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.answers {
  display: grid;
  gap: 12px;
}

.answer {
  padding: 15px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--glass-strong);
  cursor: pointer;
  text-align: left;
  font-size: 0.98rem;
  transition: all 0.18s ease;
}

.answer:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

.answer.selected {
  border-color: var(--gold);
  background: rgba(255, 210, 138, 0.28);
}

/* Result */
.score-ring {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin: 6px auto 18px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--gold) var(--pct, 0%), rgba(255, 255, 255, 0.16) 0);
  animation: pop 0.7s ease both;
}

.score-ring .inner {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: rgba(28, 16, 32, 0.82);
  display: grid;
  place-items: center;
  flex-direction: column;
}

.score-ring .inner b {
  font-size: 2.2rem;
  font-family: "Playfair Display", serif;
}

.score-ring .inner small {
  opacity: 0.8;
  font-size: 0.75rem;
}

.result-msg {
  font-size: 1.05rem;
  margin-bottom: 20px;
  opacity: 0.92;
}

.big-emoji {
  font-size: 3rem;
  animation: pop 0.6s ease both;
}

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

.hidden {
  display: none !important;
}

.stack > * + * {
  margin-top: 12px;
}

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

.slide {
  animation: slideIn 0.4s ease both;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 30px auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.redirect-note {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 14px;
}
