:root {
  --page-bg: #08090c;
  --page-bg-top: #0d0e12;
  --dossier-bg-top: rgba(20,21,26,0.8);
  --dossier-bg-bot: rgba(14,15,19,0.95);
  --dossier-border: rgba(255,255,255,0.08);
  --col-divider: rgba(255,255,255,0.06);
  --text-primary: #e8e8ec;
  --text-secondary: #7a7a85;
  --text-tertiary: #9a9aa5;
  --accent-red: #ff4d4d;
  --accent-orange: #ff8a3d;
  --accent-green: #3aff7d;
  --color-assault: #d94a3a;
  --color-skirmisher: #9b59b6;
  --color-recon: #c4d82e;
  --color-support: #e0a83a;
  --color-controller: #3a9cd9;
  --color-default: #555;
}

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

body {
  background: var(--page-bg);
  background-image: linear-gradient(180deg, var(--page-bg-top) 0%, var(--page-bg) 100%);
  color: var(--text-primary);
  font-family: 'Outfit', system-ui, sans-serif;
  height: 100vh;
  overflow: hidden;
}

/* ── Shell ── */
.shell {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 28px 24px;
  gap: 14px;
  overflow: hidden;
}

/* ── Top Bar ── */
.top-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.title-group {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.title-word {
  font-family: 'Oswald', Impact, sans-serif;
  font-size: 28px;
  letter-spacing: 5px;
  font-weight: 700;
}

.title-sep {
  color: var(--accent-red);
  font-size: 28px;
  font-weight: 700;
}

.title-divider {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.12);
  margin: 0 6px;
  align-self: center;
}

.title-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.support-link {
  color: inherit;
  text-decoration: none;
}

.support-actions {
  justify-self: center;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.kofi-mark {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 11px;
  border: 1px solid rgba(255,255,255,0.74);
  border-radius: 2px 2px 4px 4px;
}

.kofi-mark::before {
  content: "";
  position: absolute;
  right: -5px;
  top: 2px;
  width: 4px;
  height: 5px;
  border: 1px solid rgba(255,255,255,0.74);
  border-left: none;
  border-radius: 0 4px 4px 0;
}

.kofi-mark::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 4px;
  height: 4px;
  background: var(--accent-red);
  transform: rotate(45deg);
}

.support-top-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 2px;
  background: rgba(0,0,0,0.24);
  color: var(--text-tertiary);
  font-family: 'Oswald', Impact, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.support-top-option:hover,
.support-top-option:focus-visible {
  border-color: rgba(255, 138, 61, 0.58);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.support-page-link {
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 150ms ease;
}

.support-page-link:hover,
.support-page-link:focus-visible {
  color: var(--accent-orange);
}

.support-link:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 3px;
}

.top-controls {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-self: end;
}

/* ── Mode Toggle ── */
.mode-toggle {
  display: inline-flex;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--dossier-border);
  border-radius: 3px;
}

.mode-toggle button {
  padding: 8px 18px;
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  transition: color 150ms, background 150ms;
}

.mode-toggle button.active {
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  color: #fff;
}

/* ── Reroll Squad Button ── */
.reroll-squad-btn {
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  letter-spacing: 2px;
  font-weight: 700;
  padding: 10px 28px;
  border: none;
  border-radius: 2px;
  box-shadow: 0 6px 24px rgba(255,77,77,0.3);
  cursor: pointer;
  transition: transform 120ms, filter 120ms;
}

.reroll-squad-btn:hover { transform: scale(1.03); filter: brightness(1.1); }
.reroll-squad-btn:active { transform: scale(0.97); }

/* ── Dossier Card ── */
.dossier {
  flex: 1;
  background: linear-gradient(180deg, var(--dossier-bg-top), var(--dossier-bg-bot));
  border: 1px solid var(--dossier-border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── Chord ── */
.chord {
  height: 4px;
  flex-shrink: 0;
}

/* ── Dossier Columns ── */
.dossier-columns {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow-y: auto;
}

/* ── Player Column ── */
.player-col {
  flex: 1;
  min-width: 0;
  padding: 20px 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow-y: auto;
}

.player-col:not(:last-child) {
  border-right: 1px solid var(--col-divider);
}

/* ── Ambient Glow ── */
.ambient-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 240px;
  pointer-events: none;
}

/* ── Column Header ── */
.col-header {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.op-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.player-name-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--dossier-border);
  border-radius: 2px;
  outline: none;
  min-width: 40px;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-name-badge:empty::before {
  content: attr(data-placeholder);
  color: rgba(255,255,255,0.2);
  pointer-events: none;
}

.player-name-badge:focus {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
}

.gear-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background 120ms;
}

.gear-btn:hover {
  background: rgba(255,255,255,0.06);
}

.col-spacer { flex: 1; }

.reroll-btn {
  background: transparent;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: background 120ms;
}

.reroll-btn:hover {
  background: rgba(255,255,255,0.04);
}

.reroll-btn .reroll-icon { font-size: 13px; }

/* ── Legend Section ── */
.legend-section {
  display: flex;
  gap: 22px;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.legend-portrait {
  width: 170px;
  height: 200px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.legend-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.legend-portrait .legend-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-size: 48px;
  font-weight: 700;
  color: rgba(255,255,255,0.2);
}

.legend-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.legend-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 3px;
  font-weight: 500;
  margin-bottom: 8px;
}

.legend-name-text {
  font-family: 'Oswald', Impact, sans-serif;
  font-size: 64px;
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: 0;
  text-transform: uppercase;
  word-break: break-word;
}

.legend-sub {
  margin-top: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 2px;
}

/* ── Weapon Cards ── */
.weapons-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
  position: relative;
  z-index: 1;
}

.weapon-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--col-divider);
  border-radius: 3px;
}

.weapon-img-wrap {
  width: 130px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.weapon-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.weapon-fallback {
  width: 56px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  color: var(--text-tertiary);
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.weapon-info {
  min-width: 170px;
  flex: 0 0 auto;
}

.weapon-kind {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-secondary);
  font-weight: 500;
}

.weapon-name {
  font-family: 'Oswald', sans-serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-top: 3px;
  line-height: 1.1;
}

/* ── Weapon Reroll Button ── */
.weapon-reroll-btn {
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 2px;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 120ms, transform 120ms;
}

.weapon-reroll-btn:hover {
  background: rgba(255,255,255,0.06);
  transform: scale(1.1);
}

.weapon-reroll-btn:active {
  transform: scale(0.95);
}

/* ── Stat Bars ── */
.stat-bars {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 260px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 1.5px;
  font-weight: 500;
  width: 36px;
  flex-shrink: 0;
}

.stat-track {
  flex: 1;
  height: 7px;
  background: rgba(255,255,255,0.06);
  position: relative;
  border-radius: 1px;
}

.stat-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 1px;
  transition: width 220ms ease-out;
}

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 600;
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Status Bar ── */
.status-bar {
  padding: 10px 24px;
  border-top: 1px solid var(--col-divider);
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 2px;
  flex-shrink: 0;
}

.status-bar:empty {
  display: none;
}

.site-footer {
  flex-shrink: 0;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.6px;
  line-height: 1.6;
  text-align: center;
  opacity: 1;
}

.footer-credit {
  color: var(--accent-red);
  text-decoration: none;
  transition: opacity 0.2s;
}

.footer-credit:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* ── Ko-fi Widget ── */
.kofi-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,0.68);
  backdrop-filter: blur(8px);
}

.kofi-overlay.open {
  display: flex;
}

.kofi-panel {
  position: relative;
  width: min(430px, 100%);
  height: min(720px, calc(100vh - 36px));
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 4px;
  background: #101116;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55);
  overflow: hidden;
}

.kofi-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 2px;
  background: rgba(8,9,12,0.88);
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.kofi-close:hover,
.kofi-close:focus-visible {
  border-color: rgba(255, 138, 61, 0.62);
  color: var(--accent-orange);
}

.kofi-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.kofi-fallback {
  position: absolute;
  left: 12px;
  bottom: 10px;
  color: rgba(255,255,255,0.7);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.6px;
  text-decoration: none;
}

.kofi-fallback:hover,
.kofi-fallback:focus-visible {
  color: var(--accent-orange);
}

/* ── Error Message ── */
.error-msg {
  color: var(--accent-red);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-align: center;
  background: rgba(255,77,77,0.08);
  padding: 8px 12px;
  border-radius: 3px;
  border: 1px solid rgba(255,77,77,0.2);
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════
   MIRRORED COLUMN (right player in duo)
   ══════════════════════════════════════ */
.col-mirrored .col-header { flex-direction: row-reverse; }
.col-mirrored .legend-section { flex-direction: row-reverse; }
.col-mirrored .legend-info { text-align: right; }
.col-mirrored .weapon-card { flex-direction: row-reverse; }
.col-mirrored .weapon-info { text-align: right; }
.col-mirrored .stat-row { flex-direction: row-reverse; }
.col-mirrored .stat-label { text-align: right; }
.col-mirrored .stat-value { text-align: left; }
.col-mirrored .stat-fill { left: auto; right: 0; }

/* ══════════════════════════════════════
   SOLO MODE
   ══════════════════════════════════════ */
.dossier--solo .player-col {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 64px;
  gap: 22px;
}

.dossier--solo .ambient-glow { height: 280px; }

.dossier--solo .legend-portrait {
  width: 220px;
  height: 260px;
}

.dossier--solo .legend-section { gap: 28px; }
.dossier--solo .legend-kicker { font-size: 14px; margin-bottom: 10px; }
.dossier--solo .legend-name-text { font-size: 88px; }
.dossier--solo .legend-sub { margin-top: 14px; }

.dossier--solo .weapon-card { gap: 18px; padding: 16px 20px; }
.dossier--solo .weapons-section { gap: 12px; margin-top: 4px; }
.dossier--solo .weapon-img-wrap { width: 150px; height: 70px; }
.dossier--solo .weapon-info { min-width: 200px; }
.dossier--solo .weapon-kind { font-size: 12px; }
.dossier--solo .weapon-name { font-size: 30px; }

/* ══════════════════════════════════════
   DUO MODE
   ══════════════════════════════════════ */
.dossier--duo .legend-section {
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.dossier--duo .legend-info {
  align-items: center;
  text-align: center;
}

.dossier--duo .legend-sub { display: none; }

.dossier--duo .weapon-card {
  flex-direction: column;
  gap: 12px;
  padding: 14px 18px;
}

.dossier--duo .weapon-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dossier--duo .weapon-info { min-width: 0; flex: 1; }
.dossier--duo .weapon-card .weapon-spacer { display: none; }

.dossier--duo .stat-bars { min-width: 0; width: 100%; }

/* ══════════════════════════════════════
   TRIO MODE
   ══════════════════════════════════════ */
.dossier--trio .player-col {
  padding: 20px 22px 22px;
}

.dossier--trio .ambient-glow { height: 200px; }

.dossier--trio .op-label { font-size: 10px; }

.dossier--trio .player-name-badge {
  font-size: 14px;
  padding: 3px 10px;
  max-width: 110px;
}

.dossier--trio .col-header { gap: 8px; }

.dossier--trio .reroll-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 13px;
  justify-content: center;
  border-radius: 2px;
}

.dossier--trio .reroll-btn .reroll-text { display: none; }

.dossier--trio .legend-section {
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dossier--trio .legend-portrait {
  width: 140px;
  height: 170px;
}

.dossier--trio .legend-info {
  margin-top: 0;
  align-items: center;
  text-align: center;
}

.dossier--trio .legend-kicker {
  font-size: 11px;
  margin-bottom: 2px;
}

.dossier--trio .legend-name-text {
  font-size: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dossier--trio .legend-sub { display: none; }

.dossier--trio .weapon-card {
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
}

.dossier--trio .weapon-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dossier--trio .weapon-img-wrap {
  width: 140px;
  height: 60px;
}

.dossier--trio .weapon-info { min-width: 0; flex: 1; }
.dossier--trio .weapon-kind { font-size: 11px; }
.dossier--trio .weapon-name {
  font-size: 26px;
  margin-top: 2px;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dossier--trio .stat-bars { min-width: 0; width: 100%; gap: 8px; }
.dossier--trio .stat-row { gap: 10px; }
.dossier--trio .stat-label { font-size: 12px; width: 36px; }
.dossier--trio .stat-track { height: 7px; }
.dossier--trio .stat-value { font-size: 12px; width: 28px; }
.dossier--trio .weapons-section { gap: 12px; }

.dossier--trio .weapon-card .weapon-spacer { display: none; }
.dossier--trio .weapon-reroll-btn {
  width: 26px;
  height: 26px;
  font-size: 14px;
}

/* ══════════════════════════════════════
   SETTINGS OVERLAY / DRAWER
   ══════════════════════════════════════ */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

.settings-overlay.open { display: flex; }

.settings-drawer {
  width: 640px;
  max-width: 95vw;
  max-height: 90vh;
  background: linear-gradient(180deg, rgba(22,23,28,0.98), rgba(14,15,19,0.99));
  border: 1px solid var(--dossier-border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--col-divider);
  flex-shrink: 0;
}

.drawer-title {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
}

.drawer-close {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--dossier-border);
  border-radius: 2px;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms;
}

.drawer-close:hover {
  background: rgba(255,77,77,0.15);
  color: var(--accent-red);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 28px;
}

.drawer-section {
  margin-bottom: 24px;
}

.drawer-section:last-child { margin-bottom: 0; }

.drawer-section-title {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.drawer-actions button {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-primary);
  padding: 5px 14px;
  border-radius: 3px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 500;
  transition: background 120ms;
}

.drawer-actions button:hover {
  background: rgba(255,255,255,0.08);
}

.drawer-actions .sort-select {
  margin-left: auto;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  color: var(--text-tertiary);
  padding: 5px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  cursor: pointer;
  outline: none;
}

.drawer-actions .sort-select option {
  background: #14141a;
  color: var(--text-primary);
}

.drawer-reset-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin-bottom: 20px;
  background: rgba(255,77,77,0.08);
  border: 1px solid rgba(255,77,77,0.25);
  border-radius: 4px;
  color: var(--accent-red);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}

.drawer-reset-btn:hover {
  background: rgba(255,77,77,0.15);
  border-color: rgba(255,77,77,0.4);
}

/* ── Settings Tile Grid ── */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.setting-tile {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 120ms, border-color 120ms, opacity 120ms;
  user-select: none;
}

.setting-tile.disabled {
  opacity: 0.25;
  filter: grayscale(100%);
}

.setting-tile.disabled .tile-name {
  text-decoration: line-through;
}

.setting-tile.enabled:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.15);
}

.tile-img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.tile-fallback {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  flex-shrink: 0;
}

.tile-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tile-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* ── Color Classes ── */
.bg-assault { background-color: var(--color-assault); color: white; }
.bg-skirmisher { background-color: var(--color-skirmisher); color: white; }
.bg-recon { background-color: var(--color-recon); color: white; }
.bg-support { background-color: var(--color-support); color: white; }
.bg-controller { background-color: var(--color-controller); color: white; }
.bg-default { background-color: var(--color-default); color: white; }

.tag-assault { color: var(--color-assault); }
.tag-skirmisher { color: var(--color-skirmisher); }
.tag-recon { color: var(--color-recon); }
.tag-support { color: var(--color-support); }
.tag-controller { color: var(--color-controller); }
.tag-default { color: var(--text-secondary); }

/* ══════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════ */
.is-revealing .legend-name-text {
  animation: fadeIn 150ms ease-out both;
}

.is-revealing .stat-fill {
  animation: fillBar 220ms ease-out both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fillBar {
  from { width: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .shell { padding: 12px 14px 16px; }
  .top-bar {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
  }
  .title-group { flex-wrap: wrap; justify-content: center; }
  .top-controls {
    justify-self: center;
    flex-wrap: wrap;
    justify-content: center;
  }
  .dossier-columns { flex-direction: column; overflow-y: auto; }
  .player-col:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid var(--col-divider);
  }
  .dossier--solo .player-col { padding: 20px 24px; }
}
