/* =========================================================
   phone.css  —  폰 프레임 / 상태바 / 홈바
   (1단계 + 2단계: 잠금 상태일 때 상태바 모양 변경)
   ========================================================= */

:root {
  --phone-w: 390px;      /* 화면 가로 */
  --phone-h: 844px;      /* 화면 세로 */
  --bezel: 12px;         /* 폰 테두리 두께 */
  --corner: 58px;        /* 화면 모서리 둥글기 */
  --scale: 1;            /* PC에서 화면에 맞게 자동 조절 (JS가 바꿔요) */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #0b0b0e;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
               "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

button {
  font-family: inherit;
}

/* ---------- 무대 (PC에서 폰을 가운데 놓기) ---------- */
#stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- 폰 본체 ---------- */
#phone {
  position: relative;
  flex: none;
  width: calc(var(--phone-w) + var(--bezel) * 2);
  height: calc(var(--phone-h) + var(--bezel) * 2);
  padding: var(--bezel);
  border-radius: calc(var(--corner) + var(--bezel));
  background: linear-gradient(145deg, #3a3a40, #1b1b1f 40%, #2c2c31);
  box-shadow:
    0 0 0 2px #0a0a0c,
    0 30px 80px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.12);
  transform: scale(var(--scale));
  transform-origin: center center;
}

/* 옆면 버튼 */
.side-btn {
  position: absolute;
  width: 4px;
  background: #2a2a2f;
  border-radius: 2px;
}
.btn-silent   { left: -4px;  top: 130px; height: 30px; }
.btn-vol-up   { left: -4px;  top: 190px; height: 58px; }
.btn-vol-down { left: -4px;  top: 262px; height: 58px; }
.btn-power    { right: -4px; top: 220px; height: 96px; cursor: pointer; }
.btn-power:hover { background: #4a4a52; }

/* ---------- 화면 ---------- */
#screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--corner);
  overflow: hidden;
  background: #000;
}

/* 홈 화면 배경 */
#wallpaper {
  position: absolute;
  inset: 0;
  background: linear-gradient(170deg, #5b6bd6 0%, #a45bc4 45%, #f08a5d 100%);
  background-size: cover;
  background-position: center;
  z-index: 0;
}

/* 홈 화면 / 앱이 들어갈 자리 */
#content {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* 임시 안내 (3단계에서 홈 화면으로 바뀌어요) */
.placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}
.ph-title { font-size: 26px; font-weight: 700; }
.ph-desc  { font-size: 15px; line-height: 1.5; opacity: 0.85; }
.ph-btn {
  margin-top: 18px;
  padding: 12px 24px;
  border: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.ph-btn:active { background: rgba(255, 255, 255, 0.4); }

/* ---------- 상태바 ---------- */
#statusbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  z-index: 50;                 /* 항상 맨 위 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 34px 0 38px;
  pointer-events: none;        /* 터치가 아래 화면으로 통과 */
}
.sb-left, .sb-right { display: flex; align-items: center; gap: 6px; }
#statusbar {
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.3);
}
#sb-time { font-size: 18px; font-weight: 800; letter-spacing: -0.2px; }
.sb-carrier { font-size: 14px; font-weight: 800; margin-right: 3px; }
.sb-carrier-lock { display: none; font-size: 17px; font-weight: 800; }
.sb-icon {
  display: block;
  filter: drop-shadow(0 0 0.6px rgba(0, 0, 0, 0.45));
}

/* 잠금화면/암호 입력 중에는: 왼쪽에 통신사, 시간은 숨김 */
#phone[data-state="locked"] #sb-time,
#phone[data-state="passcode"] #sb-time,
#phone[data-state="locked"] #sb-carrier,
#phone[data-state="passcode"] #sb-carrier {
  display: none;
}
#phone[data-state="locked"] .sb-carrier-lock,
#phone[data-state="passcode"] .sb-carrier-lock {
  display: inline;
}

/* 다이나믹 아일랜드 */
.island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 122px;
  height: 36px;
  border-radius: 20px;
  background: #000;
}

/* 배터리 */
.battery {
  position: relative;
  display: block;
  width: 28px;
  height: 14px;
  padding: 1.5px;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  border-radius: 5px;
  margin-left: 1px;
}
.battery::after {
  content: "";
  position: absolute;
  right: -3.5px;
  top: 3.5px;
  width: 2px;
  height: 4px;
  border-radius: 0 2px 2px 0;
  background: rgba(255, 255, 255, 0.75);
}
.battery i {
  display: block;
  height: 100%;
  width: 80%;
  border-radius: 2.5px;
  background: #fff;
}

/* ---------- 홈바 ---------- */
#homebar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30px;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  cursor: pointer;
}
#homebar span {
  display: block;
  width: 138px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.95);
}

/* ---------- 안내 메시지 ---------- */
#toast {
  position: absolute;
  left: 50%;
  bottom: 96px;
  z-index: 70;
  max-width: 86%;
  padding: 10px 16px;
  border-radius: 18px;
  background: rgba(30, 30, 34, 0.9);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 스마트폰으로 볼 때: 프레임 없이 전체 화면 ---------- */
@media (max-width: 500px) {
  #phone {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    border-radius: 0;
    background: #000;
    box-shadow: none;
    transform: none;
  }
  .side-btn { display: none; }
  #screen { border-radius: 0; }
}
