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

:root {
  --ocean-deep: #0a1a2f;
  --ocean-mid: #1a3a5c;
  --ocean-light: #2d5a8a;
  --coral: #ff7a59;
  --coral-light: #ffa080;
  --sand: #f5e6d3;
  --foam: #e8f4f8;
  --text-primary: #f5f5f5;
  --text-secondary: #a8b8c8;
  --text-dim: #6b7c8e;
  --card-bg: rgba(20, 38, 60, 0.6);
  --card-border: rgba(100, 160, 220, 0.15);
}

html, body {
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--ocean-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Animated ocean background */
.ocean-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at top, var(--ocean-light), var(--ocean-mid) 40%, var(--ocean-deep) 80%);
}

.ocean-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 122, 89, 0.08), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(100, 180, 220, 0.1), transparent 40%);
  animation: drift 20s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 20px); }
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stage.hidden { display: none; }

/* ===== Landing ===== */
.hero {
  text-align: center;
  padding: 20px 0;
}

.hero-emoji {
  font-size: 72px;
  letter-spacing: -8px;
  margin-bottom: 12px;
  animation: bob 3s ease-in-out infinite;
}

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

.hero-title {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--coral), var(--coral-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 12px;
  font-weight: 600;
}

.hero-desc {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 15px;
}

.captchaa-gate-container {
  margin: 0 auto 20px;
  max-width: 360px;
}

.hero-meta {
  margin-top: 32px;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255, 122, 89, 0.1);
  border: 1px solid rgba(255, 122, 89, 0.3);
  border-radius: 20px;
  font-size: 13px;
  color: var(--coral-light);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s, background 0.2s;
  font-family: inherit;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--coral), var(--coral-light));
  color: #fff;
  box-shadow: 0 4px 20px rgba(255, 122, 89, 0.3);
}

.btn-primary:hover { opacity: 0.9; }

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--ocean-mid);
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover { background: var(--card-bg); }

/* ===== Quiz ===== */
.quiz-header {
  margin-bottom: 24px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-dim);
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--coral-light));
  border-radius: 2px;
  transition: width 0.4s ease;
}

.quiz-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 32px 24px;
}

.question-prompt {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  line-height: 1.4;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px 20px;
  text-align: left;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
}

.option:hover {
  background: rgba(255, 122, 89, 0.08);
  border-color: rgba(255, 122, 89, 0.4);
  transform: translateX(4px);
}

.option-im {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  line-height: 1.4;
  padding: 14px 20px;
}

.option-im .option-sep {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 4px;
  opacity: 0.5;
}

.result-easter-egg {
  margin-top: -8px;
  margin-bottom: 20px;
  padding: 10px 14px;
  background: rgba(255, 122, 89, 0.08);
  border: 1px dashed rgba(255, 122, 89, 0.3);
  border-radius: 10px;
  font-size: 12px;
  color: var(--coral-light);
  text-align: center;
  letter-spacing: 0.3px;
}

.option:active { transform: scale(0.98); }

/* ===== Result ===== */
.result-card {
  background: linear-gradient(180deg, rgba(40, 70, 110, 0.6), rgba(20, 38, 60, 0.8));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 40px 28px;
  text-align: center;
  margin-bottom: 20px;
}

.result-emoji {
  font-size: 80px;
  margin-bottom: 16px;
  animation: bob 3s ease-in-out infinite;
}

.result-code {
  font-size: 16px;
  font-weight: 700;
  color: var(--coral);
  letter-spacing: 6px;
  margin-bottom: 8px;
  font-family: "SF Mono", "Courier New", monospace;
}

.result-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.result-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 16px;
}

.result-tagline {
  font-size: 18px;
  font-style: italic;
  color: var(--coral-light);
  margin-bottom: 24px;
  padding: 0 8px;
}

.result-desc {
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.7;
  text-align: left;
  margin-bottom: 24px;
  padding: 16px 18px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.result-axes {
  margin-bottom: 24px;
}

.axis {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
}

.axis-label {
  flex: 1;
  text-align: right;
  color: var(--text-dim);
}

.axis-label.active { color: var(--coral); font-weight: 700; }

.axis-bar {
  flex: 2;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.axis-fill {
  position: absolute;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--coral-light));
  border-radius: 3px;
}

.axis-label:first-child { text-align: right; }
.axis-label:last-child { text-align: left; }

.result-match {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.match-block {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 14px 12px;
}

.match-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.match-types {
  font-family: "SF Mono", monospace;
  font-weight: 700;
  color: var(--coral-light);
  letter-spacing: 2px;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 20px;
  font-size: 12px;
  color: #34d399;
  font-weight: 600;
}

.result-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.result-actions .btn { flex: 1; }

.share-preview {
  text-align: center;
  margin-top: 20px;
}

.share-preview.hidden { display: none; }

#share-canvas {
  width: 100%;
  max-width: 360px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.share-hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-dim);
}

/* ===== Footer ===== */
footer {
  max-width: 560px;
  margin: 40px auto 0;
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.8;
}

footer a { color: var(--text-secondary); text-decoration: none; }
footer a:hover { color: var(--coral-light); }

/* Override CAPTCHAA widget for hero container */
.captchaa-gate-container .captchaa-gate {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-color: var(--card-border);
}

/* Responsive */
@media (max-width: 480px) {
  .hero-title { font-size: 48px; }
  .result-title { font-size: 26px; }
  .result-card { padding: 32px 20px; }
  .quiz-card { padding: 24px 18px; }
  .question-prompt { font-size: 18px; }
}
