.public-profile,.account-backdrop{--profile-ink:#123f52;--profile-accent:#287b89;--profile-pale:#d5f4ed;--pattern:none;--pattern-size:48px 48px;background-color:var(--profile-pale);background-image:var(--pattern);background-size:var(--pattern-size);border-radius:24px;overflow:hidden}
[data-profile-background=plain]{--pattern:none}[data-profile-background=hexagons]{--pattern:linear-gradient(30deg,#ffffff45 12%,transparent 12.5%,transparent 87%,#ffffff45 87.5%),linear-gradient(150deg,#ffffff45 12%,transparent 12.5%,transparent 87%,#ffffff45 87.5%),linear-gradient(30deg,#ffffff45 12%,transparent 12.5%,transparent 87%,#ffffff45 87.5%);--pattern-size:64px 110px}
[data-profile-background=waves]{--pattern:repeating-radial-gradient(ellipse at 0 0,transparent 0 16px,#ffffff50 17px 20px,transparent 21px 38px);--pattern-size:120px 60px}[data-profile-background=stars]{--pattern:radial-gradient(circle,#ffffffb0 1.5px,transparent 2px),radial-gradient(circle at 10px 12px,#ffffff60 1px,transparent 2px);--pattern-size:36px 38px}
[data-profile-background=grove]{--pattern:repeating-linear-gradient(65deg,transparent 0 28px,#ffffff40 29px 32px,transparent 33px 48px)}[data-profile-background=dunes]{--pattern:repeating-radial-gradient(ellipse at 15% 150%,transparent 0 16px,#ffffff50 17px 27px,transparent 28px 45px);--pattern-size:200px 130px}[data-profile-background=diamonds]{--pattern:repeating-linear-gradient(45deg,transparent 0 24px,#ffffff60 25px 26px,transparent 27px 50px),repeating-linear-gradient(-45deg,transparent 0 24px,#ffffff60 25px 26px,transparent 27px 50px);--pattern-size:70px 70px}[data-profile-background=terraces]{--pattern:repeating-linear-gradient(0deg,transparent 0 17px,#ffffff60 18px 20px,transparent 21px 36px)}[data-profile-background=confetti]{--pattern:radial-gradient(ellipse at 10px 10px,#ffffff90 3px,transparent 4px),linear-gradient(120deg,transparent 45%,#ffffff50 46% 50%,transparent 51%);--pattern-size:42px 60px}[data-profile-background=aurora]{--pattern:repeating-linear-gradient(115deg,#ffffff08 0 35px,#ffffff60 60px,#ffffff08 100px);--pattern-size:300px 300px}
.account-backdrop{padding:24px}.account-backdrop .public-profile{margin:0}.public-profile{color:#233e43;border:1px solid #ffffff70}.profile-hero{padding:42px;display:flex;align-items:center;gap:28px;color:white;background:linear-gradient(120deg,var(--profile-ink),var(--profile-accent));position:relative}.profile-avatar{border-radius:50%;border:6px solid #ffffff70;box-shadow:0 8px 35px #0003;flex-shrink:0}.profile-avatar img{display:block;width:136px;height:136px;border-radius:50%}.profile-hero h1{color:white;font-size:clamp(28px,4vw,44px);margin:5px 0;overflow-wrap:anywhere}.profile-hero p{color:#ffffffe0}.profile-eyebrow{font-size:11px;font-weight:800;letter-spacing:.15em;margin:0 0 8px}.profile-relationship{margin-left:auto;font-size:13px;max-width:200px}.profile-relationship a{color:white;text-decoration:underline}.profile-relationship>span{display:block;border:1px solid #ffffff60;border-radius:24px;padding:10px 16px}.profile-content{padding:28px 36px;display:grid;gap:24px}.profile-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.profile-stats>div{padding:24px 12px;background:#fffffff0;text-align:center;border-radius:16px;border:1px solid #fff}.profile-stats strong{display:block;font-size:32px;color:var(--profile-ink);line-height:1.2}.profile-stats span{font-size:12px;color:#53686d;display:block;margin-top:7px}.profile-comparison,.profile-share,.profile-customize,.profile-friend-settings{background:#fffffff5;border-radius:18px;padding:24px;color:#233e43}.public-profile h2{color:var(--profile-ink);margin-top:0;font-size:22px}.profile-section-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:18px}.profile-section-heading label{font-size:12px;display:grid;gap:5px}.profile-section-heading select{width:100%;max-width:230px}.public-profile .muted{font-size:12px;color:#5f7174;line-height:1.6}.public-profile a{color:var(--profile-ink);text-decoration:underline;text-underline-offset:3px}.profile-table-scroll{overflow-x:auto}.profile-table-scroll table{width:100%;white-space:nowrap;font-size:13px;border-collapse:collapse;min-width:590px}.profile-table-scroll th,.profile-table-scroll td{padding:14px 10px;border-bottom:1px solid #e4ecec;text-align:right}.profile-table-scroll th:first-child{text-align:left}.profile-table-scroll thead{color:#53686d;font-size:11px}.profile-table-player{display:flex;gap:10px;align-items:center}.profile-table-player img{width:34px;height:34px;border-radius:50%}.profile-table-player small{font-weight:400;color:#5f7174;font-size:10px}.profile-rank{font-size:12px;color:#7c8b8d;width:16px}.profile-owner-row{background:var(--profile-pale)}.profile-empty{text-align:center;padding:30px 16px;border:1px dashed #b8cecc;border-radius:12px}.profile-empty h3{margin:0}.profile-empty p{color:#5f7174;font-size:14px}.profile-share a{overflow-wrap:anywhere;font-size:14px}.profile-customize summary{cursor:pointer;font-size:19px;font-weight:700;color:var(--profile-ink)}.profile-editor{margin-top:24px;max-width:none}.profile-editor>h2{font-size:16px}.profile-editor fieldset{min-width:0}.profile-theme-choices{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.profile-theme-option{display:flex!important;flex-direction:column;align-items:center;gap:6px!important;font-size:11px!important;cursor:pointer;text-align:center;padding:8px!important;border:1px solid #d5e1df;border-radius:10px}.theme-swatch{display:block;width:100%;height:36px;border-radius:6px;background:linear-gradient(120deg,var(--swatch),var(--swatch-end))}.profile-theme-option:has(input:checked){outline:2px solid var(--profile-ink);background:var(--profile-pale)}.profile-theme-option input{width:16px!important;margin:0!important}.profile-friend-row{display:flex;flex-wrap:wrap;align-items:center;gap:15px;padding:12px 0;border-top:1px solid #e0e9e6}.profile-friend-row label{display:flex;gap:10px;align-items:center;margin-right:auto}.profile-friend-row input{width:18px;height:18px}.notifications-panel{max-width:none}.friend-notification{display:flex;align-items:center;gap:18px;padding:22px 0;border-top:1px solid #dce7e3}.friend-notification>img{width:56px;height:56px;border-radius:50%}.friend-notification>div:nth-child(2){flex:1}.friend-notification p{margin:4px 0;font-size:13px}.friend-response-actions{display:flex;gap:8px}.dashboard-tabs{flex-wrap:wrap}.profile-editor input,.profile-editor select{color:#233e43;background:white}.profile-editor legend,.profile-editor label{color:#233e43}.public-profile .avatar-choices{display:flex;flex-wrap:wrap;gap:10px}.public-profile .avatar-choices img{width:54px;height:54px}.profile-editor .avatar-choices label{padding:0}.profile-editor .avatar-choices input{width:auto}
@media(max-width:700px){.account-backdrop{padding:12px}.profile-hero{padding:26px 20px;flex-wrap:wrap;gap:18px}.profile-avatar img{width:88px;height:88px}.profile-hero>div:nth-child(2){flex:1;min-width:130px}.profile-hero p:not(.profile-eyebrow){font-size:12px}.profile-relationship{margin:0;max-width:none;width:100%}.profile-relationship>span{display:inline-block}.profile-content{padding:16px;gap:16px}.profile-stats{grid-template-columns:repeat(2,1fr);gap:10px}.profile-stats>div{padding:18px 8px}.profile-stats strong{font-size:27px}.profile-section-heading{align-items:flex-start;flex-direction:column}.profile-comparison,.profile-share,.profile-customize,.profile-friend-settings{padding:18px}.profile-theme-choices{grid-template-columns:repeat(2,1fr)}.friend-notification{flex-wrap:wrap;gap:12px}.friend-response-actions{width:100%}.friend-response-actions button{flex:1}}
/* Keep intrinsic table/form widths inside their own scrolling regions. */
.public-profile,.profile-content,.profile-content>*,.profile-editor,.profile-editor>*{min-width:0}
.profile-content{grid-template-columns:minmax(0,1fr)}
.profile-table-scroll{max-width:100%;min-width:0}
.profile-theme-choices{min-width:0}.profile-theme-option{min-width:0}
/* A player's public theme has its own readable palette in either site mode. */
.public-profile,.account-backdrop{color-scheme:light;color:#233e43;--bg:#fff;--paper:#fff;--ink:#233e43;--muted:#5f7174;--green:var(--profile-ink);--line:#d5e1df;--theme-ink:#233e43;--theme-muted:#5f7174;--theme-accent:var(--profile-ink);--theme-surface:#fff;--theme-subtle:#eef4f3;--theme-raised:#e2ecea;--theme-line:#c7d8d4;--theme-warm:#faf0dc;--theme-success:#e0f2e8;--theme-focus:#946524}
.profile-hero{--ink:#fff;--theme-ink:#fff;--muted:#ffffffe0;--theme-muted:#ffffffe0}

/* Separate links keep the account action and notification shortcut accessible. */
.website .site-header>.header-account{position:relative;flex-shrink:0}
.website .header-account .profile-link{height:44px;min-height:44px}
.website .header-account:has(.account-notification-badge) .profile-link{padding-right:36px}
.website .account-notification-badge{position:absolute;right:5px;top:-7px;display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;padding:2px 6px;border:2px solid var(--theme-surface,#fff);border-radius:999px;background:#b92f48;color:#fff;font-size:12px;font-weight:800;line-height:16px;text-decoration:none}
.website .account-notification-badge:hover{background:#94223a}
.website .account-notification-badge:focus-visible{outline:2px solid var(--theme-focus,#9b6b19);outline-offset:2px}
@media(max-width:760px){.website .site-header>.header-account{margin-left:auto}}
@media(max-width:650px){.website .header-account .profile-link{height:40px;min-height:40px}}
@media(max-width:360px){.website .site-header>.header-account{max-width:120px;min-width:0}.website .header-account .profile-link{max-width:100%}}
.nickname-edit{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.nickname-edit [hidden]{display:none!important}.nickname-edit [data-nickname-display]{font-size:1.15rem;font-weight:700;flex:1}.nickname-edit input{min-width:160px;flex:1}.nickname-edit button{min-height:40px}
/* Scoped visual choices keep native radio keyboard and form behavior. */
.profile-editor .background-swatch{display:block;width:100%;height:42px;border-radius:6px;background-color:#428391;background-image:var(--pattern);background-size:var(--pattern-size,48px 48px)}
.profile-editor .profile-theme-option:has(input:focus-visible),.piece-style-card:focus-visible{outline:3px solid #967020;outline-offset:3px}
.appearance-sample{--pattern:none;--pattern-size:48px 48px;padding:16px;border-radius:14px;background-color:var(--profile-pale);background-image:var(--pattern);background-size:var(--pattern-size);color:var(--profile-ink)}
.appearance-sample>div{display:grid;gap:6px;padding:18px;border-radius:10px;background:linear-gradient(120deg,var(--profile-ink),var(--profile-accent));color:white}.appearance-sample span,.appearance-sample p{font-size:12px}.appearance-sample p{margin-bottom:0}
.piece-style-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.piece-style-card{border:1px solid #c7d8d4;border-radius:12px;padding:12px;min-width:0;background:#fff}.piece-style-card[aria-pressed="true"]{border-color:#287b89;box-shadow:0 0 0 2px #287b89;background:#eff8f5}.piece-style-card label{display:flex;flex-wrap:wrap;align-items:center;gap:7px;cursor:pointer}.piece-style-card input{width:16px!important;margin:0!important;flex-shrink:0}.piece-style-card strong{font-size:13px}.piece-style-card span{font-size:11px;width:100%;color:#5f7174}.piece-style-card button{font-size:12px;width:100%;margin-top:10px;min-height:36px}.piece-style-card:has(input:disabled) label{cursor:not-allowed}
.piece-preview{margin-top:20px;border:1px solid #c7d8d4;border-radius:14px;padding:14px;background:#f6f8f5;color:#233e43}.piece-preview h3{margin:0 0 12px}.piece-kind-controls,.piece-view-controls{display:flex;gap:6px;flex-wrap:wrap}.piece-kind-controls button,.piece-view-controls button{min-height:38px;font-size:12px;padding:7px 10px}.piece-kind-controls button[aria-pressed=true]{background:#123f52;color:white;border-color:#123f52}.piece-preview-canvas{height:300px;width:100%;margin-top:12px;overflow:hidden;border-radius:10px;display:grid;place-items:center;background:#eef2ee}.piece-preview-canvas canvas{display:block;max-width:100%;touch-action:none}.piece-preview-canvas p{padding:20px}.piece-preview [data-piece-status]{font-size:12px;min-height:32px}.piece-preview small{display:block;margin-top:12px;line-height:1.5}
@media(max-width:650px){.piece-style-choices{grid-template-columns:repeat(2,minmax(0,1fr))}.piece-preview{padding:10px}.piece-preview-canvas{height:260px}}

.profile-editor .piece-style-thumb{width:100%;height:90px;object-fit:cover;border-radius:7px;background:#eef2ee}.piece-style-thumb:not([src]){display:none}
.piece-preview-canvas canvas{width:100%;height:100%}.appearance-sample>p{color:var(--profile-ink)}
html[data-theme="dark"] .piece-style-card,html[data-theme="dark"] .piece-preview{background:#233747;border-color:#4a6570;color:#e3edf4}
html[data-theme="dark"] .piece-style-card[aria-pressed="true"]{background:#244b4c;border-color:#8cb9b0;box-shadow:0 0 0 2px #8cb9b0}
html[data-theme="dark"] .piece-style-card span{color:#c2d2d8}
html[data-theme="dark"] #profile-form .piece-style-card label,html[data-theme="dark"] #profile-form .piece-style-card strong,html[data-theme="dark"] #profile-form .piece-preview h3,html[data-theme="dark"] #profile-form .piece-preview p,html[data-theme="dark"] #profile-form .piece-preview small{color:#e3edf4}
html[data-theme="dark"] #profile-form .piece-style-card button,html[data-theme="dark"] #profile-form .piece-preview button{background:#304b5c;color:#e3edf4;border:1px solid #56707e;border-radius:6px}
html[data-theme="dark"] #profile-form .piece-preview button[aria-pressed="true"]{background:#336d72;border-color:#96c3bf}
#profile-form .piece-preview button,#profile-form .piece-style-card button{border-radius:6px}
/* Account scenery spans the body beneath the shared header, including footer. */
.website>.account-backdrop{width:100%;flex:1;display:flex;flex-direction:column;border-radius:0;padding:0;overflow:visible}
.website>.account-backdrop>main{width:min(100% - 48px,1200px);margin:0 auto;padding:36px 0;flex:1}
.website>.account-backdrop>footer{width:min(100% - 48px,1200px);margin:0 auto;padding:28px 0;color:var(--profile-ink)}
.website>.account-backdrop .account-panel{max-width:none}
.customization-panel .avatar-choices{display:flex;flex-wrap:wrap;gap:12px}
.customization-panel .avatar-choices label,.customization-panel .avatar-choices label *{cursor:pointer}
.customization-panel .avatar-add{width:66px;height:66px;min-width:66px;border:2px dashed #688b91;border-radius:50%;font-size:32px;display:grid;place-items:center;padding:0;cursor:pointer;background:#ffffffb0;color:#284d59}
.customization-panel .avatar-choices label:has(input:checked){outline:3px solid var(--profile-accent);border-radius:50%}
.customization-status{position:sticky;bottom:12px;padding:10px 16px;background:#eef8f3;border:1px solid #b8d5c8;border-radius:10px;color:#234b3a;font-size:13px!important;width:fit-content}
.profile-hero .profile-membership{font-size:13px;font-weight:700;color:#ffe3a2;letter-spacing:.08em}
.profile-membership span{color:#ffd166}
.notifications-panel>[data-action="refresh-notifications"]{margin-top:24px}
@media(max-width:650px){.website>.account-backdrop>main,.website>.account-backdrop>footer{width:calc(100% - 32px)}}
.website:has(>.account-backdrop){display:flex;flex-direction:column}
.customization-panel .avatar-add img{width:60px;height:60px;border-radius:50%}
/* Unified profile and consistent customization controls. */
.public-profile{border:0}.profile-content{padding:0;gap:24px}.profile-stats{gap:12px}.profile-recent{padding:24px;background:#fffffff5;border-radius:18px}.profile-hero .profile-membership{font-size:16px}
.profile-nickname-form{margin:0;max-width:none}.profile-nickname-form .nickname-edit{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.profile-nickname-form .nickname-edit input{width:min(280px,100%)}.profile-nickname-form .form-error:empty{display:none}.profile-nickname-form button{flex:none}
.customization-panel fieldset{border:0;padding:0;margin:0 0 28px}.customization-panel legend{font-size:20px;font-weight:750;margin:0 0 18px;padding:0}.customization-panel .avatar-choices{align-items:center;gap:12px}.customization-panel .avatar-choices>label,.customization-panel .avatar-add{box-sizing:border-box;flex:0 0 68px;width:68px;height:68px;min-width:68px;min-height:68px;max-width:68px;max-height:68px;margin:0!important;padding:0!important;border-radius:50%;aspect-ratio:1;display:grid;place-items:center;position:relative}.customization-panel .avatar-choices>label>span{display:grid;place-items:center;width:64px;height:64px;border-radius:50%;padding:0}.customization-panel .avatar-choices img{width:60px;height:60px;object-fit:cover;border-radius:50%}.customization-panel .avatar-choices input{position:absolute;opacity:0;width:1px;height:1px}.customization-panel .avatar-choices label:has(input:checked){outline:3px solid #df8d24;outline-offset:2px}.customization-panel .avatar-choices label:has(input:focus-visible){outline:3px solid #247a98}.customization-status{display:none}
.account-panel .premium-membership{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:24px 0 28px;flex-wrap:wrap}.profile-editor [aria-readonly="true"]{opacity:.65;cursor:pointer;background:#edf0f2}.profile-editor [aria-readonly="true"]:focus{outline:2px solid #a3752c}
@media(max-width:700px){.profile-content{padding:0}.profile-hero .profile-membership{font-size:15px}.profile-recent{padding:18px}.profile-recent .history-row{flex-wrap:wrap}.profile-recent .history-row>div{min-width:0}.customization-panel .avatar-choices{gap:10px}}
.profile-hero .nickname-edit h1{font-size:clamp(28px,4vw,44px);flex:0 1 auto}.profile-hero [data-nickname-edit]{background:#ffffff18;border:1px solid #ffffff70;color:white;border-radius:50%;width:40px;height:40px;padding:0}.profile-nickname-form .nickname-edit input{color:#233e43;background:#fff}
/* Opaque surfaces keep nickname actions readable over every profile background. */
.profile-hero .profile-nickname-form button[type="submit"],
.profile-hero .profile-nickname-form [data-nickname-cancel]{color:#172b3a;background:#fff;border:1px solid #c4ced6;border-radius:7px;padding:10px 16px;font-weight:600}
.profile-hero .profile-nickname-form button[type="submit"]:hover,
.profile-hero .profile-nickname-form [data-nickname-cancel]:hover{color:#172b3a;background:#e8eef3}
.profile-hero .profile-nickname-form button:focus-visible{outline:3px solid #e5ad44;outline-offset:3px}
.public-profile>.profile-hero{margin-bottom:24px}

.customization-panel .customization-status{display:block}.customization-panel .customization-status:empty{display:none}.customization-panel .avatar-choices .avatar-add.is-selected{outline:3px solid #df8d24;outline-offset:2px;border:0;box-shadow:none;border-radius:50%}
