:root {
  color-scheme: dark;
  --background: #0b1017;
  --surface: #141a22;
  --surface-high: #1b222c;
  --line: #2e3440;
  --bronze: #745434;
  --gold: #e7b978;
  --ink: #f5ecdc;
  --muted: #adb6c3;
  --epic: #dd9aff;
  --rare: #91baff;
  --positive: #afd586;
  --problem: #f6a9a1;
  font-family: Inter, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--background); font-size: 15px; line-height: 1.55; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button, input, select { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button { color: inherit; cursor: pointer; }
.skip-link { position: fixed; z-index: 2; left: 12px; top: 10px; transform: translateY(-150%); background: var(--surface-high); padding: 9px 14px; }
.skip-link:focus { transform: none; }
.portal { display: grid; grid-template-columns: 206px minmax(0, 1fr); min-height: 100vh; }
.sidebar { z-index: 1; position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; min-height: 100vh; padding: 24px 16px 16px; border-right: 1px solid var(--line); background: linear-gradient(158deg, #171b21 0%, #0d1118 62%); }
.brand { display: grid; justify-items: center; gap: 8px; margin: 0 0 28px; text-align: center; color: var(--ink); }
.brand img { border-radius: 24%; object-fit: cover; max-width: 100%; }
.brand strong { display: block; font-size: 25px; font-weight: 760; letter-spacing: -.035em; }
.brand small, .muted { color: var(--muted); }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: var(--muted); border-radius: 6px; border: 1px solid transparent; }
.sidebar nav a:hover { text-decoration: none; background: #1d2530; color: var(--ink); }
.sidebar nav a[aria-current] { color: var(--gold); background: linear-gradient(90deg, #36281e, #252329); border-color: var(--bronze); }
.nav-icon { width: 20px; text-align: center; }
.source-link { margin: auto 0 0; padding: 18px 8px 0; font-size: 13px; color: var(--muted); }
main { min-width: 0; background: radial-gradient(ellipse at top right, #192533, transparent 43%), var(--background); }
.layout { max-width: 1470px; padding: 24px clamp(16px, 3vw, 36px) 52px; margin: auto; display: grid; gap: 22px; }
h1, h2, h3, p { margin: 0; }
h1 { color: var(--ink); font-size: clamp(30px, 5vw, 57px); font-weight: 780; line-height: 1.08; letter-spacing: -.041em; }
h2 { font-size: clamp(17px, 2.2vw, 22px); line-height: 1.2; }
h3 { font-size: 16px; }
.hero { min-height: 170px; position: relative; display: grid; align-items: end; isolation: isolate; border-bottom: 1px solid var(--bronze); background: #17212b; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg,#0b1017 0%,#0b1017d9 24%,#0b101722 90%), var(--art, none) center right/cover no-repeat; }
.hero.home { min-height: 285px; --art: url('/art/hall.jpg'); }
.hero.boss { min-height: 240px; --art: url('/art/boss.jpg'); }
.hero.raid-list { --art: url('/art/hall.jpg'); }
.hero.profile { --art: url('/art/hall.jpg'); }
.hero-inner { width: 100%; max-width: 1470px; margin: auto auto 0; padding: 27px clamp(16px, 3vw, 36px); display: grid; justify-items: start; gap: 8px; }
.hero-meta { color: #d3dae5; }
.crumb { font-size: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 7px 12px; color: var(--gold); font-weight: 630; border: 1px solid var(--bronze); background: #31251c; border-radius: 5px; }
.button:hover { text-decoration: none; background: #3b2e23; }
.button:disabled { cursor: default; opacity: .48; }
.columns { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--line); border-top-color: var(--bronze); border-radius: 8px; background: linear-gradient(160deg, #181e27, #121720 75%); overflow: hidden; }
.panel-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 15px; border-bottom: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 15px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-main { min-width: 0; overflow-wrap: anywhere; }
.row small, td small, .slot-info small { display: block; color: var(--muted); }
.row-end { margin-left: auto; padding-left: 6px; text-align: right; }
.item-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; object-fit: cover; border: 1px solid #51525e; border-radius: 5px; background: var(--surface-high); color: var(--gold); font-weight: 720; }
.item-icon.epic { border-color: #9d58c0; }
.item-icon.rare { border-color: #5c83bb; }
.item-icon.legendary { border-color: #bf712f; }
.epic { color: var(--epic); }
.rare { color: var(--rare); }
.uncommon { color: var(--positive); }
.legendary { color: #ffbc7f; }
.positive { color: var(--positive); }
.name-link { font-weight: 680; }
.empty { padding: 19px; color: var(--muted); }
.error { color: var(--problem); }
.hero+.layout > .empty { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.field { display: grid; gap: 5px; color: var(--muted); font-size: 13px; }
.field input, .field select { width: 100%; max-width: 100%; padding: 9px 11px; color: var(--ink); border: 1px solid #505561; background: #151b24; border-radius: 6px; font-size: 16px; }
.auth-layout { max-width: 550px; margin-left: 0; }
.portal-form { padding: 16px; display: grid; gap: 13px; }
.portal-form > label { display: grid; gap: 5px; color: var(--muted); }
.portal-form > label input { min-width: 0; padding: 8px 10px; border: 1px solid #505561; background: #151b24; border-radius: 6px; color: var(--ink); font-size: 16px; }
.portal-form .tools { align-items: center; }
.portal-form > .button { justify-self: start; }
.form-error { color: var(--problem); }
.form-error:empty { display: none; }
.account-error { padding: 12px 15px; }
.admin-row { justify-content: space-between; flex-wrap: wrap; }
.analysis-panels { display: grid; gap: 16px; min-width: 0; }
.analysis-toggle { font-size: 13px; color: var(--muted); }
.analysis-scroll { max-height: 410px; overflow: auto; }
.analysis-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-high); }
.character-options { max-height: 380px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
.character-option { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.character-option:last-child { border-bottom: 0; }
.character-option small { display: inline-block; color: var(--muted); margin-left: 6px; }
.table-scroll { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 13px; font-weight: 650; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.pager-links { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; }
.profile-head .item-icon { width: 68px; height: 68px; font-size: 27px; }
.profile-head h1 { margin-bottom: 4px; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px 19px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 2px; border-bottom: 2px solid transparent; color: var(--muted); }
.tabs a[aria-current] { color: var(--gold); border-color: var(--gold); }
.armory { position: relative; display: grid; gap: 8px; min-height: 312px; background: #17202b; align-items: center; padding: 15px; }
.armory-art { background: linear-gradient(90deg,#17202b 2%,transparent 34%,transparent 66%,#17202b 98%),url('/art/priest.jpg') center/auto 100% no-repeat, #17202b; }
.armory-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 34%; }
.gear-column { display: grid; gap: 6px; }
.gear-column.right { justify-items: end; }
.slot { width: fit-content; display: flex; align-items: center; min-height: 36px; gap: 7px; border: 1px solid transparent; border-radius: 6px; padding: 2px; background: transparent; text-align: left; }
.slot[aria-pressed=true] { border-color: var(--gold); background: #3b2c22; }
.slot-name { color: var(--ink); font-size: 12px; text-shadow: 0 1px 3px #000; }
.slot-info { padding: 13px 15px; border-top: 1px solid var(--line); min-height: 75px; }
.slot-info .row { padding: 7px 0 0; min-height: 0; }
.change { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.change .before { color: var(--muted); }
details.snapshot summary { padding: 13px 15px; cursor: pointer; }
details.snapshot[open] summary { border-bottom: 1px solid var(--line); }
details.snapshot+details.snapshot { border-top: 1px solid var(--line); }
.sibling-panels { display: grid; gap: 14px; }
@media (max-width: 1060px) {
  .portal { grid-template-columns: 164px minmax(0, 1fr); }
  .columns { gap: 13px; }
}
@media (max-width: 800px) {
  .portal { display: block; }
  .sidebar { position: static; min-height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { display: flex; margin: 0 auto 0 0; text-align: left; gap: 9px; }
  .brand img { width: 40px; height: 40px; }
  .brand strong { font-size: 18px; }
  .brand small { font-size: 11px; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar nav a { padding: 7px; }
  .source-link { display: none; }
  .hero.home { min-height: 235px; }
}
@media (max-width: 620px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
  .hero, .hero.boss { min-height: 175px; }
  .hero::before { background-image: linear-gradient(90deg,#0b1017ee 0%,#0b1017a4 52%,#0b101735), var(--art, none); }
  .layout { gap: 15px; padding-top: 15px; }
  .wide { display: none; }
  .armory-grid { gap: 14%; }
  .armory-art .slot-name { display: none; }
}
.gems { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 5px; }
.gem { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.gem .item-icon { width: 20px; height: 20px; }

.mobile-only { display: none; }
@media (max-width: 620px) { .mobile-only { display: inline; } }
