/* ═══════════════════════════════════════════════════════════════════════════ */
/* CocokGa — style.css                                                        */
/* Design system: Glassmorphic Neon-Dark, Mobile-First                        */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* Colors */
  --c-bg-start:      #09090f;
  --c-bg-end:        #11111d;
  --c-neon-pink:     #ff2a85;
  --c-neon-violet:   #9b51e0;
  --c-neon-cyan:     #00f2fe;
  --c-neon-amber:    #f2994a;
  --c-neon-green:    #39ff85;
  --c-glass-bg:      rgba(255, 255, 255, 0.055);
  --c-glass-border:  rgba(255, 255, 255, 0.13);
  --c-glass-hover:   rgba(255, 255, 255, 0.09);
  --c-text-primary:  #ffffff;
  --c-text-secondary: rgba(255, 255, 255, 0.76);
  --c-text-muted:    rgba(255, 255, 255, 0.48);

  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Radii */
  --r-sm:  8px;
  --r-md:  16px;
  --r-lg:  24px;
  --r-xl:  32px;
  --r-full: 9999px;

  /* Spacing */
  --space-xs:  8px;
  --space-sm:  12px;
  --space-md:  20px;
  --space-lg:  32px;
  --space-xl:  48px;

  /* Transitions */
  --t-fast:   0.15s ease;
  --t-normal: 0.3s ease;
  --t-slow:   0.5s ease;

  /* Max width */
  --max-w: 480px;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  background: #04040a;
  color: var(--c-text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.6;
  display: flex;
  justify-content: center;
  /* subtle grid pattern in bg for desktop */
  background-image:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(155,81,224,0.12) 0%, transparent 70%),
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
}

/* ── Phone frame wrapper ─────────────────────────────────────────────────────── */
.phone-frame {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  background: linear-gradient(160deg, var(--c-bg-start) 0%, var(--c-bg-end) 100%);
  position: relative;
  overflow-x: hidden;
  /* subtle shadow on desktop to feel like a phone */
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 32px 80px rgba(0,0,0,0.8);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: var(--font-display); cursor: pointer; border: none; background: none; }
input, select { font-family: var(--font-body); }

/* ── Utility ────────────────────────────────────────────────────────────────── */
.hidden-element  { display: none !important; }
.hidden-section  { display: none; opacity: 0; }
.gradient-text {
  background: linear-gradient(135deg, var(--c-neon-pink), var(--c-neon-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Section wrapper ────────────────────────────────────────────────────────── */
section {
  width: 100%;
  padding: var(--space-lg) var(--space-md);
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--c-text-primary);
  line-height: 1.3;
}

.section-sub {
  font-size: 14px;
  color: var(--c-text-secondary);
  margin-top: 4px;
}

/* ── Gate section reveal ────────────────────────────────────────────────────── */
.gate-section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow), transform var(--t-slow);
}

.gate-section.revealed {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ── Primary CTA Button ─────────────────────────────────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 17px 28px;
  background: linear-gradient(135deg, var(--c-neon-pink) 0%, var(--c-neon-violet) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(255, 42, 133, 0.38);
  transition: transform var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
  animation: glow-breathe 2.8s infinite ease-in-out;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(255, 42, 133, 0.65);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 0 20px rgba(255, 42, 133, 0.35);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  animation: none;
  box-shadow: none;
}

.btn-primary.btn-gate3 {
  background: linear-gradient(135deg, var(--c-neon-amber) 0%, var(--c-neon-violet) 100%);
  box-shadow: 0 0 22px rgba(242, 153, 74, 0.35);
  animation: glow-breathe-amber 2.8s infinite ease-in-out;
}

.gate3-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.gate3-actions .btn-gate3 {
  min-height: 52px;
  padding: 14px 18px;
  font-size: 15px;
}

.gate3-actions .btn-gate3-both {
  background: linear-gradient(135deg, var(--c-neon-cyan) 0%, var(--c-neon-violet) 100%);
  box-shadow: 0 0 22px rgba(0, 242, 254, 0.3);
}

@keyframes glow-breathe {
  0%, 100% { box-shadow: 0 0 22px rgba(255, 42, 133, 0.38); }
  50%       { box-shadow: 0 0 42px rgba(255, 42, 133, 0.75); }
}

@keyframes glow-breathe-amber {
  0%, 100% { box-shadow: 0 0 22px rgba(242, 153, 74, 0.35); }
  50%       { box-shadow: 0 0 42px rgba(242, 153, 74, 0.65); }
}

/* ── Secondary / icon buttons ──────────────────────────────────────────────── */
.btn-secondary {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  background: var(--c-glass-bg);
  border: 1px solid var(--c-glass-border);
  color: var(--c-text-secondary);
  font-size: 13px;
  transition: background var(--t-fast), color var(--t-fast);
}

.btn-secondary:hover { background: var(--c-glass-hover); color: var(--c-text-primary); }

.btn-icon {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  background: var(--c-glass-bg);
  border: 1px solid var(--c-glass-border);
  color: var(--c-text-secondary);
  transition: background var(--t-fast);
  white-space: nowrap;
}

.btn-icon:hover { background: var(--c-glass-hover); color: var(--c-text-primary); }
.btn-danger     { border-color: rgba(255, 80, 80, 0.3); color: rgba(255, 130, 130, 0.8); }
.btn-danger:hover { background: rgba(255, 80, 80, 0.12); color: #ff8080; }

/* ══════════════════════════════════════════════════════════════════════════════ */
/* SECTION 1 — HERO                                                              */
/* ══════════════════════════════════════════════════════════════════════════════ */
#s-hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  overflow: hidden;
}

.hero-bg-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 20%, rgba(255, 42, 133, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(155, 81, 224, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 70%, rgba(0, 242, 254, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.hero-logo {
  width: 100px;
  height: auto;
  border-radius: var(--r-md);
  margin-bottom: 4px;
  filter: drop-shadow(0 0 20px rgba(255, 42, 133, 0.4));
  animation: logo-float 4s ease-in-out infinite;
}

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

.hero-copywriting {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  margin: var(--space-sm) 0 var(--space-md);
  text-align: center;
}

.hero-lead-text {
  font-family: var(--font-display);
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 900;
  line-height: 1.18;
  color: var(--c-text-primary);
}

.hero-lead-highlight {
  font-family: var(--font-display);
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.25;
  background: linear-gradient(135deg, var(--c-neon-pink), var(--c-neon-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 6px;
}

.social-proof {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-full);
  background: var(--c-glass-bg);
  border: 1px solid var(--c-glass-border);
  backdrop-filter: blur(8px);
}

.proof-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-neon-green);
  box-shadow: 0 0 8px var(--c-neon-green);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.8); }
}

.proof-text {
  font-size: 13px;
  color: var(--c-text-secondary);
}

.hero-cta {
  margin-top: 8px;
  width: auto;
  padding: 16px 36px;
  font-size: 15px;
}

.hero-scroll-hint {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.scroll-arrow {
  font-size: 24px;
  color: var(--c-text-muted);
  animation: bounce-arrow 2s ease-in-out infinite;
  display: block;
}

@keyframes bounce-arrow {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50%       { transform: translateY(8px); opacity: 0.9; }
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* SECTION 2 — INPUT                                                             */
/* ══════════════════════════════════════════════════════════════════════════════ */
#s-input {
  padding-top: var(--space-xl);
}

.input-section-header {
  text-align: left;
}

/* History bar */
.history-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--c-glass-bg);
  border: 1px solid var(--c-glass-border);
  backdrop-filter: blur(12px);
}

.history-bar select {
  flex: 1;
  min-width: 150px;
  background: transparent;
  border: none;
  color: var(--c-text-secondary);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  font-family: var(--font-body);
}

.history-bar select option {
  background: #1a1a2e;
  color: var(--c-text-primary);
}

/* Input card */
.input-card {
  background: var(--c-glass-bg);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--r-lg);
  padding: var(--space-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--t-normal);
}

.input-card:focus-within {
  border-color: rgba(255, 42, 133, 0.45);
}

.input-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--c-text-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.input-row { position: relative; }

.input-field {
  width: 100%;
  padding: 13px 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--r-md);
  color: var(--c-text-primary);
  font-size: 15px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
}

.input-field::placeholder {
  color: var(--c-text-muted);
  font-size: 14px;
}

.input-field:focus {
  border-color: rgba(255, 42, 133, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 42, 133, 0.12);
}

.input-field.input-error {
  border-color: rgba(255, 100, 100, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 100, 100, 0.12);
}

/* Gender toggle */
.gender-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-gender {
  padding: 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-glass-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--c-text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--t-fast);
}

.btn-gender:hover:not(.active) {
  background: var(--c-glass-hover);
  color: var(--c-text-primary);
}

.btn-gender.active {
  background: linear-gradient(135deg, rgba(255, 42, 133, 0.25), rgba(155, 81, 224, 0.25));
  border-color: rgba(255, 42, 133, 0.5);
  color: var(--c-text-primary);
  box-shadow: 0 0 12px rgba(255, 42, 133, 0.2);
}

/* Heart divider */
.input-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.heart-divider {
  font-size: 28px;
  animation: heartbeat 1.8s ease-in-out infinite;
  display: block;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15%       { transform: scale(1.2); }
  30%       { transform: scale(1); }
  45%       { transform: scale(1.1); }
  60%       { transform: scale(1); }
}

/* Submit area */
.btn-submit {
  margin-top: 4px;
}

.submit-hint {
  text-align: center;
  font-size: 13px;
  color: var(--c-text-muted);
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* SECTIONS 3–5 — GATE RESULTS                                                   */
/* ══════════════════════════════════════════════════════════════════════════════ */
.gate-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, rgba(57, 255, 133, 0.18), rgba(0, 242, 254, 0.12));
  border: 1px solid rgba(57, 255, 133, 0.3);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--c-neon-green);
  width: fit-content;
}

.gate-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Result card — glassmorphism */
.result-card {
  background: var(--c-glass-bg);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--r-lg);
  padding: var(--space-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform var(--t-normal), border-color var(--t-normal), box-shadow var(--t-normal);
  animation: card-reveal 0.5s ease both;
}

.result-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 0 10px rgba(255, 255, 255, 0.03);
}

@keyframes card-reveal {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-card--score {
  text-align: center;
  border-color: rgba(255, 42, 133, 0.3);
  background: linear-gradient(135deg, rgba(255, 42, 133, 0.08), rgba(155, 81, 224, 0.08));
  box-shadow: 0 0 30px rgba(255, 42, 133, 0.12);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.score-number {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--c-neon-pink), var(--c-neon-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

.score-unit {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--c-neon-pink), var(--c-neon-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.score-sub {
  font-size: 14px;
  color: var(--c-text-secondary);
  margin-top: 8px;
}

.archetype-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text-primary);
  margin-bottom: 8px;
}

.card-body {
  font-size: 14px;
  color: var(--c-text-secondary);
  line-height: 1.75;
  text-align: justify;
  text-justify: inter-word;
}

.card-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.card-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--c-glass-border);
  background: var(--c-glass-bg);
  font-size: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--c-text-secondary);
}

/* Color swatches (Gate 3) */
.color-swatches {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.color-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.swatch-block {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.swatch-label {
  font-size: 10px;
  color: var(--c-text-muted);
  text-align: center;
  max-width: 50px;
  line-height: 1.3;
}

/* Unlock button */
.btn-unlock {
  animation-delay: 0.3s;
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* SECTION 6 — SHARE CARD & FOOTER                                               */
/* ══════════════════════════════════════════════════════════════════════════════ */
#s-share .section-inner {
  align-items: center;
}

#s-share .share-section-header {
  text-align: center;
}

/* Privacy toggle */
.privacy-setting {
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--r-full);
  border: 1px solid var(--c-glass-border);
  transition: background var(--t-fast);
  flex-shrink: 0;
}

.slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--c-text-muted);
  transition: transform var(--t-fast), background var(--t-fast);
}

input:checked + .slider {
  background: linear-gradient(135deg, var(--c-neon-pink), var(--c-neon-violet));
  border-color: rgba(255, 42, 133, 0.5);
}

input:checked + .slider::after {
  transform: translateX(20px);
  background: #fff;
}

.toggle-label {
  font-size: 13px;
  color: var(--c-text-secondary);
}

/* Share card 9:16 */
.share-card {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--c-glass-border);
  box-shadow:
    0 0 0 1px rgba(255,42,133,0.15),
    0 16px 64px rgba(0,0,0,0.6);
  background: linear-gradient(160deg, #1a0a2e 0%, #0a0a1f 100%);
  isolation: isolate;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.5s ease;
}

.share-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow:
    0 0 32px rgba(255, 42, 133, 0.35),
    0 24px 80px rgba(0,0,0,0.85);
}

.share-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 0%,
    rgba(0, 242, 254, 0.15) 25%,
    rgba(255, 42, 133, 0.18) 38%,
    rgba(255, 255, 255, 0.3) 45%,
    rgba(155, 81, 224, 0.18) 52%,
    rgba(0, 242, 254, 0.15) 65%,
    transparent 80%,
    transparent 100%
  );
  background-size: 250% 250%;
  background-position: 0% 0%;
  z-index: 9;
  pointer-events: none;
  mix-blend-mode: color-dodge;
  transition: background-position 0.8s ease, opacity 0.5s ease;
  opacity: 0.45;
}

.share-card:hover::before {
  background-position: 100% 100%;
  opacity: 0.9;
}

.share-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.02) 28%,
    transparent 28.1%
  );
  z-index: 10;
  pointer-events: none;
}

/* Layer system */
.sc-layer {
  position: absolute;
  inset: 0;
}

.sc-bg {
  z-index: 1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.sc-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.15) 0%,
    rgba(0,0,0,0.05) 40%,
    rgba(0,0,0,0.45) 80%,
    rgba(0,0,0,0.75) 100%
  );
}

.sc-chars {
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 12px;
}

.sc-char {
  width: 45%;
  max-height: 75%;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5));
}
.sc-char--left {
  transform: scaleX(1);
  filter: drop-shadow(0 0 12px rgba(255, 42, 133, 0.25)) drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.sc-char--right {
  transform: scaleX(-1);
  filter: drop-shadow(0 0 15px rgba(242, 153, 74, 0.6)) drop-shadow(0 0 30px rgba(242, 153, 74, 0.2)) drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.sc-acc {
  z-index: 3;
  pointer-events: none;
}

.sc-acc-img {
  position: absolute;
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

.sc-acc--left  { top: 28%; left: 8%; }
.sc-acc--right { top: 28%; right: 8%; }

/* Header wrapper styling (distributed layout) */
.sc-header-wrapper {
  position: absolute;
  top: 4%;
  left: 5%;
  right: 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
}

.sc-header-logo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sc-header-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(255, 42, 133, 0.4);
}

.sc-header-brand-text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-transform: uppercase;
  line-height: 1;
}

.sc-header-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding-right: 6px;
}

.sc-large-score {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 900;
  color: #ffffff;
  line-height: 0.95;
  text-shadow: 
    0 0 12px rgba(255, 42, 133, 0.95),
    0 0 25px rgba(255, 42, 133, 0.55);
}

.sc-score-label {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 4px;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

/* Bubbles overlay */
.sc-bubbles-overlay {
  z-index: 5;
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.sc-speech-bubble {
  background: #ffffff;
  color: #1a1a2e;
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  /* line-height:1 prevents emoji ascender from pushing text baseline down */
  line-height: 1;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  position: absolute;
  max-width: 65%;
  word-wrap: break-word;
  box-sizing: border-box;
}

.sc-speech-bubble.bubble-left {
  top: 28%;
  left: 6%;
  border-bottom-left-radius: 4px;
}

.sc-speech-bubble.bubble-right {
  top: 40%;
  right: 6%;
  border-bottom-right-radius: 4px;
}

/* Rotated square bubble tail */
.sc-speech-bubble .bubble-tail {
  position: absolute;
  bottom: -4px;
  width: 10px;
  height: 10px;
  background: #ffffff;
  transform: rotate(45deg);
  z-index: -1;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.06);
}

.sc-speech-bubble.bubble-left .bubble-tail {
  left: 18px;
}

.sc-speech-bubble.bubble-right .bubble-tail {
  right: 18px;
}

/* Footer panel styling */
.sc-footer-panel {
  position: absolute;
  bottom: 24px;
  left: 18px;
  width: calc(100% - 36px);
  height: 56px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  z-index: 5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sc-footer-left {
  min-width: 0;
  flex: 1 1 auto;
  padding: 0 8px 0 14px;
}

.sc-footer-text {
  display: block;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: #1a1a2e;
  /* line-height:1 prevents emoji ascender from adding phantom space above text */
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-footer-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  padding: 0 12px 0 0;
  width: 118px;
  text-align: right;
}

.sc-footer-qr-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  width: 68px;
  margin-right: 7px;
  color: #1a1a2e;
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 900;
  line-height: 1.08;
  text-align: right;
  white-space: nowrap;
}

.sc-footer-qr {
  display: block;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  color: #1a1a2e;
}
/* Screenshot button */
.btn-screenshot {
  background: linear-gradient(135deg, var(--c-neon-cyan), var(--c-neon-violet));
  box-shadow: 0 0 22px rgba(0, 242, 254, 0.3);
  animation: glow-breathe-cyan 2.8s infinite ease-in-out;
  max-width: 360px;
}

@keyframes glow-breathe-cyan {
  0%, 100% { box-shadow: 0 0 22px rgba(0, 242, 254, 0.3); }
  50%       { box-shadow: 0 0 42px rgba(0, 242, 254, 0.6); }
}

/* Footer */
.site-footer {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  border-top: 1px solid var(--c-glass-border);
  margin-top: var(--space-md);
}

.site-footer p {
  font-size: 13px;
  color: var(--c-text-muted);
}

.footer-link {
  color: var(--c-text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--t-fast);
}

.footer-link:hover { color: var(--c-neon-pink); }

.footer-sub {
  font-size: 12px;
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* LOADING OVERLAY                                                                */
/* ══════════════════════════════════════════════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(9, 9, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.loading-spinner {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(90deg, rgba(255, 42, 133, 0.1), rgba(0, 242, 254, 0.15), rgba(255, 42, 133, 0.1));
  background-size: 200% 200%;
  animation: shimmer 1.5s infinite linear;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.25);
  position: relative;
  overflow: hidden;
}

.loading-spinner::after {
  content: '🔮';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  animation: pulse-gem 1.5s infinite ease-in-out;
}

@keyframes shimmer {
  0% { background-position: -150% 0; }
  100% { background-position: 150% 0; }
}

@keyframes pulse-gem {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.8)); }
}

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

.loading-text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text-secondary);
}

/* ══════════════════════════════════════════════════════════════════════════════ */
/* TOAST                                                                          */
/* ══════════════════════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  padding: 12px 24px;
  border-radius: var(--r-md);
  background: rgba(30, 30, 50, 0.95);
  border: 1px solid var(--c-glass-border);
  backdrop-filter: blur(16px);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  max-width: calc(var(--max-w) - 40px);
  text-align: center;
  animation: toast-in 0.3s ease;
  white-space: nowrap;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.toast.toast-success { border-color: rgba(57, 255, 133, 0.4); color: var(--c-neon-green); }
.toast.toast-error   { border-color: rgba(255, 80, 80, 0.4);  color: #ff8080; }

/* ══════════════════════════════════════════════════════════════════════════════ */
/* RESPONSIVE — Desktop ≥ 480px                                                  */
/* ══════════════════════════════════════════════════════════════════════════════ */
@media (min-width: 430px) {
  .hero-cta {
    width: auto;
  }
}

/* On desktop, phone-frame sits centered — body is flex centered */
@media (min-width: 600px) {
  body {
    padding: 40px 0;
  }

  .phone-frame {
    border-radius: 40px;
    min-height: auto;
    overflow: hidden;
  }

  .phone-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0.02) 28%,
      transparent 28.1%
    );
    pointer-events: none;
    z-index: 9999;
    border-radius: 40px;
  }

  .loading-overlay,
  .toast {
    /* Keep overlays scoped to the phone frame width */
    left: 50%;
    transform: translateX(-50%);
    max-width: 430px;
    width: 100%;
  }

  .toast {
    bottom: 60px;
    border-radius: var(--r-md);
  }
}

/* ── Scrollbar styling ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 42, 133, 0.35);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 42, 133, 0.6);
}

/* ── Selection ──────────────────────────────────────────────────────────────── */
::selection {
  background: rgba(255, 42, 133, 0.3);
  color: #fff;
}

/* ── Color & Element Details (Gate 3) ────────────────────────────────────────── */
.color-descriptions-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: var(--space-md);
  border-top: 1px solid var(--c-glass-border);
  padding-top: var(--space-md);
}

.color-desc-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.color-desc-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text-primary);
}

.color-highlight {
  text-shadow: 0 0 10px currentColor;
}

.color-makna-tag {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--c-text-secondary);
  opacity: 0.85;
}

.color-desc-body {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--c-text-secondary);
  text-align: justify;
  text-justify: inter-word;
}

/* Element relationships */
.relationship-intro {
  margin-bottom: 14px;
  line-height: 1.65;
  text-align: justify;
  text-justify: inter-word;
}

.relationship-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.relationship-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px var(--space-md);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--c-glass-border);
  backdrop-filter: blur(8px);
  transition: transform var(--t-normal), border-color var(--t-normal), background var(--t-normal);
}

.relationship-item:hover {
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

.relationship-item-header {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.relationship-item-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--c-text-secondary);
  text-align: justify;
  text-justify: inter-word;
}

/* Element chips & badges */
.element-chip,
.element-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.element-chip {
  border: 1px solid rgba(255,255,255,0.15);
}

.element-badge {
  padding: 4px 12px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Element color definitions */
.element-logam {
  background: linear-gradient(135deg, #e0e0e0, #888888);
  border-color: rgba(224, 224, 224, 0.4);
  text-shadow: 0 0 8px rgba(224, 224, 224, 0.6);
}

.element-air {
  background: linear-gradient(135deg, #00f2fe, #4facfe);
  border-color: rgba(0, 242, 254, 0.4);
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.6);
}

.element-api {
  background: linear-gradient(135deg, #ff2a85, #ff7b00);
  border-color: rgba(255, 42, 133, 0.4);
  text-shadow: 0 0 8px rgba(255, 42, 133, 0.6);
}

.element-kayu {
  background: linear-gradient(135deg, #39ff85, #11998e);
  border-color: rgba(57, 255, 133, 0.4);
  text-shadow: 0 0 8px rgba(57, 255, 133, 0.6);
}

.element-tanah {
  background: linear-gradient(135deg, #f2994a, #ab7a4e);
  border-color: rgba(242, 153, 74, 0.4);
  text-shadow: 0 0 8px rgba(242, 153, 74, 0.6);
}

/* ── Gate Unlock Intro & Dynamics Labels ────────────────────────────────────── */
.gate-unlock-intro {
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
  text-align: justify;
  text-justify: inter-word;
  margin: var(--space-md) auto var(--space-sm);
  max-width: 100%;
  padding: var(--space-md);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(255, 42, 133, 0.07) 0%, rgba(155, 81, 224, 0.05) 100%);
  border: 1px solid rgba(255, 42, 133, 0.25);
  box-shadow: inset 0 0 12px rgba(255, 42, 133, 0.05), 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  animation: card-reveal 0.5s ease both;
}

.gate-unlock-intro::before {
  content: '🔒';
  font-size: 24px;
  display: inline-block;
  animation: pulse-lock 1.8s infinite ease-in-out;
  filter: drop-shadow(0 0 4px var(--c-neon-pink));
  flex-shrink: 0;
}

@keyframes pulse-lock {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
    filter: drop-shadow(0 0 4px var(--c-neon-pink));
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
    filter: drop-shadow(0 0 8px var(--c-neon-pink));
  }
}

.dynamics-label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--c-neon-pink), var(--c-neon-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  display: inline-block;
  letter-spacing: -0.2px;
}

/* Share modal overlay for mobile tap-and-hold saving */
.share-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(4, 4, 10, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  animation: fade-in 0.3s ease;
}

.share-modal-content {
  position: relative;
  background: var(--c-bg-end);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--r-lg);
  padding: var(--space-md);
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: zoom-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.share-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 28px;
  color: var(--c-text-secondary);
  cursor: pointer;
  transition: color var(--t-fast);
  z-index: 10;
}

.share-modal-close:hover {
  color: #fff;
}

.share-modal-img {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.share-modal-tip {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--c-text-secondary);
  text-align: center;
  line-height: 1.5;
  padding: 0 8px;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes zoom-in {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* Ambient background particles */
.ambient-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-particle {
  position: absolute;
  bottom: -20px;
  background: var(--c-neon-pink);
  border-radius: 50%;
  opacity: 0.15;
  filter: blur(2px);
  box-shadow: 0 0 12px var(--c-neon-pink);
  animation: float-up infinite linear;
}

.ambient-particle:nth-child(even) {
  background: var(--c-neon-cyan);
  box-shadow: 0 0 12px var(--c-neon-cyan);
}

@keyframes float-up {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.25;
  }
  90% {
    opacity: 0.2;
  }
  100% {
    transform: translateY(-105dvh) scale(1.3) rotate(360deg);
    opacity: 0;
  }
}



/* Secondary "Coba yang Lain" restart button */
.btn-try-again {
  margin-top: 12px;
  width: 100%;
  padding: 14px;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 700;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: all var(--t-fast);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-try-again:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  transform: translateY(-1px);
}

.btn-try-again:active {
  transform: translateY(1px);
}

/* Reassurance text regarding local history storage */
.history-reassurance-text {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--c-text-secondary);
  text-align: center;
  line-height: 1.5;
  margin-top: 10px;
  padding: 0 16px;
  opacity: 0.8;
}

/* Staggered result card animation delays */
.gate-cards .result-card:nth-child(1) { animation-delay: 0.05s; }
.gate-cards .result-card:nth-child(2) { animation-delay: 0.18s; }
.gate-cards .result-card:nth-child(3) { animation-delay: 0.3s; }
.gate-cards .result-card:nth-child(4) { animation-delay: 0.42s; }
