/* Shared handset and app screens, whether floating over the map or paired. */
dialog#gamePhone{position:fixed;inset:0;margin:auto;width:min(430px,calc(100vw - 16px));height:fit-content;max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 14px);padding:24px 0 0;border:0;background:transparent;box-shadow:none;overflow:visible;color:#fff0da}
dialog#gamePhone::backdrop{background:#120b20ba;backdrop-filter:blur(7px)}
#gamePhone #phoneCompanion{padding:0;width:100%;max-width:none}
#gamePhone .phone-shell-close{position:absolute;right:3px;top:-8px;z-index:3;width:32px;height:32px;min-height:32px;padding:0;border:1px solid #d4b6e4;border-radius:50%;background:#34203f;color:#fff0d8;font-size:24px;line-height:1}
#phoneCompanion .phone-homescreen{height:min(610px,calc(100dvh - 190px));max-height:680px;overflow:auto;scrollbar-width:thin;scrollbar-color:#9875a7 transparent;overscroll-behavior:contain}
#phoneCompanion .phone-home-heading h1{font-size:27px}
#phoneCompanion .phone-wallet{margin:16px 0 21px;padding:10px}
#phoneCompanion .companion-actions{gap:18px 10px}
#phoneCompanion .companion-actions .phone-app{min-height:100px;gap:9px}
#phoneCompanion .phone-map-dock{margin-top:15px;padding-top:12px}
#phoneCompanion .phone-home-note{margin:12px 0 0}
#phoneCompanion .phone-homescreen.phone-app-open{padding:0;overflow:hidden}
#phoneCompanion .phone-app-view{display:flex;height:100%;flex-direction:column;min-height:0}
#phoneCompanion [hidden]{display:none!important}
#phoneCompanion .phone-appbar{display:flex;align-items:center;gap:8px;min-height:51px;flex-shrink:0;padding:8px 10px;border-bottom:1px solid #b89ac638;background:#38233f}
#phoneCompanion .phone-appbar [data-phone-home]{padding:3px 6px;min-height:34px;border:0;background:transparent;color:#f3d47b;box-shadow:none;font-size:22px;display:flex;gap:4px;align-items:center}
#phoneCompanion .phone-appbar [data-phone-home] span{font-size:11px}
#phoneCompanion .phone-appbar strong{flex:1;text-align:center;font-size:13px;font-weight:800;letter-spacing:.2px}
#phoneCompanion .phone-signal{color:#b5dfd2;font-size:18px;padding:0 5px}
#phoneCompanion .phone-view-content{padding:16px 14px;min-height:0;flex:1;overflow:auto;overscroll-behavior:contain}
#phoneCompanion .phone-view-content:has(#phoneAppFrame:not([hidden])){padding:0;overflow:hidden}
#phoneCompanion #phoneAppFrame{width:100%;height:100%;min-height:100%;border:0;background:#30203d;display:block}
#phoneCompanion .phone-view-content dialog{position:static;inset:auto;display:block;width:100%;max-width:none;max-height:none!important;height:auto;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:#fff0da;overflow:visible}
#phoneCompanion .phone-view-content dialog>.close{display:none}
#phoneCompanion .phone-view-content dialog>.kicker{font-size:8px;letter-spacing:1.4px;color:#d5b5e2}
#phoneCompanion .phone-view-content h2{font-size:26px;line-height:1.12;margin:12px 0 20px;letter-spacing:-.7px}
#phoneCompanion .phone-view-content h3{font-size:15px;margin:22px 0 12px;color:#f4d687}
#phoneCompanion .phone-view-content p{font-size:12px;line-height:1.5;color:#dbc9e3}
#phoneCompanion .phone-view-content button{min-height:42px;padding:9px 12px;font-size:12px;border-radius:12px;background:#5a3d69;color:#fff1db;border:1px solid #b699c34d;box-shadow:none}
#phoneCompanion .phone-view-content input,#phoneCompanion .phone-view-content textarea{font-size:16px;line-height:1.4;border-radius:11px;background:#f8efdb;color:#33213d}
#phoneCompanion #nameForm{gap:8px;grid-template-columns:minmax(0,1fr) auto;align-items:end}
#phoneCompanion #nameForm button{margin-bottom:8px;background:#edc85e;color:#30203d;border:0}
#phoneCompanion .profile-photo-editor{display:grid;grid-template-columns:82px minmax(0,1fr);gap:8px 12px;align-items:center;margin-bottom:18px;padding:12px;background:#4e345d65;border:1px solid #bb9acc33;border-radius:18px}
#phoneCompanion .profile-photo-editor .profile-photo{width:78px;height:78px;max-width:78px;grid-column:1;grid-row:1/3;border:2px solid #f0cf6c;margin:0;object-fit:cover;border-radius:50%;font-size:10px;text-align:center}
#phoneCompanion .profile-photo-editor label{grid-column:2;font-size:10px;min-width:0}
#phoneCompanion .profile-photo-editor input[type=file]{width:100%;font-size:9px;padding:5px;margin:5px 0 0;background:#291b35;color:#e4d1eb;border:1px solid #a889bc55}
#phoneCompanion .profile-photo-editor input::file-selector-button{font-size:10px;border:0;border-radius:6px;padding:6px;background:#f4ce66;color:#35213f;margin-right:5px}
#phoneCompanion .profile-photo-editor button{grid-column:2;justify-self:start;min-height:32px;font-size:10px;padding:6px 9px}
#phoneCompanion .profile-photo-editor p{grid-column:1/-1;margin:0;empty-cells:hide}
#phoneCompanion #stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:18px 0}
#phoneCompanion #stats>div{padding:13px;border-radius:14px;border:1px solid #d2b4e133;background:linear-gradient(130deg,#6c4b7d70,#36233f)}
#phoneCompanion #stats strong{font-size:25px;color:#f2cf68}
#phoneCompanion #stats span{font-size:9px;color:#ddc9e8}
#phoneCompanion .profile-links{gap:7px;grid-template-columns:1fr 1fr}
#phoneCompanion .profile-links a{font-size:11px;line-height:1.4;color:#e1c3ef;padding:9px 0}
#phoneCompanion #gameCards article{padding:15px 0}
#phoneCompanion #gameCards article h3{margin-top:8px}
#phoneCompanion .phone-view-content:has(.companion-chat:not([hidden])){display:flex;overflow:hidden;padding:12px}
#phoneCompanion .companion-chat{display:flex;flex-direction:column;min-height:0;width:100%;height:100%;margin:0;padding:0;border:0;background:transparent}
#phoneCompanion .companion-chat header{position:relative;flex-shrink:0}
#phoneCompanion .companion-chat .desk-kicker{display:none}
#phoneCompanion .companion-chat h2{font-size:22px;margin:0 0 12px;color:#f7db93}
#phoneCompanion .companion-chat [data-chat-sound]{position:absolute;right:0;top:0;min-height:29px;font-size:9px;padding:5px 8px;background:#2b1c37}
#phoneCompanion [data-chat-people]{display:flex;gap:7px;overflow-x:auto;flex-shrink:0;padding:2px 0 10px;scrollbar-width:thin}
#phoneCompanion [data-chat-people] button{display:flex;align-items:center;gap:6px;flex-shrink:0;padding:5px 9px;min-height:34px;font-size:11px;background:#372440;white-space:nowrap}
#phoneCompanion [data-chat-people] button[aria-current=true]{background:#eacb72;color:#30203d}
.chat-peer-avatar{display:grid;place-items:center;width:23px;height:23px;border-radius:50%;background:#9edac6;color:#33213d;font-weight:900;flex-shrink:0}
#phoneCompanion [data-chat-conversation]{min-height:0;flex:1;display:flex;flex-direction:column}
#phoneCompanion [data-chat-name]{margin:3px 0 10px;font-size:12px;color:#d7bee3}
#phoneCompanion .desk-chat-messages{min-height:70px;max-height:none!important;flex:1;overflow:auto;padding:5px 0;overscroll-behavior:contain}
#phoneCompanion .desk-chat-messages article,.desktop-chat .desk-chat-messages article{max-width:88%;padding:6px 10px;background:#4d365d;border:1px solid #9875ac3d;border-radius:16px 16px 16px 4px;margin:0 14px 5px 0}
#phoneCompanion .desk-chat-messages article.own,.desktop-chat .desk-chat-messages article.own{margin:0 0 5px auto;background:#a4ddcc;color:#2b2336;border-radius:16px 16px 4px 16px;border-color:#b6efdb}
#phoneCompanion .desk-chat-messages article p,.desktop-chat .desk-chat-messages article p{font-size:13px;line-height:1.4;margin:2px 0 0;color:inherit;white-space:pre-wrap}
#phoneCompanion .desk-chat-messages article small{font-size:9px;color:#e7c6ef}
#phoneCompanion .desk-chat-messages article.own small,.desktop-chat .desk-chat-messages article.own small{color:#4d665f}
.desk-chat-messages time{display:block;text-align:right;font-size:9px;opacity:.7;margin-top:4px}
.desk-chat-messages .chat-message-meta{display:flex;align-items:baseline;justify-content:space-between;gap:10px;min-width:0;line-height:1.2}
.desk-chat-messages .chat-message-meta small{min-width:0;overflow-wrap:anywhere}
.desk-chat-messages .chat-message-meta time{display:inline;flex-shrink:0;margin:0;white-space:nowrap;line-height:1.2}
.desktop-chat [data-chat-people],#phoneCompanion [data-chat-people]{flex-shrink:0;border-bottom:1px solid #bb97cf66;padding-bottom:10px;margin-bottom:6px}
.desktop-chat .chat-conversation-header,#phoneCompanion .chat-conversation-header{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-shrink:0;margin:0 0 7px;min-width:0}
.desktop-chat .chat-conversation-header [data-chat-name],#phoneCompanion .chat-conversation-header [data-chat-name]{min-width:0;flex:1;font-size:12px;line-height:1.3;margin:0;overflow-wrap:anywhere}
.desktop-chat .chat-conversation-header [data-chat-duel],#phoneCompanion .chat-conversation-header [data-chat-duel]{width:auto;max-width:142px;flex:0 0 auto;min-height:34px;margin:0;padding:5px 7px;font-size:10px;line-height:1.2;background:transparent;color:#e9c2ee;border:1px dashed #b68ac7;border-radius:7px;white-space:normal}
.desktop-chat [data-chat-form]{display:flex;align-items:end;gap:7px;flex-shrink:0;padding-top:7px}
.desktop-chat [data-chat-form] label{flex:1;min-width:0;line-height:1.2}
.desktop-chat [data-chat-form] textarea,#phoneCompanion [data-chat-form] textarea{display:block;min-height:40px;max-height:86px;margin:3px 0 0;padding:8px;line-height:1.4}
.desktop-chat [data-chat-form]>button{float:none;flex:0 0 40px;width:40px;height:40px;min-height:40px;margin:0;padding:0;line-height:1;font-size:17px}
#phoneCompanion [data-chat-form]{display:flex;gap:8px;align-items:end;padding-top:10px;border-top:1px solid #ad8bc338;flex-shrink:0}
#phoneCompanion [data-chat-form] label{flex:1;min-width:0;font-size:9px;color:#d6bde3}
#phoneCompanion [data-chat-form] textarea{display:block;width:100%;min-height:40px;max-height:86px;margin:3px 0 0;padding:8px;resize:vertical;border:1px solid #b7a2c6}
#phoneCompanion [data-chat-form]>button{width:43px;height:44px;min-height:44px;flex-shrink:0;padding:0;border-radius:50%;background:#f1cb64;color:#34203f;font-size:19px;border:0}

#phoneCompanion [data-chat-status]{font-size:10px;margin:4px 0 0}
@media(max-height:650px){#phoneCompanion .phone-homescreen{height:calc(100dvh - 120px)}#phoneCompanion .phone-handset{padding-top:9px}#phoneCompanion .phone-hardware{margin-bottom:5px}#gamePhone{padding-top:15px}}

[data-chat-access],#chatAccess{padding:9px 10px;margin:8px 0;border-left:3px solid #f1cb64;background:#f1cb6410;font-size:12px;line-height:1.45;overflow-wrap:anywhere}#phoneCompanion [data-chat-access]{font-size:11px;flex-shrink:0}
