/* Identity controls only; approved page/card layout remains owned by platform.css. */
.claw-platform .profile-current-avatar{width:100%;max-width:175px;margin:auto;aspect-ratio:1}
.profile-avatar-image{display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-radius:50%;background:#eeeaff}
.profile-avatar-image img{display:block;width:100%;height:100%;object-fit:contain}
.profile-avatar-image img[hidden]{display:none}
.profile-avatar-missing{padding:8px;font-size:12px;color:#666285}
.claw-platform .profile-primary,.claw-platform .profile-secondary{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:44px;width:auto;margin:0;padding:8px 14px;border-radius:10px;font-family:inherit;font-weight:700;font-size:15px;line-height:1.3;cursor:pointer}
.claw-platform .profile-primary{background:linear-gradient(#ff727b,#ff3345);border:1px solid #ff5161;color:white}
.claw-platform .profile-secondary{background:#fff;border:1px solid #beb0ff;color:#66529f}
.claw-platform .profile-secondary.account-logout{display:flex;width:100%;margin-top:16px;background:#fff0f2;border-color:#ffc3cc;color:#c52d46}
.claw-platform .profile-secondary.account-logout:hover:not(:disabled){background:#ffe2e7}
.claw-platform .profile-primary:disabled,.claw-platform .profile-secondary:disabled{cursor:default;opacity:.55}
.claw-platform .profile-primary:focus-visible,.claw-platform .profile-secondary:focus-visible,.profile-name-input:focus-visible,.profile-avatar-choice:has(input:focus-visible){outline:3px solid #7760d6;outline-offset:3px}
.claw-platform .profile-avatar-open{margin-top:8px;max-width:100%;font-size:13px;padding:6px 8px}
.claw-platform .profile-edit{margin-top:8px}
.profile-editor[hidden],.profile-edit[hidden],.profile-retry[hidden]{display:none!important}
.claw-platform .profile-name-input{display:block;box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:8px 10px;border:1px solid #bcb0ff;border-radius:9px;background:#fff;color:#060758;font:inherit;font-size:16px}
.profile-name-input[aria-invalid=true]{border-color:#c32b47}
.profile-helper{display:block;margin:6px 0;color:#71728e;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.profile-edit-status{min-height:1.5em}
.profile-edit-status.is-error{color:#b3213d}
.profile-edit-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.profile-avatar-dialog{box-sizing:border-box;max-width:calc(100vw - 32px);width:544px;max-height:calc(100dvh - 32px);padding:20px;border:1px solid #d8cbff;border-radius:16px;background:#fffdfb;color:#060758;box-shadow:0 16px 56px #28205233;overflow:auto}
.profile-avatar-dialog::backdrop{background:#17143b66}
.profile-avatar-dialog h2{margin:0 0 8px;font-size:24px;line-height:1.3}
.profile-avatar-choices{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:0;margin:16px 0;border:0;min-width:0}
.profile-avatar-choice{position:relative;display:flex;flex-direction:column;gap:6px;align-items:center;min-width:0;padding:7px;border:2px solid transparent;border-radius:14px;cursor:pointer;font-size:13px}
.profile-avatar-choice:has(input:checked){border-color:#ff4b61;background:#fff0f3}
.profile-avatar-choice input{position:absolute;width:1px;height:1px;opacity:0}
.profile-avatar-choice .profile-avatar-image{aspect-ratio:1;height:auto}
.profile-avatar-dialog .profile-edit-actions{justify-content:flex-end}
@media(max-height:480px){.profile-avatar-dialog{padding:12px 16px}.profile-avatar-dialog h2{font-size:20px;margin-bottom:4px}.profile-avatar-dialog .profile-helper{margin:4px 0}.profile-avatar-choices{gap:4px;margin:8px 0}.profile-avatar-choice{padding:3px;gap:2px}.profile-avatar-choice .profile-avatar-image{width:54px;height:54px}.profile-avatar-dialog .profile-edit-actions{margin-top:8px}}
@media(max-width:360px){.profile-avatar-choices{gap:5px}.profile-avatar-choice{padding:4px;font-size:12px}.profile-avatar-dialog{padding:14px}.profile-edit-actions{gap:6px}.profile-edit-actions button{padding:8px 10px}}
@media(min-width:1051px){
 .claw-platform .profile-primary{height:47px;min-height:47px;font-size:18px;border-radius:16px;padding:0 16px}
 .claw-platform .profile-secondary,.claw-platform .profile-avatar-open,.claw-platform .profile-name-input{height:44px;min-height:44px;font-size:16px;border-radius:16px;padding:0 16px}
 .profile-helper{font-size:14px}.profile-edit-actions{gap:16px;margin-top:16px}
 .profile-avatar-dialog{padding:16px}.profile-avatar-choices{gap:16px}.profile-avatar-choice{font-size:16px}
 .claw-platform .profile-current-avatar{max-width:128px}
}

/* Layered avatar additions. Server-resolved local PNG sits above a separate circle. */
.profile-layered-avatar{position:relative;display:block;aspect-ratio:1;width:100%;height:100%;border-radius:50%;background-color:#eeeaff;overflow:hidden}
.profile-layered-avatar img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain;max-width:none;margin:0}
.profile-layered-avatar .profile-avatar-missing{display:flex;align-items:center;justify-content:center;position:absolute;inset:0}
.profile-layered-avatar [hidden]{display:none!important}
.platform-owner-avatar>.profile-layered-avatar{width:100%;height:100%}
.profile-layered-dialog{width:660px;max-height:min(820px,calc(100dvh - 32px));padding:16px;overflow:hidden}
.profile-layered-dialog[open]{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;gap:12px}
.profile-avatar-header{display:grid;grid-template-columns:96px minmax(0,1fr);align-items:center;gap:16px}
.profile-avatar-preview{width:96px;height:96px}
.profile-preview-label{font-size:14px;line-height:1.4;color:#67558b;margin:6px 0 0;overflow-wrap:anywhere}
.profile-fixture-note{font-size:12px;color:#886220;background:#fff3cc;border-radius:6px;padding:4px 6px;margin:5px 0 0}
.profile-picker-scroll{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:2px 4px}
.profile-palette{max-height:210px;overflow-y:auto;overscroll-behavior:contain;box-sizing:border-box;padding:8px;scroll-padding:8px}
.profile-picker-scroll h3,.profile-palette h3{margin:4px 0;font-size:16px;line-height:1.4}
.profile-layered-dialog .profile-avatar-choices{grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin:4px 0 16px}
.profile-layered-dialog .profile-avatar-choice{padding:4px;gap:3px;font-size:12px;line-height:1.3;text-align:center}
.profile-character-thumbnail{width:100%;height:auto;aspect-ratio:1;border-radius:50%}
.profile-layered-dialog .profile-avatar-choice:has(input:checked){background:#fff0f3}
.profile-background-choices{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;margin:4px 0 0;padding:0;border:0;min-width:0}
.profile-color-choice{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:6px 3px;gap:4px;border:2px solid transparent;border-radius:12px;font-size:12px;text-align:center;cursor:pointer}
.profile-color-choice input{position:absolute;width:1px;height:1px;opacity:0}
.profile-layered-dialog .profile-avatar-choice input,.profile-layered-dialog .profile-color-choice input{inset:0;width:100%;height:100%;margin:0;z-index:1;cursor:pointer}
.profile-color-choice input{scroll-margin:10px}
.profile-color-choice:has(input:checked){border-color:#ff4b61;background:#fff0f3}
.profile-color-choice:has(input:focus-visible){outline:3px solid #7760d6;outline-offset:2px}
.profile-color-swatch{display:block;width:36px;height:36px;border:1px solid #21125930;border-radius:50%;box-sizing:border-box}
.profile-layered-dialog .profile-edit-actions{margin:0;padding-top:8px;border-top:1px solid #eee8f5}
@media(max-width:640px){.profile-layered-dialog{max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px);padding:12px;gap:8px}.profile-avatar-header{grid-template-columns:64px minmax(0,1fr);gap:10px}.profile-avatar-preview{width:64px;height:64px}.profile-layered-dialog h2{font-size:21px}.profile-avatar-header .profile-helper{font-size:12px;line-height:1.4;margin:4px 0}.profile-preview-label{font-size:12px}.profile-layered-dialog .profile-avatar-choices{grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}.profile-background-choices{grid-template-columns:repeat(4,minmax(0,1fr))}.profile-layered-dialog .profile-avatar-choice{padding:3px;font-size:10px}.profile-color-choice{font-size:10px;padding:3px;gap:2px}.profile-color-swatch{width:28px;height:28px}}
@media(max-height:480px){.profile-layered-dialog{max-height:calc(100dvh - 16px);padding:10px 14px;gap:6px}.profile-avatar-header{grid-template-columns:56px minmax(0,1fr);gap:12px}.profile-avatar-preview{width:56px;height:56px}.profile-layered-dialog h2{font-size:20px}.profile-avatar-header .profile-helper{margin:2px 0}.profile-preview-label{margin:2px 0}.profile-layered-dialog .profile-avatar-choices{grid-template-columns:repeat(8,minmax(0,1fr))}.profile-layered-dialog .profile-edit-actions{padding-top:6px}.profile-fixture-note{margin:2px 0;padding:2px 4px}}
@media(forced-colors:active){.profile-color-choice:has(input:checked),.profile-avatar-choice:has(input:checked){outline:2px solid Highlight}.profile-color-swatch{forced-color-adjust:none}}
@media(max-height:480px) and (min-width:641px){
 .profile-layered-dialog[open]{grid-template-columns:180px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto}
 .profile-avatar-header,.profile-layered-dialog .profile-edit-actions{grid-column:1/-1}
 .profile-palette{grid-column:1;grid-row:2;align-self:start;max-height:100%}
 .profile-picker-scroll{grid-column:2;grid-row:2}
 .profile-background-choices{grid-template-columns:repeat(4,minmax(0,1fr))}
 .profile-color-choice{font-size:10px;padding:3px;gap:2px}.profile-color-swatch{width:28px;height:28px}
 .profile-layered-dialog .profile-avatar-choices{grid-template-columns:repeat(6,minmax(0,1fr));gap:4px}
 .profile-layered-dialog .profile-avatar-choice{font-size:10px;padding:3px}
}
.claw-platform .profile-current-avatar{max-width:170px}
@media(min-width:1051px){.claw-platform .profile-current-avatar{max-width:128px}}
.profile-layered-avatar img{object-position:center}
.profile-layered-dialog :is(.profile-avatar-choice,.profile-color-choice):has(input:checked){border-color:#b89be9;outline:2px solid #a486db;outline-offset:1px;background:#f3ecff;box-shadow:0 0 0 2px #f3ecff}
.profile-layered-dialog :is(.profile-avatar-choice,.profile-color-choice):has(input:checked)::after{content:'✓';position:absolute;right:1px;top:1px;display:grid;place-items:center;width:16px;height:16px;border-radius:50%;background:#9873d2;color:white;font:700 12px/1 sans-serif;pointer-events:none;z-index:2}
.profile-layered-dialog :is(.profile-avatar-choice,.profile-color-choice):has(input:focus-visible){outline:3px solid #b59be5;outline-offset:4px}
.claw-platform #profile-name-label{display:inline-block;margin-right:6px}
.profile-name-help{position:relative;display:inline-block;vertical-align:middle}
.claw-platform .profile-name-help-button{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;min-height:24px;padding:0;border:1px solid #d8c9fc;border-radius:50%;background:linear-gradient(145deg,#f8f3ff,#e5d9ff);color:#7052b4;box-shadow:inset 0 1px 0 #fff,0 2px 4px #7052b414;cursor:pointer;font-size:0}
.profile-name-help-button:before{content:'?';font:700 15px/1 system-ui,sans-serif}
.claw-platform .profile-name-help-button:hover,.claw-platform .profile-name-help-button:focus-visible{background:#ded0fc;border-color:#aa8de8;outline:2px solid #c6aff577;outline-offset:2px}
.profile-name-tooltip{display:none;position:absolute;z-index:20;top:calc(100% + 8px);left:-90px;width:220px;padding:12px 14px;border:1px solid #d7c6f5;border-radius:14px;background:linear-gradient(135deg,#f5edff,#eee7ff 65%,#fceef6);box-shadow:0 6px 18px #62468c24,inset 0 1px 0 #ffffffaa;text-align:left}
.profile-name-tooltip:before{content:'';position:absolute;top:-5px;left:97px;width:8px;height:8px;transform:rotate(45deg);background:#f3ecff;border-top:1px solid #d7c6f5;border-left:1px solid #d7c6f5}
.profile-name-tooltip .profile-helper{color:#594777;margin:0;font-size:13px;line-height:1.65}
.profile-name-tooltip .profile-helper+ .profile-helper{margin-top:8px;padding-top:7px;border-top:1px solid #d8c9ec;color:#8264a4;font-size:12px}
.profile-name-help:hover .profile-name-tooltip,.profile-name-help:focus-within .profile-name-tooltip,.profile-name-help.is-open .profile-name-tooltip{display:block}
.profile-name-box{position:relative;margin-top:6px}
.claw-platform .profile-name-box .profile-name-input{width:100%;box-sizing:border-box;padding-right:46px}
.claw-platform .profile-name-check{position:absolute;right:4px;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:36px;height:36px;min-height:36px;padding:0;border:0;border-radius:8px;background:#e4f7ed;color:#16864d;font-family:system-ui,sans-serif;font-size:24px;cursor:pointer}
.claw-platform .profile-name-check:disabled{opacity:.45;cursor:default}
.profile-name-check[hidden],.profile-edit-actions[hidden]{display:none!important}
.claw-platform .profile-name-help-button,.claw-platform .profile-name-help-button:hover,.claw-platform .profile-name-help-button:focus-visible{border:0;background:transparent url("/game/platform-art/help-candy-v1/help.png") center/contain no-repeat;box-shadow:none}
.profile-name-help-button:before{content:none}
.claw-platform .profile-name-help-button{transform:translateY(-2px)}
.claw-platform #profile .platform-player-id-box #platform-player-id{display:flex;align-items:center;box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:8px 10px;border:1px solid #bcb0ff;border-radius:9px;background:#fff;color:#060758;cursor:pointer;overflow-wrap:anywhere}
.claw-platform #platform-player-id:focus-visible{outline:3px solid #7760d6;outline-offset:3px}
@media(min-width:1051px){.claw-platform #profile .platform-player-id-box #platform-player-id{border-radius:16px;padding:8px 16px}}

.profile-name-label-row{display:flex;align-items:center;gap:6px;min-height:24px}.claw-platform .profile-name-label-row #profile-name-label{margin:0;line-height:24px}.profile-name-label-row .profile-name-help{display:flex;align-items:center;flex:none}

.claw-platform .profile-name-check{background:transparent url("/game/platform-art/check-candy-v1/check.png") center/32px 32px no-repeat;font-size:0;border-radius:50%}.claw-platform .profile-name-check:hover:not(:disabled){filter:brightness(1.08)}.claw-platform .profile-name-check:focus-visible{outline:2px solid #83cda8;outline-offset:1px}

.claw-platform .profile-name-check{z-index:3}

.claw-platform .profile-secondary.account-logout{background:linear-gradient(#f2f3f5,#d6d8de);border:1px solid #c7cad2;color:#4d5260;box-shadow:inset 0 1px #ffffffcc,0 3px 0 #89909d22}
.claw-platform .profile-secondary.account-logout:enabled:hover{background:linear-gradient(#e9ebef,#cdd0d8);border-color:#bcc1cb;color:#414653}
.claw-platform #profile .platform-player-id-field{position:relative;width:100%;min-width:0}
.claw-platform #profile .platform-player-id-field #platform-player-id{padding-right:48px;cursor:text;font-size:18px}
.claw-platform #profile .platform-copy-id-icon{position:absolute;right:1px;top:1px;bottom:1px;display:flex;align-items:center;justify-content:center;width:42px;min-width:42px;min-height:42px;height:auto;margin:0;padding:0;border:0;border-radius:12px;background:transparent;color:#7661ad;box-shadow:none;cursor:pointer}
.claw-platform #profile #platform-copy-player-id{background:transparent!important;box-shadow:none!important}
.claw-platform #profile .platform-copy-id-icon:focus-visible{outline:2px solid #9270ce;outline-offset:2px}
.claw-platform #profile .platform-copy-id-icon:disabled{opacity:.4;cursor:default}

.claw-platform .profile-name-help-button:hover:not(:focus-visible){outline:none}
.claw-platform #profile .account-rows{padding-inline:0}

/* Public owner card shares the profile tooltip surface. */
.platform-owner-card-trigger{position:relative;cursor:pointer;overflow:visible!important;outline-offset:3px}.platform-owner-card-trigger .platform-owner-card{left:auto;right:-8px;width:220px;white-space:normal;pointer-events:none}.platform-owner-card:before{left:auto;right:21px}.platform-owner-card-name{display:block;color:#0d124d;font-size:16px;overflow-wrap:anywhere;margin-bottom:6px}.platform-owner-card .profile-helper{display:block;overflow-wrap:anywhere}.platform-machine-card:has(.platform-owner-card-trigger:hover),.platform-machine-card:has(.platform-owner-card-trigger:focus){position:relative;z-index:3}

.claw-platform .platform-machine-card:has(.platform-owner-card-trigger:hover),.claw-platform .platform-machine-card:has(.platform-owner-card-trigger:focus),.claw-platform .platform-machine-card:has(.platform-owner-card-trigger.is-open){overflow:visible;position:relative;z-index:3}

/* Owner identity card: compact ID copy action. */
.platform-owner-card .platform-owner-id-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.platform-owner-card .platform-owner-copy{width:auto;flex:none;min-width:44px;min-height:32px;margin:0;padding:4px 8px;border:1px solid #cfbce9;border-radius:9px;background:#fff;color:#554179;font:inherit;font-size:13px;cursor:pointer;box-shadow:0 2px 3px #51407018}
.platform-owner-card .platform-owner-copy:focus-visible{outline:2px solid #9270ce;outline-offset:2px}
.platform-owner-card .platform-owner-copy:disabled{opacity:.45;cursor:default}
.platform-owner-card .platform-owner-copy-status{display:block;color:#554179;font-size:12px;line-height:1.5;white-space:normal}
.platform-owner-card .platform-owner-copy-status:not(:empty){margin-top:6px}

/* Keep the owner card interactive while crossing the avatar/card gap. */
body .platform-owner-card-trigger .platform-owner-card{pointer-events:auto}
body .platform-owner-card-trigger .platform-owner-card::after{content:'';position:absolute;left:0;right:0;top:-10px;height:10px;background:transparent}
body .platform-machine-card:has(.platform-owner-card-trigger:focus-within){position:relative;z-index:3;overflow:visible}

/* Custom static avatars: shared picker with bounded scrolling. */
.profile-layered-dialog[open]{display:flex;flex-direction:column;gap:12px}
.profile-layered-dialog [hidden]{display:none!important}
.profile-layered-dialog .profile-picker-scroll{flex:1 1 auto;min-height:80px}
.profile-layered-dialog .profile-palette{flex:0 1 auto;min-height:100px}
.profile-avatar-tabs{display:flex;gap:8px;flex:none}
.profile-avatar-tabs button{flex:1}
.profile-avatar-tabs [aria-selected=true]{background:#e9ddff;border-color:#b89be9}
.profile-custom-pane{overflow:auto;min-height:0;text-align:center;padding:4px 8px 16px}
.profile-upload-label{display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.profile-upload-label.is-disabled{opacity:.5;cursor:default}
#profile-custom-file{display:block;max-width:100%;margin:12px auto;font:inherit;font-size:12px}
.profile-upload-preview{width:180px;height:180px;margin:16px auto;max-width:100%;border-radius:50%;overflow:hidden;background:#eee5ff;box-shadow:0 0 0 4px #f5efff}
.profile-upload-preview>img{width:100%;height:100%;object-fit:cover;display:block}
.profile-custom-avatar img{object-fit:cover}
.profile-layered-dialog .profile-edit-actions{flex:none}
@media(max-width:360px){.profile-upload-preview{width:140px;height:140px}.profile-avatar-tabs button{padding:8px}}

.claw-platform .profile-name-box .profile-name-input{padding-right:72px}
.claw-platform .profile-name-check{right:36px;width:28px;height:28px;min-height:28px;background-size:24px 24px}
.claw-platform .profile-name-cancel{position:absolute;right:5px;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:28px;height:28px;min-height:28px;padding:0;border:0;border-radius:50%;background:#f2edf9;color:#796296;font:22px/1 system-ui,sans-serif;cursor:pointer;z-index:3}
.claw-platform .profile-name-cancel[hidden]{display:none}
.claw-platform .profile-name-cancel:disabled{opacity:.45;cursor:default}
.claw-platform .profile-name-cancel:focus-visible{outline:2px solid #a58bc4;outline-offset:2px}

/* Match the approved candy check/help controls. */
.claw-platform .profile-name-cancel{background:transparent url("/game/platform-art/cancel-candy-v1/cancel.png") center/24px 24px no-repeat;font-size:0;box-shadow:none}
.claw-platform .profile-name-cancel:hover:not(:disabled){filter:brightness(1.08)}
