:root {
  --bg: #09111f;
  --bg-soft: #101c33;
  --panel: rgba(9, 17, 31, 0.72);
  --panel-strong: rgba(13, 27, 49, 0.88);
  --line: rgba(147, 180, 255, 0.16);
  --text: #f3f6ff;
  --muted: #8ea8d7;
  --accent: #77f0cf;
  --accent-2: #ffb347;
  --danger: #ff8585;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --bg-start: #040915;
  --bg-mid: #09111f;
  --bg-end: #0b1730;
  --aura-1: rgba(119, 240, 207, 0.12);
  --aura-2: rgba(255, 179, 71, 0.14);
  --grid-line: rgba(255, 255, 255, 0.025);
  --grid-mask: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
  --grid-size: 36px;
  --panel-grad-top: rgba(16, 28, 51, 0.95);
  --panel-grad-bottom: rgba(9, 17, 31, 0.85);
  --panel-glow: rgba(119, 240, 207, 0.12);
  --chip-border: rgba(119, 240, 207, 0.18);
  --chip-bg: rgba(119, 240, 207, 0.08);
  --chip-text: #dffcf3;
  --chip-active-start: rgba(119, 240, 207, 0.18);
  --chip-active-end: rgba(79, 210, 255, 0.2);
  --primary-btn-end: #4fd2ff;
  --primary-btn-text: #08222f;
  --secondary-bg: rgba(255, 255, 255, 0.06);
  --warning-border: rgba(255, 133, 133, 0.26);
  --warning-bg: rgba(255, 133, 133, 0.1);
  --warning-text: #ffd7d7;
  --surface-border: rgba(255, 255, 255, 0.06);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --surface-soft-2: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(0, 0, 0, 0.18);
  --summary-text: #d9e7ff;
  --detail-summary-text: #d7e4ff;
  --rank-pill-bg: rgba(255, 179, 71, 0.12);
  --rank-pill-text: #ffd69d;
  --mini-tag-border: rgba(255, 255, 255, 0.08);
  --mini-tag-bg: rgba(255, 255, 255, 0.04);
  --mini-tag-text: #dbe6ff;
  --active-border: rgba(119, 240, 207, 0.4);
  --active-bg-start: rgba(16, 28, 51, 0.96);
  --active-bg-end: rgba(12, 28, 52, 0.9);
  --pre-bg: rgba(0, 0, 0, 0.22);
  --pre-text: #dfe8ff;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --mono: "SFMono-Regular", "JetBrains Mono", "Menlo", monospace;
  --sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

:root[data-theme="sunrise"] {
  --bg: #2b150f;
  --bg-soft: #3c1d15;
  --panel: rgba(53, 24, 18, 0.74);
  --panel-strong: rgba(73, 31, 22, 0.9);
  --line: rgba(255, 201, 159, 0.22);
  --text: #fff2e9;
  --muted: #d6b39a;
  --accent: #ffb26b;
  --accent-2: #ff7a59;
  --danger: #ff8279;
  --shadow: 0 24px 80px rgba(22, 7, 4, 0.45);
  --bg-start: #1f0d08;
  --bg-mid: #2d130e;
  --bg-end: #3a1d13;
  --aura-1: rgba(255, 178, 107, 0.2);
  --aura-2: rgba(255, 122, 89, 0.16);
  --grid-line: rgba(255, 239, 224, 0.03);
  --panel-grad-top: rgba(64, 27, 20, 0.95);
  --panel-grad-bottom: rgba(40, 17, 13, 0.88);
  --panel-glow: rgba(255, 178, 107, 0.16);
  --chip-border: rgba(255, 178, 107, 0.3);
  --chip-bg: rgba(255, 178, 107, 0.14);
  --chip-text: #ffe7d2;
  --chip-active-start: rgba(255, 178, 107, 0.28);
  --chip-active-end: rgba(255, 122, 89, 0.24);
  --primary-btn-end: #ff7a59;
  --primary-btn-text: #311209;
  --secondary-bg: rgba(255, 245, 236, 0.09);
  --warning-border: rgba(255, 136, 116, 0.35);
  --warning-bg: rgba(255, 136, 116, 0.14);
  --warning-text: #ffd7cf;
  --surface-border: rgba(255, 243, 231, 0.11);
  --surface-soft: rgba(255, 244, 234, 0.08);
  --surface-soft-2: rgba(255, 244, 234, 0.13);
  --input-bg: rgba(24, 9, 6, 0.4);
  --summary-text: #ffe4d1;
  --detail-summary-text: #ffe2cf;
  --rank-pill-bg: rgba(255, 211, 111, 0.2);
  --rank-pill-text: #ffe8b5;
  --mini-tag-border: rgba(255, 244, 234, 0.2);
  --mini-tag-bg: rgba(255, 244, 234, 0.1);
  --mini-tag-text: #ffe6d6;
  --active-border: rgba(255, 178, 107, 0.55);
  --active-bg-start: rgba(82, 34, 24, 0.95);
  --active-bg-end: rgba(62, 24, 18, 0.9);
  --pre-bg: rgba(16, 6, 4, 0.44);
  --pre-text: #ffe8d7;
}

:root[data-theme="forest"] {
  --bg: #0d2017;
  --bg-soft: #143126;
  --panel: rgba(12, 35, 26, 0.74);
  --panel-strong: rgba(17, 47, 35, 0.88);
  --line: rgba(125, 224, 181, 0.2);
  --text: #ecfff6;
  --muted: #9acfb8;
  --accent: #6fe1b4;
  --accent-2: #c8df6f;
  --danger: #ff8f8f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  --bg-start: #05140f;
  --bg-mid: #0c231b;
  --bg-end: #173126;
  --aura-1: rgba(111, 225, 180, 0.2);
  --aura-2: rgba(200, 223, 111, 0.16);
  --grid-line: rgba(211, 255, 236, 0.03);
  --panel-grad-top: rgba(18, 48, 35, 0.94);
  --panel-grad-bottom: rgba(11, 28, 21, 0.88);
  --panel-glow: rgba(111, 225, 180, 0.17);
  --chip-border: rgba(111, 225, 180, 0.26);
  --chip-bg: rgba(111, 225, 180, 0.14);
  --chip-text: #e4fff2;
  --chip-active-start: rgba(111, 225, 180, 0.25);
  --chip-active-end: rgba(200, 223, 111, 0.2);
  --primary-btn-end: #9bd477;
  --primary-btn-text: #112919;
  --secondary-bg: rgba(238, 255, 248, 0.08);
  --warning-border: rgba(255, 140, 140, 0.34);
  --warning-bg: rgba(255, 140, 140, 0.14);
  --warning-text: #ffd9d9;
  --surface-border: rgba(231, 255, 246, 0.1);
  --surface-soft: rgba(231, 255, 246, 0.07);
  --surface-soft-2: rgba(231, 255, 246, 0.12);
  --input-bg: rgba(5, 18, 13, 0.4);
  --summary-text: #def8eb;
  --detail-summary-text: #dcf3e8;
  --rank-pill-bg: rgba(200, 223, 111, 0.2);
  --rank-pill-text: #f2ffbf;
  --mini-tag-border: rgba(231, 255, 246, 0.2);
  --mini-tag-bg: rgba(231, 255, 246, 0.1);
  --mini-tag-text: #d7fae9;
  --active-border: rgba(111, 225, 180, 0.52);
  --active-bg-start: rgba(20, 54, 40, 0.95);
  --active-bg-end: rgba(13, 34, 26, 0.9);
  --pre-bg: rgba(5, 18, 13, 0.46);
  --pre-text: #ddfff1;
}

:root[data-theme="snow"] {
  --bg: #f3f8ff;
  --bg-soft: #dfeaf9;
  --panel: rgba(255, 255, 255, 0.85);
  --panel-strong: rgba(247, 251, 255, 0.95);
  --line: rgba(90, 124, 176, 0.22);
  --text: #1f2b41;
  --muted: #62728d;
  --accent: #1b83d2;
  --accent-2: #2cb67d;
  --danger: #d65353;
  --shadow: 0 24px 60px rgba(34, 62, 104, 0.16);
  --bg-start: #eef4ff;
  --bg-mid: #f8fbff;
  --bg-end: #ffffff;
  --aura-1: rgba(27, 131, 210, 0.16);
  --aura-2: rgba(44, 182, 125, 0.14);
  --grid-line: rgba(86, 117, 168, 0.08);
  --panel-grad-top: rgba(255, 255, 255, 0.96);
  --panel-grad-bottom: rgba(239, 246, 255, 0.9);
  --panel-glow: rgba(27, 131, 210, 0.13);
  --chip-border: rgba(27, 131, 210, 0.24);
  --chip-bg: rgba(27, 131, 210, 0.08);
  --chip-text: #1d5392;
  --chip-active-start: rgba(27, 131, 210, 0.19);
  --chip-active-end: rgba(44, 182, 125, 0.2);
  --primary-btn-end: #2cb67d;
  --primary-btn-text: #08243b;
  --secondary-bg: rgba(255, 255, 255, 0.78);
  --warning-border: rgba(214, 83, 83, 0.34);
  --warning-bg: rgba(214, 83, 83, 0.13);
  --warning-text: #842d2d;
  --surface-border: rgba(90, 124, 176, 0.2);
  --surface-soft: rgba(97, 130, 182, 0.1);
  --surface-soft-2: rgba(97, 130, 182, 0.16);
  --input-bg: rgba(255, 255, 255, 0.9);
  --summary-text: #2a3f5f;
  --detail-summary-text: #2b4262;
  --rank-pill-bg: rgba(44, 182, 125, 0.18);
  --rank-pill-text: #1f7453;
  --mini-tag-border: rgba(97, 130, 182, 0.26);
  --mini-tag-bg: rgba(97, 130, 182, 0.12);
  --mini-tag-text: #30496d;
  --active-border: rgba(27, 131, 210, 0.42);
  --active-bg-start: rgba(234, 244, 255, 0.94);
  --active-bg-end: rgba(222, 237, 255, 0.86);
  --pre-bg: rgba(236, 244, 255, 0.92);
  --pre-text: #243650;
}

:root[data-theme="graphite"] {
  --bg: #161b23;
  --bg-soft: #232a34;
  --panel: rgba(25, 32, 42, 0.74);
  --panel-strong: rgba(34, 42, 54, 0.88);
  --line: rgba(170, 185, 204, 0.2);
  --text: #eef2f8;
  --muted: #a2adbf;
  --accent: #8cb0ff;
  --accent-2: #95d4c0;
  --danger: #f39a9a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --bg-start: #10141b;
  --bg-mid: #171c24;
  --bg-end: #212833;
  --aura-1: rgba(140, 176, 255, 0.18);
  --aura-2: rgba(149, 212, 192, 0.15);
  --grid-line: rgba(220, 230, 244, 0.03);
  --panel-grad-top: rgba(35, 43, 56, 0.94);
  --panel-grad-bottom: rgba(22, 28, 37, 0.9);
  --panel-glow: rgba(140, 176, 255, 0.14);
  --chip-border: rgba(140, 176, 255, 0.26);
  --chip-bg: rgba(140, 176, 255, 0.12);
  --chip-text: #e4edff;
  --chip-active-start: rgba(140, 176, 255, 0.24);
  --chip-active-end: rgba(149, 212, 192, 0.18);
  --primary-btn-end: #95d4c0;
  --primary-btn-text: #1a2532;
  --secondary-bg: rgba(237, 243, 255, 0.08);
  --warning-border: rgba(243, 154, 154, 0.34);
  --warning-bg: rgba(243, 154, 154, 0.12);
  --warning-text: #ffd9d9;
  --surface-border: rgba(237, 243, 255, 0.1);
  --surface-soft: rgba(237, 243, 255, 0.07);
  --surface-soft-2: rgba(237, 243, 255, 0.13);
  --input-bg: rgba(12, 17, 24, 0.4);
  --summary-text: #dde6f4;
  --detail-summary-text: #d9e2f2;
  --rank-pill-bg: rgba(149, 212, 192, 0.2);
  --rank-pill-text: #d9fff4;
  --mini-tag-border: rgba(237, 243, 255, 0.2);
  --mini-tag-bg: rgba(237, 243, 255, 0.1);
  --mini-tag-text: #dbe6fa;
  --active-border: rgba(140, 176, 255, 0.48);
  --active-bg-start: rgba(42, 52, 68, 0.96);
  --active-bg-end: rgba(27, 35, 47, 0.92);
  --pre-bg: rgba(13, 18, 25, 0.44);
  --pre-text: #dfe7f7;
}

:root[data-theme="kpl_arena"] {
  --bg: #06060a;
  --bg-soft: #0b0b14;
  --panel: rgba(9, 10, 18, 0.74);
  --panel-strong: rgba(13, 15, 30, 0.9);
  --line: rgba(120, 140, 255, 0.22);
  --text: #f4f6ff;
  --muted: #a5b0d0;
  --accent: #25f3ff;
  --accent-2: #ff2e92;
  --danger: #ff6b6b;
  --shadow: 0 28px 92px rgba(0, 0, 0, 0.52);
  --bg-start: #020207;
  --bg-mid: #06060a;
  --bg-end: #12133a;
  --aura-1: rgba(37, 243, 255, 0.16);
  --aura-2: rgba(255, 46, 146, 0.14);
  --grid-line: rgba(255, 255, 255, 0.03);
  --grid-mask: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent);
  --grid-size: 26px;
  --panel-grad-top: rgba(22, 20, 46, 0.94);
  --panel-grad-bottom: rgba(7, 8, 16, 0.9);
  --panel-glow: rgba(120, 140, 255, 0.18);
  --chip-border: rgba(37, 243, 255, 0.26);
  --chip-bg: rgba(37, 243, 255, 0.08);
  --chip-text: #e7feff;
  --chip-active-start: rgba(37, 243, 255, 0.22);
  --chip-active-end: rgba(255, 46, 146, 0.18);
  --primary-btn-end: #5879ff;
  --primary-btn-text: #041018;
  --secondary-bg: rgba(255, 255, 255, 0.06);
  --warning-border: rgba(255, 107, 107, 0.36);
  --warning-bg: rgba(255, 107, 107, 0.14);
  --warning-text: #ffd9d9;
  --surface-border: rgba(255, 255, 255, 0.08);
  --surface-soft: rgba(255, 255, 255, 0.045);
  --surface-soft-2: rgba(255, 255, 255, 0.085);
  --input-bg: rgba(0, 0, 0, 0.22);
  --summary-text: #e1e6ff;
  --detail-summary-text: #e1e6ff;
  --rank-pill-bg: rgba(88, 121, 255, 0.18);
  --rank-pill-text: #dbe3ff;
  --mini-tag-border: rgba(120, 140, 255, 0.22);
  --mini-tag-bg: rgba(120, 140, 255, 0.1);
  --mini-tag-text: #e5eaff;
  --active-border: rgba(37, 243, 255, 0.5);
  --active-bg-start: rgba(22, 20, 46, 0.96);
  --active-bg-end: rgba(7, 8, 16, 0.92);
  --pre-bg: rgba(0, 0, 0, 0.26);
  --pre-text: #e7eeff;
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, var(--aura-1), transparent 26%),
    radial-gradient(circle at top right, var(--aura-2), transparent 30%),
    linear-gradient(160deg, var(--bg-start) 0%, var(--bg-mid) 45%, var(--bg-end) 100%);
  color: var(--text);
  font-family: var(--sans);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  mask-image: var(--grid-mask);
}

.page-shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.hero,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--panel-grad-top), var(--panel-grad-bottom));
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr;
  gap: 28px;
  padding: 36px;
  margin-bottom: 24px;
}

.hero::after,
.panel::after {
  content: "";
  position: absolute;
  inset: auto -10% -45% auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--panel-glow), transparent 65%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  letter-spacing: 0.28em;
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 4.5vw, 66px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.hero-text {
  margin-top: 16px;
  max-width: 820px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-meta span,
.chip,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 12px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--primary-btn-end));
  color: var(--primary-btn-text);
}

.secondary-btn {
  background: var(--secondary-bg);
  color: var(--text);
  border: 1px solid var(--line);
}

.theme-switcher {
  display: grid;
  gap: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 12px;
}

.theme-switcher p {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.theme-chip {
  justify-content: center;
  border-radius: 14px;
  padding: 10px 8px;
  font-size: 12px;
}

.author-contact {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

.panel {
  padding: 24px;
}

.overview-panel,
.analytics-panel,
.explorer-panel,
.text-panel,
.recent-match-panel {
  grid-column: 1 / -1;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-head h2 {
  font-size: 26px;
}

.panel-head p {
  color: var(--muted);
  font-size: 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
}

.stat-card .label {
  color: var(--muted);
  font-size: 13px;
}

.stat-card .value {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.stat-card .sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.warning-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.warning-strip .warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-text);
}

.insight-card-grid,
.analytics-grid,
.analytics-summary {
  display: grid;
  gap: 14px;
}

.insight-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.analytics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.analytics-block,
.insight-card,
.summary-line {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.insight-card,
.summary-line {
  padding: 16px;
}

.analytics-block {
  padding: 16px;
}

.analytics-block h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.analytics-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.analytics-block-head h3 {
  margin-bottom: 0;
}

.mini-switch-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--secondary-bg);
  color: var(--text);
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.mini-switch-btn[hidden] {
  display: none;
}

.analytics-list {
  display: grid;
  gap: 10px;
}

.insight-card .label,
.metric-item .label {
  color: var(--muted);
  font-size: 12px;
}

.insight-card .team-name {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 800;
}

.insight-card .value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 800;
}

.insight-card .sub,
.metric-item .sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.metric-item {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
}

.brand-inline,
.match-team,
.team-title-wrap,
.hero-inline,
.player-cell,
.value.with-avatar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo,
.match-team-logo,
.team-title-logo,
.leaderboard-avatar,
.table-avatar,
.mini-avatar,
.hero-inline-logo {
  flex: 0 0 auto;
  object-fit: cover;
  background: var(--secondary-bg);
}

.brand-logo,
.match-team-logo,
.table-avatar,
.hero-inline-logo {
  width: 28px;
  height: 28px;
  border-radius: 10px;
}

.team-title-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

.leaderboard-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 12px;
}

.brand-logo.is-fallback,
.match-team-logo.is-fallback,
.team-title-logo.is-fallback,
.leaderboard-avatar.is-fallback,
.table-avatar.is-fallback,
.mini-avatar.is-fallback,
.hero-inline-logo.is-fallback {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.match-team {
  min-width: 0;
}

.brand-inline,
.team-title-wrap {
  min-width: 0;
}

.match-team-right {
  justify-content: flex-end;
}

.hero-inline span,
.match-team span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-inline strong,
.value.with-avatar span {
  margin-top: 0;
}

.metric-item strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
}

.metric-item .value-strong {
  text-align: left;
  margin-top: 6px;
}

.micro-bar {
  margin-top: 10px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft-2);
}

.micro-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.summary-line {
  color: var(--summary-text);
  line-height: 1.7;
}

.team-board,
.leaderboard-table,
.team-list {
  display: grid;
  gap: 10px;
}

.team-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 140px 90px;
  gap: 14px;
  align-items: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 12px 14px;
}

.rank-pill {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--rank-pill-bg);
  color: var(--rank-pill-text);
  font-weight: 800;
}

.team-row .meta {
  display: grid;
  gap: 6px;
}

.team-row .meta strong {
  font-size: 16px;
}

.team-row .meta span {
  color: var(--muted);
  font-size: 12px;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.value-strong {
  text-align: right;
  font-weight: 800;
}

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

.leaderboards h3,
.text-panels h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.ai-config-panel {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.ai-config-head,
.provider-pills,
.ai-profile-grid,
.ai-profile-actions,
.ai-config-grid {
  display: grid;
  gap: 12px;
}

.ai-config-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 14px;
}

.ai-config-head p,
.provider-note {
  color: var(--muted);
  font-size: 13px;
}

.provider-pills {
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: center;
}

.provider-pills .chip {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.ai-config-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ai-profile-grid {
  grid-template-columns: 1.05fr 1.3fr 0.9fr;
  align-items: end;
  margin-bottom: 12px;
}

.ai-profile-actions {
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.compact-btn {
  padding: 12px 14px;
}

.provider-note {
  margin-top: 12px;
}

.ai-task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.ai-task-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
}

.ai-task-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-task-top h4 {
  font-size: 14px;
}

.task-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  background: var(--secondary-bg);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
}

.task-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.task-badge.is-running {
  color: var(--accent);
}

.task-badge.is-running::before {
  animation: taskPulse 1s ease-in-out infinite;
}

.task-badge.is-success {
  color: var(--accent-2);
}

.task-badge.is-error {
  color: var(--danger);
}

.task-badge.is-idle {
  color: var(--muted);
}

.ai-task-meta,
.ai-task-time {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.ai-task-actions {
  margin-top: 10px;
}

.mini-task-btn {
  padding: 8px 12px;
  font-size: 12px;
}

@keyframes taskPulse {
  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.45;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

.stage-summary,
.rank-card-grid,
.stage-groups,
.match-columns {
  display: grid;
  gap: 14px;
}

.stage-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.stage-chip,
.group-card,
.rank-card,
.match-card,
.match-inspector,
.hero-rank-table {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.stage-chip,
.rank-card,
.match-card {
  padding: 16px;
}

.stage-chip .value,
.rank-card .value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 800;
}

.stage-chip .sub,
.rank-card .sub,
.match-card .subtle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.stage-groups {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.group-card {
  overflow: hidden;
}

.group-card h3,
.match-columns h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.group-card h3 {
  padding: 14px 16px 0;
}

.standings-table table {
  width: 100%;
  min-width: 520px;
}

.standings-table,
.roster-table,
.hero-rank-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.roster-table table {
  min-width: 780px;
}

.hero-rank-table table {
  min-width: 680px;
}

.standings-table th,
.standings-table td {
  padding: 10px 12px;
}

.standings-table td:nth-child(1),
.standings-table td:nth-child(3),
.standings-table td:nth-child(4),
.standings-table td:nth-child(5) {
  text-align: center;
}

.rank-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.rank-card .title {
  color: var(--muted);
  font-size: 13px;
}

.rank-card .leader {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rank-card .avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--secondary-bg);
}

.rank-card .avatar.is-fallback {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.rank-card .leader-name {
  font-size: 16px;
  font-weight: 700;
}

.rank-card .leader-team {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.hero-rank-table {
  overflow-x: auto;
}

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

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

.match-inspector {
  margin-top: 18px;
  padding: 18px;
}

.match-card-top,
.match-score-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.match-stage {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.match-score-row {
  margin-top: 14px;
  font-size: 14px;
}

.match-score-row strong {
  font-size: 24px;
  letter-spacing: -0.04em;
}

.match-card.selectable {
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.match-card.selectable:hover,
.match-card.selectable.active {
  transform: translateY(-1px);
  border-color: var(--active-border);
  background: linear-gradient(180deg, var(--active-bg-start), var(--active-bg-end));
}

.round-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--mini-tag-border);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--mini-tag-bg);
  font-size: 12px;
  color: var(--mini-tag-text);
}

.inspector-head,
.inspector-meta,
.round-detail-top,
.schedule-mini-top,
.schedule-mini-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.inspector-head {
  align-items: flex-start;
  margin-bottom: 16px;
}

.inspector-head h3 {
  font-size: 28px;
}

.inspector-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.inspector-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.round-detail-card,
.team-schedule-panel,
.schedule-mini-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.round-detail-card,
.team-schedule-panel {
  padding: 14px;
}

.team-schedule-panel .label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.round-detail-top {
  align-items: center;
  margin-bottom: 12px;
}

.round-detail-top span {
  color: var(--accent-2);
  font-size: 13px;
}

.lineup-team-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.lineup-team-head span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lineup-team-head span:last-child {
  text-align: right;
}

.hero-pick-grid,
.team-schedule-list {
  display: grid;
  gap: 10px;
}

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

.hero-pick-chip {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--input-bg);
  border: 1px solid var(--surface-border);
}

.hero-pick-chip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.hero-pick-chip strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
}

.hero-pick-chip.empty strong {
  color: var(--muted);
  font-weight: 600;
}

.player-cell {
  min-width: 0;
}

.player-cell > div {
  min-width: 0;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 36px 42px minmax(0, 1fr) 70px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel);
}

.leaderboard-row .name {
  font-weight: 700;
}

.leaderboard-row .desc {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.explorer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

input[type="search"] {
  flex: 1 1 260px;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  cursor: pointer;
}

.chip.active {
  background: linear-gradient(135deg, var(--chip-active-start), var(--chip-active-end));
}

.explorer {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

.team-card {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 16px;
  transition: border-color 160ms ease, transform 160ms ease;
}

.team-card:hover,
.team-card.active {
  transform: translateY(-1px);
  border-color: var(--active-border);
}

.team-card .topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.team-card .topline strong {
  font-size: 18px;
}

.team-card .subline,
.detail-subline {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.team-card .tag-row,
.detail-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.team-detail {
  min-height: 560px;
}

.detail-hero {
  display: grid;
  gap: 14px;
}

.detail-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.detail-title h3 {
  font-size: 34px;
}

.team-title-wrap {
  min-width: 0;
}

.summary-box,
.detail-grid > article,
.roster-table,
.hero-grid .hero-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.summary-box {
  padding: 18px;
  color: var(--detail-summary-text);
  line-height: 1.75;
}

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

.detail-grid article {
  padding: 16px;
}

.detail-grid .value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 800;
}

.detail-grid .value.with-avatar {
  font-size: 22px;
}

.section-title {
  margin: 18px 0 12px;
  font-size: 16px;
}

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

.slot-card,
.hero-card {
  padding: 14px;
}

.slot-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.slot-card strong {
  display: block;
  margin-bottom: 10px;
}

.slot-card span,
.hero-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.roster-table {
  overflow-x: auto;
}

.schedule-mini-card {
  padding: 12px;
}

.schedule-mini-top {
  align-items: center;
  font-size: 13px;
}

.schedule-mini-top span {
  color: var(--muted);
}

.schedule-mini-main {
  align-items: center;
  margin-top: 10px;
  font-size: 14px;
}

.schedule-mini-main strong {
  font-size: 20px;
  letter-spacing: -0.04em;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.text-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.article-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 280px) max-content max-content 1fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

pre {
  min-height: 320px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--pre-bg);
  color: var(--pre-text);
  white-space: pre-wrap;
  word-break: break-word;
  font: 13px/1.7 var(--mono);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 440px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
}

.match-inspector .empty-state,
.team-schedule-list .empty-state {
  min-height: 120px;
}

@media (max-width: 1200px) {
  .layout,
  .hero,
  .explorer,
  .text-panels,
  .leaderboards {
    grid-template-columns: 1fr;
  }

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

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

  .stage-summary,
  .insight-card-grid,
  .stage-groups,
  .rank-card-grid,
  .ai-task-grid,
  .ai-config-head,
  .ai-profile-grid,
  .ai-config-grid,
  .detail-grid,
  .position-grid,
  .hero-grid,
  .match-columns,
  .round-detail-grid,
  .team-schedule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 16px 14px 28px;
  }

  .hero,
  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  h1 {
    font-size: 34px;
  }

  .hero-text {
    font-size: 15px;
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .detail-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-title h3 {
    font-size: 28px;
  }

  .match-card-top,
  .match-score-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-grid,
  .stage-summary,
  .insight-card-grid,
  .stage-groups,
  .rank-card-grid,
  .ai-task-grid,
  .ai-config-head,
  .ai-profile-grid,
  .ai-config-grid,
  .detail-grid,
  .position-grid,
  .hero-grid,
  .match-columns,
  .round-detail-grid,
  .team-schedule-grid {
    grid-template-columns: 1fr;
  }

  .team-row {
    grid-template-columns: 44px 1fr;
  }

  .leaderboard-row {
    grid-template-columns: 36px 42px minmax(0, 1fr);
  }

  .leaderboard-row .value-strong {
    grid-column: 2 / 4;
    text-align: left;
  }

  .team-row .bar-track,
  .team-row .value-strong {
    grid-column: 2;
  }

  .provider-pills {
    grid-auto-flow: row;
    grid-auto-columns: unset;
  }

  .ai-profile-actions {
    grid-auto-flow: row;
  }

  .theme-pills {
    grid-template-columns: 1fr;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .inspector-head,
  .inspector-meta,
  .round-detail-top,
  .schedule-mini-top,
  .schedule-mini-main {
    flex-direction: column;
    align-items: flex-start;
  }
}
