:root {
  --bg: #0a0b0c;
  --panel: #11141a;
  --panel-2: #171b24;
  --line: #293242;
  --text: #e5edf8;
  --muted: #8490a3;
  --faint: #4d586b;
  --orange: #d97706;
  --amber: #f59e0b;
  --blue: #60a5fa;
  --green: #4ade80;
  --red: #fb7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 44px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(217, 119, 6, .14), transparent 30%),
    linear-gradient(180deg, #101216, var(--bg) 50%, #07080a);
}

button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #353b46; border-radius: 999px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
  background: rgba(15, 18, 24, .88);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 14px; min-width: 250px; }
.brand-mark {
  width: 145px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand h1 {
  margin: 0;
  font-family: Cinzel, Georgia, serif;
  font-size: 24px;
  line-height: 1;
  letter-spacing: .16em;
}

.brand p {
  margin: 5px 0 0;
  color: var(--amber-2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.tabs, .header-tools { display: flex; align-items: center; gap: 8px; }
.tabs {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #07090d;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 7px;
  color: #8893a5;
  background: transparent;
  font-weight: 800;
}

.tab.active {
  color: white;
  background: #a16207;
  box-shadow: 0 12px 28px rgba(161, 98, 7, .22);
}

.small-btn, .icon-btn, .primary-btn, .secondary-btn, .ghost-btn, .danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9px;
  color: white;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: .18s ease;
}

.small-btn {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #0b0f16;
  color: #cbd5e1;
  font-size: 10px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: #0b0f16;
  color: #aab4c3;
}

.icon-btn.add { color: var(--amber-2); }
.small-btn:hover, .icon-btn:hover, .secondary-btn:hover { border-color: rgba(245, 158, 11, .5); color: white; }

.primary-btn, .secondary-btn, .ghost-btn, .danger-btn {
  min-height: 42px;
  padding: 0 16px;
  font-size: 11px;
}

.primary-btn { background: #b45309; box-shadow: 0 14px 30px rgba(180, 83, 9, .2); }
.primary-btn:hover { background: #d97706; transform: translateY(-1px); }
.secondary-btn { border: 1px solid var(--line); background: #141a24; color: #d9e2ef; }
.ghost-btn { background: transparent; color: #9ca3af; }
.danger-btn { border: 1px solid rgba(251, 113, 133, .35); background: rgba(225, 29, 72, .12); color: #fecdd3; }

.shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

.view {
  display: none;
  grid-template-columns: minmax(310px, 370px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.view.active { display: grid; }
#quickView {
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
}
.quick-sidebar {
  display: grid;
  align-content: start;
  gap: 18px;
}
.content, .stack, .side-stack { display: grid; gap: 18px; }

.panel, .metric, .player-card, .lane, .group-card, .modal {
  border: 1px solid var(--line);
  background: rgba(17, 20, 26, .88);
  box-shadow: var(--shadow);
}

.panel { border-radius: 12px; overflow: hidden; }
.panel-head {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head.wrap { flex-wrap: wrap; }
.panel-head h2, .kicker {
  margin: 0;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.panel-head span, .muted { color: var(--muted); font-size: 12px; }
.panel-body { padding: 20px; }
.divider { height: 1px; background: var(--line); }
.modal-divider { grid-column: 1 / -1; }

.form-row, .filters { display: flex; gap: 10px; }
.filters { align-items: center; }
.roster-transfer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#setupView .panel-body.stack > .primary-btn,
#setupView .panel-body.stack > .danger-btn,
.roster-transfer-actions .primary-btn {
  width: 100%;
}
.war-role-create-row #warRoleName { flex: 1 1 auto; }
.war-role-create-row #warRoleColor {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  padding: 4px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #f8fafc;
  background: #080b10;
  outline: 0;
  padding: 12px 13px;
}

textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(245, 158, 11, .58); box-shadow: 0 0 0 3px rgba(245, 158, 11, .1); }
label { color: #8b95a6; font-size: 10px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; display: grid; gap: 7px; }
.checkbox-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  align-self: end;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}
.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--amber);
  border: 0;
  background: transparent;
  padding: 0;
}
.command-checks {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

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

.team-field-grid label {
  grid-column: 1 / -1;
}

.war-role-field-grid {
  grid-template-columns: minmax(0, 1fr) 110px;
}

.war-role-field-grid #warRoleEditColor {
  min-height: 44px;
  padding: 4px;
}

.team-field-grid textarea {
  min-height: 120px;
}

.role-checks-field {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  color: #8b95a6;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.role-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  width: 100%;
}

.role-check {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #080b10;
  color: #dbe4f0;
  font-size: 11px;
  letter-spacing: .08em;
}

.role-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--amber);
  padding: 0;
}

.bulwark-field {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.bulwark-field legend {
  margin-bottom: 8px;
  color: #8b95a6;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.bulwark-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.bulwark-option-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  object-fit: contain;
}

.empty.compact { padding: 18px 16px; }

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  border-radius: 10px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(23, 28, 37, .98), rgba(12, 15, 21, .98));
}

.metric small { color: #667085; font-size: 12px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.metric strong { display: block; margin-top: 8px; color: white; font-size: 30px; }
.metric-total { background: rgba(248, 250, 252, .14); border-color: rgba(248, 250, 252, .24); }
.metric-tanks { background: rgba(249, 115, 22, .18); border-color: rgba(249, 115, 22, .32); }
.metric-healers { background: rgba(34, 197, 94, .16); border-color: rgba(34, 197, 94, .3); }
.metric-dps-count { background: rgba(59, 130, 246, .18); border-color: rgba(59, 130, 246, .32); }
.metric-bench-count { background: rgba(239, 68, 68, .18); border-color: rgba(239, 68, 68, .32); }
.metric-total small,
.metric-total strong { color: #f8fafc; }
.metric-tanks small { color: rgba(251, 146, 60, .9); }
.metric-healers small { color: rgba(74, 222, 128, .9); }
.metric-dps-count small { color: rgba(96, 165, 250, .9); }
.metric-bench-count small { color: rgba(248, 113, 113, .9); }

.war-role-list,
.lane-list { display: grid; gap: 10px; }
.war-role-row,
.lane-row,
.sector-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b0f16;
  color: #dbe4f0;
}

.lane-row > span:first-child,
.war-role-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.lane-row strong,
.war-role-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.lane-row,
.war-role-row {
  cursor: grab;
}
.lane-row.dragging,
.war-role-row.dragging {
  opacity: .55;
}
.lane-row.drag-over-before,
.war-role-row.drag-over-before {
  border-top-color: rgba(245, 158, 11, .85);
  box-shadow: inset 0 3px 0 rgba(245, 158, 11, .85);
}
.lane-row.drag-over-after,
.war-role-row.drag-over-after {
  border-bottom-color: rgba(245, 158, 11, .85);
  box-shadow: inset 0 -3px 0 rgba(245, 158, 11, .85);
}
.row-grip,
.lane-row-grip {
  color: #657084;
  cursor: grab;
}
.war-role-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.war-role-row-actions .icon-btn {
  width: 32px;
  height: 32px;
}
.lane-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.lane-row-actions .icon-btn {
  width: 32px;
  height: 32px;
}

.sector-btn {
  width: 100%;
  height: 48px;
  text-align: left;
}
.sector-btn > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sector-btn.active { border-color: rgba(245, 158, 11, .5); background: rgba(146, 64, 14, .18); }
.swatch { width: 13px; height: 13px; border-radius: 999px; flex: 0 0 auto; }

.player-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.player-card {
  position: relative;
  border-radius: 8px;
  padding: 8px;
  padding-right: 54px;
  background: #0f111a;
  cursor: pointer;
  transition: .18s ease;
  overflow: hidden;
  border: 1px solid #161d28;
}
#setupView .player-card {
  padding: 14px;
  padding-right: 60px;
}

.player-card:hover, .player-card.dragging { border-color: rgba(245, 158, 11, .45); transform: translateY(-2px); }
.player-card.dragging { opacity: .55; }

.player-top {
  display: flex;
  justify-content: flex-start;
  gap: 5px;
  align-items: flex-start;
}
.player-info { min-width: 0; }
.player-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.player-icon-stack {
  display: flex;
  align-self: stretch;
  gap: 6px;
  flex: 0 0 auto;
}
.role-badge,
.path-badge {
  flex: 0 0 42px;
  width: 42px;
  min-height: 42px;
  justify-content: center;
  font-size: 20px !important;
  padding: 0;
  font-size: 17px;
}
.role-badge img,
.path-badge img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.role-badge.bench-role img,
.path-badge.bench-role img {
  filter: grayscale(1) saturate(0);
  opacity: .50;
}
.player-card.meta-inline .player-top { align-items: center; }
.player-card.meta-inline .player-icon-stack {
  align-self: center;
}
.player-card.meta-inline .role-badge,
.player-card.meta-inline .path-badge {
  flex-basis: 30px;
  width: 30px;
  min-height: 30px;
  font-size: 14px !important;
}
.player-card.meta-inline .role-badge img,
.player-card.meta-inline .path-badge img {
  width: 24px;
  height: 24px;
}

.bookmark-stack {
  position: absolute;
  top: 0;
  right: 12px;
  z-index: 2;
  display: flex;
  gap: 5px;
  align-items: flex-start;
}

.bookmark {
  position: relative;
  width: 24px;
  height: 33px;
  display: grid;
  place-items: start center;
  padding-top: 8px;
  color: white;
  font-size: 12px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .35));
}

.bookmark::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}

.bookmark i {
  color: #0a0b0c;
  position: relative;
  z-index: 1;
}

.main-command-mark { color: #ef4444; }
.commander-mark { color: #fbbf24; }
.party-mark { color: #38bdf8; }
.player-name { margin: 0; color: white; font-size: 16px; }
.player-name.bench-name { color: #3f495d; }
.player-order {
  align-self: center;
  flex: 0 0 auto;
  color: #6e7788;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  border: 1px solid #6e7788;
  border-radius: 4px;
  padding: 4px 2px;
  width: 22px;
  text-align: center;
}
#setupView .player-order {
  position: absolute;
  right: 16px;
  top: 16px;
}
.player-meta { margin-top: 5px; color: #6e7788; font-size: 11px; }
.path-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.bulwark-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  object-fit: contain;
}
.player-card.meta-inline .player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.player-card.meta-inline .player-meta { margin-top: 0; }
.player-title-row .bench-badge {
  padding: 3px 7px;
  font-size: 9px;
}
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid;
  border-radius: 6px;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 600;
  /* text-transform: uppercase; */
}

.tank { color: var(--orange); border-color: rgba(251, 191, 36, .32); background: rgba(146, 64, 14, .16); }
.healer { color: var(--green); border-color: rgba(74, 222, 128, .4); background: rgba(22, 163, 74, .12); }
.dps { color: var(--blue); border-color: rgba(96, 165, 250, .44); background: rgba(37, 99, 235, .12); }
.bench-role,
.muted-tag {
  color: #94a3b8;
  border-color: rgb(20 21 22);
  background: rgb(0 0 0 / 10%);
}

.bench-badge {
  color: #fb7185;
  border-radius: 4px;
  border-color: #000;
  background: rgba(225, 29, 72, .12);
}
.status { color: #fbbf24; border-color: rgba(251, 191, 36, .32); background: rgba(146, 64, 14, .16); }
.status.apprentice { color: #cbd5e1; border-color: rgba(148, 163, 184, .28); background: rgba(148, 163, 184, .08); }

.war-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.war-head h2 {
  margin: 0;
  font-family: Cinzel, Georgia, serif;
  font-size: 27px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.war-head p { margin: 5px 0 0; color: #6f7a8c; font-size: 11px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.war-mode { display: none; }
.war-mode.active { display: block; }

.lane-create-row {
  width: min(420px, 100%);
  flex: 1 1 320px;
}
.lane-create-row #laneName { flex: 1 1 auto; }

.bench { margin-bottom: 16px; }
.bench-sidebar {
  position: fixed;
  top: 104px;
  left: 24px;
  bottom: 68px;
  z-index: 18;
  width: 390px;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: rgba(245, 158, 11, .38);
  background: #0d1118;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, .16), 0 28px 80px rgba(0, 0, 0, .68);
  transition: transform .22s ease, opacity .22s ease;
}

.bench-sidebar .panel-head {
  background: #131923;
}

.bench-sidebar .bench-filters {
  background: #0f141d;
}

body:not(.bench-sidebar-open) .bench-sidebar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(-100% - 34px));
}

.bench-sidebar-toggle {
  position: fixed;
  top: 104px;
  left: 24px;
  z-index: 19;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(251, 191, 36, .42);
  border-radius: 14px;
  color: white;
  background: #d97706;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .18), 0 16px 34px rgba(217, 119, 6, .34), var(--shadow);
  font-size: 22px;
  transition: transform .22s ease, border-color .18s ease, color .18s ease;
}

.bench-sidebar-toggle:hover {
  border-color: rgba(255, 237, 213, .72);
  background: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, .24), 0 18px 38px rgba(217, 119, 6, .42), var(--shadow);
}

body.bench-sidebar-open .bench-sidebar-toggle {
  transform: translateX(402px);
}

.bench-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.bench-list {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 10px;
  overflow-x: visible;
  overflow-y: auto;
  min-height: 0;
  padding: 14px;
}
.bench-list .player-card {
  min-width: 0;
  height: auto;
  padding: 7px 10px;
  padding-right: 42px;
}
.bench-list .player-top {
  min-height: 36px;
  align-items: center;
}
.bench-list .player-icon-stack {
  align-self: center;
}
.bench-list .role-badge,
.bench-list .path-badge {
  flex: 0 0 34px;
  width: 34px;
  min-height: 34px;
  height: 34px;
}
.bench-list .role-badge img,
.bench-list .path-badge img {
  width: 28px;
  height: 28px;
}
.bench-list .player-title-row {
  min-width: 0;
  flex-wrap: nowrap;
}
.bench-list .player-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bench-list .player-order {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}
.bench-list.drag-over {
  outline: 2px dashed rgba(245, 158, 11, .65);
  outline-offset: -8px;
  background: rgba(245, 158, 11, .06);
}

.lane-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lane {
  min-height: 420px;
  border-radius: 14px;
  overflow: hidden;
}

.lane.drag-over { border-color: rgba(245, 158, 11, .8); box-shadow: 0 0 0 3px rgba(245, 158, 11, .12), var(--shadow); }
.lane-head {
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 42, .68);
}

.lane-head h3 { margin: 0; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; }
.lane-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.lane-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.lane-clear-btn {
  width: 28px;
  height: 28px;
  font-size: 11px;
}
.count {
  min-width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #1f2937;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 900;
}

.lane-body { min-height: 350px; display: grid; align-content: start; gap: 8px; padding: 14px; }
.assigned-card { position: relative; }
.assigned-card.drag-over .player-card { border-color: rgba(245, 158, 11, .8); box-shadow: 0 0 0 3px rgba(245, 158, 11, .12); }
.assigned-card.drag-over-before::before,
.assigned-card.drag-over-after::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  z-index: 6;
  height: 4px;
  border-radius: 999px;
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, .18), 0 8px 18px rgba(0, 0, 0, .38);
  pointer-events: none;
}
.assigned-card.drag-over-before::before { top: -6px; }
.assigned-card.drag-over-after::after { bottom: -6px; }

.sector-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 14px;
}
.sector-grid .assigned-card {
  min-width: 0;
}

.quick-team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  min-width: 620px;
}

#quickView .panel-body { overflow-x: auto; }

.quick-counter-list {
  display: grid;
  gap: 12px;
}

.quick-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 14, 20, .48);
}

.quick-counter span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-counter strong {
  color: #f8fafc;
  font-size: 24px;
  line-height: 1;
}

.quick-counter.total {
  background: linear-gradient(135deg, rgb(255 174 38 / 65%), rgb(255 94 0 / 17%));
  border-color: rgba(245, 158, 11, .46);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}

.quick-counter.total.low {
  background: linear-gradient(135deg, rgb(251 4 4 / 68%), rgba(127, 29, 29, .28));
  border-color: rgba(245, 40, 40, .5);
}

.quick-counter.total.full {
  background: linear-gradient(135deg, rgba(74, 222, 128, .62), rgba(21, 128, 61, .24));
  border-color: rgba(74, 222, 128, .48);
}

.quick-counter.total span,
.quick-counter.total strong {
  color: #fff7ed;
}

.quick-counter.total i { color: #fbbf24; }
.quick-counter.total.low i { color: #fecdd3; }
.quick-counter.total.full i { color: #bbf7d0; }
.quick-counter.tank i { color: #d97706; }
.quick-counter.healer i { color: #34d399; }
.quick-counter.dps i { color: #60a5fa; }

.quick-team-count-list {
  display: grid;
  gap: 8px;
}

.quick-team-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgb(145 137 255 / 8%);
}

.quick-team-count span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
}

.quick-team-count strong {
  color: #f8fafc;
  font-size: 18px;
  line-height: 1;
}

.quick-war-role-count {
  background: rgba(15, 18, 24, .62);
}

.quick-war-role-count .swatch {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .08);
}

.quick-bulwark-count {
  background: rgba(15, 18, 24, .62);
}

.quick-bulwark-count img {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  object-fit: contain;
}

.quick-main-command-list {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-main-command {
  padding: 2px 10px 5px;
  border: 1px solid #ff0000;
  border-radius: 5px;
  background: rgb(115 0 0 / 38%);
}

.quick-main-command strong {
  color: #f8fafc;
  font-size: 13px;
}

.quick-main-command span {
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.35;
}

.quick-main-command-inline {
  display: grid;
  justify-items: end;
  gap: 8px;
  text-align: right;
}

.quick-main-command-inline > span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.quick-main-command-inline .empty {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.quick-team {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 14, 20, .52);
  overflow: hidden;
}

.quick-team.drag-over {
  border-color: rgba(245, 158, 11, .8);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .12), var(--shadow);
}

.quick-team-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(217, 119, 6, .08);
}

.quick-team-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #f8fafc;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.quick-team-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-team h3.player-name {
  font-size: 14px;
}

.quick-team-head p {
  margin: 6px 0 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.35;
}

.quick-team-lead-stack {
  display: grid;
  justify-items: end;
  gap: 4px;
  max-width: 48%;
}

.quick-commanders,
.quick-party-leads {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
  color: #fbbf24;
  font-size: 11px;
  line-height: 1.3;
  text-align: right;
}

.quick-commanders span,
.quick-party-leads span {
  color: #94a3b8;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-commanders strong,
.quick-party-leads strong {
  color: #fbbf24;
  font-weight: 900;
  font-size: 12px
}

.quick-party-leads strong {
  color: #38bdf8;
}

.quick-team-body {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px;
}

#quickView .player-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  flex-wrap: wrap;
  margin: auto;
}

#quickView .player-icon-stack {
  gap: 4px;
}

#quickView .role-badge,
#quickView .path-badge {
  flex-basis: 25px;
  width: 25px;
  min-height: 25px;
  font-size: 13px !important;
}

#quickView .role-badge img,
#quickView .path-badge img {
  width: 20px;
  height: 20px;
}

#quickView .player-title-row,
#quickView .player-meta {
  margin-top: 0;
}

#quickView .path-line {
  gap: 6px;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 14px;
}

.group-card { border-radius: 14px; overflow: hidden; }
.group-card .lane-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.placeholder-card { opacity: .62; }
.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(217, 119, 6, .09);
}
.group-head h3 { margin: 0; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; }
.group-body { display: grid; gap: 12px; padding: 14px; }

.sector-layout,
.group-layout { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 18px; }
.group-layout { display: block; }
.sector-tabs,
.group-tabs {
  display: grid;
  grid-auto-rows: 48px;
  align-content: start;
  gap: 10px;
}

.empty {
  padding: 42px 16px;
  border: 2px dashed rgba(148, 163, 184, .14);
  border-radius: 12px;
  color: #465063;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.empty.full-width { grid-column: 1 / -1; }

.war-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: flex;
  justify-content: center;
  gap: 26px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: rgba(7, 9, 13, .9);
  color: #788397;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.war-footer.active { display: flex; }
.war-footer strong { color: white; }
.war-footer a {
  color: inherit;
  text-decoration: none;
}
.blue { color: #3b82f6; } .red { color: #ef4444; } .green { color: #22c55e; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 5, 8, .76);
  backdrop-filter: blur(10px);
}
.modal-backdrop.active { display: flex; }
.modal { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 14px; }
.modal .panel-head h2 { font-size: 14px; }
.modal label { font-size: 11px; }
.modal input,
.modal select,
.modal textarea {
  font-size: 15px;
}
.modal .primary-btn,
.modal .ghost-btn,
.modal .danger-btn {
  font-size: 12px;
}
.modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-actions.align-end { justify-content: flex-end; }
.modal-actions > div { display: flex; gap: 10px; }

.share-modal,
.share-save-modal { width: min(520px, 100%); }
.share-modal .panel-head > div,
.share-save-modal .panel-head > div { display: grid; gap: 4px; }
.share-modal .panel-head span,
.share-save-modal .panel-head span {
  color: var(--muted);
  font-size: 11px;
}
.share-options,
.share-save-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.share-option {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, .025);
  text-align: left;
  cursor: pointer;
  transition: .18s ease;
}
.share-option:hover,
.share-option:focus-visible {
  border-color: rgba(245, 158, 11, .6);
  background: rgba(245, 158, 11, .08);
  transform: translateY(-1px);
  outline: none;
}
.share-option > i {
  flex: 0 0 auto;
  color: var(--amber);
  font-size: 22px;
}
.share-option span { display: grid; gap: 5px; }
.share-option strong { font-size: 13px; }
.share-option small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.share-option:disabled { cursor: wait; opacity: .7; transform: none; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  max-width: 360px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 158, 11, .38);
  border-radius: 10px;
  background: rgba(15, 18, 24, .96);
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}
.toast.active { opacity: 1; transform: translateY(0); }
.toast.has-action {
  display: grid;
  gap: 10px;
  pointer-events: auto;
}
.toast-message {
  color: #e5edf8;
  font-size: 13px;
  line-height: 1.45;
}
.toast-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast-action {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: #b45309;
  color: white;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.toast-action:hover { background: #d97706; }
.toast-action.secondary {
  border: 1px solid var(--line);
  background: #141a24;
  color: #cbd5e1;
}
.toast-action.secondary:hover {
  border-color: rgba(245, 158, 11, .5);
  background: #0b0f16;
  color: white;
}

@media (max-width: 1180px) {
  .topbar-inner, .war-head { flex-direction: column; align-items: stretch; }
  .quick-main-command-inline { justify-items: start; text-align: left; }
  .header-tools { flex-wrap: wrap; }
  .bench-sidebar {
    top: 92px;
    width: min(390px, calc(100vw - 48px));
  }
  body.bench-sidebar-open .bench-sidebar-toggle {
    transform: translateX(0);
  }
  .view.active, .sector-layout, .group-layout { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .bulwark-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-options,
  .share-save-options { grid-template-columns: 1fr; }
  .shell, .topbar-inner { padding: 16px; }
  .bench-sidebar {
    top: 86px;
    left: 16px;
    right: 16px;
    bottom: 68px;
    width: auto;
  }
  .bench-sidebar-toggle {
    top: 86px;
    left: 16px;
  }
  .bench-filters { grid-template-columns: 1fr; }
  .brand h1 { font-size: 19px; }
  .tabs, .lane-board, .group-grid, .field-grid, .stats, .player-grid { grid-template-columns: 1fr; width: 100%; }
  .tabs, .form-row, .filters, .modal-actions, .modal-actions > div, .war-footer { flex-direction: column; }
  .tab { width: 100%; justify-content: center; }
  .lane-board { display: grid; }
}
