/* ===========================
   CSS Reset & Variables
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg-start: #fff5f9;
  --color-bg-end: #f3e8ff;
  --color-primary: #ff7eb3;
  --color-primary-light: #ffa8cc;
  --color-secondary: #7ec8c8;
  --color-lavender: #b4a7d6;
  --color-lemon: #ffd966;
  --color-card: #ffffff;
  --color-text: #4a3a5c;
  --color-text-muted: #8a7a9c;
  --color-text-light: #b0a0c0;
  --color-border: rgba(255, 150, 200, 0.2);

  /* 로또 공 색상 */
  --ball-1-10: #fbc400;
  --ball-11-20: #69c8f2;
  --ball-21-30: #ff7272;
  --ball-31-40: #aaaaaa;
  --ball-41-45: #b0d840;

  --shadow-card: 0 4px 20px rgba(255, 150, 200, 0.15);
  --shadow-ball: 0 3px 10px rgba(0, 0, 0, 0.15);
  --border-radius: 20px;
  --border-radius-sm: 12px;
  --transition: all 0.3s ease;

  /* Safe area */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===========================
   Base Styles
   =========================== */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Jua', 'Segoe UI', 'Malgun Gothic', sans-serif;
  background: linear-gradient(160deg, var(--color-bg-start) 0%, var(--color-bg-end) 100%);
  min-height: 100vh;
  color: var(--color-text);
  line-height: 1.6;
  touch-action: manipulation;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  -webkit-font-smoothing: antialiased;
}

/* ===========================
   Floating Decorations
   =========================== */
.floating-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.deco {
  position: absolute;
  opacity: 0.12;
  font-size: 2rem;
  animation: float 8s ease-in-out infinite;
  color: var(--color-primary);
}
.deco-1 { top: 8%; left: 8%; animation-delay: 0s; font-size: 1.8rem; }
.deco-2 { top: 15%; right: 12%; animation-delay: 1.5s; font-size: 1.4rem; color: var(--color-lavender); }
.deco-3 { top: 40%; left: 5%; animation-delay: 3s; font-size: 2.2rem; color: var(--color-secondary); }
.deco-4 { top: 55%; right: 8%; animation-delay: 4.5s; font-size: 1.6rem; }
.deco-5 { top: 75%; left: 15%; animation-delay: 2s; font-size: 1.3rem; color: var(--color-lemon); }
.deco-6 { top: 85%; right: 20%; animation-delay: 5.5s; font-size: 1.5rem; }
.deco-7 { top: 25%; left: 50%; animation-delay: 6.5s; font-size: 1.2rem; color: var(--color-lavender); }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-15px) rotate(5deg); }
  50% { transform: translateY(-8px) rotate(-3deg); }
  75% { transform: translateY(-20px) rotate(3deg); }
}

/* ===========================
   App Container
   =========================== */
.app-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 12px 16px 40px;
  position: relative;
  z-index: 1;
}

@media (min-width: 480px) {
  .app-container {
    max-width: 440px;
    padding: 20px 20px 40px;
  }
}

/* ===========================
   Character
   =========================== */
.character-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px;
  position: relative;
}

.character {
  transition: var(--transition);
}

.character svg {
  display: block;
}

/* Idle - 좌우 흔들림 + 눈 깜빡임 */
.char-idle {
  animation: charIdle 3s ease-in-out infinite;
}

.char-idle .eye {
  animation: blink 4s ease-in-out infinite;
}

@keyframes charIdle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(2deg); }
  75% { transform: rotate(-2deg); }
}

@keyframes blink {
  0%, 42%, 46%, 100% { ry: 3.5; }
  44% { ry: 0.5; }
}

/* Excited - 점프 + 눈 반짝 */
.char-excited {
  animation: charJump 0.5s ease infinite;
}

.char-excited .eye {
  fill: #ff7eb3;
}

.char-excited .sparkle {
  animation: sparkleGlow 0.4s ease infinite alternate;
}

@keyframes charJump {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.05); }
}

@keyframes sparkleGlow {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* Waiting - zzZ, 기울어짐 */
.char-waiting {
  animation: charSleep 4s ease-in-out infinite;
  opacity: 0.7;
}

@keyframes charSleep {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(-3deg); }
}

/* Speech Bubble */
.speech-bubble {
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: 16px;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--color-text);
  box-shadow: 0 2px 10px rgba(255, 150, 200, 0.1);
  position: relative;
  margin-top: 4px;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.3s, transform 0.3s;
}

.speech-bubble.visible {
  opacity: 1;
  transform: translateY(0);
}

.speech-bubble::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--color-border);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--color-card);
}

/* ===========================
   Header
   =========================== */
.app-header {
  text-align: center;
  margin-bottom: 16px;
  background: var(--color-card);
  border: 2px dashed var(--color-border);
  border-radius: var(--border-radius);
  padding: 20px 16px;
  box-shadow: var(--shadow-card);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.5px;
}

.latest-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, rgba(255, 126, 179, 0.08), rgba(180, 167, 214, 0.08));
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  padding: 6px 14px;
}

.latest-label {
  font-size: 0.65rem;
  color: var(--color-primary);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.latest-round {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}

.latest-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}

.loading-text {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* ===========================
   Tab Navigation
   =========================== */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tab-nav .tab-btn {
  flex: 1 1 calc(25% - 6px);
  min-width: 70px;
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  background: var(--color-card);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn:hover {
  border-color: var(--color-primary-light);
  color: var(--color-text);
  transform: translateY(-2px);
}

.tab-btn:active {
  transform: scale(0.95);
}

.tab-btn.active {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, rgba(255, 126, 179, 0.1), rgba(180, 167, 214, 0.08));
  color: var(--color-primary);
  box-shadow: 0 2px 12px rgba(255, 126, 179, 0.15);
}

.tab-btn.active .tab-icon {
  animation: tabBounce 0.4s ease;
}

@keyframes tabBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.tab-icon {
  font-size: 1.3rem;
}

/* ===========================
   Tab Content
   =========================== */
.tab-content {
  margin-bottom: 16px;
}

.tab-panel {
  display: none;
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 20px 16px;
  box-shadow: var(--shadow-card);
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

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

.panel-description {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(255, 126, 179, 0.05), rgba(126, 200, 200, 0.05));
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  line-height: 1.7;
}

.panel-description strong {
  color: var(--color-primary);
}

/* ===========================
   Generate Button
   =========================== */
.generate-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--color-primary), #e85d9c);
  color: white;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 20px rgba(255, 126, 179, 0.35);
  margin-bottom: 20px;
  min-height: 52px;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 126, 179, 0.45);
}

.generate-btn:active {
  transform: scale(0.96);
  box-shadow: 0 2px 12px rgba(255, 126, 179, 0.3);
}

.generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Shimmer effect */
.btn-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

.btn-icon {
  font-size: 1.2rem;
}

.saju-btn {
  background: linear-gradient(135deg, var(--color-lavender), #9b8ec4);
  box-shadow: 0 4px 20px rgba(180, 167, 214, 0.35);
}

.saju-btn:hover {
  box-shadow: 0 6px 25px rgba(180, 167, 214, 0.45);
}

.name-btn {
  background: linear-gradient(135deg, #ffa54c, #e88a30);
  box-shadow: 0 4px 20px rgba(255, 165, 76, 0.35);
}

.name-btn:hover {
  box-shadow: 0 6px 25px rgba(255, 165, 76, 0.45);
}

.mbti-btn {
  background: linear-gradient(135deg, #64b4ff, #4a8fd4);
  box-shadow: 0 4px 20px rgba(100, 180, 255, 0.35);
}

.mbti-btn:hover {
  box-shadow: 0 6px 25px rgba(100, 180, 255, 0.45);
}

/* ===========================
   Lotto Balls
   =========================== */
.result-area {
  min-height: 60px;
}

.balls-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  padding: 12px 0;
}

.balls-container .ball {
  width: 42px;
  height: 42px;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.ball {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: var(--shadow-ball),
              inset 0 -3px 6px rgba(0, 0, 0, 0.2),
              inset 0 3px 6px rgba(255, 255, 255, 0.3);
  position: relative;
  opacity: 0;
  animation: ballBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 공 광택 효과 */
.ball::before {
  content: '';
  position: absolute;
  top: 7px;
  left: 11px;
  width: 12px;
  height: 9px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  transform: rotate(-30deg);
}

/* 번호 범위별 색상 */
.ball-1-10 {
  background: radial-gradient(circle at 35% 35%, #fde47e, #fbc400, #d4a500);
  color: #4a3800;
  text-shadow: 0 1px 2px rgba(255, 200, 0, 0.3);
}
.ball-11-20 {
  background: radial-gradient(circle at 35% 35%, #a8e4f8, #69c8f2, #3a9fd4);
}
.ball-21-30 {
  background: radial-gradient(circle at 35% 35%, #ffaaaa, #ff7272, #d44444);
}
.ball-31-40 {
  background: radial-gradient(circle at 35% 35%, #dddddd, #aaaaaa, #777777);
  color: #333;
  text-shadow: 0 1px 2px rgba(100, 100, 100, 0.3);
}
.ball-41-45 {
  background: radial-gradient(circle at 35% 35%, #d4f080, #b0d840, #7aad00);
  color: #2a4a00;
  text-shadow: 0 1px 2px rgba(100, 160, 0, 0.3);
}

/* 공 등장 바운스 애니메이션 */
@keyframes ballBounce {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 롤링 애니메이션 */
.ball.rolling {
  animation: rolling 0.6s ease infinite;
}

@keyframes rolling {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(90deg) scale(1.1); }
  50% { transform: rotate(180deg) scale(1); }
  75% { transform: rotate(270deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

/* 작은 공 (info용) */
.ball-sm {
  width: 34px;
  height: 34px;
  font-size: 0.78rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12),
              inset 0 -2px 4px rgba(0, 0, 0, 0.15),
              inset 0 2px 4px rgba(255, 255, 255, 0.3);
  animation: none;
  opacity: 1;
}

.ball-sm::before {
  top: 5px;
  left: 8px;
  width: 9px;
  height: 6px;
}

/* ===========================
   Frequency Chart
   =========================== */
.freq-chart {
  margin-top: 14px;
}

.freq-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 0.78rem;
  animation: slideIn 0.3s ease forwards;
  opacity: 0;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-15px); }
  to { opacity: 1; transform: translateX(0); }
}

.freq-number {
  width: 28px;
  text-align: right;
  color: var(--color-text-muted);
  font-weight: 600;
}

.freq-bar-container {
  flex: 1;
  height: 8px;
  background: rgba(180, 167, 214, 0.12);
  border-radius: 4px;
  overflow: hidden;
}

.freq-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.freq-count {
  width: 38px;
  color: var(--color-text-muted);
  font-size: 0.72rem;
}

.freq-rank {
  width: 24px;
  font-size: 0.68rem;
  color: var(--color-primary);
  font-weight: 700;
}

/* ===========================
   Top/Bottom Numbers Info
   =========================== */
.top-numbers-info {
  margin-top: 20px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255,126,179,0.04), rgba(126,200,200,0.04));
  border: 1px dashed var(--color-border);
  border-radius: var(--border-radius-sm);
}

.top-numbers-info h3 {
  font-size: 0.85rem;
  margin-bottom: 10px;
  color: var(--color-text-muted);
}

.info-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ===========================
   Saju Form
   =========================== */
.saju-form {
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.optional {
  color: var(--color-text-light);
  font-weight: 400;
  font-size: 0.75rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-lavender);
  box-shadow: 0 0 0 3px rgba(180, 167, 214, 0.15);
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%238a7a9c' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* 사주 결과 표시 */
.saju-pillars {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px;
}

.saju-pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(180, 167, 214, 0.1), rgba(180, 167, 214, 0.05));
  border: 1px solid rgba(180, 167, 214, 0.25);
  border-radius: var(--border-radius-sm);
  min-width: 60px;
}

.pillar-label {
  font-size: 0.62rem;
  color: var(--color-lavender);
  font-weight: 600;
  margin-bottom: 3px;
  letter-spacing: 0.5px;
}

.pillar-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #9b8ec4;
}

.pillar-romanized {
  font-size: 0.62rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ===========================
   MBTI Selector
   =========================== */
.mbti-form {
  margin-bottom: 16px;
}

.mbti-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.mbti-axis {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mbti-axis-label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  width: 40px;
  flex-shrink: 0;
  font-weight: 600;
}

.mbti-opt {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  background: var(--color-card);
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.mbti-opt:hover {
  border-color: rgba(100, 180, 255, 0.4);
  color: var(--color-text);
}

.mbti-opt.active {
  border-color: #64b4ff;
  background: rgba(100, 180, 255, 0.1);
  color: #3a7abf;
  box-shadow: 0 2px 8px rgba(100, 180, 255, 0.2);
}

.mbti-selected {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  background: linear-gradient(135deg, rgba(100, 180, 255, 0.08), rgba(180, 167, 214, 0.08));
  border: 1px solid rgba(100, 180, 255, 0.2);
  border-radius: var(--border-radius-sm);
}

.mbti-type-display {
  font-size: 1.3rem;
  font-weight: 900;
  color: #3a7abf;
  letter-spacing: 2px;
}

.mbti-label-display {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

/* ===========================
   Name Info
   =========================== */
.name-form {
  margin-bottom: 16px;
}

.name-info {
  margin-top: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(255, 165, 76, 0.06), rgba(255, 200, 100, 0.06));
  border: 1px dashed rgba(255, 165, 76, 0.3);
  border-radius: var(--border-radius-sm);
}

.name-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 8px;
}

.name-char-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255, 165, 76, 0.08);
  border: 1px solid rgba(255, 165, 76, 0.2);
  border-radius: 8px;
  min-width: 56px;
}

.name-char-main {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
}

.name-char-jamo {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.name-char-strokes {
  font-size: 0.62rem;
  color: #c47a00;
  font-weight: 600;
  margin-top: 1px;
}

.name-info-summary {
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.name-info-summary strong {
  color: #c47a00;
}

/* ===========================
   Explain Box
   =========================== */
.explain-box {
  margin-top: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255, 240, 220, 0.6), rgba(240, 230, 255, 0.6));
  border: 1.5px dashed rgba(180, 167, 214, 0.35);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: fadeIn 0.5s ease;
}

.explain-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.explain-text {
  font-size: 0.82rem;
  color: var(--color-text);
  line-height: 1.7;
  word-break: keep-all;
}

/* ===========================
   Disclaimer
   =========================== */
.disclaimer {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(255, 180, 180, 0.08);
  border: 1px solid rgba(255, 150, 150, 0.2);
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
  color: #c97070;
  line-height: 1.6;
  text-align: center;
}

/* ===========================
   History Section
   =========================== */
.history-section {
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 0;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.history-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.history-toggle-icon {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  transition: transform 0.3s;
}

.history-toggle-icon.collapsed {
  transform: rotate(-90deg);
}

.history-body {
  padding: 0 16px 16px;
  transition: max-height 0.3s ease;
}

.history-body.collapsed {
  display: none;
}

.history-empty {
  text-align: center;
  padding: 24px 0;
  color: var(--color-text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  opacity: 0.5;
}

.history-empty p {
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.empty-sub {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 150, 200, 0.08);
  animation: historySlide 0.3s ease forwards;
}

@keyframes historySlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.history-item:last-child {
  border-bottom: none;
}

.history-method {
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.method-random { background: rgba(255, 217, 102, 0.2); color: #c49500; }
.method-frequent { background: rgba(255, 126, 179, 0.12); color: var(--color-primary); }
.method-rare { background: rgba(126, 200, 200, 0.15); color: #5aa0a0; }
.method-saju { background: rgba(180, 167, 214, 0.15); color: #8a7aaa; }
.method-name { background: rgba(255, 165, 0, 0.15); color: #c47a00; }
.method-mbti { background: rgba(100, 180, 255, 0.15); color: #3a7abf; }

.history-balls {
  display: flex;
  gap: 3px;
  flex-wrap: nowrap;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
}

.history-balls .ball-sm {
  width: 28px;
  height: 28px;
  font-size: 0.68rem;
  flex-shrink: 0;
}

.history-balls .ball-sm::before {
  display: none;
}

.history-time {
  font-size: 0.68rem;
  color: var(--color-text-light);
  white-space: nowrap;
  flex-shrink: 0;
}

.clear-history-btn {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 150, 150, 0.25);
  border-radius: var(--border-radius-sm);
  background: rgba(255, 180, 180, 0.06);
  color: #c97070;
  font-family: inherit;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition);
}

.clear-history-btn:hover {
  background: rgba(255, 150, 150, 0.12);
}

/* ===========================
   Footer
   =========================== */
.app-footer {
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.72rem;
  line-height: 1.8;
}

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

.app-footer a:hover {
  text-decoration: underline;
}

/* ===========================
   Toast Notification
   =========================== */
.toast {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-card);
  border: 2px solid var(--color-border);
  color: var(--color-text);
  padding: 10px 22px;
  border-radius: 26px;
  font-family: 'Jua', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

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

/* ===========================
   Data Status Banner
   =========================== */
.data-status {
  padding: 8px 14px;
  border-radius: var(--border-radius-sm);
  font-size: 0.78rem;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.data-status.loaded {
  background: rgba(126, 200, 200, 0.1);
  border: 1px solid rgba(126, 200, 200, 0.25);
  color: #5aa0a0;
}

.data-status.fallback {
  background: rgba(255, 180, 100, 0.1);
  border: 1px solid rgba(255, 180, 100, 0.25);
  color: #c49500;
}

/* ===========================
   Confetti
   =========================== */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  font-size: 1.2rem;
  animation: confettiFall 2s ease-out forwards;
  opacity: 0;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg) scale(0.3);
  }
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 380px) {
  .app-title {
    font-size: 1.25rem;
  }

  .tab-btn {
    padding: 8px 4px;
    font-size: 0.65rem;
  }

  .tab-icon {
    font-size: 1rem;
  }

  .mbti-opt {
    padding: 8px;
    font-size: 0.9rem;
  }

  .ball {
    width: 42px;
    height: 42px;
    font-size: 0.9rem;
  }

  .ball-sm {
    width: 30px;
    height: 30px;
    font-size: 0.7rem;
  }

  .history-balls .ball-sm {
    width: 26px;
    height: 26px;
    font-size: 0.62rem;
  }

  .generate-btn {
    font-size: 0.95rem;
    padding: 14px;
  }

  .tab-panel {
    padding: 14px 12px;
  }

  .balls-container {
    gap: 6px;
  }

  .header-content {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 340px) {
  .tab-label {
    display: none;
  }

  .tab-btn {
    padding: 10px 6px;
  }

  .mbti-axis-label {
    display: none;
  }

  .explain-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
  }
}

/* Large screens */
@media (min-width: 768px) {
  .app-container {
    max-width: 480px;
  }
}

/* ===========================
   Scrollbar
   =========================== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 126, 179, 0.2);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 126, 179, 0.35);
}

/* ===========================
   Smart Filter Toggle
   =========================== */
.smart-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(126, 200, 200, 0.06), rgba(180, 167, 214, 0.06));
  border: 1px solid rgba(126, 200, 200, 0.15);
  border-radius: var(--border-radius-sm);
}

.smart-filter-label {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.smart-filter-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.smart-filter-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.smart-filter-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(180, 167, 214, 0.25);
  border-radius: 24px;
  transition: var(--transition);
}

.smart-filter-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.smart-filter-toggle input:checked + .smart-filter-slider {
  background: var(--color-secondary);
}

.smart-filter-toggle input:checked + .smart-filter-slider::before {
  transform: translateX(20px);
}

/* ===========================
   Analysis Card
   =========================== */
.analysis-card {
  margin-top: 14px;
}

.analysis-card:empty {
  display: none;
}

.analysis-card-inner {
  background: linear-gradient(135deg, rgba(255, 240, 220, 0.5), rgba(230, 240, 255, 0.5));
  border: 1.5px solid rgba(126, 200, 200, 0.25);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  animation: fadeIn 0.4s ease;
}

.analysis-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.analysis-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analysis-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--color-text);
}

.analysis-item-icon {
  width: 22px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.analysis-item-text {
  flex: 1;
  line-height: 1.5;
}

.analysis-item-check {
  font-size: 0.7rem;
  flex-shrink: 0;
}

.analysis-item-check.good {
  color: var(--color-secondary);
}

.analysis-item-check.neutral {
  color: var(--color-lemon);
}

.analysis-score {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(180, 167, 214, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.analysis-score-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.analysis-score-value {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--color-secondary);
}

.analysis-score-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.analysis-score-stars {
  display: flex;
  gap: 2px;
  font-size: 1rem;
}

.analysis-comment {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
}

.analysis-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  color: var(--color-secondary);
  background: rgba(126, 200, 200, 0.1);
  border: 1px solid rgba(126, 200, 200, 0.2);
  border-radius: 20px;
  padding: 2px 8px;
  margin-top: 8px;
}

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

@media (max-width: 380px) {
  .analysis-card-inner {
    padding: 12px;
  }

  .analysis-score-value {
    font-size: 1rem;
  }
}

/* ===========================
   🔥 지옥 이스터에그
   =========================== */
.hell-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, #1a0000 0%, #000000 70%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.8s ease;
  overflow: hidden;
}

.hell-overlay.active {
  opacity: 1;
}

.hell-overlay.fade-out {
  opacity: 0;
  transition: opacity 1s ease;
}

.hell-content {
  text-align: center;
  z-index: 2;
  position: relative;
}

.hell-text {
  font-size: 1.6rem;
  font-weight: 900;
  color: #ff1a1a;
  text-shadow:
    0 0 10px #ff1a1a,
    0 0 20px #ff4444,
    0 0 40px #ff6600,
    0 0 80px #ff1a1a;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  letter-spacing: 2px;
}

.hell-text.show {
  opacity: 1;
  transform: scale(1);
}

.hell-sub {
  font-size: 2.2rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow:
    0 0 10px #ff1a1a,
    0 0 30px #ff4444,
    0 0 60px #ff0000;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
  margin-top: 30px;
  animation: none;
}

.hell-sub.show {
  opacity: 1;
  transform: translateY(0);
  animation: hell-tremble 0.1s infinite;
}

@keyframes hell-tremble {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, -2px); }
}

/* 화면 흔들림 */
.hell-shake {
  animation: hell-shake-anim 0.4s ease-in-out 3;
}

@keyframes hell-shake-anim {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* 불꽃 파티클 */
.hell-fire-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.hell-fire {
  position: absolute;
  bottom: -50px;
  font-size: 2rem;
  animation: hell-fire-rise linear infinite;
  opacity: 0;
}

/* ===========================
   공유 버튼
   =========================== */
.share-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--color-border);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: 'Jua', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  color: var(--color-text);
  background: rgba(255, 126, 179, 0.1);
}

.share-btn:hover {
  background: rgba(255, 126, 179, 0.25);
  transform: translateY(-1px);
}

.share-btn:active {
  transform: scale(0.96);
}

.share-btn span {
  font-size: 1rem;
}

/* ===========================
   광고 영역
   =========================== */
.ad-slot {
  width: 100%;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.4);
  border: 1px dashed var(--color-border);
  color: var(--color-text-light);
  font-size: 0.8rem;
}

/* ===========================
   후원 버튼
   =========================== */
.support-section {
  text-align: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border);
}

.support-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border: 2px solid var(--color-primary);
  border-radius: 30px;
  background: rgba(255, 126, 179, 0.12);
  color: var(--color-primary);
  font-size: 0.95rem;
  font-family: 'Jua', sans-serif;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  animation: supportPulse 3s ease-in-out infinite;
}

@keyframes supportPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 126, 179, 0); }
  50% { box-shadow: 0 0 0 6px rgba(255, 126, 179, 0.15); }
}

.support-btn:hover {
  background: rgba(255, 126, 179, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 126, 179, 0.3);
}

.support-qr {
  margin-top: 16px;
  padding: 20px;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  text-align: center;
  animation: fadeIn 0.3s ease;
}

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

.support-qr-title {
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: 12px;
  font-weight: 700;
}

.support-qr-img {
  width: 200px;
  height: 200px;
  border-radius: 12px;
}

.support-qr-name {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.support-qr-link {
  display: block;
}

.support-pay-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 24px;
  background: #fee500;
  color: #3c1e1e;
  border-radius: 8px;
  font-family: 'Jua', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
}

.support-pay-btn:hover {
  background: #fdd835;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(254,229,0,0.4);
}

.support-qr-close {
  margin-top: 12px;
  padding: 6px 20px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: transparent;
  color: var(--color-text-muted);
  font-family: 'Jua', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
}

@keyframes hell-fire-rise {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-100vh) rotate(360deg);
    opacity: 0;
  }
}

/* ===========================
   오늘의 운세 번호 카드
   =========================== */
.daily-fortune {
  margin-bottom: 16px;
}

.fortune-card {
  background: linear-gradient(135deg, rgba(255,126,179,0.12), rgba(180,167,214,0.12));
  border: 2px solid rgba(255,126,179,0.2);
  border-radius: var(--border-radius);
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.fortune-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.fortune-date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.fortune-badge {
  background: var(--color-primary);
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.fortune-title {
  font-size: 1.2rem;
  color: var(--color-text);
  margin-bottom: 16px;
}

.fortune-balls {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin-bottom: 16px;
}

.fortune-balls .ball {
  width: 42px;
  height: 42px;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.fortune-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fortune-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.fortune-item-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.fortune-item-value {
  font-size: 0.9rem;
  color: var(--color-text);
  font-weight: 700;
}

.fortune-share {
  margin-top: 8px;
}

.fortune-share-btn {
  background: rgba(255,126,179,0.15) !important;
}

/* ===========================
   버튼 그룹 (1세트 + 5세트)
   =========================== */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-group .generate-btn {
  width: 100%;
}

.multi-btn {
  width: 100%;
  font-size: 0.85rem !important;
  padding: 10px 14px !important;
  background: linear-gradient(135deg, var(--color-lavender), var(--color-secondary)) !important;
  white-space: nowrap;
}

/* ===========================
   5세트 결과 (로또 용지)
   =========================== */
.multi-set-container {
  background: white;
  border-radius: var(--border-radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
  border-left: 4px solid var(--color-primary);
}

.multi-set-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--color-border);
  animation: fadeIn 0.3s ease both;
}

.multi-set-row:last-child {
  border-bottom: none;
}

.multi-set-label {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.multi-set-balls {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* ===========================
   당첨 비교
   =========================== */
.compare-section {
  margin-bottom: 16px;
  text-align: center;
}

.compare-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  border: 2px solid var(--color-lemon);
  border-radius: 30px;
  background: rgba(255,217,102,0.15);
  color: var(--color-text);
  font-family: 'Jua', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.compare-btn:hover {
  background: rgba(255,217,102,0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255,217,102,0.3);
}

.compare-result {
  margin-top: 16px;
  text-align: left;
}

.compare-header {
  text-align: center;
  margin-bottom: 16px;
}

.compare-header h3 {
  font-size: 1rem;
  color: var(--color-text);
  margin-bottom: 8px;
}

.compare-latest-balls {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.compare-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare-item {
  background: white;
  border-radius: var(--border-radius-sm);
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid #eee;
}

.compare-item.match-3 { border-left-color: #b0d840; }
.compare-item.match-4 { border-left-color: #ffd966; }
.compare-item.match-5 { border-left-color: #ff7272; }
.compare-item.match-5b { border-left-color: #69c8f2; }
.compare-item.match-6 { border-left-color: #ff7eb3; background: rgba(255,126,179,0.05); }

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

.compare-method {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.compare-match-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
}

.compare-balls {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.ball-matched {
  box-shadow: 0 0 0 3px rgba(255,126,179,0.5), var(--shadow-ball) !important;
  transform: scale(1.1);
}

.ball-dimmed {
  opacity: 0.4;
}

.compare-empty {
  text-align: center;
  padding: 20px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ===========================
   궁합 탭 스타일
   =========================== */
.chemistry-form {
  margin-bottom: 16px;
}

.chemistry-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chemistry-inputs .form-group {
  flex: 1;
}

.chemistry-heart {
  font-size: 1.5rem;
  color: var(--color-primary);
  animation: heartBeat 1.5s ease-in-out infinite;
  flex-shrink: 0;
  padding-top: 20px;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.chemistry-btn {
  background: linear-gradient(135deg, var(--color-primary), #ff5a9e) !important;
}

/* 궁합 결과 카드 */
.chemistry-result-card {
  background: linear-gradient(135deg, #fff5f9, #fce4f0, #f3e8ff);
  border-radius: 20px;
  padding: 24px 16px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(255, 126, 179, 0.15);
  border: 2px solid rgba(255, 126, 179, 0.2);
  animation: fadeInUp 0.5s ease;
}

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

.chem-card-header {
  font-size: 1.1rem;
  color: var(--color-primary);
  margin-bottom: 8px;
  font-weight: 700;
}

.chem-names {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 16px;
}

.chem-heart-icon {
  color: var(--color-primary);
  display: inline-block;
  animation: heartBeat 1.5s ease-in-out infinite;
}

.chem-score-area {
  margin-bottom: 16px;
}

.chem-score-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.chem-score-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.chem-score-bar {
  height: 12px;
  background: rgba(255, 126, 179, 0.15);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 8px;
}

.chem-score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #ff5a9e, var(--color-lavender));
  border-radius: 6px;
  transition: width 0.05s linear;
}

.chem-element-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.chem-elem {
  background: rgba(255, 126, 179, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
}

.chem-elem-x {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.chem-element-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.chem-numbers-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.chem-balls {
  justify-content: center;
  margin-bottom: 12px;
}

.chem-comment {
  font-size: 0.95rem;
  color: var(--color-primary);
  font-weight: 700;
  padding: 8px;
  background: rgba(255, 126, 179, 0.08);
  border-radius: 12px;
  margin-bottom: 8px;
}

.chem-watermark {
  font-size: 0.7rem;
  color: var(--color-text-light);
}

/* 궁합 메서드 색상 */
.method-chemistry {
  background: linear-gradient(135deg, var(--color-primary), #ff5a9e) !important;
  color: white !important;
}

/* ===========================
   인라인 후원 nudge
   =========================== */
.result-support-nudge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  border-top: 1px dashed var(--color-border);
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.nudge-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  transition: var(--transition);
}

.nudge-link:hover {
  color: #ff5a9e;
}
