/* Character profile only. Values and inventory geometry follow the DBT client. */
.character-profile {
    --profile-surface: #0c141f;
    --profile-raised: #101a27;
    --profile-ink: #f0f4fa;
    --profile-muted: #b3bfd0;
    --profile-accent: #ffcf4a;
    --profile-border: #69788f;
    --profile-line: #334155;
    container: character-profile / inline-size;
    color: var(--profile-ink);
    font: 13px/1.5 Arial, Helvetica, sans-serif;
    min-width: 0;
    text-align: left;
}
.character-profile *, .character-profile *::before, .character-profile *::after { box-sizing: border-box; }
.character-profile h1, .character-profile h2, .character-profile h3,
.character-profile p, .character-profile dl, .character-profile dd { margin: 0; padding: 0; }
.character-profile h1 { color: var(--profile-ink); font: bold clamp(24px, 5cqi, 32px)/1.2 Arial, sans-serif; overflow-wrap: anywhere; }
.character-profile h2, .character-profile h3 { color: var(--profile-ink); font: bold 16px/1.4 Arial, sans-serif; margin-bottom: 16px; }
.character-profile a { color: var(--profile-accent); text-decoration: underline; overflow-wrap: anywhere; }
.character-profile a:hover { color: var(--profile-ink); }
.character-profile a:focus-visible, .character-profile [tabindex]:focus-visible { outline: 2px solid var(--profile-accent); outline-offset: 4px; }
.profile-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px; background: var(--profile-raised); border-top: 3px solid var(--profile-accent); border-radius: 8px 8px 0 0; }
.profile-portrait { display: grid; place-items: center; width: 80px; height: 80px; flex: 0 0 80px; background: var(--profile-surface); border: 1px solid var(--profile-line); border-radius: 8px; }
.profile-portrait img { object-fit: contain; image-rendering: pixelated; }
.profile-identity-text { flex: 1; min-width: 120px; }
.profile-identity-text p { color: var(--profile-muted); margin-top: 8px; }
.profile-identity-text p span { padding: 0 4px; }
.profile-identity-text .profile-character-level { padding: 0; white-space: nowrap; }
.profile-flag { margin-top: 8px; max-width: 24px; }
.profile-status { padding: 4px 8px; border: 1px solid var(--profile-border); border-radius: 8px; font-size: 12px; }
.profile-status.is-online { color: #8be5b5; }
.profile-status.is-offline { color: var(--profile-muted); }
.profile-facts { display: grid; padding: 0 16px 16px !important; background: var(--profile-raised); border-radius: 0 0 8px 8px; }
.profile-facts > div { min-width: 0; padding: 12px 0; border-top: 1px solid var(--profile-line); }
.profile-facts dt { color: var(--profile-muted); font-size: 12px; margin-bottom: 4px; }
.profile-facts dd { overflow-wrap: anywhere; }
.profile-vitals { display: grid; gap: 16px; padding: 16px 0; }
.profile-vital-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; margin-bottom: 8px; }
.profile-vital-label strong { font-variant-numeric: tabular-nums; }
.profile-vital-label strong span { color: var(--profile-muted); font-weight: normal; }
.profile-meter { height: 8px; border-radius: 8px; overflow: hidden; background: var(--profile-line); }
.profile-meter > span { display: block; height: 100%; border-radius: inherit; background: #d64e65; }
.profile-vital-ki .profile-meter > span { background: #66caff; }
.profile-build { display: grid; gap: 16px; margin-bottom: 24px; align-items: start; }
.profile-equipment, .profile-skills { min-width: 0; padding: 16px; background: var(--profile-raised); border: 1px solid var(--profile-line); border-radius: 8px; }
.profile-equipment-grid { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(4, 64px); gap: 8px; width: 208px; max-width: 100%; margin: 0 auto 16px; }
.profile-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; padding: 4px; min-width: 0; background: var(--profile-surface); border: 1px solid var(--profile-border); border-radius: 8px; }
.profile-slot.is-equipped { border-color: var(--profile-accent); }
.profile-slot-label { color: var(--profile-muted); font-size: 10px; line-height: 1.3; white-space: nowrap; }
.profile-item-image, .profile-empty-image { display: block; width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; }
.profile-empty-image { opacity: .65; }
.profile-slot-8 { grid-column: 2; }
.profile-slot-12 { grid-column: 3; }
.profile-item-fallback { font-size: 10px; line-height: 32px; }
.profile-item-tooltip { display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 5; width: max-content; max-width: 200px; padding: 8px; color: var(--profile-ink); background: var(--profile-surface); border: 1px solid var(--profile-border); border-radius: 8px; font-size: 12px; line-height: 1.5; pointer-events: none; overflow-wrap: anywhere; }
.profile-slot:nth-child(3n + 1) .profile-item-tooltip { left: 0; transform: none; }
.profile-slot:nth-child(3n) .profile-item-tooltip, .profile-slot-12 .profile-item-tooltip { left: auto; right: 0; transform: none; }
.profile-slot:hover .profile-item-tooltip, .profile-slot:focus .profile-item-tooltip { display: block; }
.profile-resources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 12px !important; border-top: 1px solid var(--profile-line); }
.profile-resources dt { font-size: 11px; color: var(--profile-muted); }
.profile-resources dd { font-weight: bold; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.profile-skill-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--profile-line); }
.profile-skill-list > div:first-child { padding-top: 0; }
.profile-skill-list > div:last-child { border: 0; padding-bottom: 0; }
.profile-skill-list dt { min-width: 0; overflow-wrap: anywhere; color: var(--profile-muted); }
.profile-skill-list dd { flex-shrink: 0; color: var(--profile-ink); font-weight: bold; font-variant-numeric: tabular-nums; }
.profile-skill-list [data-skill="maglevel"] dt, .profile-skill-list [data-skill="maglevel"] dd { color: var(--profile-accent); }
.profile-experience { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-top: 1px solid var(--profile-border); margin-top: 16px; padding-top: 12px; }
.profile-experience span { color: var(--profile-muted); }
.profile-experience strong { font-variant-numeric: tabular-nums; }
.character-profile table { width: 100%; margin: 0 0 24px; border-collapse: collapse; border: 0; background: var(--profile-raised); color: var(--profile-ink); font: inherit; }
.character-profile th, .character-profile td { padding: 12px; border: 0; border-bottom: 1px solid var(--profile-line); text-align: left; color: inherit; background: none; overflow-wrap: anywhere; }
.character-profile thead, .character-profile tr.yellow { background: var(--profile-surface); color: var(--profile-ink); }
.character-profile thead th, .character-profile thead td { font-size: 14px; font-weight: bold; }
.character-profile tr:hover { background: none; }
.character-profile .deathlist td:first-child { width: 32%; color: var(--profile-muted); }
.character-profile .profile-table-scroll { max-width: 100%; overflow-x: auto; }
.character-profile .profile-related { margin-top: 24px; }
.character-profile .profile-related table { min-width: 480px; }
.character-profile .address { padding: 12px 0; border-top: 1px solid var(--profile-line); color: var(--profile-muted); font-size: 12px; overflow-wrap: anywhere; }
@container character-profile (min-width: 520px) {
    .profile-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
    .profile-vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-build { grid-template-columns: minmax(242px, .95fr) minmax(0, 1.05fr); }
}
