/* ============================
   ROOT & RESET
   ============================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-hover: #eeecff;
  --border: rgba(108,99,255,0.15);
  --border-strong: rgba(108,99,255,0.35);
  --accent: #6c63ff;
  --accent2: #a78bfa;
  --text: #1e1b4b;
  --text-sub: #6b7280;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 4px 20px rgba(108,99,255,0.10);
  --shadow-lg: 0 12px 40px rgba(108,99,255,0.18);
  --font: 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
  --bg-grad1: rgba(108,99,255,0.08);
  --bg-grad2: rgba(167,139,250,0.07);
}

/* ── 테마: 블루 ── */
[data-theme="blue"] {
  --bg: #f0f7ff;
  --surface: #ffffff;
  --surface-hover: #e0f0ff;
  --border: rgba(37,99,235,0.15);
  --border-strong: rgba(37,99,235,0.35);
  --accent: #2563eb;
  --accent2: #60a5fa;
  --text: #1e3a5f;
  --shadow: 0 4px 20px rgba(37,99,235,0.10);
  --shadow-lg: 0 12px 40px rgba(37,99,235,0.18);
  --bg-grad1: rgba(37,99,235,0.08);
  --bg-grad2: rgba(96,165,250,0.07);
}

/* ── 테마: 그린 ── */
[data-theme="green"] {
  --bg: #f0faf4;
  --surface: #ffffff;
  --surface-hover: #dcfce7;
  --border: rgba(22,163,74,0.15);
  --border-strong: rgba(22,163,74,0.35);
  --accent: #16a34a;
  --accent2: #4ade80;
  --text: #14532d;
  --shadow: 0 4px 20px rgba(22,163,74,0.10);
  --shadow-lg: 0 12px 40px rgba(22,163,74,0.18);
  --bg-grad1: rgba(22,163,74,0.08);
  --bg-grad2: rgba(74,222,128,0.07);
}

/* ── 테마: 다크 ── */
[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #2d3f55;
  --border: rgba(148,163,184,0.12);
  --border-strong: rgba(148,163,184,0.28);
  --accent: #818cf8;
  --accent2: #a5b4fc;
  --text: #e2e8f0;
  --text-sub: #94a3b8;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
  --bg-grad1: rgba(129,140,248,0.06);
  --bg-grad2: rgba(165,180,252,0.04);
}

/* ── 테마: 리퀴드 글라스 ── */
[data-theme="glass"] {
  --bg: #dbeeff;
  --surface: rgba(255,255,255,0.45);
  --surface-hover: rgba(255,255,255,0.68);
  --border: rgba(100,180,255,0.28);
  --border-strong: rgba(100,180,255,0.55);
  --accent: #0ea5e9;
  --accent2: #38bdf8;
  --text: #0c2d4e;
  --text-sub: #3d6a8a;
  --success: #0d9488;
  --danger: #e11d48;
  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 4px 24px rgba(14,165,233,0.13);
  --shadow-lg: 0 12px 48px rgba(14,165,233,0.22);
  --bg-grad1: rgba(14,165,233,0.10);
  --bg-grad2: rgba(56,189,248,0.08);
}

/* ── 테마: 한교동 ── */
[data-theme="hgd"] {
  --bg: #e0f7f4;
  --surface: #ffffff;
  --surface-hover: #c8f0ec;
  --border: rgba(0,180,160,0.18);
  --border-strong: rgba(0,180,160,0.4);
  --accent: #00b4a0;
  --accent2: #4dd9c8;
  --text: #0a3330;
  --text-sub: #3a7a74;
  --success: #00b4a0;
  --danger: #ff6b6b;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 4px 20px rgba(0,180,160,0.13);
  --shadow-lg: 0 12px 40px rgba(0,180,160,0.22);
  --bg-grad1: rgba(0,180,160,0.09);
  --bg-grad2: rgba(77,217,200,0.07);
}

[data-theme="hgd"] body {
  background: #e0f7f4;
}

/* 한교동 캐릭터들 — 곳곳에 배치 */
/* HGD: 우하단 */
[data-theme="hgd"] body::after {
  content: '';
  position: fixed;
  bottom: -8px;
  right: 8px;
  width: 110px;
  height: 110px;
  background: url('/image/HGD.png') no-repeat bottom right / contain;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.9;
}
/* hgd1 (선글라스): 좌하단 */
[data-theme="hgd"] body::before {
  content: '';
  position: fixed;
  bottom: -6px;
  left: 10px;
  width: 95px;
  height: 95px;
  background: url('/image/hgd1.png') no-repeat bottom left / contain;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.85;
}
/* hgd2 (놀란 표정): 우상단 */
[data-theme="hgd"] .app::before {
  content: '';
  position: fixed;
  top: 12px;
  right: 14px;
  width: 80px;
  height: 80px;
  background: url('/image/hgd2.png') no-repeat top right / contain;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.75;
}
/* hgd3 (하트): 입력창 근처 (좌상단) */
[data-theme="hgd"] .app::after {
  content: '';
  position: fixed;
  top: 10px;
  left: 12px;
  width: 80px;
  height: 80px;
  background: url('/image/hgd3.png') no-repeat top left / contain;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.75;
}

/* 한교동 — 일정 탭/풀 영역 안에 흐릿하게 */
[data-theme="hgd"] .schedule-area {
  position: relative;
}
/* 경계선 근처 — hgd3(하트) 왼쪽, hgd2(놀란) 오른쪽 */
[data-theme="hgd"] .schedule-area__header {
  position: relative;
}
[data-theme="hgd"] .schedule-area__header::before {
  content: '';
  position: absolute;
  top: -38px;
  left: 30px;
  width: 72px;
  height: 72px;
  background: url('/image/hgd3.png') no-repeat center / contain;
  pointer-events: none;
  z-index: 2;
  opacity: 0.55;
}
/* 할일 풀 영역 배경 — hgd2(놀란 표정) */
[data-theme="hgd"] .task-pool {
  position: relative;
}
[data-theme="hgd"] .task-pool::before {
  content: '';
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 110px;
  height: 110px;
  background: url('/image/hgd2.png') no-repeat center / contain;
  pointer-events: none;
  z-index: 0;
  opacity: 0.12;
}
/* day-card 홀수번째 — hgd1(선글라스) */
[data-theme="hgd"] .day-card:nth-child(odd)::after {
  content: '';
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 72px;
  height: 72px;
  background: url('/image/hgd1.png') no-repeat center / contain;
  pointer-events: none;
  z-index: 0;
  opacity: 0.09;
}
/* day-card 짝수번째 — HGD(혀) */
[data-theme="hgd"] .day-card:nth-child(even)::after {
  content: '';
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 72px;
  height: 72px;
  background: url('/image/HGD.png') no-repeat center / contain;
  pointer-events: none;
  z-index: 0;
  opacity: 0.09;
}

/* 한교동 — O버튼을 캐릭터 이미지로 교체 */
[data-theme="hgd"] .btn-o {
  background: url('/image/hgdno.png') no-repeat center / contain !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: transparent !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 0 !important;
}
[data-theme="hgd"] .btn-o--checked,
[data-theme="hgd"] .sched-item__done--checked ~ * .btn-o,
[data-theme="hgd"] .pool-card--done .btn-o,
[data-theme="hgd"] .btn-o[data-checked="true"] {
  background-image: url('/image/hgdyes.png') !important;
}
/* active(완료) 상태 */
[data-theme="hgd"] .btn-o.active {
  background: url('/image/hgdyes.png') no-repeat center / contain !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: transparent !important;
}

/* 한교동 스와치 */
.theme-swatch[data-theme="hgd"] {
  background: linear-gradient(135deg, #00b4a0, #4dd9c8, #a8f0ea);
  box-shadow: 0 3px 10px rgba(0,180,160,0.35);
  background-image: url('/image/HGD.png');
  background-size: 130%;
  background-position: center 10%;
  background-repeat: no-repeat;
}

/* ── 테마: 젤리 ── */
[data-theme="jelly"] {
  --bg: #fff0f8;
  --surface: #ffffff;
  --surface-hover: #ffe4f4;
  --border: rgba(255,105,180,0.18);
  --border-strong: rgba(255,105,180,0.4);
  --accent: #ff5fad;
  --accent2: #ff9de2;
  --text: #4a0030;
  --text-sub: #b06090;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 4px 20px rgba(255,95,173,0.13);
  --shadow-lg: 0 12px 40px rgba(255,95,173,0.22);
  --bg-grad1: rgba(255,95,173,0.09);
  --bg-grad2: rgba(255,157,226,0.07);
}

[data-theme="jelly"] body {
  background: #fff0f8;
}

/* 젤리 — 둥글고 통통한 surface */
[data-theme="jelly"] .app {
  border-radius: 28px;
  box-shadow: 0 8px 40px rgba(255,95,173,0.18),
              0 2px 0 rgba(255,255,255,0.9) inset;
}
[data-theme="jelly"] .pool-card,
[data-theme="jelly"] .sched-day,
[data-theme="jelly"] .modal-box {
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(255,95,173,0.12),
              0 1px 0 rgba(255,255,255,0.8) inset;
}

/* 젤리 — 몽글몽글 애니메이션 */
@keyframes jellyWobble {
  0%   { transform: scale(1,1); }
  20%  { transform: scale(1.15, 0.85); }
  40%  { transform: scale(0.9, 1.12); }
  55%  { transform: scale(1.08, 0.94); }
  70%  { transform: scale(0.97, 1.05); }
  85%  { transform: scale(1.03, 0.98); }
  100% { transform: scale(1,1); }
}
@keyframes jellyFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

/* 상단 버튼 아이콘들 — 아주 살짝만 */
[data-theme="jelly"] #addBtn,
[data-theme="jelly"] #demoBtn,
[data-theme="jelly"] #infoBtn,
[data-theme="jelly"] #settingsBtn,
[data-theme="jelly"] #deadlineBtn {
  animation: jellyFloat 4s ease-in-out infinite;
}
[data-theme="jelly"] #demoBtn     { animation-delay: 0s; }
[data-theme="jelly"] #infoBtn     { animation-delay: 0.8s; }
[data-theme="jelly"] #settingsBtn { animation-delay: 1.6s; }
[data-theme="jelly"] #deadlineBtn { animation-delay: 2.4s; }
[data-theme="jelly"] #addBtn      { animation-delay: 0.4s; }

/* 클릭하면 쫀득하게 튀기 */
[data-theme="jelly"] button:active {
  animation: jellyWobble 0.45s ease forwards !important;
}

/* 젤리 스와치 */
.theme-swatch[data-theme="jelly"] {
  background: linear-gradient(135deg, #ff5fad, #ff9de2, #ffb3ec);
  box-shadow: 0 3px 10px rgba(255,95,173,0.4);
}

/* 배경 — 무지갯빛 그라디언트 */
[data-theme="glass"] body {
  background: linear-gradient(135deg,
    #c4e0ff 0%, #d4f0ff 20%,
    #e8d4ff 45%, #ffd4e8 65%,
    #d4ffe8 85%, #c4e0ff 100%);
  background-size: 400% 400%;
  animation: glassGradient 12s ease infinite;
}

@keyframes glassGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 유리처럼 흐릿한 surface */
[data-theme="glass"] .app,
[data-theme="glass"] .modal-box,
[data-theme="glass"] .pool-card,
[data-theme="glass"] .sched-day,
[data-theme="glass"] .settings-modal,
[data-theme="glass"] .info-modal {
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  background: var(--surface) !important;
}

[data-theme="glass"] .app {
  border: 1.5px solid var(--border-strong);
  box-shadow: 0 8px 40px rgba(14,165,233,0.18),
              inset 0 1px 0 rgba(255,255,255,0.7);
}

/* 테마 스와치 — 글라스 프리즘 */
.theme-swatch[data-theme="glass"] {
  background: linear-gradient(135deg, #c4e0ff, #e8d4ff, #ffd4e8, #d4ffe8);
  background-size: 200% 200%;
  animation: glassSwatchShift 4s ease infinite;
  border: 1.5px solid rgba(100,180,255,0.5);
}
@keyframes glassSwatchShift {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

/* ══════════════════════════════════════════════
   테마: 겨울 (Winter)
   ══════════════════════════════════════════════ */
[data-theme="winter"] {
  --bg: #eaf5fc;
  --surface: #ffffff;
  --surface-hover: #d5ecf7;
  --border: rgba(58,155,213,0.18);
  --border-strong: rgba(58,155,213,0.38);
  --accent: #3a9bd5;
  --accent2: #7ec8e8;
  --text: #1a3a5c;
  --text-sub: #5a7a9c;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(58,155,213,0.13);
  --shadow-lg: 0 12px 40px rgba(58,155,213,0.2);
  --bg-grad1: rgba(58,155,213,0.07);
  --bg-grad2: rgba(126,200,232,0.05);
}

[data-theme="winter"] body {
  background:
    radial-gradient(ellipse 80% 40% at 20% 10%, rgba(184,224,245,0.5) 0%, transparent 60%),
    radial-gradient(ellipse 60% 30% at 80% 90%, rgba(126,200,232,0.35) 0%, transparent 55%),
    linear-gradient(180deg, #d6eef8 0%, #eaf5fc 50%, #f3faff 100%);
  background-attachment: fixed;
}

[data-theme="winter"] .app {
  background: rgba(255,255,255,0.88) !important;
  border: 1.5px solid rgba(58,155,213,0.2);
  box-shadow:
    0 8px 40px rgba(58,155,213,0.14),
    inset 0 1px 0 rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

[data-theme="winter"] .pool-card,
[data-theme="winter"] .sched-day,
[data-theme="winter"] .modal-box {
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(58,155,213,0.1),
              inset 0 1px 0 rgba(255,255,255,0.85);
}

/* 날짜 헤더 accent 색 */
[data-theme="winter"] .day-card__date  { color: #3a9bd5; }
[data-theme="winter"] .today-badge {
  background: linear-gradient(135deg, #3a9bd5, #7ec8e8);
  color: #fff;
}

/* 버튼들 */
[data-theme="winter"] .auth-btn,
[data-theme="winter"] #addTaskBtn {
  background: linear-gradient(135deg, #3a9bd5, #7ec8e8);
  color: #fff;
}

/* 입력창 포커스 */
[data-theme="winter"] .task-input:focus {
  border-color: #3a9bd5;
  box-shadow: 0 0 0 3px rgba(58,155,213,0.15);
}

/* 진행 바 */
[data-theme="winter"] .day-card__progress-bar {
  background: linear-gradient(90deg, #3a9bd5, #7ec8e8);
}

/* ── 겨울 테마: 일정 아이템 공통 ── */
[data-theme="winter"] .sched-item {
  position: relative;
  overflow: hidden; /* 균열이 아이템 밖으로 나가지 않도록 */
}

/* ── 미완료 일정 = 얼음 스타일 ── */
[data-theme="winter"] .sched-item:not(.done) {
  background:
    linear-gradient(160deg,
      rgba(240,251,255,0.99) 0%,
      rgba(208,238,252,0.97) 28%,
      rgba(242,252,255,0.98) 55%,
      rgba(192,226,248,0.96) 100%) !important;
  border: 1.5px solid rgba(80,168,222,0.55) !important;
  box-shadow:
    inset 0 2px 5px rgba(255,255,255,0.92),
    inset 0 -2px 4px rgba(58,155,213,0.2),
    inset 3px 0 7px rgba(255,255,255,0.5),
    0 3px 10px rgba(58,155,213,0.14) !important;
}

/* 서리 결정 + 반사광 + 광택 (::before 하나로 통합, z-index 충돌 방지) */
[data-theme="winter"] .sched-item:not(.done)::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
  background:
    /* 광택 필름 — 상단 좌측 얇은 글로스 */
    linear-gradient(108deg, rgba(255,255,255,0.32) 0%, rgba(255,255,255,0.06) 28%, transparent 46%),
    /* 좌상단 반사광 */
    radial-gradient(ellipse 65% 48% at 10% 18%, rgba(255,255,255,0.55) 0%, transparent 100%),
    /* 우하단 보조 반사 */
    radial-gradient(ellipse 45% 55% at 86% 83%, rgba(195,232,252,0.32) 0%, transparent 100%),
    /* 서리 해칭 A */
    repeating-linear-gradient(
      -52deg,
      transparent 0px, transparent 8px,
      rgba(255,255,255,0.32) 8px, rgba(255,255,255,0.32) 9px
    ),
    /* 서리 해칭 B */
    repeating-linear-gradient(
      40deg,
      transparent 0px, transparent 13px,
      rgba(110,185,228,0.2) 13px, rgba(110,185,228,0.2) 14px
    );
}
/* nth-child 교차 패턴 */
[data-theme="winter"] .sched-item:not(.done):nth-child(even)::before {
  background:
    linear-gradient(108deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.05) 25%, transparent 44%),
    radial-gradient(ellipse 55% 52% at 88% 15%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(ellipse 40% 50% at 12% 85%, rgba(185,225,250,0.28) 0%, transparent 100%),
    repeating-linear-gradient(
      -38deg,
      transparent 0px, transparent 10px,
      rgba(255,255,255,0.28) 10px, rgba(255,255,255,0.28) 11px
    ),
    repeating-linear-gradient(
      52deg,
      transparent 0px, transparent 16px,
      rgba(110,185,228,0.18) 16px, rgba(110,185,228,0.18) 17px
    );
}

/* ── 대기목록(pool card) 얼음 텍스처 ── */
[data-theme="winter"] .pool-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg,
    rgba(196,226,242,0.45) 0%,
    rgba(235,247,253,0.7) 100%) !important;
  border-color: rgba(58,155,213,0.28) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    0 2px 8px rgba(58,155,213,0.08) !important;
}
[data-theme="winter"] .pool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: repeating-linear-gradient(
    -48deg,
    transparent,
    transparent 10px,
    rgba(255,255,255,0.2) 10px,
    rgba(255,255,255,0.2) 11px
  );
  z-index: 0;
}
/* 얼음 깨기 플래시 keyframe */
@keyframes iceFlash {
  0%   { opacity: 0.85; transform: scale(1); }
  40%  { opacity: 1;    transform: scale(1.04); }
  100% { opacity: 0;    transform: scale(1.08); }
}

/* ── 겨울 눈 파티클 ── */
.winter-snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  overflow: hidden;
}
.snowflake {
  position: absolute;
  top: -2em;
  color: #c8e8f8;
  user-select: none;
  animation: snowFall linear infinite;
}
@keyframes snowFall {
  0%   { transform: translateY(-2em) translateX(0)                rotate(0deg);   opacity: 0; }
  8%   { opacity: 1; }
  100% { transform: translateY(105vh) translateX(var(--drift,30px)) rotate(540deg); opacity: 0.25; }
}

/* ── 겨울 데코 (눈사람·트리) ── */
.winter-deco {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 1.6rem;
  line-height: 1;
  pointer-events: none;
  z-index: 10;
  opacity: 0.82;
  animation: decoFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 2px 6px rgba(58,155,213,0.25));
}
@keyframes decoFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-5px); }
}


/* 겨울 스와치 */
.theme-swatch[data-theme="winter"] {
  background: linear-gradient(135deg, #b8ddf0 0%, #e8f6fc 50%, #3a9bd5 100%);
  border: 1.5px solid rgba(58,155,213,0.35);
  box-shadow: 0 2px 8px rgba(58,155,213,0.2);
}

/* ── 테마: 붕괴 스타레일 ── */
[data-theme="starrail"] {
  --bg: #0e1d35;
  --surface: #162a48;
  --surface-hover: #1e3a60;
  --border: rgba(137,196,255,0.22);
  --border-strong: rgba(137,196,255,0.45);
  --accent: #89c4ff;
  --accent2: #c8dff8;
  --text: #e8f4ff;
  --text-sub: #8ab0d0;
  --success: #5de0b0;
  --danger: #f87171;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.5);
  --bg-grad1: rgba(137,196,255,0.1);
  --bg-grad2: rgba(200,223,248,0.07);
}

html { scroll-behavior: smooth; overflow-x: hidden; overscroll-behavior: none; }

/* 스크롤바 숨기기 (스크롤 동작은 유지) */
* { scrollbar-width: none !important; }
*::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; background: transparent !important; }
*::-webkit-scrollbar-thumb { background: transparent !important; }
*::-webkit-scrollbar-track { background: transparent !important; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 5%, var(--bg-grad1) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 90%, var(--bg-grad2) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  overflow-x: hidden;               /* 가로 스크롤 방지 */
  overflow-y: hidden;               /* 상단 바 위로 스크롤 방지 */
  overscroll-behavior: none;        /* iOS 고무줄 스크롤 방지 */
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================
   LOGIN SCREEN
   ============================ */
/* ============================
   NEW SPLIT LOGIN SCREEN
   ============================ */
.ls-wrap {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  transition: opacity 0.35s ease;
}
.ls-wrap.hidden { opacity: 0; pointer-events: none; }

.ls-card {
  display: flex;
  width: 100%;
  max-width: 860px;
  min-height: 520px;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(37,99,235,0.13), 0 2px 8px rgba(0,0,0,0.05);
  animation: lsCardIn 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes lsCardIn {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── 왼쪽 패널 ── */
.ls-left {
  display: none;
  position: relative;
  width: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
  border-right: 1px solid #e2e8f0;
  overflow: hidden;
}
@media (min-width: 640px) { .ls-left { display: block; } }

.ls-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ls-left__overlay {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px 32px;
  text-align: center;
}
.ls-left__icon-wrap {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 8px 24px rgba(59,130,246,0.35);
  margin-bottom: 18px;
  animation: lsIconIn 0.6s 0.3s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes lsIconIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ls-left__title {
  font-size: 2rem; font-weight: 900; letter-spacing: -0.04em;
  background: linear-gradient(135deg, #2563eb, #6366f1);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 10px;
  animation: lsIconIn 0.6s 0.4s cubic-bezier(0.22,1,0.36,1) both;
}
.ls-left__desc {
  font-size: 0.88rem; color: #4b5563; line-height: 1.65;
  margin-bottom: 20px;
  animation: lsIconIn 0.6s 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
.ls-left__chips {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  animation: lsIconIn 0.6s 0.6s cubic-bezier(0.22,1,0.36,1) both;
}
.ls-chip {
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  color: #2563eb; font-size: 0.72rem; font-weight: 600;
  padding: 4px 10px; border-radius: 99px;
}

/* ── 오른쪽 패널 ── */
.ls-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}
.ls-right__inner { width: 100%; max-width: 320px; }

.ls-right__title {
  font-size: 1.75rem; font-weight: 800; color: #111827;
  letter-spacing: -0.03em; margin-bottom: 6px;
  animation: lsRightIn 0.5s 0.15s cubic-bezier(0.22,1,0.36,1) both;
}
.ls-right__sub {
  font-size: 0.9rem; color: #6b7280; margin-bottom: 32px; line-height: 1.5;
  animation: lsRightIn 0.5s 0.22s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes lsRightIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ls-google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px 20px;
  background: #fff; color: #1f2937;
  border: 1.5px solid #e5e7eb; border-radius: 12px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  font-family: inherit;
  animation: lsRightIn 0.5s 0.3s cubic-bezier(0.22,1,0.36,1) both;
}
.ls-google-btn:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 16px rgba(59,130,246,0.15);
}
.ls-google-btn:active { transform: scale(0.98); }
.ls-google-icon { width: 20px; height: 20px; flex-shrink: 0; }

.ls-note {
  font-size: 0.76rem; color: #9ca3af; text-align: center;
  margin-top: 16px;
  animation: lsRightIn 0.5s 0.38s cubic-bezier(0.22,1,0.36,1) both;
}
.ls-legal {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 12px;
  font-size: 0.73rem; color: #d1d5db;
  animation: lsRightIn 0.5s 0.44s cubic-bezier(0.22,1,0.36,1) both;
}
.ls-legal a { color: #9ca3af; text-decoration: none; transition: color 0.15s; }
.ls-legal a:hover { color: #3b82f6; }
.ls-legal span { opacity: 0.5; }

/* ── 마스코트 캐릭터 ── */
.ls-mascot-wrap {
  width: 180px; height: 225px;
  margin-bottom: 24px;
  animation: lsMascotFloat 2.4s cubic-bezier(0.36,0.07,0.19,0.97) infinite;
  filter: drop-shadow(0 18px 32px rgba(59,130,246,0.22));
  will-change: transform;
}
/* 로그인 화면 숨김 시 모든 애니메이션 일시정지 */
.ls-paused .ls-mascot-wrap,
.ls-paused .ls-mesh-body,
.ls-paused .ls-eye {
  animation-play-state: paused !important;
}
@keyframes lsMascotFloat {
  0%   { transform: translateY(0)     scaleX(1)    scaleY(1); }
  10%  { transform: translateY(2px)   scaleX(1.04) scaleY(0.96); } /* 눌림 */
  30%  { transform: translateY(-12px) scaleX(0.96) scaleY(1.05); } /* 떠오름 */
  50%  { transform: translateY(-16px) scaleX(0.97) scaleY(1.03); } /* 정점 */
  70%  { transform: translateY(-5px)  scaleX(0.98) scaleY(1.02); } /* 내려오는 중 */
  85%  { transform: translateY(2px)   scaleX(1.03) scaleY(0.97); } /* 착지 */
  93%  { transform: translateY(-3px)  scaleX(0.99) scaleY(1.01); } /* 작은 튕김 */
  100% { transform: translateY(0)     scaleX(1)    scaleY(1); }
}

.ls-mascot {
  width: 100%; height: 100%;
  overflow: visible;
}

/* 메시 그라디언트 배경 (순수 SVG — iPad foreignObject 버그 회피) */
.ls-mesh-body {
  animation: lsMeshHue 10s linear infinite;
  will-change: filter;
}
@keyframes lsMeshHue {
  0%   { filter: hue-rotate(0deg)  brightness(1); }
  50%  { filter: hue-rotate(40deg) brightness(1.08); }
  100% { filter: hue-rotate(0deg)  brightness(1); }
}

/* 눈 깜빡임 */
.ls-eye {
  transform-origin: center;
  animation: lsBlink 3.5s ease-in-out infinite;
}
.ls-eye:nth-of-type(2) { animation-delay: 0.08s; }
@keyframes lsBlink {
  0%, 42%, 58%, 100% { ry: 22; }
  48%, 52%            { ry: 2; }
}

/* ── 레거시 클래스 호환 (테마 오버라이드용) ── */
.login-screen { display: none !important; }
.login-screen__starrail-logo { display: none; }

