/* Friends redesign: presentation only; social actions retain their existing IDs. */
@media(max-width:650px){#friends-panel .friends-account-editor>div{grid-template-columns:auto minmax(0,1fr) minmax(0,1fr)}#friends-panel #friends-username-input{grid-column:2/4;min-width:0;width:100%}#friends-panel #friends-username-save{grid-row:2;grid-column:2}#friends-panel #friends-username-cancel{grid-row:2;grid-column:3}}
#chest-overlay{position:fixed;inset:0;z-index:149;background:#0008;touch-action:none}
#chest-overlay.hidden{display:none}
#friends-panel>header,#friends-panel>footer,#friends-panel .friends-list{background:transparent!important;box-shadow:none!important}
#friends-panel .friends-list{border:0!important}
#friends-panel .friends-account-card{min-height:0!important}
#friends-panel .friend-card>div{text-align:left!important}
#friends-panel .friend-card{box-shadow:none!important}
#chest-panel{position:fixed;z-index:150;inset:max(12px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));max-width:1000px;margin:auto;display:flex;flex-direction:column;gap:12px;padding:16px;border:2px solid #957049;border-radius:14px;background:#202d30;box-shadow:0 0 0 100vmax #0009;color:#edf0e7;font:13px system-ui,sans-serif}
#chest-panel.hidden{display:none}#chest-panel header{display:flex;align-items:center;justify-content:space-between;flex:none}#chest-panel header>div{display:flex;flex-direction:column;gap:3px}#chest-title{font-size:24px;color:#ffdc8a}#chest-panel header small{color:#b8c4c4}#chest-panel button{min-height:44px;touch-action:manipulation;cursor:pointer;border:1px solid #71817f;border-radius:6px;background:#334b52;color:white;font:inherit}#chest-panel [data-chest-close]{width:44px;font-size:28px}
#chest-panel .chest-columns{min-height:0;flex:1;display:grid;grid-template-columns:1fr 1fr;gap:18px}#chest-panel .chest-columns>section{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y}#chest-panel h3{position:sticky;top:0;z-index:1;margin:0 0 8px;padding:8px;background:#202d30;font-size:12px;color:#ffd78c;display:flex;justify-content:space-between}#chest-panel h3 small{font-size:9px;color:#b2c2c2}
#chest-panel .chest-slots{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:4px;padding:2px}#chest-panel .chest-slots button{position:relative;aspect-ratio:1;min-height:0;padding:4px;border:1px solid #657571;box-shadow:inset 2px 2px 0 #101f24;overflow:hidden}#chest-panel .chest-slots button.selected{border:2px solid #ffe078;background:#526650}#chest-panel .chest-icon{display:block;width:100%;height:100%;object-fit:contain;image-rendering:pixelated;pointer-events:none}#chest-panel .chest-slots small{position:absolute;right:3px;bottom:1px;font-weight:bold;text-shadow:1px 1px #000;font-size:12px;pointer-events:none}#chest-panel footer{flex:none;display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #697370;padding-top:8px}#chest-panel footer p{margin:0;font-size:12px;max-width:50%;line-height:1.4}#chest-panel footer>div{display:flex;gap:6px}#chest-panel footer button{padding:8px 14px;font-size:11px}#chest-panel [data-chest-move="stack"]{background:#ffe078;color:#183239}#chest-panel button:disabled{opacity:.4;cursor:default}
@media(max-width:600px){#chest-panel{padding:10px;gap:6px}#chest-panel .chest-columns{grid-template-columns:1fr;grid-template-rows:1fr 1.2fr;gap:8px}#chest-panel .chest-slots{grid-template-columns:repeat(6,minmax(0,1fr))}#chest-panel footer{flex-direction:column;align-items:stretch;gap:5px}#chest-panel footer p{max-width:none;font-size:11px}#chest-panel footer>div>button{flex:1}}
@media(orientation:landscape) and (max-height:520px){#chest-panel{padding:8px 12px;gap:5px}#chest-panel header small{display:none}#chest-title{font-size:18px}#chest-panel h3{padding:4px;font-size:10px}#chest-panel .chest-slots{grid-template-columns:repeat(6,minmax(0,1fr))}}
#friends-panel{position:fixed!important;inset:max(12px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))!important;transform:none!important;width:auto!important;max-width:1000px!important;height:auto!important;max-height:none!important;margin:auto!important;padding:16px!important;display:flex;flex-direction:column;gap:10px;overflow:hidden!important;background:#102a32;border:2px solid #58757b;box-shadow:0 20px 90px #0009;border-radius:16px;color:#f2f5ef;font-size:13px}
#friends-panel.hidden{display:none!important}
#friends-panel{bottom:auto!important;top:calc(var(--friends-visible-top,0px) + max(12px,env(safe-area-inset-top)))!important;height:calc(var(--friends-visible-height,100dvh) - max(12px,env(safe-area-inset-top)) - max(12px,env(safe-area-inset-bottom)))!important}
#friends-panel.keyboard-open .friends-account-card,#friends-panel.keyboard-open>header small,#friends-panel.keyboard-open .friends-add-box small{display:none!important}
#friends-panel.keyboard-open{gap:5px;padding:8px!important}
#friends-panel.keyboard-open>header,#friends-panel.keyboard-open .friends-tabs{display:none!important}
#friends-panel.keyboard-open .friends-search{position:static;width:auto}
#friends-panel.keyboard-open:has(.friends-profile-tools[open]) .friends-account-card{display:grid!important}
#friends-panel>header{flex:none;display:flex;align-items:center;justify-content:space-between;padding:0 0 8px!important;border-bottom:1px solid #42606a}
#friends-panel>header b{font-size:24px!important;letter-spacing:.03em;color:#ffe375}
#friends-panel>header small{font-size:10px!important;color:#a6c1c6;letter-spacing:.08em;margin-top:4px}
#friends-panel button{min-height:44px;font:inherit;touch-action:manipulation;border-radius:8px;white-space:normal;cursor:pointer}
#friends-panel>header button{width:44px;height:44px;font-size:28px!important;padding:0}
#friends-panel .friends-account-card{position:relative;flex:none;display:grid!important;grid-template-columns:38px minmax(0,1fr) auto auto;align-items:center;gap:10px;padding:8px 12px!important;margin:0;background:#1b3943;border:0;border-radius:10px}
#friends-panel .friends-account-avatar{width:36px;height:36px;font-size:22px}
#friends-panel .friends-account-card>div:nth-child(2){min-width:0;display:flex;flex-direction:column;gap:3px}
#friends-panel #friends-player-name{font-size:14px!important;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#friends-panel #friends-account-state{font-size:9px!important;letter-spacing:.02em;color:#a6c1c6}
#friends-panel .friends-account-card span,#friends-panel #friends-dream-id{font-size:11px!important;overflow-wrap:anywhere}
#friends-panel #friends-copy-id{font-size:10px!important;padding:6px 10px}
#friends-panel .friends-profile-tools>summary{list-style:none;cursor:pointer;min-height:44px;display:flex;align-items:center;padding:0 12px;border:1px solid #58757b;border-radius:8px;font-size:11px}
#friends-panel .friends-profile-tools[open]>div{position:absolute;right:0;top:100%;z-index:5;display:flex;flex-wrap:wrap;gap:8px;width:min(560px,100%);max-height:48dvh;overflow:auto;padding:14px;background:#17343f;border:2px solid #71929a;border-radius:10px;box-shadow:0 12px 30px #0009}
#friends-panel .friends-profile-tools button{font-size:11px!important;padding:8px}
#friends-panel .friends-account-editor,#friends-panel .friends-profile-switcher{width:100%;min-width:0}
#friends-panel .friends-tabs{flex:none;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:0;padding:0;border:0;background:none}
#friends-panel .friends-tabs button{display:flex;align-items:center;justify-content:center;gap:6px;padding:7px 4px!important;font-size:11px!important;border:1px solid #45616b;background:#193641;color:#b8cdd0;box-shadow:none}
#friends-panel .friends-tabs button.selected{background:#ffe078;color:#17303a;border-color:#ffe078}
#friends-panel .friends-tabs em{font-size:10px!important;min-width:16px;font-style:normal}
#friends-panel .friends-search{flex:none;display:flex;align-items:center;gap:10px;font-size:11px;color:#b7ccd1}
#friends-search{flex:1;min-width:0;height:40px;padding:8px 12px;border:1px solid #557580;border-radius:8px;background:#0c222a;color:white;font:inherit}
#friends-panel .friends-add-box{flex:none;padding:10px!important;margin:0;border:1px solid #456c79;background:#193c49;border-radius:10px}
#friends-panel .friends-add-box label{font-size:11px!important;letter-spacing:.02em}
#friends-panel .friends-add-box>div{display:flex;gap:8px;margin:6px 0}
#friends-panel .friends-add-box input{flex:1;width:0;min-width:0;min-height:44px;font-size:16px!important;border-radius:6px}
#friends-panel #friends-add-submit{padding:8px 12px;font-size:11px!important;background:#ffe078;color:#172e38}
#friends-panel .friends-add-box small{font-size:10px!important;line-height:1.4;letter-spacing:0}
#friends-panel .friends-list{flex:1 1 0!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden;display:flex!important;flex-direction:column;gap:8px;padding:2px 6px 8px 0!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}
#friends-panel .friend-card{flex:none;min-height:80px;display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;gap:12px;padding:10px!important;border:1px solid #365863;border-radius:10px;background:#193740}
#friends-panel .friend-avatar{height:44px;width:44px;display:grid;place-items:center;background:#356574;border:0;border-radius:12px;font-size:22px}
#friends-panel .friend-card>div:not(.friend-card-actions){min-width:0;display:flex;flex-direction:column;gap:4px}
#friends-panel .friend-card b{font-size:14px!important;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
#friends-panel .friend-card small{font-size:11px!important;overflow-wrap:anywhere}
#friends-panel .friend-card em{font-size:10px!important;letter-spacing:0}
#friends-panel .friend-card-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;max-width:340px}
#friends-panel .friend-card-actions button{padding:8px 12px!important;font-size:10px!important;border:1px solid #567680;background:#244753;color:white}
#friends-panel .friend-card-actions .primary{background:#72c6ac;border-color:#72c6ac;color:#122c2b}
#friends-panel .friend-card-actions [data-friend-action="block"]{color:#e7adb0;background:transparent}
#friends-panel .friends-empty{margin:auto;text-align:center;padding:16px;min-height:0}
#friends-panel .friends-empty b{font-size:15px!important}#friends-panel .friends-empty small{font-size:11px!important}
#friends-panel>footer{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 0 0!important;border-top:1px solid #42606a}
#friends-status{font-size:11px!important;line-height:1.4;min-width:0;overflow-wrap:anywhere}
#friends-done{min-width:90px;background:#ffe078;color:#142c34;border:0;padding:8px 16px}
@media(max-width:600px){#friends-panel{padding:10px!important;gap:7px}#friends-panel .friend-card{grid-template-columns:36px minmax(0,1fr);gap:8px}#friends-panel .friend-avatar{width:36px;height:36px}#friends-panel .friend-card-actions{grid-column:1/-1;max-width:none;justify-content:stretch}#friends-panel .friend-card-actions button{flex:1}#friends-panel .friends-account-card{grid-template-columns:minmax(0,1fr) auto auto;gap:6px;padding:6px!important}#friends-panel .friends-account-avatar{display:none}#friends-panel .friends-tabs button{font-size:9px!important;gap:3px}}
@media(orientation:landscape) and (max-height:520px){#friends-panel{padding:8px 12px!important;gap:6px}#friends-panel>header{padding-bottom:4px!important}#friends-panel>header b{font-size:18px!important}#friends-panel>header small{display:none}#friends-panel .friends-account-card{padding:3px 8px!important}#friends-panel #friends-account-state{display:none}#friends-panel .friends-search{position:absolute;top:12px;right:70px;width:35%}#friends-panel .friends-search>span{display:none}#friends-search{height:34px}#friends-panel .friend-card{min-height:65px;padding:6px 8px!important}#friends-panel .friends-add-box small{display:none}#friends-panel .friends-add-box label{display:none}#friends-panel .friends-add-box{padding:4px 8px!important}#friends-panel .friends-add-box>div{margin:0}}
