/* Holy Larp: palette from the guild crest (blood crimson, black-maroon, holy gold, bone, slate).
   Motion follows the Jayco site: expo-out reveals, staggered lists, gentle media drift,
   a page loader, and nothing moves when the viewer prefers reduced motion. */
:root {
  --bg: #0b0607;
  --bg-2: #150a0c;
  --panel: #1c0e10;
  --panel-2: #241215;
  --line: #3a1d21;
  --line-2: #55282e;
  --crimson: #b3202a;
  --blood: #6e0e14;
  --ember: #ff8a1f;
  --gold: #f2b632;
  --gold-2: #ffdf7a;
  --bone: #ecdfc4;
  --muted: #a8927b;
  --dim: #6f5e52;
  --slate: #59606f;
  --ok: #57c76a;
  --warn: #f2a33a;
  --bad: #e5484d;
  --up: #4ea8ff;

  --q-poor: #9d9d9d;
  --q-common: #ffffff;
  --q-uncommon: #1eff00;
  --q-rare: #0070dd;
  --q-epic: #a335ee;
  --q-legendary: #ff8000;

  --c-warrior: #c69b6d;
  --c-paladin: #f48cba;
  --c-hunter: #aad372;
  --c-rogue: #fff468;
  --c-priest: #ffffff;
  --c-shaman: #0070dd;
  --c-mage: #3fc7eb;
  --c-warlock: #8788ee;
  --c-druid: #ff7c0a;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --drift: 18px;
  --pixel: 'Pixelify Sans', 'Barlow Condensed', system-ui, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cond: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  --radius: 6px;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(179, 32, 42, 0.28), transparent 60%),
    radial-gradient(900px 600px at 100% 30%, rgba(110, 14, 20, 0.25), transparent 60%),
    var(--bg);
  color: var(--bone);
  font: 16px/1.5 var(--body);
  overflow-x: hidden;
}
/* Faint pixel grid, a nod to the crest's pixel art */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 8px 8px;
  z-index: 0;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.wrap { width: min(1240px, 100% - 2 * var(--gutter)); margin-inline: auto; position: relative; z-index: 1; }

/* ---------- loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.loader img { width: min(220px, 50vw); image-rendering: pixelated; animation: bob 1.6s var(--ease) infinite alternate; filter: drop-shadow(0 0 30px rgba(255, 138, 31, 0.35)); }
.loader p { margin: 18px 0 0; text-align: center; font: 600 15px var(--pixel); letter-spacing: 0.08em; color: var(--gold); }
.loader.done { opacity: 0; visibility: hidden; }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-10px); } }

/* ---------- header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(11, 6, 7, 0.92), rgba(11, 6, 7, 0.75));
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 40px; height: 40px; image-rendering: pixelated; }
.brand span { font: 700 20px var(--pixel); color: var(--gold); letter-spacing: 0.04em; text-shadow: 2px 2px 0 var(--blood); }
.tabs { display: flex; gap: 4px; margin-left: 10px; }
.tab {
  position: relative;
  padding: 8px 14px;
  border: 0;
  background: none;
  font: 600 15px var(--cond);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}
.tab::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  background: var(--crimson);
  transform: scaleX(0);
  transition: transform 0.45s var(--ease);
}
.tab:hover { color: var(--bone); }
.tab[aria-current='page'] { color: var(--gold); }
.tab[aria-current='page']::after, .tab:hover::after { transform: scaleX(1); }
.viewer { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: linear-gradient(var(--panel-2), var(--panel));
  font: 600 14px var(--cond);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn:hover { border-color: var(--gold); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(242, 182, 50, 0.15); }
.btn.primary { background: linear-gradient(#c62a33, #8c1219); border-color: #d9454d; color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }

/* ---------- reveal (Jayco-style) ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
.reveal.in { opacity: 1; transform: none; }
.drift { transform: translate3d(0, calc(var(--p, 0) * var(--drift) * -1), 0); will-change: transform; }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(32px, 7vw, 80px) 0 28px; }
.hero .hero-head { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 5vw, 56px); align-items: center; }
.crest { width: clamp(130px, 22vw, 240px); image-rendering: pixelated; filter: drop-shadow(0 10px 40px rgba(179, 32, 42, 0.55)); }
.eyebrow { font: 600 13px var(--cond); letter-spacing: 0.22em; text-transform: uppercase; color: var(--crimson); margin: 0 0 6px; }
.hero h1 { margin: 0; font: 700 clamp(34px, 6.4vw, 72px)/1 var(--pixel); color: var(--gold); text-shadow: 3px 3px 0 var(--blood), 0 0 40px rgba(242, 182, 50, 0.25); letter-spacing: 0.02em; }
.hero p.lede { margin: 14px 0 0; max-width: 60ch; color: var(--muted); font-size: 17px; }
.countdown { display: inline-flex; gap: 8px; align-items: center; margin-top: 18px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(110, 14, 20, 0.35); font: 600 14px var(--cond); letter-spacing: 0.06em; text-transform: uppercase; }
.countdown b { color: var(--gold-2); font-family: var(--pixel); font-size: 16px; letter-spacing: 0.02em; }

.embers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.embers i { position: absolute; bottom: -10px; width: 4px; height: 4px; background: var(--ember); box-shadow: 0 0 8px var(--ember); opacity: 0; animation: rise linear infinite; }
@keyframes rise { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: 0.9; } 100% { transform: translate(var(--x, 20px), -520px); opacity: 0; } }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 26px 0 8px; }
.stat {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  overflow: hidden;
}
.stat::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--crimson), transparent); }
.stat .k { font: 600 12px var(--cond); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.stat .v { font: 700 34px/1.1 var(--pixel); color: var(--bone); margin-top: 4px; }
.stat .v small { font-size: 18px; color: var(--dim); }
.stat .bar { height: 6px; margin-top: 10px; background: #2a1518; border-radius: 3px; overflow: hidden; }
.stat .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--crimson), var(--gold)); transition: width 1.4s var(--ease); }
.roles { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font: 700 22px var(--pixel); }
.roles span { display: inline-flex; align-items: center; gap: 6px; }
.roles em { font: 600 12px var(--cond); font-style: normal; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* ---------- section headings ---------- */
.section { padding: 34px 0; position: relative; }
.section h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font: 700 26px var(--pixel); color: var(--bone); letter-spacing: 0.02em; }
.section h2::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, var(--line-2), transparent); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  font: 600 13px var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: all 0.3s var(--ease);
}
.chip:hover { color: var(--bone); border-color: var(--gold); }
.chip[aria-pressed='true'] { background: var(--crimson); border-color: var(--crimson); color: #fff; }

/* ---------- roster cards ---------- */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  text-align: left;
  transition: transform 0.45s var(--ease), border-color 0.3s var(--ease), box-shadow 0.45s var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(242, 182, 50, 0.12); }
.card[aria-current='true'] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 12px 34px rgba(242, 182, 50, 0.18); }
.card .av { position: relative; width: 52px; height: 52px; border-radius: 4px; overflow: hidden; border: 2px solid var(--line-2); background: #000; }
.card .av img { width: 100%; height: 100%; object-fit: cover; }
.card .av .cls { position: absolute; right: -2px; bottom: -2px; width: 20px; height: 20px; border: 1px solid #000; border-radius: 3px; }
.card .nm { font: 700 16px/1.15 var(--cond); letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .sub { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.card .sub img { width: 16px; height: 16px; border-radius: 2px; }
.card .meter { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font: 600 12px var(--cond); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.card .meter .track { flex: 1; height: 5px; background: #2a1518; border-radius: 3px; overflow: hidden; }
.card .meter .track span { display: block; height: 100%; background: linear-gradient(90deg, #b88a1c, var(--gold-2)); }
.status { margin-left: 4px; white-space: nowrap; font: 700 11px var(--cond); letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.status.ready { background: rgba(87, 199, 106, 0.16); color: var(--ok); border: 1px solid rgba(87, 199, 106, 0.4); }
.status.work { background: rgba(242, 163, 58, 0.14); color: var(--warn); border: 1px solid rgba(242, 163, 58, 0.4); }
.status.lvl { background: rgba(89, 96, 111, 0.25); color: #c3c8d4; border: 1px solid var(--slate); }

/* ---------- character sheet ---------- */
.sheet {
  position: relative;
  margin-top: 18px;
  padding: clamp(14px, 3vw, 28px);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background:
    radial-gradient(500px 420px at 50% 40%, rgba(179, 32, 42, 0.22), transparent 70%),
    linear-gradient(180deg, #1d0e10, #120809);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), 0 30px 80px rgba(0, 0, 0, 0.5);
}
/* Pixel corner studs, like the crest's frame */
.sheet::before, .sheet::after {
  content: '';
  position: absolute;
  top: 10px;
  width: 10px;
  height: 10px;
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--blood);
}
.sheet::before { left: 10px; }
.sheet::after { right: 10px; }
.sheet-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.sheet-head .who h3 { margin: 0; font: 700 clamp(22px, 3.2vw, 32px)/1.1 var(--pixel); letter-spacing: 0.02em; }
.sheet-head .who p { margin: 4px 0 0; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sheet-head .who p img { width: 20px; height: 20px; border-radius: 3px; }
.sheet-head .badges { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius); border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.3); font: 600 13px var(--cond); letter-spacing: 0.06em; text-transform: uppercase; }
.badge b { font: 700 16px var(--pixel); letter-spacing: 0; }
.badge.bis b { color: var(--gold-2); }
.badge.ench b { color: var(--warn); }
.badge.empty b { color: var(--bad); }
.badges .status { margin-left: 0; padding: 6px 10px; border-radius: var(--radius); font-size: 13px; }

.doll { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 380px) minmax(0, 1fr); gap: clamp(10px, 2vw, 22px); align-items: stretch; }
.col { display: flex; flex-direction: column; gap: 8px; }
.col.right .slot { flex-direction: row-reverse; text-align: right; }
.col.right .slot .info { align-items: flex-end; }
.figure {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 700 / 750;
  align-self: center;
  background:
    radial-gradient(closest-side, rgba(255, 138, 31, 0.18), transparent 75%),
    radial-gradient(circle at 50% 90%, rgba(179, 32, 42, 0.35), transparent 55%);
}
.figure::after { content: ''; position: absolute; left: 15%; right: 15%; bottom: 7%; height: 7%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.7), transparent); z-index: 0; }
/* The render is 1600x1200 with the character centered; crop to roughly x 450-1150, y 300-1050. */
.figure img.render { position: absolute; width: 228.6%; max-width: none; left: -64.3%; top: -40%; z-index: 1; transition: transform 0.9s var(--ease), opacity 0.6s var(--ease); }
.figure .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font: 600 14px var(--cond); text-transform: uppercase; letter-spacing: 0.1em; }
.bottom { grid-column: 1 / -1; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.bottom .slot { width: min(320px, 100%); }

.slot {
  --qc: var(--line-2);
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.28);
  min-height: 60px;
  text-align: left;
  width: 100%;
  transition: transform 0.4s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.4s var(--ease);
}
.slot:hover, .slot:focus-visible { transform: translateY(-2px); background: rgba(255, 255, 255, 0.035); border-color: var(--line-2); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45); }
.slot .ico { position: relative; flex: none; width: 46px; height: 46px; border-radius: 4px; border: 2px solid var(--qc); background: #0a0506 center/cover; box-shadow: inset 0 0 0 1px #000, 0 0 12px color-mix(in srgb, var(--qc) 35%, transparent); }
.slot .ico.blank { background: repeating-linear-gradient(45deg, #1b0d0f 0 6px, #140a0b 6px 12px); }
.slot .info { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.slot .lbl { font: 600 11px var(--cond); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.slot .iname { font: 600 15px/1.2 var(--cond); color: var(--qc); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.slot .ench { font-size: 12.5px; color: var(--q-uncommon); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.slot .tag { font: 700 11px var(--cond); letter-spacing: 0.08em; text-transform: uppercase; }
.slot .tag.warn { color: var(--warn); }
.slot .tag.bad { color: var(--bad); }
.slot.q-POOR { --qc: var(--q-poor); }
.slot.q-COMMON { --qc: var(--q-common); }
.slot.q-UNCOMMON { --qc: var(--q-uncommon); }
.slot.q-RARE { --qc: var(--q-rare); }
.slot.q-EPIC { --qc: var(--q-epic); }
.slot.q-LEGENDARY { --qc: var(--q-legendary); }
.slot.cosmetic { opacity: 0.6; }
/* Highlights on the gear boxes */
.slot.f-empty, .slot.f-low { border-color: rgba(229, 72, 77, 0.65); background: rgba(229, 72, 77, 0.08); }
.slot.f-empty .ico, .slot.f-low .ico { animation: pulse-bad 2.2s ease-in-out infinite; }
.slot.f-enchant { border-color: rgba(242, 163, 58, 0.55); background: rgba(242, 163, 58, 0.06); }
.slot.is-bis { border-color: rgba(242, 182, 50, 0.6); }
.slot.is-bis .ico::after { content: '★'; position: absolute; top: -9px; right: -9px; width: 18px; height: 18px; display: grid; place-items: center; font-size: 11px; color: #1a0d00; background: var(--gold); border-radius: 50%; box-shadow: 0 0 10px rgba(242, 182, 50, 0.8); }
.slot .up { position: absolute; top: -7px; width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--up); background: #0a0506 center/cover; box-shadow: 0 0 10px rgba(78, 168, 255, 0.5); }
.col.left .slot .up, .bottom .slot .up { right: -7px; }
.col.right .slot .up { left: -7px; }
@keyframes pulse-bad { 0%, 100% { box-shadow: inset 0 0 0 1px #000, 0 0 0 0 rgba(229, 72, 77, 0.0); } 50% { box-shadow: inset 0 0 0 1px #000, 0 0 0 4px rgba(229, 72, 77, 0.35); } }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- popover ---------- */
/* Item tooltips on hover, styled after the game's. */
.itip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 90;
  width: max-content;
  max-width: min(320px, calc(100vw - 16px));
  padding: 9px 11px;
  border: 1px solid #4b5563;
  border-radius: 5px;
  background: rgba(8, 10, 22, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  color: #fff;
  font: 13px/1.4 system-ui, sans-serif;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.itip.open { opacity: 1; visibility: visible; }
.itip > b { display: block; font-size: 15px; margin-bottom: 2px; }
.itip-l.two { display: flex; justify-content: space-between; gap: 24px; }
.itip-l { white-space: pre-wrap; }

.pop {
  position: fixed;
  z-index: 70;
  width: min(330px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: linear-gradient(180deg, #1f1013, #140a0c);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.35s var(--ease);
}
.pop.open { opacity: 1; transform: none; pointer-events: auto; }
.pop h4 { margin: 0; font: 700 17px/1.2 var(--cond); }
.pop .meta { margin: 2px 0 8px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.pop .row { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: 14px; }
.pop .row .d { width: 8px; height: 8px; margin-top: 7px; border-radius: 2px; flex: none; }
.pop .target { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px; border: 1px dashed rgba(78, 168, 255, 0.5); border-radius: 6px; background: rgba(78, 168, 255, 0.06); text-decoration: none; }
.pop .target img { width: 36px; height: 36px; border-radius: 4px; border: 2px solid var(--qc, var(--q-rare)); }
.pop .target small { display: block; color: var(--muted); font-size: 12px; }
.pop .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- upgrade list ---------- */
.todo { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 18px; }
.todo .box { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 0, 0, 0.25); }
.todo h4 { margin: 0 0 8px; font: 700 15px var(--cond); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.todo ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.todo li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.todo li img { width: 24px; height: 24px; border-radius: 3px; }
.todo li .s { color: var(--dim); font: 600 12px var(--cond); text-transform: uppercase; letter-spacing: 0.08em; min-width: 72px; }

/* ---------- leaderboards ---------- */
.lb-groups { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.lb-refresh { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lb-refresh .hint { color: var(--dim); font-size: 13px; }
@media (max-width: 760px) { .lb-refresh { margin-left: 0; width: 100%; justify-content: space-between; } }
.lb-boards { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; align-items: end; margin-bottom: 18px; }
.pod {
  position: relative;
  padding: 18px 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  text-align: center;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.pod:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); }
.pod.p1 { border-color: var(--gold); padding-top: 26px; background: linear-gradient(180deg, #2b1a0c, var(--panel)); box-shadow: 0 0 40px rgba(242, 182, 50, 0.12); }
.pod .medal { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font: 700 14px var(--pixel); color: #1a0d00; }
.pod.p1 .medal { background: var(--gold); box-shadow: 0 0 16px rgba(242, 182, 50, 0.7); }
.pod.p2 .medal { background: #c9ccd3; }
.pod.p3 .medal { background: #c98a4b; }
.pod .face { width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 6px; overflow: hidden; border: 2px solid var(--line-2); background: #000; }
.pod.p1 .face { width: 92px; height: 92px; border-color: var(--gold); }
.pod .face img { width: 100%; height: 100%; object-fit: cover; }
.pod .nm { font: 700 17px/1.15 var(--cond); }
.pod .val { margin-top: 6px; font: 700 30px/1 var(--pixel); color: var(--gold-2); }
.pod .sec { margin-top: 4px; font-size: 13px; color: var(--muted); }
.ranks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ranks li { display: grid; grid-template-columns: 34px 36px 1fr auto; gap: 12px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 0, 0, 0.25); transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.4s var(--ease); }
.ranks li:hover { background: rgba(255, 255, 255, 0.03); border-color: var(--line-2); transform: translateX(4px); }
.ranks .n { font: 700 16px var(--pixel); color: var(--dim); text-align: right; }
.ranks .face { width: 36px; height: 36px; border-radius: 4px; overflow: hidden; background: #000; position: relative; }
.ranks .face img { width: 100%; height: 100%; object-fit: cover; }
.ranks .nm { font: 700 15px var(--cond); }
.ranks .sec { font-size: 13px; color: var(--muted); }
.ranks .val { font: 700 20px var(--pixel); color: var(--bone); text-align: right; }
.lb-note { margin-top: 12px; color: var(--dim); font-size: 13px; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.dcard { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(160deg, var(--panel-2), var(--panel)); text-align: left; transition: transform 0.45s var(--ease), border-color 0.3s var(--ease); }
.dcard:hover { transform: translateY(-3px); border-color: var(--line-2); }
.dcard[aria-pressed='true'] { border-color: var(--gold); }
.dcard h4 { margin: 0; font: 700 17px var(--cond); }
.dcard small { color: var(--muted); }
.dcard .faces { display: flex; margin-top: 10px; }
.dcard .faces img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--panel); margin-right: -8px; object-fit: cover; background: #000; }
.dcard .total { float: right; font: 700 22px var(--pixel); color: var(--gold-2); }

/* ---------- editor modal ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(5, 2, 3, 0.75); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity 0.3s var(--ease), visibility 0.3s; }
.modal.open { opacity: 1; visibility: visible; }
.modal .box { width: min(560px, 100%); max-height: min(720px, 90vh); display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 10px; background: #160a0c; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); transform: translateY(16px); transition: transform 0.5s var(--ease); }
.modal.open .box { transform: none; }
.modal header { padding: 16px 18px 10px; }
.modal header h3 { margin: 0; font: 700 20px var(--pixel); color: var(--gold); }
.modal header p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.modal input { width: calc(100% - 36px); margin: 0 18px 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #0c0607; color: var(--bone); font: 16px var(--body); }
.modal .results { overflow: auto; padding: 0 10px 10px; display: grid; gap: 4px; }
.modal .results button { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid transparent; border-radius: var(--radius); background: none; text-align: left; }
.modal .results button:hover { border-color: var(--line-2); background: rgba(255, 255, 255, 0.03); }
.modal .results img { width: 32px; height: 32px; border-radius: 4px; border: 2px solid var(--qc); }
.modal footer { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.modal footer .btn:last-child { margin-left: auto; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 95; transform: translate(-50%, 20px); padding: 10px 16px; border-radius: var(--radius); border: 1px solid var(--line-2); background: #1c0e10; opacity: 0; transition: all 0.4s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

footer.site { padding: 40px 0 60px; color: var(--dim); font-size: 13px; text-align: center; }
footer.site img { width: 44px; margin: 0 auto 10px; image-rendering: pixelated; opacity: 0.8; }

.empty-state { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .doll { grid-template-columns: 1fr 1fr; }
  .figure { grid-column: 1 / -1; grid-row: 1; width: min(360px, 100%); justify-self: center; }
  .col.right .slot { flex-direction: row; text-align: left; }
  .col.right .slot .info { align-items: flex-start; }
  .col.right .slot .up { left: auto; right: -7px; }
}
@media (max-width: 640px) {
  .hero .hero-head { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .tabs { margin-left: 0; }
  .brand span, .viewer .lbl, .viewer .who-label, #music span { display: none; }
  .top .wrap { gap: 8px; }
  .tab { padding: 8px; }
  .doll { grid-template-columns: 1fr; }
  .podium { grid-template-columns: 1fr; }
  .pod.p1 { order: -1; }
  .stats .stat:nth-child(3) { grid-column: 1 / -1; }
  .ranks li { grid-template-columns: 28px 32px 1fr auto; gap: 8px; }
  .sheet-head .badges { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .drift { transform: none; }
  .embers { display: none; }
}

/* ---------- Konami easter egg ---------- */
.egg {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  background: radial-gradient(circle, rgba(10, 4, 5, 0.6), rgba(0, 0, 0, 0.94));
  opacity: 0;
  transition: opacity 0.6s ease;
}
.egg.on { opacity: 1; }
.egg .rays {
  position: absolute;
  inset: -60%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 223, 46, 0.22) 0 9deg, transparent 9deg 18deg);
  opacity: 0;
  transition: opacity 0.25s ease;
  animation: egg-rays 8s linear infinite;
}
.egg.hit .rays { opacity: 1; }
.egg img {
  grid-area: 1 / 1;
  width: min(62vw, 44vh);
  border: 8px solid #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 4px #000, 0 24px 70px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: scale(0.02) rotate(0deg);
}
/* 15 full turns over the clip, speeding up as it grows, like a spinning-newspaper transition */
.egg img.go { animation: egg-spin var(--dur, 37s) cubic-bezier(0.45, 0, 0.85, 0.55) forwards; }
.egg.hit img.go { animation: egg-slam 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.egg.hit { animation: egg-shake 0.5s steps(2, end); }
.egg h2 {
  grid-area: 1 / 1;
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 4vw;
  text-align: center;
  font: 400 clamp(64px, 15vw, 240px)/0.9 'Bangers', var(--pixel);
  letter-spacing: 0.03em;
  color: #ffdf2e;
  -webkit-text-stroke: 4px #000;
  paint-order: stroke fill;
  text-shadow: 8px 8px 0 var(--crimson), 14px 14px 0 #000;
  transform: scale(0) rotate(-14deg);
}
.egg.hit h2 { animation: egg-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.12s forwards, egg-wobble 1.2s ease-in-out 0.9s infinite; }
.egg small { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, 0.45); font: 600 13px var(--cond); letter-spacing: 0.12em; text-transform: uppercase; }
@keyframes egg-spin {
  0% { opacity: 0; transform: scale(0.02) rotate(0deg); }
  100% { opacity: 1; transform: scale(1) rotate(5400deg); }
}
@keyframes egg-slam {
  0% { opacity: 1; transform: scale(1.4) rotate(0deg); }
  100% { opacity: 1; transform: scale(1) rotate(-5deg); }
}
@keyframes egg-pop { to { transform: scale(1) rotate(-8deg); } }
@keyframes egg-wobble { 0%, 100% { transform: scale(1) rotate(-8deg); } 50% { transform: scale(1.06) rotate(-4deg); } }
@keyframes egg-rays { to { transform: rotate(360deg); } }
@keyframes egg-shake { 0%, 100% { transform: none; } 25% { transform: translate(-12px, 6px); } 50% { transform: translate(10px, -8px); } 75% { transform: translate(-6px, -4px); } }
@media (prefers-reduced-motion: reduce) {
  .egg img { opacity: 1; transform: none; }
  .egg.hit h2 { transform: rotate(-8deg); }
}

/* Readability: pixel digits are hard to read (8 looks like S, Z like 2), so numbers and
   character names use the bold condensed face; the pixel font stays on big titles. */
.stat .v, .roles, .countdown b, .badge b, .pod .val, .ranks .n, .ranks .val, .dcard .total, .pod .medal, .sheet-head .who h3 {
  font-family: var(--cond);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.stat .v { font-size: 40px; }
.stat .v small { font-size: 20px; }
.roles { font-size: 26px; }
.countdown b { font-size: 17px; }
.badge b { font-size: 17px; }
.pod .val { font-size: 38px; }
.ranks .n { font-size: 18px; }
.ranks .val { font-size: 24px; }
.dcard .total { font-size: 26px; }
.sheet-head .who h3 { font-size: clamp(26px, 3.6vw, 38px); text-transform: none; }

/* Entire roster: under-55 cards show rank and last seen in place of the BiS bar */
.card .meter .seen { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: 0.02em; font-size: 13px; }
.badges [hidden], .todo[hidden] { display: none; }

/* Pixel font only for the brand and big page titles; everything else uses the crisp condensed face. */
.section h2, .modal header h3, .loader p {
  font-family: var(--cond);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.section h2 { font-size: 28px; }

/* ---------- enchant lines and gear plan editing ---------- */
.slot .ench { display: block; }
.slot .ench.has { color: var(--q-uncommon); }
.slot .ench.none { color: var(--warn); font-weight: 600; }
.slot .ench.plan { color: var(--up); }
.slot .pen { position: absolute; bottom: 4px; right: 6px; font-size: 13px; color: var(--gold); opacity: 0; transition: opacity 0.3s var(--ease); }
.col.right .slot .pen { right: auto; left: 6px; }
.slot:hover .pen, .doll.editing .slot .pen { opacity: 1; }
.doll.editing .slot:not(.cosmetic) { border-style: dashed; border-color: rgba(242, 182, 50, 0.55); cursor: pointer; }
.doll.editing .slot:not(.cosmetic):hover { background: rgba(242, 182, 50, 0.07); }
.sheet-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -6px 0 18px; }
.sheet-tools .claim { color: var(--muted); font-size: 14px; }
.sheet-tools .claim b { color: var(--gold-2); }
.sheet-tools .hint { color: var(--gold-2); font-size: 14px; }
.sheet-tools .hint.age { color: var(--muted); }
.main-spec { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.main-spec label { display: inline-flex; align-items: center; gap: 6px; }
.main-spec select { width: auto; max-width: 100%; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #0c0607; color: var(--bone); font: 14px var(--body); color-scheme: dark; }
.main-spec.nudge select { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 30%, transparent); }
.main-roles { display: inline-flex; gap: 4px; }
.main-roles .chip { display: inline-flex; align-items: center; gap: 4px; }
.main-roles .chip svg { width: 13px; height: 13px; }
.main-roles .chip[aria-pressed='true'] { background: color-mix(in srgb, var(--rc) 18%, transparent); border-color: var(--rc); color: var(--rc); }
.talented { color: var(--muted); font-size: 0.9em; }
.btn[aria-pressed='true'] { border-color: var(--gold); color: var(--gold-2); box-shadow: 0 0 0 1px rgba(242, 182, 50, 0.3) inset; }

.modal .box { overflow: auto; }
.modal .scope { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ed-sec { padding: 12px 18px; border-top: 1px solid var(--line); }
.ed-sec h4 { margin: 0 0 6px; font: 700 14px var(--cond); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.ed-now { margin-bottom: 10px; font-size: 14px; color: var(--muted); }
.ed-now small { color: var(--dim); }
.ench-has { color: var(--q-uncommon); }
.ench-none { color: var(--warn); }
.modal .ed-sec input { width: 100%; margin: 0 0 8px; }
.modal .ed-sec .results { padding: 0; max-height: 240px; }
.ed-label { display: block; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.ed-row { display: flex; gap: 8px; align-items: flex-start; }
.ed-row input { flex: 1; min-width: 0; }
.ed-row .btn { padding-top: 10px; padding-bottom: 10px; }
.ed-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.ed-note { flex: 1 1 200px; font-size: 13px; color: var(--dim); }
.legend [data-bis-import] { margin-left: 6px; }
.imp-body { flex: 1 1 auto; min-height: 0; overflow: auto; color-scheme: dark; }
.imp-links { display: flex; flex-wrap: wrap; gap: 8px; }
.bis-import .ed-note { margin: 0 0 8px; }
.bis-import textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #0c0607; color: var(--bone); font: 14px var(--body); resize: vertical; }
.bis-import textarea:focus { border-color: var(--gold); outline: none; }
.imp-picks { display: grid; gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; }
.imp-picks li { display: grid; grid-template-columns: 92px 24px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 14px; }
.imp-picks .s { color: var(--muted); font-size: 13px; }
.imp-picks img { width: 24px; height: 24px; border-radius: 3px; border: 1px solid var(--qc); }
.imp-picks .noicon { width: 24px; height: 24px; border-radius: 3px; background: rgba(255, 255, 255, 0.05); }
.imp-picks a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-none, .imp-empty { color: var(--dim); font-size: 14px; }
.todo .get-box { grid-column: 1 / -1; }
.todo .get-list { gap: 0; }
.todo .get-list li { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.todo .get-list li:first-child { border-top: 0; padding-top: 0; }
.todo .get-list .s { padding-top: 2px; }
.get-what > a, .get-ench { font-weight: 600; }
.get-ench { color: var(--bone); }
.get-where, .get-needs { margin-top: 2px; color: var(--muted); font-size: 13px; }
.get-needs { color: var(--dim); }
.get-where a, .get-needs a { color: var(--gold-2); }
.get-zone { color: var(--dim); }
.get-cost { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--gold); font-weight: 600; white-space: nowrap; }
.get-cost > span { display: inline-flex; align-items: center; gap: 4px; }
.todo .get-cost img { width: 16px; height: 16px; border-radius: 3px; }
.get-cost .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.get-cost small { color: var(--dim); font-weight: 400; }
.get-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.todo .get-head h4 { margin: 0; }
.get-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.get-tabs .chip small { margin-left: 4px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.get-unknown { color: var(--dim); font-style: italic; }
.get-plan { margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--gold) 5%, transparent); }
.get-short { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.get-short b { color: var(--bone); }
.todo .get-places { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: place; }
.todo .get-places li { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; counter-increment: place; }
.todo .get-places li:not(.other)::before { content: counter(place); color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.get-places b { color: var(--bone); font-weight: 600; }
.get-places span { color: var(--gold-2); }
.todo .get-places li.other { border-style: dashed; color: var(--dim); }
.get-places li.other b { color: var(--muted); font-weight: 400; }
.get-none { margin: 0; color: var(--ok); }
.get-total { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.get-total b { color: var(--gold); }
.get-note { margin: 8px 0 0; color: var(--dim); font-size: 12px; }
@media (max-width: 640px) {
  .todo .get-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .todo .get-list .s { grid-column: 1 / -1; }
}
.imp-sub { margin: 14px 0 0; font: 700 13px var(--cond); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.imp-picks a.imp-ench { color: var(--bone); }
.imp-empty { margin: 10px 0 0; }

/* ---------- talents ---------- */
.talents { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.talents:empty { display: none; }
.tal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.tal-head h3 { margin: 0; font: 700 22px var(--cond); letter-spacing: 0.08em; text-transform: uppercase; color: var(--bone); }
.tal-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tal-tabs .chip small { margin-left: 4px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.tal-tabs .chip.add { border-style: dashed; color: var(--gold-2); }
.tal-info, .tal-draft { margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 0, 0, 0.25); font-size: 14px; color: var(--muted); }
.tal-info b { color: var(--bone); }
.tal-notes { margin: 6px 0 0; white-space: pre-wrap; color: var(--bone); }
.tal-diffs { color: var(--up); }
.tal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.tal-actions .grow { flex: 1; }
.tal-fields { display: grid; gap: 8px; }
.tal-fields input, .tal-fields textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #0c0607; color: var(--bone); font: 16px var(--body); resize: vertical; }
.tal-count { margin-top: 10px; font-variant-numeric: tabular-nums; }
.tal-count b { color: var(--gold-2); font: 700 20px var(--cond); }
.tal-trees { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tree { --ts: 44px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: radial-gradient(circle at 50% 0%, rgba(179, 32, 42, 0.12), transparent 60%), linear-gradient(180deg, #170b0d, #0e0708); }
.tree-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.tree-head img { width: 26px; height: 26px; border-radius: 4px; border: 1px solid var(--line-2); }
.tree-head b { font: 700 16px var(--cond); letter-spacing: 0.04em; color: var(--bone); }
.tree-head .pts { margin-left: auto; font: 700 20px var(--cond); color: var(--gold-2); font-variant-numeric: tabular-nums; }
.tree-grid { position: relative; display: grid; grid-template-columns: repeat(4, var(--ts)); grid-template-rows: repeat(var(--rows), var(--ts)); gap: 12px; justify-content: center; }
.tree-grid .links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.tree-grid .links line { stroke: #4a3a35; stroke-width: 3; vector-effect: non-scaling-stroke; }
.tree-grid .links line.lit { stroke: var(--gold); }
.tal { position: relative; z-index: 1; width: var(--ts); height: var(--ts); padding: 0; border: 2px solid #3d3431; border-radius: 6px; background: #0a0506 center/cover; box-shadow: inset 0 0 0 1px #000; filter: grayscale(1) brightness(0.55); transition: transform 0.25s var(--ease), filter 0.3s var(--ease), border-color 0.3s var(--ease); touch-action: manipulation; }
.tal:hover, .tal:focus-visible { transform: scale(1.08); filter: none; }
.tal.some { filter: none; border-color: var(--ok); box-shadow: inset 0 0 0 1px #000, 0 0 10px rgba(87, 199, 106, 0.35); }
.tal.max { filter: none; border-color: var(--gold); box-shadow: inset 0 0 0 1px #000, 0 0 12px rgba(242, 182, 50, 0.45); }
.tal.avail { filter: none; border-color: var(--ok); opacity: 0.9; }
.tal .rk { position: absolute; right: -6px; bottom: -6px; min-width: 24px; padding: 0 3px; border: 1px solid #000; border-radius: 4px; background: #120a0b; font: 700 11px/15px var(--cond); color: var(--dim); text-align: center; font-variant-numeric: tabular-nums; }
.tal.some .rk, .tal.avail .rk { color: var(--ok); }
.tal.max .rk { color: var(--gold-2); }
.tal.diff::after { content: ''; position: absolute; top: -5px; left: -5px; width: 11px; height: 11px; border-radius: 50%; background: var(--up); border: 2px solid #000; }
.tal-help { margin: 10px 0 0; font-size: 13px; color: var(--dim); }
.tal-help .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--up); vertical-align: middle; }
.pop .tal-desc { margin: 6px 0 0; font-size: 14px; color: var(--q-uncommon); line-height: 1.4; }
.pop .tal-desc.next { color: var(--muted); }

/* Hover vs touch hints */
@media (hover: hover) { .touch-only { display: none !important; } }
@media (hover: none) { .hover-only { display: none !important; } }

@media (max-width: 1100px) {
  .tree { --ts: 40px; }
  .tree-grid { gap: 10px; }
}
@media (max-width: 920px) {
  /* Trees become a swipeable row, one tree per screen on phones. */
  .tal-trees { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .tree { flex: 0 0 min(330px, 88%); scroll-snap-align: center; }
}
@media (max-width: 640px) {
  .tree { --ts: min(48px, calc((100vw - 120px) / 4 - 8px)); }
  .sheet-tools .btn { flex: 1 1 auto; justify-content: center; }
  .tal-actions .btn { flex: 1 1 auto; justify-content: center; }
  .tal-actions .grow { display: none; }
  /* Popovers become bottom sheets on phones. */
  .pop { left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; max-height: 60vh; overflow: auto; }
  .modal { padding: 0; align-items: end; }
  .modal .box { width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; }
  .ed-row { flex-direction: column; align-items: stretch; }
}

/* Talent grid without gaps: each cell is icon + spacing, so the arrow overlay (viewBox in cell
   units) lines up exactly with the icon centers. */
.tree-grid { --cell: calc(var(--ts) + 12px); gap: 0; width: max-content; margin: 0 auto; grid-template-columns: repeat(4, var(--cell)); grid-template-rows: repeat(var(--rows), var(--cell)); }
.tree-grid .tal { justify-self: center; align-self: center; }
@media (max-width: 1100px) { .tree-grid { --cell: calc(var(--ts) + 10px); } }

/* Tree buttons: jump between trees where only one fits (phones, small tablets). */
.tal-trees { position: relative; }
.tree-jump { display: none; gap: 6px; margin-bottom: 10px; overflow-x: auto; }
.tree-jump .chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tree-jump .chip img { width: 18px; height: 18px; border-radius: 3px; }
.tree-jump .chip b { font: 700 14px var(--cond); color: var(--gold-2); }
.tree-jump .chip[aria-pressed='true'] b { color: #fff; }
.tree { cursor: default; }
@media (max-width: 920px) { .tree-jump { display: flex; } }
.tree-jump, .tal-trees { scrollbar-width: none; }
.tree-jump::-webkit-scrollbar, .tal-trees::-webkit-scrollbar { display: none; }

/* ---------- add-on page ---------- */
.addon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.addon-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.addon-card .ico { font-size: 26px; line-height: 1; margin-bottom: 10px; }
.addon-card h3 { margin: 0 0 6px; font: 700 18px var(--cond); color: var(--gold); letter-spacing: 0.02em; }
.addon-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.addon-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.addon-steps, .addon-notes { margin: 0; padding-left: 20px; color: var(--bone); line-height: 1.6; }
.addon-steps li, .addon-notes li { margin-bottom: 8px; }
.addon-notes li { color: var(--muted); }
.addon-cmds { margin: 0; display: grid; gap: 4px 0; }
.addon-cmds dt { margin-top: 8px; }
.addon-cmds dd { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
#app code { font: 13px ui-monospace, Consolas, monospace; background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--gold-2); overflow-wrap: anywhere; }
@media (max-width: 760px) { .addon-cols { grid-template-columns: 1fr; gap: 6px; } }
.tab { white-space: nowrap; }
.addon-dl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.sound-list { display: grid; gap: 8px; margin-top: 12px; }
.sound-list.busy { opacity: 0.6; pointer-events: none; }
.sound-row { display: grid; grid-template-columns: minmax(0, 1fr) 260px auto; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.sound-name { display: grid; gap: 2px; min-width: 0; }
.sound-name .hint { overflow-wrap: anywhere; }
.sound-row audio { width: 100%; height: 34px; }
.sound-actions { display: flex; gap: 6px; }
.sound-actions label { cursor: pointer; }
@media (max-width: 760px) { .sound-row { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- raid calendar ---------- */
.tab .short { display: none; }
@media (max-width: 640px) { .tab .long { display: none; } .tab .short { display: inline; } }
.raid-you-line { color: var(--ok); }
.cal-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-head h2 { flex: 1; margin: 0; }
.cal-nav { display: flex; gap: 6px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 16px; }
.cal-dow { padding: 4px 6px; color: var(--dim); font: 600 12px var(--cond); text-transform: uppercase; letter-spacing: 0.08em; }
.cal-day { min-height: 92px; padding: 6px; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); min-width: 0; }
.cal-day.out { opacity: 0.4; }
.cal-day.today { border-color: var(--gold); }
.cal-day .n { color: var(--muted); font-size: 13px; }
.cal-day.today .n { color: var(--gold); font-weight: 700; }
.cal-ev { display: block; width: 100%; padding: 3px 6px; border: 1px solid rgba(217, 69, 77, 0.5); border-radius: 5px; background: rgba(198, 42, 51, 0.22); color: var(--bone); font: 13px var(--body); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-ev:hover { border-color: var(--gold); }
.cal-ev.me { border-color: rgba(87, 199, 106, 0.7); background: rgba(87, 199, 106, 0.18); }
.cal-ev b { color: var(--gold-2); font-weight: 600; }
.raid-list { display: grid; gap: 12px; }
.raid-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); scroll-margin-top: 90px; }
.raid-card.flash { animation: raid-flash 1.6s var(--ease); }
@keyframes raid-flash { 0%, 40% { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 182, 50, 0.25); } }
.raid-date { display: grid; justify-items: center; align-content: start; padding: 8px 0; border: 1px solid var(--line-2); border-radius: 8px; background: #160a0c; }
.raid-date .dow, .raid-date .mon { color: var(--muted); font: 600 12px var(--cond); text-transform: uppercase; letter-spacing: 0.08em; }
.raid-date .day { font: 700 30px/1.1 var(--pixel); color: var(--gold); }
.raid-body h3 { margin: 0; font: 700 22px var(--cond); color: var(--bone); letter-spacing: 0.02em; }
.raid-body h3 span { color: var(--muted); font-weight: 500; }
.raid-meta { margin: 4px 0 0; color: var(--muted); }
.raid-meta b, #ra-count b { color: var(--bone); }
.raid-meta b.full, #ra-count b.full { color: var(--ok); }
.raid-notes { margin: 8px 0 0; color: var(--bone); white-space: pre-line; }
.raid-you { margin: 8px 0 0; color: var(--ok); }
.raid-you b { color: var(--ok); }
.raid-roster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.raid-col h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font: 600 14px var(--cond); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.raid-col h4 small { color: var(--dim); }
.raid-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.raid-col li { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.raid-col li a { text-decoration: none; }
.raid-col li.me::after { content: ' ★'; color: var(--ok); }
.raid-col li.none { color: var(--dim); }
.raid-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.raid-actions .hint { color: var(--dim); font-size: 13px; }
.raid-past { margin-top: 18px; }
.raid-past summary { cursor: pointer; color: var(--muted); margin-bottom: 12px; }
.raid-form { display: grid; gap: 12px; padding: 0 18px 16px; overflow: auto; color-scheme: dark; }
.raid-form label { display: grid; gap: 4px; color: var(--muted); font-size: 14px; }
.raid-form label small { color: var(--dim); }
.modal .raid-form input, .raid-form select, .raid-form textarea { width: 100%; margin: 0; padding: 9px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #0c0607; color: var(--bone); font: 16px var(--body); color-scheme: dark; }
.raid-form textarea { resize: vertical; }
.raid-form label.check { display: flex; align-items: center; gap: 8px; color: var(--bone); flex-wrap: wrap; }
.modal .raid-form label.check input { width: 18px; height: 18px; padding: 0; accent-color: var(--gold-2); flex: none; }
.raid-weekly { color: var(--gold-2); white-space: nowrap; }
.dp-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #0c0607; color: var(--bone); font: 16px var(--body); text-align: left; cursor: pointer; }
.dp-field span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-field svg { flex: none; color: var(--muted); }
.dp-field:hover, .dp-field[aria-expanded='true'] { border-color: var(--gold); }
.dp-field:hover svg, .dp-field[aria-expanded='true'] svg { color: var(--gold); }
.dp { padding: 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); }
.dp[hidden] { display: none; }
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dp-head b { font: 600 16px var(--cond); letter-spacing: 0.06em; text-transform: uppercase; }
.dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.dp-dow { padding: 2px 0; text-align: center; color: var(--dim); font: 600 12px var(--cond); text-transform: uppercase; }
.dp-day { height: 36px; border: 1px solid transparent; border-radius: 6px; background: rgba(255, 255, 255, 0.04); color: var(--bone); font: 15px var(--body); cursor: pointer; transition: border-color 0.2s var(--ease), background 0.2s var(--ease); }
.dp-day:hover:not(:disabled) { border-color: var(--gold); }
.dp-day.out { background: transparent; color: var(--muted); }
.dp-day.today { border-color: var(--line-2); color: var(--gold); font-weight: 700; }
.dp-day[aria-pressed='true'] { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.dp-day:disabled { opacity: 0.3; cursor: default; }
.raid-form-row { display: grid; grid-template-columns: 1.4fr 1fr 0.8fr; gap: 10px; }
.raid-assign .results { padding: 0 12px 10px; }
.as-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius); }
.as-row.on { background: rgba(87, 199, 106, 0.08); }
.as-row img, .as-noimg { width: 32px; height: 32px; border-radius: 4px; background: #0c0607; }
.as-who { display: grid; min-width: 0; }
.as-who b, .as-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-who small { color: var(--muted); }
.as-who .ok { color: var(--ok); }
.as-roles { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.modal .results .as-roles .chip { display: inline-block; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; font-size: 12px; }
.modal .results .as-roles .chip:hover { border-color: var(--gold); color: var(--bone); }
.modal .results .as-roles .chip[aria-pressed='true'] { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.raid-assign footer { align-items: center; }
.raid-assign footer .hint { color: var(--dim); font-size: 13px; flex: 1; }
@media (max-width: 760px) {
  .cal { gap: 2px; }
  .cal-day { min-height: 54px; padding: 3px; }
  .cal-dow { padding: 2px; font-size: 10px; text-align: center; }
  .cal-day .n { font-size: 11px; }
  /* Days with raids show a marker; the cards below have the details. */
  .cal-ev { padding: 0; height: 8px; border-radius: 4px; font-size: 0; }
  .raid-card { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .raid-roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .as-row { grid-template-columns: 32px minmax(0, 1fr); }
  .as-roles { grid-column: 1 / -1; justify-content: flex-start; }
  .raid-form-row { grid-template-columns: 1fr 1fr; }
  .raid-form-row label:last-child { grid-column: 1 / -1; }
}
@media (max-width: 420px) { .tab { padding: 8px 5px; letter-spacing: 0.03em; } .top .wrap { gap: 6px; } }

/* raid sign-ups */
.cal-ev.signed { border-style: dashed; border-color: rgba(87, 199, 106, 0.7); }
.raid-signups { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.raid-signups h4 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0 0 8px; font: 600 14px var(--cond); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.raid-signups h4 small { color: var(--dim); text-transform: none; letter-spacing: 0; font: 13px var(--body); }
.su-waiting { color: var(--gold-2); text-transform: none; letter-spacing: 0; font: 13px var(--body); }
.su-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.su { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 9px 3px 7px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; }
.su a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su svg { width: 14px; height: 14px; display: block; }
.su .su-off { display: inline-flex; opacity: 0.8; }
.su .su-off svg { width: 11px; height: 11px; }
.su-mark { font-weight: 700; color: var(--ok); }
.su.maybe { border-style: dashed; }
.su.maybe .su-mark { color: var(--gold-2); }
.su.no { opacity: 0.55; }
.su.no .su-mark { color: var(--dim); }
.su.no a { text-decoration: line-through; }
.su.in { border-color: rgba(87, 199, 106, 0.6); background: rgba(87, 199, 106, 0.08); }
.su.me { box-shadow: 0 0 0 1px var(--ok); }
.su small { font-size: 12px; }
.su .guest-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-guest { color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px !important; margin-left: 2px; }
.su-actions { margin-top: 10px; }
.su-me { color: var(--muted); }
.su-field { display: grid; gap: 4px; color: var(--muted); font-size: 14px; }
.su-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.su-chips .chip { padding: 6px 14px; }
.su-chips .chip:disabled { opacity: 0.35; cursor: not-allowed; }
.as-who .su-tag { color: var(--ok); }
.as-who .su-tag.maybe { color: var(--gold-2); }
.as-who .su-tag.no { color: var(--dim); }
.modal .results .as-roles .chip.asked { border-color: var(--ok); border-style: dashed; color: var(--bone); }

/* raids page: your team and auto sign-up */
.my-teams { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.my-teams .dim { color: var(--dim); }
.team-status { font: 600 12px var(--cond); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ok); }
.team-status.trial { color: var(--warn); }
.team-status.bench { color: var(--muted); }
.team-card.mine { border-color: rgba(87, 199, 106, 0.6); }
.my-teams { gap: 8px; }
.my-team { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--panel); }
.my-team.auto-on { border-style: solid; border-color: rgba(87, 199, 106, 0.6); }
.my-team small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.my-team button[aria-pressed='true'] { border-color: rgba(87, 199, 106, 0.7); color: var(--ok); }
.raid-team { color: var(--gold-2) !important; }
/* All teams: a big bar that opens the rosters. */
.teams-all { margin-top: 18px; }
.teams-all > summary { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); cursor: pointer; list-style: none; transition: border-color 0.2s var(--ease), background 0.2s var(--ease); }
.teams-all > summary::-webkit-details-marker { display: none; }
.teams-all > summary:hover, .teams-all > summary:focus-visible { border-color: var(--gold); background: rgba(242, 182, 50, 0.06); outline: none; }
.ta-arrow { color: var(--gold); font-size: 14px; transition: transform 0.2s var(--ease); }
.teams-all[open] .ta-arrow { transform: rotate(90deg); }
.ta-label { font: 700 22px var(--cond); text-transform: uppercase; letter-spacing: 0.06em; color: var(--bone); }
.ta-count { min-width: 28px; padding: 2px 9px; border-radius: 999px; background: var(--crimson); color: #fff; font: 700 15px var(--cond); text-align: center; }
.ta-hint { margin-left: auto; color: var(--muted); font-size: 14px; }
.teams-all[open] > summary { border-color: var(--gold); margin-bottom: 12px; }
@media (max-width: 520px) { .ta-hint { display: none; } }
.auto-count { color: var(--ok); }
.raid-col li .su-auto { margin-left: 4px; color: var(--ok); }
.su-auto { color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px !important; }

/* ---------- raid lead: teams and DKP ---------- */
.lead-nav { margin-top: 18px; }
.lead-nav .chip { text-decoration: none; }
.team-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.team-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.team-head h3 { margin: 0; font: 700 22px var(--cond); color: var(--bone); letter-spacing: 0.02em; }
.team-head h3 span { color: var(--muted); font-weight: 500; }
.team-comp { display: flex; flex-wrap: wrap; gap: 8px; }
.team-comp span { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.team-comp img { width: 20px; height: 20px; border-radius: 4px; }
.raid-col small.trial { color: var(--warn); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.as-who .warn { color: var(--warn); }
.modal .results .as-roles .chip.asked { border-color: var(--gold); }
.as-status { padding: 3px 6px; border: 1px solid var(--line-2); border-radius: 999px; background: #0c0607; color: var(--bone); font: 12px var(--body); color-scheme: dark; }
.tm-all { display: flex; align-items: center; gap: 6px; margin: -4px 18px 8px; color: var(--muted); font-size: 13px; }
.modal .tm-all input { width: auto; margin: 0; }
.raid-form-row.two { grid-template-columns: 1fr 1fr; }
.raid-form-row.adj { grid-template-columns: 0.6fr 1.4fr auto; align-items: end; }

.dkp-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; }
.dkp-tools .filters { margin: 0; flex: 1; }
.dkp-tools input { padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #0c0607; color: var(--bone); font: 15px var(--body); min-width: 200px; }
.dkp-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.dkp-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.dkp-table th { padding: 10px 12px; text-align: left; color: var(--muted); font: 600 13px var(--cond); text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid var(--line-2); }
.dkp-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dkp-table tbody tr { cursor: pointer; transition: background 0.2s var(--ease); }
.dkp-table tbody tr:hover, .dkp-table tbody tr:focus-visible { background: rgba(255, 255, 255, 0.04); outline: none; }
.dkp-table tbody tr:last-child td { border-bottom: 0; }
.dkp-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.dkp-table .rank { color: var(--dim); width: 36px; }
.dkp-table td small { color: var(--dim); margin-left: 6px; }
.dkp-table .bal { font: 700 17px var(--cond); color: var(--gold); }
.dkp-table .dim, .dkp-act .dim { color: var(--dim); }
.neg, .dkp-table .bal.neg { color: var(--bad); }
.dkp-sub { margin: 26px 0 10px; font: 600 16px var(--cond); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.dkp-act { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.dkp-act li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 0, 0, 0.25); }
.dkp-act.in-modal { margin: 0; padding: 0 18px 12px; overflow: auto; }
.dkp-act .what { min-width: 0; display: grid; }
.dkp-act .what small { color: var(--dim); font-size: 12px; }
.dkp-act .what a { color: var(--bone); }
.dkp-act li.voided .dkp-amt, .dkp-act li.voided .what { opacity: 0.45; text-decoration: line-through; }
.dkp-amt { font: 700 17px var(--cond); text-align: right; font-variant-numeric: tabular-nums; }
.dkp-amt.pos { color: var(--ok); }
.dkp-amt.neg { color: var(--bad); }
.dkp-big { color: var(--gold); font-size: 18px; }
.dkp-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.aw-bar { display: flex; gap: 6px; align-items: center; }
.modal .aw-bar input { flex: 1; width: auto; margin: 0; padding: 7px 10px; font-size: 14px; }
.aw-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 10px; max-height: 260px; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: #0c0607; }
.aw-row { display: flex !important; align-items: center; gap: 8px; padding: 4px; border-radius: 4px; cursor: pointer; }
.aw-row:hover { background: rgba(255, 255, 255, 0.04); }
.modal .aw-row input { width: auto; margin: 0; }
.aw-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.aw-row small { margin-left: auto; color: var(--dim); white-space: nowrap; }
.it-after { margin: 0; align-self: end; padding-bottom: 10px; color: var(--muted); font-size: 14px; }
.it-after b { color: var(--gold); }
.it-after b.neg { color: var(--bad); }
.dkp-history { width: min(640px, 100%); }
.dkp-adjust { border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 640px) {
  .dkp-table th:nth-child(4), .dkp-table td:nth-child(4), .dkp-table th:nth-child(6), .dkp-table td:nth-child(6), .dkp-table th:nth-child(7), .dkp-table td:nth-child(7) { display: none; }
  .raid-form-row.adj { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  /* Five tabs don't fit a phone header; let them scroll sideways. */
  .tabs { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .viewer { flex: none; }
}

/* Raid Lead tab bar: big tabs on a shared baseline, the open one joined to the page below. */
.lead-section { padding-top: 8px; }
.lead-tabs { display: flex; gap: 4px; margin: 0 0 26px; border-bottom: 2px solid var(--line-2); }
.lead-tabs a {
  position: relative; display: inline-flex; align-items: center; gap: 8px; margin-bottom: -2px;
  padding: 14px 26px 12px; border: 2px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0;
  font: 700 18px var(--cond); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; color: var(--muted);
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.lead-tabs a:hover { color: var(--bone); background: rgba(255, 255, 255, 0.03); }
.lead-tabs a[aria-current='page'] { color: var(--gold); background: var(--panel); border-color: var(--line-2); box-shadow: inset 0 3px 0 var(--crimson); }
.lead-tabs a[aria-current='page']::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--panel); }
.lead-badge:empty { display: none; }
.lead-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--crimson); color: #fff; font: 700 13px var(--body); letter-spacing: 0; }
@media (max-width: 640px) { .lead-tabs a { flex: 1; justify-content: center; padding: 12px 10px 10px; font-size: 15px; } }

/* Standings / Suggested switch inside DKP. */
.dkp-views { display: flex; gap: 0; margin: 4px 0 16px; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; width: fit-content; max-width: 100%; }
.dkp-views button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 0; background: transparent; color: var(--muted); font: 600 15px var(--cond); letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; }
.dkp-views button + button { border-left: 1px solid var(--line-2); }
.dkp-views button:hover { color: var(--bone); }
.dkp-views button[aria-selected='true'] { background: var(--crimson); color: #fff; }
.dkp-views button[aria-selected='true'] .lead-badge { background: #fff; color: var(--crimson); }
.row-acts { text-align: right; }
.row-acts .btn { margin-left: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Suggested boss kills. */
.kill-help { max-width: 75ch; margin: 0 0 14px; }
.kills { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.kill { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 8px; background: var(--panel); }
.kill.awarded, .kill.dismissed { border-left-color: var(--line-2); opacity: 0.7; }
.kill-main b { font: 700 19px var(--cond); color: var(--bone); }
.kill-main small { display: block; margin-top: 2px; color: var(--muted); }
.kill-people { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 14px; }
.kill-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .kill { grid-template-columns: 1fr; } .kill-acts { justify-content: flex-start; } }

/* Award window: team or pick people. */
.dkp-award { width: min(620px, 100%); }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { padding: 10px; border: 0; background: transparent; color: var(--muted); font: 600 15px var(--cond); letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-selected='true'] { background: var(--crimson); color: #fff; }
.seg button:disabled { opacity: 0.4; cursor: not-allowed; }
.dkp-award[data-mode='pick'] .aw-team, .dkp-award[data-mode='pick'] .aw-team-btns, .dkp-award[data-mode='team'] .aw-picked { display: none !important; }
.aw-picked { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; align-items: center; }
.aw-picked .pick { padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: #0c0607; font: 600 13px var(--body); cursor: pointer; }
.aw-picked .pick:hover { border-color: var(--bad); }
.aw-team-btns { display: inline-flex; gap: 6px; }

/* DKP on the Readiness cards and character sheet. */
/* A tag on the card's top edge, so it takes no room from the name. */
.dkp-pill { position: absolute; top: -9px; right: 10px; display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 8px; border: 1px solid rgba(242, 182, 50, 0.5); border-radius: 999px; background: #1d1208; color: var(--muted); font: 600 10px/1.3 var(--cond); letter-spacing: 0.1em; }
.dkp-pill b { font: 700 13px var(--pixel); color: var(--gold); letter-spacing: 0; }
.dkp-pill.neg { border-color: rgba(229, 72, 77, 0.55); background: #1d0a0b; }
.roster { padding-top: 10px; }
.dkp-pill.neg b, .badge.dkp.neg b { color: var(--bad); }
.badge.dkp b { color: var(--gold); }
.dkp-box .dkp-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.dkp-box .dkp-head b { font: 700 30px var(--pixel); color: var(--gold); }
.dkp-box .dkp-head b.neg { color: var(--bad); }
.dkp-box .dkp-head span { color: var(--muted); font-size: 13px; }
.dkp-box li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; }
.dkp-box .amt { font: 700 15px var(--cond); text-align: right; }
.dkp-box .amt.pos { color: var(--ok); }
.dkp-box .amt.neg { color: var(--bad); }
.dkp-box .why { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dkp-box .why a { color: var(--bone); }
.dkp-box .s { min-width: 0; text-align: right; }
.dkp-box .btn { margin-top: 12px; }

/* ---------- admin: Discord roles ---------- */
.lead-tabs .soon { display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px 12px; font: 700 18px var(--cond); letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); cursor: default; }
.lead-tabs .soon small { font: 600 11px var(--body); letter-spacing: 0.04em; text-transform: none; padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 999px; }
@media (max-width: 640px) { .lead-tabs .soon { padding: 12px 8px 10px; font-size: 14px; } }
.adm-warn { margin: 0 0 16px; padding: 12px 16px; border: 1px solid rgba(242, 182, 50, 0.45); border-left: 4px solid var(--gold); border-radius: 8px; background: rgba(242, 182, 50, 0.07); color: var(--bone); }
.adm-roles { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 18px; }
.adm-role { --rc: #99aab5; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: #0c0607; color: var(--bone); font: 600 14px var(--body); cursor: pointer; }
.adm-role i, .rc i { width: 10px; height: 10px; border-radius: 50%; background: var(--rc); flex: none; }
.adm-role small { color: var(--dim); font-weight: 600; }
.adm-role em { font: 700 10px var(--cond); letter-spacing: 0.08em; text-transform: uppercase; font-style: normal; color: var(--gold); }
.adm-role:hover { border-color: var(--rc); }
.adm-role[aria-pressed='true'] { border-color: var(--rc); background: color-mix(in srgb, var(--rc) 16%, #0c0607); }
.adm-role.locked { color: var(--muted); }
#adm-filter { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.adm-members { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.adm-members > li:not(.empty-state) { display: grid; grid-template-columns: 40px minmax(140px, 220px) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.adm-members img, .adm-members .as-noimg { width: 40px; height: 40px; border-radius: 50%; background: #0c0607; display: block; }
.adm-members .who { min-width: 0; display: grid; }
.adm-members .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bone); }
.adm-members .who small { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.adm-members .who .you { display: inline; color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; font: 700 10px var(--cond); }
.adm-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.rc { --rc: #99aab5; display: inline-flex; align-items: center; gap: 5px; padding: 3px 4px 3px 9px; border: 1px solid color-mix(in srgb, var(--rc) 55%, transparent); border-radius: 999px; font: 600 13px var(--body); color: var(--bone); }
.rc.locked { padding-right: 9px; color: var(--muted); }
.rc-x { display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 50%; background: transparent; color: var(--dim); font-size: 11px; cursor: pointer; }
.rc-x:hover { background: rgba(229, 72, 77, 0.2); color: var(--bad); }
.adm-members select { padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #0c0607; color: var(--bone); font: 14px var(--body); color-scheme: dark; max-width: 170px; }
@media (max-width: 760px) {
  .adm-members > li:not(.empty-state) { grid-template-columns: 40px minmax(0, 1fr); }
  .adm-chips, .adm-members select { grid-column: 1 / -1; }
}
/* An empty list's single line spans the row instead of sitting in the first grid column. */
.dkp-act li.dim { display: block; }
/* ---------- raid buffs and debuffs ---------- */
.stat-open { display: block; width: 100%; text-align: left; transition: border-color 0.3s var(--ease), transform 0.3s var(--ease); }
.stat-open:hover { border-color: var(--gold); transform: translateY(-1px); }
.stat-open .sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.stat-open .sub b { color: var(--bone); }
.stat-open .go { margin-left: auto; color: var(--gold-2); font: 600 12px var(--cond); letter-spacing: 0.1em; text-transform: uppercase; }
.modal .box.aura-modal { width: min(1100px, 100%); max-height: 90vh; overflow: hidden; }
.aura-head .filters { margin: 10px 0 0; }
.aura-head .chip small { margin-left: 4px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.aura-body { overflow: auto; padding: 4px 18px 16px; color-scheme: dark; }
.stat-roles { grid-column: span 2; }
.aura-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.aura-group { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 0, 0, 0.25); }
.aura-group h4 { margin: 0 0 8px; font: 700 15px var(--cond); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.aura-group ul { list-style: none; margin: 0; padding: 0; }
.aura { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.aura:first-child { border-top: 0; padding-top: 0; }
.aura img { width: 24px; height: 24px; border-radius: 4px; box-shadow: 0 0 0 1px var(--line-2); }
.aura-what > a { font-weight: 600; color: var(--bone); }
.aura-does { color: var(--muted); font-size: 13px; }
.aura-who { margin-top: 2px; font-size: 13px; color: var(--dim); }
.aura-who a { font-weight: 600; }
.aura-who small { color: var(--dim); }
.aura-n { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.aura.none img { filter: grayscale(1); opacity: 0.45; }
.aura.none .aura-what > a { color: var(--dim); }
.aura.none .aura-who { font-style: italic; }
.cons-for { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 12px; color: var(--muted); font-size: 13px; }
.cons-for select { max-width: 100%; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #0c0607; color: var(--bone); font: 14px var(--body); color-scheme: dark; }
.cons-meta { margin-top: 2px; font-size: 12px; color: var(--dim); }
.cons-station { color: var(--gold-2); }
.cons-have { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--muted); cursor: pointer; }
.cons-have input { flex: none; width: 14px; height: 14px; margin: 0; padding: 0; accent-color: var(--gold); }
.aura-empty { color: var(--muted); }
