:root {
  --bg: #070818;
  --bg-2: #10142c;
  --panel: rgba(16, 20, 44, 0.92);
  --panel-2: #171c38;
  --line: #283057;
  --text: #f2f4f8;
  --muted: #9ba5c2;
  --blue: #5b8cff;
  --violet: #9d7bff;
  --red: #eb2948;
  --good: #8fd0a8;
  --warn: #e3b341;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body { margin: 0; background: var(--bg); color: var(--text); }

body {
  font: 15px/1.45 "Segoe UI", sans-serif;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(7, 8, 24, 0.66) 0%, rgba(7, 8, 24, 0.42) 16%, rgba(7, 8, 24, 0.6) 100%),
    radial-gradient(900px 420px at 8% -10%, rgba(91, 140, 255, 0.2), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgba(157, 123, 255, 0.22), transparent 55%),
    url("backdrop.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  background-position: center top;
}

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 36px 22px 80px; }

.hero {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 12px 0 8px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.brand-mark {
  margin: 0;
  font-size: 64px;
  line-height: 0.9;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.brand-mark .blue { color: var(--blue); }

.brand-mark .red {
  display: block;
  margin-top: 6px;
  color: var(--red);
  letter-spacing: 0.28em;
  font-size: 22px;
  font-weight: 700;
}

.lede { margin: 14px 0 0; color: var(--muted); max-width: 640px; }

.hero-side { min-width: 260px; flex: 0 1 320px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.stripe {
  height: 3px;
  margin: 18px 0 0;
  border: 0;
  background: linear-gradient(90deg, var(--blue), var(--violet) 78%, var(--red));
}

.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(7, 8, 24, 0.74);
  backdrop-filter: blur(12px);
}

.nav button, .btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 8px 12px;
}

.nav button { letter-spacing: 0.04em; }

.nav button.active {
  color: var(--text);
  border-color: transparent;
  background: linear-gradient(0deg, rgba(91, 140, 255, 0.16), transparent 70%);
  box-shadow: inset 0 -2px 0 var(--violet);
}

.btn {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel-2);
}

/* Same look as the addon: small cuts at top-left and bottom-right, a soft rim that lights blue on hover. */
.btn {
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
  background: linear-gradient(180deg, #1c2240, #141932);
  border-color: rgba(255, 255, 255, 0.14);
  color: #c5ceda;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.btn:hover:not(:disabled) { background: linear-gradient(180deg, #252c52, #1b2142); border-color: rgba(91, 140, 255, 0.75); color: var(--text); }

.btn:active:not(:disabled) { background: linear-gradient(180deg, #10132c, #161b38); }

.btn.primary { background: linear-gradient(180deg, #6f8dff, #7656ea); color: #ffffff; border-color: #b3c2ff; font-weight: 700; }

.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #88a3ff, #8566f4); border-color: #dbe4ff; }

.btn.primary:active:not(:disabled) { background: linear-gradient(180deg, #7656ea, #5f44cc); }

.btn.danger:hover:not(:disabled) { background: rgba(235, 41, 72, 0.14); color: #ffe1e5; }

.btn.danger { color: var(--red); border-color: rgba(235, 41, 72, 0.7); background: transparent; }

.btn:disabled { opacity: 0.45; cursor: default; }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }

.chip-btn {
  border-radius: 999px;
  background: transparent;
  padding: 6px 10px;
}

.chip-btn.on { background: rgba(255, 255, 255, 0.04); font-weight: 700; }

.flash {
  padding: 10px 12px;
  margin-bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
}

.flash.good { border-left-color: var(--good); }

.flash.bad { border-left-color: var(--red); }

.flash.warn { border-left-color: var(--warn); }

.layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }

.panel {
  background: rgba(12, 14, 20, 0.78);
  border: 1px solid var(--line);
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.display { margin: 0 0 8px; font-size: 32px; letter-spacing: 0.04em; font-weight: 750; }

.panel h2, .panel h3 { margin: 0 0 10px; }

.panel h3 { font-size: 16px; }

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.stack { display: flex; flex-direction: column; gap: 16px; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }

.grow { flex: 1 1 160px; }

label.field, .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}

input, select, textarea {
  width: 100%;
  background: #0c0f15;
  border: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--text);
}

textarea { resize: vertical; min-height: 140px; font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; line-height: 1.4; }
textarea.helper-paste { min-height: 88px; }
textarea.note-edit { width: 100%; min-height: 200px; font: 14px/1.5 "Segoe UI", sans-serif; }

.armory-link { color: var(--blue); }

input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.list-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 10px;
  margin-bottom: 6px;
}

.list-btn.active { border-color: var(--blue); }

.list-btn small, .muted { color: var(--muted); }

.role-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.role-col {
  background: #0c0f15;
  border: 1px solid var(--line);
  padding: 10px;
  min-height: 180px;
}

.role-col header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}

.role-col header strong {
  color: var(--text);
  font-size: 28px;
  letter-spacing: 0;
  font-weight: 750;
}

.person {
  display: grid;
  gap: 6px;
  padding: 8px;
  margin-bottom: 8px;
  background: var(--bg-2);
  border-left: 3px solid var(--line);
}

.person .who { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }

.person .name {
  background: transparent;
  border: 0;
  padding: 0;
  font-weight: 750;
}

.person .meta { color: var(--muted); font-size: 12px; }

.person select { padding: 4px 6px; }

.groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.group {
  background: #10141b;
  border: 1px solid var(--line);
  min-height: 148px;
  padding: 8px;
}

.group header {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.player {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 6px 8px;
  margin-bottom: 6px;
  background: #0c0e12;
  border-left: 3px solid var(--class, #888);
}

.player .name { font-weight: 650; }

.player .sub, .sub { color: var(--muted); font-size: 12px; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }

th { color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }

.bless-wrap { overflow-x: auto; }

.bless { border-collapse: collapse; min-width: 760px; }

.bless th, .bless td { padding: 4px; }

.bless select { min-width: 92px; }
.totem select { min-width: 148px; }

.note { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

.warn-list {
  margin: 10px 0 0;
  padding: 8px 12px 8px 30px;
  color: var(--warn);
  border: 1px solid rgba(227, 179, 65, 0.45);
  background: linear-gradient(180deg, rgba(227, 179, 65, 0.10), rgba(227, 179, 65, 0.04));
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.warn-list li + li { margin-top: 4px; }

/* A totem picked by hand: Organise keeps it, like the * mark in the addon. */
.bless td.hand select { border-color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); }

.item, .sims {
  border: 1px solid var(--line);
  background: #10141b;
  padding: 10px;
  margin-bottom: 8px;
}

.item header { display: flex; justify-content: space-between; gap: 8px; align-items: center; }

.call { color: var(--muted); }

.call.hit { color: var(--text); font-weight: 700; }

.q0 { color: #9d9d9d; }
.q1 { color: #ffffff; }
.q2 { color: #1eff00; }
.q3 { color: #0070dd; }
.q4 { color: #a335ee; }
.q5 { color: #ff8000; }

.roster-head {
  display: grid;
  grid-template-columns: 1fr auto minmax(180px, 260px);
  gap: 16px;
  align-items: end;
}

.roster-switch { display: flex; gap: 8px; flex-wrap: wrap; }

.roster-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0c0f15;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 12px;
}

.roster-tab.on { color: var(--text); border-color: var(--blue); }

.roster-tab b {
  min-width: 1.4em;
  text-align: center;
  color: var(--text);
  font-size: 12px;
}

.raid-mark {
  width: 14px;
  height: 14px;
  background: var(--blue);
}

.raid-mark.main { clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }

.raid-mark.guild {
  background: var(--red);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.roster-summary { display: flex; flex-direction: column; gap: 12px; }

.roster-counts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.roster-counts div {
  background: rgba(12, 15, 21, 0.82);
  border: 1px solid var(--line);
  padding: 10px 12px;
  backdrop-filter: blur(8px);
}

.roster-counts dt {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.roster-counts dd { margin: 2px 0 0; font-size: 28px; font-weight: 750; line-height: 1.1; }

[data-role-tone="tank"] { --tone: #c79c6e; }
[data-role-tone="healer"] { --tone: #6fbf73; }
[data-role-tone="melee"] { --tone: #e05a5a; }
[data-role-tone="ranged"] { --tone: #6aa8ff; }

.roster-counts [data-role-tone] dd { color: var(--tone); }

.roster-bar {
  display: flex;
  height: 8px;
  overflow: hidden;
  background: #0c0f15;
}

.roster-bar i { display: block; min-width: 4px; }

.roster-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.roster-class {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--line);
  padding: 4px 8px;
  color: var(--text);
}

.roster-class.on { background: rgba(255, 255, 255, 0.05); }

.roster-class b { color: var(--text); }

.class-pip { width: 8px; height: 8px; border-radius: 50%; }

.roster-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.roster-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.roster-col-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.role-pip {
  width: 14px;
  height: 14px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: -2px;
  background: var(--tone, var(--muted));
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.roster-col-count { color: var(--tone, var(--text)); font-size: 20px; font-weight: 750; }

.roster-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px 2px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: inherit;
  text-align: left;
  position: relative;
}

.roster-card.is-open .roster-row { background: rgba(91, 140, 255, 0.08); }

.avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: visible;
  background: linear-gradient(165deg, color-mix(in srgb, var(--race, #243044) 72%, white) 0%, var(--race, #1a2030) 46%, #10141c 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #f4f7fb;
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.avatar-letters { position: relative; z-index: 0; }

.spec-pip {
  position: absolute;
  right: -6px;
  bottom: -6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  background: #12151c;
  border: 1px solid var(--rim, var(--line));
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  color: var(--text);
}

.rank-medal {
  position: absolute;
  left: -5px;
  top: -4px;
  z-index: 2;
  min-width: 16px;
  height: 14px;
  padding: 0 2px;
  border-radius: 7px;
  background: #e3b341;
  color: #1a1404;
  font-size: 8px;
  line-height: 14px;
  font-weight: 800;
}

.rank-medal.gm { background: #f4f7fb; }

.roster-who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.roster-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; }

.roster-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.alt-badge {
  flex: none;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 5px;
}

.roster-spec { color: var(--muted); font-size: 12px; line-height: 1.3; }

.roster-level { color: var(--text); font-weight: 700; margin-right: 4px; }

.roster-os { margin-left: 6px; }

.roster-os abbr {
  margin-right: 4px;
  padding: 0 3px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 10px;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.os-mark {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 4px;
  background: #12151c;
  border: 1px solid var(--line);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text);
  vertical-align: -4px;
}

.race-chip {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  justify-self: end;
  background: var(--race, transparent);
  color: #f4f7fb;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.race-chip.is-empty { background: transparent; box-shadow: none; }

[data-race="Human"] { --race: #8d6a45; }
[data-race="Dwarf"] { --race: #a15a3a; }
[data-race="Night Elf"] { --race: #6d4ea3; }
[data-race="Gnome"] { --race: #c46b8a; }
[data-race="Orc"] { --race: #4e7a38; }
[data-race="Undead"] { --race: #7f9a86; }
[data-race="Tauren"] { --race: #8a5a32; }
[data-race="Troll"] { --race: #2f7c86; }
[data-race="High Elf"] { --race: #c9a15b; }
[data-race="Goblin"] { --race: #6a8f2e; }

.roster-edit h3 { margin: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.steps { margin-top: 28px; }

.steps ol {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
}

.steps li {
  display: flex;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px;
}

.steps li > span {
  color: var(--blue);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.steps h3 { margin: 0 0 6px; }

.steps p { margin: 0; color: var(--muted); }

.foot {
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.token-note { color: var(--muted); font-size: 13px; }

code, .mono { font-family: Consolas, "Cascadia Mono", monospace; color: #d5e4ff; }

.empty { color: var(--muted); padding: 12px 0; }

@media (max-width: 1100px) {
  .roster-head, .roster-counts, .roster-board { grid-template-columns: 1fr 1fr; }
  .roster-head { align-items: stretch; }
}

@media (max-width: 860px) {
  .layout, .role-board, .steps ol, .roster-head, .roster-counts, .roster-board { grid-template-columns: 1fr; }
  .brand-mark { font-size: 42px; }
  .nav { position: static; }
}
