/* ============================================================
   QUANTUMSAJU™ — 양자역학 노벨상 영감 디자인 시스템
   "관측이 운명을 결정한다" — Nobel Prize QM Inspired UI
   Aspect · Clauser · Zeilinger (노벨물리학상 2022)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { -webkit-tap-highlight-color: transparent; user-select: none; }
input, textarea, select { user-select: text; }

:root {
  /* ── 양자 컬러 팔레트 ── */
  --q-void:       #04060f;          /* 양자 진공 */
  --q-deep:       #070d1e;          /* 심우주 */
  --q-cosmos:     #0b1228;          /* 코스모스 배경 */
  --q-card:       rgba(255,255,255,0.06);
  --q-card-glow:  rgba(99,179,237,0.08);
  --q-border:     rgba(99,179,237,0.18);

  /* ── 양자 발광 컬러 ── */
  --q-photon:     #63b3ed;          /* 광자(光子) 블루 */
  --q-entangle:   #a78bfa;          /* 얽힘(Entanglement) 퍼플 */
  --q-wave:       #34d399;          /* 파동함수 그린 */
  --q-collapse:   #f6ad55;          /* 파동수렴 앰버 */
  --q-spin:       #f687b3;          /* 스핀 핑크 */
  --q-resonance:  #76e4f7;          /* 공명(Resonance) 시안 */

  /* ── 텍스트 ── */
  --q-text:       #e8f4ff;
  --q-text2:      rgba(180,210,240,0.80);
  --q-text3:      rgba(150,180,220,0.50);

  /* ── 레거시 호환 (iOS 컴포넌트용) ── */
  --ios-bg:       var(--q-cosmos);
  --ios-card:     var(--q-card);
  --ios-card-border: var(--q-border);
  --ios-text:     var(--q-text);
  --ios-text2:    var(--q-text2);
  --ios-text3:    var(--q-text3);
  --ios-teal:     var(--q-resonance);
  --ios-blue:     var(--q-photon);
  --ios-gold:     var(--q-collapse);
  --ios-red:      #fc5c65;
  --ios-green:    var(--q-wave);
  --ios-purple:   var(--q-entangle);
  --ios-orange:   #ff9f43;
  --ios-pink:     var(--q-spin);

  --ios-radius:   22px;
  --ios-icon-size: 64px;
  --shadow-icon:  0 4px 20px rgba(0,0,0,0.55), 0 0 12px rgba(99,179,237,0.12);

  /* ── 양자 광효과 ── */
  --glow-photon:  0 0 24px rgba(99,179,237,0.45), 0 0 60px rgba(99,179,237,0.18);
  --glow-entangle:0 0 24px rgba(167,139,250,0.45), 0 0 60px rgba(167,139,250,0.18);
  --glow-wave:    0 0 24px rgba(52,211,153,0.4),  0 0 50px rgba(52,211,153,0.15);
}

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--q-void);
  font-family: -apple-system, 'SF Pro Display', 'Noto Sans KR', sans-serif;
  color: var(--q-text);
  -webkit-font-smoothing: antialiased;
}

/* ── 앱 쉘 ── */
#app-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 100% 80% at 30% -20%, rgba(99,179,237,0.12) 0%, transparent 55%),
    radial-gradient(ellipse 80% 60% at 75% 110%, rgba(167,139,250,0.10) 0%, transparent 55%),
    linear-gradient(180deg, #04060f 0%, #070d1e 100%);
}

/* ── 폰 프레임 (iPhone 15 Pro 스타일) ── */
#phone-frame {
  position: relative;
  width: 393px;
  height: 852px;
  border-radius: 52px;
  overflow: hidden;
  box-shadow:
    /* 기기 외곽 테두리 */
    0 0 0 1.5px rgba(180,180,200,0.25),
    0 0 0 10px rgba(8,8,14,0.92),
    0 0 0 11px rgba(60,60,80,0.30),
    /* 깊이감 그림자 */
    0 40px 100px rgba(0,0,0,0.90),
    0 20px 60px rgba(0,0,0,0.70),
    /* 양자 발광 */
    0 0 80px rgba(63,94,251,0.12),
    0 0 160px rgba(99,179,237,0.06);
  display: flex;
  flex-direction: column;
  background: var(--q-cosmos);
}

/* iOS 홈화면 스타일 배경 — 양자 우주 월페이퍼 */
#phone-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    /* 상단 오로라 빛 */
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(63,94,251,0.55) 0%, transparent 50%),
    /* 왼쪽 파란 빛 */
    radial-gradient(ellipse 80% 70% at -10% 35%, rgba(30,80,200,0.40) 0%, transparent 55%),
    /* 오른쪽 보라 빛 */
    radial-gradient(ellipse 70% 60% at 110% 30%, rgba(130,50,200,0.35) 0%, transparent 55%),
    /* 하단 중앙 깊은 색 */
    radial-gradient(ellipse 100% 50% at 50% 110%, rgba(10,5,40,0.80) 0%, transparent 60%),
    /* 기본 우주 배경 */
    linear-gradient(175deg, #0d1640 0%, #080e28 30%, #060920 60%, #030715 100%);
  pointer-events: none;
}

/* 별빛 파티클 레이어 */
#phone-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    /* 밝은 별 */
    radial-gradient(1.8px 1.8px at 7%   6%,  rgba(255,255,255,0.90) 0%, transparent 100%),
    radial-gradient(1.2px 1.2px at 18%  3%,  rgba(180,220,255,0.75) 0%, transparent 100%),
    radial-gradient(2px   2px   at 32%  8%,  rgba(255,255,255,0.80) 0%, transparent 100%),
    radial-gradient(1px   1px   at 45%  4%,  rgba(200,230,255,0.65) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 62%  7%,  rgba(255,255,255,0.85) 0%, transparent 100%),
    radial-gradient(1px   1px   at 78%  2%,  rgba(220,200,255,0.70) 0%, transparent 100%),
    radial-gradient(1.8px 1.8px at 91%  9%,  rgba(255,255,255,0.80) 0%, transparent 100%),
    radial-gradient(1px   1px   at 14%  16%, rgba(180,210,255,0.55) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 29%  14%, rgba(255,255,255,0.70) 0%, transparent 100%),
    radial-gradient(1px   1px   at 52%  19%, rgba(200,180,255,0.60) 0%, transparent 100%),
    radial-gradient(2px   2px   at 71%  13%, rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(1px   1px   at 85%  18%, rgba(180,220,255,0.55) 0%, transparent 100%),
    radial-gradient(1.2px 1.2px at 5%   28%, rgba(255,255,255,0.60) 0%, transparent 100%),
    radial-gradient(1px   1px   at 38%  25%, rgba(220,200,255,0.50) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 58%  30%, rgba(255,255,255,0.65) 0%, transparent 100%),
    radial-gradient(1px   1px   at 88%  27%, rgba(180,210,255,0.55) 0%, transparent 100%),
    radial-gradient(1px   1px   at 23%  38%, rgba(200,230,255,0.45) 0%, transparent 100%),
    radial-gradient(2px   2px   at 47%  42%, rgba(255,255,255,0.55) 0%, transparent 100%),
    radial-gradient(1px   1px   at 75%  38%, rgba(220,180,255,0.50) 0%, transparent 100%),
    radial-gradient(1.2px 1.2px at 95%  44%, rgba(255,255,255,0.60) 0%, transparent 100%),
    /* 하단은 어둡게 — 아이콘 가독성 */
    radial-gradient(1px   1px   at 12%  55%, rgba(180,200,255,0.30) 0%, transparent 100%),
    radial-gradient(1px   1px   at 67%  60%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px   1px   at 40%  70%, rgba(200,180,255,0.20) 0%, transparent 100%);
  pointer-events: none;
  animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0%   { opacity: 0.70; }
  50%  { opacity: 1.00; }
  100% { opacity: 0.80; }
}

@media (max-width: 440px) {
  #phone-frame { width:100vw; height:100dvh; border-radius:0; box-shadow:none; }
  #app-shell { align-items: flex-start; }
  /* 모바일에서 Dynamic Island 상대적 크기 유지 */
  #homescreen::before { width:110px; height:32px; top:10px; }
}

/* ── 스크린 컨테이너 ── */
#screen-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }

/* ── iOS 홈화면 상태바 (Dynamic Island 아래) ── */
.ios-statusbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Dynamic Island: 폰 상단에서 44px 아래에 시작 */
  padding: 14px 26px 0;
  height: 54px;
  flex-shrink: 0;
}

/* 상태바 시간 — Dynamic Island 좌측 배치 스타일 */
.ios-statusbar .time {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: white;
}
.ios-statusbar .status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ios-statusbar .status-icons svg { fill: white; }
.battery-box {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}
.battery-icon {
  width: 25px; height: 13px;
  border: 1.5px solid rgba(255,255,255,0.8);
  border-radius: 3.5px;
  padding: 1.5px;
  position: relative;
}
.battery-icon::after {
  content: '';
  position: absolute;
  right: -5px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 6px;
  background: rgba(255,255,255,0.6);
  border-radius: 0 2px 2px 0;
}
.battery-fill {
  height: 100%;
  background: white;
  border-radius: 2px;
  width: 70%;
}

/* ── 하단 네비게이션 (숨김) ── */
#bottom-nav { display: none !important; }

/* ── 홈화면 컨테이너 ── */
#homescreen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  z-index: 2;
  overflow: hidden;
}

/* Dynamic Island — 실제 iPhone 15 Pro 위치 */
#homescreen::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 36px;
  background: #000;
  border-radius: 22px;
  z-index: 100;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    inset 0 0 0 1px rgba(255,255,255,0.04),
    0 4px 12px rgba(0,0,0,0.60);
}

/* ── iOS 홈화면 날짜/시간 위젯 ── */
.hs-datetime-widget {
  text-align: center;
  padding: 2px 0 10px;
  flex-shrink: 0;
}
.hs-datetime-widget .hs-time {
  font-size: 76px;
  font-weight: 200;
  letter-spacing: -3px;
  color: white;
  line-height: 1;
  /* iOS 홈화면 시계 텍스트 그림자 */
  text-shadow:
    0 1px 0 rgba(255,255,255,0.10),
    0 2px 20px rgba(0,0,0,0.60),
    0 4px 40px rgba(0,0,0,0.30);
  font-family: -apple-system, 'SF Pro Display', sans-serif;
}
.hs-datetime-widget .hs-date {
  font-size: 17px;
  font-weight: 400;
  color: rgba(255,255,255,0.90);
  letter-spacing: 0.2px;
  margin-top: 4px;
  text-shadow:
    0 1px 8px rgba(0,0,0,0.55),
    0 2px 16px rgba(0,0,0,0.30);
  font-family: -apple-system, 'SF Pro Display', sans-serif;
}

/* ── iOS 홈화면 스타일 아이콘 그리드 ── */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 2px 14px 0;
  flex: 1;
  align-content: start;
}
.icon-row { display: contents; }

.app-icon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px 10px;
  cursor: pointer;
  transition: transform 0.12s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.app-icon-wrap:active {
  transform: scale(0.86);
}

/* 아이콘 실제 iOS 스타일 */
.app-icon {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  font-size: 28px;
  transition: transform 0.1s ease;
  /* iOS 특유의 입체 그림자 */
  box-shadow:
    0 2px 8px rgba(0,0,0,0.45),
    0 6px 20px rgba(0,0,0,0.30),
    inset 0 1px 0 rgba(255,255,255,0.22);
}

/* 아이콘 내부 iOS 광택 효과 */
.app-icon::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.28) 0%,
    rgba(255,255,255,0.08) 60%,
    transparent 100%);
  border-radius: 15px 15px 0 0;
  pointer-events: none;
  z-index: 1;
}

/* 아이콘 하단 반사 */
.app-icon::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 30%;
  background: linear-gradient(0deg,
    rgba(0,0,0,0.20) 0%,
    transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* 아이콘 레이블 — iOS 스타일 */
.app-label {
  font-size: 11px;
  font-weight: 400;
  color: white;
  text-align: center;
  /* iOS 홈화면 그림자 텍스트 */
  text-shadow:
    0 1px 3px rgba(0,0,0,0.90),
    0 0 10px rgba(0,0,0,0.60);
  line-height: 1.2;
  max-width: 68px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: keep-all;
  letter-spacing: -0.1px;
}

/* iOS 알림 배지 */
.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  background: #ff3b30;
  border-radius: 9px;
  /* iOS 홈화면처럼 흰 테두리 */
  border: 1.5px solid rgba(255,255,255,0.90);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
  padding: 0 4px;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  letter-spacing: -0.3px;
}

/* ── iOS 홈화면 스타일 검색바 ── */
.ios-searchbar {
  margin: 6px 16px 10px;
  height: 38px;
  /* iOS 스타일 frosted glass */
  background: rgba(255,255,255,0.18);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  cursor: pointer;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid rgba(255,255,255,0.30);
  box-shadow: 0 1px 4px rgba(0,0,0,0.20);
}
.ios-searchbar svg { fill: rgba(255,255,255,0.75); width:14px; height:14px; flex-shrink:0; }
.ios-searchbar span { font-size: 15px; color: rgba(255,255,255,0.70); font-weight: 400; }

/* ── iOS 홈화면 독(Dock) ── */
.ios-dock {
  margin: 4px 14px 18px;
  /* iOS 특유의 흰색 투명 frosted glass */
  background: rgba(255,255,255,0.20);
  border-radius: 28px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  backdrop-filter: blur(35px) saturate(200%);
  -webkit-backdrop-filter: blur(35px) saturate(200%);
  border: 0.5px solid rgba(255,255,255,0.35);
  box-shadow:
    0 2px 20px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.25);
  flex-shrink: 0;
}
.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: transform 0.12s;
}
.dock-item:active { transform: scale(0.86); }
.dock-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.45),
    0 4px 16px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.22);
}
.dock-icon::before {
  content:'';
  position:absolute;top:0;left:0;right:0;height:55%;
  background:linear-gradient(180deg,rgba(255,255,255,0.28) 0%,rgba(255,255,255,0.06) 60%,transparent 100%);
  pointer-events:none;z-index:1;
}
.dock-icon::after {
  content:'';
  position:absolute;bottom:0;left:0;right:0;height:30%;
  background:linear-gradient(0deg,rgba(0,0,0,0.18) 0%,transparent 100%);
  pointer-events:none;z-index:1;
}

/* ── 앱 실행 화면 (풀스크린) — iOS 스타일 ── */
.app-window {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* iOS 앱 실행: 아이콘에서 확대되는 느낌 */
  animation: appLaunch 0.35s cubic-bezier(0.28,0.72,0,1) both;
  transform-origin: center center;
}
.app-window.closing {
  animation: appClose 0.30s cubic-bezier(0.4,0,0.6,1) both;
}
@keyframes appLaunch {
  0%   { transform: scale(0.001); opacity: 0; }
  65%  { transform: scale(1.03);  opacity: 1; }
  100% { transform: scale(1);     opacity: 1; }
}
@keyframes appClose {
  0%   { transform: scale(1);    opacity: 1; }
  100% { transform: scale(0.001); opacity: 0; }
}

/* 앱 내부 상태바 (앱 윈도우용) */
.app-statusbar {
  height: 54px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 24px 8px;
  flex-shrink: 0;
  z-index: 5;
}
.app-statusbar .time { font-size: 15px; font-weight: 600; color: white; letter-spacing: -0.2px; }
.app-statusbar-icons { display: flex; gap: 6px; align-items: center; }

/* 앱 내부 네비게이션바 */
.app-navbar {
  display: flex;
  align-items: center;
  padding: 8px 20px 12px;
  flex-shrink: 0;
  position: relative;
}
.app-navbar h2 {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  font-size: 17px;
  font-weight: 600;
  color: white;
}
.back-btn-ios {
  display: flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--q-photon);
  font-size: 17px;
  font-weight: 400;
  padding: 4px 0;
  font-family: -apple-system, 'SF Pro Display', sans-serif;
}
.back-btn-ios svg { fill: var(--q-photon); width: 10px; height: 18px; }
.navbar-action {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--q-photon);
  font-size: 17px;
  font-weight: 400;
  font-family: -apple-system, 'SF Pro Display', 'Noto Sans KR', sans-serif;
}

/* ── 앱 내부 스크롤 영역 ── */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.app-content::-webkit-scrollbar { display: none; }

/* ── iOS 하단 탭바 ── */
.app-tabbar {
  display: flex;
  height: 72px;
  padding-bottom: 8px;
  background: rgba(7,13,30,0.92);
  border-top: 0.5px solid rgba(99,179,237,0.18);
  backdrop-filter: blur(30px);
  flex-shrink: 0;
}
.tabbar-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0 0;
  transition: opacity 0.15s;
}
.tabbar-btn:active { opacity: 0.6; }
.tabbar-btn svg { width: 24px; height: 24px; fill: rgba(180,210,240,0.35); }
.tabbar-btn span { font-size: 10px; color: rgba(180,210,240,0.35); font-weight: 500; }
.tabbar-btn.active svg { fill: var(--q-photon); }
.tabbar-btn.active span { color: var(--q-photon); }

/* ── iOS 카드/섹션 ── */
.ios-section {
  margin: 0 16px 10px;
  background: rgba(10,20,45,0.85);
  border-radius: 16px;
  overflow: hidden;
  border: 0.5px solid rgba(99,179,237,0.14);
}
.ios-section-header {
  padding: 16px 16px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--q-text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.ios-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-top: 0.5px solid rgba(99,179,237,0.08);
  cursor: pointer;
  transition: background 0.1s;
  gap: 12px;
}
.ios-row:first-child { border-top: none; }
.ios-row:active { background: rgba(99,179,237,0.07); }
.ios-row .row-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.ios-row .row-label { flex: 1; font-size: 17px; color: var(--q-text); }
.ios-row .row-value { font-size: 15px; color: var(--q-text3); }
.ios-row .row-chevron { color: var(--q-text3); font-size: 17px; }

/* ── iOS 카드 ── */
.ios-card {
  margin: 0 16px 12px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

/* ── 오늘 파동함수 카드 ── */
.flow-card {
  margin: 0 16px 10px;
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(11,25,60,0.97), rgba(15,35,55,0.97));
  border: 0.5px solid rgba(99,179,237,0.22);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}
.flow-card::before {
  content:'';
  position:absolute;
  top:-50px; right:-40px;
  width:140px; height:140px;
  background:radial-gradient(circle, rgba(99,179,237,0.20), transparent 70%);
  pointer-events:none;
  animation: quantumPulse 4s ease-in-out infinite;
}
.flow-card::after {
  content:'';
  position:absolute;
  bottom:-30px; left:-20px;
  width:100px; height:100px;
  background:radial-gradient(circle, rgba(167,139,250,0.15), transparent 70%);
  pointer-events:none;
}

/* ── 점수 원 (파동함수 수렴) ── */
.score-circle {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(99,179,237,0.3);
  box-shadow: 0 0 20px rgba(99,179,237,0.25), inset 0 0 12px rgba(99,179,237,0.08);
}

/* ── 사주팔자 카드 ── */
.saju-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 8px;
}
.saju-pillar {
  text-align: center;
  padding: 10px 4px;
  background: rgba(99,179,237,0.06);
  border-radius: 12px;
  border: 0.5px solid rgba(99,179,237,0.15);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.saju-pillar:hover {
  border-color: rgba(99,179,237,0.35);
  box-shadow: 0 0 12px rgba(99,179,237,0.15);
}

/* ── 오행 바 (양자 에너지 레벨) ── */
.ohaeng-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.ohaeng-track {
  flex: 1;
  height: 6px;
  background: rgba(99,179,237,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.ohaeng-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.9s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.ohaeng-fill::after {
  content:'';
  position:absolute;
  right:0; top:0; bottom:0;
  width: 6px;
  background: rgba(255,255,255,0.6);
  border-radius: 3px;
  filter: blur(2px);
}

/* ── 궁합 카드 ── */
.compat-card-ios {
  margin: 0 16px 10px;
  padding: 16px;
  background: rgba(10,20,45,0.88);
  border-radius: 18px;
  border: 0.5px solid rgba(167,139,250,0.18);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  backdrop-filter: blur(10px);
}
.compat-card-ios:active { transform: scale(0.98); }
.compat-card-ios:hover {
  box-shadow: 0 0 24px rgba(167,139,250,0.18);
}

/* ── 인사이트 블록 ── */
.insight-block {
  margin: 0 16px 10px;
  padding: 16px;
  border-radius: 16px;
  border: 0.5px solid rgba(99,179,237,0.14);
  background: rgba(10,20,45,0.70);
}

/* ── 입력 필드 ── */
.ios-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(99,179,237,0.07);
  border: 0.5px solid rgba(99,179,237,0.25);
  color: var(--q-text);
  font-size: 17px;
  font-family: -apple-system, 'SF Pro Display', 'Noto Sans KR', sans-serif;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.ios-input:focus {
  border-color: var(--q-photon);
  background: rgba(99,179,237,0.10);
  box-shadow: 0 0 0 3px rgba(99,179,237,0.12);
}
.ios-input::placeholder { color: rgba(150,190,230,0.35); }

/* ── 선택 버튼 ── */
.ios-select-btn {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(99,179,237,0.07);
  border: 0.5px solid rgba(99,179,237,0.18);
  color: rgba(180,220,255,0.55);
  font-size: 16px;
  cursor: pointer;
  font-family: -apple-system, 'SF Pro Display', 'Noto Sans KR', sans-serif;
  text-align: left;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.ios-select-btn.selected {
  border-color: var(--q-photon);
  background: rgba(99,179,237,0.15);
  color: var(--q-text);
  box-shadow: 0 0 12px rgba(99,179,237,0.18);
}

/* ── 큰 버튼 ── */
.ios-btn-primary {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e5fa8, var(--q-photon));
  color: white;
  font-size: 17px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: -apple-system, 'SF Pro Display', 'Noto Sans KR', sans-serif;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(99,179,237,0.35);
}
.ios-btn-primary:hover {
  opacity: 0.92;
  box-shadow: 0 6px 28px rgba(99,179,237,0.45);
}
.ios-btn-primary:active { transform: scale(0.98); opacity: 0.8; }
.ios-btn-primary:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }

.ios-btn-secondary {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: rgba(99,179,237,0.08);
  color: var(--q-text);
  font-size: 16px;
  font-weight: 500;
  border: 0.5px solid rgba(99,179,237,0.20);
  cursor: pointer;
  font-family: -apple-system, 'SF Pro Display', 'Noto Sans KR', sans-serif;
  transition: opacity 0.15s, background 0.2s;
}
.ios-btn-secondary:active { opacity: 0.6; }

.ios-btn-text {
  background: none;
  border: none;
  color: var(--q-photon);
  font-size: 17px;
  cursor: pointer;
  font-family: -apple-system, 'SF Pro Display', 'Noto Sans KR', sans-serif;
  padding: 8px;
}

/* ── 태그 칩 ── */
.ios-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 14px;
  background: rgba(99,179,237,0.08);
  border: 0.5px solid rgba(99,179,237,0.20);
  color: var(--q-text2);
  cursor: pointer;
  transition: all 0.15s;
}
.ios-tag.selected {
  background: rgba(99,179,237,0.22);
  border-color: var(--q-photon);
  color: white;
  box-shadow: 0 0 10px rgba(99,179,237,0.25);
}

/* ── 진행바 (온보딩) ── */
.ob-progress {
  display: flex;
  gap: 6px;
  padding: 0 24px 20px;
}
.ob-progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(99,179,237,0.12);
  border-radius: 2px;
  overflow: hidden;
}
.ob-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--q-photon), var(--q-entangle));
  border-radius: 2px;
  transition: width 0.35s ease;
  box-shadow: 0 0 6px rgba(99,179,237,0.5);
}

/* ── 스플래시 ── */
.splash-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(30,95,168,0.22) 0%, transparent 65%),
    linear-gradient(180deg, #070d1e 0%, #04060f 100%);
}
.splash-icon-box {
  width: 108px; height: 108px;
  border-radius: 30px;
  background: linear-gradient(135deg, #0c2461, #1e3799, #0f3460);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  box-shadow:
    0 20px 60px rgba(30,95,168,0.50),
    0 0 0 1px rgba(99,179,237,0.25),
    inset 0 1px 0 rgba(255,255,255,0.15);
  animation: quantumPulse 3s ease-in-out infinite;
}
@keyframes quantumPulse {
  0%,100% {
    box-shadow: 0 20px 60px rgba(30,95,168,0.50), 0 0 0 1px rgba(99,179,237,0.25), 0 0 0 rgba(99,179,237,0);
  }
  50% {
    box-shadow: 0 24px 80px rgba(30,95,168,0.70), 0 0 0 1px rgba(99,179,237,0.45), 0 0 40px rgba(99,179,237,0.20);
  }
}
.splash-dots { display: flex; gap: 10px; margin-top: 48px; }
.splash-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(99,179,237,0.30);
  animation: dotBounce 1.4s infinite;
}
.splash-dots span:nth-child(2) { animation-delay: 0.22s; }
.splash-dots span:nth-child(3) { animation-delay: 0.44s; }
@keyframes dotBounce {
  0%,100% { transform: translateY(0); background: rgba(99,179,237,0.30); }
  50% { transform: translateY(-12px); background: var(--q-resonance); box-shadow: 0 0 8px var(--q-resonance); }
}

/* ── 로그인 ── */
.login-screen {
  display: flex;
  flex-direction: column;
  padding: 60px 24px 40px;
  min-height: 100%;
  background:
    radial-gradient(ellipse 70% 50% at 50% 20%, rgba(30,95,168,0.18) 0%, transparent 60%),
    linear-gradient(180deg, #070d1e 0%, #04060f 100%);
}
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: -apple-system, 'SF Pro Display', 'Noto Sans KR', sans-serif;
  transition: all 0.15s;
  width: 100%;
}
.social-btn:active { transform: scale(0.97); }
.btn-apple-login {
  background: rgba(30,30,35,0.95);
  color: white;
  border: 0.5px solid rgba(99,179,237,0.25);
}
.btn-google-login { background: white; color: #1C1C1E; }
.btn-kakao-login  { background: #FEE500; color: #191919; }

/* ── 구독 플랜 카드 ── */
.plan-card {
  margin: 0 16px 10px;
  padding: 18px;
  background: rgba(10,20,45,0.88);
  border-radius: 18px;
  border: 0.5px solid rgba(99,179,237,0.14);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.plan-card.featured {
  border-color: var(--q-collapse);
  background: rgba(246,173,85,0.06);
  box-shadow: 0 0 30px rgba(246,173,85,0.12);
}
.plan-card:active { transform: scale(0.98); }
.plan-badge {
  position: absolute;
  top: -1px; right: 14px;
  background: linear-gradient(90deg, var(--q-collapse), #e67e22);
  color: #1a1a1a;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 0 0 8px 8px;
}

/* ── 모달 (바텀시트) ── */
.bottomsheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(10px);
}
.bottomsheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: #0c1530;
  border-radius: 24px 24px 0 0;
  padding: 8px 20px 32px;
  max-height: 80%;
  overflow-y: auto;
  border-top: 0.5px solid rgba(99,179,237,0.20);
}
.bottomsheet-handle {
  width: 36px; height: 4px;
  background: rgba(99,179,237,0.25);
  border-radius: 2px;
  margin: 8px auto 16px;
}

/* ── 토스트 ── */
.ios-toast {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12,21,50,0.97);
  color: var(--q-text);
  padding: 11px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 9999;
  box-shadow: 0 4px 24px rgba(0,0,0,0.6), 0 0 20px rgba(99,179,237,0.15);
  border: 0.5px solid rgba(99,179,237,0.22);
  animation: toastIn 0.25s ease both;
  font-family: -apple-system, 'SF Pro Display', 'Noto Sans KR', sans-serif;
  max-width: 320px;
  text-align: center;
  word-break: keep-all;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(0.95); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ── 양자 특화 UI 컴포넌트 ── */

/* 양자 수렴 배지 */
.quantum-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.quantum-badge.photon {
  background: rgba(99,179,237,0.15);
  border: 0.5px solid rgba(99,179,237,0.35);
  color: var(--q-photon);
}
.quantum-badge.entangle {
  background: rgba(167,139,250,0.15);
  border: 0.5px solid rgba(167,139,250,0.35);
  color: var(--q-entangle);
}
.quantum-badge.wave {
  background: rgba(52,211,153,0.15);
  border: 0.5px solid rgba(52,211,153,0.35);
  color: var(--q-wave);
}

/* 노벨상 인용 블록 */
.nobel-quote {
  margin: 0 16px 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(99,179,237,0.08), rgba(167,139,250,0.08));
  border-radius: 14px;
  border-left: 3px solid var(--q-photon);
  font-size: 13px;
  color: var(--q-text2);
  font-style: italic;
  line-height: 1.6;
  position: relative;
}
.nobel-quote::before {
  content: '"';
  position: absolute;
  top: -8px; left: 12px;
  font-size: 40px;
  color: rgba(99,179,237,0.25);
  font-style: normal;
  line-height: 1;
}
.nobel-quote .quote-source {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--q-text3);
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* 파동함수 시각화 바 */
.wavefunction-bar {
  height: 48px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  margin: 8px 0;
}
.wavefunction-bar canvas {
  width: 100%;
  height: 100%;
}

/* 양자 간섭 무늬 구분선 */
.quantum-divider {
  height: 1px;
  margin: 12px 16px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(99,179,237,0.20) 20%,
    rgba(167,139,250,0.30) 50%,
    rgba(99,179,237,0.20) 80%,
    transparent 100%
  );
}

/* 얽힘(Entanglement) 태그 */
.entangle-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--q-entangle);
  font-weight: 600;
}

/* ── 페이지 도트 인디케이터 (iOS 홈화면 스타일) ── */
.hs-page-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 4px 0 6px;
  flex-shrink: 0;
}
.hs-page-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transition: all 0.3s ease;
}
.hs-page-dots .dot.active {
  width: 20px;
  border-radius: 4px;
  background: rgba(255,255,255,0.85);
}

/* ── 아이콘 페이드인 애니메이션 ── */
@keyframes iconFadeIn {
  from {
    opacity: 0;
    transform: scale(0.7) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ── iOS 앱 실행 애니메이션 (iPhone 스타일) ── */
@keyframes appLaunchIOS {
  0%   { transform: scale(0.001); opacity: 0; }
  60%  { transform: scale(1.04);  opacity: 1; }
  100% { transform: scale(1);     opacity: 1; }
}

/* ── 애니메이션 ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes scaleIn {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
@keyframes quantumGlow {
  0%,100% { filter: drop-shadow(0 0 4px rgba(99,179,237,0.4)); }
  50%     { filter: drop-shadow(0 0 12px rgba(99,179,237,0.8)); }
}
@keyframes entangleFloat {
  0%,100% { transform: translateY(0) rotate(0deg); }
  33%     { transform: translateY(-4px) rotate(1deg); }
  66%     { transform: translateY(2px) rotate(-1deg); }
}

/* ── 유틸 ── */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.text-muted    { color: var(--q-text3); }
.text-blue     { color: var(--q-photon); }
.text-teal     { color: var(--q-resonance); }
.text-gold     { color: var(--q-collapse); }
.text-red      { color: var(--ios-red); }
.text-purple   { color: var(--q-entangle); }
.text-green    { color: var(--q-wave); }
.text-center   { text-align: center; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* ══════════════════════════════════════════════════════════
   양자만세력 (量子萬歲曆) 전용 스타일
   ══════════════════════════════════════════════════════════ */

/* 달력 날짜 셀 — 호버 효과 */
.mr-day-cell {
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  border-radius: 8px;
}
.mr-day-cell:active {
  transform: scale(0.92);
  background: rgba(99,179,237,0.18) !important;
}

/* 간지 뱃지 (오행별 색상) */
.mr-ganji-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
  border: 1.5px solid currentColor;
}

/* 절기 태그 */
.mr-jeolgi-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(251,191,36,0.12);
  border: 0.5px solid rgba(251,191,36,0.35);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 700;
}

/* 월 네비게이터 버튼 */
.mr-nav-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(99,179,237,0.10);
  border: 0.5px solid rgba(99,179,237,0.25);
  color: var(--q-photon);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
  flex-shrink: 0;
}
.mr-nav-btn:active {
  background: rgba(99,179,237,0.28);
  transform: scale(0.93);
}

/* 선택 날짜 하이라이트 */
.mr-selected {
  background: rgba(99,179,237,0.22) !important;
  border: 1px solid rgba(99,179,237,0.55) !important;
  transform: scale(1.06);
}

/* 오늘 날짜 하이라이트 */
.mr-today {
  background: rgba(167,139,250,0.15) !important;
  border: 1px solid rgba(167,139,250,0.38) !important;
}

/* 일진 테이블 행 */
.mr-table-row {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}
.mr-table-cell {
  flex: 1;
  text-align: center;
  padding: 6px 2px;
  border-radius: 8px;
  background: rgba(99,179,237,0.05);
  border: 1px solid rgba(99,179,237,0.10);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.mr-table-cell:active {
  background: rgba(99,179,237,0.20);
  transform: scale(0.94);
}

/* 연주 카드 */
.mr-year-card {
  padding: 14px 16px;
  background: rgba(10,20,50,0.7);
  border-radius: 16px;
  border: 0.5px solid rgba(99,179,237,0.12);
}

/* 절기 카드 */
.mr-jeolgi-card {
  padding: 12px 14px;
  background: rgba(8,15,35,0.88);
  border-radius: 14px;
  border: 0.5px solid rgba(251,191,36,0.20);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mr-jeolgi-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.30);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* 일주 상세 카드 — 3주 그리드 */
.mr-pillar-grid {
  display: flex;
  gap: 8px;
}
.mr-pillar-card {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  background: rgba(99,179,237,0.06);
  border-radius: 14px;
  border: 0.5px solid rgba(99,179,237,0.15);
}

/* 오행 컬러 클래스 */
.ohaeng-mok  { color: #22C55E; }
.ohaeng-hwa  { color: #F97316; }
.ohaeng-to   { color: #D4A017; }
.ohaeng-geum { color: #94A3B8; }
.ohaeng-su   { color: #3B82F6; }

/* 애니메이션 — 달력 셀 등장 */
@keyframes mrCellIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
