﻿/* ==========================================================================
   WinterTime Â· Clan Command Center
   Premium dark gaming design system
   Tokens â†’ base â†’ layout â†’ sections â†’ components â†’ responsive
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Surfaces */
  --bg: #0B0F14;
  --bg-2: #121D1A;
  --surface: #16201D;
  --surface-2: #1A2522;
  --surface-3: #202C28;
  --surface-inset: #0E1512;

  /* Text */
  --text: #F5F6F7;
  --text-2: #A1AAA5;
  --text-3: #8B958F;

  /* Accent */
  --accent: #62DE56;
  --accent-strong: #7BEE6E;
  --accent-dim: #3FA82F;
  --accent-soft: rgba(98, 222, 86, 0.10);
  --accent-soft-2: rgba(98, 222, 86, 0.06);
  --accent-line: rgba(98, 222, 86, 0.30);

  /* Status (semantic only) */
  --danger: #E5484D;
  --danger-soft: rgba(229, 72, 77, 0.12);
  --danger-line: rgba(229, 72, 77, 0.30);
  --warn: #E8B341;
  --warn-soft: rgba(232, 179, 65, 0.12);
  --warn-line: rgba(232, 179, 65, 0.28);
  --neutral-soft: rgba(255, 255, 255, 0.05);

  /* Lines */
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.11);
  --border-3: rgba(255, 255, 255, 0.16);

  /* Radius */
  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Spacing (8px rhythm) */
  --s-1: 8px;
  --s-2: 16px;
  --s-3: 24px;
  --s-4: 32px;
  --s-5: 40px;
  --s-6: 48px;
  --s-7: 64px;
  --s-8: 80px;
  --s-9: 96px;

  /* Type */
  --font: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --max: 1320px;
  --gutter: 32px;
  --header-h: 72px;

  /* Effects */
  --shadow-card: 0 24px 48px -32px rgba(0, 0, 0, 0.9);
  --shadow-pop: 0 32px 64px -40px rgba(0, 0, 0, 0.95);
  --ring: 0 0 0 3px rgba(98, 222, 86, 0.22);
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.15;
  color: var(--text);
}

p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

strong { font-weight: 600; color: var(--text); }
em { font-style: normal; color: var(--text); }

::selection {
  background: rgba(98, 222, 86, 0.28);
  color: var(--text);
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-xs);
}

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: #2A3632 transparent; }
*::-webkit-scrollbar { height: 10px; width: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #2A3632;
  border-radius: var(--r-pill);
  border: 2px solid var(--bg);
}
*::-webkit-scrollbar-thumb:hover { background: #3A4A44; }

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

.skip-link {
  position: absolute;
  left: 50%;
  top: -60px;
  transform: translateX(-50%);
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: #08120A;
  font-weight: 700;
  font-size: 13px;
  transition: top 0.18s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- 3. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 20, 0.82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
}

.brand-text { display: flex; flex-direction: column; gap: 1px; }

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.1;
}

.brand-sub {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  line-height: 1.2;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.site-nav a {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.16s ease, background 0.16s ease;
}
.site-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #cbd0d7;
  cursor: pointer;
  transition: color .2s ease, opacity .2s ease;
}
.mobile-nav-toggle:focus-visible,
.site-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 290;
  background: rgba(0, 0, 0, .72);
}
.mobile-nav-backdrop[hidden] { display: none !important; }
.mobile-side-panel { display: none; }
body.mobile-menu-open { overflow-y: hidden; }

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  max-width: 360px;
}

.header-status #auto-sync-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot,
.live-dot {
  flex-shrink: 0;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(232, 179, 65, 0.14);
}

/* ---------- 4. Layout ---------- */
.bento-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--s-7);
}

.bento-main > section,
.bento-main > .table-card,
.bento-main > .toolbar-bento,
.bento-main > .kick-output,
.bento-main > .site-footer {
  margin-bottom: var(--s-8);
}

.bento-main > .hero { margin-bottom: var(--s-7); }

/* ---------- 5. Hero ---------- */
.hero {
  position: relative;
  margin-inline: calc(50% - 50vw);
  padding: 0;
  display: flex;
  align-items: flex-end;
  min-height: 620px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  background-image: url("bg-podium.jpg");
  background-size: cover;
  background-position: center 30%;
  opacity: 0.55;
  filter: grayscale(0.82) contrast(1.06) brightness(1.28);
  z-index: -2;
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 90% at 12% 22%, rgba(11, 15, 20, 0.62) 0%, rgba(11, 15, 20, 0.46) 46%, rgba(11, 15, 20, 0.78) 100%),
    linear-gradient(180deg, rgba(11, 15, 20, 0.84) 0%, rgba(18, 29, 26, 0.34) 48%, var(--bg) 100%),
    radial-gradient(60% 60% at 82% 10%, rgba(98, 222, 86, 0.12) 0%, rgba(11, 15, 20, 0) 70%);
}

.hero-inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--s-8) var(--gutter) var(--s-7);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--s-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
}

.eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero-title {
  font-size: clamp(3.4rem, 9.2vw, 7.2rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.9;
  margin-bottom: var(--s-3);
  text-transform: uppercase;
}

.hero-lead {
  max-width: 620px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-2);
  margin-bottom: var(--s-5);
}
.hero-lead strong { color: var(--accent); font-weight: 600; }

.clan-summary { width: 100%; }

.hero-hint {
  font-size: 14px;
  color: var(--text-2);
  padding: var(--s-2) 0;
}

/* Hero stat strip */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: rgba(11, 15, 20, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}

.hero-stats > div {
  padding: 18px 20px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.hero-stats > div:first-child { border-left: none; }

.hero-stats .kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-stats strong {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Stat colour coding (semantic) */
.hero-stats #kpi-members,
.hero-stats #kpi-clan-score { color: var(--text); }
.hero-stats #kpi-good { color: var(--accent); }
.hero-stats #kpi-average { color: #C3CEC8; }
.hero-stats #kpi-warning { color: var(--warn); }
.hero-stats #kpi-kick { color: #F0868A; }
.hero-stats #kpi-unknown { color: var(--text-3); }

.health-bar {
  margin-top: var(--s-3);
  height: 5px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.health-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--accent);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* KPI cards (kept for markup compatibility, hidden by app.js) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-2);
}

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.kpi-card strong {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.kpi-value {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
}

.error-box {
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  border: 1px solid var(--danger-line);
  background: var(--danger-soft);
  color: #F7B9BB;
  font-size: 14px;
}

/* ---------- 6. Info cards (notice / rules) ---------- */
.clan-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: var(--s-3);
  align-items: start;
}

.info-card {
  padding: var(--s-3);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.info-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding-bottom: var(--s-2);
  margin-bottom: var(--s-2);
  border-bottom: 1px solid var(--border);
}

.info-card-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.info-badge {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.info-badge-gold {
  border-color: var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn);
}

.clan-rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clan-rules-list li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}

.clan-rules-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-dim);
}

.clan-rules-list strong { color: var(--text); font-weight: 600; }
.notice-card .clan-rules-list li { color: var(--text); }

/* ---------- 7. Section headings ---------- */
.podium-section { scroll-margin-top: calc(var(--header-h) + 24px); }

.podium-header {
  margin-bottom: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.podium-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.podium-title {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.meta-decks-sub {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.6;
}

/* ---------- 8. Podium cards ---------- */
.podium-stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
  align-items: start;
}

.podium-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: var(--s-3);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-inset) 100%);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.podium-card:hover {
  border-color: var(--border-3);
  transform: translateY(-3px);
}

.podium-1st {
  border-color: var(--accent-line);
  background:
    linear-gradient(180deg, rgba(98, 222, 86, 0.10) 0%, rgba(22, 32, 29, 0.92) 46%, var(--surface-inset) 100%);
  box-shadow: 0 32px 64px -44px rgba(98, 222, 86, 0.45), var(--shadow-card);
  transform: translateY(-14px);
}

.podium-1st:hover { transform: translateY(-17px); }

.podium-rank-crest {
  position: absolute;
  top: 20px;
  right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-2);
  white-space: nowrap;
}

.podium-1st .podium-rank-crest {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.podium-2nd .podium-rank-crest,
.podium-3rd .podium-rank-crest { color: var(--text-2); }

.podium-avatar-wrap {
  position: relative;
  width: 64px; height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.podium-1st .podium-avatar-wrap {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

.podium-crown {
  position: absolute;
  top: -10px;
  right: 6px;
  font-size: 17px;
  line-height: 1;
}

.podium-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  word-break: break-word;
}

.podium-meta {
  font-size: 13px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.podium-fame-Main {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.podium-1st .podium-fame-Main { color: var(--accent); }

.podium-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.podium-metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}

/* ---------- 9. CW2 panels ---------- */
.cw2-panel {
  padding: var(--s-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.cw2-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
}

.cw2-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-2);
  min-width: 0;
}

.cw2-meta > strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.cw2-personal-average {
  font-size: 12px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.member-average {
  font-size: 11px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.cw2-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.cw2-chart-wrap {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-inset);
  padding: var(--s-2);
  margin-bottom: var(--s-3);
  overflow-x: auto;
}

.cw2-chart-wrap .meta-decks-sub { margin-bottom: 10px; }

.cw2-bar { fill: var(--accent); }
.cw2-bar-value { fill: var(--text); }
.cw2-bar-label { fill: var(--text-3); }

.cw2-note {
  padding: 0 0 var(--s-3);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-3);
}

.cw2-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-2);
  margin-bottom: var(--s-3);
}

.cw2-stat-card {
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.cw2-stat-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.cw2-stat-value {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ---------- 10. Tables ---------- */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}

th, td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #131B18;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border-2);
}

/* Wide screens: let the roster header stick to the viewport, not to the
   horizontal scroll wrapper, so column labels stay visible on long lists. */
@media (min-width: 1200px) {
  .table-card .table-scroll {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }
  .table-card .table-scroll thead th {
    top: var(--header-h);
    z-index: 3;
  }
  .table-card .table-scroll thead th::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #131B18;
    z-index: -1;
  }
}

tbody tr:last-child td { border-bottom: none; }

select option {
  background: #131B18;
  color: var(--text);
}

tbody tr { transition: background 0.14s ease; }
tbody tr:hover { background: rgba(255, 255, 255, 0.028); }

.cw2-table { font-size: 13px; }
.cw2-table th,
.cw2-table td {
  padding: 11px 12px;
  text-align: center;
  color: var(--text-2);
}
.cw2-table th:first-child,
.cw2-table td:first-child { text-align: left; }
.cw2-table tbody td strong { color: var(--text); font-weight: 600; }

.member-table { font-size: 14px; }
.member-table th:nth-child(1) { width: 56px; }
.member-table th:nth-child(2) { width: 190px; }
.member-table th:nth-child(3) { width: 100px; }
.member-table th:nth-child(4) { width: 84px; }
.member-table th:nth-child(5) { width: 264px; }
.member-table th:nth-child(6) { width: 112px; }
.member-table th:nth-child(7) { width: 150px; }
.member-table th:nth-child(8) { width: 260px; }
.member-table td { color: var(--text-2); vertical-align: middle; }
.member-table tbody td:first-child {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
}
.member-table tbody td small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-3);
  margin-top: 2px;
  white-space: normal;
  max-width: 240px;
}
.member-table tbody td:last-child { min-width: 250px; }
.member-table tbody td:last-child small { max-width: 240px; }
.member-table tbody td:nth-child(5) small { -webkit-line-clamp: 1; }

.cell-eval {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.member-table tbody td strong { color: var(--text); font-weight: 600; }

.member-row-clickable { cursor: pointer; }
.member-row-active { background: var(--accent-soft-2); }
.member-row-active:hover { background: var(--accent-soft); }
.member-row-active td:first-child { box-shadow: inset 2px 0 0 var(--accent); }

/* Roster card */
.table-card {
  padding: var(--s-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.roster-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: var(--s-3);
}

.roster-title {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.roster-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- 11. Toolbar ---------- */
.toolbar-bento {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  padding: var(--s-2);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.toolbar-field { display: flex; min-width: 0; }
.toolbar-search { flex: 1 1 260px; }
.toolbar-spacer { flex: 1 1 auto; }

.toolbar-bento input[type="search"],
.toolbar-bento input[type="text"],
.toolbar-bento select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.16s ease, background 0.16s ease;
  appearance: none;
  -webkit-appearance: none;
}

.toolbar-bento input::placeholder { color: var(--text-3); }

.toolbar-bento input:hover,
.toolbar-bento select:hover { border-color: var(--border-3); }

.toolbar-bento input:focus,
.toolbar-bento select:focus {
  outline: none;
  border-color: var(--accent-line);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--ring);
}

.toolbar-bento select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A1AAA5' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.toolbar-bento select option {
  background: #131B18;
  color: var(--text);
}

.kick-actions { display: flex; align-items: center; }

/* ---------- 12. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-3);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-2);
  color: var(--text-2);
}
.btn-ghost:hover { color: var(--text); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #08120A;
}
.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn-danger {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: #F0868A;
}
.btn-danger:hover { background: rgba(229, 72, 77, 0.2); }

.btn-sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: var(--r-xs);
}

.btn-kick {
  padding: 6px 12px;
  border-radius: var(--r-xs);
  border: 1px solid var(--danger-line);
  background: var(--danger-soft);
  color: #F0868A;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-kick:hover { background: rgba(229, 72, 77, 0.22); }

/* ---------- 13. Badges, pills, bars ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-good { color: #8CF07F; background: var(--accent-soft); border-color: var(--accent-line); }
.badge-average { color: #C3CEC8; background: rgba(255, 255, 255, 0.05); border-color: var(--border-2); }
.badge-warning { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.badge-kick { color: #F0868A; background: var(--danger-soft); border-color: var(--danger-line); }
.badge-unknown { color: var(--text-3); background: rgba(255, 255, 255, 0.04); border-color: var(--border); }

.badge-active { color: #8CF07F; background: var(--accent-soft); border-color: var(--accent-line); }

.kick-icon { font-size: 11px; }

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}

.tag-mono {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-3);
  white-space: nowrap;
}

.score-bar {
  width: 92px;
  max-width: 100%;
  height: 5px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--accent);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.deck-mini-list {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.deck-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 1px 4px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
}

.deck-full { color: #8CF07F; background: var(--accent-soft); border-color: var(--accent-line); }
.deck-mid { color: #D7DEDA; background: rgba(255, 255, 255, 0.06); border-color: var(--border-2); }
.deck-low { color: var(--text-2); }
.deck-zero { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.deck-unknown {
  color: var(--text-3);
  background: transparent;
  border-style: dashed;
}

/* ---------- 14. Meta decks ---------- */
.meta-decks-section {
  padding: var(--s-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.meta-decks-section:empty { display: none; }

.meta-decks-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
}

.meta-decks-title {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.meta-decks-head .meta-decks-sub { margin-top: 6px; }

.meta-decks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-2);
}

.meta-deck-card {
  padding: 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.meta-deck-card:hover {
  border-color: var(--border-3);
  background: var(--surface-3);
}

.meta-deck-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.meta-deck-name {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

.meta-deck-rank {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

.meta-deck-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: color 0.14s ease, border-color 0.14s ease;
}

a.meta-pill:hover { color: var(--accent); border-color: var(--accent-line); }
a.meta-pill-copy-deck {
  background: rgba(179, 137, 76, 0.12);
  border-color: rgba(211, 169, 108, 0.36);
  color: #DFBC8C;
  font-weight: 600;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
a.meta-pill-copy-deck:hover,
a.meta-pill-copy-deck:focus-visible {
  background: rgba(179, 137, 76, 0.21);
  border-color: rgba(224, 186, 129, 0.65);
  color: #F0D5AE;
}
.meta-pill-win { color: #C3CEC8; }
.meta-pill-elixir { color: var(--text-2); }

.meta-cards-row {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: flex-start;
}

.meta-card-slot {
  flex: 0 0 auto;
  width: 62px;
  height: 83px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-inset);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.meta-card-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 640px) {
  .meta-cards-row { flex-wrap: wrap; }
  .meta-card-slot { width: 52px; height: 69px; }
}

/* ---------- 15. Kick output ---------- */
.kick-output {
  padding: var(--s-3);
  border-radius: var(--r-lg);
  border: 1px solid var(--danger-line);
  background: var(--danger-soft);
  color: #F7C9CA;
  font-size: 14px;
  line-height: 1.7;
}

.kick-output ul {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kick-output li { padding-left: 14px; position: relative; }
.kick-output li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--danger);
}

/* ---------- 16. Marquee ticker ---------- */
.wt-marquee-bar {
  overflow: hidden;
  margin-bottom: var(--s-8);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.018);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.wt-marquee-track {
  display: flex;
  gap: var(--s-6);
  width: max-content;
  padding: 11px 0;
  animation: wt-marquee 72s linear infinite;
}

.wt-marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
}

.wt-marquee-grad {
  color: var(--text-2);
  background: none;
  -webkit-text-fill-color: currentColor;
}

@keyframes wt-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- 17. Custom dropdown ---------- */
.custom-dropdown {
  position: relative;
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  z-index: 40;
}

.toolbar-field .custom-dropdown { display: flex; width: 100%; }
.cw2-actions .custom-dropdown { flex: 0 1 300px; min-width: 200px; max-width: 100%; }

.custom-dropdown.open { z-index: 999; }

.custom-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease;
}

/* Selected values fit on one line; full option text remains in the menu. */
.custom-dropdown-trigger {
  min-width: 0;
  white-space: nowrap;
}
.custom-dropdown-label {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cw2-actions .custom-dropdown { flex: 0 1 330px; }

.custom-dropdown-trigger:hover { border-color: var(--border-3); }
.custom-dropdown.open .custom-dropdown-trigger {
  border-color: var(--accent-line);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--ring);
}

.custom-dropdown-arrow {
  width: 15px; height: 15px;
  flex-shrink: 0;
  color: var(--text-3);
  transition: transform 0.2s ease;
}
.custom-dropdown.open .custom-dropdown-arrow { transform: rotate(180deg); }

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 100%;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-2);
  background: #101815;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(-6px) scale(0.99);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.custom-dropdown.open .custom-dropdown-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.custom-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--r-xs);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.custom-dropdown-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.custom-dropdown-item.selected {
  background: var(--accent-soft);
  color: var(--accent);
}
.custom-dropdown-item .check { color: var(--accent); font-size: 12px; }

.custom-dropdown-search-wrap {
  position: sticky;
  top: 0;
  padding: 4px;
  background: #101815;
  z-index: 1;
}

.custom-dropdown-search {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}
.custom-dropdown-search::placeholder { color: var(--text-3); }
.custom-dropdown-search:focus {
  outline: none;
  border-color: var(--accent-line);
}

.custom-dropdown-empty {
  padding: 14px 10px;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}

/* ---------- 18. Footer ---------- */
.site-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
}

.footer-sep { color: var(--border-3); }

/* ---------- 19. Snow (removed from markup; defensive) ---------- */
.wt-snow-layer { display: none !important; }

/* Lightweight desktop-only snowfall, inspired by the CodePen snow drift.
   Only transform/opacity animate: no JS per frame, glow filters or layout work. */
.wt-screen-snow {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 85;
  contain: layout style paint;
}
.wt-screen-flake {
  position: absolute;
  top: -8px;
  left: var(--snow-left);
  width: var(--snow-size);
  height: var(--snow-size);
  border-radius: 50%;
  background: var(--snow-color, rgba(239, 249, 255, .9));
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  animation: wt-screen-snow-fall var(--snow-duration, 15s) linear infinite;
  animation-delay: var(--snow-delay, 0s);
}
@keyframes wt-screen-snow-fall {
  0% { opacity: 0; transform: translate3d(0, 0, 0); }
  10% { opacity: var(--snow-opacity, .45); }
  87% { opacity: var(--snow-opacity, .45); }
  100% {
    opacity: 0;
    transform: translate3d(var(--snow-drift, 0px), calc(100dvh + 24px), 0);
  }
}
.wt-screen-snow.is-paused .wt-screen-flake { animation-play-state: paused; }
@media (max-width: 820px), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .wt-screen-snow { display: none !important; }
}
@media (pointer: coarse) {
  .hero-snow-layer { display: none !important; animation: none !important; }
}

/* ---------- 20. Responsive ---------- */
@media (max-width: 1180px) {
  .site-nav a { padding: 8px 11px; font-size: 13px; }
  .header-status { max-width: 260px; }
}

@media (max-width: 1024px) {
  :root { --gutter: 24px; }

  .hero { min-height: 540px; }
  .hero-title { font-size: clamp(3rem, 11vw, 5.2rem); }

  .clan-info-grid { grid-template-columns: 1fr; }
  .meta-decks-grid { grid-template-columns: 1fr; }

  .podium-1st { transform: none; }
  .podium-1st:hover { transform: translateY(-3px); }

  .header-inner { position: relative; }
  .mobile-nav-toggle { display: inline-flex; margin-left: auto; }
  .mobile-nav-toggle:hover,
  .mobile-nav-toggle[aria-expanded="true"] {
    color: #ffffff;
    background: transparent;
  }
  .site-nav { display: none; }
  .mobile-side-panel {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 0 0 auto;
    width: clamp(176px, 40vw, 410px);
    height: 100vh;
    height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 18px 12px;
    border-left: 1px solid rgba(226, 232, 240, .13);
    background: linear-gradient(165deg, #17181b 0%, #101114 52%, #090a0c 100%);
    box-shadow: -24px 0 64px rgba(0, 0, 0, .64);
    visibility: hidden;
    pointer-events: none;
    transform: translateX(103%);
    transition: transform .28s ease, visibility .28s ease;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 300;
  }
  .mobile-side-panel.is-open {
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
  }
  .mobile-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 14px;
    padding: 0 0 14px;
    border-bottom: 1px solid rgba(226, 232, 240, .10);
    color: #f1f2f5;
    font-size: clamp(12.5px, 3.3vw, 15px);
    letter-spacing: .015em;
  }
  .mobile-side-close {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 36px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #cbd0d7;
    font-size: 23px;
    cursor: pointer;
  }
  .mobile-side-close:focus-visible, .mobile-side-links a:focus-visible {
    outline: 2px solid #b6c0cd;
    outline-offset: -2px;
  }
  .mobile-side-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .mobile-side-links a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 12px;
    border-radius: 3px;
    color: #b6bac2;
    font-size: clamp(12.5px, 3.3vw, 15px);
    font-weight: 500;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: break-word;
    transition: background .16s ease, color .16s ease;
  }
  .mobile-side-links a:hover,
  .mobile-side-links a:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, .065);
  }
}

@media (max-width: 820px) {
  /* Phone-sized screens: suppress title snowfall and its GPU work entirely. */
  .hero-snow-layer {
    display: none !important;
    background-image: none !important;
    animation: none !important;
  }
  .podium-stage { grid-template-columns: 1fr; }
  .podium-card { flex-direction: column; }

  .hero { min-height: 480px; }
  .hero-inner { padding: var(--s-7) var(--gutter) var(--s-6); }
  .hero-stats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .hero-stats > div { padding: 14px 16px; }
  .hero-stats strong { font-size: 19px; }

  .cw2-panel, .table-card, .meta-decks-section { padding: var(--s-3); }
  .cw2-header { align-items: stretch; }
  .cw2-actions { margin-left: 0; width: 100%; }
  .cw2-actions > * { flex: 1 1 auto; }

  .header-status { display: none; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; --header-h: 64px; }

  body { font-size: 14.5px; }

  .brand-sub { display: none; }
  .brand-mark { width: 34px; height: 34px; }

  .hero { min-height: 420px; }
  .hero-title { font-size: clamp(2.6rem, 15vw, 3.6rem); letter-spacing: -0.04em; }
  .hero-lead { font-size: 14.5px; margin-bottom: var(--s-4); }
  .hero-eyebrow { font-size: 11px; letter-spacing: 0.12em; }

  .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-stats > div { border-left: 1px solid var(--border); }
  .hero-stats > div:nth-child(3n + 1) { border-left: none; }
  .hero-stats > div:nth-child(n + 4) { border-top: 1px solid var(--border); }
  .hero-stats strong { font-size: 16px; }

  .podium-name { font-size: 18px; }
  .podium-fame-Main { font-size: 22px; }

  .toolbar-bento { padding: var(--s-2); }
  .toolbar-search { flex: 1 1 100%; }
  .toolbar-field { flex: 1 1 140px; }
  .cw2-actions .custom-dropdown { flex: 1 1 100%; min-width: 0; max-width: none; }
  .toolbar-spacer { display: none; }
  .kick-actions { flex: 1 1 100%; }
  .kick-actions .btn { width: 100%; }

  .info-card { padding: var(--s-2); }
  .clan-rules-list li { font-size: 13px; }

  .meta-cards-row { flex-wrap: wrap; }
  .meta-card-slot { flex: 0 0 calc(12.5% - 5px); }

  .cw2-table th, .cw2-table td { padding: 10px; font-size: 12px; }

  .bento-main > section,
  .bento-main > .table-card,
  .bento-main > .toolbar-bento,
  .bento-main > .kick-output { margin-bottom: var(--s-6); }
}

/* ---------- 21. Layout polish · verified War UI ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Five readable KPI tiles on large screens, then responsive rows. */
.hero-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.hero-stats > div { padding: 15px 18px; }
.hero-stats > div:nth-child(5n + 1) { border-left: none; }
.hero-stats > div:nth-child(n + 6) { border-top: 1px solid var(--border); }
.hero-stats .kpi-label {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.35;
  min-height: 2.7em;
  letter-spacing: 0.06em;
  text-wrap: pretty;
}

/* Keep the score large and its short explanation quiet, not a wrap-prone sentence. */
.podium-fame-Main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.3;
}
.podium-score-value {
  font: 700 30px/1.1 var(--mono);
  letter-spacing: -0.045em;
  white-space: nowrap;
}
.podium-score-unit {
  font: 500 12px/1.35 var(--font);
  color: var(--text-2);
  letter-spacing: 0;
  white-space: nowrap;
}
.podium-1st .podium-score-unit { color: var(--text-2); }

/* Source provenance stays available, but does not occupy a paragraph-sized block. */
.cw2-source-details {
  padding-bottom: var(--s-3);
  color: var(--text-3);
}
.cw2-source-details summary,
.rules-details summary {
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  line-height: 1.6;
  font-weight: 600;
  color: var(--text-2);
  transition: color 0.16s ease;
}
.cw2-source-details summary:hover,
.rules-details summary:hover { color: var(--text); }
.cw2-source-details[open] .cw2-note {
  padding: 10px 0 0 16px;
  margin: 0;
  font-size: 12px;
}
.rules-overview { display: grid; gap: 10px; }
.rules-overview p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.rules-overview strong { font-weight: 600; color: var(--text); }
.rules-details { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.rules-details .clan-rules-list { margin-top: 14px; padding-left: 0; }
.clan-info-grid { align-items: stretch; }
.info-card { min-width: 0; }

/* Clan War uses a shorter, quieter history chart; latest War is emphasized. */
.cw2-clan-chart {
  display: block;
  max-height: 245px;
  margin-inline: auto;
}
.cw2-grid-line { stroke: var(--border-3); stroke-width: 1; }
.cw2-clan-chart .cw2-bar-prior { fill: #466b51; }
.cw2-clan-chart .cw2-bar-current { fill: var(--accent); }
.cw2-clan-chart .cw2-bar-value { font-size: 11px; font-weight: 600; }
.cw2-clan-chart .cw2-bar-label { font-size: 11px; }

/* Fit roster columns inside their panel; only use horizontal scrolling as a fallback. */
.table-card { min-width: 0; }
.table-card .table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.table-card .member-table {
  table-layout: fixed;
  width: 100%;
}
.member-table th,
.member-table td {
  padding: 12px 9px;
  overflow-wrap: anywhere;
}
.member-table th:nth-child(1) { width: 4%; }
.member-table th:nth-child(2) { width: 15%; }
.member-table th:nth-child(3) { width: 9%; }
.member-table th:nth-child(4) { width: 8%; }
.member-table th:nth-child(5) { width: 23%; }
.member-table th:nth-child(6) { width: 10%; }
.member-table th:nth-child(7) { width: 10%; }
.member-table th:nth-child(8) { width: 21%; }
.member-table tbody td:last-child { min-width: 0; }
.member-table tbody td:nth-child(2) strong,
.member-table tbody td:nth-child(2) .tag-mono { display: block; }
.member-table tbody td:nth-child(2) strong {
  white-space: normal;
  line-height: 1.4;
}
.member-table .cell-eval { gap: 6px; }
.member-table tbody td:nth-child(5) strong { white-space: normal; }
.member-table tbody td:last-child small { display: none; }
.member-table th { white-space: normal; line-height: 1.4; }
.member-table tbody td:nth-child(2) .tag-mono { font-size: 10.5px; margin-top: 2px; }
.member-table .btn-sm { white-space: nowrap; }

/* This long status strip has been intentionally retired from the visual UI. */
.header-status { display: none !important; }

@media (max-width: 1100px) {
  .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-stats > div { border-left: 1px solid var(--border); }
  .hero-stats > div:nth-child(5n + 1) { border-left: 1px solid var(--border); }
  .hero-stats > div:nth-child(3n + 1) { border-left: none; }
  .hero-stats > div:nth-child(n + 4) { border-top: 1px solid var(--border); }
  .member-table { min-width: 1090px; }
}
@media (max-width: 640px) {
  .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-stats > div { padding: 13px 9px; gap: 8px; }
  .hero-stats .kpi-label { font-size: 10px; letter-spacing: 0; min-height: 2.7em; }
  .hero-stats strong { font-size: 16px; }
  .podium-score-value { font-size: 26px; }
  .podium-score-unit { font-size: 12px; }
  .cw2-clan-chart { max-height: 200px; }
}

/* A single deck column avoids overflow between tablet and compact desktop widths. */
@media (max-width: 1200px) {
  .meta-decks-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Paint containment prevents the scrolled roster's wide table from widening the mobile page. */
.table-card .table-scroll { contain: paint; }
@media (min-width: 1101px) {
  .hero-stats-unified > div:last-child { grid-column: auto; }
}

/* Vietnam War rank: a quiet tenth KPI, with explicit snapshot attribution. */
.hero-stats-unified .kpi-vietnam-war-rank #kpi-vietnam-war-rank {
  color: #DCC69A;
}
.hero-stats-unified .kpi-source {
  color: var(--text-3);
  font-size: 10.5px;
  line-height: 1.35;
  font-weight: 400;
}
@media (min-width: 761px) and (max-width: 1100px) {
  .hero-stats-unified { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hero-stats-unified > div { padding: 12px 10px; }
  .hero-stats-unified > div:nth-child(3n + 1) { border-left: 1px solid var(--border); }
  .hero-stats-unified > div:nth-child(5n + 1) { border-left: none; }
  .hero-stats-unified > div:nth-child(n + 4) { border-top: 0; }
  .hero-stats-unified > div:nth-child(n + 6) { border-top: 1px solid var(--border); }
}
@media (max-width: 760px) {
  .hero-stats-unified { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats-unified > div:nth-child(3n + 1),
  .hero-stats-unified > div:nth-child(5n + 1) { border-left: 1px solid var(--border); }
  .hero-stats-unified > div:nth-child(2n + 1) { border-left: none; }
  .hero-stats-unified > div:nth-child(n + 4),
  .hero-stats-unified > div:nth-child(n + 6) { border-top: 0; }
  .hero-stats-unified > div:nth-child(n + 3) { border-top: 1px solid var(--border); }
}

/* ---------- 22. Always-visible rules · compact cards · readable type ---------- */
/* Notice cards should hug their own content; an expanded rule card must not
   stretch a short Clan announcement into a tall dark empty rectangle. */
.clan-info-grid { align-items: start; }
.clan-info-grid > .info-card { align-self: start; height: auto; }
.rules-always-open {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.rules-always-open .clan-rules-list { margin-top: 0; }

/* Increase regular reading text modestly, preserving the existing hierarchy. */
body { font-size: 16px; }
.site-nav a { font-size: 14.5px; }
.brand-sub { font-size: 11.5px; }
.hero-lead { font-size: 16.5px; }
.hero-eyebrow { font-size: 12.5px; }
.hero-hint { font-size: 14.5px; }
.info-card-title { font-size: 14.5px; }
.info-badge { font-size: 11.5px; }
.clan-rules-list li { font-size: 15px; line-height: 1.65; }
.podium-meta { font-size: 13.5px; }
.podium-metric-pill { font-size: 12.5px; }
.meta-decks-sub { font-size: 13.5px; }
.cw2-note { font-size: 13.5px; }
.cw2-table { font-size: 13.5px; }
.member-table { font-size: 14.5px; }
.member-table tbody td small { font-size: 12.5px; }
.member-table tbody td:nth-child(2) .tag-mono { font-size: 11px; }
.roster-sub { font-size: 13.5px; }
.toolbar-bento input[type="search"],
.toolbar-bento input[type="text"],
.toolbar-bento select { font-size: 14px; }
.btn { font-size: 13.5px; }
.meta-deck-name { font-size: 14.5px; }
.site-footer { font-size: 12.5px; }

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .hero-lead { font-size: 15px; }
  .hero-eyebrow { font-size: 11.5px; }
  .clan-rules-list li { font-size: 14px; }
  .info-card-title { font-size: 14px; }
  .cw2-table { font-size: 13px; }
  .member-table { font-size: 14px; }
}

/* ---------- 23. Roster first-row visibility and compact one-row Meta decks ---------- */
/* Keep rank and all column headings on one line without stretching the page. */
#clan-roster .member-table thead th {
  white-space: nowrap;
  overflow-wrap: normal;
  letter-spacing: 0.02em;
}
#clan-roster .member-table th:nth-child(1) { width: 6%; }
#clan-roster .member-table th:nth-child(5) { width: 22%; }
#clan-roster .member-table th:nth-child(6) { width: 12%; }
#clan-roster .member-table th:nth-child(8) { width: 18%; }

/* The roster header was being painted over the first member on page navigation.
   Keep its column names in normal table flow so rank #1 is never covered. */
#clan-roster .member-table thead th {
  position: static;
  top: auto;
}
#clan-roster .member-table tbody tr:first-child { display: table-row; }

/* Eight cards always share one line. A slot follows the card art's 5:6
   proportions instead of showing a tall black placeholder around it. */
.meta-deck-card { min-width: 0; }
.meta-cards-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  align-items: start;
  width: 100%;
  max-width: 538px;
}
.meta-card-slot {
  display: block;
  width: 100%;
  height: auto;
  min-width: 0;
  aspect-ratio: 5 / 6;
  border: 0;
  border-radius: 5px;
  background: transparent;
  overflow: hidden;
}
.meta-card-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@media (max-width: 640px) {
  .meta-cards-row {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
  }
  .meta-card-slot {
    width: 100%;
    height: auto;
  }
}

/* The War controls belong side by side; the Clan details may wrap independently. */
.cw2-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}
.cw2-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: auto;
  min-width: 0;
  gap: 10px;
  margin-left: 0;
}
.cw2-actions .custom-dropdown {
  flex: 0 1 300px;
  width: 300px;
  min-width: 0;
  max-width: 100%;
}
.cw2-actions > .btn { flex: 0 0 auto; white-space: nowrap; }
.cw2-meta { min-width: 0; }

/* Soft animated rank glow: jade-to-gold, with no abrupt motion. */
.cw2-clan-panel .cw2-meta .badge-good {
  border-color: rgba(157, 226, 115, .55);
  background: linear-gradient(110deg, rgba(39, 107, 54, .80) 0%,
    rgba(77, 166, 66, .60) 36%, rgba(196, 158, 62, .45) 53%,
    rgba(39, 107, 54, .80) 100%);
  background-size: 240% 100%;
  color: #e8ffd9;
  box-shadow: 0 0 0 1px rgba(107, 219, 100, .12), 0 0 14px rgba(91, 194, 84, .18);
  animation: cw2-rank-shimmer 7s ease-in-out infinite;
}
@keyframes cw2-rank-shimmer {
  0%, 100% {
    background-position: 0% 50%;
    box-shadow: 0 0 0 1px rgba(107, 219, 100, .10), 0 0 10px rgba(91, 194, 84, .11);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 0 1px rgba(107, 219, 100, .22), 0 0 18px rgba(91, 194, 84, .25);
  }
}
@media (max-width: 1160px) {
  .cw2-header { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .cw2-actions { width: 100%; margin-left: 0; justify-content: flex-start; }
  .cw2-actions .custom-dropdown { flex: 1 1 0; width: auto; max-width: 330px; }
}
@media (max-width: 640px) {
  .cw2-actions { flex-wrap: nowrap; width: 100%; gap: 8px; }
  .cw2-actions .custom-dropdown {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    max-width: none;
  }
  .cw2-actions > .btn {
    flex: 0 1 auto;
    max-width: 48%;
    min-width: 0;
    padding-inline: 10px;
    font-size: 11.5px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cw2-clan-panel .cw2-meta .badge-good { animation: none; }
}

/* WinterTime winter accents: lightweight effects only, no layout shifts. */
.hero-title {
  position: relative;
  width: fit-content;
  max-width: 100%;
  color: #e9f7ff;
  background: linear-gradient(180deg, #ffffff 0%, #e5f3ff 50%, #bedce8 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* Individually varied 6-arm flakes, four independently drifting text-clipped layers. */
.hero-snow-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  white-space: nowrap;
  font: inherit;
  letter-spacing: inherit;
  color: transparent;
  background-image: url("./snowflake-six.svg?v=variety-v3");
  background-size: 320px 144px;
  background-repeat: repeat;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: wintertime-letter-snow var(--snow-duration, 11s) linear infinite;
  animation-delay: var(--snow-delay, 0s);
}
.hero-snow-layer:nth-of-type(1) { --snow-x: 0px; --snow-duration: 7.5s; opacity: .90; }
.hero-snow-layer:nth-of-type(2) { --snow-x: 69px; --snow-duration: 10.5s; opacity: .86; }
.hero-snow-layer:nth-of-type(3) { --snow-x: 147px; --snow-duration: 14s; opacity: .73; }
.hero-snow-layer:nth-of-type(4) { --snow-x: 228px; --snow-duration: 19s; opacity: .68; }
@keyframes wintertime-letter-snow {
  from { background-position: var(--snow-x, 0px) 0px; }
  to   { background-position: var(--snow-x, 0px) 144px; }
}

/* Each podium gently drifts with a different cadence, independent of hover. */
.podium-stage .podium-card {
  animation: wintertime-cloud-float 9.5s ease-in-out infinite;
}
.podium-stage .podium-card:nth-child(2) {
  animation-duration: 11s;
  animation-delay: -3.4s;
}
.podium-stage .podium-card:nth-child(3) {
  animation-duration: 10.3s;
  animation-delay: -6.2s;
}
@keyframes wintertime-cloud-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}
/* The gradient highlight actually travels around the rounded card perimeter. */
@property --wintertime-border-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.podium-stage .podium-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  background: conic-gradient(from var(--wintertime-border-angle),
    rgba(140, 190, 204, .26) 0deg,
    rgba(120, 235, 214, .98) 20deg,
    rgba(229, 243, 202, .85) 45deg,
    rgba(128, 213, 202, .45) 88deg,
    rgba(140, 190, 204, .18) 142deg,
    rgba(140, 190, 204, .18) 310deg,
    rgba(140, 190, 204, .26) 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: wintertime-border-flow 7.5s linear infinite;
}
.podium-stage .podium-card:nth-child(2)::before,
.podium-stage .podium-card:nth-child(2)::after {
  animation-delay: -4s;
  animation-duration: 8.1s;
}
.podium-stage .podium-card:nth-child(3)::before,
.podium-stage .podium-card:nth-child(3)::after {
  animation-delay: -6s;
  animation-duration: 7.9s;
}
.podium-stage .podium-1st::before {
  background: conic-gradient(from var(--wintertime-border-angle),
    rgba(111, 204, 120, .32) 0deg,
    rgba(162, 255, 152, 1) 20deg,
    rgba(250, 226, 138, .9) 45deg,
    rgba(130, 224, 132, .5) 88deg,
    rgba(111, 204, 120, .2) 142deg,
    rgba(111, 204, 120, .2) 310deg,
    rgba(111, 204, 120, .32) 360deg);
}
/* Soft halo follows the moving color, without thickening the 1px edge. */
.podium-stage .podium-card::after {
  content: "";
  position: absolute;
  inset: -3px;
  padding: 2px;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: conic-gradient(from var(--wintertime-border-angle),
    transparent 0%,
    rgba(148, 220, 205, .7) 22%,
    rgba(199, 216, 169, .5) 40%,
    rgba(126, 206, 190, .3) 57%,
    transparent 72%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  filter: blur(4px);
  opacity: .38;
  animation: wintertime-border-flow 7.5s linear infinite;
}
.podium-stage .podium-1st::after {
  background: conic-gradient(from var(--wintertime-border-angle),
    transparent 0%,
    rgba(144, 236, 137, .8) 22%,
    rgba(224, 197, 113, .55) 40%,
    rgba(125, 213, 127, .3) 57%,
    transparent 72%);
}
@keyframes wintertime-border-flow {
  to { --wintertime-border-angle: 360deg; }
}
@media (max-width: 820px) {
  .podium-stage .podium-card {
    animation-duration: 12s;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-snow-layer,
  .podium-stage .podium-card,
  .podium-stage .podium-card::before,
  .podium-stage .podium-card::after {
    animation: none !important;
    translate: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wt-marquee-track { animation: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}