/* ===========================================================================
   Raid Check — Material-inspired dark theme
   =========================================================================== */
:root {
  /* surfaces (elevation tints over a near-black base) */
  --bg: #0d0e12;
  --surface-1: #16181f;
  --surface-2: #1c1f28;
  --surface-3: #242834;
  --surface-4: #2c313f;

  --on-surface: #e8eaf0;
  --on-surface-variant: #a6acba;
  --outline: #383d4a;
  --outline-variant: #262a33;

  /* primary (luminous indigo/violet) */
  --primary: #9b8cff;
  --on-primary: #1c163a;
  --primary-container: #312a5e;
  --on-primary-container: #e3dfff;

  --success: #5fd081;
  --success-container: #163a26;
  --error: #ff6f74;
  --error-container: #45191c;
  --warning: #ffd166;
  --warning-container: #3d3416;

  /* WoW class colors (kept — these are data, not decoration) */
  --c-warrior: #c69b6d;
  --c-paladin: #f48cba;
  --c-hunter: #aad372;
  --c-rogue: #fff468;
  --c-priest: #ffffff;
  --c-shaman: #3a8bff;
  --c-mage: #3fc7eb;
  --c-warlock: #9b8bf4;
  --c-druid: #ff7c0a;
  --c-deathknight: #c41e3a;

  --radius-card: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --e1: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px 1px rgba(0,0,0,.22);
  --e2: 0 2px 6px 2px rgba(0,0,0,.28), 0 1px 2px rgba(0,0,0,.4);
  --e3: 0 10px 28px rgba(0,0,0,.45);

  --ease: cubic-bezier(.2, 0, 0, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--on-surface);
  background:
    radial-gradient(1100px 520px at 12% -8%, #211d3f 0%, transparent 55%),
    radial-gradient(1000px 520px at 100% 0%, #15263a 0%, transparent 50%),
    var(--bg);
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: .1px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: "Roboto Mono", ui-monospace, Consolas, monospace;
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: .88em;
}

/* ---- app bar ------------------------------------------------------------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(20, 22, 29, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--outline-variant);
}
.appbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .5px;
  color: var(--on-primary);
  background: linear-gradient(135deg, var(--primary), #6d7dff 70%, #5ad1c4);
  box-shadow: var(--e2);
}
.appbar-titles h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: .2px; }
.appbar-sub { margin: 1px 0 0; color: var(--on-surface-variant); font-size: 13px; }

main {
  max-width: 1120px;
  margin: 28px auto;
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ---- segmented control --------------------------------------------------- */
.segmented {
  display: inline-flex;
  align-self: flex-start;
  background: var(--surface-1);
  border: 1px solid var(--outline);
  border-radius: 999px;
  padding: 5px;
  gap: 4px;
  box-shadow: var(--e1);
}
.mode-btn {
  border: none;
  background: transparent;
  color: var(--on-surface-variant);
  padding: 9px 22px;
  border-radius: 999px;
  cursor: pointer;
  font: 500 14px/1 "Roboto", sans-serif;
  letter-spacing: .2px;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.mode-btn:hover { color: var(--on-surface); background: rgba(255,255,255,.04); }
.mode-btn.active {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

/* ---- cards --------------------------------------------------------------- */
.card {
  background: var(--surface-1);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-card);
  padding: 26px 28px;
  box-shadow: var(--e1);
}
.hidden { display: none !important; }
#mode-raid { display: flex; flex-direction: column; gap: 22px; }

.eyebrow {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--primary);
}
.section-title { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: .2px; }

.step-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-container); color: var(--on-primary-container);
  font-weight: 700; font-size: 15px;
}
.step-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.hint { color: var(--on-surface-variant); margin: 6px 0 18px; max-width: 70ch; }

.row { display: flex; align-items: center; }
.gap { gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.grow { flex: 1 1 240px; }

/* ---- text fields (Material filled + floating label) ---------------------- */
.field { position: relative; display: block; }
.field > input,
.field > textarea {
  width: 100%;
  background: var(--surface-2);
  color: var(--on-surface);
  border: none;
  border-bottom: 2px solid var(--outline);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 23px 15px 8px;
  font: 400 15px/1.5 "Roboto", sans-serif;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.field > textarea {
  min-height: 170px;
  resize: vertical;
  font-family: "Roboto Mono", ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
}
.field > input:hover,
.field > textarea:hover { background: var(--surface-3); }
.field > input:focus,
.field > textarea:focus {
  outline: none;
  background: var(--surface-3);
  border-bottom-color: var(--primary);
}
.field-label {
  position: absolute;
  left: 15px;
  top: 16px;
  color: var(--on-surface-variant);
  font-size: 15px;
  pointer-events: none;
  transition: top .15s var(--ease), font-size .15s var(--ease), color .15s var(--ease);
}
.field > textarea + .field-label { top: 14px; }
.field > input:focus + .field-label,
.field > input:not(:placeholder-shown) + .field-label,
.field > textarea:focus + .field-label,
.field > textarea:not(:placeholder-shown) + .field-label {
  top: 7px;
  font-size: 11px;
  letter-spacing: .5px;
  color: var(--primary);
}

/* plain Material input (no floating label) for JS-built fields */
.m-input {
  background: var(--surface-2);
  color: var(--on-surface);
  border: none;
  border-bottom: 2px solid var(--outline);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 11px 13px;
  font: 400 15px/1.4 "Roboto", sans-serif;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.m-input:hover { background: var(--surface-3); }
.m-input:focus { outline: none; background: var(--surface-3); border-bottom-color: var(--primary); }
.m-input:disabled { opacity: .55; }

/* ---- buttons (Material, with ripple) ------------------------------------- */
.btn {
  position: relative;
  overflow: hidden;
  border: none;
  background: transparent;
  color: var(--on-surface);
  padding: 11px 26px;
  border-radius: 999px;
  cursor: pointer;
  font: 500 14px/1 "Roboto", sans-serif;
  letter-spacing: .35px;
  transition: box-shadow .2s var(--ease), background .2s var(--ease), opacity .2s;
  user-select: none;
}
.btn::after { /* state layer */
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.btn:hover::after { opacity: .08; }
.btn:active::after { opacity: .14; }

.btn.primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--e1);
}
.btn.primary:hover { box-shadow: var(--e2); }

.btn.ghost {
  color: var(--primary);
  border: 1px solid var(--outline);
}
.btn.danger { color: var(--error); border: 1px solid transparent; }

.btn.sm { padding: 8px 18px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn:disabled::after { opacity: 0; }

.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: currentColor;
  opacity: .28;
  pointer-events: none;
  animation: ripple .55s var(--ease);
}
@keyframes ripple { to { transform: scale(2.4); opacity: 0; } }

/* ---- messages ------------------------------------------------------------ */
.msg { color: var(--on-surface-variant); font-size: 13px; }
.msg.error { color: var(--error); }
.msg.ok { color: var(--success); }

/* ---- switch (Material) --------------------------------------------------- */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--on-surface-variant); font-size: 14px; user-select: none; }
.switch input { display: none; }
.switch .track {
  width: 40px; height: 22px; border-radius: 999px;
  background: var(--surface-4); border: 1px solid var(--outline);
  position: relative; transition: background .2s var(--ease), border-color .2s var(--ease);
  flex: none;
}
.switch .track::before {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--on-surface-variant); transition: transform .2s var(--ease), background .2s var(--ease);
}
.switch input:checked + .track { background: var(--primary-container); border-color: var(--primary); }
.switch input:checked + .track::before { transform: translateX(18px); background: var(--primary); }

/* ---- tables -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--outline-variant); border-radius: var(--radius-md); background: var(--surface-1); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--outline-variant); }
thead th {
  background: var(--surface-2);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  color: var(--on-surface-variant);
  position: sticky; top: 0;
}
tbody tr { transition: background .15s var(--ease); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr.excluded { opacity: .4; }
.col-check { width: 46px; text-align: center; }
.col-actions { width: 190px; }
.signup-name { color: var(--on-surface-variant); }

/* correction-table inline name input */
td input[type="text"] {
  width: 100%;
  background: var(--surface-2); color: var(--on-surface);
  border: none; border-bottom: 2px solid var(--outline);
  border-radius: 8px 8px 0 0; padding: 9px 11px; font-size: 14px;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
td input[type="text"]:focus { outline: none; background: var(--surface-3); border-bottom-color: var(--primary); }
td input[type="text"].changed,
td input[type="text"].dirty { border-bottom-color: var(--primary); }
.alias-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: var(--primary); margin-left: 8px;
}

/* checkbox accent */
input[type="checkbox"] { accent-color: var(--primary); width: 17px; height: 17px; }

/* ---- chips --------------------------------------------------------------- */
.chip, .tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  padding: 5px 12px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--outline);
  color: var(--on-surface-variant);
}
.tag.status-absence { color: var(--error); background: var(--error-container); border-color: transparent; }
.tag.status-bench { color: var(--warning); background: var(--warning-container); border-color: transparent; }

/* ---- manage / auth ------------------------------------------------------- */
.manage-auth { margin-bottom: 18px; }
.add-alias { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.add-alias .field { min-width: 200px; }

.auth-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--outline);
  border-radius: var(--radius-md); padding: 13px 18px;
}
.auth-bar.authed { border-color: rgba(95,208,129,.45); background: var(--success-container); }
.auth-status { font-size: 14px; font-weight: 500; color: var(--on-surface-variant); }
.auth-bar.authed .auth-status { color: var(--success); }
.auth-input { min-width: 200px; }
.auth-note {
  font-size: 13.5px; color: var(--warning);
  background: var(--warning-container); border: 1px solid rgba(255,209,102,.3);
  border-radius: var(--radius-md); padding: 13px 18px;
}
.actions-locked {
  font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--on-surface-variant);
}
.row-actions { display: flex; gap: 10px; }

/* ---- report summary ------------------------------------------------------ */
#summary { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 6px; }
.stat {
  flex: 1 1 160px;
  background: var(--surface-2); border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md); padding: 16px 18px;
}
.stat .num { font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: var(--on-surface-variant); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; margin-top: 2px; }
.stat.good .num { color: var(--success); }
.stat.bad .num { color: var(--error); }
.stat.warn .num { color: var(--warning); }
.flag-list { margin-top: 6px; font-size: 12px; color: var(--on-surface-variant); }

.report-controls { margin: 16px 0 20px; }

/* ---- player cards -------------------------------------------------------- */
#report { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.pcard {
  background: var(--surface-2); border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md); padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--e1);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.pcard:hover { box-shadow: var(--e2); transform: translateY(-2px); }
.pcard.problem { border-color: rgba(255,111,116,.4); }
.pcard.notfound { opacity: .9; }

.pcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pname { font-size: 19px; font-weight: 700; letter-spacing: .2px; }
.psub { font-size: 12px; color: var(--on-surface-variant); margin-top: 3px; }
.psub .orig { color: var(--warning); }

/* guild membership chip */
.guild-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  white-space: nowrap; border: 1px solid transparent;
}
.guild-badge .gb-state { font-size: 9.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; opacity: .85; }
.guild-badge.in { background: var(--success-container); color: var(--success); border-color: rgba(95,208,129,.4); }
.guild-badge.out { background: var(--error-container); color: var(--error); border-color: rgba(255,111,116,.4); }
.guild-badge.none { background: var(--surface-3); color: var(--on-surface-variant); border-color: var(--outline); }

.charmeta { font-size: 12px; color: var(--on-surface-variant); display: flex; gap: 14px; flex-wrap: wrap; }
.charmeta b { color: var(--on-surface); font-weight: 600; }

.zones { display: flex; flex-direction: column; gap: 13px; }
.zone-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.zone-name { font-weight: 600; }
.zone-count { color: var(--on-surface-variant); font-variant-numeric: tabular-nums; }
.zone-count.full { color: var(--success); }
.zone-count.none { color: var(--error); }

/* Material linear progress */
.bar { height: 6px; background: var(--surface-4); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width .4s var(--ease); }
.bar.full > span { background: var(--success); }

.furthest { font-size: 11.5px; color: var(--on-surface-variant); margin-top: 5px; }
.furthest b { color: var(--on-surface); font-weight: 600; }

details.bosses { margin-top: 5px; }
details.bosses summary {
  cursor: pointer; font-size: 11px; color: var(--on-surface-variant);
  list-style: none; user-select: none; display: inline-flex; align-items: center; gap: 5px;
}
details.bosses summary::-webkit-details-marker { display: none; }
details.bosses summary::before { content: "+"; font-weight: 700; color: var(--primary); }
details.bosses[open] summary::before { content: "–"; }
.boss-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; font-size: 12px; }
.boss-list li { display: contents; }
.boss-list .bn { color: var(--on-surface-variant); }
.boss-list .bn.killed { color: var(--on-surface); }
.boss-list .bk { text-align: right; color: var(--on-surface-variant); font-variant-numeric: tabular-nums; }
.boss-list .bk.killed { color: var(--success); font-weight: 600; }

.err-line { font-size: 12.5px; color: var(--error); }

#single-report { margin-top: 20px; max-width: 480px; }

.site-footer { text-align: center; color: var(--on-surface-variant); font-size: 12px; padding: 30px 20px; }

/* class colors */
.class-Warrior { color: var(--c-warrior); }
.class-Paladin { color: var(--c-paladin); }
.class-Hunter { color: var(--c-hunter); }
.class-Rogue { color: var(--c-rogue); }
.class-Priest { color: var(--c-priest); }
.class-Shaman { color: var(--c-shaman); }
.class-Mage { color: var(--c-mage); }
.class-Warlock { color: var(--c-warlock); }
.class-Druid { color: var(--c-druid); }
.class-DeathKnight { color: var(--c-deathknight); }
