/* Visual language adopted from BisListExample.html — the design reference
   committed at the root. Tokens first, then layout, then components. */

:root{
  --bg: #05070c;
  --bg-panel: #0b101c;
  --bg-panel-raised: #10182a;
  --line: #1c2740;
  --ice: #4fb3ff;
  --ice-dim: #2a6ba8;
  --ice-glow: rgba(79,179,255,0.35);
  --white: #eaf1fb;
  --muted: #7c8aa8;

  --need: #ffb454;
  --sr: #ff6b8b;
  --have: #52e0b8;

  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --serif: 'Cinzel', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
}

*{ box-sizing: border-box; margin: 0; padding: 0; }

body{
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79,179,255,0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(79,179,255,0.06), transparent),
    var(--bg);
  color: var(--white);
  font-family: var(--sans);
  min-height: 100vh;
  padding: 48px 20px 80px;
}

.wrap{ max-width: 980px; margin: 0 auto; }

/* ── header ───────────────────────────────────────────────────────────── */

header{ text-align: center; margin-bottom: 40px; }

.eyebrow{
  font-family: var(--mono); font-size: 12px; letter-spacing: 3px;
  color: var(--ice); text-transform: uppercase; margin-bottom: 14px;
}

h1{
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(30px, 5.5vw, 50px); letter-spacing: 1.5px; line-height: 1.2;
  background: linear-gradient(180deg, #ffffff 10%, #a9c9ec 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px var(--ice-glow);
}

.subtitle{ color: var(--muted); font-size: 15px; margin-top: 12px; }

.rune-divider{
  width: 100%; height: 1px; margin-top: 32px;
  background: linear-gradient(90deg, transparent, var(--ice-dim) 20%, var(--ice) 50%, var(--ice-dim) 80%, transparent);
  opacity: 0.6;
}

/* ── progress bars ────────────────────────────────────────────────────── */

.raid-progress{
  margin: 28px auto 0; max-width: 460px;
  display: flex; flex-direction: column; gap: 14px;
}
.raid-bar-label{
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  margin-bottom: 6px; letter-spacing: 1px;
}
.raid-bar-track{
  height: 6px; background: var(--bg-panel-raised);
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
}
.raid-bar-fill{ height: 100%; background: var(--have); transition: width 0.4s ease; }

/* ── controls ─────────────────────────────────────────────────────────── */

.control-bar{
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 18px; margin-top: 32px;
}
.control{ display: flex; flex-direction: column; gap: 6px; text-align: left; }
.control-row{ display: flex; gap: 6px; }
.control label{
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
}

select{
  background: var(--bg-panel-raised); color: var(--white);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
  font-family: var(--mono); font-size: 12.5px; cursor: pointer; min-width: 170px;
}
select:focus{ outline: 1px solid var(--ice); }
select:disabled{ color: var(--muted); cursor: not-allowed; opacity: 0.6; }

button{ font: inherit; cursor: pointer; }

.icon-btn{
  width: 36px; background: var(--bg-panel); color: var(--white);
  border: 1px solid var(--line); border-radius: 8px; font-size: 16px; line-height: 1;
}
.icon-btn:hover{ border-color: var(--ice-dim); }

.spec-tabs{
  display: flex; justify-content: center; gap: 10px;
  margin-top: 26px; flex-wrap: wrap;
}
.spec-tab{
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 1px;
  padding: 9px 20px; border-radius: 24px; border: 1px solid var(--line);
  background: var(--bg-panel); color: var(--muted);
  transition: all 0.15s ease; text-transform: uppercase;
}
.spec-tab:hover{ border-color: var(--ice-dim); color: var(--white); }
.spec-tab.active{
  background: rgba(79,179,255,0.12); border-color: var(--ice); color: var(--ice);
}

/* ── sections ─────────────────────────────────────────────────────────── */

section{ margin-top: 56px; }
.section-head{ display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.section-num{ font-family: var(--mono); color: var(--ice-dim); font-size: 13px; }
h2{
  font-family: var(--serif); font-size: 20px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--white);
}
.section-line{ flex: 1; height: 1px; background: var(--line); }

.legend{
  display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 20px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.legend span{ display: flex; align-items: center; gap: 6px; }
.legend .edit-note{ color: var(--ice); }

.dot{ width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.have{ background: var(--have); box-shadow: 0 0 8px var(--have); }
.dot.need{ background: var(--need); box-shadow: 0 0 8px var(--need); }
.dot.sr{ background: var(--sr); box-shadow: 0 0 8px var(--sr); }

.empty-note{
  font-family: var(--mono); font-size: 12px; color: var(--need);
  margin-bottom: 16px; min-height: 16px;
}
.prof-subtext{
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  line-height: 1.7; margin-bottom: 18px; max-width: 680px;
}
code{ font-family: var(--mono); color: var(--ice); }

/* ── gear table ───────────────────────────────────────────────────────── */

.gear-table{
  width: 100%; border-collapse: collapse; background: var(--bg-panel);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.gear-table thead th{
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted); text-align: left;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: var(--bg-panel-raised);
}
.gear-table thead th.status-col{ width: 34%; }
.gear-table thead th.avail-col{ width: 42%; }
.gear-table td{
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-size: 13.5px; vertical-align: top;
}
.gear-table tr:last-child td{ border-bottom: none; }
.gear-table tbody tr:not(.group-row):hover td{ background: rgba(79,179,255,0.03); }

.slot-name{ font-weight: 600; color: var(--white); white-space: nowrap; }

.group-header{
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 10px 16px;
  background: var(--bg-panel-raised);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  text-align: center;
}
.group-header.group-sr{ color: var(--sr); }
.group-header.group-need{ color: var(--need); }
.group-header.group-have{ color: var(--have); }
.gear-table tr.group-row:first-child .group-header{ border-top: none; }

/* ── status control ───────────────────────────────────────────────────── */

.status-control{ position: relative; display: inline-block; }
.status{
  display: inline-flex; align-items: center; gap: 6px; user-select: none;
  padding: 3px 9px 3px 7px; border-radius: 20px; border: 1px solid transparent;
  transition: all 0.15s ease; line-height: 1.5; background: transparent;
}
.status .dot{ flex-shrink: 0; transition: transform 0.15s ease; }
.status:hover .dot{ transform: scale(1.2); }
.status:focus-visible{ outline: 2px solid var(--ice); outline-offset: 2px; }
.status-caret{ font-size: 9px; opacity: 0.7; margin-left: 2px; }
.status.st-have{ color: var(--have); border-color: rgba(82,224,184,0.25); background: rgba(82,224,184,0.06); }
.status.st-need{ color: var(--need); border-color: rgba(255,180,84,0.25); background: rgba(255,180,84,0.06); }
.status.st-sr{ color: var(--sr); border-color: rgba(255,107,139,0.25); background: rgba(255,107,139,0.06); }

.status-menu{
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0;
  min-width: 150px; padding: 6px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg-panel-raised); box-shadow: 0 12px 30px rgba(0,0,0,0.42);
}
.status-option{
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px;
  border: 0; border-radius: 6px; background: transparent; color: var(--white);
  font-size: 12px; text-align: left;
}
.status-option:hover, .status-option:focus-visible{ background: rgba(255,255,255,0.08); outline: none; }
.status-option[aria-checked="true"]{ background: rgba(79,179,255,0.10); }

.status-note{
  display: block; margin-top: 6px; padding: 1px 3px; min-height: 15px;
  font-size: 11px; color: var(--muted); border-radius: 3px; outline: none;
}
.status-note:hover{ background: rgba(255,255,255,0.05); }
.status-note:focus{ outline: 1px dashed var(--muted); outline-offset: 2px; }
.status-note:empty::before{ content: "+ add a note"; opacity: 0.45; }

/* ── options cell ─────────────────────────────────────────────────────── */

.avail-cell .option-select{ width: 100%; min-width: 0; }
.option-src{
  font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 5px;
}
.option-src.inferred{ font-style: italic; }
.option-link{
  display: inline-block; margin-top: 5px; font-size: 11px;
  color: var(--ice-dim); text-decoration: none;
}
.option-link:hover{ color: var(--ice); text-decoration: underline; }

/* ── alternates held ──────────────────────────────────────────────────── */
/* A child row under its slot, present only when you own something that is
   not the BiS. Indented and quiet on purpose: it is an aside to the row
   above it, not a row in its own right. */

.alt-row > td{ padding: 0 14px 10px 14px; border-top: none; }
.alt-details{ font-size: 11.5px; }
.alt-details > summary{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 6px; cursor: pointer; list-style: none;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--need); background: rgba(214,167,63,0.07);
  border: 1px solid rgba(214,167,63,0.2);
}
.alt-details > summary::-webkit-details-marker{ display: none; }
.alt-details > summary::before{ content: '▸'; font-size: 9px; }
.alt-details[open] > summary::before{ content: '▾'; }
.alt-details > summary:hover{ background: rgba(214,167,63,0.12); }

.alt-list{ list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; }
.alt-list li{
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: 3px 0;
}
.alt-list a{ color: var(--ice-dim); text-decoration: none; }
.alt-list a:hover{ color: var(--ice); text-decoration: underline; }
.alt-rank{
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line);
}
.alt-src{ font-family: var(--mono); font-size: 10px; color: var(--muted); }

/* ── export ───────────────────────────────────────────────────────────── */

.export-bar{ display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.export-btn, .link-btn{
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.5px;
  padding: 10px 20px; border-radius: 8px; border: 1px solid var(--ice);
  background: rgba(79,179,255,0.12); color: var(--ice);
  text-decoration: none; transition: background 0.15s ease;
}
.export-btn:hover, .link-btn:hover{ background: rgba(79,179,255,0.22); }
.export-btn-os{ border-color: var(--need); color: var(--need); background: rgba(255,180,84,0.10); }
.export-btn-os:hover{ background: rgba(255,180,84,0.20); }
.link-btn{ border-color: var(--line); color: var(--muted); background: var(--bg-panel); }

/* ── auth ─────────────────────────────────────────────────────────────── */

.auth-bar{
  display: flex; justify-content: flex-end; align-items: center; gap: 12px;
  margin-bottom: 8px; min-height: 34px;
}
.auth-email{ font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

.hidden{ display: none !important; }

.modal{ position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.modal-backdrop{ position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.modal-panel{
  position: relative; width: min(420px, calc(100vw - 32px));
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 26px; box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.modal-panel h2{ margin-bottom: 10px; }
.modal-intro{ font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-bottom: 18px; }
.modal-panel label{
  display: block; margin-bottom: 14px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
}
.modal-panel input{
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  background: var(--bg-panel-raised); color: var(--white);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--sans); font-size: 13.5px; letter-spacing: normal;
  text-transform: none;
}
.modal-panel input:focus{ outline: 1px solid var(--ice); }
.modal-actions{ display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-actions button{
  padding: 9px 18px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-panel-raised); color: var(--muted); font-size: 13px;
}
.modal-actions .primary{ border-color: var(--ice); background: rgba(79,179,255,0.14); color: var(--ice); }
.modal-actions button:disabled{ opacity: 0.5; cursor: not-allowed; }
.auth-error{ color: var(--sr); font-size: 12px; min-height: 16px; line-height: 1.5; }
/* Same slot carries the "reset link sent" confirmation — green, not alarm-red. */
.auth-error.ok{ color: var(--have); }
.auth-toggle{ margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }
.auth-toggle a{ color: var(--ice); cursor: pointer; }

/* ── invite codes ─────────────────────────────────────────────────────── */

.invite-bar{ display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.invite-bar input{
  background: var(--bg-panel-raised); color: var(--white);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
  font-family: var(--sans); font-size: 13px; min-width: 200px;
}
.invite-bar input:focus{ outline: 1px solid var(--ice); }
#invite-uses{ min-width: 80px; }

.invite-table td{ vertical-align: middle; }
.invite-code{
  font-family: var(--mono); font-size: 13px; color: var(--ice);
  letter-spacing: 1px; user-select: all;
}
.invite-state{ font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.invite-state.live{ color: var(--have); }
.invite-state.blocked{ color: var(--muted); }
.invite-empty{ color: var(--muted); font-family: var(--mono); font-size: 12px; text-align: center; }
.invite-revoke{
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg-panel-raised); color: var(--sr); font-size: 12px;
}
.invite-revoke:hover{ border-color: var(--sr); }

/* ── scrape by link ───────────────────────────────────────────────────── */

.scrape-url input{ min-width: 460px; }
@media (max-width: 640px){ .scrape-url input{ min-width: 0; width: 100%; } }

.scrape-result{ margin-top: 4px; min-height: 24px; }
.scrape-status{ font-family: var(--mono); font-size: 12px; color: var(--muted); }
.scrape-status.error{ color: var(--sr); }
.scrape-status.ok{ color: var(--have); }

.scrape-preview{
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px 18px;
}
.scrape-target{ font-size: 14px; font-weight: 600; color: var(--white); }
.scrape-meta{
  display: block; font-family: var(--mono); font-size: 10.5px;
  font-weight: 400; color: var(--muted); margin-top: 3px;
}
.scrape-counts{ display: flex; gap: 14px; flex-wrap: wrap; flex: 1; }
.scrape-count{
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.5px; color: var(--muted);
}
.scrape-count.added{ color: var(--have); }
.scrape-count.removed{ color: var(--sr); }
.scrape-count.changed{ color: var(--need); }

/* Signed out: the lists stay readable, the controls stop pretending to work. */
.gear-table tbody.readonly .status,
.gear-table tbody.readonly .status-note{ opacity: 0.55; pointer-events: none; }

footer{
  text-align: center; margin-top: 64px; font-family: var(--mono);
  font-size: 11px; color: var(--muted); line-height: 1.9;
}
footer a{ color: var(--ice-dim); }

/* ── small screens: table collapses to cards ──────────────────────────── */

@media (max-width: 640px){
  body{ padding: 32px 14px 60px; }
  .gear-table thead{ display: none; }
  .gear-table, .gear-table tbody, .gear-table tr, .gear-table td{ display: block; width: 100%; }
  .gear-table tr:not(.group-row){ border-bottom: 1px solid var(--line); padding: 14px 16px; }
  .gear-table td{ border: none; padding: 8px 0; }
  .gear-table td::before{
    content: attr(data-label); display: block; font-family: var(--mono);
    font-size: 10px; color: var(--muted); letter-spacing: 1px;
    text-transform: uppercase; margin-bottom: 4px;
  }
  .gear-table tr.group-row{ padding: 0; }
  .gear-table td.group-header::before{ content: none; }
  .control, select{ width: 100%; }
  .control-bar{ flex-direction: column; }
}
