/* #41/#46: profile, phone and minimap presentation. Transport and navigation keep their own state. */
:root{
 --hud-surface:var(--b-panel);--hud-well:var(--b-well);--hud-edge:var(--b-line);--hud-ink:var(--b-ink);
 --hud-muted:var(--b-muted);--hud-blue:var(--b-info);--hud-gold:var(--b-accent);--hud-gap:10px;
 --bolha-phone-width:220px;--bolha-hud-right:18px;--bolha-hud-bottom:18px;
 --bolha-phone-height:min(440px,calc(100dvh - var(--bolha-profile-height,272px) - var(--bolha-minimap) - 56px));
}
.hud-icon{display:block;width:22px;height:22px;flex:none}
#bolha-profile,#phone{color:var(--hud-ink);font-family:var(--b-font);font-weight:450}
#bolha-profile{position:fixed;top:max(18px,env(safe-area-inset-top));right:max(var(--bolha-hud-right),env(safe-area-inset-right));width:var(--bolha-phone-width);padding:8px;border:1px solid var(--hud-edge);border-radius:16px;background:var(--hud-surface);box-shadow:0 8px 28px #0004;z-index:25}
.profile-header{display:flex;align-items:center;gap:9px;min-height:45px;margin-bottom:8px}
.profile-avatar,.online-avatar{display:grid;place-items:center;flex:none;width:35px;height:38px;background:#253a52;border:1px solid #42607e55;border-radius:9px;color:#b5cce6}
.profile-avatar .hud-icon{width:25px;height:25px}.profile-identity{flex:1;min-width:0}
#bolha-profile #auth{position:static;display:flex;align-items:center;gap:6px;min-width:0;font:600 14px/1.3 var(--b-font);text-shadow:none}
#bolha-profile #auth>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#bolha-profile.connected #auth>span:after{content:'';display:inline-block;width:6px;height:6px;border-radius:50%;background:#27d59b;margin:0 0 1px 6px}
#bolha-profile #auth button{padding:5px;width:29px;height:29px;flex:none;display:grid;place-items:center;color:var(--hud-blue);background:#142b43;border:1px solid #42648555;border-radius:8px;box-shadow:none;text-shadow:none}
#bolha-profile #auth button .hud-icon{width:18px;height:18px}
#bolha-profile #auth.profile-guest button{display:block;width:100%;min-width:0;height:auto;min-height:28px;padding:3px 0;border:0;border-radius:4px;background:transparent;font:500 10.5px/1.4 var(--b-font);text-align:left;white-space:normal;overflow-wrap:anywhere;cursor:pointer}
#bolha-profile #auth.profile-guest button:hover{color:#c4dcff;text-decoration:underline;text-underline-offset:3px}
#bolha-profile #auth.profile-guest button:focus-visible{outline:2px solid var(--hud-blue);outline-offset:2px}
.profile-place{display:block;color:var(--hud-muted);font-size:10px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profile-stats{display:grid;grid-template-columns:1fr 1fr;gap:0;padding:6px 0;border:1px solid #42648555;border-radius:9px;background:#0b1b2c;margin-bottom:7px}
.profile-stat{display:flex;align-items:center;gap:6px;min-width:0;padding:6px 7px;border:0;background:none;color:var(--hud-ink);font:600 11px/1.4 var(--b-font);text-align:left;cursor:pointer;font-variant-numeric:tabular-nums}
.profile-stat+button{border-left:1px solid #42648566}.profile-stat .hud-icon{width:18px;height:18px;color:var(--hud-gold)}
.profile-stat span{min-width:0;overflow-wrap:anywhere}.profile-stat:focus-visible{outline:2px solid var(--hud-blue);outline-offset:2px;border-radius:6px}
.bolha-hud #wallet-hud,.bolha-hud #work-badge{display:none!important}
#bolha-profile #bolha-online{border:0;border-radius:0;background:transparent;box-shadow:none;font:12px var(--b-font)}
.online-header{display:flex;align-items:center;gap:5px;min-height:38px}
#bolha-online-toggle{display:flex;align-items:center;gap:6px;min-width:0;flex:1;padding:7px 0;background:none;color:var(--hud-ink);text-align:left;cursor:pointer}
#bolha-online-toggle span{flex:1;white-space:nowrap;font-weight:600;font-size:11px}#bolha-online-toggle .hud-icon{width:16px;height:16px;color:var(--hud-blue)}
#bolha-online-toggle .hud-icon:last-child{width:13px;height:13px;transition:transform .15s}#bolha-online-toggle .expanded{transform:rotate(180deg)}
#bolha-online-toggle:disabled{opacity:1;cursor:default}
#bolha-online-toggle:disabled .hud-icon:last-child{visibility:hidden}
.online-controls{display:flex;gap:4px;flex:none}
#bolha-profile .voice-chip{position:relative;display:grid;place-items:center;min-width:27px;width:27px;height:30px;padding:3px;gap:0;color:var(--hud-blue);border:1px solid #42648555;border-radius:7px;background:#132b43}
#bolha-profile .voice-chip small{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#bolha-profile .voice-chip .ic{width:17px;height:17px}
#bolha-profile .voice-chip.off{color:#ff7d84;background:#301c2a85;border-color:#5b344766}
#bolha-profile .voice-chip.off[data-kind=speaker]:after{left:3px;top:14px;width:21px;height:1.5px}
#bolha-profile button.voice-chip{font:inherit;cursor:pointer}#bolha-profile button.voice-chip:focus-visible,#bolha-online-toggle:focus-visible{outline:2px solid var(--hud-blue);outline-offset:1px}
#bolha-profile #bolha-online #bolha-online-list{max-height:144px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#6383aa #142b43;scrollbar-gutter:stable}
@media(min-width:701px) and (min-height:501px) and (pointer:fine){
 body:not(.club-inside,.profile-compact) #bolha-profile #bolha-online #bolha-online-list[data-has-people="true"]{
  --bolha-roster-room:max(0px,calc(100dvh - max(18px,env(safe-area-inset-top)) - max(var(--bolha-hud-bottom),env(safe-area-inset-bottom)) - var(--hud-gap) - var(--bolha-roster-reserved)));
  max-height:var(--bolha-roster-room,144px);
 }
}
@media(min-width:701px) and (min-height:801px) and (pointer:fine){
 body:not(.club-inside,.profile-compact):has(#bolha-profile:not([hidden]) #bolha-online-list[data-has-people="true"]:not([hidden])) #phone{
  --bolha-phone-height:min(520px,calc(100dvh - var(--bolha-profile-base-height,var(--bolha-profile-height,272px)) - var(--bolha-minimap) - 56px));
 }
}
#bolha-profile #bolha-online #bolha-online-list::-webkit-scrollbar{width:4px}#bolha-profile #bolha-online #bolha-online-list::-webkit-scrollbar-thumb{background:#6383aa;border-radius:4px}
#bolha-profile #bolha-online #bolha-online-list .online-player{height:48px;min-height:48px;gap:5px;padding:5px 1px;border-top:1px solid #6d91b122;background:none}
#bolha-profile .online-avatar{width:22px;height:29px;border-radius:6px}#bolha-profile .online-avatar .hud-icon{width:16px;height:16px}
#bolha-profile .online-name{font-size:10.5px;font-weight:550}#bolha-profile .online-place{font-size:9px;margin-top:3px;color:var(--hud-muted)}
#bolha-profile .online-meta .online-place{margin-top:0}
#bolha-profile .online-voice-label{font-size:8.5px;line-height:12px;color:var(--hud-ink);background:#243e52}
#bolha-profile .online-voice-label .hud-icon{width:9px;height:9px}
#bolha-profile .online-states{gap:3px}#bolha-profile .online-states .voice-chip{width:23px;min-width:23px;height:29px}
#bolha-profile .online-states .voice-chip{background:transparent;border-color:transparent}
#bolha-profile .online-states .voice-chip .ic{width:15px;height:15px}#bolha-profile .online-states .voice-chip.off[data-kind=speaker]:after{left:2px;width:18px}
#bolha-profile .online-speaking .online-name{color:#54e4b3}#bolha-profile #bolha-online .online-player.online-speaking{box-shadow:inset 2px 0 #39ce9d;background:#144b3c25}
#bolha-phone-dock{top:calc(max(18px,env(safe-area-inset-top)) + var(--bolha-profile-height,272px) + var(--hud-gap));bottom:auto;gap:var(--hud-gap)}
#phone{height:var(--bolha-phone-height);min-height:280px;max-height:none;border:4px solid #111b28;border-radius:27px;background:linear-gradient(155deg,#102840,#071524 80%);box-shadow:0 0 0 1px #8493a0,0 0 0 3px #0b1119,0 8px 24px #0005;overflow:hidden}
#phone:after{content:'';position:absolute;bottom:6px;left:32%;right:32%;height:3px;border-radius:5px;background:#a7c9ff;pointer-events:none}
.phone-status{display:flex;align-items:center;justify-content:space-between;position:relative;min-height:29px;padding:4px 11px;color:#c5d9f1;font-size:10px;font-variant-numeric:tabular-nums}
#phone .phone-notch{position:absolute;top:5px;left:50%;transform:translateX(-50%);margin:0;width:52px;height:14px;border-radius:12px;background:#030910}
.phone-signal{display:flex;align-items:center;gap:5px;color:#a8c9f6}.phone-signal .hud-icon{width:14px;height:14px}.phone-signal .hud-icon:last-child{width:20px;height:14px}
#phone header{gap:12px;min-height:34px;padding:3px 12px 7px;border-color:#6d91b125;background:transparent}
#phone header strong{font-size:15px;font-weight:600;color:var(--hud-ink)}
#phone header button{display:grid;place-items:center;padding:4px;width:28px;height:28px;flex:none;color:var(--hud-blue);background:#142b4380;border:1px solid #42648555;border-radius:8px}
#phone header button .hud-icon{width:16px;height:16px}
#phone main{padding:10px;scrollbar-width:thin;scrollbar-color:#6383aa transparent;font-size:12px;color:var(--hud-ink)}
#phone.home main{display:flex;padding:5px 7px 15px;overflow:hidden}
#phone .phone-apps{flex:1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(5,minmax(0,1fr));gap:4px;width:100%}
#phone .phone-apps button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-height:0;min-width:0;padding:4px 0;font:450 9px/1.2 var(--b-font);background:#152e4633!important;color:var(--hud-ink)!important;border:1px solid #4264851c;border-radius:9px;box-shadow:none;white-space:normal;overflow:visible}
#phone .phone-apps button:hover{background:#22446766!important;border-color:#6383aa88}
#phone .phone-apps .phone-icon{font-size:0;line-height:1;color:var(--hud-blue)}#phone .phone-icon .hud-icon{width:25px;height:25px}
#phone .phone-apps [data-app=taxi] .phone-icon,#phone .phone-apps [data-app=wallet] .phone-icon{color:var(--hud-gold)}
#phone .phone-apps.phone-work-apps{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:minmax(62px,auto)}
#phone button:focus-visible{outline:2px solid var(--hud-blue);outline-offset:-2px}#phone button{background:#284f74;color:var(--hud-ink)}
#phone :is(input:not([type=range]),textarea,select){background:#10253a;color:var(--hud-ink);border-color:#4d6e8e}
#phone .phone-note,#phone .phone-contact small{color:#b0c3da}#phone .phone-contact{border-color:#42648566}
#phone .phone-received{background:#20384e}#phone .phone-sent{background:#204b4b}#phone .phone-subtle{background:#233d58!important;color:var(--hud-ink)!important}#phone a{color:#9ec5ff}
#phone-unfold{position:relative;width:40px;height:71px;min-height:0;padding:0;align-self:flex-end;color:var(--hud-blue);border:2px solid #7191b4;border-radius:10px;background:#0b1b2cf2;box-shadow:0 0 0 2px #09111c,0 6px 16px #0004}
#phone-unfold:before,#phone-unfold:after{content:'';position:absolute;left:35%;right:35%;height:2px;background:var(--hud-blue);border-radius:4px}
#phone-unfold:before{top:5px}#phone-unfold:after{bottom:5px;left:27%;right:27%}
body:has(#start:not([hidden])) :is(#bolha-profile,#bolha-phone-dock){visibility:hidden}
@media(max-width:700px){
 :root{--bolha-hud-right:12px;--bolha-hud-bottom:12px;--bolha-phone-width:min(242px,calc(100vw - 24px));--hud-gap:10px}
 #bolha-profile{top:max(12px,env(safe-area-inset-top));padding:8px;border-radius:14px}
 #bolha-profile #auth{font-size:14px}.profile-header{margin-bottom:6px;min-height:38px}.profile-avatar{height:34px;width:32px}
 .profile-stat{font-size:11px;min-height:35px;padding:4px 6px}.profile-stats{padding:2px 0;margin-bottom:4px}
 .online-header{min-height:38px}#bolha-online-toggle{min-height:38px}#bolha-profile .online-controls .voice-chip{width:35px;height:35px}
 #bolha-profile #bolha-online #bolha-online-list{max-height:144px}#bolha-profile .online-states .voice-chip{min-width:30px;width:30px;height:34px}
 #bolha-phone-dock{top:calc(max(12px,env(safe-area-inset-top)) + var(--bolha-profile-height,145px) + var(--hud-gap));bottom:auto}
 #phone{position:fixed;right:50%;transform:translateX(50%);bottom:max(14px,env(safe-area-inset-bottom));width:min(320px,calc(100vw - 40px),calc((100dvh - 190px)/1.85));height:min(610px,calc(100dvh - 190px));min-height:260px;z-index:55;border-radius:30px}
 #phone main{font-size:13px}#phone.home main{padding:8px 9px 17px}
 #phone .phone-apps{gap:8px 5px}#phone .phone-apps button{font-size:11px;gap:9px;border-color:#42648555;background:#142c4580!important;border-radius:12px}
 #phone .phone-icon .hud-icon{width:31px;height:31px}#phone header{min-height:39px}#phone header strong{font-size:18px}
 #phone-unfold{position:fixed;right:max(22px,env(safe-area-inset-right));bottom:max(28px,env(safe-area-inset-bottom));width:45px;height:80px;z-index:26}
 #turn-help{display:none!important}
}
@media(max-width:700px),(max-height:500px){
 #phone > header > button{width:44px;height:44px}
 #phone.home main{overflow:auto}
}
/* Short landscape screens use two columns: profile on the right, phone beside it. */
@media(max-height:500px) and (orientation:landscape){
 :root{--bolha-phone-width:200px;--bolha-hud-right:12px;--bolha-hud-bottom:12px;--bolha-phone-height:calc(100dvh - 32px)}
 #bolha-profile{top:max(12px,env(safe-area-inset-top));padding:6px}
 .profile-header{min-height:32px;margin-bottom:4px}.profile-avatar{width:28px;height:28px}.profile-place{font-size:9px}
 .profile-stat{font-size:10px;padding:3px 4px}.profile-stats{padding:3px 0;margin-bottom:3px}
 #bolha-profile #bolha-online #bolha-online-list{max-height:96px}
 #bolha-phone-dock{top:calc(max(12px,env(safe-area-inset-top)) + var(--bolha-profile-height,140px) + 8px)}
 #phone{position:fixed;right:calc(var(--bolha-hud-right) + var(--bolha-phone-width) + 14px);top:14px;bottom:auto;transform:none;width:210px;height:calc(100dvh - 28px);min-height:0}
 #phone .phone-apps button{font-size:9px;gap:4px}#phone .phone-icon .hud-icon{width:22px;height:22px}
 #phone-unfold{position:fixed;right:auto;left:calc(50% - 20px);bottom:28px;width:36px;height:64px}
}
.profile-guest-name{display:block;font:600 14px/1.4 var(--b-font)}.profile-guest-name[hidden]{display:none}
#bolha-profile.connected .profile-guest-name:after{content:'';display:inline-block;width:6px;height:6px;border-radius:50%;background:#27d59b;margin:0 0 1px 6px}
.profile-stat:first-child span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:700px){
 #brand #place{display:none}
 body{--hud-map-space:0px}
 #phone{--mobile-phone-room:calc(100dvh - var(--bolha-profile-height,150px) - var(--hud-map-space) - 48px);height:min(610px,var(--mobile-phone-room));width:min(320px,calc(100vw - 40px),calc(var(--mobile-phone-room)/1.85))}
}
/* On short phones a full-height phone replaces the profile until dismissed; app targets stay usable. */
@media(max-width:700px) and (max-height:740px) and (orientation:portrait){
 #phone{height:calc(100dvh - 32px);width:min(320px,calc(100vw - 32px),calc((100dvh - 32px)/1.9));bottom:16px}
 .bolha-phone-open #bolha-profile{visibility:hidden}
}
@media(min-width:701px) and (min-height:501px) and (max-height:800px){
 #phone{position:fixed;right:calc(var(--bolha-hud-right) + var(--bolha-phone-width) + 14px);top:18px;height:min(440px,calc(100dvh - 36px));width:var(--bolha-phone-width)}
}

/* #46: rectangular minimap, the same width and frame as the profile. */
:root{--bolha-minimap:140px}
#minimap{width:100%;height:var(--bolha-minimap);border:1px solid var(--hud-edge);border-radius:15px;background:var(--hud-surface);box-shadow:0 8px 28px #0004;overflow:hidden;padding:0}
#minimap canvas{width:100%;height:100%;border-radius:0}
#minimap:focus-visible{outline:2px solid var(--hud-blue);outline-offset:3px}
@media(max-width:700px){:root{--bolha-minimap:140px}}
@media(max-height:500px) and (orientation:landscape){:root{--bolha-minimap:110px}}
/* Keep the existing turn banner readable below the mobile profile/map stack. */
@media(max-width:700px){
 body.bolha-hud #bolha-guide{top:calc(max(12px,env(safe-area-inset-top)) + var(--bolha-profile-height,150px) + var(--hud-map-space,0px) + var(--hud-gap));left:12px;right:12px;transform:none;max-width:calc(100vw - 24px);background:var(--hud-surface);border-color:var(--hud-edge)}
 body.bolha-phone-open #bolha-guide{visibility:hidden}
}

/* The phone HUD uses the safe corners for the map and profile. */
@media(pointer:coarse) and (max-width:700px),(pointer:coarse) and (orientation:landscape) and (max-height:500px){
 body.bolha-hud{
  --mobile-hud-top:max(12px,env(safe-area-inset-top));
  --mobile-hud-left:max(12px,calc(env(safe-area-inset-left) + 8px));
  --mobile-hud-right:max(12px,env(safe-area-inset-right));
  --mobile-hud-gap:12px;
  --mobile-profile-width:252px;
  --mobile-map-width:132px;
  --mobile-map-height:94px;
 }
 body.bolha-hud #brand{display:none}
 body.bolha-hud #minimap:not([hidden]){
  display:block;position:fixed;z-index:23;left:var(--mobile-hud-left);top:var(--mobile-hud-top);
  width:var(--mobile-map-width);height:var(--mobile-map-height);border-radius:16px;
 }
 body.bolha-hud:is(.bolha-phone-open,.bolha-chat-typing,.racer-touch-driving,.atelier-open) #minimap:not([hidden]){display:none}
}
@media(pointer:coarse) and (orientation:portrait) and (max-width:700px){
 body.bolha-hud{
  --mobile-profile-width:min(252px,calc(100vw - var(--mobile-hud-left) - var(--mobile-hud-right) - var(--mobile-hud-gap) - 80px));
  --mobile-map-width:calc(100vw - var(--mobile-hud-left) - var(--mobile-hud-right) - var(--mobile-profile-width) - var(--mobile-hud-gap));
  --mobile-map-height:clamp(96px,var(--bolha-profile-height,120px),150px);
  --mobile-map-row-end:calc(var(--mobile-hud-top) + max(var(--mobile-map-height),var(--bolha-profile-height,120px)) + var(--mobile-hud-gap));
 }
 body.bolha-hud.profile-compact:has(#minimap:not([hidden])) #bolha-profile{width:var(--mobile-profile-width)}
 body.bolha-hud:has(#minimap:not([hidden])) #bolha-guide{top:var(--mobile-map-row-end)}
 body.bolha-hud:not(.racer-touch-driving):has(#minimap:not([hidden])) #drive-hud{top:var(--mobile-map-row-end);left:var(--mobile-hud-left)}
 body.bolha-hud:not(.racer-touch-driving):has(#minimap:not([hidden])):has(#bolha-guide:not([hidden])) #drive-hud{top:calc(var(--mobile-map-row-end) + 86px)}
}
@media(pointer:coarse) and (orientation:landscape) and (max-height:500px){
 body.bolha-hud:not(.racer-touch-driving):has(#minimap:not([hidden])) #bolha-guide{
  left:calc(var(--mobile-hud-left) + var(--mobile-map-width) + var(--mobile-hud-gap));
  right:calc(var(--mobile-hud-right) + var(--mobile-profile-width) + var(--mobile-hud-gap));
  top:var(--mobile-hud-top);width:auto;max-width:none;transform:none;
 }
}
@media(pointer:coarse) and (orientation:landscape) and (max-height:500px) and (max-width:740px){
 body.bolha-hud:not(.racer-touch-driving):has(#minimap:not([hidden])) #bolha-guide{
  left:var(--mobile-hud-left);right:auto;
  width:min(300px,calc(100vw - var(--mobile-hud-left) - var(--mobile-hud-right) - 276px));
  top:calc(var(--mobile-hud-top) + max(var(--mobile-map-height),var(--bolha-profile-height,120px)) + var(--mobile-hud-gap));
 }
 body.bolha-hud:has(#drive-hud:not([hidden])) #minimap:not([hidden]){display:none}
}
@media(pointer:coarse) and (orientation:landscape) and (max-height:500px) and (min-width:741px){
 body.bolha-hud:not(.racer-touch-driving):has(#minimap:not([hidden])) #drive-hud{
  top:calc(var(--mobile-hud-top) + var(--mobile-map-height) + var(--mobile-hud-gap));left:var(--mobile-hud-left);
 }
}

/* Keep the mobile walking/turning area below an open phone (#116). */
@media(max-width:700px) and (orientation:portrait){
 body.bolha-phone-open #phone{bottom:calc(164px + env(safe-area-inset-bottom));height:min(470px,calc(100dvh - 276px));min-height:190px;width:min(300px,calc(100vw - 40px),calc((100dvh - 276px)/1.6))}
 body.bolha-phone-open #action{bottom:calc(122px + env(safe-area-inset-bottom))}
}

/* #120: edit the name where it is shown, without opening the phone. */
.profile-name-row{display:flex;align-items:center;gap:3px;min-width:0}
.profile-name-row #auth{flex:1}
#bolha-profile .profile-name-action{display:grid;place-items:center;flex:none;width:28px;height:30px;min-height:0;padding:5px;border:0;border-radius:7px;background:transparent;color:var(--hud-blue);cursor:pointer;box-shadow:none}
#bolha-profile .profile-name-action .hud-icon{width:16px;height:16px}
#bolha-profile .profile-name-action:hover{background:#91baff18}
#bolha-profile .profile-name-action:focus-visible{outline:2px solid var(--hud-blue);outline-offset:1px}
#bolha-profile .profile-name-action:disabled{opacity:.5;cursor:wait}
#bolha-profile .profile-name-action[hidden],.profile-name-editor[hidden]{display:none}
.profile-name-editor{display:grid;grid-template-columns:minmax(0,1fr) 28px 28px;gap:3px;margin:0 0 8px}
#bolha-profile .profile-name-editor input{min-width:0;width:100%;box-sizing:border-box;padding:6px 8px;background:#10243a;border:1px solid #6383aa;border-radius:7px;color:var(--hud-ink);font:16px/1.3 var(--b-font)}
.profile-name-editor input:focus{outline:2px solid var(--hud-blue);outline-offset:1px}
.profile-name-error{grid-column:1/-1;color:#ffbd9b;font:11px/1.4 var(--b-font);overflow-wrap:anywhere}
.profile-name-error:empty{display:none}
/* Backpack stays available through I; the permanent screen button is hidden. */
body.bolha-hud .market-bag-button{display:none!important}

/* #425 «Ночной город»: the phone's home is six apps under a balance row. Kept at the end of the file: the older phone
   rules above and in bolha-phone.css still size the shell. */
#phone.home main{flex-direction:column;gap:10px;overflow:auto}
#phone.home.analytics-access main:has(.phone-wallet-row){display:flex}
#phone.home .phone-apps{flex:none;grid-template-rows:none;grid-auto-rows:minmax(68px,auto);gap:8px;height:auto;min-height:0}
#phone .phone-apps.phone-work-apps{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:none;grid-auto-rows:minmax(68px,auto);gap:8px}
#phone .phone-apps button{gap:6px;padding:8px 2px;font:700 var(--b-t-xs)/1.15 var(--b-font);background:var(--b-raise)!important;border:1px solid var(--b-line);border-radius:var(--b-r)}
#phone .phone-apps button:hover{background:var(--b-btn)!important;border-color:var(--b-info)}
#phone .phone-apps button[data-app=house]:disabled{background:var(--b-panel)!important;border-color:var(--b-line);color:var(--b-muted)!important;cursor:default}
#phone .phone-apps button[data-app=house]:disabled .phone-icon{color:inherit}
#phone .phone-icon .hud-icon{width:28px;height:28px}
#phone .phone-wallet-row{order:-1;flex:none;display:flex;align-items:center;gap:10px;width:100%;min-height:var(--b-tap);padding:0 12px;background:var(--b-raise);border:1px solid var(--b-line);border-radius:var(--b-r);color:var(--b-ink);font-family:var(--b-font);text-align:left}
#phone .phone-wallet-row .hud-icon{color:var(--b-accent)}
#phone .phone-wallet-row b{font-size:var(--b-t-m);font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap}
#phone .phone-wallet-row small{margin-left:auto;color:var(--b-muted);font-size:var(--b-t-xs);font-weight:700}
#phone .phone-settings-links{display:grid;gap:8px;margin-bottom:14px}
#phone .phone-settings-links button{min-height:var(--b-tap);text-align:left;padding:0 12px;background:var(--b-raise);border:1px solid var(--b-line);border-radius:var(--b-r);color:var(--b-ink);font:700 var(--b-t-s)/1.2 var(--b-font)}
/* On a real phone the drawn handset (status bar, bezel) only eats room: a plain panel instead. */
@media(max-width:700px) and (orientation:portrait){
 #phone{width:min(420px,calc(100vw - 24px));border:1px solid var(--b-line);border-radius:var(--b-r-l);background:var(--b-panel);box-shadow:var(--b-shadow)}
 #phone .phone-status{display:none}
 #phone header{padding-top:8px}
}

/* #425: the HUD speaks Nunito like the windows; hints sit quieter, and the logo steps down when the robot button is shown. */
#help,#turn-help{font:600 var(--b-t-xs)/1.4 var(--b-font);color:var(--b-ink);opacity:.85}
body:has(#robot-monitor-toggle:not([hidden])) #brand{top:calc(max(14px,env(safe-area-inset-top)) + 44px)}

/* #425 mobile pass. In portrait the game phone is a panel as wide as the screen allows and as tall as its home screen needs;
   its bottom edge still stays above the joystick (#116). */
@media(max-width:700px) and (orientation:portrait){
 body.bolha-phone-open #phone{width:min(420px,calc(100vw - 24px))}
 body.bolha-phone-open #phone.home{height:auto;min-height:0}
 #phone.home main{padding-bottom:14px}
 #phone:after{display:none}
 .bolha-shop{top:max(5%,env(safe-area-inset-top));bottom:max(5%,env(safe-area-inset-bottom))}
}
/* Touch: nothing in the player card under 11 px, a finger-sized hit area on the two 24 px icons, and the joystick and toast
   clear of the notch and the home bar (iPhone X). */
@media(pointer:coarse){
 #bolha-profile .profile-place,#bolha-profile .online-place,#bolha-profile .voice-chip small,#bolha-online small,#bolha-online .online-name,#bolha-online .online-voice-label span,#bolha-online-toggle span,.profile-stat span{font-size:11px}
 #bolha-profile .profile-name-action,#bolha-profile #auth button{position:relative}
 #bolha-profile .profile-name-action::after,#bolha-profile #auth button::after{content:'';position:absolute;inset:-9px -2px}
 #stick{left:max(22px,calc(env(safe-area-inset-left) + 10px));bottom:max(28px,calc(env(safe-area-inset-bottom) + 14px))}
 #toast{top:calc(100px + env(safe-area-inset-top))}
}

/* #425 UX: the player card is a bar; everything rare opens under it. */
#bolha-profile .profile-header{margin-bottom:0}
#bolha-profile.more-open .profile-header{margin-bottom:8px}
#bolha-profile .profile-more-toggle{display:grid;place-items:center;flex:none;width:32px;height:36px;min-height:0;padding:0;border:0;border-radius:var(--b-r-s);background:transparent;color:var(--b-muted);box-shadow:none;cursor:pointer}
#bolha-profile .profile-more-toggle:hover{background:var(--b-raise);color:var(--b-ink)}
#bolha-profile .profile-more-toggle .hud-icon{width:18px;height:18px;transition:transform .15s}
#bolha-profile.more-open .profile-more-toggle .hud-icon{transform:rotate(180deg)}
#bolha-profile:not(.more-open) #auth:not(.profile-guest) button,#bolha-profile:not(.more-open) .bolha-roles-open{display:none}
#bolha-profile .profile-stats{display:flex}#bolha-profile .profile-stats>*{flex:1 1 0;min-width:0}
body.club-inside #bolha-profile .profile-more[hidden]{display:block}
@media(min-width:701px) and (min-height:501px) and (pointer:fine){body.bolha-hud #bolha-guide{max-width:min(560px,max(320px,calc(100vw - 780px)))}}
#bolha-profile .profile-header{gap:6px}
/* #425: no key list or hint text over the game; the keys live in the phone's settings. */
body.bolha-hud :is(#help,#turn-help){display:none!important}
/* #425 UX: on a desktop the phone is a handset by the HUD, as it always was (Arbi, 14.11.2026) — a little wider for the
   regrouped screens and in the interface's colours. Only the map leaves it for a wide window (below).
   #450: the player card, the phone and the minimap are one column of one width; on a screen under ~860 px high the minimap
   gives the phone 30 px of its height. */
@media(min-width:701px) and (min-height:501px) and (pointer:fine){
 :root{--bolha-phone-width:300px;--bolha-minimap:clamp(110px,calc(100dvh - 720px),140px);--bolha-phone-height:min(620px,calc(100dvh - var(--bolha-profile-height,64px) - var(--bolha-minimap) - 56px))}
}
#phone{border-color:#0a1422;background:var(--b-panel);box-shadow:0 0 0 1px var(--b-line),0 10px 28px #0007}
/* On a phone the bar is avatar, balance, microphone, sound and the chevron; the name and the fold button live in the sheet. */
body.profile-compact #bolha-profile:not(.more-open):not(:has(.profile-guest)) .profile-identity,body.profile-compact #bolha-profile:not(.more-open) .profile-fold{display:none}

/* #425 UX: the map — a side list (search, groups, distance) and the map with the chosen place's card. */
#phone .bolha-map{display:flex;flex-direction:column;gap:10px}
#phone .bolha-map button{margin:0;font-family:var(--b-font)}
#phone .map-main{position:relative;display:flex;flex-direction:column;gap:8px;min-width:0}
/* #428: the map fills its frame (the window's height on a computer, a square in the portrait phone); drag, wheel, pinch, buttons. */
#phone .map-view{position:relative;width:100%;aspect-ratio:1;border:1px solid var(--b-line);border-radius:var(--b-r);overflow:hidden;background:#0a141e}
#phone .bolha-map canvas{position:absolute;inset:0;display:block;width:100%;height:100%;touch-action:none;cursor:grab}
#phone .bolha-map canvas.drag{cursor:grabbing}
#phone .map-zoom{position:absolute;right:8px;bottom:8px;display:flex;flex-direction:column;gap:6px}
#phone .map-zoom button{display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid var(--b-line);border-radius:var(--b-r-s);background:var(--b-panel);color:var(--b-ink);box-shadow:var(--b-shadow);cursor:pointer}
#phone .map-zoom button:hover{background:var(--b-raise)}
#phone .map-zoom .hud-icon{width:18px;height:18px}
#phone .map-scale{position:absolute;left:8px;bottom:8px;display:flex;flex-direction:column;gap:3px;padding:5px 8px;border-radius:var(--b-r-s);background:#0d1626cc;color:var(--b-ink);font:800 11px/1 var(--b-font);font-variant-numeric:tabular-nums;pointer-events:none}
#phone .map-scale i{display:block;height:5px;border:2px solid var(--b-ink);border-top:0}
#phone .map-badge{display:grid;place-items:center;flex:none;width:26px;height:26px;border-radius:50%;color:#fff}
#phone .map-badge svg{width:15px;height:15px}
#phone .map-card .map-badge{width:36px;height:36px}
#phone .map-card .map-badge svg{width:20px;height:20px}
#phone .map-tools{position:absolute;top:8px;left:8px;display:flex;align-items:center;gap:8px}
#phone .map-tools button,#phone .map-tools label{display:flex;align-items:center;gap:6px;min-height:32px;margin:0;padding:0 10px;border:1px solid var(--b-line);border-radius:var(--b-r-s);background:var(--b-panel);color:var(--b-ink);font:700 12px/1 var(--b-font)}
#phone .map-card{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 12px;border:1px solid var(--b-line);border-radius:var(--b-r);background:var(--b-raise)}
#phone .map-card:empty{display:none}
#phone .map-card>div:first-of-type{flex:1 1 140px;min-width:0;display:flex;flex-direction:column;gap:2px}
#phone .map-card b{font:800 var(--b-t-m)/1.2 var(--b-font)}
#phone .map-card small{color:var(--b-muted);font:700 var(--b-t-xs)/1.3 var(--b-font)}
#phone .map-card-actions{display:flex;gap:8px;flex-wrap:wrap}
#phone .map-card-actions button{min-height:var(--b-tap);padding:0 14px;border:1px solid var(--b-line);border-radius:var(--b-r);background:var(--b-btn);color:var(--b-ink);font:800 var(--b-t-s)/1 var(--b-font)}
#phone .map-card-actions button.pri{background:var(--b-accent);border-color:var(--b-accent);color:var(--b-accent-ink)}
#phone .map-side{display:flex;flex-direction:column;gap:8px;min-height:0}
#phone .map-side input[type=search]{min-height:var(--b-tap);padding:0 12px;border:1px solid var(--b-line);border-radius:var(--b-r-s);background:var(--b-well);color:var(--b-ink);font:700 var(--b-t-s)/1 var(--b-font)}
#phone .map-groups{display:flex;gap:6px;flex-wrap:wrap}
#phone .map-groups button{display:flex;align-items:center;gap:6px;min-height:32px;padding:0 10px;border:1px solid var(--b-line);border-radius:var(--b-r-s);background:var(--b-raise);color:var(--b-muted);font:800 12px/1 var(--b-font)}
#phone .map-groups button[aria-pressed=true]{background:var(--b-accent);border-color:var(--b-accent);color:var(--b-accent-ink)}
#phone .map-groups button i{width:8px;height:8px;border-radius:50%;box-shadow:0 0 0 1px #0004}
#phone .map-places{display:grid;gap:2px;align-content:start;overflow:auto;min-height:0;max-height:220px}
#phone .map-places p{margin:8px;color:var(--b-muted)}
#phone .map-places button{display:flex;align-items:center;gap:10px;min-height:40px;padding:0 8px;text-align:left;border:1px solid transparent;border-radius:var(--b-r-s);background:transparent;color:var(--b-ink);font:700 13px/1.2 var(--b-font)}
#phone .map-places button .hud-icon{width:20px;height:20px;color:var(--b-info)}
#phone .map-places button span:not(.map-badge){flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#phone .map-places button small{color:var(--b-muted);font-size:var(--b-t-xs);font-variant-numeric:tabular-nums;white-space:nowrap}
#phone .map-places button.on{background:var(--b-raise);border-color:var(--b-accent)}
/* Desktop: the map is a wide window, list on the left. */
@media(min-width:901px) and (min-height:501px){
 #bolha-phone-dock #phone.map-app{position:fixed;left:50%;top:50%;right:auto;bottom:auto;transform:translate(-50%,-50%);width:min(940px,calc(100vw - 48px));height:min(660px,calc(100dvh - 72px));min-height:0;border:1px solid var(--b-line);border-radius:var(--b-r-l);box-shadow:var(--b-shadow-modal)}
 #phone.map-app .phone-status,#phone.map-app:after{display:none}
 #phone.map-app header{padding:10px 12px}
 #phone.map-app main{padding:14px;font-size:14px}
 #phone.map-app main{overflow:hidden;display:flex}
 #phone.map-app .bolha-map{flex:1;min-height:0;display:grid;grid-template-columns:280px minmax(0,1fr);gap:14px}
 #phone.map-app .map-side{order:-1}
 #phone.map-app .map-places{max-height:none;flex:1}
 #phone.map-app .map-main{min-height:0}
 #phone.map-app .map-view{flex:1 1 0;min-height:0;aspect-ratio:auto}
}
/* Taxi on its way: one line in the HUD with the way to cancel. */
#bolha-taxi-status{position:fixed;left:50%;transform:translateX(-50%);top:calc(max(12px,env(safe-area-inset-top)) + 62px);z-index:15;display:flex;align-items:center;gap:10px;min-height:var(--b-tap);padding:0 6px 0 14px;border:1px solid var(--b-line);border-radius:var(--b-r-l);background:var(--b-panel);color:var(--b-ink);font:800 var(--b-t-s)/1 var(--b-font);box-shadow:var(--b-shadow);white-space:nowrap}
#bolha-taxi-status[hidden]{display:none}
#bolha-taxi-status .hud-icon{width:20px;height:20px;color:var(--b-accent)}
#bolha-taxi-status button{min-height:32px;padding:0 10px;border:1px solid #7a3a3a;border-radius:var(--b-r-s);background:transparent;color:#ff9a92;font:800 12px/1 var(--b-font);cursor:pointer}
@media(max-width:700px){#bolha-taxi-status{top:auto;bottom:calc(150px + env(safe-area-inset-bottom))}}
/* Phone in portrait: the game phone fills the screen (walking waits until it is closed); two columns of apps. */
@media(max-width:700px) and (orientation:portrait){
 body.bolha-phone-open #phone,body.bolha-phone-open #phone.home{left:0;right:0;top:0;bottom:0;transform:none;width:auto;height:auto;min-height:0;border:0;border-radius:0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}
 #phone.home .phone-apps{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(76px,auto);gap:10px}
 #phone .phone-apps button{font-size:var(--b-t-s)}
 #phone header{padding:10px 14px}#phone main{padding:14px}
 #phone .map-places{max-height:none}
}
/* #425 UX fixes after the first look on a phone: the list keeps its distance column, the map comes first, the full-screen
   phone sits above every HUD button, and the bar needs no fold button. */
#phone .map-places{grid-template-columns:minmax(0,1fr)}
body.profile-compact #bolha-profile .profile-fold{display:none}
@media(max-width:700px) and (orientation:portrait){
 #phone .map-main{order:-1}
 body.bolha-phone-open #bolha-phone-dock{z-index:70}
}

/* #425 UX: «Работа» — three cards with a state line; steps instead of paragraphs inside a job. */
#phone .phone-work-cards{display:grid;gap:10px}
#phone .phone-work-card{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;column-gap:12px;row-gap:2px;align-items:center;min-height:68px;padding:10px 14px;text-align:left;border:1px solid var(--b-line);border-radius:var(--b-r);background:var(--b-raise);color:var(--b-ink);font:800 var(--b-t-m)/1.2 var(--b-font)}
#phone .phone-work-card:hover{background:var(--b-btn);border-color:var(--b-info)}
#phone .phone-work-card .phone-icon{grid-row:1/3;color:var(--b-info)}
#phone .phone-work-card[data-app=taxiWork] .phone-icon{color:var(--b-accent)}
#phone .phone-work-card>span:nth-child(2){align-self:end}
#phone .phone-work-card small{grid-column:2;align-self:start;color:var(--b-muted);font:700 var(--b-t-xs)/1.3 var(--b-font)}
#phone .phone-work-card>span:nth-child(2):last-child{grid-row:1/3;align-self:center}
#phone .phone-steps{margin:0 0 12px;padding:0;list-style:none;counter-reset:step;display:grid;gap:8px}
#phone .phone-steps li{counter-increment:step;display:grid;grid-template-columns:28px 1fr;gap:10px;align-items:start;font:700 var(--b-t-s)/1.35 var(--b-font);color:var(--b-ink)}
#phone .phone-steps li::before{content:counter(step);display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--b-raise);border:1px solid var(--b-line);color:var(--b-accent);font:800 13px/1 var(--b-font)}
#phone details{margin:12px 0;color:var(--b-muted);font:700 var(--b-t-xs)/1.45 var(--b-font)}
#phone details summary{cursor:pointer;color:var(--b-info);font-size:var(--b-t-s)}
#phone details p{margin:8px 0 0}

/* #425 UX: wallet, garage, shop. */
#phone .wallet-row{display:flex;align-items:baseline;gap:12px;min-height:40px;padding:8px 0;border-bottom:1px solid var(--b-line);font:700 var(--b-t-s)/1.3 var(--b-font)}
#phone .wallet-row span{color:var(--b-muted);flex:none;width:84px}
#phone .wallet-row b{flex:1;min-width:0;font-weight:800;color:var(--b-ink)}
#phone .wallet-wear{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
#phone :is(.phone-house,.phone-house-sale) h2{margin:0 0 4px}
#phone .phone-house>p{margin:0 0 16px;color:var(--b-muted)}
#phone .phone-house>button{display:block;width:100%;min-height:var(--b-tap);margin:0 0 8px;padding:8px 12px}
#phone .phone-house>button.pri{background:var(--b-accent);border-color:var(--b-accent);color:var(--b-accent-ink)}
#phone .phone-house>.house-garage{text-align:left;background:var(--b-raise);border:1px solid var(--b-line)}
#phone .house-garage::after{content:'›';float:right;color:var(--b-info)}
#phone .phone-house>.house-sale-link{margin-top:16px;background:transparent;border:1px solid var(--b-line);color:#f2a9aa}
#phone .house-sale-refund{display:grid;gap:4px;margin:14px 0 10px;padding:12px;background:var(--b-well);border:1px solid var(--b-line);border-radius:var(--b-r)}
#phone .house-sale-refund strong{font-size:var(--b-t-l);font-variant-numeric:tabular-nums}
#phone .house-sale-refund span,#phone .phone-house-sale>p{color:var(--b-muted);font-size:var(--b-t-s)}
#phone .phone-house-sale>p{margin:10px 0 16px}
#phone .house-sale-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#phone .house-sale-actions button{min-height:var(--b-tap);padding:8px 6px;font-weight:800;border:1px solid var(--b-line);background:var(--b-raise)}
#phone .house-sale-actions .bad{background:#96343b;border-color:var(--b-bad);color:#fff}
#phone .garage-balance{margin:0 0 8px;color:var(--b-muted)}
#phone .garage-car{padding:7px 0;border-bottom:1px solid var(--b-line)}
#phone .garage-summary{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:6px}
#phone .garage-dot{width:12px;height:12px;border-radius:50%;box-shadow:0 0 0 1px #8aa0b2}
#phone .garage-info{display:grid;gap:2px;overflow-wrap:anywhere}
#phone .garage-info b{font:800 var(--b-t-m)/1.2 var(--b-font)}
#phone .garage-info small,#phone .garage-why{color:var(--b-muted);font-size:var(--b-t-xs)}
#phone .garage-actions{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 2px;padding-left:18px}
#phone .garage-actions[hidden]{display:none}
#phone .garage-why{flex-basis:100%}
#phone .garage-summary button,#phone .garage-actions button{min-height:40px;padding:6px 8px;font:800 var(--b-t-xs)/1.2 var(--b-font);border:1px solid var(--b-line);border-radius:var(--b-r);background:var(--b-raise);color:var(--b-ink)}
#phone .garage-summary .garage-route{display:grid;place-items:center;width:40px;padding:0;color:var(--b-info)}
#phone .garage-route .hud-icon{width:18px;height:18px}
#phone .garage-more[aria-expanded=true]{background:var(--b-btn)}
#phone .garage-actions button.bad{background:#96343b;border-color:var(--b-bad);color:#fff}
.wallet-balance{display:inline-flex;align-items:center;min-height:36px;margin:0 0 12px;padding:0 12px;border:1px solid var(--b-line);border-radius:var(--b-r);background:var(--b-well);font:800 var(--b-t-m)/1 var(--b-font);font-variant-numeric:tabular-nums}
.bolha-shop .wallet-item{display:grid;grid-template-columns:1fr auto;gap:4px 12px;align-items:center;padding:12px 0;border-bottom:1px solid var(--b-line)}
.bolha-shop .wallet-item p{margin:0;grid-column:1;color:var(--b-muted);font-variant-numeric:tabular-nums}
.bolha-shop .wallet-item button{grid-column:2;grid-row:1/3}
.wallet-why{grid-column:1/-1;color:var(--b-bad);font:700 var(--b-t-xs)/1.3 var(--b-font)}
.wallet-confirm{padding:14px;border:1px solid var(--b-accent);border-radius:var(--b-r);background:var(--b-raise);color:var(--b-ink)}
.wallet-confirm p{margin:0 0 10px;font-weight:800}
.wallet-confirm button.pri{background:var(--b-accent);color:var(--b-accent-ink);box-shadow:none}
/* A shop window is as tall as its goods, not always most of the screen. */
@media(min-width:701px){.bolha-shop{bottom:auto;max-height:84%}}

/* #425 UX: people — tabs in «Друзья», chat bubbles and the voice switch in the interface's colours. */
#phone .phone-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:3px;margin-bottom:12px;border:1px solid var(--b-line);border-radius:var(--b-r);background:var(--b-well)}
#phone .phone-tabs button{min-height:36px;padding:0 4px;border:0;border-radius:var(--b-r-s);background:transparent;color:var(--b-muted);font:800 13px/1.1 var(--b-font);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#phone .phone-tabs button[aria-pressed=true]{background:var(--b-raise);color:var(--b-ink)}
#phone .phone-contact{display:grid;grid-template-columns:1fr auto;gap:2px 8px;align-items:center;padding:10px 0;border-bottom:1px solid var(--b-line)}
#phone .phone-contact b{font:800 var(--b-t-s)/1.2 var(--b-font)}
#phone .phone-contact small{grid-column:1;margin:0;color:var(--b-muted);font-size:var(--b-t-xs)}
#phone .phone-contact button{grid-column:2;margin:0;min-height:36px;padding:0 12px;border:1px solid var(--b-line);border-radius:var(--b-r);background:var(--b-btn);color:var(--b-ink);font:800 12px/1 var(--b-font)!important}
#phone .phone-contact button.phone-subtle{background:transparent!important;color:var(--b-muted)!important}
#phone .phone-contact b+small+button{grid-row:1/3}
#phone .phone-messages{height:auto;min-height:160px;max-height:46dvh}
#phone .phone-messages p{max-width:86%;padding:8px 12px;border-radius:14px;font:600 var(--b-t-s)/1.4 var(--b-font)}
#phone .phone-received{background:var(--b-raise);border-bottom-left-radius:4px}
#phone .phone-sent{background:#1f4f4a;border-bottom-right-radius:4px}
#phone.voice-app .voice-tabs{background:var(--b-well);border:1px solid var(--b-line);border-radius:var(--b-r)}
#phone.voice-app .voice-tabs button{min-height:36px;font:800 13px/1.1 var(--b-font);color:var(--b-muted)}
#phone.voice-app .voice-tabs button[aria-pressed=true]{background:var(--b-raise);color:var(--b-ink);box-shadow:none}

/* #425 UX: settings in sections; graphics as three presets. */
#phone .phone-settings-section{margin:0 0 8px;border:1px solid var(--b-line);border-radius:var(--b-r);background:var(--b-well);color:var(--b-ink);font:700 var(--b-t-s)/1.4 var(--b-font)}
#phone .phone-settings-section>summary{display:flex;align-items:center;min-height:var(--b-tap);padding:0 14px;list-style:none;cursor:pointer;color:var(--b-ink);font:800 var(--b-t-m)/1 var(--b-font)}
#phone .phone-settings-section>summary::-webkit-details-marker{display:none}
#phone .phone-settings-section>summary::after{content:'';margin-left:auto;width:8px;height:8px;border-right:2px solid var(--b-muted);border-bottom:2px solid var(--b-muted);transform:rotate(45deg);transition:transform .15s}
#phone .phone-settings-section[open]>summary::after{transform:rotate(-135deg)}
#phone .phone-settings-section[open]>summary{border-bottom:1px solid var(--b-line)}
#phone .phone-settings-section>:not(summary){margin-left:14px;margin-right:14px}
#phone .phone-settings-section>:nth-child(2){margin-top:12px}
#phone .phone-settings-section>:last-child{margin-bottom:14px}
#phone .phone-settings-section label{margin:12px 14px}
#phone .phone-settings-section .phone-settings-links{margin-bottom:14px}
#phone .phone-presets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
#phone .phone-presets button{min-height:var(--b-tap);padding:0 4px;border:1px solid var(--b-line);border-radius:var(--b-r);background:var(--b-raise);color:var(--b-ink);font:800 13px/1.15 var(--b-font)}
#phone .phone-presets button[aria-pressed=true]{background:var(--b-accent);border-color:var(--b-accent);color:var(--b-accent-ink)}
#phone .phone-settings-section .phone-note{color:var(--b-muted);font-size:var(--b-t-xs)}

/* #425 UX: first steps for a newcomer. */
#bolha-intro{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(96px + env(safe-area-inset-bottom));z-index:30;display:grid;grid-template-columns:1fr auto auto;gap:6px 10px;align-items:center;width:min(380px,calc(100vw - 24px));padding:14px;border:1px solid var(--b-accent);border-radius:var(--b-r-l);background:var(--b-panel);color:var(--b-ink);box-shadow:var(--b-shadow-modal);font-family:var(--b-font)}
#bolha-intro b{grid-column:1/-1;font:800 var(--b-t-m)/1.2 var(--b-font)}
#bolha-intro p{grid-column:1/-1;margin:0 0 6px;color:var(--b-ink);font:600 var(--b-t-s)/1.4 var(--b-font)}
#bolha-intro small{color:var(--b-muted);font:700 var(--b-t-xs)/1 var(--b-font)}
#bolha-intro button{min-height:40px;padding:0 14px;border:1px solid var(--b-accent);border-radius:var(--b-r);background:var(--b-accent);color:var(--b-accent-ink);font:800 var(--b-t-s)/1 var(--b-font);cursor:pointer}
#bolha-intro button.skip{border-color:transparent;background:transparent;color:var(--b-muted)}
@media(max-width:700px) and (orientation:portrait){#bolha-intro{bottom:calc(200px + env(safe-area-inset-bottom))}}
body:is(.bolha-phone-open,.atelier-open,.theater-inside,.racer-touch-driving) #bolha-intro{display:none}
/* #425 UX: a phone held sideways — the game phone fills the screen too, the map keeps its two columns, the route line is one line. */
@media(max-height:500px) and (orientation:landscape){
 body.bolha-phone-open #phone,body.bolha-phone-open #phone.home{left:0;right:0;top:0;bottom:0;transform:none;width:auto;height:auto;max-height:none;min-height:0;border:0;border-radius:0;padding:0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
 body.bolha-phone-open #bolha-phone-dock{z-index:70}
 #phone .phone-status,#phone:after{display:none}
 #phone header{padding:8px 14px}#phone main{padding:10px 14px}
 #phone.home .phone-apps{grid-template-columns:repeat(4,minmax(0,1fr))}
 #phone.map-app main{overflow:hidden;display:flex}
 #phone.map-app .bolha-map{flex:1;min-height:0;display:grid;grid-template-columns:240px minmax(0,1fr);gap:12px}
 #phone.map-app .map-side{order:-1}
 #phone.map-app .map-places{max-height:none;flex:1}
 #phone.map-app .map-main{min-height:0}
 #phone.map-app .map-view{flex:1 1 0;min-height:0;aspect-ratio:auto}
 body.bolha-hud #bolha-guide{padding:6px 6px 6px 12px}
 body.bolha-hud #bolha-guide .route-text b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}

/* #425 UX: the open player card is mostly the roster. One line for the name with rename and sign-out, one row for the timer
   and the voice mode, then people — a line each, so a dozen fit where three did. */
#bolha-profile.more-open .profile-header{margin-bottom:4px}
#bolha-profile.more-open .profile-identity{display:flex;align-items:center;gap:8px;min-width:0}
#bolha-profile.more-open .profile-name-row{flex:1;min-width:0}
#bolha-profile.more-open .profile-place{flex:none;max-width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#bolha-profile.more-open #auth:not(.profile-guest) button{width:28px;height:28px;padding:4px;border:0;background:transparent}
#bolha-profile .profile-stats{gap:6px;margin:0 0 6px;padding:0;border:0;background:transparent}
#bolha-profile .profile-stats>button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:34px;width:auto;margin:0;padding:0 10px;border:1px solid var(--b-line);border-radius:var(--b-r-s);background:var(--b-raise);color:var(--b-ink);font:700 12px/1 var(--b-font);text-align:center}
#bolha-profile #bolha-online .online-header{min-height:0}
#bolha-profile #bolha-online #bolha-online-toggle{min-height:30px;padding:0 4px}
#bolha-profile #bolha-online .online-player{min-height:0;padding:4px;gap:8px;align-items:center}
#bolha-profile #bolha-online .online-avatar{width:26px;height:26px;border-radius:7px}
#bolha-profile #bolha-online .online-info{display:flex;align-items:baseline;gap:6px;min-width:0;flex:1}
#bolha-profile #bolha-online .online-name{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 13px/1.2 var(--b-font)}
#bolha-profile #bolha-online .online-meta{flex:1 1 0;min-width:0;display:flex;align-items:center;gap:4px;margin:0;overflow:hidden}
#bolha-profile #bolha-online .online-place{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
#bolha-profile #bolha-online .online-voice-label{padding:0;border:0;background:transparent}
#bolha-profile #bolha-online .online-voice-label span,#bolha-profile #bolha-online .online-states .voice-chip small{display:none}
#bolha-profile #bolha-online .online-states .voice-chip{min-width:0;width:22px;height:22px;min-height:0;padding:0;border:0;background:transparent}
#bolha-profile.more-open .bolha-roles-open{display:inline-flex;align-items:center;justify-content:center;width:auto;min-height:32px;margin:6px 6px 0 0;padding:0 10px;font:700 12px/1 var(--b-font)}
body #bolha-profile #bolha-online #bolha-online-list .online-player{height:auto;min-height:34px;padding:4px}
/* #427: the player card in two rows — avatar | name, then your mic, speaker, voice mode and timer. No balance, no places
   (the phone has the wallet, the map has positions); sign-out lives in the phone's settings; the roster shows up to eight. */
body:not(.profile-compact) #bolha-profile .profile-header{display:grid;grid-template-columns:44px minmax(0,1fr) auto;column-gap:10px;row-gap:8px;align-items:center;margin-bottom:8px}
body:not(.profile-compact) #bolha-profile .profile-avatar{grid-row:1;grid-column:1;width:44px;height:44px;border-radius:10px}
body:not(.profile-compact) #bolha-profile .profile-identity{grid-row:1;grid-column:2;order:0}
body:not(.profile-compact) #bolha-profile .profile-fold{grid-row:1;grid-column:3}
body:not(.profile-compact) #bolha-profile .profile-header>.profile-stats{grid-row:2;grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;min-width:0}
body:not(.profile-compact) #bolha-profile .profile-more-toggle{display:none}
#bolha-profile .profile-header>.profile-stats>button{flex:none;min-height:32px;padding:0 9px}#bolha-profile .profile-header>.profile-stats>.profile-header-audio{flex:none}
#bolha-profile .profile-header>.profile-stats>.profile-stat{margin-left:auto}
/* #472: leave room for the pause label; narrow cards can put the timer on the next line. */
body:not(.profile-compact) #bolha-profile .profile-header>.profile-stats>.profile-stat{flex:1 1 100px;max-width:100%;line-height:1.3;white-space:normal}
#bolha-profile .profile-header .online-voice-mode{display:flex;align-items:center;gap:6px;min-width:0;border:1px solid var(--b-line);border-radius:var(--b-r-s);background:var(--b-raise);color:var(--b-ink);font:700 13px/1 var(--b-font);cursor:pointer}
#bolha-profile .profile-header .online-voice-mode .online-mode-icon{display:grid;color:var(--b-info)}#bolha-profile .profile-header .online-voice-mode .hud-icon{width:16px;height:16px}
#bolha-profile .profile-header .online-mode-full{display:none}#bolha-profile .profile-header .online-mode-short{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#bolha-profile .profile-header-audio .online-controls .voice-chip{width:32px;height:32px}
#bolha-profile .profile-header button.profile-avatar{position:relative;overflow:visible} /* the online dot sits over the rim, not clipped */
/* The balance: a plain line under the name — the wallet icon and the sum, no box; a tap opens the wallet. */
body.bolha-hud #bolha-profile .profile-identity{display:flex;flex-direction:column;align-items:stretch;gap:1px;min-width:0}
#bolha-profile .profile-balance{display:inline-flex;align-self:flex-start;align-items:center;gap:5px;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;color:var(--b-ink);font:700 12px/1.25 var(--b-font);font-variant-numeric:tabular-nums;text-align:left;cursor:pointer}
#bolha-profile .profile-balance .hud-icon{width:14px;height:14px;color:var(--b-accent)}
#bolha-profile .profile-balance{max-width:100%;white-space:nowrap}#bolha-profile .profile-balance span{min-width:0;overflow:hidden;text-overflow:ellipsis}
body.profile-compact #bolha-profile .profile-balance .hud-icon{display:none} /* the phone's bar is narrow: the sum alone */
#bolha-profile:has(#auth.profile-guest) .profile-balance{display:none} /* #450: a guest has no wallet, «Войти» is right above */
#bolha-profile .profile-balance:hover{color:var(--b-accent)}#bolha-profile .profile-balance:focus-visible{outline:2px solid var(--b-info);outline-offset:2px}
#bolha-profile.connected #auth>span:after,#bolha-profile.connected .profile-guest-name:after{display:none}
#bolha-profile.connected .profile-avatar::after{content:'';position:absolute;right:-3px;bottom:-3px;width:9px;height:9px;border-radius:50%;background:#27d59b;border:2px solid var(--b-panel)}
#bolha-profile #auth:not(.profile-guest)>button:not(.profile-name-action){display:none}
@media(hover:hover){#bolha-profile .profile-name-row .profile-name-action{opacity:0;transition:opacity .15s}#bolha-profile .profile-name-row:hover .profile-name-action,#bolha-profile .profile-name-row .profile-name-action:is(:focus-visible,[aria-expanded="true"]){opacity:1}}
body.profile-compact #bolha-profile:not(.more-open):not(:has(.profile-guest)) .profile-identity{display:block;flex:1;min-width:0}
#bolha-profile #bolha-online .online-avatar{width:24px;height:24px;border-radius:6px}
/* Always show the microphone state; only an enabled speaker needs no extra mark. */
body:not(.club-inside) #bolha-profile #bolha-online .online-states .voice-chip[data-kind=speaker].on{display:none}
body:not(.club-inside) #bolha-profile #bolha-online .online-states .voice-chip[data-kind=mic].on{color:#39ce9d}
body:not(.club-inside) #bolha-profile #bolha-online .online-states .voice-chip[data-kind=speaker].off{color:var(--b-muted)}
#bolha-profile #bolha-online .online-voice-label{color:var(--b-muted)}
#bolha-profile #bolha-online .online-more{display:block;width:100%;min-height:30px;margin:0;padding:0 4px;border:0;border-top:1px solid #6d91b122;border-radius:0;background:transparent;color:var(--b-info);font:700 12px/1 var(--b-font);text-align:left;box-shadow:none;cursor:pointer}
#bolha-profile #bolha-online .online-more:hover{color:var(--b-ink)}
body.bolha-hud.profile-compact #bolha-profile #auth:not(.profile-guest){display:flex;align-items:center;gap:4px}
body.bolha-hud.profile-compact #bolha-profile #auth:not(.profile-guest)>span{flex:1;min-width:0}
/* #425 (Арби): no white captions over the game — the logo and the place line go too; where everyone is shows on the map (#427). */
body.bolha-hud #brand{display:none}

#phone .wallet-confirm.house-sale-confirm{background:var(--b-raise);color:var(--b-ink);border-color:var(--b-accent)}
