/* Armory, guild and rankings pages. Builds on style.css tokens (--gold, --amber, --surface, Cinzel/Fira Sans). */

:root {
    --panel: #15171d;
    --panel-raised: #1a1d24;
    --line: rgba(184, 149, 74, 0.2);
    --line-soft: rgba(255, 255, 255, 0.06);
    --text-dim: #80838d;
    --wow-yellow: #ffd100;
    --timed: #9fcf78;
    --overtime: #dd7a62;
    --q0: #9d9d9d;
    --q1: #ece9e1;
    --q2: #1eff00;
    --q3: #3d9dff;
    --q4: #b76df3;
    --q5: #ff8000;
    --q6: #e6cc80;
    --q7: #00ccff;
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .86 0 0 0 0 .62 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.nav-links a[aria-current] { color: var(--gold-light); }
.nav-links a[aria-current]::after { transform: scaleX(1); }

.ar :focus-visible {
    outline: 2px solid var(--amber-bright);
    outline-offset: 2px;
}

.ar-skip {
    position: fixed;
    top: -60px;
    left: 16px;
    z-index: 300;
    padding: 12px 18px;
    background: var(--amber);
    color: #fff;
    font-weight: 600;
    border-radius: 3px;
}

.ar-skip:focus { top: 10px; }

/* ── Section bar (Armory / Rankings) ── */
/* Body pads below the fixed nav (a margin on the first child would collapse through body)
   and stacks vertically so short pages keep the footer at the bottom. */
body.ar {
    display: flex;
    flex-direction: column;
    padding-top: 64px;
}

body.ar > .ar-main { flex: 1 0 auto; width: 100%; }

.ar-subnav {
    position: sticky;
    top: 64px;
    z-index: 60;
    background: #14161c;
    border-bottom: 1px solid var(--line);
}

.ar-subnav-inner {
    display: flex;
    align-items: stretch;
    gap: 28px;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 48px;
    overflow-x: auto;
    scrollbar-width: none;
}

.ar-subnav-group {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
}

.ar-subnav-group + .ar-subnav-group {
    padding-left: 28px;
    border-left: 1px solid var(--line-soft);
}

.ar-subnav-label {
    margin-right: 10px;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    white-space: nowrap;
}

.ar-subnav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease-out;
}

.ar-subnav a:hover { color: var(--text-primary); }

.ar-subnav a[aria-current] {
    color: var(--gold-bright);
    border-bottom-color: var(--amber);
}

/* ── Header band ── */
.ar-band {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(180deg, #101218 0%, var(--surface) 100%);
}

.ar-band::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 48% 110% at 12% 0%, var(--band-glow, rgba(200, 122, 46, 0.2)) 0%, transparent 70%),
        radial-gradient(ellipse 30% 80% at 92% 0%, rgba(184, 149, 74, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

.ar-band::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--grain);
    opacity: 0.22;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.ar-head {
    position: relative;
    z-index: 1;
    max-width: 1320px;
    margin: 0 auto;
    padding: 56px 48px 44px;
}

.ar-eyebrow {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--amber-light);
    margin-bottom: 14px;
}

.ar-title {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: clamp(34px, 4.6vw, 60px);
    letter-spacing: 3px;
    line-height: 1.08;
    color: var(--gold-bright);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
}

.ar-lede {
    max-width: 62ch;
    margin-top: 16px;
    font-size: 17px;
    font-weight: 300;
    line-height: 1.7;
    color: var(--text-secondary);
}

.ar-snapshot {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 0;
    margin-top: 22px;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.ar-snapshot span + span::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    margin: 0 14px 2px;
    border: 1px solid var(--gold);
    transform: rotate(45deg);
}

.ar-head.has-ledger {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 48px;
    align-items: end;
}

.ar-head.has-ledger > :not(.ar-ledger) { grid-column: 1; }
.ar-head.has-ledger > .ar-eyebrow,
.ar-head.has-ledger > .ar-title { grid-column: 1 / -1; }
.ar-head.has-ledger > .ar-ledger { grid-column: 2; grid-row: 3 / span 2; align-self: end; }
.ar-ledger { grid-template-columns: repeat(var(--n), minmax(128px, auto)); }

/* ── Layout ── */
.ar-main {
    position: relative;
    z-index: 1;
    max-width: 1320px;
    margin: 0 auto;
    padding: 40px 48px 96px;
}

.ar-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 28px;
    align-items: start;
}

.ar-stack { display: grid; gap: 28px; }

.ar-muted { color: var(--text-secondary); font-size: 15px; line-height: 1.6; }

/* ── Panels ── */
.ar-panel {
    position: relative;
    background: linear-gradient(180deg, var(--panel-raised) 0%, var(--panel) 100%);
    border: 1px solid var(--chrome-border);
    border-radius: 3px;
}

.ar-panel::before,
.ar-panel::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.ar-panel::before {
    top: -1px;
    left: -1px;
    border-top: 1px solid var(--gold);
    border-left: 1px solid var(--gold);
}

.ar-panel::after {
    right: -1px;
    bottom: -1px;
    border-right: 1px solid var(--gold);
    border-bottom: 1px solid var(--gold);
}

.ar-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 16px;
    padding: 16px 22px 14px;
    border-bottom: 1px solid var(--line);
}

.ar-panel-title {
    font-family: 'Cinzel', serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--gold-light);
}

.ar-panel-note {
    font-size: 13px;
    color: var(--text-dim);
}

.ar-panel-body { padding: 18px 22px 22px; }

.ar-notes-list,
.ar-empty-why {
    list-style: none;
    display: grid;
    gap: 10px;
}

.ar-notes-list li,
.ar-empty-why li {
    position: relative;
    padding-left: 20px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.ar-notes-list li::before,
.ar-empty-why li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 9px;
    width: 6px;
    height: 6px;
    border: 1px solid var(--gold);
    transform: rotate(45deg);
}

/* ── Empty / status states ── */
.ar-empty,
.ar-status {
    padding: 32px 32px 34px;
    border: 1px dashed rgba(184, 149, 74, 0.35);
    border-radius: 3px;
    background: rgba(14, 15, 20, 0.6);
}

.ar-status { max-width: 760px; margin: 24px auto; }

.ar-panel-body .ar-empty {
    padding: 4px 0 2px;
    border: 0;
    background: none;
}

.ar-empty-title {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.ar-empty-body {
    max-width: 64ch;
    margin-top: 10px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.ar-empty-why { margin-top: 18px; }

.ar-empty-action {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 20px;
    padding: 0 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold-bright);
    border: 1px solid rgba(200, 122, 46, 0.55);
    border-radius: 3px;
    transition: background 0.15s ease-out, color 0.15s ease-out;
}

.ar-empty-action:hover { background: rgba(200, 122, 46, 0.14); color: #fff; }

.ar-empty-action::after { content: '→'; margin-left: 10px; }

.ar-na { color: var(--text-dim); }

/* ── Tables ── */
.ar-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.ar-table th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
    color: var(--text-dim);
    border-bottom: 1px solid var(--line);
}

.ar-table td {
    padding: 14px 16px;
    font-size: 15px;
    vertical-align: middle;
    border-bottom: 1px solid var(--line-soft);
}

.ar-table tbody tr { transition: background 0.15s ease-out; }
.ar-table tbody tr:hover { background: rgba(200, 122, 46, 0.06); }
.ar-table tbody tr:last-child td { border-bottom: 0; }
.ar-table .is-num { text-align: right; }
.ar-table tr[data-href] { cursor: pointer; }

/* Character identity cell */
.who {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.who-mark {
    flex: 0 0 4px;
    align-self: stretch;
    min-height: 36px;
    background: var(--cc);
    border-radius: 1px;
}

.who-text { display: grid; gap: 2px; min-width: 0; }

.who-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--cc);
}

a.who-name:hover { text-decoration: underline; text-underline-offset: 3px; }

.who-sub { font-size: 13px; color: var(--text-secondary); }

.ar-level {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 17px;
    color: var(--text-primary);
}

.ar-link { color: var(--gold-light); }
.ar-link:hover { color: var(--gold-bright); text-decoration: underline; text-underline-offset: 3px; }

/* ── Forms / filters ── */
.ar-search {
    display: grid;
    gap: 8px;
    padding: 22px;
}

.ar-label,
.ar-field label,
.ar-field .ar-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.ar-search-box { position: relative; }

.ar-search-box .glyph {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    fill: var(--gold);
    pointer-events: none;
}

.ar-input,
.ar-select {
    width: 100%;
    min-height: 48px;
    font-family: 'Fira Sans', sans-serif;
    font-size: 16px;
    color: var(--text-primary);
    background: #0d0e13;
    border: 1px solid #343846;
    border-radius: 3px;
    transition: border-color 0.15s ease-out;
}

.ar-input { padding: 0 16px 0 48px; font-size: 18px; }
.ar-input::placeholder { color: #676a74; }
.ar-input:hover, .ar-select:hover { border-color: #4a4e5c; }
.ar-input:focus, .ar-select:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 1px var(--amber); }

.ar-select {
    appearance: none;
    padding: 0 40px 0 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23b8954a' stroke-width='1.6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    cursor: pointer;
}

.ar-select:disabled { cursor: not-allowed; color: var(--text-dim); border-color: #262932; }

.ar-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 20px;
    padding: 18px 22px 20px;
}

.ar-field { display: grid; gap: 8px; min-width: 170px; }

.ar-filters-note {
    flex-basis: 100%;
    font-size: 13px;
    color: var(--text-dim);
}

/* Segmented control and tab strips */
.ar-seg {
    display: inline-flex;
    border: 1px solid #343846;
    border-radius: 3px;
    background: #0d0e13;
}

.ar-seg button,
.ar-tabs button {
    min-height: 48px;
    padding: 0 20px;
    font-family: 'Fira Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: background 0.15s ease-out, color 0.15s ease-out;
}

.ar-seg button + button { border-left: 1px solid #343846; }
.ar-seg button:hover, .ar-tabs button:hover { color: var(--text-primary); }

.ar-seg button[aria-pressed="true"] {
    color: var(--gold-bright);
    background: rgba(200, 122, 46, 0.18);
}

.ar-tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    scrollbar-width: thin;
}

.ar-tabs button {
    flex: 0 0 auto;
    padding: 0 18px;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: none;
    border-bottom: 2px solid transparent;
}

.ar-tabs button[aria-pressed="true"] { color: var(--gold-bright); border-bottom-color: var(--amber); }

/* ── Rank / key / time cells ── */
.rank {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--text-secondary);
}

.rank-1 { color: var(--gold-bright); }
.rank-2 { color: #cfd2da; }
.rank-3 { color: #d39257; }

.key {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 20px;
    color: var(--gold-bright);
}

.key.is-overtime { color: var(--text-secondary); }

.clock { display: grid; gap: 2px; }
.clock-main { font-size: 16px; font-weight: 500; }
.clock-sub { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.cell-date, .cell-result { white-space: nowrap; }

.result {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.result::before {
    content: '';
    width: 7px;
    height: 7px;
    transform: rotate(45deg);
    background: currentColor;
}

.result.is-timed { color: var(--timed); }
.result.is-overtime { color: var(--overtime); }
.result.is-overtime::before { background: transparent; border: 1px solid currentColor; }

/* Party list */
.party {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    list-style: none;
}

.party li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.party a { color: var(--cc); font-weight: 500; }
.party a:hover { text-decoration: underline; text-underline-offset: 3px; }

.glyph { width: 14px; height: 14px; fill: currentColor; flex: 0 0 auto; }
.glyph-tank { color: #8fb4e8; }
.glyph-healer { color: var(--timed); }
.glyph-damage { color: var(--overtime); }

/* ── Policy explainer ── */
.ar-policy {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    counter-reset: step;
    list-style: none;
}

.ar-policy li {
    position: relative;
    padding: 18px 22px 20px 64px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    counter-increment: step;
}

.ar-policy li + li { border-left: 1px solid var(--line-soft); }

.ar-policy li::before {
    content: counter(step, upper-roman);
    position: absolute;
    left: 22px;
    top: 16px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--gold);
}

.ar-policy b { display: block; margin-bottom: 4px; color: var(--text-primary); font-weight: 500; }

.ar-banner {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 18px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    border-left: 2px solid var(--amber);
    background: rgba(200, 122, 46, 0.07);
}

.ar-banner strong { color: var(--text-primary); font-weight: 500; }

/* ── Character page ── */
.ch-band { --band-glow: color-mix(in srgb, var(--cc) 24%, transparent); }

.ch-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 32px 48px;
    align-items: end;
}

.ch-name {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: clamp(40px, 5.4vw, 72px);
    letter-spacing: 2px;
    line-height: 1.02;
    color: var(--cc);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7);
    overflow-wrap: anywhere;
}

.ch-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 26px;
    margin-top: 18px;
    list-style: none;
    font-size: 15px;
    color: var(--text-primary);
}

.ch-meta li { display: inline-flex; gap: 8px; align-items: baseline; }

.ch-meta .k {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.ch-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(128px, auto));
    border: 1px solid var(--chrome-border);
    background: rgba(13, 14, 19, 0.72);
    border-radius: 3px;
}

.ch-stat { padding: 16px 22px 18px; }
.ch-stat + .ch-stat { border-left: 1px solid var(--chrome-border); }

.ch-stat dt {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--text-dim);
}

.ch-stat dd {
    margin-top: 6px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 28px;
    color: var(--gold-light);
    font-variant-numeric: tabular-nums;
}

.ch-stat dd small {
    display: block;
    margin-top: 2px;
    font-family: 'Fira Sans', sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: var(--text-dim);
}

.ch-stat .ar-na { font-size: 24px; }

.ch-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 28px;
    align-items: start;
}

.ch-grid + .ar-notes,
.ar-split + .ar-notes { margin-top: 28px; }

.ar-more { padding: 6px 0 0; text-align: center; }

button.ar-empty-action { background: transparent; font-family: 'Fira Sans', sans-serif; cursor: pointer; }

/* Paperdoll */
.pd {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 236px minmax(0, 1fr);
    gap: 0 20px;
    padding: 6px 0 0;
}

.pd-untracked-note { display: none; }

.pd-col {
    display: grid;
    grid-auto-rows: 60px;
    gap: 6px;
    list-style: none;
}

.pd-figure {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 24px 18px;
    text-align: center;
    border: 1px solid var(--line-soft);
    border-radius: 3px;
    background:
        radial-gradient(ellipse 80% 55% at 50% 42%, color-mix(in srgb, var(--cc) 16%, transparent) 0%, transparent 70%),
        #0e0f14;
}

.pd-figure figcaption { display: grid; gap: 4px; }
.pd-figure figcaption b { font-family: 'Cinzel', serif; font-size: 14px; letter-spacing: 1px; color: var(--text-primary); font-weight: 600; }
.pd-figure figcaption span { font-size: 13px; line-height: 1.5; color: var(--text-dim); }

.crest { width: 120px; height: 140px; }
.crest-outer { fill: #14151b; stroke: var(--gold); stroke-width: 2; }
.crest-inner { fill: color-mix(in srgb, var(--cc) 20%, #121318); stroke: var(--cc); stroke-width: 1.5; }
.crest-rule { stroke: color-mix(in srgb, var(--cc) 40%, transparent); stroke-width: 1; fill: none; }
.crest-letter { font-family: 'Cinzel', serif; font-weight: 900; font-size: 46px; fill: var(--gold-bright); text-anchor: middle; }

.pd-left { grid-column: 1; grid-row: 1; }
.pd-right { grid-column: 3; grid-row: 1; }

.pd-weapons {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    margin-top: 16px;
    padding-top: 16px;
    list-style: none;
    border-top: 1px solid var(--line-soft);
}

.slot {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 0 6px;
    border-radius: 3px;
    --qc: var(--q1);
}

.slot[tabindex] { cursor: default; }
.slot[tabindex]:hover { background: rgba(255, 255, 255, 0.03); }

.pd-right .slot,
.pd-weapons .slot:first-child { flex-direction: row-reverse; text-align: right; }

.slot-icon {
    position: relative;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: #0a0b0f;
    border: 2px solid var(--qc);
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.7);
}

.slot-icon img {
    width: 100%;
    height: 100%;
    border-radius: 2px;
    display: block;
}

.slot-icon.is-iconless {
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.045) 0 2px, transparent 2px 7px),
        #0a0b0f;
}

.slot-glyph {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #6c6f78;
    text-transform: uppercase;
}

.slot-text { display: grid; gap: 3px; min-width: 0; }

.slot-name {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.25;
    color: var(--qc);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slot-meta {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot.is-empty .slot-icon { border-color: #2c2f39; }
.slot.is-empty .slot-name { color: var(--text-dim); font-weight: 400; }

.slot.is-untracked .slot-icon { border: 1px dashed rgba(184, 149, 74, 0.32); background: transparent; box-shadow: none; }
.slot.is-untracked .slot-name { color: #6d7079; font-weight: 400; font-style: italic; }

.q0 { --qc: var(--q0); } .q1 { --qc: var(--q1); } .q2 { --qc: var(--q2); } .q3 { --qc: var(--q3); }
.q4 { --qc: var(--q4); } .q5 { --qc: var(--q5); } .q6 { --qc: var(--q6); } .q7 { --qc: var(--q7); }

/* Item tooltip (WoW-style) */
.slot-tip {
    position: absolute;
    top: 0;
    left: calc(100% + 6px);
    z-index: 30;
    width: 280px;
    padding: 12px 14px 13px;
    text-align: left;
    background: #070912;
    border: 1px solid #6a6d78;
    border-radius: 4px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease-in, visibility 0.12s;
    pointer-events: none;
}

.pd-right .slot-tip,
.pd-weapons .slot:first-child .slot-tip { left: auto; right: calc(100% + 6px); }

.slot:hover .slot-tip,
.slot:focus .slot-tip,
.slot:focus-within .slot-tip { opacity: 1; visibility: visible; transition: opacity 0.18s ease-out, visibility 0s; }

.slot-tip > * { display: block; }
.tip-name { font-size: 16px; font-weight: 600; color: var(--qc); line-height: 1.3; }
.tip-line { font-size: 13px; line-height: 1.55; color: var(--q1); }
.tip-ilvl { color: var(--wow-yellow); }
.tip-dim { color: var(--text-dim); }
.tip-mog { color: #ff80ff; }

/* Achievements */
.ach-total {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line-soft);
}

.ach-total-value {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 40px;
    line-height: 1;
    color: var(--gold-bright);
}

.ach-total-label { font-size: 13px; line-height: 1.5; color: var(--text-secondary); }

.shield {
    display: grid;
    place-items: center;
    width: 34px;
    height: 38px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 13px;
    color: #1a1308;
    background: linear-gradient(180deg, var(--gold-bright), var(--gold));
    clip-path: polygon(0 0, 100% 0, 100% 68%, 50% 100%, 0 68%);
    padding-bottom: 6px;
}

.shield.is-zero { background: #3a3c45; color: var(--text-secondary); }

.ach-list { list-style: none; }

.ach-list li {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
}

.ach-list li:last-child { border-bottom: 0; padding-bottom: 0; }

.ach-icon {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(184, 149, 74, 0.55);
    border-radius: 3px;
    background: #0a0b0f;
}

.ach-name { font-size: 15px; color: var(--text-primary); }
.ach-date { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* PvP */
.pvp-meters { display: grid; gap: 14px; margin-bottom: 18px; }

.meter-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    font-size: 14px;
}

.meter-row .v { color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.meter {
    grid-column: 1 / -1;
    height: 6px;
    background: #0a0b0f;
    border: 1px solid var(--chrome-border);
}

.meter span { display: block; height: 100%; width: var(--pct); background: linear-gradient(90deg, #a56420, var(--amber-light)); }

.pvp-brackets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--line-soft);
    border: 1px solid var(--line-soft);
}

.pvp-bracket { padding: 12px 14px; background: var(--panel); }
.pvp-bracket dt { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); }
.pvp-bracket dd { margin-top: 4px; font-family: 'Cinzel', serif; font-weight: 700; font-size: 22px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.pvp-bracket dd small { display: block; font-family: 'Fira Sans', sans-serif; font-weight: 400; font-size: 12px; color: var(--text-dim); }

/* Talents */
.loadouts { list-style: none; display: grid; gap: 8px; }
.loadouts li { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.loadouts .is-active { color: var(--gold-light); }

/* Raid progress block (character / guild / rankings) */
.rp + .rp { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); }

.rp-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px 16px;
}

.rp-raid { font-family: 'Cinzel', serif; font-size: 18px; font-weight: 700; color: var(--text-primary); }
.rp-diff { font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--amber-light); }

.rp-count {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 22px;
    color: var(--gold-bright);
    font-variant-numeric: tabular-nums;
}

.rp-count small {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 5px 1px;
    font-family: 'Fira Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    vertical-align: 4px;
    color: var(--amber-light);
    border: 1px solid rgba(224, 152, 64, 0.5);
    border-radius: 2px;
}

.pips { display: flex; gap: 3px; margin: 10px 0 6px; }
.pip { flex: 1; height: 8px; background: #23262f; }
.pip.is-killed { background: linear-gradient(180deg, var(--amber-bright), var(--amber)); }

.rp-bosses {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 4px 20px;
    margin-top: 10px;
    list-style: none;
    font-size: 14px;
}

.rp-bosses li { display: flex; justify-content: space-between; gap: 10px; color: var(--text-dim); }
.rp-bosses li.is-killed { color: var(--text-primary); }
.rp-bosses li.is-killed::before { content: '◆'; color: var(--amber); font-size: 10px; margin-right: -4px; align-self: center; }
.rp-bosses li:not(.is-killed)::before { content: '◇'; font-size: 10px; margin-right: -4px; align-self: center; }
.rp-bosses li span:first-of-type { flex: 1; }
.rp-bosses time { font-size: 12px; color: var(--text-dim); }

.rp-scope { margin-top: 8px; font-size: 13px; color: var(--text-dim); }

/* ── Guild page ── */
.gd-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; }
.gd-head .crest { --cc: var(--gold); width: 96px; height: 112px; }

/* ── Rankings ── */
.rk-records {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.rk-record {
    padding: 16px 18px;
    background: rgba(10, 11, 15, 0.55);
    border: 1px solid var(--line-soft);
    border-top: 2px solid rgba(200, 122, 46, 0.55);
}
.rk-record-name { font-family: 'Cinzel', serif; font-weight: 700; font-size: 15px; color: var(--text-primary); }
.rk-record-key { margin-top: 8px; display: flex; gap: 12px; align-items: baseline; }
.rk-record .party { margin-top: 8px; }

.rk-progress { display: grid; gap: 6px; min-width: 160px; }
.rk-progress .pips { margin: 0; }

/* ── Mobile ── */
@media (max-width: 1180px) {
    .ch-head { grid-template-columns: 1fr; }
    .ar-head.has-ledger { grid-template-columns: 1fr; }
    .ar-head.has-ledger > .ar-ledger { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 24px; }
    .ch-grid, .ar-split { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .ar-policy { grid-template-columns: 1fr; }
    .ar-policy li + li { border-left: 0; border-top: 1px solid var(--line-soft); }
}

@media (max-width: 768px) {
    .ar-subnav-inner { padding: 0 12px; gap: 12px; }
    .ar-subnav-group + .ar-subnav-group { padding-left: 12px; }
    .ar-subnav-label { display: none; }
    .ar-subnav a { padding: 0 10px; letter-spacing: 1.2px; }
    .ar-head { padding: 36px 20px 30px; }
    .ar-main { padding: 24px 16px 72px; }
    .ar-lede { font-size: 16px; }
    .ar-panel-head { padding: 14px 16px 12px; }
    .ar-panel-body { padding: 16px; }
    .ar-empty { padding: 24px 20px; }
    .ar-filters { padding: 16px; }
    .ar-filters { gap: 14px; }
    .ar-field { min-width: 0; flex: 1 1 100%; }
    .ar-seg { display: flex; }
    .ar-seg button { flex: 1 1 0; padding: 0 10px; }
    .ar-snapshot { flex-direction: column; gap: 4px; }
    .ar-snapshot span + span::before { display: none; }

    .ch-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ar-head.has-ledger > .ar-ledger { justify-self: stretch; }
    .ch-stats.ar-ledger { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
    .ar-ledger .ch-stat { padding: 12px 12px 14px; }
    .ar-ledger .ch-stat:nth-child(3) { border-left: 1px solid var(--chrome-border); }
    .ar-ledger .ch-stat:nth-child(n+3) { border-top: 0; }
    .ar-ledger .ch-stat dt { white-space: normal; letter-spacing: 1.2px; line-height: 1.4; }
    .ar-ledger .ch-stat dd { font-size: 22px; }
    .ch-stat:nth-child(3) { border-left: 0; }
    .ch-stat:nth-child(n+3) { border-top: 1px solid var(--chrome-border); }
    .ch-stat { padding: 14px 16px; }
    .ch-stat dd { font-size: 24px; }
    .ch-meta { gap: 8px 18px; }

    .pd { grid-template-columns: 1fr; padding: 0; }
    .pd .slot.is-untracked { display: none; }
    .pd-untracked-note {
        display: block;
        grid-column: 1;
        margin-top: 12px;
        padding-top: 12px;
        font-size: 13px;
        line-height: 1.5;
        color: var(--text-dim);
        border-top: 1px solid var(--line-soft);
    }
    .pd-figure { display: none; }
    .pd-left, .pd-right { grid-column: 1; grid-row: auto; }
    .pd-col { grid-auto-rows: 56px; gap: 4px; }
    .pd-right { margin-top: 4px; }
    .pd-weapons { grid-template-columns: 1fr; gap: 4px; margin-top: 8px; padding-top: 12px; }
    .pd-right .slot, .pd-weapons .slot:first-child { flex-direction: row; text-align: left; }
    .slot-tip,
    .pd-right .slot-tip,
    .pd-weapons .slot:first-child .slot-tip { top: calc(100% + 4px); left: 56px; right: 0; width: auto; }

    /* Tables become stacked rows */
    .ar-table thead { display: none; }
    .ar-table, .ar-table tbody { display: block; }
    .ar-table tr {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 6px 12px;
        padding: 14px 10px;
        border-bottom: 1px solid var(--line-soft);
    }
    .ar-table tbody tr:last-child { border-bottom: 0; }
    .ar-table td { padding: 0; border: 0; font-size: 14px; }
    .ar-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        color: var(--text-dim);
    }
    .ar-table .is-num { text-align: left; }
    .ar-table .cell-wide { grid-column: 1 / -1; }

    /* Mythic+ run rows */
    .rk-runs tr {
        grid-template-columns: 30px auto minmax(0, 1fr) auto;
        grid-template-areas:
            "rank key dungeon result"
            "rank time time date"
            "rank party party party";
        align-items: center;
        gap: 8px 12px;
    }
    .rk-runs td[data-label]::before { display: none; }
    .rk-runs .cell-rank { grid-area: rank; align-self: start; padding-top: 2px; }
    .rk-runs .cell-key { grid-area: key; }
    .rk-runs .cell-dungeon { grid-area: dungeon; font-family: 'Cinzel', serif; font-weight: 700; font-size: 15px; }
    .rk-runs .cell-result { grid-area: result; text-align: right; }
    .rk-runs .cell-time { grid-area: time; }
    .rk-runs .cell-date { grid-area: date; text-align: right; font-size: 13px; color: var(--text-dim); }
    .rk-runs .cell-party { grid-area: party; }
    .rk-runs .clock { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }

    /* Raid standing rows */
    .rk-raids tr {
        grid-template-columns: 30px minmax(0, 1fr) auto;
        grid-template-areas:
            "rank name name"
            "rank progress date"
            "rank scope scope";
        align-items: center;
        gap: 10px 12px;
    }
    .rk-raids .cell-rank { grid-area: rank; align-self: start; padding-top: 4px; }
    .rk-raids td.cell-rank::before { display: none; }
    .rk-raids .cell-name { grid-area: name; }
    .rk-raids .cell-progress { grid-area: progress; }
    .rk-raids .cell-date { grid-area: date; text-align: right; }
    .rk-raids .cell-scope { grid-area: scope; font-size: 13px; color: var(--text-dim); }
    .rk-raids td.cell-scope::before { display: none; }

    .ar-tabs { mask-image: linear-gradient(90deg, #000 82%, transparent); scrollbar-width: none; }

    .gd-head { grid-template-columns: 1fr; }
    .gd-head .crest { width: 64px; height: 75px; }
}

@media (prefers-reduced-motion: reduce) {
    .ar *, .ar *::before, .ar *::after { transition: none !important; }
}
