@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
  --bg: #0b1020;
  --panel: #0f172a;
  --surface: #111827;
  --line: #1f2937;
  --glow: #7dd3fc;
  --glow-strong: #38bdf8;
  --text: #e5e7eb;
  --muted: #94a3b8;
}

.matchup-card {
  margin-bottom: 1.25rem;
}

.matchup-table .matchup-gap {
  border: none;
  width: 24px;
}

.matchup-table td.matchup-gap,
.matchup-table th.matchup-gap {
  background: transparent;
  padding: 0;
}

.matchup-header {
  align-items: center;
  gap: 0.6rem;
}

.matchup-emblem {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #facc15;
  background: radial-gradient(circle at 35% 30%, rgba(250, 204, 21, 0.28), rgba(15, 23, 42, 0.92));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fef08a;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.28);
}

.matchup-moves {
  display: inline-flex;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.matchup-move {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  border-radius: 6px;
  width: 26px;
  height: 24px;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  padding: 0;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.matchup-move:hover {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.08);
}

.matchup-table th.matchup-move-col,
.matchup-table td.matchup-move-col {
  width: 58px;
  min-width: 58px;
  padding: 0.45rem 12px 0.45rem 6px;
  border: 0;
  background: transparent;
  text-align: center;
  vertical-align: middle;
}

.matchup-move-wrap {
  display: inline-block;
  white-space: nowrap;
  vertical-align: middle;
}

.matchup-move-wrap .matchup-move {
  display: inline-block;
  vertical-align: middle;
}

.matchup-move-wrap .matchup-move + .matchup-move {
  margin-left: 2px;
}

.matchup-table tbody tr.is-move-hover td.matchup-move-col,
.matchup-table tbody tr.is-move-hover td.matchup-position,
.matchup-table tbody tr.is-move-hover td.matchup-player,
.matchup-table tbody tr.is-move-hover td.matchup-rating,
.matchup-table tbody tr.is-move-hover td.matchup-player-th {
  background: #16213a;
}

.matchup-table tbody tr.matchup-left-row td.matchup-position .matchup-pos-number,
.matchup-table tbody tr.matchup-left-row td.matchup-player .player-name,
.matchup-table tbody tr.matchup-left-row td.matchup-player .muted.tag,
.matchup-table tbody tr.matchup-left-row td.matchup-rating,
.matchup-table tbody tr.matchup-left-row td.matchup-player-th {
  color: #fca5a5;
}

.matchup-player.has-left-icon .player-name {
  position: relative;
  padding-right: 24px;
}

/* Attack attendance dots */
.player-name-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.player-name-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
}

.player-report-link {
  display: inline-block;
  position: relative;
  width: 18px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(125, 211, 252, 0.52);
  background: linear-gradient(150deg, rgba(224, 242, 254, 0.22), rgba(14, 116, 144, 0.2));
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.player-report-link::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 9px;
  height: 1px;
  background: #dbeafe;
  box-shadow: 0 3px 0 #dbeafe, 0 6px 0 #dbeafe;
}

.player-report-link::after {
  content: '';
  position: absolute;
  top: -1px;
  right: -1px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-top: 6px solid rgba(224, 242, 254, 0.85);
}

.player-report-link:hover {
  background: linear-gradient(150deg, rgba(224, 242, 254, 0.32), rgba(56, 189, 248, 0.28));
  border-color: rgba(125, 211, 252, 0.7);
  transform: translateY(-1px);
}

.player-report-link:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.9);
  outline-offset: 1px;
}

.player-tag {
  font-size: 0.82rem;
  color: var(--muted);
}

.player-attendance {
  display: flex;
  flex-direction: column;
  gap: 4px;
}


.attack-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.attack-label {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: #94a3b8;
  min-width: 26px;
  text-transform: uppercase;
}

.attack-streak {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.ranking-attack-streak {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}

.attack-star-block {
  width: 2px;
  height: 2px;
  border-radius: 0.5px;
  border: 0.5px solid rgba(148, 163, 184, 0.3);
  background: #bfc7d6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.attack-star-block.is-three {
  border-color: rgba(250, 204, 21, 0.72);
  background: linear-gradient(140deg, #fde68a, #facc15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 3px rgba(250, 204, 21, 0.26);
}

.attack-star-block.is-other {
  border-color: rgba(239, 68, 68, 0.45);
  background: linear-gradient(140deg, #fee2e2, #ef4444);
}

.attack-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 2px;
  border-radius: 5px;
  border: 1px solid #1f2937;
  background: rgba(255, 255, 255, 0.02);
}

.attack-group.compact {
  gap: 1.5px;
  padding: 1px 2px;
  border-radius: 4px;
}

.attack-dot {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: #1f2937;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.attack-dot-done {
  background: #22c55e;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.attack-dot-miss {
  background: #ef4444;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.attack-dot-bench {
  background: #6b7280;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.cwl-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cwl-season {
  display: flex;
  align-items: center;
  gap: 0px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.cwl-dots {
  display: inline-flex;
  gap: 2px;
  padding: 1px 2px;
  border-radius: 4px;
  border: 1px solid #1f2937;
  background: rgba(255, 255, 255, 0.02);
}

.left-icon {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-block;
  width: 20px;
  height: 20px;
  background: no-repeat center / contain url('/static/exit-icon.svg');
}

.matchup-table th,
.matchup-table td {
  vertical-align: middle;
}

.matchup-sort {
  cursor: pointer;
  user-select: none;
}

.cwl-rounds {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cwl-round-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(255, 255, 255, 0.02);
}

.cwl-round-label {
  font-weight: 700;
  color: #e5e7eb;
}

.cwl-round-opponent {
  color: #e2e8f0;
}

.cwl-round-score,
.cwl-round-destr {
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}

body {
  font-family: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.08), transparent 30%), radial-gradient(circle at 80% 0%, rgba(250, 204, 21, 0.07), transparent 32%), var(--bg);
  color: var(--text);
}

.page-shell {
  width: min(1120px, calc(100% - 2.75rem));
  margin: 0 auto;
}

.clan-hero {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.scout-entry-card,
.scout-search-card,
.scout-player-card,
.scout-summary-card,
.scout-list-card,
.scout-opponents-card {
  margin-bottom: 1rem;
}

.scout-entry-header,
.scout-report-header {
  margin-bottom: 0.6rem;
}

.scout-search-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.scout-history-wrap {
  margin-top: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.scout-history-title {
  color: #93c5fd;
  font-weight: 700;
  font-size: 0.85rem;
}

.scout-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.scout-history-chip {
  display: inline-flex;
  flex-direction: column;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  line-height: 1.15;
}

.scout-history-chip:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.12);
}

.scout-history-name {
  color: #f8fafc;
  font-size: 0.84rem;
  font-weight: 700;
}

.scout-history-tag {
  color: #94a3b8;
  font-size: 0.76rem;
}

.scout-input-label {
  font-weight: 700;
  color: #dbeafe;
}

.scout-search-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.scout-input {
  flex: 1;
  min-width: 220px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.95);
  color: #e2e8f0;
  padding: 0.7rem 0.85rem;
  font: inherit;
}

.scout-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.scout-error {
  margin-top: 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.5);
  background: rgba(127, 29, 29, 0.26);
  color: #fecaca;
  padding: 0.65rem 0.8rem;
}

.scout-error.small {
  margin-top: 0;
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
}

.scout-player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}

.scout-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.6);
  background: rgba(14, 116, 144, 0.22);
  color: #bae6fd;
  font-weight: 700;
}

.scout-stat-grid,
.scout-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.55rem;
}

.scout-legend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 0.55rem;
  max-width: 580px;
}

.scout-legend-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(14, 116, 144, 0.2), rgba(30, 64, 175, 0.16));
  padding: 0.55rem 0.8rem;
}

.legend-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
}

.legend-label {
  color: #bfdbfe;
  font-size: 0.82rem;
}

.legend-value {
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 800;
}

.legend-sep {
  color: #93c5fd;
  opacity: 0.85;
}

.stars-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.scout-summary-wide {
  grid-column: 1 / -1;
}

.scout-stat,
.scout-summary-item {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.6rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.scout-stat-label,
.scout-summary-label {
  color: #94a3b8;
  font-size: 0.8rem;
}

.scout-stat-value,
.scout-summary-value {
  font-weight: 700;
  color: #f8fafc;
}

.scout-lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}

.scout-inline-list {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.scout-inline-list.compact {
  margin-top: 0.35rem;
}

.scout-inline-list.stack-list {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
}

.scout-inline-list.stack-list .result-pill {
  border-radius: 10px;
  justify-content: space-between;
}

.result-card {
  border-radius: 10px;
  background: linear-gradient(140deg, #ffffff, #b9c7dd);
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  box-shadow: 0 3px 10px rgba(100, 110, 140, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  color: #1f2937;
}

.result-card.is-attack,
.result-card.is-defense {
  color: #1f2937;
}

.result-main {
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.result-name {
  font-weight: 700;
  color: inherit;
}

.result-name-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
  flex-wrap: wrap;
}

.result-score {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
  white-space: nowrap;
}

.result-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
}

.result-pct {
  color: #111111;
  font-size: 0.86rem;
  line-height: 1;
}

.result-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.result-link .result-card {
  transition: transform 120ms ease, box-shadow 140ms ease;
}

.result-link:hover .result-card {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(30, 64, 175, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.result-link:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
  border-radius: 12px;
}

.result-base-mark {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.result-base-mark.is-excellent {
  background: #14532d;
  color: #bbf7d0;
  border-color: #22c55e;
}

.result-base-mark.is-good {
  background: #064e3b;
  color: #a7f3d0;
  border-color: #10b981;
}

.result-meta {
  font-size: 0.88rem;
  color: #374151;
}

.result-card.is-three-attack {
  background: linear-gradient(140deg, #FEF3C7, #FCD34D);
  border-color: #FBBF24;
  box-shadow: 0 3px 10px rgba(180, 100, 20, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.result-card.is-three-defense {
  background: linear-gradient(140deg, #FEE2E2, #FECACA);
  border-color: #F87171;
  box-shadow: 0 3px 10px rgba(220, 80, 80, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.result-card.is-three-attack .result-main {
  color: #92400E;
}

.result-card.is-three-attack .result-meta {
  color: #B45309;
}

.result-card.is-three-defense .result-main {
  color: #991B1B;
}

.result-card.is-three-defense .result-meta {
  color: #B91C1C;
}

.result-star.is-on {
  color: #facc15;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45), 0 0 2px rgba(0, 0, 0, 0.35);
}

.result-star.is-off {
  color: #111111;
}

.result-submeta {
  font-size: 0.8rem;
}

.result-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: #e2e8f0;
  padding: 0.28rem 0.56rem;
  font-size: 0.84rem;
}

.scout-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.scout-result-list li {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.45rem 0.58rem;
}

.scout-result-list.compact li {
  font-size: 0.93rem;
  padding: 0.4rem 0.5rem;
}

.scout-opponent-row {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.64);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.scout-opponent-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.scout-opponent-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
}

.scout-opponent-our-result {
  margin-top: 0.25rem;
  font-size: 0.84rem;
  color: #cbd5e1;
}

.scout-mini-summary {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.scout-mini-summary span {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 0.8rem;
  padding: 0.25rem 0.55rem;
}

.scout-assessment {
  min-width: min(100%, 320px);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.1), rgba(203, 213, 225, 0.16));
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.assessment-badge {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.assessment-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  font-size: 0.82rem;
  color: #e2e8f0;
}

.assessment-metrics strong {
  color: #f8fafc;
}

.scout-assessment.is-excellent {
  border-color: rgba(34, 197, 94, 0.72);
  background: linear-gradient(140deg, rgba(220, 252, 231, 0.35), rgba(134, 239, 172, 0.3));
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.scout-assessment.is-excellent .assessment-badge {
  background: #14532d;
  border-color: #22c55e;
  color: #bbf7d0;
}

.scout-assessment.is-good {
  border-color: rgba(16, 185, 129, 0.64);
  background: linear-gradient(140deg, rgba(209, 250, 229, 0.32), rgba(110, 231, 183, 0.26));
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.scout-assessment.is-good .assessment-badge {
  background: #064e3b;
  border-color: #10b981;
  color: #a7f3d0;
}

.scout-assessment.is-medium {
  border-color: rgba(245, 158, 11, 0.62);
  background: linear-gradient(140deg, rgba(254, 243, 199, 0.34), rgba(252, 211, 77, 0.26));
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.scout-assessment.is-medium .assessment-badge {
  background: #78350f;
  border-color: #f59e0b;
  color: #fde68a;
}

.scout-assessment.is-bad {
  border-color: rgba(248, 113, 113, 0.68);
  background: linear-gradient(140deg, rgba(254, 226, 226, 0.34), rgba(252, 165, 165, 0.28));
  box-shadow: 0 10px 20px rgba(239, 68, 68, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.scout-assessment.is-bad .assessment-badge {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fecaca;
}

.scout-assessment.is-unknown {
  border-color: rgba(148, 163, 184, 0.45);
  background: linear-gradient(140deg, rgba(226, 232, 240, 0.18), rgba(148, 163, 184, 0.15));
}

.scout-assessment.is-unknown .assessment-badge {
  background: #334155;
  border-color: #64748b;
  color: #cbd5e1;
}

.scout-opponent-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.scout-opponent-body.single-column {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.scout-opponent-body h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #e2e8f0;
}

.defense-anchor-target {
  scroll-margin-top: 92px;
}

.defense-tiles {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.45rem;
}

.defense-tile {
  min-height: 62px;
  border-radius: 10px;
  border: none;
  padding: 0.38rem 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  text-align: center;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.defense-tile .tile-stars {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 0.84rem;
  font-weight: 700;
}

.tile-star.is-on {
  color: #facc15;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45), 0 0 2px rgba(0, 0, 0, 0.35);
}

.tile-star.is-off {
  color: #111111;
}

.defense-tile .tile-pct {
  font-size: 0.8rem;
  color: #111827;
  font-weight: 700;
}

.defense-tile.is-max {
  background: linear-gradient(140deg, #fee2e2, #fca5a5);
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.defense-tile.is-two {
  background: linear-gradient(140deg, #ffffff, #b9c7dd);
  box-shadow: 0 3px 10px rgba(100, 110, 140, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.defense-tile.is-two .tile-star.is-on {
  color: #facc15;
  text-shadow: 0 1px 0 rgba(17, 24, 39, 0.45), 0 0 2px rgba(0, 0, 0, 0.35);
}

.defense-tile.is-low {
  background: linear-gradient(140deg, #dcfce7, #86efac);
  box-shadow: 0 3px 10px rgba(34, 197, 94, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

@media (max-width: 700px) {
  .scout-search-row {
    flex-direction: column;
  }

  .scout-search-row .btn {
    width: 100%;
  }

  .scout-legend-grid {
    grid-template-columns: 1fr;
  }

  .scout-legend-inline {
    width: 100%;
    justify-content: space-between;
  }

  .stars-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .defense-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 701px) and (max-width: 980px) {
  .defense-tiles {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.clan-badge img,
.clan-badge .badge-fallback {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid #1f2937;
  background: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #cbd5e1;
  letter-spacing: 0.06em;
}

.clan-title {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.clan-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #f8fafc;
}

.clan-tag {
  font-size: 0.95rem;
  color: #94a3b8;
}

.players-header {
  margin: 1.75rem 0 0.4rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.clans-header {
  margin: 0 0 1rem;
}

.players-emblem {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid #facc15;
  background: radial-gradient(circle at 30% 30%, rgba(250, 204, 21, 0.25), rgba(15, 23, 42, 0.95));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fef08a;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.35);
}

.players-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.players-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #f8fafc;
}

.players-sub {
  color: #cbd5e1;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.players-line {
  height: 1px;
  background: linear-gradient(90deg, rgba(250, 204, 21, 0), rgba(250, 204, 21, 0.5), rgba(250, 204, 21, 0));
}

.clan-name-row,
.clan-crest,
.clan-title-accent,
.clan-sub {
  display: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(120deg, rgba(15, 23, 42, 0.92) 0%, rgba(11, 17, 36, 0.95) 40%, rgba(15, 23, 42, 0.9) 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
}

.header-title {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

header h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: #f8fafc;
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 252, 0.4);
  background: radial-gradient(circle at 30% 20%, rgba(125, 211, 252, 0.22), rgba(15, 23, 42, 0.98));
  color: transparent; /* hide literal arrow, use pseudo for single icon */
  text-decoration: none;
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.18);
  transition: transform 120ms ease, box-shadow 140ms ease, border-color 140ms ease, color 140ms ease;
  position: relative;
}

.back-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  background-color: #a7afcc;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M14.5 6.5 9 12l5.5 5.5' stroke='currentColor' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M14.5 6.5 9 12l5.5 5.5' stroke='currentColor' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

.back-button:hover {
  border-color: var(--glow-strong);
  color: transparent;
  box-shadow: 0 10px 28px rgba(56, 189, 248, 0.28);
  transform: translateY(-1px);
}

.back-button:hover::before {
  background-color: #e9f0ff;
}

main {
  padding: 2rem 0 2.5rem;
}

.page-hero {
  margin-bottom: 1.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: #93c5fd;
  margin: 0 0 0.25rem 0;
}

.lede {
  margin: 0.35rem 0 0;
  color: #cbd5e1;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.overview-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

@media (max-width: 900px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

.panel-card {
  border: 1px solid #1e293b;
  border-radius: 12px;
  background: linear-gradient(135deg, #0b1224 0%, #0f172a 60%, #0b1224 100%);
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.active-war-card {
  border: 1px solid #1e293b;
  border-radius: 14px;
  background: linear-gradient(135deg, #0b1224 0%, #0f172a 55%, #0b1224 100%);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.war-overview-card {
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.25rem 1.35rem;
  border-radius: 14px;
  border: 1px solid #1e293b;
  background: linear-gradient(135deg, #0b1224 0%, #0f172a 55%, #0b1224 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.active-war-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.active-war-body {
  display: grid;
  grid-template-columns: auto 1fr 0.9fr;
  gap: 1rem;
  align-items: center;
}

.active-war-body.has-action {
  grid-template-columns: auto 1fr 0.9fr auto;
}

.war-overview-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(148, 163, 184, 0.4), rgba(255, 255, 255, 0));
  border: 0;
}

.war-overview-card .matchup-card {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.war-overview-card .matchup-card .section-header {
  margin-bottom: 0.35rem;
}

.war-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.war-opp-name {
  font-weight: 800;
  font-size: 1.1rem;
  color: #e2e8f0;
}

.war-opp-tag {
  color: #94a3b8;
  font-size: 0.9rem;
}

.war-score-large {
  text-align: left;
  justify-self: start;
}

.score-line {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 2.2rem;
  font-weight: 800;
}

.score-neutral { color: #e2e8f0; }
.score-divider { color: #94a3b8; }

.score-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: #cbd5e1;
  font-size: 1rem;
}

.war-planner-btn {
  height: 100%;
  min-width: 110px;
  padding: 0.75rem 0.9rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  align-self: center;
}

.war-planner-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.war-planner-label {
  font-size: 0.9rem;
  line-height: 1.1;
}
.war-row,
.cwl-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.war-badge img,
.badge-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #1f2937;
  background: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #cbd5e1;
}

.war-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.war-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
}

.war-name {
  font-weight: 700;
  color: #e2e8f0;
}

.war-score {
  color: #cbd5e1;
  font-size: 0.95rem;
}

.war-score .divider {
  margin: 0 0.35rem;
  opacity: 0.7;
}

.cwl-meta {
  flex: 1;
}

.cwl-season {
}

.cwl-season .attack-label {
  font-weight: 700;
  color: #b7b7b8;
  font-size: 0.55em;
  vertical-align: bottom;
}


.cwl-stats {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.95rem;
  color: #cbd5e1;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pill-win { background: rgba(22, 163, 74, 0.15); border-color: rgba(22, 163, 74, 0.45); color: #22c55e; }
.pill-loss { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.45); color: #f87171; }
.pill-draw { background: rgba(234, 179, 8, 0.15); border-color: rgba(234, 179, 8, 0.45); color: #fbbf24; }
.pill-ongoing { background: rgba(37, 99, 235, 0.15); border-color: rgba(37, 99, 235, 0.45); color: #93c5fd; }
.pill-finished { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.45); color: #86efac; }

.mini-table th.score-col,
.mini-table th.th-col,
.mini-table td.score-col,
.mini-table td.th-col {
  text-align: center;
}

.mini-table th.th-col,
.mini-table td.th-col {
  border-left: 0;
}


.clan-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem;
  border: 1px solid #1e293b;
  border-radius: 14px;
  background: linear-gradient(150deg, #0b1224 0%, #0f172a 60%, #0b1224 100%);
  text-decoration: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  transition: transform 140ms ease, box-shadow 180ms ease, border-color 160ms ease;
}

.clan-card:hover {
  transform: translateY(-2px);
  border-color: rgba(125, 211, 252, 0.45);
  box-shadow: 0 16px 38px rgba(56, 189, 248, 0.18);
}

.card-hero {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.card-badge img,
.card-badge .badge-fallback {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid #1f2937;
  background: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #cbd5e1;
  letter-spacing: 0.05em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.card-title-block h3 {
  margin: 0;
  font-size: 1.12rem;
  color: #e2e8f0;
  letter-spacing: -0.01em;
}

.card-title-block .card-tag {
  margin-top: 0.15rem;
  font-size: 0.95rem;
}

.card-meta {
  margin-top: 0.85rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #1f2a44;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(11, 17, 36, 0.95));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.meta-count {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
  color: #cbd5e1;
}

.meta-count-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.meta-count-sub {
  font-size: 0.95rem;
}

.meta-count-value {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #e2e8f0;
  min-width: 52px;
  text-align: right;
}

.card-actions {
  margin-top: 0.65rem;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  background: rgba(37, 99, 235, 0.08);
  color: #dbeafe;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.18);
}

.th-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.clan-card:hover {
  transform: translateY(-2px);
  border-color: #2563eb;
  box-shadow: 0 15px 35px rgba(37, 99, 235, 0.25);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  color: #bfdbfe;
  border: 1px solid rgba(59, 130, 246, 0.35);
  font-weight: 600;
  font-size: 0.85rem;
}

.chevron {
  font-weight: 700;
  color: #93c5fd;
}

.card-body h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #e2e8f0;
}

.card-body p {
  margin: 0.35rem 0 0;
  color: #94a3b8;
  font-size: 0.95rem;
}

.muted {
  color: #9ca3af;
}

.btn {
  background: #1f2937;
  color: #e5e7eb;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

.btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #f8fafc;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  border: 1px solid #334155;
  color: #e5e7eb;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  cursor: pointer;
  font-size: 1rem;
}

.lineup-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lineup-section .actions-col {
  width: 140px;
  text-align: center;
}

.lineup-section .row-muted {
  opacity: 0.55;
}
.lineup-section #lineup-table tbody tr:hover td {
  background: #16213a;
}

.lineup-section:not(.is-editing) .actions-col {
  display: none;
}

.lineup-toggle {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e5e7eb;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  margin-right: 0.35rem;
}

.lineup-toggle.is-selected {
  background: #2563eb;
  border-color: #2563eb;
  color: #f8fafc;
}

.lineup-toggle.is-deselected {
  background: transparent;
}

.lineup-toggle:hover {
  border-color: #93c5fd;
}

.lineup-empty-row td {
  padding: 0.9rem;
  text-align: center;
  color: #cbd5e1;
  background: #0f172a;
  border: 1px dashed #334155;
  font-style: italic;
}

.empty-message {
  opacity: 0.9;
}

.mini-table td.actions-col,
.mini-table th.actions-col {
  text-align: center;
}

.lineup-separator td {
  background: #111827;
  color: #9ca3af;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.5rem;
  border-top: 1px solid #1f2937;
  border-bottom: 1px solid #1f2937;
}
.lineup-empty {
  margin-top: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed #334155;
  border-radius: 8px;
  background: #0b1224;
  color: #9ca3af;
  font-style: italic;
}

.th-rankings {
  margin-top: 2rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.th-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.th-card {
  border: 1px solid #1e293b;
  border-radius: 12px;
  background: #0b1224;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.th-card-header {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  background: #0b1224;
}

.mini-table th,
.mini-table td {
  padding: 0.45rem 0.6rem;
  border: 1px solid #1f2937;
  font-size: 0.9rem;
}

.mini-table th {
  background: #0f172a;
  text-align: left;
}

.mini-table td {
  background: #0b1224;
}

.mini-table .rank-col,
.mini-table .score-col {
  text-align: center;
  white-space: nowrap;
}

.mini-table .player-name {
  font-weight: 600;
}

.mini-table .tag {
  font-size: 0.8rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 1rem;
  background: #020617;
}

th, td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #1e293b;
}

th {
  background: #0f172a;
}

#th-table th:nth-child(3),
#th-table td:nth-child(3),
#th-table th:nth-child(4),
#th-table td:nth-child(4) {
  text-align: center;
}

.th-cell {
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: center;
}

.th-cell.th-empty {
  background: #020617;
  color: #4b5563;
}

.th-metric {
  white-space: nowrap;
}

.th-cell-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
}

.th-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.th-row-strength {
  justify-content: center;
}

.th-metric-label {
  font-weight: 600;
}

.sort-indicator {
  margin-left: 0.2rem;
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Score buckets for TH cells */
.score-empty { background-color: #0f172a; }
.score-1 { background-color: #0a5325; }
.score-2 { background-color: #638100; }
.score-3 { background-color: #616510; }
.score-4 { background-color: #c5a71e; }
.score-5 { background-color: #df7225; }
.score-6 { background-color: #610707; }

a {
  color: #bfdbfe;
}

a:hover {
  color: #eff6ff;
}
