/* Emotion Iceberg Test Styles */
/* Primary Color: #2E86AB (Arctic Ocean Blue) */

:root {
  --primary: #2E86AB;
  --primary-dark: #1a5f7a;
  --primary-light: #7ED6F5;
  --primary-glow: rgba(46, 134, 171, 0.3);
  --surface-color: #7ED6F5;
  --deep-color: #2E86AB;
  --bg: #0a0a1a;
  --bg-card: rgba(255, 255, 255, 0.05);
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f0f4f8;
    --bg-card: rgba(0, 0, 0, 0.03);
    --text: #1a1a2e;
    --text-muted: #666680;
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --primary-glow: rgba(46, 134, 171, 0.15);
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  z-index: 10001;
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; }

/* App Loader */
.app-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.4s ease;
}
.app-loader.hidden { opacity: 0; pointer-events: none; }
.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Language Selector */
.lang-selector-wrap {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 100;
}
.lang-select {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

/* Container */
.container {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

/* Screen */
.screen { display: none; }
.screen.active { display: block; }

/* Hero */
.hero {
  text-align: center;
  padding: 24px 0 16px;
}
.iceberg-hero-icon {
  width: 90px;
  height: 90px;
  margin: 0 auto 12px;
  animation: icebergPulse 3s ease-in-out infinite;
}
.hero-iceberg-svg {
  width: 100%;
  height: 100%;
  animation: icebergFloat 3s ease-in-out infinite;
}
@keyframes icebergFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes icebergPulse {
  0%, 100% { filter: drop-shadow(0 0 20px var(--primary-glow)); }
  50% { filter: drop-shadow(0 0 40px rgba(46, 134, 171, 0.5)); }
}
.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 400px;
  margin: 0 auto;
}

/* Social Proof & Meta */
.social-proof {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(46, 134, 171, 0.15), rgba(126, 214, 245, 0.1));
  border: 1px solid rgba(46, 134, 171, 0.25);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 16px;
}

/* Result Type Teasers */
.type-teasers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0 0;
}
.type-teaser-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: all var(--transition);
}
.type-teaser-item:hover {
  background: rgba(46, 134, 171, 0.08);
  border-color: rgba(46, 134, 171, 0.2);
}
.type-teaser-emoji {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.type-teaser-name {
  font-weight: 700;
  color: var(--text);
}
.type-teaser-desc {
  font-size: 0.82rem;
}
.time-estimate {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.result-preview {
  margin-top: 16px;
  margin-bottom: 16px;
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.9rem;
}

/* Card */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* Start Card */
.start-card {
  text-align: center;
  max-width: 440px;
  margin: 0 auto;
}
.start-desc {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

/* CTA pulse attention */
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 134, 171, 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(46, 134, 171, 0); }
}
#start-btn {
  animation: ctaPulse 2s ease-in-out 1s 3;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 14px 28px;
  border: none;
  border-radius: calc(var(--radius) / 2);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  gap: 8px;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  width: 100%;
  font-size: 1.1rem;
  box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-primary:hover { box-shadow: 0 6px 30px var(--primary-glow); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  width: 100%;
  margin-top: 20px;
}

/* Progress Bar */
.progress-bar-wrap {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 16px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s ease;
}

/* Question Counter */
.question-counter {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Mini Iceberg Preview */
.mini-iceberg-wrap {
  width: 200px;
  height: 160px;
  margin: 0 auto 16px;
  opacity: 1;
  transition: opacity var(--transition);
}
.mini-iceberg-svg {
  width: 100%;
  height: 100%;
}

/* Step Indicator */
.step-indicator {
  text-align: center;
  margin-bottom: 12px;
}
.step-label {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all var(--transition);
}
.step-indicator.surface .step-label {
  background: rgba(126, 214, 245, 0.15);
  color: var(--surface-color);
  border: 1px solid rgba(126, 214, 245, 0.3);
}
.step-indicator.deep .step-label {
  background: rgba(46, 134, 171, 0.15);
  color: var(--deep-color);
  border: 1px solid rgba(46, 134, 171, 0.3);
}

/* Question Card */
.question-card {
  margin: 0 auto;
  max-width: 500px;
}
.scenario-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.question-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.5;
  min-height: 3em;
}

/* Layer Label */
.layer-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  font-weight: 600;
}
.layer-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.layer-label.surface .layer-icon { background: var(--surface-color); }
.layer-label.deep .layer-icon { background: var(--deep-color); }

/* Options Grid */
.options-grid {
  display: grid;
  gap: 10px;
}
.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) / 2);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  min-height: 44px;
  width: 100%;
}
.option-btn:hover {
  border-color: var(--primary);
  background: rgba(46, 134, 171, 0.08);
  transform: translateX(4px);
}
.option-btn:active {
  transform: translateX(2px);
}
.option-btn.selected {
  border-color: var(--primary);
  background: rgba(46, 134, 171, 0.15);
  box-shadow: 0 0 15px var(--primary-glow);
}
.option-emoji {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

/* Result Screen */
.result-header {
  text-align: center;
  padding: 30px 0 10px;
}
.result-type-name {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.result-type-desc {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 400px;
  margin: 0 auto;
}

/* Result Iceberg */
.result-iceberg-wrap {
  max-width: 360px;
  margin: 20px auto;
  filter: drop-shadow(0 0 40px var(--primary-glow));
}
.result-iceberg-svg {
  width: 100%;
  height: auto;
}
.result-ice-top {
  animation: iceGlow 3s ease-in-out infinite;
}
.result-ice-bottom {
  animation: deepGlow 4s ease-in-out infinite;
}
@keyframes iceGlow {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 0.95; }
}
@keyframes deepGlow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.7; }
}

.emotion-tag {
  font-size: 12px;
  font-weight: 600;
  fill: currentColor;
}
.emotion-tag.surface { fill: #7ED6F5; }
.emotion-tag.deep { fill: #a8d8ea; }

/* Result Detail Card */
.result-detail-card {
  margin-top: 20px;
}
.result-detail-card h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 10px;
}
.result-analysis {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Stats Card */
.result-stats-card {
  margin-top: 16px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.stat-label-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.stat-value-text {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.gap-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.gap-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 4px;
  width: 0%;
  transition: width 1.5s ease;
}
.gap-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Mid-Quiz Encouragement */
.mid-quiz-encouragement {
  text-align: center;
  padding: 16px 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(46, 134, 171, 0.12), rgba(126, 214, 245, 0.08));
  border: 1px solid rgba(46, 134, 171, 0.2);
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-light);
  animation: encourageFadeIn 0.6s ease forwards;
}
@keyframes encourageFadeIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Celebration animation on deep-question transition */
.celebration-flash {
  animation: celebrationPulse 0.5s ease;
}
@keyframes celebrationPulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 134, 171, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(46, 134, 171, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 134, 171, 0); }
}

/* Result Narrative */
.result-narrative {
  text-align: center;
  padding: 16px 20px;
  margin: 16px 0;
  background: linear-gradient(135deg, rgba(46, 134, 171, 0.1), rgba(126, 214, 245, 0.06));
  border: 1px solid rgba(46, 134, 171, 0.2);
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.6;
}
.result-narrative .surface-word {
  color: var(--surface-color);
}
.result-narrative .deep-word {
  color: var(--deep-color);
}

/* Gap count-up */
.stat-value-text.counting {
  transition: none;
}

/* Share Section — prominent */
.share-section {
  text-align: center;
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(46, 134, 171, 0.08), rgba(126, 214, 245, 0.04));
  border: 1px solid rgba(46, 134, 171, 0.15);
  border-radius: var(--radius);
}
.share-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}
.share-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) / 2);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 48px;
}
.share-btn:hover {
  border-color: var(--primary);
  background: rgba(46, 134, 171, 0.1);
}
.share-btn.kakao:hover { border-color: #FEE500; background: rgba(254, 229, 0, 0.1); }
.share-btn.twitter:hover { border-color: #1DA1F2; background: rgba(29, 161, 242, 0.1); }
.share-btn.facebook:hover { border-color: #1877F2; background: rgba(24, 119, 242, 0.1); }

/* Screen transitions */
.screen-enter {
  animation: fadeSlideIn 0.4s ease forwards;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Option enter animation */
.option-btn {
  opacity: 0;
  transform: translateY(10px);
  animation: optionIn 0.3s ease forwards;
}
.option-btn:nth-child(1) { animation-delay: 0.05s; }
.option-btn:nth-child(2) { animation-delay: 0.1s; }
.option-btn:nth-child(3) { animation-delay: 0.15s; }
.option-btn:nth-child(4) { animation-delay: 0.2s; }
@keyframes optionIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile compact hero to surface CTA above fold */
@media (max-width: 640px) {
  .type-teasers {
    display: none;
  }
  .hero {
    padding: 16px 0 8px;
  }
  .iceberg-hero-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 8px;
  }
  .hero h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
  }
  .subtitle {
    font-size: 0.9rem;
  }
  .start-card {
    padding-top: 0;
  }
}

/* Responsive */
@media (min-width: 640px) {
  .hero h1 { font-size: 2.5rem; }
  .result-type-name { font-size: 2.2rem; }
}

@media (max-width: 360px) {
  .share-btn span { display: none; }
  .share-btn { padding: 10px; }
  .question-text { font-size: 1rem; }
}

/* Related Tests Section */
.related-tests {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.related-tests h3 {
  font-size: 16px;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 12px;
  text-align: center;
}
.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.related-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text, #fff);
  transition: transform 0.2s, border-color 0.2s;
}
.related-card:hover {
  transform: translateY(-2px);
  border-color: var(--card-color, #3498db);
}
.related-emoji { font-size: 28px; }
.related-name {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--text-secondary, #94a3b8);
}
[data-theme="light"] .related-card {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .related-card:hover {
  background: rgba(0,0,0,0.06);
}

/* Percentile stat */
.percentile-stat {
  text-align: center;
  margin: 12px 0;
  font-size: 13px;
  color: var(--text-secondary, #94a3b8);
}
.percentile-stat strong {
  color: var(--primary, #2E86AB);
  font-size: 15px;
}

/* About / Collapsible Section */
.about-section {
  max-width: 480px;
  margin: 24px auto;
  padding: 0 16px;
}
.about-section details {
  background: var(--bg-card, rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
}
.about-section summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--text, #e2e8f0);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.about-section summary::after {
  content: "+";
  font-size: 18px;
  color: var(--primary, #2E86AB);
  transition: transform 0.2s;
}
.about-section details[open] summary::after {
  content: "\2212";
}
.about-section summary::-webkit-details-marker { display: none; }
.about-content {
  padding: 0 18px 18px;
}
.about-content h2 {
  font-size: 16px;
  color: var(--primary, #2E86AB);
  margin: 16px 0 8px;
}
.about-content p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary, #94a3b8);
  margin: 0 0 12px;
}
[data-theme="light"] .about-section details {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.1);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .option-btn { opacity: 1; transform: none; }
  .result-ice-top, .result-ice-bottom { opacity: 0.7; }
}
