/* HardcoreLedger — "Spirit Healer" theme: spectral ice-blue on deep night.
   Single-viewport dashboard: fixed background, no page scroll, tables scroll inside panels. */
:root {
  --night: #08090c;
  --night-2: #0c1016;
  --night-3: #141a24;
  --spectral: #9fc3d8;
  --spectral-dim: #5f7d92;
  --spectral-faint: rgba(159, 195, 216, .12);
  --bone: #e9eef3;
  --tomb: #8b95a1;
  --candle: #f2e3c2;
  --candle-dim: #c9b98f;
  --blood: #b0403a;
  --blood-dim: rgba(176, 64, 58, .12);
  --header-h: 59px;
  --header-gap: 16px;
  --reverence-h: 46px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--night); color: var(--bone);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5; overflow: hidden; padding-top: var(--header-gap);
}
h2, .brand-word { font-family: Cinzel, Georgia, "Times New Roman", serif; }

/* Fixed full-viewport background — never scrolls */
.bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(8,9,12,.62) 0%, rgba(8,9,12,.26) 36%, rgba(8,9,12,.05) 60%, rgba(8,9,12,.2) 100%),
    linear-gradient(0deg, rgba(8,9,12,.5) 0%, transparent 32%),
    url("assets/hero-spirit-healer.webp") 50% 18% / cover no-repeat;
}

/* Header — transparent glass bar */
.site-header {
  display: flex; align-items: center; gap: 30px;
  height: var(--header-h); padding: 0 28px;
  background: rgba(8, 9, 12, .45);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid rgba(198, 166, 106, .5);
  border-bottom: 1px solid rgba(198, 166, 106, .5);
  position: relative; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.emblem { width: 46px; height: 46px; object-fit: cover; mix-blend-mode: screen; flex-shrink: 0; }
.brand-word {
  font-weight: 600; font-size: 1.05em; letter-spacing: 3px; color: #ece2cc; white-space: nowrap;
}
.site-header nav { display: none; }
.realm-tag {
  position: absolute; left: 50%; transform: translateX(-50%);
  color: var(--spectral-dim); font-size: .8em; letter-spacing: 3px; text-transform: uppercase;
  white-space: nowrap; pointer-events: none;
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.about-link {
  color: var(--tomb); text-decoration: none; font-size: .92em; letter-spacing: .05em;
  white-space: nowrap;
}
.about-link:hover { color: var(--spectral); text-shadow: 0 0 12px rgba(159,195,216,.3); }
.log-run {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  border: 1px solid var(--candle-dim); color: var(--candle); text-decoration: none;
  padding: 9px 20px; border-radius: 8px; font-weight: 600; font-size: .92em;
  transition: background .15s, box-shadow .15s; white-space: nowrap; cursor: pointer;
  background: transparent; font-family: inherit;
}
.log-run:hover { background: rgba(242,227,194,.08); box-shadow: 0 0 18px rgba(242,227,194,.18); }
.log-run span { font-size: 1.1em; line-height: 1; }

/* Dashboard grid — everything visible, no page scroll */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 20px;
  height: calc(100vh - var(--header-h) - var(--header-gap) - var(--reverence-h));
  padding: 18px 42px 12px;
}
.hero-text { grid-column: 1; grid-row: 1; align-self: start; justify-self: end; width: min(620px, 100%); padding: 60px 0 0; }
.hero-text h1 {
  font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500;
  font-size: clamp(2.4em, 4.4vw, 3.7em); line-height: 1.04; letter-spacing: .01em;
  color: #f3ecdf; margin: 0 0 14px;
  text-shadow: 0 2px 26px rgba(0,0,0,.9), 0 0 60px rgba(159,195,216,.25);
}
.lede { color: #c3ccd6; font-size: 1.06em; max-width: 520px; margin: 0 0 20px; text-shadow: 0 2px 10px #000; line-height: 1.6; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid rgba(148,168,192,.38);
  background: linear-gradient(180deg, rgba(38,48,66,.88), rgba(20,26,38,.88));
  color: #d7dee8; padding: 10px 22px; border-radius: 14px; font-size: .9em;
  box-shadow: 0 4px 18px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.06);
}
.hero-badge img.badge-ic { width: 18px; height: 18px; flex-shrink: 0; mix-blend-mode: screen; }

/* Panels — compact like the mockup, background breathes through */
.panel.lb-panel { grid-column: 1; grid-row: 2; align-self: end; justify-self: end; width: min(620px, 100%); min-height: 42vh; max-height: 48vh; }
.panel.mem-panel { grid-column: 2; grid-row: 1 / 3; align-self: end; justify-self: start; width: min(660px, 100%); min-height: 56vh; max-height: 64vh; }
.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(11,15,21,.45), rgba(8,11,16,.5));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(198,166,106,.55); border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55),
    inset 0 0 0 4px rgba(5,7,10,.92),
    inset 0 0 0 5px rgba(198,166,106,.28);
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
}
/* mockup-style gold frame: corner studs */
.panel::before, .panel::after {
  content: ""; position: absolute; inset: -5px; pointer-events: none;
  background-image:
    linear-gradient(var(--gold), var(--gold)),
    linear-gradient(var(--gold), var(--gold)),
    linear-gradient(var(--gold), var(--gold)),
    linear-gradient(var(--gold), var(--gold));
  background-size: 7px 7px;
  background-position: 0 0, 100% 0, 0 100%, 100% 100%;
  background-repeat: no-repeat;
  opacity: .95;
}
.panel::after {
  inset: -5px;
  background-size: 3px 3px;
  background-position: 2px 2px, calc(100% - 2px) 2px, 2px calc(100% - 2px), calc(100% - 2px) calc(100% - 2px);
  opacity: .6;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 20px 22px 10px; flex-shrink: 0;
}
.panel-title { display: flex; gap: 12px; align-items: center; }
.panel-title svg { flex-shrink: 0; }
.panel-title h2 { margin: 0; font-size: 1.22em; color: var(--bone); letter-spacing: .02em; font-weight: 600; }
.panel-sub { margin: 2px 0 0; color: var(--spectral-dim); font-size: .78em; letter-spacing: 2px; text-transform: uppercase; }
.mini-tabs { display: flex; gap: 6px; flex-shrink: 0; padding-top: 2px; }
.tab {
  background: transparent; border: 1px solid var(--night-3); color: var(--tomb);
  padding: 6px 14px; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: .85em;
  transition: border-color .15s, color .15s, box-shadow .15s; white-space: nowrap;
}
.tab.active, .tab:hover { border-color: var(--spectral); color: var(--spectral); box-shadow: 0 0 14px rgba(159,195,216,.15); }
.filters-bar { display: flex; gap: 6px; align-items: center; padding: 2px 22px 10px; flex-shrink: 0; flex-wrap: wrap; }
.filters-extra {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 0 22px 12px; flex-shrink: 0;
}
.filter-label { color: var(--tomb); font-size: .85em; }
.chip {
  background: transparent; border: 1px solid var(--night-3); color: var(--tomb);
  padding: 5px 13px; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: .85em;
  transition: all .15s; white-space: nowrap;
}
.chip.active { color: var(--night); background: var(--spectral); border-color: var(--spectral); font-weight: bold; }
.chip:not(.active):hover { border-color: var(--spectral-dim); color: var(--spectral); }
.bracket-chip.active { background: var(--night-3); color: var(--spectral); border-color: var(--spectral); }
.wall-chip.active { background: transparent; color: var(--candle); border-color: var(--candle-dim); }
.ghost-chip { border-style: dashed; }
.guild-filter { display: inline-flex; gap: 6px; }
.guild-filter input {
  background: var(--night); border: 1px solid var(--night-3); color: var(--bone);
  padding: 5px 12px; border-radius: 8px; font-family: inherit; font-size: .85em; width: 150px;
}
.guild-filter input::placeholder { color: var(--tomb); }
.guild-filter input:focus { outline: none; border-color: var(--spectral-dim); }

/* The scrolling region inside each panel */
.panel-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 22px 18px; display: flex; flex-direction: column; }
.panel-scroll > .empty, .panel-scroll > .loading { margin: auto; }
.panel-scroll::-webkit-scrollbar { width: 10px; }
.panel-scroll::-webkit-scrollbar-track { background: transparent; }
.panel-scroll::-webkit-scrollbar-thumb { background: rgba(159,195,216,.18); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
.panel-scroll::-webkit-scrollbar-thumb:hover { background: rgba(159,195,216,.32); background-clip: content-box; border: 2px solid transparent; }

/* Leaderboard table — mockup columns */
table.board { width: 100%; border-collapse: collapse; }
table.board th {
  text-align: left; color: var(--spectral-dim); font-weight: 600; letter-spacing: 2px;
  font-size: .74em; text-transform: uppercase; padding: 8px 10px;
  border-bottom: 1px solid rgba(159,195,216,.14);
  position: sticky; top: 0; background: rgba(11,15,21,.96); z-index: 1;
}
table.board td { padding: 11px 10px; border-bottom: 1px solid rgba(20, 26, 36, .8); font-size: .94em; }
table.board tr.lead td { background: rgba(159,195,216,.09); }
table.board tr.lead td:first-child { border-radius: 6px 0 0 6px; }
table.board tr.lead td:last-child { border-radius: 0 6px 6px 0; }
.rank { white-space: nowrap; color: var(--spectral-dim); font-weight: 600; }
.rsep { color: var(--night-3); margin: 0 3px; font-weight: 400; }
.rdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.rdot.alliance { background: #8fb8e8; box-shadow: 0 0 8px #8fb8e8; }
.rdot.horde { background: #e8958a; box-shadow: 0 0 8px #e8958a; }
.name { color: var(--bone); font-weight: 600; }
.sub { color: var(--tomb); font-size: .85em; }
.cstar { color: var(--candle); font-size: .85em; cursor: help; }
table.board td.num { text-align: right; color: var(--spectral); font-weight: 600; white-space: nowrap; }
.alive-badge {
  display: inline-block; font-size: .72em; font-weight: 700; letter-spacing: 1.5px;
  color: #0e1622; background: #9fc3d8; border-radius: 999px;
  padding: 4px 14px; white-space: nowrap;
}
.loading, .empty { color: var(--tomb); text-align: center; padding: 30px; }

/* Memorial wall cards — mockup style */
.death-card {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid rgba(159,195,216,.12); border-radius: 8px;
  padding: 14px 16px; margin: 0 0 12px;
  background: linear-gradient(180deg, rgba(22,29,42,.55), rgba(13,18,27,.6));
  cursor: pointer; transition: border-color .15s;
}
.death-card:hover { border-color: rgba(201,169,106,.4); }
.death-card.witnessed { cursor: default; }
.death-icon {
  width: 30px; height: 30px; flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  color: #c9a96a;
}
.death-main { min-width: 0; flex: 1; }
.death-main .name { font-size: 1.02em; }
.death-main .sub { margin-top: 2px; }
.death-main .killer { color: #d96a55; font-size: .82em; letter-spacing: 1.2px; margin-top: 5px; font-weight: 600; }
.death-card.witnessed .killer { color: var(--candle-dim); }
.transfer-badge {
  display: inline-block; padding: 2px 10px; border: 1px solid var(--spectral-dim);
  border-radius: 20px; color: var(--spectral); font-size: .8em; letter-spacing: .08em;
}
.death-detail { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--night-3); }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.detail-label { color: var(--spectral-dim); font-size: .78em; letter-spacing: 1px; text-transform: uppercase; }
table.dmg { width: 100%; border-collapse: collapse; margin-top: 6px; }
table.dmg td { padding: 6px 8px; border-bottom: 1px solid rgba(20, 26, 36, .8); }
table.dmg td.num { text-align: right; color: var(--spectral); font-weight: 600; }
.badge {
  display: inline-block; font-size: .72em; letter-spacing: 1px; padding: 2px 8px;
  border-radius: 999px; border: 1px solid var(--spectral-dim); color: var(--spectral); margin-right: 4px;
}
.badge.broken { border-color: var(--blood); color: var(--blood); text-decoration: line-through; }
.faction-a { color: #8fb8e8; } .faction-h { color: #e8958a; }
.mode-hc { color: var(--blood); font-size: .8em; letter-spacing: 1px; font-weight: 600; }
.mode-self { color: var(--tomb); font-size: .8em; letter-spacing: 1px; }

/* Reverence strip */
.reverence {
  height: var(--reverence-h); display: flex; align-items: center; justify-content: center;
  color: var(--tomb); font-size: .9em; letter-spacing: .05em; margin: 0;
  text-shadow: 0 2px 8px #000;
}
.reverence span { color: var(--spectral-dim); margin: 0 10px; }

/* Download modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4,5,8,.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  position: relative; max-width: 540px; width: 100%;
  background: linear-gradient(180deg, rgba(13,17,24,.97), rgba(9,12,17,.98));
  border: 1px solid rgba(159,195,216,.2); border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0,0,0,.7), 0 0 60px rgba(159,195,216,.08);
  padding: 38px 40px; text-align: center;
}
.modal h2 { margin: 0 0 12px; font-size: 1.6em; color: var(--bone); letter-spacing: .02em; }
.modal p { color: var(--tomb); }
/* About modal — longer content, left-aligned and scrollable */
.about-modal { text-align: left; max-height: 88vh; overflow-y: auto; max-width: 620px; }
.about-modal h2 { text-align: center; }
.about-modal .about-body h3 {
  color: var(--spectral); font-size: .95em; letter-spacing: 2px; text-transform: uppercase;
  margin: 22px 0 8px; font-family: inherit; font-weight: 700;
}
.about-modal .about-body h3:first-child { margin-top: 6px; }
.about-modal .about-body p { margin: 0 0 10px; line-height: 1.65; font-size: .95em; }
.about-modal .about-body ol, .about-modal .about-body ul { margin: 0 0 10px; padding-left: 22px; color: var(--tomb); font-size: .95em; line-height: 1.65; }
.about-modal .about-body li { margin-bottom: 6px; }
.about-modal .about-body li::marker { color: var(--spectral-dim); }
.about-modal .about-body code {
  background: rgba(159,195,216,.1); border: 1px solid rgba(159,195,216,.18);
  border-radius: 4px; padding: 1px 6px; font-size: .88em; color: var(--spectral);
}
.about-modal .about-body .sub { text-align: center; }
.about-modal .about-body p:has(.btn) { text-align: center; }
.modal .sub { font-size: .85em; margin-top: 18px; }
.modal-x {
  position: absolute; top: 10px; right: 14px; background: none; border: none;
  color: var(--tomb); font-size: 1.7em; cursor: pointer; line-height: 1; padding: 4px 8px;
}
.modal-x:hover { color: var(--bone); }
.btn {
  display: inline-block; background: var(--candle); color: var(--night);
  padding: 14px 30px; border-radius: 8px; text-decoration: none; font-weight: 700; margin: 6px;
  letter-spacing: .02em; transition: box-shadow .15s, transform .15s;
}
.btn:hover { box-shadow: 0 0 30px rgba(242,227,194,.3); transform: translateY(-1px); }

/* Small screens: fall back to a scrolling page */
@media (max-width: 900px) {
  html, body { height: auto; }
  body { overflow: auto; }
  .site-header { gap: 14px; padding: 0 16px; }
  .site-header nav { display: none; }
  .brand-word { letter-spacing: 2px; font-size: .85em; }
  .log-run { padding: 8px 14px; font-size: .85em; }
  .dashboard { display: block; height: auto; padding: 16px; }
  .hero-text { margin-bottom: 18px; }
  .panel { margin-bottom: 18px; }
  .panel-scroll { max-height: 62vh; }
  .mem-panel .panel-scroll { max-height: 70vh; }
  table.board th:nth-child(4), table.board td:nth-child(4) { display: none; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-head { flex-direction: column; }
}
