.profile-referrals {margin:0 0 32px;padding-bottom:32px;border-bottom:1px solid var(--border);font-family:var(--font-body,system-ui,sans-serif)}
.profile-section-head {display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:24px}
#overlay .profile-referrals h3 {font:600 22px/1.35 system-ui,sans-serif;margin:0 0 8px}
#overlay .profile-referrals h4 {font:600 18px/1.4 system-ui,sans-serif;margin:0 0 6px}
.profile-referrals p {max-width:65ch;font-size:14px;line-height:1.65}
.profile-section-head>button {flex-shrink:0}
.profile-referrals label {display:block;font-size:13px;margin-bottom:8px;color:var(--muted)}
.referral-share {display:flex;gap:10px}
.referral-share input {min-width:0;width:100%;padding:12px;background:var(--bg,#101e21);color:var(--text,#e2dcc7);border:1px solid var(--border);border-radius:0;font:14px/1.5 system-ui,sans-serif}
.referral-share button {flex-shrink:0}
.referral-customize,.referral-permanent {margin-top:12px;font-size:14px}
.referral-customize summary,.referral-permanent summary {min-height:44px;align-content:center;cursor:pointer}
.referral-customize label {margin-top:8px}
.referral-customize p {margin-top:8px;font-size:13px;color:var(--muted)}
#referral-name-status {overflow-wrap:anywhere;min-height:22px}
.referral-permanent .referral-share {margin-top:8px}
.referral-totals {display:flex;flex-wrap:wrap;gap:12px 28px;margin:24px 0;font-size:14px;color:var(--muted)}
.referral-totals b {color:var(--text,#e2dcc7);font-variant-numeric:tabular-nums}
.referral-reward {display:flex;align-items:center;gap:24px;padding:24px 0;border-block:1px solid var(--border)}
.referral-chest {width:110px;height:auto;aspect-ratio:6 / 5;flex-shrink:0;image-rendering:pixelated}
.referral-reward button {margin-top:16px;min-width:180px}
.referral-notice {margin:12px 0;color:var(--muted)}
.referral-odds {padding:20px 0;border-bottom:1px solid var(--border);font-size:14px}
.referral-odds summary {cursor:pointer;min-height:44px;display:list-item;align-content:center;color:var(--text,#e2dcc7)}
.referral-odds dl {display:flex;gap:12px 32px;flex-wrap:wrap;margin:18px 0}
.referral-odds dt {color:var(--muted);font-size:13px}
.referral-odds dd {margin:6px 0 0;font-variant-numeric:tabular-nums}
#overlay .profile-referrals .referral-tracking-title {margin-top:24px}
.referral-tracking {padding:0;list-style:none;margin:12px 0 0;max-height:340px;overflow:auto}
.referral-tracking li {display:flex;justify-content:space-between;gap:20px;align-items:center;padding:16px 0;border-bottom:1px solid var(--border);font-size:14px}
.referral-tracking small {display:block;color:var(--muted);margin-top:5px}
.referral-tracking li>span {font-size:13px;color:var(--muted);flex-shrink:0}
.referral-empty {margin:12px 0}
.referral-reveal {display:flex;align-items:center;gap:20px;margin-top:24px;padding:24px;border:1px solid var(--rarity);animation:referral-reveal .25s ease-out}
.referral-item-art {width:80px;flex-shrink:0}
.referral-item-art svg {width:100%;height:auto;image-rendering:pixelated}
.referral-rarity {display:block;font-size:13px;color:var(--rarity);margin-bottom:8px}
.referral-reveal small {display:block;margin-top:8px;color:var(--muted)}
.referral-reveal a {display:inline-flex;align-items:center;min-height:44px;color:var(--text,#e2dcc7);margin-top:8px}
@keyframes referral-reveal {from {opacity:0;transform:translateY(6px)}to {opacity:1;transform:translateY(0)}}
@media(max-width:600px){
 .profile-section-head {gap:12px;flex-wrap:wrap}
 #overlay .profile-referrals h3 {font-size:20px}
 .referral-share {flex-direction:column}
 .referral-reward {gap:14px;align-items:flex-start}
 .referral-chest {width:70px}
 .referral-reward button {min-width:0;width:100%}
 .referral-reveal {padding:16px;gap:12px;align-items:flex-start}
 .referral-item-art {width:52px}
 .referral-tracking li {gap:12px}
}
@media(prefers-reduced-motion:reduce){.referral-reveal {animation:none}}

.profile-page [hidden]{display:none!important}
.profile-tabs{display:flex;gap:4px;border-bottom:1px solid var(--border);margin:0 0 28px;overflow-x:auto;overscroll-behavior-x:contain}
#overlay .profile-tabs [role=tab]{flex:1;min-height:48px;padding:12px 16px;border:0;border-bottom:2px solid transparent;box-shadow:none;background:transparent;color:var(--muted);font:500 14px/1.4 var(--font-ui,system-ui);white-space:nowrap}
#overlay .profile-tabs [aria-selected=true]{border-bottom-color:var(--brand-gold,#d5bd79);color:var(--text);background:var(--brand-selected,#172524)}
#overlay .profile-tabs [role=tab]:focus-visible{outline:2px solid var(--brand-gold,#d5bd79);outline-offset:-4px}
.profile-page #profile-identity,.profile-page .profile-referrals{margin:0;padding-bottom:0;border-bottom:0}
.profile-page #profile-panel-showcase fieldset{margin-top:0}
@media(max-width:480px){#overlay .profile-tabs [role=tab]{padding:12px 7px;font-size:12px}.profile-tabs{gap:0}}

.run-history-list{list-style:none;padding:0;margin:20px 0}
.run-history-list>li{border-bottom:1px solid var(--border)}
.run-history-list summary{display:flex;justify-content:space-between;gap:16px;cursor:pointer;padding:18px 0;min-height:44px}
.run-history-list summary small{display:block;margin-top:5px;color:var(--muted)}
.run-history-list summary>span:last-child{font-size:12px;color:var(--muted);text-align:right}
.run-history-details{padding:0 0 20px;overflow-wrap:anywhere}
.run-history-details p{margin:8px 0}
.run-history-details a{display:inline-block;min-height:44px;padding:12px 0;color:var(--brand-gold,#d5bd79)}
.run-history-list summary:focus-visible{outline:2px solid var(--brand-gold,#d5bd79);outline-offset:4px}

.run-history-list summary>span:first-child{flex:1;min-width:0}
.run-history-list summary::after{content:'+';color:var(--muted);font-size:18px;line-height:1}
.run-history-list details[open]>summary::after{content:'−'}
