/* murlocs.com design system
   Deep sea at night: abyss navy is the ground, bioluminescent teal marks anything you can act on,
   tarnished gold is treasure and trim. Item quality colors are data, used only on items.

   Fonts: Pirata One (display; reads like a ship's nameplate, used for the wordmark and short titles only)
          Alegreya Sans (text and UI; calligraphic sans with storybook warmth, holds up small in tooltips)

   ── Layout ────────────────────────────────────────────────────────────────────────────────
   .container          centered page column (max 1200px, 16px gutters on phones)
   .stack / .stack-lg  vertical rhythm: children spaced 12px / 24px
   .cluster            wrapping horizontal row with gap
   .visually-hidden    hidden on screen, read by screen readers
   .hide-narrow        hidden under 420px (e.g. "with Twitch" in "Sign in with Twitch")
   .skip-link          "Skip to content" link, visible on keyboard focus
   .muted              secondary text color

   ── Header / footer ───────────────────────────────────────────────────────────────────────
   .site-header        sticky top bar (the only blurred surface on the site)
   .brand              logo mark + wordmark link; .brand-word, .brand-tld inside
   .site-nav           header links; collapses into a panel under 860px (.nav-toggle opens it)
   .auth-slot          right side of the header; site.js fills it (sign in, or avatar + name + sign out)
   .avatar             round profile picture (24-40px)
   .site-footer        page footer; .footer-links, .footer-legal

   ── Buttons ───────────────────────────────────────────────────────────────────────────────
   .btn                base button/link button, 44px tall
   .btn-primary        brass treasure fill; the one main action per screen
   .btn-ghost          outlined, for secondary actions
   .btn-danger         outlined red, fills on hover; destructive actions
   .btn-sm             compact (40px, 44px on touch screens)
   .btn-lg             hero-size (54px)
   .btn[aria-busy=true] loading state: dims and shows a spinner

   ── Surfaces ──────────────────────────────────────────────────────────────────────────────
   .panel              flat dark surface with a hairline border
   .panel-raised       panel lifted with a shadow (dialogs, popovers, the item you're inspecting)
   .panel-title        heading inside a panel

   ── Forms ─────────────────────────────────────────────────────────────────────────────────
   .field              label + control + hint, stacked
   .field-label        control label
   .field-hint         one-line help under a control
   .field-error        validation message (red)
   .input / .select    text input and select, 44px tall
   .switch             toggle: <label class="switch"><input type="checkbox"><span class="switch-track"></span> Label</label>
   .range              styled <input type="range">; set --fill (0-100%) from JS to color the track

   ── Tabs and tables ───────────────────────────────────────────────────────────────────────
   .tabs               role=tablist row; .tab buttons use aria-selected; site.js initTabs() wires keys
   .tab-panel          role=tabpanel; hidden attribute toggled by initTabs()
   .table-wrap         horizontal scroll container for tables on phones
   .table              simple data table; .num right-aligns numbers

   ── Status ────────────────────────────────────────────────────────────────────────────────
   .pill               small status label; .pill-live (teal), .pill-next (gold), .pill-later (outline), .pill-danger
   .notice             inline message box; .notice-info, .notice-ok, .notice-error
   .toast-region       fixed bottom-right stack created by site.js toast()
   .toast              one toast; same variants via data-kind
   .state              empty / loading / error block: .state-title, .state-body, .state-action
   .spinner            small loading ring (stops spinning under reduced motion)

   ── Game ──────────────────────────────────────────────────────────────────────────────────
   .q-poor … .q-artifact   sets --q to that quality color; put on .item-tip or .bag-slot
   .slot-icon          item-slot glyph tinted with currentColor; data-slot="weapon|offhand|head|chest|hands|feet|trinket"
   .class-icon         class emblem; data-class="tidecaller|shellguard|reefstalker|mudmender"
   .item-tip           item tooltip card: .item-tip-head, .item-name, .item-meta, .item-stats, .item-flavor, .item-source
   .bag-slot           inventory square with quality border and icon; .is-empty for an open slot, .is-new pulses once
   .bag-grid           grid of bag slots
   .char-card          character card: .char-head, .char-crest, .char-name, .char-sub, .char-power,
                       .char-stats (dl), .char-gear (paper-doll row of bag slots)
*/

@import url('https://fonts.googleapis.com/css2?family=Alegreya+Sans:ital,wght@0,400;0,500;0,700;0,800;1,400&family=Pirata+One&display=swap');

:root {
  /* ground: four steps of depth */
  --abyss-0: #050c15;
  --abyss-1: #0a1826;
  --abyss-2: #0f2131;
  --abyss-3: #16304a;
  --line: #24455d;
  --line-strong: #33627f;

  /* text */
  --foam: #e8f1ec;
  --mist: #a9c0c4;
  --mist-dim: #8aa5ab;

  /* bioluminescence: links, focus, live things */
  --teal: #3ee6c8;
  --teal-dim: #1fae95;
  --teal-ink: #04231f;

  /* treasure and trim */
  --gold: #c9a25b;
  --gold-bright: #e8c477;
  --gold-deep: #8a6a2e;
  --gold-ink: #1d1405;

  --danger: #ff7a6e;
  --ok: #62e39a;

  /* item quality (data colors, items only) */
  --q-poor: #9d9d9d;
  --q-common: #ffffff;
  --q-uncommon: #1eff00;
  --q-rare: #0070dd;
  --q-epic: #a335ee;
  --q-legendary: #ff8000;
  --q-artifact: #e6cc80;
  /* rare blue is too dark for text on navy; text uses this lifted tone, borders keep the true color */
  --q-rare-text: #3f9bff;

  --font-display: 'Pirata One', 'Alegreya Sans', Georgia, serif;
  --font-body: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px; --sp-10: 136px;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-pill: 999px;

  --shadow-lift: 0 18px 40px -18px rgba(0, 0, 0, .75), 0 2px 6px rgba(0, 0, 0, .35);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--abyss-1);
  color: var(--foam);
  font: 400 1.0625rem/1.6 var(--font-body);
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--teal); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #8ff3e0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(62, 230, 200, .35); color: #fff; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 2px; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.stack > * + * { margin-top: var(--sp-3); }
.stack-lg > * + * { margin-top: var(--sp-5); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.muted { color: var(--mist); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--gold); color: var(--gold-ink); padding: 10px 14px; border-radius: var(--r-sm); font-weight: 700; }
.skip-link:focus { top: 12px; }

/* ───────────────────────────────────────────── header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 12, 21, .82);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); /* keeps nav legible over the moving demo */
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: var(--sp-5); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--foam); text-decoration: none; flex: none; }
.brand img { width: 36px; height: 36px; }
.brand-word { font: 400 1.85rem/1 var(--font-display); letter-spacing: .01em; }
.brand-tld { color: var(--gold); font-size: .95rem; font-weight: 700; margin-left: -6px; align-self: flex-end; padding-bottom: 6px; }
.brand:hover { color: #fff; }

.site-nav { display: flex; gap: var(--sp-1); margin-right: auto; }
.site-nav a {
  color: var(--mist); text-decoration: none; font-weight: 500; padding: 10px 12px; border-radius: var(--r-sm);
  min-height: 44px; display: inline-flex; align-items: center;
}
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--foam); background: rgba(62, 230, 200, .07); }

.auth-slot { display: flex; align-items: center; gap: var(--sp-3); flex: none; }
.auth-user { display: inline-flex; align-items: center; gap: 10px; color: var(--foam); text-decoration: none; font-weight: 700; min-height: 44px; }
.auth-user:hover { color: var(--teal); }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--abyss-3); border: 1px solid var(--gold-deep); flex: none; }
.avatar-fallback { display: inline-grid; place-items: center; font-weight: 800; color: var(--gold-bright); font-size: .9rem; }

.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px; border-radius: var(--r-sm);
  background: transparent; border: 1px solid var(--line-strong); cursor: pointer; place-items: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 18px; height: 2px; background: var(--foam); position: relative; transition: transform .2s var(--ease);
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .site-header .container { gap: var(--sp-3); flex-wrap: wrap; }
  .nav-toggle { display: grid; order: 2; margin-left: 0; }
  .auth-slot { order: 1; margin-left: auto; }
  .site-nav {
    order: 3; display: none; flex-direction: column; width: 100%; margin: 0;
    padding: 0 0 var(--sp-3); border-top: 1px solid var(--line);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 4px; }
  .auth-slot .btn { padding: 0 14px; }
}
@media (max-width: 420px) {
  .brand-tld { display: none; }
  .auth-user .auth-name { display: none; }
  .hide-narrow { display: none; }
}

/* ───────────────────────────────────────────── footer */
.site-footer { border-top: 1px solid var(--line); background: var(--abyss-0); padding: var(--sp-7) 0 var(--sp-6); color: var(--mist); }
.site-footer .container { display: grid; gap: var(--sp-5); grid-template-columns: 1fr auto; align-items: start; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); list-style: none; }
.footer-links a { color: var(--mist); text-decoration: none; display: inline-block; padding: 10px 0; }
.footer-links a:hover { color: var(--teal); }
.footer-legal { grid-column: 1 / -1; font-size: .9rem; color: var(--mist-dim); border-top: 1px solid var(--line); padding-top: var(--sp-4); }
@media (max-width: 700px) { .site-footer .container { grid-template-columns: 1fr; } }

/* ───────────────────────────────────────────── buttons */
.btn {
  --btn-bg: transparent; --btn-fg: var(--foam); --btn-border: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px; border-radius: 6px;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-border);
  font-weight: 700; font-size: 1rem; line-height: 1.1; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s var(--ease), box-shadow .2s;
}
.btn:hover { color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

/* brass: gold face, darker rim, a lit top edge. Glow is reserved for this button (the one main action). */
.btn-primary {
  --btn-fg: var(--gold-ink); --btn-border: var(--gold-deep);
  background: linear-gradient(180deg, #f3d48d 0%, var(--gold-bright) 38%, var(--gold) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 246, 214, .7), 0 0 0 0 rgba(232, 196, 119, 0);
  font-size: 1.05rem;
}
.btn-primary:hover { --btn-fg: var(--gold-ink); box-shadow: inset 0 1px 0 rgba(255, 246, 214, .7), 0 0 26px -4px rgba(232, 196, 119, .55); }
.btn-ghost { --btn-border: var(--line-strong); }
.btn-ghost:hover { --btn-border: var(--teal-dim); background: rgba(62, 230, 200, .07); }
.btn-danger { --btn-fg: var(--danger); --btn-border: rgba(255, 122, 110, .55); }
.btn-danger:hover { --btn-fg: #1a0604; background: var(--danger); --btn-border: var(--danger); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: .95rem; }
@media (pointer: coarse) { .btn-sm { min-height: 44px; } }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 1.15rem; border-radius: 8px; }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.btn[aria-busy="true"]::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}

/* ───────────────────────────────────────────── surfaces */
.panel { background: var(--abyss-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-5); }
.panel-raised { box-shadow: var(--shadow-lift); }
.panel-title { font-size: 1.2rem; margin-bottom: var(--sp-3); }

/* ───────────────────────────────────────────── forms */
.field { display: grid; gap: 6px; }
.field-label { font-weight: 700; color: var(--foam); }
.field-hint { font-size: .92rem; color: var(--mist); }
.field-error { font-size: .92rem; color: var(--danger); }
.input, .select {
  min-height: 44px; width: 100%; padding: 0 12px;
  background: var(--abyss-0); border: 1px solid var(--line-strong); border-radius: var(--r-sm); color: var(--foam);
}
.input::placeholder { color: var(--mist-dim); }
.input:hover, .select:hover { border-color: #4a7d9c; }
.input:focus-visible, .select:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal-dim); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.select {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--mist) 50%), linear-gradient(135deg, var(--mist) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}

.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; min-height: 44px; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative; width: 44px; height: 24px; border-radius: var(--r-pill); flex: none;
  background: var(--abyss-0); border: 1px solid var(--line-strong); transition: background-color .15s, border-color .15s;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--mist); transition: transform .18s var(--ease), background-color .15s;
}
.switch input:checked + .switch-track { background: rgba(62, 230, 200, .22); border-color: var(--teal-dim); }
.switch input:checked + .switch-track::after { transform: translateX(20px); background: var(--teal); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--teal); outline-offset: 3px; }
.switch input:disabled + .switch-track { opacity: .5; }

.range { --fill: 50%; width: 100%; height: 44px; appearance: none; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--teal-dim) var(--fill), var(--abyss-3) var(--fill));
}
.range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--abyss-3); }
.range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--teal-dim); }
.range::-webkit-slider-thumb {
  appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%;
  background: var(--foam); border: 3px solid var(--teal-dim);
}
.range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--foam); border: 3px solid var(--teal-dim); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--teal); outline-offset: 3px; }
.range:focus-visible::-moz-range-thumb { outline: 2px solid var(--teal); outline-offset: 3px; }

/* ───────────────────────────────────────────── tabs + table */
.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 0 14px; min-height: 46px; color: var(--mist); font-weight: 700; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--foam); }
.tab[aria-selected="true"] { color: var(--foam); border-bottom-color: var(--gold); }
.tab-panel { padding-top: var(--sp-5); }
.tab-panel[hidden] { display: none; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.table { width: 100%; border-collapse: collapse; font-size: .98rem; }
.table th {
  text-align: left; font-weight: 700; color: var(--mist); font-size: .9rem;
  padding: 10px 14px; background: var(--abyss-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid rgba(36, 69, 93, .6); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ───────────────────────────────────────────── status */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-pill);
  font-size: .82rem; font-weight: 700; line-height: 1.5; background: var(--abyss-3); color: var(--mist); border: 1px solid transparent;
}
.pill-live { background: rgba(62, 230, 200, .14); color: var(--teal); border-color: rgba(62, 230, 200, .35); }
.pill-next { background: rgba(232, 196, 119, .12); color: var(--gold-bright); border-color: rgba(232, 196, 119, .35); }
.pill-later { background: transparent; color: var(--mist); border-color: var(--line-strong); }
.pill-danger { background: rgba(255, 122, 110, .12); color: var(--danger); border-color: rgba(255, 122, 110, .35); }

.notice { padding: 12px 16px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--abyss-2); color: var(--foam); }
.notice-info { border-color: rgba(62, 230, 200, .35); background: rgba(62, 230, 200, .07); }
.notice-ok { border-color: rgba(98, 227, 154, .4); background: rgba(98, 227, 154, .08); }
.notice-error { border-color: rgba(255, 122, 110, .45); background: rgba(255, 122, 110, .08); }

.toast-region { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: grid; gap: 10px; max-width: min(380px, 100vw - 32px); }
.toast {
  padding: 12px 16px; border-radius: var(--r-md); background: var(--abyss-3); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lift); color: var(--foam); animation: toast-in .25s var(--ease);
}
.toast[data-kind="ok"] { border-color: rgba(98, 227, 154, .5); }
.toast[data-kind="error"] { border-color: rgba(255, 122, 110, .6); }
.toast[data-kind="info"] { border-color: rgba(62, 230, 200, .45); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.state { display: grid; justify-items: center; text-align: center; gap: var(--sp-2); padding: var(--sp-7) var(--sp-4); color: var(--mist); }
.state-title { color: var(--foam); font-weight: 700; font-size: 1.1rem; }
.state-body { max-width: 46ch; }
.state-action { margin-top: var(--sp-2); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--teal); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────────────────────────────────────── game: quality, icons */

/* glyphs are single-color SVG masks, so any element can tint them with color */
.slot-icon, .class-icon {
  display: inline-block; width: 1em; height: 1em; flex: none; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
[data-slot="weapon"] { --icon: url('/site/img/slots/weapon.svg'); }
[data-slot="offhand"] { --icon: url('/site/img/slots/offhand.svg'); }
[data-slot="head"] { --icon: url('/site/img/slots/head.svg'); }
[data-slot="chest"] { --icon: url('/site/img/slots/chest.svg'); }
[data-slot="hands"] { --icon: url('/site/img/slots/hands.svg'); }
[data-slot="feet"] { --icon: url('/site/img/slots/feet.svg'); }
[data-slot="trinket"] { --icon: url('/site/img/slots/trinket.svg'); }
/* class emblems are real spell icons: a picture, not a tinted mask */
.class-icon[data-class] { -webkit-mask: none; mask: none; background: #000 center / cover no-repeat; border-radius: 18%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .8), 0 0 0 2px rgba(232, 196, 119, .35); }
.class-icon[data-class="tidecaller"] { background-image: url('/assets/icons/wow/spell_shaman_tidalwaves.jpg'); }
.class-icon[data-class="shellguard"] { background-image: url('/assets/icons/wow/ability_warrior_shieldwall.jpg'); }
.class-icon[data-class="reefstalker"] { background-image: url('/assets/icons/wow/ability_throw.jpg'); }
.class-icon[data-class="mudmender"] { background-image: url('/assets/icons/wow/spell_nature_healingtouch.jpg'); }

/* ───────────────────────────────────────────── item tooltip */
.item-tip {
  --q: var(--q-common); --q-text: var(--q-common);
  position: relative; width: min(100%, 360px); padding: 14px 16px 16px;
  background: linear-gradient(180deg, rgba(16, 30, 46, .97), rgba(6, 14, 24, .98));
  border: 1px solid color-mix(in srgb, var(--q) 55%, var(--line-strong));
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lift), inset 0 0 0 1px rgba(255, 255, 255, .03);
  font-size: .98rem; line-height: 1.45;
}
.item-tip-head { display: flex; gap: 12px; align-items: flex-start; }
.item-tip-head .bag-slot { --size: 48px; }
.item-name { color: var(--q-text); font-size: 1.12rem; font-weight: 800; line-height: 1.2; }
.item-meta { color: var(--mist); font-size: .9rem; margin-top: 2px; }
.item-meta .item-quality { color: var(--q-text); }
.item-stats { list-style: none; margin-top: 10px; display: grid; gap: 1px; }
.item-stats li { color: var(--foam); font-weight: 500; }
.item-stats .stat-val { color: var(--ok); font-weight: 800; font-variant-numeric: tabular-nums; }
.item-flavor { margin-top: 10px; color: var(--gold-bright); font-style: italic; }
.item-source { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--mist); font-size: .88rem; }

/* ───────────────────────────────────────────── bag slots */
.bag-slot {
  --q: var(--q-common); --size: 56px;
  position: relative; display: inline-grid; place-items: center; width: var(--size); height: var(--size); flex: none;
  padding: 0; border-radius: var(--r-sm); cursor: default;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--q) 22%, var(--abyss-2)), var(--abyss-0) 75%);
  border: 2px solid var(--q); color: var(--q);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6), inset 0 0 14px -4px color-mix(in srgb, var(--q) 60%, transparent);
}
.bag-slot .slot-icon { font-size: calc(var(--size) * .62); }
/* real item icon inside the quality border */
.bag-slot.has-icon { background: #000; }
.bag-slot .bag-icon { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 2px; pointer-events: none; }
.bag-slot.q-common { color: #e6ecea; }
button.bag-slot, a.bag-slot { cursor: pointer; }
button.bag-slot:hover, a.bag-slot:hover { filter: brightness(1.18); }
.bag-slot.is-empty {
  --q: var(--line-strong); color: rgba(127, 154, 161, .35);
  background: var(--abyss-0); border-style: dashed; box-shadow: none;
}
.bag-slot .bag-count {
  position: absolute; right: 3px; bottom: 1px; font-size: .75rem; font-weight: 800; color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 2px #000;
}
.bag-slot.is-new { animation: bag-new 1.4s var(--ease) 1; }
@keyframes bag-new {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--q) 80%, transparent); transform: scale(.9); }
  40% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--q) 0%, transparent); transform: scale(1.06); }
  100% { transform: scale(1); }
}
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; justify-items: center; }

/* ───────────────────────────────────────────── character card */
.char-card {
  background: linear-gradient(180deg, var(--abyss-2), var(--abyss-1));
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-5);
  display: grid; gap: var(--sp-5);
}
.char-head { display: flex; align-items: center; gap: var(--sp-4); }
.char-crest {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(circle at 50% 35%, var(--abyss-3), var(--abyss-0));
  border: 2px solid var(--gold-deep); color: var(--gold-bright); font-size: 34px;
}
.char-name { font-size: 1.4rem; font-weight: 800; }
.char-sub { color: var(--mist); }
.char-power { margin-left: auto; text-align: right; }
.char-power span { display: block; color: var(--mist); font-size: .85rem; }
.char-power strong { font: 400 2rem/1 var(--font-display); color: var(--gold-bright); }
.char-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); margin: 0; }
.char-stats > div { background: var(--abyss-0); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; }
.char-stats dt { color: var(--mist); font-size: .85rem; }
.char-stats dd { margin: 0; font-weight: 800; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.char-gear { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 520px) {
  .char-stats { grid-template-columns: repeat(2, 1fr); }
  .char-head { flex-wrap: wrap; }
}

/* quality classes come after the components so they override the component defaults */
.q-poor { --q: var(--q-poor); --q-text: var(--q-poor); }
.q-common { --q: var(--q-common); --q-text: var(--q-common); }
.q-uncommon { --q: var(--q-uncommon); --q-text: var(--q-uncommon); }
.q-rare { --q: var(--q-rare); --q-text: var(--q-rare-text); }
.q-epic { --q: var(--q-epic); --q-text: #c07cf7; }
.q-legendary { --q: var(--q-legendary); --q-text: var(--q-legendary); }
.q-artifact { --q: var(--q-artifact); --q-text: var(--q-artifact); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .spinner, .btn[aria-busy="true"]::before { animation: none; border-top-color: var(--teal); }
}
