/* ==========================================================================
   말랑말랑 BMI 젤리몬 - CSS 디자인 시스템 (클레이모피즘 & 툰 에스테틱)
   ========================================================================== */

/* 1. CSS 변수 설정 */
:root {
  /* 귀여운 파스텔 & 선명한 카툰 테두리 색상 */
  --outline-color: #2d3748;
  --bg-sky: linear-gradient(185deg, #fff5f5 0%, #fed7aa 40%, #e0f2fe 100%);
  
  /* 비만도 상태별 소프트 파스텔 색상 세트 */
  --color-underweight: #38bdf8;       /* 시원한 하늘색 */
  --color-underweight-light: #e0f2fe;
  --color-normal: #4ade80;            /* 싱그러운 연두색 */
  --color-normal-light: #f0fdf4;
  --color-overweight: #facc15;          /* 달콤한 꿀 노란색 */
  --color-overweight-light: #fef9c3;
  --color-obese: #fb7185;               /* 러블리 복숭아 핑크 */
  --color-obese-light: #ffe4e6;
  --color-extreme: #c084fc;             /* 신비로운 자두 보라색 */
  --color-extreme-light: #fae8ff;

  /* 3D 카툰 버튼/카드 입체 섀도우 */
  --clay-card-shadow: 
    0 12px 0 var(--outline-color), 
    0 24px 30px rgba(0, 0, 0, 0.08);
  --clay-btn-shadow: 
    0 6px 0 var(--outline-color);
  --clay-btn-active: 
    0 2px 0 var(--outline-color);
  
  --transition-squish: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 2. 전역 스타일 초기화 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-drag: none;
}

body.jelly-body {
  min-height: 100vh;
  background: var(--bg-sky);
  font-family: 'Jua', sans-serif;
  color: #2d3748;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  padding: 2rem 1rem;
}

/* 3. 배경 장식용 둥실둥실 구름 & 반짝이들 */
.sky-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.cloud {
  position: absolute;
  font-size: 3rem;
  opacity: 0.6;
}

.cloud-1 {
  top: 10%;
  left: 5%;
  animation: floatCloud 25s infinite linear;
}

.cloud-2 {
  top: 45%;
  right: -10%;
  font-size: 4rem;
  animation: floatCloud 35s infinite linear reverse;
}

.cloud-3 {
  top: 25%;
  right: 15%;
  font-size: 1.5rem;
  animation: heartPulse 3s infinite alternate ease-in-out;
}

.cloud-4 {
  bottom: 15%;
  left: 10%;
  font-size: 2rem;
  animation: heartPulse 4s infinite alternate-reverse ease-in-out;
}

.cloud-5 {
  top: 75%;
  right: 8%;
  font-size: 2rem;
  animation: floatCloud 30s infinite linear;
}

@keyframes floatCloud {
  0% { transform: translateX(-100px) translateY(0); }
  50% { transform: translateX(50vw) translateY(-20px); }
  100% { transform: translateX(100vw) translateY(0); }
}

@keyframes heartPulse {
  0% { transform: scale(0.8) rotate(0deg); opacity: 0.4; }
  100% { transform: scale(1.2) rotate(15deg); opacity: 0.8; }
}

/* 4. 컨테이너 및 헤더 */
.jelly-app-container {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  z-index: 10;
}

.jelly-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.header-badge {
  background: #ffffff;
  border: 3px solid var(--outline-color);
  padding: 0.4rem 1rem;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: bold;
  box-shadow: 0 4px 0 var(--outline-color);
  transform: rotate(-1.5deg);
}

.jelly-title {
  font-family: 'Single Day', cursive;
  font-size: 3.5rem;
  color: #2d3748;
  text-shadow: 3px 3px 0px #ffffff;
  margin-top: 0.5rem;
}

.jelly-title .highlight {
  color: #fb7185;
  position: relative;
  display: inline-block;
  transform: rotate(1deg);
}

.jelly-title .highlight::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 0;
  width: 100%;
  height: 12px;
  background: rgba(251, 113, 133, 0.2);
  z-index: -1;
  border-radius: 5px;
}

.jelly-subtitle {
  font-size: 1.1rem;
  color: #4a5568;
  background: rgba(255, 255, 255, 0.4);
  padding: 0.2rem 1rem;
  border-radius: 12px;
}

/* 5. 메인 레이아웃 카드 (클레이모피즘 완성본) */
.jelly-main-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  background: #ffffff;
  border: 4px solid var(--outline-color);
  border-radius: 36px;
  padding: 2.2rem;
  box-shadow: var(--clay-card-shadow);
  position: relative;
}

/* 내부 공통 카드 스타일 */
.jelly-card-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: #fdfaf6;
  border: 3px solid var(--outline-color);
  border-radius: 28px;
  padding: 1.75rem;
  box-shadow: inset 4px 4px 0 #ffffff;
}

/* 6. 입력 인풋 스타일 */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.group-label {
  font-size: 1.25rem;
  color: #2d3748;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.group-label .required {
  color: #ef4444;
}

.group-label .sub-label {
  font-size: 0.9rem;
  color: #718096;
}

/* 둥실거리는 뱃지 벨류 */
.badge-value {
  background: #ffffff;
  border: 3px solid var(--outline-color);
  border-radius: 15px;
  padding: 0.3rem 0.8rem;
  font-size: 1.05rem;
  box-shadow: 0 4px 0 var(--outline-color);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  display: inline-block;
  transform: rotate(1deg);
}

.badge-value.highlight-cyan {
  background: #e0f2fe;
}

.badge-value.highlight-pink {
  background: #ffe4e6;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 성별 버튼 선택자 */
.gender-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.gender-btn {
  background: #ffffff;
  border: 3px solid var(--outline-color);
  border-radius: 20px;
  padding: 0.8rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  box-shadow: var(--clay-btn-shadow);
  transition: var(--transition-squish);
  font-family: 'Jua', sans-serif;
  font-size: 1.15rem;
}

.gender-btn:hover {
  transform: translateY(-2px);
  background: #fffbeb;
}

.gender-btn:active {
  transform: translateY(4px);
  box-shadow: var(--clay-btn-active);
}

.gender-btn.active {
  background: #fed7aa;
  box-shadow: inset 4px 4px 0 rgba(255,255,255,0.4), 0 6px 0 var(--outline-color);
  border-color: var(--outline-color);
  transform: translateY(0);
}

.gender-emoji {
  font-size: 1.5rem;
}

/* 슬라이더 & 숫자 입력창 정렬 */
.range-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* 귀여운 젤리 슬라이더 디자인 */
.jelly-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 20px;
  background: #edf2f7;
  border: 3px solid var(--outline-color);
  border-radius: 12px;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  position: relative;
}

/* 슬라이더 핸들 (Chrome/Safari) */
.jelly-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fbd38d; /* 오렌지/옐로우 젤리빈 */
  border: 3px solid var(--outline-color);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.6), 0 4px 0 rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform 0.1s;
}

.jelly-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* 민트/실버 테마 슬라이더 핸들 */
.jelly-slider.slider-cyan::-webkit-slider-thumb {
  background: #38bdf8;
}

.jelly-slider.slider-pink::-webkit-slider-thumb {
  background: #fb7185;
}

/* 숫자 직접입력창 */
.jelly-number-input {
  width: 70px;
  height: 42px;
  border: 3px solid var(--outline-color);
  border-radius: 14px;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #2d3748;
  outline: none;
  background: #ffffff;
  box-shadow: 0 4px 0 rgba(0,0,0,0.1);
  -moz-appearance: textfield;
}

.jelly-number-input::-webkit-outer-spin-button,
.jelly-number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.jelly-number-input:focus {
  border-color: #fb7185;
  background: #ffe4e6;
}

/* 작은 보조 유틸리티 로우 */
.sound-control-row {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  gap: 1rem;
}

.jelly-small-btn {
  background: #ffffff;
  border: 3px solid var(--outline-color);
  border-radius: 15px;
  padding: 0.4rem 0.8rem;
  font-family: 'Jua', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 0 var(--outline-color);
  transition: var(--transition-squish);
}

.jelly-small-btn:hover {
  background: #edf2f7;
  transform: translateY(-2px);
}

.jelly-small-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--outline-color);
}

.jelly-small-btn i {
  width: 14px;
  height: 14px;
}

.jelly-small-btn.reset-btn {
  background: #fed7aa;
}

/* 7. 오른쪽: 젤리몬 스테이지 및 캐릭터 비주얼 */
.result-section {
  background: #f0f9ff;
  border-color: var(--outline-color);
  align-items: center;
  position: relative;
}

.jellymon-stage {
  width: 100%;
  max-width: 250px;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
}

/* 젤리몬 숨쉬는 그림자 */
.jelly-shadow {
  position: absolute;
  bottom: 24px;
  width: 120px;
  height: 14px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  filter: blur(1px);
  z-index: 1;
  animation: shadowBreath 3s infinite ease-in-out;
}

/* SVG 젤리몬 벡터 */
.jellymon-svg {
  width: 200px;
  height: 200px;
  z-index: 10;
  filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.05));
  animation: jellyBreath 3s infinite ease-in-out;
}

/* 젤리몬 세부 파츠 흔들림 트랜지션 */
#jellyBody {
  stroke: var(--outline-color);
  stroke-width: 4.5px;
  stroke-linejoin: round;
  transition: d 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.5), 
              fill 0.6s ease;
}

#decorations {
  transition: transform 0.5s var(--transition-squish);
}

#jellyFace {
  transition: transform 0.4s var(--transition-squish);
}

#jellyMouth {
  transition: d 0.5s ease;
}

/* 말랑말랑 애니메이션들 */
@keyframes jellyBreath {
  0%, 100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.04, 0.95) translateY(4px);
  }
}

@keyframes shadowBreath {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.5;
  }
}

/* 강제 젤리 흔들림 (클릭 시 트리거) */
.wobble-jelly {
  animation: jellyWobble 0.6s ease-in-out !important;
}

@keyframes jellyWobble {
  0% { transform: scale(1) rotate(0); }
  25% { transform: scale(1.1, 0.8) rotate(-6deg); }
  50% { transform: scale(0.9, 1.1) rotate(6deg); }
  75% { transform: scale(1.05, 0.95) rotate(-3deg); }
  100% { transform: scale(1) rotate(0); }
}

/* 젤리몬 말풍선 */
.speech-bubble {
  position: absolute;
  top: -10px;
  background: #ffffff;
  border: 3px solid var(--outline-color);
  border-radius: 20px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.1);
  animation: bubbleFloat 4s infinite ease-in-out;
  word-break: keep-all;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -19px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 9px;
  border-style: solid;
  border-color: var(--outline-color) transparent transparent transparent;
  z-index: -1;
}

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

/* 눈 깜빡임 */
#eyeL, #eyeR {
  animation: blinkEyes 4s infinite ease-in-out;
  transform-origin: center;
}

@keyframes blinkEyes {
  0%, 95%, 100% { transform: scaleY(1); }
  97.5% { transform: scaleY(0.1); }
}

/* 8. BMI 스코어 카드 및 무지개 진행 바 */
.bmi-score-card {
  width: 100%;
  background: #ffffff;
  border: 3px solid var(--outline-color);
  border-radius: 20px;
  padding: 1rem 1.25rem;
  box-shadow: 0 6px 0 var(--outline-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bmi-score-card .card-title {
  font-size: 0.95rem;
  color: #718096;
}

.bmi-main-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bmi-number {
  font-family: 'Outfit', sans-serif;
  font-size: 2.8rem;
  font-weight: 900;
  color: #2d3748;
}

/* 젤리 비만 상태 라벨 태그 */
.jelly-status-tag {
  border: 3px solid var(--outline-color);
  border-radius: 16px;
  padding: 0.4rem 0.8rem;
  font-size: 1.1rem;
  font-weight: bold;
  box-shadow: 0 4px 0 var(--outline-color);
  transform: rotate(-1deg);
  transition: all 0.3s;
}

.status-underweight { background: var(--color-underweight-light); color: var(--color-underweight); }
.status-normal { background: var(--color-normal-light); color: #16a34a; }
.status-overweight { background: var(--color-overweight-light); color: #ca8a04; }
.status-obese { background: var(--color-obese-light); color: var(--color-obese); }
.status-extreme { background: var(--color-extreme-light); color: #9333ea; }

/* 무지개 젤리 트랙 바 */
.bmi-progress-container {
  width: 100%;
  position: relative;
  margin-top: 1rem;
  padding-bottom: 12px;
}

.bmi-progress-track {
  height: 18px;
  background: #edf2f7;
  border: 3px solid var(--outline-color);
  border-radius: 10px;
  display: flex;
  overflow: hidden;
}

.track-segment {
  height: 100%;
}

/* 비만도 구간별 비율 분배 */
.track-segment.underweight { width: 35%; background: var(--color-underweight); border-right: 2.5px solid var(--outline-color); }
.track-segment.normal { width: 25%; background: var(--color-normal); border-right: 2.5px solid var(--outline-color); }
.track-segment.overweight { width: 10%; background: var(--color-overweight); border-right: 2.5px solid var(--outline-color); }
.track-segment.obese { width: 20%; background: var(--color-obese); border-right: 2.5px solid var(--outline-color); }
.track-segment.extreme-obese { width: 10%; background: var(--color-extreme); }

/* 움직이는 젤리몬 핀 */
.bmi-indicator-pin {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  background: #ffffff;
  border: 3px solid var(--outline-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 0 var(--outline-color);
  z-index: 20;
  transition: left 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.35);
}

.pin-face {
  font-size: 1.15rem;
}

/* 9. 젤리 건강 조언 처방전 */
.jelly-prescription {
  width: 100%;
  background: #ffffff;
  border: 3px solid var(--outline-color);
  border-radius: 20px;
  padding: 1.1rem;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.6);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.prescription-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  color: #fb7185;
}

.prescription-icon {
  width: 20px;
  height: 20px;
}

.prescription-desc {
  font-size: 0.95rem;
  color: #4a5568;
  line-height: 1.5;
  word-break: keep-all;
}

.ideal-weight-box {
  background: #fff8f8;
  border: 2px dashed #fecdd3;
  border-radius: 12px;
  padding: 0.5rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.heart-icon {
  width: 16px;
  height: 16px;
  color: #fb7185;
  animation: heartPulse 1.2s infinite alternate ease-in-out;
}

/* 10. BMI 성장 일기장 (히스토리) */
.jelly-diary-section {
  background: #ffffff;
  border: 4px solid var(--outline-color);
  border-radius: 32px;
  padding: 1.75rem;
  box-shadow: var(--clay-card-shadow);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.diary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--outline-color);
  padding-bottom: 0.75rem;
}

.diary-title {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.diary-title i {
  color: #fb7185;
}

/* 다이어리 아이템 카드 목록 */
.diary-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 5px;
}

.diary-list::-webkit-scrollbar {
  width: 8px;
}

.diary-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border: 2px solid var(--outline-color);
  border-radius: 4px;
}

.empty-diary {
  text-align: center;
  padding: 2rem;
  color: #718096;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.diary-empty-icon {
  font-size: 2.5rem;
  opacity: 0.5;
}

.diary-item {
  background: #fdfaf6;
  border: 3px solid var(--outline-color);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 0 var(--outline-color);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.diary-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.diary-meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: #718096;
}

.diary-stat-badge {
  background: #ffffff;
  border: 2px solid var(--outline-color);
  border-radius: 10px;
  padding: 0.1rem 0.4rem;
  font-weight: bold;
}

.diary-note {
  font-size: 1.05rem;
  color: #2d3748;
}

.diary-delete-btn {
  background: transparent;
  border: none;
  color: #a0aec0;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 5px;
  transition: all 0.2s;
}

.diary-delete-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

/* 성장 기록 입력 */
.save-diary-row {
  display: flex;
  gap: 1rem;
}

.diary-note-input {
  flex: 1;
  border: 3px solid var(--outline-color);
  border-radius: 18px;
  padding: 0.75rem 1.25rem;
  font-family: 'Jua', sans-serif;
  font-size: 1.1rem;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.diary-note-input:focus {
  border-color: #fb7185;
}

.jelly-btn {
  background: #fb7185; /* 기본 러블리 복숭아 핑크 */
  color: #ffffff;
  border: 3px solid var(--outline-color);
  border-radius: 20px;
  padding: 0.8rem 1.5rem;
  font-family: 'Jua', sans-serif;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--clay-btn-shadow);
  transition: var(--transition-squish);
}

.jelly-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.jelly-btn:active {
  transform: translateY(4px);
  box-shadow: var(--clay-btn-active);
}

.jelly-save-btn {
  background: #fbd38d;
  color: #2d3748;
}

.jelly-small-btn.danger-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* 11. 푸터 */
.jelly-footer {
  text-align: center;
  font-size: 0.85rem;
  color: #718096;
  opacity: 0.8;
  margin-top: 1rem;
}

/* 12. 미디어 쿼리 (반응형 튜닝) */
@media (max-width: 768px) {
  .jelly-main-card {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
    border-radius: 28px;
  }
  
  .jelly-title {
    font-size: 2.7rem;
  }
  
  .jelly-card-inner {
    padding: 1.25rem;
  }
  
  .save-diary-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .jelly-btn {
    justify-content: center;
  }
}

/* --- 자랑하기 (Share Modals & Cards) --- */
.status-btn-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.share-badge-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fef08a; /* soft yellow */
  color: #854d0e;
  border: 2px solid #2d3748;
  border-radius: 20px;
  padding: 6px 14px;
  font-family: 'Jua', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 0 #2d3748;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.share-badge-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #2d3748;
}

.share-badge-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #2d3748;
}

/* 모달 레이아웃 */
.jelly-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.jelly-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(45, 55, 72, 0.5);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 500px;
  background: #fbf7f4;
  border: 3px solid #2d3748;
  border-radius: 24px;
  box-shadow: 0 16px 0 #2d3748;
  padding: 24px;
  z-index: 1010;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.jelly-modal:not(.hidden) .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: 'Jua', sans-serif;
  color: #2d3748;
  font-size: 1.3rem;
  margin: 0;
}

.close-panel-btn {
  background: #fee2e2;
  color: #ef4444;
  border: 2px solid #2d3748;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 0 #2d3748;
}

.close-panel-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #2d3748;
}

/* 공유 카드 디자인 - 실시간 OG 배너 프리뷰 */
.share-card-canvas {
  position: relative;
  width: 100%;
  height: 250px;
  border: 3px solid #2d3748;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 0 rgba(45, 55, 72, 0.15);
}

.card-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.card-glass-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(3px);
  z-index: 2;
}

.card-content-layout {
  position: relative;
  z-index: 3;
  padding: 16px 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-sparkle {
  font-size: 1.1rem;
}

.brand-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  letter-spacing: 1px;
  color: #1e293b;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.6);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1.5px solid #2d3748;
}

.card-main-info {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid #2d3748;
  border-radius: 16px;
  padding: 10px 16px;
  box-shadow: 0 4px 0 rgba(45, 55, 72, 0.1);
}

.card-mascot-container {
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-mascot-svg {
  width: 100%;
  height: 100%;
}

.card-stat-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}

.card-user-info {
  font-family: 'Single Day', sans-serif;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: bold;
}

.card-bmi-badge {
  background: #2d3748;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: bold;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 8px;
}

.card-status-title {
  font-family: 'Jua', sans-serif;
  font-size: 1.25rem;
  color: #1e293b;
  margin: 2px 0 0 0;
}

.card-stat-desc {
  margin: 0;
  font-size: 0.8rem;
  color: #475569;
}

.card-footer-text {
  font-family: 'Single Day', sans-serif;
  font-size: 0.75rem;
  color: #64748b;
  text-align: right;
  font-weight: bold;
}

.modal-actions-row {
  display: flex;
  gap: 12px;
}

.modal-actions-row .jelly-btn {
  flex: 1;
}

/* --- 바이럴 초대장 배너 --- */
.viral-invite-banner {
  background: #ffedd5; /* soft orange peach */
  border: 3px solid #2d3748;
  border-radius: 20px;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 auto 1.5rem auto;
  max-width: 960px;
  box-shadow: 0 6px 0 #2d3748;
  animation: bounceSlow 3s infinite ease-in-out;
  z-index: 10;
}

.viral-invite-banner.hidden {
  display: none !important;
}

.invite-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.invite-emoji {
  font-size: 1.5rem;
}

.invite-msg {
  font-family: 'Jua', sans-serif;
  color: #7c2d12;
  font-size: 0.95rem;
}

.invite-action-btn {
  background: #f97316;
  color: #fff;
  border: 2px solid #2d3748;
  border-radius: 16px;
  padding: 6px 16px;
  font-family: 'Jua', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 0 #2d3748;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.invite-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #2d3748;
}

.invite-action-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #2d3748;
}

/* --- 바이럴 업적 & 비밀 테마 카드 --- */
.viral-achievements-card {
  margin-top: 1.25rem;
  border: 3px solid #2d3748;
  background: #f8fafc;
}

.achievements-intro {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.4;
  margin-top: 4px;
}

.highlight-gold {
  color: #ca8a04 !important;
}

.highlight-count {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  color: #ec4899; /* hot pink share counter */
  font-size: 1rem;
}

.themes-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.theme-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-item:hover {
  border-color: #cbd5e1;
}

.theme-item.active {
  border-color: #2d3748;
  background: #f0fdf4;
  box-shadow: 0 4px 0 #2d3748;
}

.theme-item.locked {
  opacity: 0.65;
  background: #f1f5f9;
  cursor: not-allowed;
  border-style: dashed;
}

.theme-item.locked:hover {
  border-color: #cbd5e1;
  transform: none;
}

.theme-preview {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #2d3748;
  box-shadow: 0 2px 0 rgba(45,55,72,0.15);
}

/* 프리뷰 그라데이션 원형 배경 */
.bg-rainbow {
  background: radial-gradient(circle, #ffedd5 0%, #fdba74 40%, #818cf8 80%, #f472b6 100%);
}

.bg-galaxy {
  background: radial-gradient(circle, #a5f3fc 0%, #c084fc 40%, #1e1b4b 80%, #020617 100%);
}

.bg-tanghulu {
  background: radial-gradient(circle, #fef2f2 0%, #fee2e2 40%, #dc2626 80%, #7f1d1d 100%);
}

.theme-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.theme-name {
  font-family: 'Jua', sans-serif;
  font-size: 0.85rem;
  color: #1e293b;
}

.theme-status {
  font-size: 0.75rem;
  color: #64748b;
}

.theme-item.active .theme-status {
  color: #16a34a;
  font-weight: bold;
}

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

/* ==========================================================================
   자랑하기 모달 내 SNS 공유 버튼 스타일 (클레이모피즘)
   ========================================================================== */
.sns-share-container {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  padding-top: 1rem;
  border-top: 2px dashed #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.sns-share-label {
  font-family: 'Jua', sans-serif;
  font-size: 0.9rem;
  color: #475569;
  letter-spacing: 0.5px;
}

.sns-buttons-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  width: 100%;
}

.sns-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.5rem;
  border-radius: 16px;
  font-family: 'Jua', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.08), inset 0 -4px 0 rgba(0, 0, 0, 0.1);
  border: 2px solid;
}

.sns-icon {
  font-size: 1.5rem;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.sns-btn-text {
  font-weight: 500;
}

/* 카카오톡 */
.sns-kakao {
  background: #fef08a;
  border-color: #eab308;
  color: #854d0e;
}
.sns-kakao:hover {
  background: #fde047;
}

/* 트위터 / X */
.sns-twitter {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0369a1;
}
.sns-twitter:hover {
  background: #bae6fd;
}

/* 페이스북 */
.sns-facebook {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1d4ed8;
}
.sns-facebook:hover {
  background: #bfdbfe;
}

/* 기타 SNS / 네이티브 */
.sns-native {
  background: #ccfbf1;
  border-color: #2dd4bf;
  color: #0f766e;
}
.sns-native:hover {
  background: #99f6e4;
}

/* 마우스 및 터치 인터랙션 */
.sns-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.06), inset 0 -4px 0 rgba(0, 0, 0, 0.1);
}

.sns-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1), inset 0 -2px 0 rgba(0, 0, 0, 0.05);
}

/* ========================================== */
/* 📊 젤리몬 관리자 스튜디오 스타일시트 */
/* ========================================== */

/* 비밀 비밀번호 트리거 */
.secret-admin-trigger {
  cursor: pointer;
  opacity: 0.3;
  margin-left: 6px;
  font-size: 0.85rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: inline-block;
}
.secret-admin-trigger:hover {
  opacity: 1;
  transform: scale(1.2) rotate(-10deg);
}

/* 관리자 인증 모달 레이아웃 */
.admin-auth-content {
  max-width: 380px !important;
  background: var(--jelly-bg-soft) !important;
  border: 4px solid var(--jelly-border) !important;
  border-radius: 28px !important;
  box-shadow: var(--jelly-shadow-3d) !important;
  padding: 24px !important;
}

.admin-auth-desc {
  font-size: 0.95rem;
  color: var(--jelly-text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
  text-align: center;
}

.admin-input-group {
  margin-bottom: 24px;
  text-align: left;
}

.admin-pwd-field {
  width: 100%;
  padding: 14px 18px;
  font-size: 1.1rem;
  border: 3px solid var(--jelly-border);
  border-radius: 16px;
  outline: none;
  background: white;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.06);
  font-family: inherit;
  transition: border-color 0.2s ease;
  text-align: center;
  box-sizing: border-box;
}

.admin-pwd-field:focus {
  border-color: var(--jelly-primary);
}

.pwd-error-msg {
  color: var(--jelly-red);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 8px;
  text-align: center;
  animation: shake 0.3s ease;
}

/* 대시보드 모달 본체 */
.admin-dashboard-content {
  max-width: 580px !important;
  background: #f8fafc !important;
  border: 4px solid var(--jelly-border) !important;
  border-radius: 32px !important;
  box-shadow: var(--jelly-shadow-3d) !important;
  padding: 28px !important;
}

/* KPI 요약 그리드 */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  padding: 16px 20px;
  border-radius: 20px;
  border: 3px solid var(--jelly-border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-shadow: 0 6px 0 var(--jelly-border);
  transition: transform 0.1s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-purple { background: #f3e8ff; border-color: var(--jelly-border); }
.kpi-blue { background: #e0f2fe; border-color: var(--jelly-border); }
.kpi-pink { background: #fce7f3; border-color: var(--jelly-border); }
.kpi-yellow { background: #fef9c3; border-color: var(--jelly-border); }

.kpi-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}

.kpi-value {
  font-family: 'Jua', sans-serif;
  font-size: 2.1rem;
  color: var(--jelly-text);
  line-height: 1.1;
}

.conversion-banner {
  background: var(--jelly-light-yellow);
  border: 3px solid var(--jelly-border);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--jelly-text);
  text-align: center;
  box-shadow: 0 4px 0 var(--jelly-border);
  margin-bottom: 24px;
}

.chart-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--jelly-text);
  margin-top: 24px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 일일 차트 래퍼 */
.admin-chart-wrapper {
  background: white;
  border: 3px solid var(--jelly-border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 5px 0 var(--jelly-border);
  margin-bottom: 24px;
}

.admin-bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 160px;
  padding-top: 15px;
  position: relative;
}

.chart-bar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 12%;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  background: var(--jelly-primary);
  border: 3px solid var(--jelly-border);
  border-radius: 8px 8px 0 0;
  min-height: 10px;
  position: relative;
  transition: height 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: inset -3px 0 0 rgba(0,0,0,0.06);
}

.chart-bar-container:nth-child(2n) .chart-bar {
  background: var(--jelly-pink);
}

.chart-bar-container:nth-child(3n) .chart-bar {
  background: #38bdf8;
}

.chart-tooltip {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--jelly-text);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  border: 2px solid var(--jelly-border);
  box-shadow: 0 2px 0 var(--jelly-border);
}

.chart-date-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  margin-top: 8px;
  white-space: nowrap;
}

/* 데이터 테이블 */
.admin-table-container {
  background: white;
  border: 3px solid var(--jelly-border);
  border-radius: 20px;
  padding: 8px;
  box-shadow: 0 5px 0 var(--jelly-border);
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 24px;
}

.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 0.85rem;
}

.admin-data-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #475569;
  padding: 8px;
  border-bottom: 2px solid var(--jelly-border);
}

.admin-data-table td {
  padding: 8px;
  color: var(--jelly-text);
  border-bottom: 1px solid #e2e8f0;
}

.admin-data-table tbody tr:last-child td {
  border-bottom: none;
}

/* 테이블 스크롤바 커스텀 */
.admin-table-container::-webkit-scrollbar {
  width: 8px;
}
.admin-table-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}
.admin-table-container::-webkit-scrollbar-thumb {
  background: var(--jelly-border);
  border-radius: 10px;
}

/* 하단 액션바 */
.admin-actions-bar {
  display: flex;
  gap: 12px;
}

.admin-sub-btn {
  flex: 1;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--jelly-text);
  background: white;
  border: 3px solid var(--jelly-border);
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 0 var(--jelly-border);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.admin-sub-btn:active {
  transform: translateY(4px);
  box-shadow: none;
}

.btn-danger-action {
  color: white;
  background: var(--jelly-red);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ========================================== */
/* 🌐 다국어 선택기 (Language Selector) 스타일 */
/* ========================================== */
.lang-selector-container {
  position: absolute;
  top: 10px;
  right: 15px;
  z-index: 200;
}

.lang-dropdown-btn {
  background: white;
  border: 3px solid var(--jelly-border, #1e293b);
  padding: 8px 16px;
  border-radius: 18px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--jelly-text, #2d3748);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 0 var(--jelly-border, #1e293b);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.lang-dropdown-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1.5px 0 var(--jelly-border, #1e293b);
}

.lang-dropdown-menu {
  position: absolute;
  top: 48px;
  right: 0;
  width: 140px;
  background: white;
  border: 3px solid var(--jelly-border, #1e293b);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--jelly-border, #1e293b);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: dropdownBouncy 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 210;
}

.lang-option {
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--jelly-text, #2d3748);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 0.2s ease, padding-left 0.2s ease;
}

.lang-option:hover {
  background: #f1f5f9;
  padding-left: 20px;
}

.lang-option:not(:last-child) {
  border-bottom: 2px solid #e2e8f0;
}

@keyframes dropdownBouncy {
  from {
    transform: translateY(-10px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .lang-selector-container {
    position: relative;
    align-self: center;
    top: auto;
    right: auto;
    margin-bottom: -10px;
    margin-top: 10px;
  }
}
