/* Illustrated wardrobe, with real controls and readable live labels above the art. */
.hskduel-ui #modal:has(.profile-studio){width:min(780px,calc(100vw - 28px));max-width:780px;padding:clamp(20px,3vw,38px);border-radius:30px;background:radial-gradient(ellipse at top,#20373b 0,#10191d 48%,#0e1215 100%);color:#f4f0e5;border:1px solid #8f805355;box-shadow:0 24px 100px #0008}
.profile-studio{width:100%;max-width:100%;box-sizing:border-box}.profile-studio-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.profile-studio-head h2{font-size:clamp(22px,3vw,32px);margin:0}.profile-hero{display:flex;align-items:center;flex-direction:column;padding:22px 0 12px;gap:10px}.profile-hero>.profile-icon{width:250px;height:250px;margin:8px 0 14px}.profile-hero h3{font-size:26px;margin:0}.profile-icon{position:relative;overflow:visible!important;isolation:isolate;flex-shrink:0}.profile-icon>.profile-icon-crop,.profile-icon>.encounter-portrait,.profile-icon>img{position:absolute!important;inset:8%;width:84%!important;height:84%!important;border-radius:50%;overflow:hidden;box-sizing:border-box;object-fit:contain;background:#111b22}.profile-icon>.encounter-portrait{display:block;border:0;box-shadow:none}.profile-icon>.profile-icon-crop{display:block}.avatar-frame{display:block;position:absolute;inset:-7%;z-index:2;pointer-events:none;background:url('/hskduel/frames-slim.png') no-repeat;background-size:369% 402%;background-position:calc(var(--frame-col)*42.65% + 7%) calc(var(--frame-row)*32.25% + 1%)}
.avatar-frame[data-rarity=Legendary]{filter:drop-shadow(0 0 4px #e8bd6266)}.avatar-frame[data-rarity=Epic]{filter:drop-shadow(0 0 3px #aebffb44)}
.profile-region{display:flex;align-items:center;gap:8px;min-height:20px}.country-flag{width:28px;height:21px;object-fit:cover;border-radius:3px;box-shadow:0 0 0 1px #ffffff26;vertical-align:middle}.profile-name{display:grid;gap:7px;font-size:13px;color:#b9c5c6}.profile-name input,.flag-search input{border-radius:12px!important;background:#ffffff09!important;color:inherit!important;border:1px solid #ffffff25!important;padding:12px!important;width:100%;box-sizing:border-box}.wardrobe-menu{display:grid;gap:8px;margin:18px 0}.wardrobe-menu button{display:flex;align-items:center;justify-content:space-between;text-align:left;padding:13px 16px!important;background:linear-gradient(120deg,#30444288,#142326aa)!important;border:1px solid #a7ba9f20!important;border-radius:14px!important;color:#f4f0e5!important}.wardrobe-menu small{display:block;font-size:12px;color:#aabdb8;margin-top:4px}.profile-studio>button{width:100%;margin-top:10px}.wardrobe-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin:24px 0;max-height:58dvh;overflow:auto;padding:12px}.wardrobe-item{display:flex!important;flex-direction:column;align-items:center;gap:10px;border-radius:18px!important;padding:17px 8px!important;background:#ffffff06!important;border:1px solid #ffffff12!important;color:inherit!important;text-align:center}.wardrobe-item[aria-pressed=true]{border-color:#d4b778!important;box-shadow:0 0 20px #c4a26125}.wardrobe-item>.profile-icon{width:116px;height:116px;margin:8px}.wardrobe-item strong{font-size:13px}.wardrobe-item small{font-size:11px}.wardrobe-item.is-locked{opacity:.48;filter:saturate(.5)}.flag-search{display:grid;gap:8px;margin:24px 0 15px}.country-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:53dvh;overflow:auto}.country-grid button{display:flex;gap:12px;align-items:center;text-align:left;border-radius:12px!important;color:inherit!important;background:#ffffff06!important;border:1px solid #ffffff16!important;padding:11px!important;font-size:13px!important}.country-grid button[hidden]{display:none}.country-grid button[aria-pressed=true]{border-color:#d4b778!important}.title-choices{display:flex;flex-wrap:wrap;gap:12px;margin:24px 0;max-height:55dvh;overflow:auto}.title-choices button{font-size:16px!important}.profile-studio [data-rarity=Rare]{color:#80c9ff}.profile-studio [data-rarity=Epic]{color:#c59fff}.profile-studio [data-rarity=Legendary]{color:#f3c46f}.profile-studio details{font-size:13px;margin-top:16px;color:#becbc7}.profile-studio details li{margin:8px 0}.profile-studio summary{cursor:pointer;padding:8px 0}.reward-history{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px}.treasure-stage{display:flex;flex-direction:column;align-items:center;text-align:center;position:relative;min-height:330px;padding:18px}.chest-art{display:block;width:260px;height:260px;max-width:80vw;background-image:url('/hskduel/chests-illustrated.png');background-size:300% 200%;background-position:calc(var(--chest-col)*50%) 0;mask-image:radial-gradient(ellipse at center,#000 45%,transparent 73%)}.chest-art.is-open{background-position-y:100%}.treasure-stage>button{margin:20px 0 0;min-width:180px}.treasure-stage.is-opening .chest-art{animation:chest-rattle .22s ease-in-out infinite alternate}.treasure-stage.is-revealed .chest-art{width:180px;height:180px;opacity:.65}.treasure-reward{display:flex;flex-direction:column;align-items:center;gap:14px;animation:treasure-reveal .65s ease-out}.treasure-reward h3{margin:0;font-size:25px}.treasure-reward>.profile-icon{width:120px;height:120px}.reward-frame{display:block;position:relative;width:130px;height:130px}.chest-progress{display:grid;gap:9px;text-align:center;font-size:13px;color:#aabdb8}.chest-progress progress{width:100%;accent-color:#d4b778;height:8px}.treasure-reward>button{min-width:180px}.profile-studio #wardrobe-status{padding-top:12px;min-height:20px;color:#f3c46f}#wardrobe-status:empty{padding:0;min-height:0}
@keyframes chest-rattle{from{transform:rotate(-2deg) translateY(0)}to{transform:rotate(2deg) translateY(-5px)}}@keyframes treasure-reveal{from{opacity:0;transform:translateY(24px) scale(.9)}to{opacity:1;transform:none}}
@media(max-width:520px){.profile-hero>.profile-icon{width:210px;height:210px}.wardrobe-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.country-grid{grid-template-columns:1fr}.profile-hero{padding:8px 0}.wardrobe-menu button{padding:11px 14px!important}.profile-studio-head h2{font-size:22px}}
@media(prefers-reduced-motion:reduce){.treasure-stage.is-opening .chest-art,.treasure-reward{animation:none}}
/* Popup centre is the viewport centre, independent of inherited dialog margins. */
dialog.medal-unlock[open]{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;padding:clamp(12px,3vw,28px)!important;display:grid!important;place-items:center!important;overflow:auto!important;box-sizing:border-box!important}.medal-unlock .medal-unlock-body{width:min(640px,100%)!important;min-width:0!important;margin:auto!important;padding:clamp(20px,4vw,38px)!important;display:flex!important;flex-direction:column!important;align-items:center!important;text-align:center!important;box-sizing:border-box!important}.medal-unlock-body>*{max-width:100%;box-sizing:border-box}.medal-unlock .medal-emblem{margin-inline:auto!important;align-self:center!important;position:relative}.medal-unlock-body button{width:100%!important;margin-inline:0!important}
/* Larger target word, while preserving the complete readable sentence. */
.example-zh{font-size:25px;line-height:1.9}.example-zh strong{font-size:1.5em!important;font-weight:750;color:var(--accent,#f0c88a);display:inline-block;vertical-align:baseline}.example-sentence-audio{margin-top:16px!important}.sentence-question{font-size:clamp(26px,4vw,46px);line-height:1.7;max-width:950px;margin:auto}.sentence-question .sentence-gap{display:inline-block;min-width:2.5em;border-bottom:2px solid currentColor;color:#e4bd7a}.sentence-instruction{font-size:14px;color:var(--muted);margin-bottom:16px}
@media(min-width:680px){.hskduel-ui #modal:has(.profile-studio){width:min(880px,calc(100vw - 40px));max-width:880px}.profile-studio[data-profile-panel=home]{display:grid;grid-template-columns:280px minmax(0,1fr);gap:12px 30px}.profile-studio[data-profile-panel=home] .profile-studio-head{grid-column:1/-1;margin-bottom:8px}.profile-studio[data-profile-panel=home] .profile-hero{grid-column:1;grid-row:2/6;padding-top:28px}.profile-studio[data-profile-panel=home] .profile-name,.profile-studio[data-profile-panel=home] .wardrobe-menu,.profile-studio[data-profile-panel=home]>button,.profile-studio[data-profile-panel=home] #wardrobe-status{grid-column:2}.profile-studio[data-profile-panel=home] .wardrobe-menu{margin:4px 0}.profile-studio[data-profile-panel=home]>button{margin:0}.profile-studio[data-profile-panel=home] .profile-hero h3{max-width:220px;overflow-wrap:anywhere}}
#modal:has(.story-confirm) #modal-close,#modal:has(.story-confirm)>form,#modal:has(.story-confirm)>button{display:none!important}

.hskduel-ui .duel-profile>.profile-icon{width:112px!important;height:112px!important}.hskduel-ui .duel-player .profile-icon{width:82px!important;height:82px!important}@media(max-width:520px){.hskduel-ui .duel-profile>.profile-icon{width:96px!important;height:96px!important}.hskduel-ui .duel-player .profile-icon{width:66px!important;height:66px!important}}
/* Exclude the neighbouring atlas row below each frame. */
.avatar-frame{clip-path:inset(0 0 6% 0)}
/* Reserve a clear portrait aperture; ornaments sit around the character. */
.hskduel-ui .profile-icon.has-frame>.profile-icon-crop,.hskduel-ui .profile-icon.has-frame>.encounter-portrait,.hskduel-ui .profile-icon.has-frame>img{inset:18%;width:64%!important;height:64%!important}
.hskduel-ui .profile-icon.has-frame{background:radial-gradient(circle,#17252c 52%,transparent 53%)}
.profile-hero>.profile-icon{width:280px;height:280px}
.profile-studio .player-title[data-rarity=Mythical],.chest-info-dialog [data-rarity=Mythical]{color:#f79eea}
.profile-studio .player-title[data-rarity=Common]{color:#cad5d7}.profile-studio .player-title[data-rarity=Uncommon]{color:#8bd1a4}
.title-choices{display:block;max-height:58dvh;overflow:auto;padding:4px}.title-rarity-group{margin-top:24px}.title-rarity-group h3{font-size:15px;margin:0 0 10px}.title-rarity-group>div{display:flex;flex-wrap:wrap;gap:10px}.title-rarity-group button{background:#ffffff08;border:1px solid #ffffff20;border-radius:12px;padding:12px 16px}.title-rarity-group button[aria-pressed=true]{outline:2px solid currentColor;outline-offset:2px}
.profile-equipped-medals{display:flex;gap:10px;justify-content:center}.profile-equipped-medals .medal-emblem{width:54px;height:66px}.profile-equipped-medals .achievement-medal{width:54px;height:54px}.profile-medal-heading{margin-top:22px}.medal-picker .medal-emblem{width:100px;height:118px}.medal-picker .achievement-medal{width:100px;height:100px}.medal-picker .medal-rank{font-size:12px}.medal-picker button:disabled{opacity:.45}
.fast-chest{display:flex;align-items:center;justify-content:center;gap:10px;font-size:15px;margin:18px 0}.fast-chest input{width:18px;height:18px;min-height:18px;accent-color:#e4c484}.chest-help-actions{display:flex;justify-content:center;gap:12px;margin-top:22px}.chest-help-actions button{border-radius:12px;background:#ffffff08;color:inherit}.chest-info-dialog{width:min(540px,calc(100vw - 32px));box-sizing:border-box;border-radius:24px;padding:28px;background:#142024;color:#f4f0e5;border:1px solid #b0a17644;box-shadow:0 24px 100px #0009}.chest-info-dialog::backdrop{background:#0008;backdrop-filter:blur(5px)}.chest-info-dialog h2{margin-top:0}.chest-info-dialog li{line-height:1.65;margin:12px 0}.chest-info-dialog>button{width:100%;margin-top:12px}
.treasure-stage:has(.chest-reel){min-height:340px;justify-content:center;gap:28px;padding:20px 0}.chest-reel{width:100%;position:relative;overflow:hidden;border-radius:18px;background:#090f13;border:1px solid #e5c67544;padding:24px 0;box-shadow:inset 0 0 30px #0008;mask-image:linear-gradient(90deg,transparent,#000 5%,#000 95%,transparent)}.chest-reel-track{display:flex;gap:12px;width:max-content;will-change:transform}.chest-reel-card{flex:none;width:140px;height:210px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px;padding:14px 10px;background:linear-gradient(#263139,#172127);border:1px solid #ffffff16;border-bottom:4px solid currentColor;border-radius:14px;color:#a6c7df;text-align:center}.chest-reel-card>.profile-icon,.chest-reel-card>.reward-frame{width:86px;height:86px;flex:none}.chest-reel-card>strong{font-size:13px;line-height:1.35;min-height:34px;display:flex;align-items:center}.chest-reel-card>small{font-size:11px}.chest-reel-card .player-title{font-size:13px;min-height:86px;display:grid;place-items:center}.chest-reel-pointer{position:absolute;top:10px;bottom:10px;left:50%;width:2px;background:#ffe0a1;z-index:4;box-shadow:0 0 15px #ffd074;pointer-events:none}.chest-reel-pointer:before,.chest-reel-pointer:after{content:'';position:absolute;left:-7px;border:8px solid transparent}.chest-reel-pointer:before{top:-10px;border-top-color:#ffe0a1}.chest-reel-pointer:after{bottom:-10px;border-bottom-color:#ffe0a1}
@media(max-width:520px){.profile-hero>.profile-icon{width:240px;height:240px}.chest-reel-card{width:112px;height:186px}.chest-reel-card>.profile-icon,.chest-reel-card>.reward-frame{width:72px;height:72px}.chest-help-actions{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){.chest-reel-track{will-change:auto}.treasure-reward{animation:none}}
/* The same title rarity has the same colour on profiles, duel cards and leaderboards. */
.hskduel-ui .player-title[data-rarity=Common]{color:#cad5d7;border-color:#cad5d755}.hskduel-ui .player-title[data-rarity=Rare]{color:#80c9ff;border-color:#80c9ff66}.hskduel-ui .player-title[data-rarity=Epic]{color:#c59fff;border-color:#c59fff66}.hskduel-ui .player-title[data-rarity=Legendary]{color:#f3c46f;border-color:#f3c46f77}.hskduel-ui .player-title[data-rarity=Mythical]{color:#f79eea;border-color:#f79eea88}
@media(min-width:680px){.profile-studio[data-profile-panel=home]{grid-template-rows:auto auto auto auto;grid-auto-rows:min-content;align-items:start}.profile-studio[data-profile-panel=home] .profile-hero{grid-row:2/5;align-self:start;min-height:0}.profile-studio[data-profile-panel=home] .profile-name{grid-row:2}.profile-studio[data-profile-panel=home] .wardrobe-menu{grid-row:3}.profile-studio[data-profile-panel=home] #wardrobe-status{grid-row:4}}
.hskduel-ui #modal:has(.profile-studio){height:fit-content;max-height:calc(100dvh - 36px);overflow:auto}.hskduel-ui #modal:has(.profile-studio) #close-modal{margin-top:16px}

/* Clip portrait cells before scaling so adjacent artwork never enters a profile. */
.profile-icon-crop>svg{display:block;width:100%;height:100%;overflow:hidden}

/* Each atlas crop is centred inside the same square as its portrait. */
.avatar-frame:not(.mythical-frame){inset:0;background:none;clip-path:none;display:grid;place-items:center}
.avatar-frame:not(.mythical-frame)>svg{display:block;width:100%;height:auto;overflow:hidden}
.board-player{display:inline-flex;align-items:center;gap:14px;vertical-align:middle;min-width:0}
.board .board-player>.profile-icon{width:72px;height:72px;margin:4px 0;flex:none}
.board-player-name{display:inline-flex;align-items:center;gap:8px;font-size:18px;font-weight:700;overflow-wrap:anywhere}
.member-crown{display:inline-block;width:24px!important;height:24px!important;object-fit:contain;flex:none;vertical-align:middle}
@media(max-width:520px){.board .board-player>.profile-icon{width:60px;height:60px}.board-player{gap:10px}.board-player-name{font-size:16px}.member-crown{width:21px!important;height:21px!important}}

.hskduel-ui .profile-icon{border-color:transparent;background:none}

@media(max-width:600px){
 .profile-board,.profile-board tbody{display:block;width:100%}
 .profile-board thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
 .profile-board tbody tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 10px;margin:14px 0;padding:18px 14px;border:1px solid var(--line);border-radius:18px}
 .profile-board tbody td{display:block;width:auto!important;min-width:0!important;padding:0!important;border:0!important;background:none!important;text-align:left;font-size:16px;white-space:normal}
 .profile-board tbody td:before{content:attr(data-label);display:block;font-size:11px;color:var(--muted);margin-bottom:7px;font-weight:400}
 .profile-board tbody td:first-child{grid-column:1/-1;display:flex;align-items:baseline;gap:6px;font-size:14px;color:var(--muted)}
 .profile-board tbody td:first-child:before{display:inline;margin:0}
 .profile-board tbody td:nth-child(2){grid-column:1/-1}
 .profile-board tbody td:nth-child(2):before{display:none}
 .profile-board .board-player{display:flex;max-width:100%;gap:10px}
 .profile-board .board-player-name{min-width:0;flex:1}
 .profile-board .profile-flag{margin:0;flex:none}
}
.hskduel-ui #modal:has(.profile-studio) :is(#wardrobe-back,#close-modal,#reward-dismiss){background:#ffffff12;color:#f4f0e5;border:1px solid #ffffff45;border-radius:12px}

/* The overview stays compact; large collections retain their own picker. */
.hskduel-ui #modal:has(.profile-studio[data-profile-panel=home]){padding:22px 26px}
.profile-studio[data-profile-panel=home] .wardrobe-menu{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0}
.profile-studio[data-profile-panel=home] .wardrobe-menu button{min-width:0;min-height:60px;padding:10px 12px!important;font-size:13px}
.profile-studio[data-profile-panel=home] .wardrobe-menu small{font-size:11px;line-height:1.3;overflow-wrap:anywhere}
.profile-studio[data-profile-panel=home] .profile-hero{gap:8px;padding:10px 0}
.profile-studio[data-profile-panel=home] .profile-hero>.profile-icon{width:190px;height:190px;margin:4px 0 10px}
.profile-studio[data-profile-panel=home] .profile-hero h3{font-size:22px;overflow-wrap:anywhere;text-align:center}
.profile-studio[data-profile-panel=home] .profile-equipped-medals{gap:10px;margin:4px 0}
.profile-studio[data-profile-panel=home] #account-membership{margin-top:0}
@media(min-width:680px){.profile-studio[data-profile-panel=home]{grid-template-columns:220px minmax(0,1fr);gap:12px 24px}.profile-studio[data-profile-panel=home] .profile-hero{grid-row:2/6}.profile-studio[data-profile-panel=home] #account-membership{grid-row:4}.profile-studio[data-profile-panel=home] #wardrobe-status{grid-row:5}.hskduel-ui #modal:has(.profile-studio[data-profile-panel=home]) #close-modal{margin-top:10px}}
@media(max-width:679px){.hskduel-ui #modal:has(.profile-studio[data-profile-panel=home]){padding:16px}.profile-studio[data-profile-panel=home] .profile-hero{display:grid;grid-template-columns:100px minmax(0,1fr);gap:5px 16px;margin:10px 0;text-align:left;align-items:center}.profile-studio[data-profile-panel=home] .profile-hero>.profile-icon{grid-column:1;grid-row:1/5;width:94px;height:94px;margin:0}.profile-studio[data-profile-panel=home] .profile-hero>:not(.profile-icon){grid-column:2}.profile-studio[data-profile-panel=home] .profile-hero h3{text-align:left;font-size:18px}.profile-studio[data-profile-panel=home] .profile-name{margin-bottom:12px}.profile-studio[data-profile-panel=home] .wardrobe-menu{margin-bottom:12px}.profile-studio[data-profile-panel=home] .profile-equipped-medals{justify-content:flex-start}.profile-studio[data-profile-panel=home] .wardrobe-menu button{min-height:56px;padding:8px 10px!important}.profile-studio[data-profile-panel=home] .profile-region{font-size:12px}.profile-studio[data-profile-panel=home] .player-title{font-size:12px;justify-self:start}}
.profile-studio[data-profile-panel=home] #wardrobe-status:not(:has(button)):has(>span:empty){display:none}
.profile-studio[data-profile-panel=home] [data-safety-settings]{grid-column:1/-1;display:flex;gap:8px}
.profile-studio [data-safety-settings]>button{flex:1;margin:0;min-height:36px;padding:8px;font-size:12px;background:#ffffff0a;color:inherit;border:1px solid #ffffff20;border-radius:12px}
.profile-studio[data-profile-panel=home] #account-membership{background:#ffffff0a;color:#f4f0e5;border:1px solid #d4b77855;border-radius:12px}
.profile-studio[data-profile-panel=home] .profile-studio-head #profile-overview-close{width:36px;height:36px;min-height:36px;padding:6px;margin:0!important;font-size:20px}
.profile-studio[data-profile-panel=home] .profile-studio-head h2{margin-right:auto}
@media(min-width:680px){.profile-studio[data-profile-panel=home]{grid-template-rows:auto auto auto auto auto auto;gap:8px 24px}.profile-studio[data-profile-panel=home] .profile-hero{grid-row:2/5}.profile-studio[data-profile-panel=home] .wardrobe-menu button{min-height:52px;padding:8px 12px!important}.profile-studio[data-profile-panel=home] .profile-studio-head{margin-bottom:6px}.profile-studio[data-profile-panel=home] [data-safety-settings]{grid-row:6}}

.hskduel-ui #modal:has(.profile-studio[data-profile-panel=home]) #close-modal{display:none}

.profile-studio[data-profile-panel=home] #profile-overview-close{background:#ffffff12;color:#f4f0e5;border:1px solid #ffffff45;border-radius:12px}
