.account-page { background: radial-gradient(ellipse at 50% 0, #132a43 0, #0a1526 480px); min-height: 100vh; }
.account-header { border-bottom: 1px solid var(--line); background: #091524; }
.account-header .header-inner { grid-template-columns: 1fr auto; }
.account-nav { justify-content: end; }
.account-main { padding-block: 42px 65px; }
.account-title, .character-heading, .storage-heading, .storage-pages {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px;
}
.account-title { margin-bottom: 18px; }
.account-title .runes { color: var(--ice); letter-spacing: .22em; }
.account-title h1 { margin: 3px 0 0; font: 700 clamp(2rem, 5vw, 3.2rem)/1.15 var(--serif); }
.account-surface { padding: clamp(16px, 3vw, 28px); border: 1px solid var(--line); background: #101f34; min-width: 0; }
.account-surface h2, .account-surface h3 { margin: 0; font-family: var(--serif); }
.account-surface h2 { font-size: 1.45rem; }
.account-surface h3 { margin: 21px 0 9px; font-size: 1.05rem; }
.account-surface p { color: var(--muted); }
.login-card { max-width: 480px; }
.login-card p { margin: 6px 0 19px; }
.login-card button { justify-self: start; }
.create-account-link { display: inline-block; color: var(--ice); margin-top: 20px; text-decoration: underline; }
.profile-description { color: var(--muted); margin: 0 0 18px; }
.profile-description strong { color: #e8f2ff; overflow-wrap: anywhere; }
.profile-grid { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(0, 3fr); gap: 16px; align-items: start; }
.character-list { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.character-list button {
    width: 100%; padding: 9px 11px; text-align: left; color: inherit; cursor: pointer;
    background: #102138; border: 1px solid var(--line); overflow-wrap: anywhere;
}
.character-list button strong, .character-list button small { display: block; }
.character-list button[aria-pressed="true"] { background: #1b3553; border-color: #729fc9; }
.character-list button:hover { border-color: var(--ice); }
.character-heading { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.character-heading p { margin: 0; color: var(--ice); }
.character-heading h2 { overflow-wrap: anywhere; }
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; margin: 0; text-align: center; }
.stat-grid div { padding: 6px 2px; background: #132b46; border: 1px solid #335474; min-width: 0; }
.stat-grid dt { color: var(--muted); font-size: .77rem; }
.stat-grid dd { color: #eff7ff; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; }
.account-page table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.account-page th, .account-page td { padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.account-page th { color: var(--ice); background: #102843; }
.account-page td:first-child { min-width: 138px; overflow-wrap: anywhere; }
.account-page td:not(:first-child) { font-variant-numeric: tabular-nums; }
.account-page td small { margin-top: 3px; }
.storage-card { grid-column: 1 / -1; }
.storage-heading { margin-bottom: 12px; }
.storage-heading p { margin: 5px 0 0; }
.storage-heading input { width: 100%; }
.storage-pages { justify-content: center; margin-top: 14px; }
.storage-pages button { min-height: 36px; padding: 7px 11px; }

@media (max-width: 720px) {
    .account-main { padding-block: 22px 40px; }
    .account-header .header-inner { grid-template-columns: 1fr; }
    .account-nav { justify-content: start; }
    .profile-grid { grid-template-columns: minmax(0, 1fr); }
    .character-list { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}@media (max-width: 450px) {
    .account-page th, .account-page td { padding-inline: 5px; }
    .account-page td:first-child { min-width: 105px; }
}

.wallet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.wallet-value {
    display: flex; gap: 10px; align-items: center; min-height: 59px;
    padding: 8px 12px; border: 1px solid var(--line); background: #11253d;
}
.wallet-value img { flex: 0 0 auto; object-fit: contain; image-rendering: pixelated; }
.wallet-value span { color: var(--muted); font-size: .79rem; }
.wallet-value strong { display: block; color: #eaf5ff; font-size: 1rem; overflow-wrap: anywhere; }
.equipment-heading, .trait-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.equipment-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.equipment-tabs button {
    border: 1px solid var(--line); background: #0d1c2e; color: var(--muted); cursor: pointer;
    padding: 6px 9px; font-size: .78rem;
}
.equipment-tabs button[aria-pressed="true"] { border-color: #729fc9; background: #1b3553; color: #eaf5ff; }
.equipment-stage {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(118px, 165px) minmax(0, 1fr);
    align-items: start; gap: 10px; margin-top: 9px; padding: 12px;
    border: 1px solid #315171; background: #0b192c;
}
.equipment-column { display: grid; gap: 5px; min-width: 0; }
.equip-slot {
    display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 6px; align-items: center;
    min-height: 33px; padding: 3px 5px; border: 1px solid #355575; color: #edf6ff;
    font: inherit; text-align: left; background: #152c45; min-width: 0;
}
button.equip-slot { width: 100%; cursor: help; }
button.equip-slot:hover { border-color: var(--ice); }
.equip-slot.empty { background: #0e2035; color: #aabed8; }
.slot-label { font-size: .72rem; overflow-wrap: anywhere; }
.slot-badge { font-size: .68rem; color: #ceedff; white-space: nowrap; }
.game-icon { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; flex-shrink: 0; }
.slot-icon { display:grid; place-items:center; background:#0c1c30; border:1px solid #355575; width:30px; height:29px; }
.character-portrait {
    display: grid; gap: 1px; justify-items: center; margin: 0;
    min-width: 0; padding: 5px 0;
    background: radial-gradient(ellipse at center, #29405e 0, #10243d 47%, transparent 76%);
}
.portrait-layers { display: grid; place-items: center; width: 100%; aspect-ratio: 160/144; }
.portrait-layers img { grid-area: 1/1; width: 100%; height: auto; image-rendering: pixelated; }
.character-portrait figcaption { text-align: center; color: var(--muted); font-size: .74rem; }
.trait-heading p { margin: 0 0 8px; font-size: .82rem; }
.trait-heading strong { color: var(--ice); margin-left: 4px; }
.item-tooltip {
    position: fixed; z-index: 20; pointer-events: none; overflow-wrap: anywhere;
    width: min(292px, calc(100vw - 24px)); padding: 10px 12px;
    background: #0d1b2e; color: #edf6ff; border: 1px solid #7eacd4;
    box-shadow: 0 8px 25px #0009; font-size: .81rem;
}
.item-tooltip p { margin: 4px 0; color: var(--muted); }
.item-tooltip strong { display: block; color: #d0eaff; }
.item-tooltip ul { margin: 3px 0 8px; list-style: none; padding: 0; }
.item-entry { display: flex; align-items: center; gap: 7px; min-width: 0; }
.item-tooltip .game-icon { width: 19px; height: 19px; }
@media (max-width: 560px) {
    .wallet { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
    .equipment-stage { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 6px; padding: 6px; }
    .character-portrait { grid-column: 1 / -1; grid-row: 1; justify-self: center; width: min(150px, 100%); }
    .equip-slot { grid-template-columns: 25px minmax(0,1fr); min-height: 34px; gap: 3px; }
    .slot-icon { height: 24px; width: 24px; grid-row: span 2; }
    .slot-icon .game-icon { height: 22px; width: 22px; }
    .slot-badge { grid-column: 2; }
}
