@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-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;
}

.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;
}

.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;
}
