/* =========================================================
   VANITA ROLEPLAY — Phone
   (tokens, base, buttons, inputs, toasts, overlay: see ../shared/vanita.css)
========================================================= */
html, body { height: 100%; overflow: hidden; }

/* ---------------------------------------------------------
   Phone device frame
--------------------------------------------------------- */

.phone-device {
  position: relative;
  z-index: 1;
  width: 380px;
  max-width: 94vw;
  height: min(790px, calc(100vh - 126px));
  border-radius: 46px;
  background: #0c0e14;
  border: 1px solid rgba(232,237,245,0.12);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), inset 0 0 0 7px #05060a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.status-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 26px 6px;
  color: var(--text-1);
}

.status-time { font-size: 13px; font-weight: 500; }

.status-icons { display: flex; gap: 7px; font-size: 12px; color: var(--text-2); }

.screen-stack {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-3) 100%);
}

.phone-screen {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.phone-screen.is-active { display: flex; opacity: 1; }

/* ---------------------------------------------------------
   Home screen
--------------------------------------------------------- */

.home-clock { text-align: center; padding: 22px 0 14px; flex: 0 0 auto; }

.home-clock-time { font-size: 42px; font-weight: 500; color: var(--text-1); letter-spacing: 0.02em; }

.home-clock-date { font-size: 11px; letter-spacing: 0.14em; color: var(--text-4); margin-top: 4px; text-transform: uppercase; }

.app-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 8px;
  padding: 6px 20px;
  align-content: start;
}

.app-icon {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: none; border: none; color: var(--text-2);
  text-decoration: none;
  font-family: 'Kanit', sans-serif;
  cursor: pointer;
}

.app-icon-glyph {
  position: relative;
  width: 52px; height: 52px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
}

.app-icon-glyph--blue   { background: linear-gradient(160deg, #5aa7ff, #2f6fd6); }

.app-icon-glyph--green  { background: linear-gradient(160deg, #4fe0a0, #1f9e68); }

.app-icon-glyph--amber  { background: linear-gradient(160deg, #ffd166, #e0a52f); }

.app-icon-glyph--purple { background: linear-gradient(160deg, #c3a6ff, #8b63e0); }

.app-icon-glyph--pink   { background: linear-gradient(160deg, #ff8fb3, #e0487a); }

.app-icon-glyph--gray   { background: linear-gradient(160deg, #8a93a3, #555e6d); }

.app-icon-label { font-size: 10.5px; color: var(--text-3); text-align: center; white-space: nowrap; }

.app-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 999px;
  background: var(--health);
  color: #fff;
  font-size: 9.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Roboto Mono', monospace;
  border: 2px solid var(--bg-1);
}

/* ---------------------------------------------------------
   App header (used by sub-screens)
--------------------------------------------------------- */

.app-header {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--panel-border);
}

.app-header h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text-1); }

.app-back {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--panel-border);
  background: rgba(232,237,245,0.05);
  color: var(--text-3);
  cursor: pointer; font-size: 12px;
}

.app-back:hover { color: var(--text-1); }

/* ---------------------------------------------------------
   Messages: conversation list + thread
--------------------------------------------------------- */

.conv-list { flex: 1 1 auto; overflow-y: auto; }

.conv-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 1px solid rgba(232,237,245,0.05);
}

.conv-row:hover { background: rgba(232,237,245,0.04); }

.conv-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(160deg, #3a4254, #1c212c);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 15px; font-weight: 600;
  flex: 0 0 auto;
}

.conv-info { flex: 1 1 auto; min-width: 0; }

.conv-name-row { display: flex; justify-content: space-between; align-items: baseline; }

.conv-name { font-size: 13.5px; font-weight: 500; color: var(--text-1); }

.conv-time { font-size: 10px; color: var(--text-4); }

.conv-preview {
  font-size: 12px; color: var(--text-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.conv-row.is-unread .conv-preview { color: var(--text-2); }

.conv-unread-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--health);
  flex: 0 0 auto; margin-left: 8px; align-self: center;
}

.thread-messages {
  flex: 1 1 auto; overflow-y: auto;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}

.msg-bubble {
  max-width: 75%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.5;
}

.msg-bubble.in { align-self: flex-start; background: rgba(232,237,245,0.08); color: var(--text-2); border-bottom-left-radius: 4px; }

.msg-bubble.out { align-self: flex-end; background: linear-gradient(160deg, #ff4a63, #e0243e); color: #fff; border-bottom-right-radius: 4px; }

.thread-input-row {
  flex: 0 0 auto;
  display: flex; gap: 8px;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--panel-border);
}

.thread-input {
  flex: 1 1 auto;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(232,237,245,0.06);
  color: var(--text-1);
  font-family: 'Kanit', sans-serif;
  font-size: 12.5px;
  outline: none;
}

.thread-input:focus { border-color: rgba(255,49,85,0.4); }

.thread-send {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--health); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; flex: 0 0 auto;
}

/* ---------------------------------------------------------
   Calls: list + calling + in-call
--------------------------------------------------------- */

.call-list { flex: 1 1 auto; overflow-y: auto; }

.call-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 1px solid rgba(232,237,245,0.05);
}

.call-row:hover { background: rgba(232,237,245,0.04); }

.call-row .conv-avatar { }

.call-type-icon { font-size: 10px; margin-right: 4px; display: inline-flex; }

.call-type-icon.in { color: var(--fuel); transform: rotate(-135deg); }

.call-type-icon.out { color: var(--fuel); transform: rotate(45deg); }

.call-type-icon.missed { color: var(--health); transform: rotate(-135deg); }

.call-meta { font-size: 11px; color: var(--text-4); margin-top: 2px; display: flex; align-items: center; }

.call-row-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(53,211,153,0.16); border: 1px solid rgba(53,211,153,0.35);
  color: var(--fuel); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}

.call-row-btn:hover { background: rgba(53,211,153,0.28); }

.call-stage {
  flex: 1 1 auto;
  display: flex; flex-direction: column; align-items: center;
  padding: 50px 20px 30px;
}

.call-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(160deg, #3a4254, #1c212c);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 600; color: var(--text-2);
  margin-bottom: 16px;
}

.call-name { font-size: 19px; font-weight: 600; color: var(--text-1); }

.call-sub { font-size: 13px; color: var(--text-3); margin-top: 6px; margin-bottom: 30px; }

.call-ring {
  --pct: 0;
  width: 96px; height: 96px; border-radius: 50%;
  background: conic-gradient(var(--fuel) calc(var(--pct) * 3.6deg), var(--track) 0deg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 40px;
  transition: --pct 0.2s linear;
  filter: drop-shadow(0 0 14px rgba(53,211,153,0.4));
}

.call-ring-inner {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--fuel);
}

.incall-actions { display: flex; gap: 12px; margin-bottom: 40px; }

.incall-pill {
  padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(232,237,245,0.06);
  color: var(--text-2); font-family: 'Kanit', sans-serif;
  font-size: 12px; cursor: pointer;
}

.incall-pill.is-active { background: rgba(255,255,255,0.18); color: #fff; }

.call-end-btn {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--health); border: none; color: #fff;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  margin-top: auto;
  box-shadow: 0 8px 20px rgba(255,49,85,0.4);
}

/* ---------------------------------------------------------
   Calls: tabs + keypad + contacts
--------------------------------------------------------- */

.call-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  padding: 12px 16px 0;
}

.call-tab {
  flex: 1 1 0;
  padding: 8px 0;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(232,237,245,0.05);
  color: var(--text-3);
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  cursor: pointer;
}

.call-tab.is-active { background: rgba(255,49,85,0.16); border-color: rgba(255,49,85,0.4); color: var(--text-1); }

.call-tab-panel { display: none; flex: 1 1 auto; min-height: 0; flex-direction: column; }

.call-tab-panel.is-active { display: flex; }

.keypad-display {
  flex: 0 0 auto;
  text-align: center;
  font-size: 26px;
  letter-spacing: 0.06em;
  color: var(--text-1);
  padding: 22px 16px 14px;
  min-height: 1.3em;
  word-break: break-all;
}

.keypad-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 28px;
  align-content: start;
}

.keypad-btn {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: rgba(232,237,245,0.06);
  color: var(--text-1);
  font-size: 19px;
  font-family: 'Roboto Mono', monospace;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.keypad-btn:hover { background: rgba(232,237,245,0.12); }

.keypad-btn .keypad-sub { font-size: 7.5px; letter-spacing: 0.1em; color: var(--text-4); margin-top: 1px; font-family: 'Kanit', sans-serif; }

.keypad-actions {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  gap: 24px;
  padding: 16px 0 calc(16px + env(safe-area-inset-bottom, 0px));
}

.keypad-spacer { width: 44px; }

.keypad-call-btn {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--fuel); border: none; color: #04140c;
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(53,211,153,0.4);
}

.keypad-back-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: transparent; border: none; color: var(--text-3);
  font-size: 17px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.keypad-back-btn:hover { color: var(--text-1); }

/* ---------------------------------------------------------
   Camera
--------------------------------------------------------- */

.camera-viewfinder {
  position: relative;
  flex: 1 1 auto;
  margin: 14px 16px;
  border-radius: 16px;
  background: #06070a;
  border: 1px solid var(--panel-border);
  display: flex; align-items: center; justify-content: center;
}

.camera-hint { font-size: 12px; color: var(--text-4); }

.camera-frame-corner { position: absolute; width: 22px; height: 22px; border-color: rgba(232,237,245,0.4); border-style: solid; }

.camera-frame-corner.tl { top: 12px; left: 12px; border-width: 2px 0 0 2px; border-top-left-radius: 6px; }

.camera-frame-corner.tr { top: 12px; right: 12px; border-width: 2px 2px 0 0; border-top-right-radius: 6px; }

.camera-frame-corner.bl { bottom: 12px; left: 12px; border-width: 0 0 2px 2px; border-bottom-left-radius: 6px; }

.camera-frame-corner.br { bottom: 12px; right: 12px; border-width: 0 2px 2px 0; border-bottom-right-radius: 6px; }

.camera-controls { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; padding: 20px 0 calc(20px + env(safe-area-inset-bottom, 0px)); }

.camera-shutter {
  width: 64px; height: 64px; border-radius: 50%;
  background: #fff; border: 4px solid rgba(232,237,245,0.3);
  cursor: pointer;
}

.camera-shutter:active { background: #ddd; }

/* ---------------------------------------------------------
   Settings
--------------------------------------------------------- */

.settings-list { padding: 10px 16px; display: flex; flex-direction: column; gap: 2px; }

.settings-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid rgba(232,237,245,0.05);
}

.settings-row-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff; flex: 0 0 auto;
}

.settings-row-icon--gray   { background: #6b7280; }

.settings-row-icon--purple { background: #8b63e0; }

.settings-row-icon--blue   { background: #2f6fd6; }

.settings-row-label { flex: 1 1 auto; font-size: 13px; color: var(--text-2); }

.settings-toggle {
  width: 42px; height: 24px; border-radius: 999px;
  background: rgba(232,237,245,0.12);
  border: none; cursor: pointer;
  position: relative;
  flex: 0 0 auto;
}

.settings-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.settings-toggle.is-on { background: var(--fuel); }

.settings-toggle.is-on::after { transform: translateX(18px); }

/* ---------------------------------------------------------
   Bank
--------------------------------------------------------- */

.bank-balance-card {
  margin: 16px 18px 6px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(145deg, #171c28, #0c0f17);
  border: 1px solid var(--panel-border);
}

.bank-balance-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-3); padding: 5px 0; }

.bank-balance-row--main { font-size: 19px; font-weight: 600; color: var(--text-1); padding-top: 8px; }

.bank-balance-row--main span:first-child { font-size: 11px; color: var(--text-4); align-self: flex-end; }

.bank-form { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

.bank-error { margin: -6px 0 0; font-size: 11px; color: var(--health); }

.bank-transfer-btn {
  flex: 0 0 auto;
  width: 100%;
  margin-top: 6px;
  padding: 13px;
  border-radius: var(--radius);
  font-size: 14px;
}

/* ---------------------------------------------------------
   Home indicator
--------------------------------------------------------- */

.home-indicator {
  flex: 0 0 auto;
  width: 100%;
  padding: 10px 0 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.home-indicator::after {
  content: "";
  width: 120px; height: 4px; border-radius: 3px;
  background: rgba(232,237,245,0.35);
}

.transfer-ring {
  --pct: 0;
  width: 84px; height: 84px; border-radius: 50%;
  background: conic-gradient(var(--vehicle) calc(var(--pct) * 3.6deg), var(--track) 0deg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  transition: --pct 0.2s linear;
  filter: drop-shadow(0 0 14px rgba(246,201,69,0.4));
}

.transfer-ring-inner {
  width: 70px; height: 70px; border-radius: 50%;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--vehicle);
}

.transfer-label { font-size: 13px; color: var(--text-2); }

/* ---------------------------------------------------------
   Responsive
--------------------------------------------------------- */

@media (max-width: 420px) {
  .phone-device { width: 94vw; border-radius: 32px; }
}

/* ---------------------------------------------------------
   Generic list apps
--------------------------------------------------------- */

.list-app-body { flex: 1 1 auto; overflow-y: auto; padding: 10px 0 18px; }

.list-section { display: flex; flex-direction: column; }

.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid rgba(232,237,245,0.05);
  cursor: pointer;
}

.list-row:hover { background: rgba(232,237,245,0.04); }

.list-thumb {
  width: 42px; height: 42px; border-radius: 11px;
  background: rgba(232,237,245,0.07);
  color: var(--text-2); font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}

.list-info { flex: 1 1 auto; min-width: 0; }

.list-title { font-size: 13px; font-weight: 500; color: var(--text-1); }

.list-sub { font-size: 11px; color: var(--text-4); margin-top: 2px; }

.list-meta { font-size: 11.5px; color: var(--vehicle); flex: 0 0 auto; }

.list-cta {
  display: block; width: calc(100% - 36px); margin: 4px 18px 10px;
  padding: 11px; border-radius: 10px; border: none;
  background: linear-gradient(160deg, #5a6cff, #3b45e0);
  color: #fff; font-family: 'Kanit', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer;
}

.social-post { padding: 14px 18px; border-bottom: 1px solid rgba(232,237,245,0.06); }

.social-head { display: flex; align-items: center; gap: 10px; }

.social-head .conv-avatar { width: 36px; height: 36px; font-size: 13px; }

.social-text { margin: 10px 0 8px; font-size: 12.5px; line-height: 1.6; color: var(--text-2); }

.social-actions { display: flex; gap: 18px; font-size: 11px; color: var(--text-4); }

.social-actions button, .social-count { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--text-4); cursor: pointer; font-size: 11px; padding: 0; }

.social-like.is-liked { color: var(--health); }

.map-mock {
  position: relative; height: 210px; margin: 0 16px 10px;
  border-radius: 14px; overflow: hidden;
  background: #0b1018; border: 1px solid var(--panel-border);
  background-image:
    linear-gradient(rgba(232,237,245,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,237,245,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
}

.map-road { position: absolute; background: rgba(232,237,245,0.1); }

.map-road.r1 { left: 0; right: 0; top: 70px; height: 7px; transform: rotate(-4deg); }

.map-road.r2 { left: 0; right: 0; top: 150px; height: 5px; transform: rotate(3deg); }

.map-road.r3 { top: 0; bottom: 0; left: 110px; width: 6px; transform: rotate(8deg); }

.map-road.r4 { top: 0; bottom: 0; left: 230px; width: 5px; transform: rotate(-6deg); }

.map-pin { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); font-size: 26px; color: var(--health); filter: drop-shadow(0 0 8px rgba(255,49,85,0.6)); }

.map-you { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); font-size: 10px; color: var(--text-3); background: rgba(5,8,14,0.7); padding: 2px 8px; border-radius: 999px; }

.call-tab-panel .call-list { padding-top: 8px; }

.transfer-overlay { flex-direction: column; }

/* page wrapper: shared header on top, phone below */
.phone-page {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding-top: 2.5vh;
}
.phone-header { width: 380px; max-width: 94vw; }
