/* 공통 레이아웃: 배경 · 잠금화면 · 상태바 · 홈 화면 · Dock · 앱 화면 공통 */
:root { color-scheme: dark; --white: rgba(255,255,255,.96); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; width: 100%; height: 100%; overflow: hidden; background: #111;
  overscroll-behavior: none; touch-action: none;           /* Safari 기본 스크롤/바운스 막기 */
}
body {
  position: fixed; inset: 0;                                 /* iOS 주소창 바운스로 화면이 밀리는 것 방지 */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--white); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}

/* ---------- 1) 배경사진: 고정된 독립 레이어 (절대 움직이지 않음) ---------- */
.background {
  position: fixed; inset: 0; z-index: 0;
  background-image: url("../background.jpeg");
  background-size: cover; background-position: center; background-repeat: no-repeat;
  pointer-events: none;
}

/* ---------- 2) 잠금화면 UI 컨테이너 (이것만 움직임) ---------- */
.lock-ui {
  position: fixed; inset: 0; z-index: 2;
  padding-top: max(env(safe-area-inset-top), 6px);
  display: flex; flex-direction: column; align-items: center;
  transition: transform .5s cubic-bezier(.22,.8,.2,1), opacity .4s ease;
  will-change: transform, opacity;
}
/* 글씨 가독성용 그림자 — UI 컨테이너 안에 있어서 UI와 함께 사라짐 */
.lock-ui::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 46%; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.28), transparent); }
body.ui-hidden .lock-ui { transform: translateY(-100%); opacity: 0; pointer-events: none; }

/* ---------- 상태바 ---------- */
.status { position: relative; width: 100%; height: 44px; padding: 0 26px; display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 600; letter-spacing: -.1px; }
.status-left { padding-left: 6px; }
.status-right { display: flex; align-items: center; gap: 6px; }
.signal { display: flex; align-items: flex-end; gap: 1.6px; height: 11px; }
.signal i { display: block; width: 3px; border-radius: 1px; background: #fff; }
.signal i:nth-child(1){height:4px}.signal i:nth-child(2){height:6px}.signal i:nth-child(3){height:8.5px}.signal i:nth-child(4){height:11px}
.net { font-size: 14px; font-weight: 600; }
.batt { position: relative; width: 27px; height: 13px; border-radius: 4.3px; background: rgba(255,255,255,.38); overflow: hidden; }
.batt-fill { position: absolute; inset: 0 auto 0 0; width: 93%; background: #fff; }
.batt-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; color: #111; letter-spacing: -.3px; }
.batt-cap { width: 1.6px; height: 4.5px; margin-left: -4px; border-radius: 0 1px 1px 0; background: rgba(255,255,255,.45); }
.grabber { position: absolute; right: 26px; top: 41px; width: 56px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.42); }

/* ---------- 날짜 / 시계 ---------- */
.date { margin-top: 30px; font-size: 20px; font-weight: 600; letter-spacing: .2px; text-shadow: 0 1px 10px rgba(0,0,0,.35); }
.clock {
  margin-top: 2px; font-family: "Noto Serif Display", "New York", "Times New Roman", serif;
  font-weight: 400; font-size: clamp(98px, 30vw, 132px); line-height: 1; letter-spacing: -1px;
  font-variant-numeric: lining-nums tabular-nums;
  color: transparent;
  background: linear-gradient(180deg, rgba(255,255,255,.62) 0%, rgba(255,255,255,.34) 45%, rgba(255,255,255,.28) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke: 1px rgba(255,255,255,.5);
  filter: drop-shadow(0 2px 10px rgba(0,0,0,.28));
}

/* ---------- 위젯 ---------- */
.widgets { width: min(88%, 380px); display: grid; grid-template-columns: 2.05fr 1fr 1fr; align-items: center; gap: 12px; margin-top: 16px; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.pods-line { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.pods-line svg { width: 22px; height: 16px; }
.pct { display: flex; align-items: center; gap: 1px; }
.pct svg { width: 9px; height: 14px; }
.pods-name { margin-top: 3px; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pods-bar { margin-top: 9px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.3); overflow: hidden; }
.pods-bar span { display: block; width: 80%; height: 100%; border-radius: 4px; background: #fff; }
.ring { width: 100%; max-width: 62px; justify-self: center; aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 1px 6px rgba(0,0,0,.25)); }

/* ---------- 하단 아이콘 / 홈 바 ---------- */
.bottom { margin-top: auto; width: 100%; display: flex; justify-content: space-between; padding: 0 46px calc(max(env(safe-area-inset-bottom), 8px) + 34px); }
.quick { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.17); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.35), inset 0 -1px 2px rgba(0,0,0,.15), 0 2px 10px rgba(0,0,0,.2); }
.quick svg { width: 22px; height: 22px; fill: #fff; }
.home-indicator { position: absolute; left: 50%; bottom: max(env(safe-area-inset-bottom), 8px); transform: translateX(-50%); width: 140px; height: 5px; border-radius: 3px; background: #fff; }

/* ---------- 3) 홈 화면 컨테이너 (배경 없음 — 공통 배경사진이 그대로 비침) ---------- */
.home {
  position: fixed; inset: 0; z-index: 1;
  padding-top: max(env(safe-area-inset-top), 6px);
  display: flex; flex-direction: column;
  opacity: 0; transform: scale(1.06); pointer-events: none;
  transition: transform .5s cubic-bezier(.22,.8,.2,1), opacity .4s ease;
  will-change: transform, opacity;
}
body.ui-hidden .home { opacity: 1; transform: none; pointer-events: auto; }
.home .status-left { padding-left: 14px; font-variant-numeric: tabular-nums; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.apps { width: 100%; max-width: 430px; margin: 22px auto 0; padding: 0 24px; display: grid; grid-template-columns: repeat(4, 1fr); row-gap: 22px; column-gap: 8px; }
.app { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: #fff; -webkit-touch-callout: none; }
.app:active .icon { transform: scale(.92); filter: brightness(.85); }
.icon {
  position: relative; width: clamp(56px, 16vw, 64px); aspect-ratio: 1; border-radius: 23%;
  display: grid; place-items: center; overflow: hidden;
  background: rgba(255,255,255,.16);                       /* 반투명 유리 스타일 */
  backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.45), inset 0 -1px 1px rgba(0,0,0,.18), 0 4px 14px rgba(0,0,0,.35);
  transition: transform .15s ease, filter .15s ease;
}
.icon::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255,255,255,.22), transparent 45%); }
.icon svg { width: 52%; height: 52%; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
.label { font-size: 12px; font-weight: 500; letter-spacing: -.2px; white-space: nowrap; text-shadow: 0 1px 3px rgba(0,0,0,.8), 0 0 8px rgba(0,0,0,.4); }
.cal-icon { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.cal-icon b { font-size: 10px; font-weight: 600; color: #ff6b62; letter-spacing: .2px; }
.cal-icon strong { margin-top: 2px; font-size: clamp(28px, 8vw, 33px); font-weight: 300; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.3); }
.search { margin: auto auto 14px; padding: 7px 16px; border-radius: 18px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.18); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); text-shadow: 0 1px 3px rgba(0,0,0,.3); }
.search svg { width: 13px; height: 13px; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.dock { margin: 0 10px calc(max(env(safe-area-inset-bottom), 8px) + 6px); padding: 15px 14px; border-radius: 34px;
  display: grid; grid-template-columns: repeat(4, 1fr); justify-items: center;
  background: rgba(255,255,255,.16); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.3); }
.icon.has-img > svg, .icon.has-img > b, .icon.has-img > strong { visibility: hidden; }   /* 이미지가 있으면 기본 기호는 숨김 (투명 이미지 대비) */
.icon-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; z-index: 1; pointer-events: none; }
.dock { padding: 12px 14px 8px; }
.dock .label { display: none; }   /* Dock 안에는 앱 이름을 표시하지 않음 */

/* ---------- 5) 앱 화면 공통 (홈 위에 열리는 각 앱 내부 화면) ---------- */
.app-screen { position: fixed; inset: 0; z-index: 4; display: none; flex-direction: column; overflow: hidden; color: #000; background: #fff;
  padding-top: max(env(safe-area-inset-top), 6px); font-size: 15px; }
.app-screen.active { display: flex; animation: appIn .32s cubic-bezier(.22,.8,.2,1); }
@keyframes appIn { from { opacity: 0; transform: scale(.93); } to { opacity: 1; transform: none; } }
body.app-open .home { visibility: hidden; }
.app-screen > .status { flex: none; position: relative; z-index: 2; }
.light .signal i, .light .batt-fill { background: #000; }
.light .batt { background: rgba(0,0,0,.28); }
.light .batt-num { color: #fff; }
.light .batt-cap { background: rgba(0,0,0,.4); }
.app-screen .status-left { padding-left: 14px; font-variant-numeric: tabular-nums; }
.app-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
.app-top { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px; flex: none; position: relative; z-index: 2; }
.app-back { appearance: none; border: 0; background: none; font: inherit; font-size: 17px; color: inherit; display: flex; align-items: center; gap: 3px; padding: 6px 4px; cursor: pointer; }
.app-back svg { width: 11px; height: 19px; stroke: currentColor; stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.app-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; margin-right: 48px; }
.spacer { flex: 1; }
.app-homebar { flex: none; height: calc(max(env(safe-area-inset-bottom), 8px) + 16px); display: grid; place-items: center; touch-action: none; cursor: pointer; position: relative; z-index: 2; }
.app-homebar i { width: 134px; height: 5px; border-radius: 3px; background: currentColor; opacity: .9; }
.sim-tag { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 7px; background: rgba(127,127,127,.18); }
.fine { font-size: 11.5px; line-height: 1.45; opacity: .6; margin: 14px 16px; }
.icon-btn { appearance: none; border: 0; background: none; color: inherit; padding: 6px; cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Wi-Fi 상태 표시 (설정에서 Wi-Fi 연결 시 5G 대신 표시) */
.st-wifi { display: none; width: 17px; height: 12px; fill: currentColor; }
body.wifi-on .st-wifi { display: block; }
body.wifi-on .net { display: none; }
/* 화면 전체 효과: 밝기 · True Tone */
.fx-layer { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s; }
#dimmer { z-index: 90; background: #000; }
#warmth { z-index: 89; background: rgba(255, 170, 70, .10); mix-blend-mode: multiply; }
/* 알림 배너 */
.banner { position: fixed; left: 8px; right: 8px; top: calc(max(env(safe-area-inset-top), 6px) + 6px); z-index: 80; padding: 10px 14px 12px; border-radius: 20px;
  background: rgba(245,245,247,.9); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); color: #000; box-shadow: 0 8px 30px rgba(0,0,0,.25);
  transform: translateY(-140%); transition: transform .4s cubic-bezier(.22,.8,.2,1); cursor: pointer; display: flex; flex-direction: column; gap: 1px; font-size: 14.5px; max-width: 420px; margin: 0 auto; }
.banner.show { transform: none; }
.banner-top { display: flex; justify-content: space-between; font-size: 12px; color: #6d6d72; margin-bottom: 2px; }
.banner-top b { font-weight: 600; text-transform: uppercase; }
#bannerTitle { font-size: 15px; } #bannerText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-height: 700px) {
  .date { margin-top: 16px; }
  .clock { font-size: clamp(84px, 25vw, 110px); }
  .apps { margin-top: 14px; row-gap: 18px; }
}
/* 잠금화면 알림 목록 */
.lk-notifs { width: min(92%, 400px); margin-top: 18px; display: flex; flex-direction: column; gap: 7px; }
.lk-notifs:empty { display: none; }
.lk-head { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.lk-head b { font-size: 15px; font-weight: 600; }
.lk-clear { appearance: none; border: 0; border-radius: 12px; padding: 4px 10px; background: rgba(255,255,255,.22); color: #fff; font: inherit; font-size: 12px; cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.lk-card { appearance: none; border: 0; width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 20px; text-align: left; font: inherit; color: #111;
  background: rgba(245,245,245,.72); backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6); box-shadow: 0 2px 10px rgba(0,0,0,.15); cursor: pointer; }
.lk-card.fresh { animation: lkIn .45s cubic-bezier(.22,.8,.2,1); }
@keyframes lkIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
.lk-ic { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 700; }
.lk-ic.kk { color: #3a1d1d; font-size: 9.5px; font-weight: 900; letter-spacing: -.2px; }
.lk-tx { flex: 1; min-width: 0; }
.lk-top { display: flex; justify-content: space-between; gap: 8px; }
.lk-top b { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-top small { flex: none; font-size: 12px; color: #6d6d72; }
.lk-msg { display: block; font-size: 14px; color: #222; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-more { text-align: center; font-size: 12.5px; color: rgba(255,255,255,.85); text-shadow: 0 1px 6px rgba(0,0,0,.4); }
@media (max-height: 760px) { .lk-notifs .lk-card:nth-of-type(n+4) { display: none; } }
/* 음악 재생 중: 상단 상태바 시계 옆에 움직이는 재생 표시 */
body.music-on .status-left::after { content: ""; display: inline-block; vertical-align: -1px; width: 13px; height: 11px; margin-left: 6px;
  background: linear-gradient(#ff375f, #ff375f) 0 100% / 3px 40% no-repeat, linear-gradient(#ff375f, #ff375f) 5px 100% / 3px 100% no-repeat, linear-gradient(#ff375f, #ff375f) 10px 100% / 3px 60% no-repeat;
  animation: npEq .8s ease-in-out infinite alternate; }
@keyframes npEq {
  0% { background-size: 3px 40%, 3px 100%, 3px 60%; }
  50% { background-size: 3px 90%, 3px 45%, 3px 100%; }
  100% { background-size: 3px 60%, 3px 75%, 3px 35%; } }
/* 잠금화면 음악 재생 카드 */
.lk-music { display: none; width: min(92%, 400px); margin-top: 16px; padding: 14px 16px 10px; border-radius: 24px; color: #fff;
  background: rgba(60,60,60,.42); backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5); }
.lk-music.show { display: block; animation: lkIn .4s cubic-bezier(.22,.8,.2,1); }
.lkm-top { display: flex; align-items: center; gap: 12px; }
.lkm-cover { width: 48px; height: 48px; border-radius: 9px; flex: none; background-size: cover !important; }
.lkm-top div { flex: 1; min-width: 0; } .lkm-top b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .lkm-top small { font-size: 13.5px; opacity: .7; }
.lkm-eq { display: flex; gap: 2px; align-items: flex-end; height: 14px; }
.lkm-eq i { width: 3px; height: 30%; background: #ff375f; border-radius: 1px; }
.lk-music.playing .lkm-eq i { animation: lkmEq .7s ease-in-out infinite alternate; } .lk-music.playing .lkm-eq i:nth-child(2) { animation-delay: .2s; } .lk-music.playing .lkm-eq i:nth-child(3) { animation-delay: .4s; }
@keyframes lkmEq { from { height: 25%; } to { height: 100%; } }
.lkm-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.28); margin-top: 14px; overflow: hidden; } .lkm-bar i { display: block; height: 100%; width: 0; background: #fff; border-radius: 3px; transition: width .45s linear; }
.lkm-times { display: flex; justify-content: space-between; font-size: 11.5px; opacity: .7; margin-top: 4px; font-variant-numeric: tabular-nums; }
.lkm-ctrl { display: flex; justify-content: center; align-items: center; gap: 42px; margin-top: 2px; }
.lkm-ctrl button { appearance: none; border: 0; background: none; color: #fff; padding: 4px; cursor: pointer; display: grid; }
.lkm-ctrl svg { width: 28px; height: 28px; fill: currentColor; } #lkmPlay svg { width: 34px; height: 34px; }
