:root {
  --bg-deep: #0b131e;
  --bg-card: rgba(18, 28, 43, 0.88);
  --bg-card-solid: #121c2b;
  --bg-elevated: rgba(255, 255, 255, 0.05);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-warm: rgba(245, 158, 11, 0.35);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-soft: #cbd5e1;
  --accent-red: #ef4444;
  --accent-rose: #f43f5e;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --kakao-yellow: #fee500;
  --kakao-text: #191919;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(239, 68, 68, 0.14), transparent 38%),
    radial-gradient(circle at 85% 20%, rgba(16, 185, 129, 0.14), transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(245, 158, 11, 0.12), transparent 45%);
  color: var(--text-main);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Snowflakes */
.snow-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -12px;
  color: rgba(255, 255, 255, 0.45);
  user-select: none;
  animation: snowfall linear infinite;
}

@keyframes snowfall {
  0% {
    transform: translateY(-10px) translateX(0);
    opacity: 0;
  }
  10% { opacity: 0.7; }
  90% { opacity: 0.5; }
  100% {
    transform: translateY(105vh) translateX(24px);
    opacity: 0;
  }
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 16px 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
}

.season-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.32);
  color: #fecaca;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.timer-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.45); opacity: 0.45; }
}

/* Card stage */
.card-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
  animation: fadeUp 0.32s ease-out;
}

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

/* Invite Banner (B mode) */
.invite-banner {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.18), rgba(245, 158, 11, 0.14));
  border: 1px solid rgba(244, 63, 94, 0.4);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.invite-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #fda4af;
  background: rgba(244, 63, 94, 0.22);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.invite-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.45;
}

.invite-sub {
  font-size: 12.5px;
  color: var(--text-soft);
  margin-top: 4px;
}

/* Hero */
.hero-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.hero-chip {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.hero-chip.warm {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.hero-title {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.28;
  margin-bottom: 10px;
}

.hero-title .highlight {
  background: linear-gradient(90deg, #fde68a, #fb7185);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.55;
  margin-bottom: 18px;
}

.blurred-preview {
  position: relative;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  padding: 16px;
  text-align: center;
  margin-bottom: 18px;
  overflow: hidden;
}

.blurred-score {
  font-size: 32px;
  font-weight: 900;
  filter: blur(6px);
  color: #fda4af;
  user-select: none;
}

.blurred-lock-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #fde68a;
  margin-top: 4px;
}

.type-marquee {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.type-pill {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-soft);
}

.social-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* Buttons */
.btn-primary {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #e11d48 0%, #f59e0b 100%);
  box-shadow: 0 10px 26px rgba(225, 29, 72, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.98); }

.btn-kakao {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px 18px;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--kakao-text);
  background: var(--kakao-yellow);
  box-shadow: 0 10px 24px rgba(254, 229, 0, 0.24);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease;
}

.btn-kakao:active { transform: scale(0.98); }

.btn-secondary {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
}

/* Quiz Screen */
.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 2px;
}

.quiz-eta {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #f59e0b, #f43f5e);
  transition: width 0.3s ease;
}

.q-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  margin-bottom: 10px;
}

.q-tag.killer {
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.q-title {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.42;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  width: 100%;
  text-align: left;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  transition: all 0.16s ease;
}

.option-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.option-btn.selected {
  background: rgba(245, 158, 11, 0.16);
  border-color: var(--accent-gold);
}

.opt-badge {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* Loading Screen */
.loading-box {
  text-align: center;
  padding: 48px 16px;
}

.loading-spinner {
  font-size: 46px;
  display: inline-block;
  animation: bounceSpin 1s infinite ease-in-out;
  margin-bottom: 14px;
}

@keyframes bounceSpin {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.08); }
}

/* Result Screen */
.result-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-header {
  text-align: center;
}

.result-emoji-wrap {
  width: 78px;
  height: 78px;
  margin: 0 auto 12px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.result-code {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-name {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 8px;
}

.result-oneliner {
  font-size: 14.5px;
  font-weight: 700;
  color: #fde68a;
  margin-bottom: 12px;
}

.result-desc {
  font-size: 13.5px;
  color: var(--text-soft);
  line-height: 1.62;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  padding: 14px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.peeve-callout {
  text-align: left;
  font-size: 12.5px;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.hashtag-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.hashtag {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 999px;
}

/* Partner Box */
.partner-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  text-align: left;
}

.partner-label {
  font-size: 11px;
  font-weight: 800;
  color: #6ee7b7;
  margin-bottom: 4px;
}

.partner-name {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 3px;
}

.partner-synergy {
  font-size: 13px;
  color: var(--text-soft);
}

/* Compatibility Report Card (B mode) */
.compat-card {
  background: linear-gradient(155deg, rgba(225, 29, 72, 0.22), rgba(18, 28, 43, 0.95) 60%, rgba(245, 158, 11, 0.16));
  border: 1.5px solid rgba(244, 63, 94, 0.5);
}

.compat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.compat-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.25);
  color: #fda4af;
}

.compat-score-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 8px 0 6px;
}

.compat-score-num {
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #fde68a, #fb7185);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.compat-score-unit {
  font-size: 20px;
  font-weight: 800;
  color: #fda4af;
}

.compat-pair-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 12px;
}

.course-oracle {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  margin: 12px 0;
}

.oracle-label {
  font-size: 11px;
  font-weight: 800;
  color: #fcd34d;
  margin-bottom: 4px;
}

.oracle-text {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.48;
}

/* Excuse Engine Card */
.section-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
}

.section-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.nick-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 14px;
  outline: none;
  margin-bottom: 12px;
}

.nick-input:focus {
  border-color: var(--accent-gold);
}

.tone-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.tone-tab {
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.tone-tab.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--accent-gold);
  color: #fde68a;
}

.kakao-preview {
  background: #bacee0;
  color: #191919;
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
}

.kakao-bubble {
  background: var(--kakao-yellow);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.48;
  font-weight: 500;
  word-break: break-word;
  margin-bottom: 8px;
}

.og-card-preview {
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.og-thumb {
  background: linear-gradient(135deg, #162436, #7f1d1d);
  color: #fff;
  padding: 12px 14px;
  font-size: 12.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.og-meta {
  padding: 8px 12px;
}

.og-meta-title {
  font-size: 12px;
  font-weight: 800;
  color: #111827;
}

.og-meta-desc {
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

/* Ecosystem Next Action 3-Combo */
.eco-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eco-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-main);
  transition: background 0.15s ease;
}

.eco-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.eco-title {
  font-size: 13.5px;
  font-weight: 700;
}

.eco-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.eco-arrow {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-gold);
  flex-shrink: 0;
}

/* Prototype Simulator Drawer */
.proto-drawer {
  background: rgba(15, 23, 42, 0.72);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.proto-drawer summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text-soft);
}

.proto-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proto-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.proto-types {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.proto-btn {
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.proto-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.app-footer {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  padding-top: 4px;
}

.app-footer a {
  color: var(--text-soft);
  text-decoration: none;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  border: 1px solid rgba(245, 158, 11, 0.5);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 50;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
