@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Playfair+Display:wght@700;800&family=Space+Mono:wght@700&display=swap');

:root {
  --parchment: #f5deb3;
  --ink: #1c1917;
  --teal: #0e7490;
  --blood-red: #b91c1c;
  --card-bg-color: #fcf6e8;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  background: var(--ink) url('https://offertabs.s3.amazonaws.com/offer/hsk3g9/site/media/69f11d88656aa1.80788908.jpg') center/cover no-repeat fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
}

#app {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hidden { display: none !important; }

/* Views & Cards */
.card {
  width: 100%;
  background-color: var(--card-bg-color);
  background-image: url('https://offertabs.s3.amazonaws.com/offer/hsk3g9/site/media/69f11d8965a609.81811443.jpg');
  background-blend-mode: multiply;
  border-radius: 20px;
  padding: 50px 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  text-align: center;
  box-sizing: border-box;
  position: relative;
  animation: fadeIn 0.4s ease-out;
}

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

@media (max-width: 600px) {
  .card { padding: 40px 25px; }
}

/* Typography */
h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  color: var(--ink);
  margin-top: 0;
}

h1 { font-size: 2.8rem; line-height: 1.1; margin-bottom: 15px; font-weight: 800; }
h2 { font-size: 1.8rem; margin-bottom: 20px; font-weight: 700; }
p { line-height: 1.6; margin-bottom: 24px; font-size: 1.05rem; }

.badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(14, 116, 144, 0.1);
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 24px;
  border: 1px solid rgba(14, 116, 144, 0.2);
}

.gradient-text {
  background: linear-gradient(135deg, var(--teal), var(--blood-red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Buttons */
button {
  background: var(--teal);
  color: #fff;
  border: none;
  padding: 16px 28px;
  font-size: 1.1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(14, 116, 144, 0.3);
}

button:hover {
  background: #0b5f76;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(14, 116, 144, 0.4);
}

/* Quiz Header */
#quiz-header {
  width: 100%;
  margin-bottom: 24px;
  background: rgba(28, 25, 23, 0.85);
  backdrop-filter: blur(10px);
  padding: 16px 24px;
  border-radius: 14px;
  color: #fff;
  box-sizing: border-box;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
}

.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: var(--parchment);
  width: 0%;
  transition: width 0.4s ease;
}

.question-counter {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--parchment);
  text-align: left;
}

/* Timer */
.timer-ring {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 0 auto 24px;
}
.timer-ring svg { width: 60px; height: 60px; }
.timer-ring circle { transition: stroke-dashoffset 1s linear; }
.timer-text {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  display: flex; justify-content: center; align-items: center;
  font-family: 'Space Mono', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blood-red);
}

/* Choices */
.choices-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.choice-btn {
  background: rgba(255,255,255,0.7);
  color: var(--ink);
  border: 2px solid rgba(28,25,23,0.1);
  box-shadow: none;
  text-align: left;
  padding: 18px 24px;
  border-radius: 12px;
}

.choice-btn:hover {
  background: rgba(255,255,255,0.95);
  transform: none;
  border-color: var(--teal);
}

.choice-btn.correct {
  background: #dcfce7;
  border-color: #16a34a;
  color: #166534;
}

.choice-btn.wrong {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
}

/* Feedback Panel */
#feedback-panel {
  background: rgba(28,25,23,0.05);
  padding: 24px;
  border-radius: 12px;
  border-left: 4px solid var(--teal);
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease-out;
}

#fun-fact-text {
  font-size: 1rem;
  margin-bottom: 20px;
  font-style: italic;
  font-weight: 600;
  color: var(--ink);
}

/* Forms */
input[type="text"], input[type="email"] {
  width: 100%;
  padding: 16px 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(28,25,23,0.2);
  border-radius: 12px;
  font-size: 1.05rem;
  font-family: inherit;
  background: rgba(255,255,255,0.8);
  box-sizing: border-box;
  transition: all 0.3s ease;
}

input[type="text"]:focus, input[type="email"]:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(14,116,144,0.1);
  background: #fff;
}

/* Results */
.score-display {
  font-size: 3.5rem;
  font-family: 'Playfair Display', serif;
  font-weight: 800;
  color: var(--blood-red);
  margin-bottom: 10px;
}

.percentile-text { font-size: 1.2rem; }
.result-desc { font-style: italic; color: var(--teal); font-weight: 600; }

.leaderboard {
  background: rgba(255,255,255,0.6);
  border-radius: 12px;
  padding: 24px;
  margin-top: 30px;
  text-align: left;
  border: 1px solid rgba(0,0,0,0.05);
}

.leaderboard h3 { font-size: 1.3rem; margin-bottom: 15px; text-align: center; }
.leaderboard ul { list-style: none; padding: 0; margin: 0; }
.leaderboard li {
  display: flex; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  font-weight: 600;
}
.leaderboard li:last-child { border-bottom: none; }

/* Share Panel */
.share-panel {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.social-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.social-btn {
  flex: 1;
  padding: 12px;
  font-size: 0.95rem;
  margin-bottom: 0;
  box-shadow: none;
}
.social-btn:hover { transform: translateY(-2px); }
.x-btn { background: #000; }
.x-btn:hover { background: #333; }
.wa-btn { background: #25D366; }
.wa-btn:hover { background: #1ebc5a; }
.email-btn { background: #64748b; }
.email-btn:hover { background: #475569; }

.share-row { display: flex; gap: 12px; }
.share-row input { flex: 1; margin: 0; }
.share-row button { width: auto; margin: 0; padding: 0 24px; }

/* Loading State */
#loading-state {
  background: var(--card-bg-color);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  font-weight: 600;
  color: var(--teal);
  text-align: center;
}

#wbx-powered-by-slot {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.error-card { color: var(--blood-red); font-weight: 600; }