/* Profile components share the site's glass material, without changing GIF media. */
.profile-dialog{--profile-surface:var(--ui-opaque,#1b1422);width:min(850px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 32px);padding:0;margin:auto;border:1px solid var(--ui-edge,var(--line));border-radius:30px;background:var(--ui-reflection),var(--profile-surface);box-shadow:var(--ui-depth),0 24px 90px #0006;color:var(--text);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;color-scheme:dark}
html[data-theme="light"] .profile-dialog{color-scheme:light}
.profile-dialog[open]{animation:profileAppear .2s ease-out}
.profile-dialog::backdrop{background:#12091b99;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
.profile-dialog *, .profile-dialog *::before,.profile-dialog *::after{box-sizing:border-box}
.profile-dialog [hidden]{display:none!important}
.profile-top{position:sticky;top:0;z-index:6;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 22px;background:var(--ui-reflection),var(--profile-surface);border-bottom:1px solid var(--ui-edge)}
.profile-top small{font-size:9px;font-weight:750;letter-spacing:.15em;color:var(--muted)}
.profile-top h2{margin:3px 0 0;font-size:23px;letter-spacing:-.04em}
.profile-dialog button,.profile-dialog input,.profile-dialog select,.profile-dialog textarea{font:inherit}
.profile-dialog button{min-height:42px;padding:9px 13px;border:1px solid var(--ui-edge);border-radius:13px;background:var(--ui-reflection),var(--ui-control);color:var(--text);cursor:pointer}
.profile-dialog button:disabled{opacity:.55;cursor:not-allowed}
.profile-dialog button:not(:disabled):hover{border-color:var(--lg-accent)}
#profileClose{width:44px;height:44px;min-height:44px;flex:none;border-radius:16px;padding:0;font-size:26px}
.profile-notice{margin:16px 22px;padding:12px 14px;font-size:11px;line-height:1.6;color:var(--muted);border:1px solid var(--ui-edge);border-radius:16px;background:var(--ui-control)}
#profileLoading,#profileFailure{margin:22px;font-size:13px}
#profileBody{padding:0 22px 20px}
.profile-identity{border:1px solid var(--ui-edge);border-radius:24px;overflow:hidden;background:var(--ui-reflection),var(--ui-card)}
.profile-cover{height:145px;position:relative;overflow:hidden;background:radial-gradient(ellipse at 80% 25%,#f0b2df66,transparent 50%),radial-gradient(ellipse at 15% 100%,#b69be177,transparent 65%),linear-gradient(125deg,#382344,#6e4e8f 55%,#36213f)}
.profile-cover::after{content:"";position:absolute;inset:12px;border:1px solid #ffffff24;border-radius:16px;pointer-events:none}
.profile-cover img{display:block;width:100%;height:100%;object-fit:cover}
.profile-cover-mark{position:absolute;right:38px;top:17px;font-size:74px;font-weight:300;color:#f5d7f44d;transform:rotate(8deg);pointer-events:none}
.profile-cover-caption{position:absolute;left:24px;bottom:22px;color:#ffefffbb;font-size:9px;letter-spacing:.15em;text-transform:uppercase}
.profile-identity-content{position:relative;padding:56px 22px 22px}
.profile-avatar{position:absolute;top:-42px;left:22px;width:82px;height:82px;display:grid;place-items:center;border:4px solid var(--profile-surface);border-radius:50%;background:linear-gradient(140deg,#cfb0ed,#8b62b5);box-shadow:0 7px 25px #32213e40;color:#fff;font-size:23px;font-weight:850;letter-spacing:-.05em;overflow:hidden}
.profile-avatar img{width:100%;height:100%;object-fit:cover}
.profile-device{position:absolute;right:18px;top:16px;border:1px solid var(--ui-edge);border-radius:99px;padding:5px 8px;color:var(--muted);font-size:8px;font-weight:750;letter-spacing:.05em}
.profile-identity h3{margin:0;font-size:clamp(23px,5vw,31px);line-height:1.25;letter-spacing:-.04em;overflow-wrap:anywhere}
#profileUsername{margin:5px 0 12px;font-size:12px}
#profileBio{max-width:560px;margin:0 0 16px;font-size:13px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.profile-muted{color:var(--muted);font-size:11px;line-height:1.6}
.profile-facts{display:flex;flex-wrap:wrap;gap:10px 20px;font-size:10px;color:var(--muted)}
.profile-facts strong{font-size:18px;color:var(--text);font-weight:800}
.profile-moods{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}
.profile-moods>span{padding:6px 10px;background:var(--ui-control);border:1px solid var(--ui-edge);border-radius:99px;font-size:10px}
.profile-moods>.profile-muted{padding:0;border:0;background:none}
.profile-moods button{min-height:38px;font-size:11px;border-radius:99px}
.profile-moods button[aria-pressed="true"]{background:var(--lg-selected);border-color:var(--lg-accent)}
.profile-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin:20px 0 14px;padding:5px;border:1px solid var(--ui-edge);border-radius:20px;background:var(--ui-control)}
.profile-tabs button{border:1px solid transparent;background:none;min-width:0;font-size:11px;padding:10px 5px;line-height:1.3}
.profile-tabs button[aria-selected="true"]{background:var(--ui-reflection),var(--lg-selected);border-color:var(--lg-accent);box-shadow:inset 0 1px 0 #ffffff20}
.profile-favorite-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.profile-favorite-grid .v53-card .v53-media{height:190px}
.profile-favorite-grid .v53-card .v53-actions{opacity:1;visibility:visible;pointer-events:auto;transform:none}
.profile-saved-badge{display:grid;place-items:center;color:var(--lg-accent);pointer-events:none}
.profile-saved-badge svg{fill:currentColor}
.profile-empty{padding:26px 18px;text-align:center;line-height:1.65;font-size:12px;border:1px solid var(--ui-edge);border-radius:23px;background:var(--ui-reflection),var(--ui-control)}
.profile-empty h3{font-size:19px;margin:8px 0;color:var(--text)}
.profile-empty p{max-width:430px;margin:8px auto 18px;color:var(--muted)}
.profile-empty-icon{display:grid;place-items:center;margin:auto;width:64px;height:64px;border:1px solid var(--ui-edge);border-radius:20px;background:linear-gradient(140deg,#cfa9e733,#9672ba22);color:var(--lg-accent);font-size:36px}
#profileCollectionGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:12px}
.profile-stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:14px}
.profile-stat-grid>div,.profile-collection-tile{padding:20px;border:1px solid var(--ui-edge);border-radius:22px;background:var(--ui-reflection),var(--ui-control)}
.profile-stat-grid strong{display:block;font-size:34px}.profile-stat-grid span{display:block;font-size:11px;color:var(--muted)}
.profile-dialog fieldset{min-width:0;margin:18px 0;padding:16px;border:1px solid var(--ui-edge);border-radius:22px;background:var(--ui-reflection),var(--ui-control)}
.profile-dialog legend{padding:0 7px;font-size:13px;font-weight:750}
.profile-dialog label{display:flex;flex-direction:column;gap:7px;font-size:11px;font-weight:650;margin:12px 0;min-width:0}
.profile-field-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.profile-dialog :is(input:not([type="checkbox"]),select,textarea){display:block;width:100%;min-width:0;min-height:44px;padding:11px 12px;border:1px solid var(--ui-edge);border-radius:13px;background:var(--lg-input);color:var(--text);font-size:16px}
.profile-dialog input[type="file"]{font-size:11px;padding:9px 6px}
.profile-dialog input::file-selector-button{font:inherit;border:0;border-radius:7px;padding:6px;background:var(--lg-selected);color:var(--text);margin-right:7px}
.profile-dialog textarea{resize:vertical;max-height:220px}
.profile-dialog .profile-check{display:flex;flex-direction:row;align-items:center;gap:10px;min-height:44px}
.profile-check input{accent-color:var(--lg-accent);width:18px;height:18px}
.profile-field-label{font-size:11px;font-weight:650}
.profile-save-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.profile-dialog .profile-primary{background:var(--lg-selected);border-color:var(--lg-accent);font-weight:750}
#profileDraftStatus{font-size:11px;color:var(--muted);line-height:1.5;flex:1;min-width:140px}
.profile-danger{border-color:#b7778a66!important}.profile-danger button{color:var(--text)}
.profile-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:22px;padding-top:16px;border-top:1px solid var(--ui-edge)}
.profile-footer>span{font-size:10px;color:var(--muted)}
body.profile-open{overflow:hidden}
body.profile-open :is(.mobile-dock,.dock-reveal,.v531-feedback-island){visibility:hidden;pointer-events:none}
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){.profile-dialog{background:var(--ui-reflection),var(--ui-lens);backdrop-filter:blur(22px) saturate(1.3);-webkit-backdrop-filter:blur(22px) saturate(1.3)}}
@media(max-width:700px){.profile-dialog{width:100%;max-height:96dvh;margin:auto 0 0;border-radius:28px 28px 0 0}.profile-top{padding:16px}.profile-notice{margin:12px 14px}.profile-top h2{font-size:21px}#profileBody{padding:0 14px calc(18px + env(safe-area-inset-bottom,0px))}.profile-cover{height:125px}.profile-identity-content{padding:51px 16px 18px}.profile-avatar{left:16px;width:76px;height:76px;top:-38px}.profile-favorite-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.profile-favorite-grid .v53-card .v53-media{height:170px}.profile-tabs{grid-template-columns:1fr 1fr;border-radius:20px}.profile-tabs button{font-size:11px;min-height:44px}.profile-field-grid{grid-template-columns:1fr;gap:0}.profile-dialog fieldset{padding:13px}.profile-device{font-size:7px}.profile-facts{gap:8px 12px;font-size:9px}}
@media(prefers-reduced-transparency:reduce){.profile-dialog{background:var(--profile-surface);backdrop-filter:none;-webkit-backdrop-filter:none}.profile-dialog::backdrop{backdrop-filter:none;-webkit-backdrop-filter:none}}
@media(prefers-reduced-motion:reduce){.profile-dialog[open]{animation:none}.profile-dialog *{transition:none!important;animation:none!important}}
@media(forced-colors:active){.profile-dialog,.profile-dialog button,.profile-dialog fieldset{background:Canvas;color:CanvasText;border-color:CanvasText;box-shadow:none}}
@keyframes profileAppear{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}

/* A saved photo or the same GK avatar used in the profile identity. */
#mobileNav .profile-open-button{width:100%;height:auto;min-height:48px;padding:0;gap:3px}
.dock-avatar{display:grid;place-items:center;position:relative;width:30px;height:30px;flex:none;overflow:hidden;border-radius:50%;border:1px solid #ead0ff80;background:linear-gradient(145deg,#cfb0ed,#8b62b5);box-shadow:inset 0 1px 0 #ffffff80,0 3px 9px #8e63b530;color:#fff;font-weight:850;font-size:11px;line-height:1;letter-spacing:-.05em}
.dock-avatar img{width:100%;height:100%;object-fit:cover}
.dock-avatar [hidden]{display:none}
.cover-crop {width:min(92vw,640px);box-sizing:border-box;color:#fafafa;background:#171719;border:1px solid #555;border-radius:18px;padding:18px}
.cover-crop::backdrop {background:#000b;backdrop-filter:blur(5px)}
.cover-crop canvas {display:block;width:100%;height:auto;touch-action:none;border-radius:8px;cursor:grab;margin:12px 0}
.cover-crop input {width:100%;margin:12px 0}
.cover-crop div,.kasa-player-controls {display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.cover-crop button,.kasa-player-controls button {padding:8px 14px;border-radius:12px;border:1px solid #777;background:#242426;color:white}
.kasa-player-controls input {min-width:0;width:min(100%,15rem)}
.profile-dialog .photo-trigger {position:absolute;inset:0;z-index:1;width:100%;height:100%;padding:0;min-height:0;border:0;border-radius:inherit;background:transparent;color:#fff}
.photo-trigger span {position:absolute;inset:auto 8px 8px auto;display:grid;place-items:center;width:28px;height:28px;border:1px solid #fff6;border-radius:50%;background:#171719cc;font-size:18px}
.profile-avatar .photo-trigger span {right:3px;bottom:3px;width:23px;height:23px;font-size:15px}
.profile-dialog .profile-sheet {box-sizing:border-box;width:min(90vw,420px);max-height:80dvh;overflow:auto;padding:18px;border:1px solid #ffffff38;border-radius:22px;background:#19191cf5;color:#fafafa;box-shadow:0 20px 70px #0008}
.profile-sheet::backdrop {background:#09090bbd;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.profile-sheet h3 {margin:0 0 14px}
.profile-sheet .sheet-actions {display:flex;gap:8px;margin-top:12px;justify-content:flex-end}
.profile-dialog .profile-sheet button {color:#f3f3f3;background:#303036;border-color:#55555d}
.profile-sheet #profileMoodChoices {max-height:48dvh;overflow:auto}
.profile-dialog .profile-sheet [aria-pressed=true] {background:#eee;color:#111;border-color:white}
#picturePreview {max-width:100%;width:100%;height:125px;object-fit:cover;border-radius:12px}
[data-kind=avatarUrl] #picturePreview {width:90px;height:90px;border-radius:50%}
#pictureStatus:empty {display:none}
.profile-avatar:has(.photo-trigger) {z-index:2}
.profile-mood-row {display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;margin:12px 0}
.profile-mood-row .profile-moods {margin:0}
#moodStatus:empty {display:none}
#openFriends,.friends-header button,.friends-identity button {min-height:44px;padding:.5rem .85rem;border:1px solid #ffffff35;border-radius:.85rem;background:#ffffff10;color:inherit;cursor:pointer}
.friends-header,.friends-identity {display:flex;align-items:center;justify-content:space-between;gap:.8rem;flex-wrap:wrap}
.friends-header h2,.friends-identity p {margin:0}
.friends-identity {margin:.9rem 0;padding:.8rem;border-radius:1rem;background:#ffffff0b}
#friendsSheet [data-friends] {display:grid;gap:.6rem}
#friendsSheet [data-friends] > div {padding:.7rem;border:1px solid #ffffff22;border-radius:.8rem}
#friendsSheet input {flex:1 1 10rem;min-height:44px}
.profile-dialog #friendsSheet {width:min(calc(100% - 28px),440px);max-width:none;margin:auto auto 14px;padding:22px;border-radius:24px;background:linear-gradient(150deg,#30343b,#15171a 66%);color:white;box-shadow:0 20px 70px #000c}
#friendsSheet form {display:grid;gap:16px}
.friend-fields {display:grid;grid-template-columns:minmax(0,1fr) 98px;background:#0b0d10;border:1px solid #ffffff30;border-radius:14px}
.friend-fields label {min-width:0;padding:10px 12px;color:#c5cad1;font-size:12px}
.friend-fields label+label {border-left:1px solid #ffffff30}
.profile-dialog #friendsSheet .friend-fields input {min-height:34px;width:100%;margin:0;padding:0;border:0;background:transparent;color:white;font-size:16px}
.friend-tag {display:flex;align-items:center;gap:5px;font-size:16px}
#friendsSheet form>button {min-height:44px;background:#f38b82;color:#190f10;font-weight:750;clip-path:polygon(0 0,100% 0,100% calc(100% - 9px),calc(100% - 9px) 100%,0 100%)}

.friend-fields {grid-column:1/-1;width:100%}
#friendsSheet form>button {width:100%}
.profile-footer .profile-account-action {display:inline-flex;align-items:center;min-height:44px;padding:0 14px;border:1px solid #ffffff30;border-radius:12px;background:#ffffff0d;color:inherit;text-decoration:none;font-weight:650}
