/* City Drive: the in-world phone (phone.js). Everything is scoped under .ph so it can't touch the game's HUD. */
.ph { --acc: #f2c25a; --acc2: #e0a43a; --accink: #2a1a06; --sky-a: #2b1c3a; --sky-b: #160f22; --sky-w: #f2c25a;
  --scr: #0c0f17; --card: rgba(255, 255, 255, .055); --cardline: rgba(255, 255, 255, .08); --tx: #ece8de; --sub: #9b978f;
  --good: #7ee67e; --bad: #ff8a7a; --cop: #8fb6ff; --spring: cubic-bezier(.22, 1.28, .36, 1);
  position: fixed; inset: 0; z-index: 40; pointer-events: none; font: 20px/1.2 'Jersey 10', monospace; color: var(--tx); }
.ph[data-role="police"] { --acc: #8fb6ff; --acc2: #4a7ae8; --accink: #0a1630; --sky-a: #14243f; --sky-b: #0b1426; --sky-w: #8fb6ff; }
.ph * { box-sizing: border-box; }
.ph [hidden] { display: none !important; }
.ph button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.ph button:disabled { cursor: default; opacity: .45; }
.ph button:focus-visible, .ph input:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.ph svg { width: 1em; height: 1em; flex: none; }

/* The HUD button */
.ph-btn { position: absolute; left: calc(env(safe-area-inset-left) + 10px); bottom: calc(env(safe-area-inset-bottom) + var(--ph-btn-bottom, 60px));
  width: 52px; height: 52px; border-radius: 15px; pointer-events: auto; display: grid; place-items: center; font-size: 30px;
  background: linear-gradient(160deg, rgba(40, 45, 60, .95), rgba(14, 16, 24, .95)); border: 1px solid rgba(255, 255, 255, .16) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .12); color: var(--acc) !important;
  transition: transform .35s var(--spring), opacity .2s; }
.ph-btn:hover { transform: translateY(-2px); }
.ph-btn:active { transform: scale(.92); }
.ph-btn kbd { position: absolute; right: -6px; bottom: -6px; font: 400 13px/1 'Jersey 10', monospace; padding: 2px 4px 1px; border-radius: 4px; background: #0c0f17; color: var(--sub); border: 1px solid rgba(255, 255, 255, .14); }
@media (pointer: coarse) { .ph-btn kbd { display: none; } }
.ph-btn > .ph-badge { position: absolute; top: -7px; right: -7px; }
.ph.ph-open .ph-btn { transform: translateY(20px) scale(.6); opacity: 0; pointer-events: none; }
.ph-btn.ph-ring { animation: ph-ring .7s ease-in-out; }
@keyframes ph-ring { 15%, 45%, 75% { transform: rotate(-12deg); } 30%, 60% { transform: rotate(12deg); } 90% { transform: none; } }

.ph-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; background: #ff4b3e; color: #fff;
  font: 400 17px/1 'Jersey 10', monospace; box-shadow: 0 0 0 2px #0c0f17, 0 2px 6px rgba(0, 0, 0, .4); animation: ph-pop .4s var(--spring); }
@keyframes ph-pop { from { transform: scale(0); } }

/* Notification next to the closed phone */
.ph-peek { position: absolute; left: calc(env(safe-area-inset-left) + 18px); bottom: calc(env(safe-area-inset-bottom) + 92px);
  max-width: min(280px, calc(100vw - 96px)); padding: 8px 12px 9px; border-radius: 14px; pointer-events: auto; cursor: pointer;
  background: rgba(14, 17, 26, .94); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 10px 26px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .25s, transform .35s var(--spring); }
.ph-peek.on { opacity: 1; transform: none; }
.ph-peek b { display: block; font-weight: 400; font-size: 19px; color: var(--acc); }
.ph-peek span { display: block; font-size: 17px; color: #d8d3c8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-peek::before { content: ''; position: absolute; left: 40px; bottom: -6px; width: 10px; height: 10px; background: inherit; border-left: inherit; border-bottom: inherit; transform: rotate(45deg); }

/* The device */
.ph-dev { --ph-peek: 64px; position: absolute; left: calc(env(safe-area-inset-left) + 18px); bottom: calc(env(safe-area-inset-bottom) + 18px);
  width: 304px; height: min(588px, calc(100vh - 36px)); padding: 9px; border-radius: 46px; pointer-events: auto;
  background: linear-gradient(145deg, #3a3e4a, #15171e 45%, #262a33); touch-action: none;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .65), 0 0 0 1px rgba(0, 0, 0, .9), inset 0 0 0 1.5px rgba(255, 255, 255, .14), inset 0 0 0 4px #0a0b0f;
  /* Closed, only its top --ph-peek pixels show above the bottom edge: drag it up to open. */
  transform: translateY(calc(100% + env(safe-area-inset-bottom) + 18px - var(--ph-peek))); cursor: grab;
  transition: transform .45s cubic-bezier(.3, 1.12, .4, 1), box-shadow .3s; }
.ph.ph-open .ph-dev { transform: none; cursor: auto; transition: transform .5s var(--spring), box-shadow .3s; }
.ph:not(.ph-open) .ph-dev { box-shadow: 0 -6px 24px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .9), inset 0 0 0 1.5px rgba(255, 255, 255, .14), inset 0 0 0 4px #0a0b0f; }
.ph:not(.ph-open) .ph-dev:hover { translate: 0 -6px; }
.ph:not(.ph-open) .ph-screen * { pointer-events: none !important; }
.ph-dev { translate: 0 0; transition-property: transform, translate, box-shadow; }
.ph-dev.ph-nudge { animation: ph-nudge .8s var(--spring); }
@keyframes ph-nudge { 0%, 100% { translate: 0 0; } 25% { translate: 0 -22px; } 50% { translate: 0 -6px; } 70% { translate: 0 -14px; } }
.ph-grab { position: absolute; left: 50%; top: -15px; width: 46px; height: 5px; margin-left: -23px; border-radius: 3px; background: rgba(255, 255, 255, .55);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .6); transition: opacity .25s; animation: ph-grab 2.4s ease-in-out infinite; }
.ph.ph-open .ph-grab { opacity: 0; }
@keyframes ph-grab { 50% { transform: translateY(-3px); } }
.ph-total { margin-left: 6px; min-width: 20px; height: 20px; font-size: 15px; }
.ph.ph-open .ph-total { display: none; }
/* The old HUD button is gone: the phone itself peeks up. */
.ph-btn { display: none !important; }
.ph-dev.ph-drag { transition: none !important; }
.ph-key { position: absolute; width: 3px; border-radius: 2px; background: linear-gradient(90deg, #4a4e5a, #20232b); }
.ph-key-a { left: -3px; top: 110px; height: 30px; }
.ph-key-b { left: -3px; top: 150px; height: 46px; }
.ph-key-c { right: -3px; top: 140px; height: 64px; }

.ph-screen { position: relative; height: 100%; border-radius: 38px; overflow: hidden; background: var(--scr); isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }

/* Status bar + island (toasts grow out of it) */
.ph-status { position: absolute; z-index: 6; left: 0; right: 0; top: 0; height: 40px; display: flex; align-items: center; justify-content: space-between;
  padding: 4px 18px 0 24px; font-size: 19px; touch-action: none; pointer-events: auto; }
.ph-time { letter-spacing: .5px; }
.ph-right { display: flex; align-items: center; gap: 6px; }
@media (min-width: 561px) { .ph-batt { display: none; } }
.ph-cash { font-weight: 400; color: var(--good); font-size: 18px; }
.ph-sig { display: flex; align-items: flex-end; gap: 1.5px; height: 11px; }
.ph-sig i { width: 3px; border-radius: 1px; background: var(--tx); }
.ph-sig i:nth-child(1) { height: 4px; } .ph-sig i:nth-child(2) { height: 6px; } .ph-sig i:nth-child(3) { height: 8.5px; } .ph-sig i:nth-child(4) { height: 11px; opacity: .35; }
.ph-batt { position: relative; width: 22px; height: 11px; border-radius: 3px; border: 1.5px solid rgba(236, 232, 222, .6); }
.ph-batt::after { content: ''; position: absolute; right: -4px; top: 2.5px; width: 2px; height: 4px; border-radius: 0 1px 1px 0; background: rgba(236, 232, 222, .6); }
.ph-batt i { position: absolute; inset: 1.5px 5px 1.5px 1.5px; border-radius: 1px; background: var(--tx); }

.ph-island { position: absolute; z-index: 7; left: 50%; top: 9px; width: 76px; height: 25px; transform: translateX(-50%); border-radius: 14px; background: #000;
  overflow: hidden; cursor: pointer; transition: width .5s var(--spring), height .5s var(--spring), border-radius .5s, top .4s, box-shadow .3s; }
.ph-island.on { width: calc(100% - 16px); height: 62px; top: 7px; border-radius: 24px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.ph-toast { display: flex; align-items: center; gap: 10px; height: 62px; padding: 0 14px 0 10px; opacity: 0; transform: scale(.9); transition: opacity .2s, transform .3s; }
.ph-island.on .ph-toast { opacity: 1; transform: none; transition-delay: .15s; }
.ph-toast b { display: block; font-weight: 400; font-size: 19px; line-height: 1.05; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-toast small { display: block; font-size: 16px; color: #b9b5ac; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Home screen */
.ph-home { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 46px 14px 30px;
  background: radial-gradient(120% 70% at 80% 0%, color-mix(in srgb, var(--acc) 22%, transparent), transparent 60%), linear-gradient(180deg, var(--sky-a), var(--scr) 75%);
  transition: transform .35s ease, filter .35s, opacity .35s; }
.ph-home.ph-behind { transform: scale(.92); filter: blur(2px) brightness(.6); }
.ph-wall { position: absolute; inset: 0; z-index: 0; pointer-events: auto; touch-action: none; }
.ph-sky { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 46%; opacity: .9; }
.ph-wall::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; background: linear-gradient(180deg, transparent, rgba(12, 15, 23, .55)); }
.ph-widget { position: relative; z-index: 1; display: grid; justify-items: center; gap: 2px; padding: 10px 0 14px; touch-action: none; }
.ph-bigclock { font: 400 64px/0.9 'Jersey 10', monospace; letter-spacing: 1px; color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.ph-who { display: flex; align-items: center; gap: 6px; font-size: 18px; color: #d8d3c8; max-width: 100%; }
.ph-who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-side { font-style: normal; padding: 1px 7px 0; border-radius: 6px; background: var(--acc); color: var(--accink); font-size: 16px; }
.ph-bounty-chip { margin-top: 4px; padding: 2px 10px 1px; border-radius: 10px; background: rgba(255, 75, 62, .18); border: 1px solid rgba(255, 110, 95, .45); color: #ff9d90; font-size: 17px; }
.ph-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 4px; align-content: start; flex: 1; padding-top: 4px; }
.ph-dock { position: relative; z-index: 1; display: flex; justify-content: space-around; padding: 9px 6px 7px; border-radius: 28px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.ph-dock .ph-icon { width: 25%; }
.ph-icon { position: relative; display: grid; justify-items: center; gap: 4px; min-height: 76px; }
.ph-icon span { font-size: 15px; line-height: 1; color: #e8e4da; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); white-space: nowrap; }
.ph-icon .ph-badge { position: absolute; top: -6px; right: calc(50% - 33px); }
.ph-tile { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; color: #fff; font-size: 28px; font-style: normal;
  background: linear-gradient(160deg, var(--c1), var(--c2)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 0 rgba(0, 0, 0, .18), 0 4px 10px rgba(0, 0, 0, .35);
  transition: transform .25s var(--spring), filter .15s; }
.ph-tile svg { filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); stroke-width: 2.2; }
.ph-tile.sm { width: 38px; height: 38px; border-radius: 11px; font-size: 21px; flex: none; }
.ph-icon:hover .ph-tile { transform: translateY(-2px); }
.ph-icon:active .ph-tile { transform: scale(.88); filter: brightness(.85); }

/* An open app */
.ph-app { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; padding: 40px 0 26px; background: var(--scr); }
.ph-app.ph-in { animation: ph-zoomin .42s var(--spring); }
.ph-app.ph-out { animation: ph-zoomout .26s ease-in forwards; }
@keyframes ph-zoomin { from { transform: scale(.18); opacity: 0; border-radius: 40px; } 40% { opacity: 1; } }
@keyframes ph-zoomout { to { transform: scale(.18); opacity: 0; border-radius: 40px; } }
.ph-head { position: relative; display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 10px; flex: none; }
.ph-back { display: flex; align-items: center; gap: 1px; height: 40px; padding: 0 8px 0 2px; border-radius: 12px; color: var(--acc) !important; font-size: 19px; }
.ph-back svg { font-size: 22px; stroke-width: 2.6; }
.ph-back:hover { background: rgba(255, 255, 255, .06) !important; }
.ph-title { flex: 1; margin: 0; font: 400 25px/1 'Jersey 10', monospace; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; touch-action: none; }
.ph-action { min-width: 64px; display: flex; justify-content: flex-end; }
.ph-tname { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; text-align: left; }
.ph-tname .ph-ava { width: 32px; height: 32px; font-size: 15px; }
.ph-tname b { display: block; font-weight: 400; font-size: 20px; overflow: hidden; text-overflow: ellipsis; }
.ph-tname small { display: block; font-size: 14px; color: var(--sub); }
.ph-tname > span { min-width: 0; }
.ph-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 14px 16px; touch-action: pan-y; overscroll-behavior: contain; scrollbar-width: none; }
.ph-body::-webkit-scrollbar { display: none; }
.ph-body.ph-push { animation: ph-push .32s cubic-bezier(.2, .9, .3, 1); }
.ph-body.ph-pop { animation: ph-pop2 .32s cubic-bezier(.2, .9, .3, 1); }
@keyframes ph-push { from { transform: translateX(40%); opacity: 0; } }
@keyframes ph-pop2 { from { transform: translateX(-30%); opacity: 0; } }
.ph-foot { flex: none; padding: 6px 10px 2px; border-top: 1px solid rgba(255, 255, 255, .06); background: rgba(255, 255, 255, .02); }

/* Shared bits */
.ph-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ph-grow { flex: 1; min-width: 0; }
.ph-trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ph-sub { color: var(--sub); font-size: 16px; }
.ph-list { display: grid; gap: 8px; }
.ph-card { display: block; width: 100%; text-align: left; padding: 11px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--cardline) !important; }
.ph-card + .ph-card, .ph-cashcard + .ph-card { margin-top: 0; }
.ph-body > .ph-card { margin-bottom: 10px; }
.ph-tap { transition: transform .15s, background .15s; }
.ph-tap:hover { background: rgba(255, 255, 255, .08) !important; }
.ph-tap:active { transform: scale(.98); }
.ph-card b { font-weight: 400; }
.ph-card small { display: block; color: var(--sub); font-size: 15px; }
.ph-pay { font-weight: 400; color: var(--good); font-size: 22px; }
.ph-pay.big { color: var(--acc); font-size: 26px; }
.ph-items { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0; }
.ph-item { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 1px 6px; border-radius: 8px; background: rgba(0, 0, 0, .3); font-size: 17px; }
.ph-item i { width: 9px; height: 9px; border-radius: 3px; box-shadow: 0 0 6px currentColor; }
.ph-where { display: flex; align-items: center; gap: 6px; font-size: 18px; color: #e6e1d6; }
.ph-where svg { color: var(--good); font-size: 18px; }
.ph-where.unknown { color: var(--sub); }
.ph-where.unknown svg { color: var(--sub); }
.ph-where.small { font-size: 16px; color: var(--sub); margin: 8px 2px 12px; }
.ph-sub svg { vertical-align: -2px; margin-right: 3px; font-size: 15px; }
.ph-meta { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 16px; color: var(--sub); min-height: 22px; }
.ph-left { color: #e6e1d6; white-space: nowrap; }
.ph-left.soon { color: var(--bad); animation: ph-blink 1s steps(2) infinite; }
@keyframes ph-blink { 50% { opacity: .55; } }
.ph-new { font-style: normal; padding: 1px 6px 0; border-radius: 6px; background: var(--acc); color: var(--accink); font-size: 14px; }
.ph-tag { display: inline-block; padding: 1px 8px 0; border-radius: 7px; background: rgba(255, 255, 255, .08); font-size: 15px; color: #d8d3c8; white-space: nowrap; }
.ph-tag.s-delivered { background: rgba(126, 230, 126, .16); color: var(--good); }
.ph-tag.s-expired, .ph-tag.s-declined { color: var(--sub); }
.ph-card.s-expired, .ph-card.s-declined, .ph-card.s-done { opacity: .55; }
.ph-card.s-delivered { border-color: rgba(126, 230, 126, .25) !important; }
.ph-intro { margin: 0 2px 10px; color: var(--sub); font-size: 16px; line-height: 1.15; }
.ph-help { margin: 10px 4px 0; text-align: center; color: var(--sub); font-size: 16px; line-height: 1.15; }
.ph-help.left { text-align: left; margin: 6px 0 0; }
.ph-h4 { margin: 16px 2px 6px; font: 400 18px/1 'Jersey 10', monospace; color: var(--sub); text-transform: uppercase; letter-spacing: 1px; }
.ph-empty { display: grid; justify-items: center; gap: 4px; padding: 54px 18px 0; text-align: center; }
.ph-empty svg { font-size: 50px; color: rgba(255, 255, 255, .2); margin-bottom: 8px; stroke-width: 1.6; }
.ph-empty b { font-weight: 400; font-size: 24px; }
.ph-empty p { margin: 0; color: var(--sub); font-size: 17px; line-height: 1.15; max-width: 220px; }

.ph-cta { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; margin-top: 12px; border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--acc) 85%, #fff), var(--acc2)) !important; color: var(--accink) !important; font-size: 23px;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--acc2) 50%, #000), 0 8px 18px rgba(0, 0, 0, .35); transition: transform .12s, box-shadow .12s; }
.ph-cta svg { font-size: 22px; }
.ph-cta:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--acc2) 50%, #000); }
.ph-cta.danger { background: linear-gradient(180deg, #ff8f80, #d8463a) !important; color: #2a0806 !important; box-shadow: 0 3px 0 #7a1f18, 0 8px 18px rgba(0, 0, 0, .35); }
.ph-ghost { display: block; width: 100%; height: 46px; margin-top: 8px; border-radius: 14px; background: rgba(255, 255, 255, .07) !important; font-size: 20px; }
.ph-ghost:hover { background: rgba(255, 255, 255, .11) !important; }
.ph-ghost.bad { color: var(--bad) !important; }
.ph-mini { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px 0 10px; border-radius: 12px; white-space: nowrap; flex: none;
  background: color-mix(in srgb, var(--acc) 18%, transparent) !important; color: var(--acc) !important; font-size: 18px; transition: transform .12s; }
.ph-mini:active { transform: scale(.94); }
.ph-mini svg { font-size: 16px; }
.ph-round { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--acc) 18%, transparent) !important; color: var(--acc) !important; font-size: 20px; }

.ph-ava { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; font: 400 19px/1 'Jersey 10', monospace; font-style: normal; color: #10131b;
  background: linear-gradient(160deg, #cfcac0, #8a867e); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.ph-ava.k-customer { background: linear-gradient(160deg, #a8f0b8, #3c9a5a); }
.ph-ava.k-criminal { background: linear-gradient(160deg, #ffe08a, #c8862a); }
.ph-ava.k-police { background: linear-gradient(160deg, #bcd4ff, #4a7ae8); }

/* Orders detail */
.ph-hero { padding: 14px; }
.ph-hero .ph-pay { font-size: 28px; }
.ph-hero .ph-items { margin: 12px 0; }
.ph-hero .ph-item { font-size: 19px; padding: 4px 10px 3px 8px; }

/* Messages */
.ph-threads { gap: 2px; }
.ph-thread { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 6px; border-radius: 14px; text-align: left; transition: background .15s; }
.ph-thread:hover { background: rgba(255, 255, 255, .05) !important; }
.ph-thread b { font-weight: 400; font-size: 20px; }
.ph-thread time { color: var(--sub); font-size: 15px; }
.ph-prev { color: var(--sub); font-size: 17px; }
.ph-prev i { font-style: normal; }
.ph-thread.unread b, .ph-thread.unread .ph-prev { color: #fff; }
.ph-dot { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center; background: var(--acc); color: var(--accink); font-size: 15px; font-weight: 400; }
.ph-chat { display: flex; flex-direction: column; gap: 5px; padding-top: 6px; }
.ph-msg { max-width: 82%; display: flex; flex-direction: column; animation: ph-msgin .3s var(--spring); }
@keyframes ph-msgin { from { transform: translateY(8px) scale(.96); opacity: 0; } }
.ph-msg p { margin: 0; padding: 7px 12px 6px; border-radius: 18px; font-size: 19px; line-height: 1.1; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.ph-msg time { font-size: 13px; color: var(--sub); margin: 2px 8px 2px; }
.ph-msg.them { align-self: flex-start; }
.ph-msg.them p { background: #22283a; border-bottom-left-radius: 6px; }
.ph-msg.me { align-self: flex-end; align-items: flex-end; }
.ph-msg.me p { background: linear-gradient(180deg, color-mix(in srgb, var(--acc) 90%, #fff), var(--acc2)); color: var(--accink); border-bottom-right-radius: 6px; }
.ph-msg.pending { opacity: .6; }
.ph-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 7px; scrollbar-width: none; touch-action: pan-x; }
.ph-chips::-webkit-scrollbar { display: none; }
.ph-chip { flex: none; height: 32px; padding: 0 12px; border-radius: 16px; background: rgba(255, 255, 255, .08) !important; border: 1px solid rgba(255, 255, 255, .1) !important; font-size: 17px; white-space: nowrap; transition: transform .12s; }
.ph-chip:hover { background: rgba(255, 255, 255, .13) !important; }
.ph-chip:active { transform: scale(.94); }
.ph-compose { position: relative; display: flex; align-items: center; gap: 6px; }
.ph-input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border-radius: 21px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(0, 0, 0, .35); color: var(--tx);
  font: 400 19px 'Jersey 10', monospace; -webkit-user-select: text; user-select: text; touch-action: manipulation; outline: none; }
.ph-input:focus { border-color: color-mix(in srgb, var(--acc) 60%, transparent); }
.ph-input::placeholder { color: #6e6a63; }
.ph-count { position: absolute; right: 56px; top: 50%; transform: translateY(-50%); font-weight: 400; font-size: 14px; color: var(--sub); pointer-events: none; }
.ph-sendbtn { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; background: rgba(255, 255, 255, .1) !important; color: var(--sub) !important; transition: background .2s, transform .15s; }
.ph-compose.has .ph-sendbtn { background: var(--acc) !important; color: var(--accink) !important; }
.ph-sendbtn:active { transform: scale(.9); }

/* Market */
.ph-dealer { display: flex !important; align-items: center; gap: 10px; }
.ph-dealer b { display: block; font-size: 20px; }
.ph-dealer b small { display: inline; font-size: 15px; }
.ph-dealer .ph-sub { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.ph-dealer .ph-sub { gap: 6px; }
.ph-avawrap { position: relative; flex: none; }
.ph-avawrap.on::after { content: ''; position: absolute; right: 0; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 2.5px #1a1e29, 0 0 8px var(--good); }
.ph-dm { width: 44px; height: 44px; flex: none; font-size: 22px; }
.ph-stars { display: inline-flex; gap: 1px; }
.ph-stars i { display: inline-flex; font-size: 13px; color: rgba(255, 255, 255, .18); }
.ph-stars i.on { color: #f2c25a; }
.ph-stars i.half { color: #f2c25a; opacity: .5; }
.ph-on { color: var(--good); display: inline-flex; align-items: center; gap: 4px; }
.ph-on::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 6px var(--good); }

/* Bank */
.ph-cashcard { position: relative; overflow: hidden; display: grid; gap: 2px; padding: 16px 16px 14px; margin-bottom: 10px; border-radius: 20px;
  background: linear-gradient(135deg, #2f5a2c, #173019); border: 1px solid rgba(126, 230, 126, .25); box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
.ph-cashcard::after { content: ''; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; border: 18px solid rgba(255, 255, 255, .05); }
.ph-cashcard small { color: #a8d8a0; font-size: 16px; }
.ph-cashcard b { font: 400 46px/1 'Jersey 10', monospace; color: #fff; }
.ph-cashcard span { color: var(--good); font-size: 17px; }
.ph-bountycard { background: rgba(255, 75, 62, .1) !important; border-color: rgba(255, 110, 95, .35) !important; }
.ph-bountycard small { color: #ff9d90 !important; }
.ph-bountycard b { font-size: 34px; line-height: 1; color: #ff6a5a; }
.ph-bountycard svg { font-size: 26px; color: #ff6a5a; }
.ph-bountycard p { margin: 6px 0 0; color: #d8b0a8; font-size: 15px; line-height: 1.15; }
.ph-ledger { border-radius: 16px; background: var(--card); border: 1px solid var(--cardline); padding: 2px 12px; }
.ph-ledger .ph-row { padding: 9px 0; font-size: 18px; }
.ph-ledger .ph-row + .ph-row { border-top: 1px solid rgba(255, 255, 255, .06); }
.ph-ledger time { color: var(--sub); font-size: 15px; }
.ph-ledger b { font-weight: 400; min-width: 60px; text-align: right; }
.ph-ledger .pos { color: var(--good); }
.ph-ledger .neg { color: var(--bad); }

/* Identity */
.ph-idcard { position: relative; overflow: hidden; padding: 16px; border-radius: 20px; background: linear-gradient(135deg, #20345e, #0f1a33); border: 1px solid rgba(143, 182, 255, .3);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
.ph-idcard::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(255, 255, 255, .025) 14px 28px); }
.ph-idcard > * { position: relative; }
.ph-idcard small { color: #a8c0ec; font-size: 15px; }
.ph-idcard .ph-row { margin: 8px 0; }
.ph-idcard .ph-row b { font-weight: 400; font-size: 26px; color: #fff; }
.ph-idcard p { margin: 0; color: #a8c0ec; font-size: 16px; }

/* Map */
.ph-mapwrap { position: relative; margin: 0 -4px; border-radius: 18px; overflow: hidden; border: 1px solid var(--cardline); background: #121620; }
.ph-map { display: block; width: 100%; aspect-ratio: 1; cursor: pointer; touch-action: manipulation; }
.ph-mapyou { display: none; }
.ph-maplist { margin-top: 10px; }
.ph-pins { gap: 4px; }
.ph-pinrow { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 12px; border-radius: 12px; background: var(--card) !important; text-align: left; font-size: 18px; }
.ph-pinrow i { width: 12px; height: 12px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); flex: none; }
.ph-pinrow .ph-sub { font-size: 15px; color: var(--acc); }
.ph-pinrow.on { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 60%, transparent); }
.ph-pinrow.on .ph-sub { color: var(--good); }

/* Radio */
.ph-station { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 16px; background: var(--card) !important; text-align: left; min-height: 56px; transition: background .15s; }
.ph-station b { display: block; font-weight: 400; font-size: 20px; }
.ph-station small { display: block; font-size: 15px; color: var(--sub); }
.ph-station.on { background: linear-gradient(135deg, rgba(255, 140, 120, .22), rgba(196, 58, 85, .2)) !important; box-shadow: inset 0 0 0 1px rgba(255, 160, 140, .3); }
.ph-eq { flex: none; display: flex; align-items: flex-end; gap: 2px; width: 22px; height: 18px; }
.ph-eq i { flex: 1; height: 4px; border-radius: 1px; background: rgba(255, 255, 255, .25); }
.ph-eq.play i { background: #ffa79a; animation: ph-eq .9s ease-in-out infinite alternate; }
.ph-eq.play i:nth-child(2) { animation-delay: -.3s; } .ph-eq.play i:nth-child(3) { animation-delay: -.6s; } .ph-eq.play i:nth-child(4) { animation-delay: -.45s; }
@keyframes ph-eq { from { height: 3px; } to { height: 18px; } }

/* Settings */
.ph-sliders { display: grid; gap: 14px; padding: 14px; }
.ph-slider { display: grid; gap: 8px; }
.ph-slider b { font-weight: 400; }
.ph-slider output { color: var(--acc); font-size: 18px; min-width: 30px; text-align: right; }
.ph-slider input { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: none; touch-action: pan-x; cursor: pointer; }
.ph-slider input::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--acc) var(--v), rgba(255, 255, 255, .12) var(--v)); }
.ph-slider input::-moz-range-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--acc) var(--v), rgba(255, 255, 255, .12) var(--v)); }
.ph-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.ph-slider input::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.ph-sidename { font-size: 24px; color: var(--acc); }
.ph-keys { margin-top: 18px; }
@media (pointer: coarse) { .ph-keys { display: none; } }

/* Sheets: confirm, order request, new chat */
.ph-sheet { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; background: rgba(4, 6, 10, .55); }
.ph-sheet.ph-sheet-in { animation: ph-fade .2s; }
@keyframes ph-fade { from { background: rgba(4, 6, 10, 0); } }
.ph-sheetcard { width: 100%; max-height: calc(100% - 44px); overflow-y: auto; padding: 8px 16px 34px; border-radius: 28px 28px 0 0; background: #171b26;
  border-top: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 -10px 30px rgba(0, 0, 0, .5); touch-action: pan-y; scrollbar-width: none; }
.ph-sheet-in .ph-sheetcard { animation: ph-sheetup .4s var(--spring); }
@keyframes ph-sheetup { from { transform: translateY(100%); } }
.ph-sheetcard { position: relative; }
.ph-x { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08) !important; color: var(--sub) !important; font-size: 18px; }
.ph-x:hover { color: #fff !important; }
.ph-grab { display: block; width: 40px; height: 5px; margin: 0 auto 12px; border-radius: 3px; background: rgba(255, 255, 255, .2); }
.ph-sheetcard h4 { margin: 0 0 4px; font: 400 28px/1 'Jersey 10', monospace; text-align: center; }
.ph-sheetcard > p { margin: 0 0 10px; color: var(--sub); text-align: center; font-size: 18px; line-height: 1.15; }
.ph-sheetcard .ph-to b { color: var(--acc); font-weight: 400; }
.ph-prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 5px; margin: 6px 0 12px; }
.ph-prod { display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 6px; border-radius: 11px; background: rgba(255, 255, 255, .06) !important; border: 1px solid transparent !important;
  font-size: 16px; line-height: 1; text-align: left; white-space: nowrap; overflow: hidden; transition: transform .12s, background .15s; }
.ph-prod i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ph-prod.on { background: color-mix(in srgb, var(--acc) 18%, transparent) !important; border-color: var(--acc) !important; color: #fff; }
.ph-prod:active { transform: scale(.95); }
.ph-amount { margin-bottom: 10px; font-size: 19px; }
.ph-step { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .08) !important; font-size: 24px; display: grid; place-items: center; }
.ph-n { font-weight: 400; font-size: 28px; min-width: 26px; text-align: center; color: var(--acc); }
.ph-seg { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 13px; background: rgba(0, 0, 0, .35); }
.ph-seg button { height: 38px; border-radius: 10px; font-size: 18px; color: var(--sub); transition: background .2s, color .2s; }
.ph-seg button.on { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.ph-newchat .ph-input { width: 100%; margin-top: 4px; }

/* Home bar */
.ph-bar { position: absolute; z-index: 8; left: 50%; bottom: 0; width: 160px; height: 26px; transform: translateX(-50%); display: grid; place-items: center; touch-action: none; }
.ph-bar i { width: 118px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .78); transition: width .2s; }
.ph-bar:hover i { width: 130px; }

/* Phones: nearly full screen */
@media (max-width: 560px), (max-height: 600px) and (pointer: coarse) {
  .ph-dev { left: calc(env(safe-area-inset-left) + 6px); right: calc(env(safe-area-inset-right) + 6px); width: auto;
    top: calc(env(safe-area-inset-top) + 8px); bottom: calc(env(safe-area-inset-bottom) + 6px); height: auto; padding: 6px; border-radius: 42px; }
  .ph-screen { border-radius: 36px; }
  .ph-key { display: none; }
  .ph-grid { gap: 18px 4px; }
  .ph-bigclock { font-size: 74px; }
  .ph-widget { padding: 18px 0 22px; }
  .ph-tile { width: 60px; height: 60px; border-radius: 17px; font-size: 31px; }
  .ph-icon span { font-size: 16px; }
  .ph-map { aspect-ratio: 1 / 1.05; }
  .ph-dev { --ph-peek: 58px; transform: translateY(calc(100% + env(safe-area-inset-bottom) + 6px - var(--ph-peek))); }
  .ph.ph-open .ph-dev { transform: none; }
  .ph-peek { bottom: calc(env(safe-area-inset-bottom) + 80px); }
}
@media (prefers-reduced-motion: reduce) {
  .ph-dev, .ph.ph-open .ph-dev, .ph-island, .ph-btn { transition-duration: .01s !important; }
  .ph-app.ph-in, .ph-app.ph-out, .ph-body.ph-push, .ph-body.ph-pop, .ph-msg, .ph-sheet-in .ph-sheetcard { animation-duration: .01s !important; }
}

/* Landscape phones: a phone held upright at the left (the game stays visible beside it), peeking up a little less. */
@media (max-height: 500px) and (orientation: landscape) {
  .ph-dev { --ph-peek: 40px; left: calc(env(safe-area-inset-left) + 8px); right: auto; width: 250px; top: auto;
    height: calc(100dvh - 16px); bottom: calc(env(safe-area-inset-bottom) + 8px); padding: 6px; border-radius: 34px;
    transform: translateY(calc(100% + env(safe-area-inset-bottom) + 8px - var(--ph-peek))); }
  .ph.ph-open .ph-dev { transform: none; }
  .ph-screen { border-radius: 28px; }
  .ph-grab { top: -11px; }
  .ph-peek { left: calc(env(safe-area-inset-left) + 8px); bottom: calc(env(safe-area-inset-bottom) + 54px); max-width: 240px; }
  .ph-bigclock { font-size: 46px; }
  .ph-widget { padding: 6px 0 8px; }
  .ph-tile { width: 46px; height: 46px; border-radius: 13px; font-size: 24px; }
  .ph-icon span { font-size: 13px; }
  .ph-grid { gap: 10px 4px; }
}
