:root {
  --bg: #e8eef5;
  --paper: #f8fbff;
  --panel: #eef5fb;
  --panel-strong: #e3edf7;
  --line: #c7d7e7;
  --text: #10243d;
  --muted: #5f7187;
  --navy: #0d1b2f;
  --navy-2: #132a46;
  --blue: #2467c9;
  --blue-soft: #dceaff;
  --green: #0aa779;
  --green-soft: #dff7ee;
  --gold: #bd8a22;
  --gold-soft: #fff1cb;
  --red: #d7354b;
  --shadow: 0 20px 54px rgba(16, 36, 61, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(36, 103, 201, 0.16), transparent 34%),
    linear-gradient(180deg, #dfe8f2 0%, var(--bg) 42%, #f3f6fa 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.agent-shell {
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px;
}

.hero,
.match-panel,
.chat-panel,
.run-panel,
.report-panel,
.library-header,
.team-card,
.schedule-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 540px) auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border-color: rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(13, 27, 47, 0.97), rgba(19, 42, 70, 0.94)),
    var(--navy);
  color: #f7fbff;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.agent-mark {
  width: 64px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: #ffffff;
  color: #ffffff;
  font-size: 0;
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.world-cup-trophy {
  display: block;
  width: 64px;
  height: 78px;
  object-fit: contain;
}

.brand-row p,
.panel-title span,
.report-header span,
.library-header span {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: 32px;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.hero-copy strong,
.hero-copy span {
  display: block;
}

.hero-copy span,
.panel-title p,
.message p,
.result-card p,
.evidence-item p,
.score-card p,
.library-header p,
.team-card small {
  color: var(--muted);
  line-height: 1.7;
}

.hero .hero-copy span {
  color: #c8d7ea;
}

.status-pill {
  padding: 10px 14px;
  border-radius: 999px;
  color: #66f0c7;
  background: rgba(10, 167, 121, 0.14);
  white-space: nowrap;
  font-weight: 800;
}

.main-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.global-disclaimer {
  margin: 14px 0 18px;
  padding: 13px 16px;
  border: 1px solid rgba(215, 53, 75, 0.5);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff0f2, #ffe1e6);
  color: #c5162f;
  font-weight: 900;
  line-height: 1.6;
  box-shadow: 0 12px 28px rgba(215, 53, 75, 0.14);
}

.main-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(248, 251, 255, 0.86);
  color: #50657d;
  font-weight: 800;
}

.main-tab.active {
  border-color: rgba(189, 138, 34, 0.48);
  background: linear-gradient(135deg, #fff7df, #e8f2ff);
  color: #173b70;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.command-grid {
  display: grid;
  grid-template-columns: 350px minmax(420px, 1fr) 330px;
  gap: 18px;
}

.match-panel,
.chat-panel,
.run-panel,
.report-panel,
.library-header,
.home-hero-panel,
.overview-panel {
  padding: 18px;
}

.home-hero-panel,
.overview-panel {
  border: 1px solid rgba(199, 215, 231, 0.86);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.97), rgba(238, 245, 251, 0.94));
  box-shadow: var(--shadow);
}

.home-hero-panel {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 620px);
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
  border-color: rgba(245, 211, 116, 0.28);
  background:
    radial-gradient(circle at 50% 100%, rgba(245, 211, 116, 0.24), transparent 34%),
    linear-gradient(135deg, #0b1729, #132b49 58%, #173f63);
  color: #f7fbff;
}

.home-hero-panel span,
.home-hero-panel p {
  color: #c8d7ea;
}

.home-hero-panel > div > span {
  color: #f2cf70;
  font-weight: 900;
  font-size: 12px;
}

.home-hero-panel h2 {
  margin: 8px 0;
  font-size: 34px;
}

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

.home-stat-grid div {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}

.home-stat-grid strong,
.home-stat-grid span {
  display: block;
}

.home-stat-grid strong {
  color: #f2cf70;
  font-size: 30px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  margin-bottom: 18px;
}

.overview-grid.groups-only {
  grid-template-columns: 1fr;
}

.overview-panel {
  margin-bottom: 18px;
}

.overview-grid .overview-panel {
  margin-bottom: 0;
}

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

.home-group-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
}

.home-group-card h3,
.standing-card h3,
.bracket-column h3 {
  margin: 0 0 10px;
  color: #173b70;
}

.home-team-chip {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  color: #253d58;
  font-weight: 800;
}

.mini-flag {
  display: inline-flex;
  width: 24px;
  height: 18px;
  margin: 0 5px;
  vertical-align: middle;
}

.mini-flag .flag-img,
.mini-flag img {
  width: 24px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
}

.today-match-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.home-match-card {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--text);
  text-align: left;
}

.home-match-card:hover {
  border-color: rgba(189, 138, 34, 0.56);
  background: #fffaf0;
}

.home-match-card.finished,
.match-card.finished,
.schedule-row.finished {
  cursor: default;
  border-color: rgba(86, 105, 128, 0.24);
  background: #eef3f8;
  opacity: 0.92;
}

.home-match-card.finished:hover,
.match-card.finished:hover,
.schedule-row.finished:hover {
  border-color: rgba(86, 105, 128, 0.24);
  background: #eef3f8;
}

.home-match-card span,
.home-match-card small,
.home-match-card em {
  color: var(--muted);
}

.home-match-card em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 13px;
}

.home-match-card strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  font-size: 15px;
}

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

.standing-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
}

.standing-card h3 {
  padding: 12px 12px 0;
}

.standing-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.standing-card th,
.standing-card td {
  padding: 8px 6px;
  border-top: 1px solid #dfebf5;
  text-align: center;
  white-space: nowrap;
}

.standing-card th:first-child,
.standing-card td:first-child {
  text-align: left;
}

.standing-card td:first-child {
  font-weight: 800;
}

.bracket-panel {
  background:
    radial-gradient(circle at 50% 50%, rgba(245, 211, 116, 0.16), transparent 28%),
    linear-gradient(180deg, #f8fbff, #edf4fb);
}

.bracket-title {
  text-align: center;
}

.knockout-map {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(190px, 240px) minmax(560px, 1fr);
  gap: 16px;
  align-items: stretch;
  overflow-x: auto;
  padding: 12px 4px 2px;
}

.desktop-bracket {
  display: contents;
}

.mobile-bracket {
  display: none;
}

.bracket-half {
  display: grid;
  grid-template-columns: 1.45fr 1.1fr 0.95fr 0.9fr;
  gap: 18px;
  position: relative;
  min-width: 560px;
}

.bracket-half > h3 {
  grid-column: 1 / -1;
  margin: 0;
  color: #173b70;
}

.right-half {
  grid-template-columns: 0.9fr 0.95fr 1.1fr 1.45fr;
}

.bracket-round {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.bracket-round header {
  display: grid;
  gap: 2px;
  min-height: 42px;
  margin-bottom: 8px;
  text-align: center;
}

.bracket-round header strong {
  color: #173b70;
}

.bracket-round header span {
  color: var(--muted);
  font-size: 12px;
}

.round-lane {
  display: grid;
  height: 100%;
  gap: 10px;
}

.round-32 .round-lane {
  grid-template-rows: repeat(8, minmax(72px, 1fr));
}

.round-16 .round-lane {
  grid-template-rows: repeat(4, minmax(154px, 1fr));
}

.round-8 .round-lane {
  grid-template-rows: repeat(2, minmax(320px, 1fr));
}

.round-4 .round-lane {
  grid-template-rows: minmax(650px, 1fr);
}

.bracket-match {
  position: relative;
  align-self: center;
  display: grid;
  gap: 4px;
}

.bracket-match::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px;
  height: 1px;
  background: rgba(189, 138, 34, 0.74);
}

.bracket-match.left::after {
  right: -18px;
}

.bracket-match.right::after {
  left: -18px;
}

.winner-node::before {
  content: "";
  position: absolute;
  top: -42px;
  bottom: -42px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(189, 138, 34, 0.72), transparent);
}

.winner-node.left::before {
  left: -9px;
}

.winner-node.right::before {
  right: -9px;
}

.match-tag {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  color: #7b5511;
  background: var(--gold-soft);
  font-size: 10px;
  font-weight: 900;
}

.right .match-tag {
  justify-self: end;
}

.bracket-team {
  display: grid;
  grid-template-columns: minmax(44px, auto) 1fr;
  align-items: center;
  min-height: 30px;
  overflow: hidden;
  border: 1px solid rgba(189, 138, 34, 0.36);
  border-radius: 8px;
  background: linear-gradient(180deg, #16375b, #0d243d);
  color: #f7fbff;
}

.bracket-team span {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 0 8px;
  color: #f2cf70;
  border-right: 1px solid rgba(245, 211, 116, 0.22);
  font-size: 12px;
  font-weight: 900;
}

.bracket-team b {
  min-width: 0;
  padding: 0 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.right .bracket-team {
  grid-template-columns: 1fr minmax(44px, auto);
}

.right .bracket-team span {
  order: 2;
  border-right: 0;
  border-left: 1px solid rgba(245, 211, 116, 0.22);
}

.right .bracket-team b {
  text-align: right;
}

.bracket-final-stage {
  position: relative;
  display: grid;
  gap: 14px;
  place-items: center;
  min-width: 190px;
  padding-top: 80px;
}

.cup-core {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 250px;
  padding: 18px;
  border: 1px solid rgba(245, 211, 116, 0.5);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 38%, rgba(245, 211, 116, 0.24), transparent 36%),
    linear-gradient(180deg, #10243d, #091421);
  color: #f7fbff;
  text-align: center;
}

.final-badge {
  padding: 4px 9px;
  border-radius: 999px;
  color: #7b5511;
  background: #f2cf70;
  font-size: 11px;
  font-weight: 900;
}

.bracket-trophy {
  width: 150px;
  height: 188px;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.42));
  border-radius: 10px;
}

.cup-core strong {
  color: #f2cf70;
  font-size: 28px;
}

.cup-core p {
  margin: 0;
  color: #c8d7ea;
  font-size: 12px;
}

.champion-card {
  width: 100%;
  padding: 13px;
  border: 1px solid rgba(189, 138, 34, 0.48);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff8e3, #edf6ff);
  text-align: center;
}

.champion-card span,
.champion-card b {
  display: block;
}

.champion-card span {
  color: #7b5511;
  font-size: 12px;
  font-weight: 900;
}

.champion-card b {
  margin-top: 4px;
  color: #173b70;
}

.final-line {
  width: 1px;
  height: 46px;
  background: linear-gradient(180deg, transparent, rgba(189, 138, 34, 0.8), transparent);
}

.final-line.top {
  align-self: end;
}

.final-line.bottom {
  align-self: start;
  height: 34px;
}

.round-stack {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.round-stack span {
  padding: 8px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #7b5511;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.match-list {
  display: grid;
  gap: 12px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.match-card {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
}

.match-card.active {
  border-color: rgba(200, 148, 34, 0.85);
  background: var(--gold-soft);
}

.match-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.match-main strong {
  flex: 1;
}

.flag-wrap,
.team-flag,
.inline-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.flag-wrap {
  width: 34px;
  height: 24px;
  flex: 0 0 34px;
}

.inline-flag {
  width: 30px;
  height: 20px;
  margin-right: 7px;
  vertical-align: middle;
}

.flag-img,
.flag-emoji {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(16, 36, 61, 0.12);
}

.flag-emoji {
  display: grid;
  place-items: center;
  background: #f6f9fc;
  font-size: 22px;
  line-height: 1;
}

.flag-placeholder {
  width: 30px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 3px;
  color: var(--muted);
  background: #eef3f7;
  font-size: 12px;
  font-weight: 900;
}

.match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.match-meta b {
  padding: 5px 8px;
  border-radius: 999px;
  color: #405168;
  background: #eef3f7;
  font-size: 12px;
}

.match-result {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #10243d;
  color: #f7d36b;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.pre-match-prediction {
  margin-top: 10px;
  color: #405168;
  font-size: 13px;
  line-height: 1.5;
}

.chat-log {
  min-height: 420px;
  max-height: 620px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fafc;
}

.message {
  max-width: 86%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.message.user {
  margin-left: auto;
  border-color: rgba(35, 103, 209, 0.18);
  background: var(--blue-soft);
}

.message.agent {
  border-color: rgba(22, 167, 122, 0.22);
  background: var(--green-soft);
}

.message.thinking {
  border-color: rgba(200, 148, 34, 0.24);
  background: var(--gold-soft);
}

.message.warning {
  border-color: rgba(216, 58, 82, 0.32);
  background: #fff0f2;
}

.message.warning strong,
.message.warning p {
  color: var(--red);
  font-weight: 900;
}

.message strong {
  color: var(--blue);
}

.message p {
  white-space: pre-wrap;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}

.chat-form input,
.library-header input {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--paper);
  outline: none;
}

.chat-form input:focus,
.library-header input:focus {
  border-color: rgba(35, 103, 209, 0.55);
  box-shadow: 0 0 0 4px rgba(35, 103, 209, 0.08);
}

.chat-form button,
.report-actions button {
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 900;
}

.report-actions button:last-child {
  background: var(--green);
}

.agent-intro-strip {
  margin-bottom: 16px;
  padding: 15px;
  border: 1px solid rgba(189, 138, 34, 0.28);
  border-radius: 12px;
  background:
    radial-gradient(circle at 100% 0%, rgba(245, 211, 116, 0.28), transparent 34%),
    linear-gradient(135deg, #f7fbff, #e8f2ff);
}

.agent-intro-strip span,
.agent-intro-header span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.agent-intro-strip h2 {
  margin: 5px 0 6px;
  font-size: 20px;
}

.agent-intro-strip p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.agent-intro-strip button {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  color: #0d1b2f;
  background: linear-gradient(135deg, #f2cf70, #fff4c8);
  font-weight: 900;
}

.run-status {
  padding: 12px;
  border-radius: 10px;
  color: var(--green);
  background: var(--green-soft);
  font-weight: 800;
}

.progress-track {
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #e4edf6;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 0.3s ease;
}

.agent-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  max-height: 610px;
  overflow: auto;
}

.agent-output {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.agent-output span {
  color: var(--gold);
  font-weight: 900;
}

.agent-output strong {
  display: block;
  margin: 7px 0;
}

.agent-output p {
  margin: 0;
  color: var(--muted);
}

.agent-output.degraded {
  border-color: rgba(200, 148, 34, 0.42);
  background: var(--gold-soft);
}

.access-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 18px;
}

.access-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.access-card > span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.access-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 14px 0;
}

.access-form input {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--paper);
}

.access-form button {
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.access-status-box {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 12px;
  background: var(--panel);
}

.access-status-box p {
  margin: 0;
}

.access-active {
  color: var(--green);
}

.access-inactive {
  color: var(--red);
}

.report-panel {
  margin-top: 18px;
}

.report-header,
.library-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.report-actions {
  display: flex;
  gap: 10px;
}

.report-empty {
  margin-top: 18px;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
  background: var(--panel);
}

.hidden {
  display: none;
}

.report-summary {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(35, 103, 209, 0.16);
  border-radius: 10px;
  background: var(--blue-soft);
}

.report-summary h3 {
  margin-bottom: 8px;
  font-size: 26px;
}

.report-cards,
.score-list,
.evidence-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.evidence-section {
  grid-template-columns: 1fr 1fr;
}

.result-card,
.score-card,
.markdown-section,
.evidence-section > div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.result-card span,
.score-card span {
  color: var(--gold);
  font-weight: 900;
}

.result-card strong,
.score-card strong {
  display: block;
  margin: 8px 0;
  font-size: 24px;
}

.result-card.danger strong {
  color: var(--red);
}

.score-card.danger strong {
  color: var(--red);
}

.score-section,
.markdown-section {
  margin-top: 18px;
}

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

.evidence-item {
  padding: 12px;
  border-radius: 10px;
  background: #f7fafc;
}

.evidence-item span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.markdown-section pre {
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  color: #253950;
  line-height: 1.7;
}

.library-header {
  margin-bottom: 18px;
}

.library-header input {
  width: min(420px, 100%);
}

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

.library-count,
.empty-state {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(35, 103, 209, 0.16);
  border-radius: 10px;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 800;
}

.empty-state {
  grid-column: 1 / -1;
  margin-bottom: 0;
  color: var(--muted);
  background: var(--panel);
}

.team-card {
  padding: 0;
  overflow: hidden;
  border-color: rgba(17, 44, 76, 0.14);
  background: linear-gradient(180deg, #fbfdff 0%, #eef5fb 100%);
}

.team-card summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  list-style: none;
  background: linear-gradient(90deg, rgba(19, 42, 70, 0.08), rgba(255, 255, 255, 0.35));
}

.team-card summary::-webkit-details-marker {
  display: none;
}

.team-flag {
  width: 42px;
  height: 30px;
}

.team-card summary strong {
  display: block;
  font-size: 20px;
}

.team-card summary b {
  padding: 7px 10px;
  border-radius: 999px;
  color: #173b70;
  background: #dfeaff;
  font-size: 13px;
}

.team-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px 14px;
}

.team-metrics span {
  padding: 8px;
  border-radius: 8px;
  background: #e6eef7;
  color: #324a65;
  font-size: 13px;
  text-align: center;
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.player-list {
  grid-template-columns: 1fr;
}

.coach-strip {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 0 16px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, #eef6ff, #fff8e7);
}

.coach-strip b,
.coach-strip span {
  display: block;
}

.coach-strip span,
.squad-note {
  color: var(--muted);
  font-size: 13px;
}

.coach-strip button {
  flex: 0 0 auto;
}

.squad-note {
  padding: 0 16px 10px;
}

.player-card {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
}

.player-row {
  width: 100%;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.player-row:hover {
  border-color: rgba(189, 138, 34, 0.56);
  background: #fffaf0;
}

.player-card img {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  object-fit: cover;
  background: #dfe9f4;
}

.player-card div {
  min-width: 0;
}

.player-row-main {
  flex: 1;
}

.player-card strong,
.player-card span,
.player-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-card span,
.player-card small {
  color: var(--muted);
  font-size: 12px;
}

.player-value-line {
  color: #8a6215 !important;
  font-weight: 800;
}

.player-club-line {
  color: #344f6d !important;
}

.captain-check {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 5px;
  border-radius: 50%;
  color: #fff;
  background: #e03030;
  font-size: 12px;
  font-weight: 900;
}

.captain-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  background: #e03030;
  font-size: 12px;
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(9, 19, 34, 0.64);
}

.profile-modal.open {
  display: grid;
}

.profile-dialog {
  position: relative;
  width: min(820px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  padding: 24px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff, #edf4fb);
  box-shadow: 0 24px 80px rgba(10, 23, 42, 0.28);
}

.agent-intro-dialog {
  width: min(980px, 100%);
}

.agent-intro-header {
  padding-right: 90px;
  margin-bottom: 16px;
}

.agent-intro-header h3 {
  margin: 5px 0 8px;
  font-size: 28px;
}

.agent-intro-header p {
  color: var(--muted);
  line-height: 1.7;
}

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

.agent-role-item {
  padding: 14px;
  border: 1px solid rgba(199, 215, 231, 0.9);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.82);
}

.agent-role-item span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 26px;
  border-radius: 999px;
  color: #173b70;
  background: var(--gold-soft);
  font-weight: 900;
}

.agent-role-item strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 16px;
}

.agent-role-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 8px 12px;
}

.profile-hero {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  align-items: center;
  padding-right: 86px;
}

.profile-hero img,
.coach-avatar {
  width: 112px;
  height: 112px;
  border-radius: 12px;
  object-fit: cover;
  background: #e6eef8;
}

.coach-avatar {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  font-size: 44px;
  font-weight: 900;
}

.profile-hero span,
.profile-hero p {
  color: var(--muted);
}

.profile-hero h3 {
  margin: 5px 0;
  font-size: 28px;
}

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

.profile-grid section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fbff;
}

.profile-grid .wide {
  grid-column: 1 / -1;
}

.profile-grid b {
  display: block;
  margin-bottom: 8px;
}

.profile-grid p {
  margin: 0;
  color: #405168;
  line-height: 1.7;
}

.schedule-table {
  display: grid;
  gap: 10px;
}

.schedule-row {
  display: grid;
  grid-template-columns: 110px 1fr minmax(220px, 320px) 140px minmax(120px, 160px) minmax(160px, 240px);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  color: var(--text);
  text-align: left;
}

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

.muted {
  color: var(--muted);
}

@media (max-width: 1180px) {
  .hero,
  .home-hero-panel,
  .overview-grid,
  .today-match-list,
  .knockout-map,
  .command-grid,
  .access-grid,
  .report-cards,
  .score-list,
  .evidence-section,
  .team-library {
    grid-template-columns: 1fr;
  }

  .schedule-row {
    grid-template-columns: 1fr;
  }

  .profile-grid,
  .agent-role-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .agent-shell {
    padding: 12px;
  }

  .chat-form,
  .access-form,
  .report-header,
  .library-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .player-grid,
  .team-metrics,
  .home-stat-grid,
  .group-board,
  .standings-board,
  .today-match-list,
  .round-stack {
    grid-template-columns: 1fr;
  }

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

  .standing-card table {
    font-size: 11px;
  }

  .chat-log {
    background: #ffffff;
    border-color: #d7dde5;
  }

  .message,
  .message.agent,
  .message.thinking {
    max-width: 100%;
    border-width: 0 0 1px;
    border-color: #d7dde5;
    border-radius: 0;
    background: #ffffff;
    color: #111827;
    box-shadow: none;
  }

  .message.user {
    max-width: 100%;
    margin-left: 0;
    border-width: 0 0 1px;
    border-color: #d7dde5;
    border-radius: 0;
    background: #f6f7f9;
  }

  .message strong {
    color: #111827;
  }

  .message p {
    color: #263241;
  }

  .message.warning {
    border: 1px solid rgba(216, 58, 82, 0.32);
    border-radius: 10px;
    background: #fff0f2;
  }

  .message.warning strong,
  .message.warning p {
    color: var(--red);
  }

  .knockout-map {
    display: block;
    overflow: visible;
    padding: 0;
  }

  .desktop-bracket {
    display: none;
  }

  .mobile-bracket {
    display: grid;
    gap: 14px;
  }

  .mobile-bracket-section,
  .mobile-bracket-final {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
  }

  .mobile-bracket-section header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
  }

  .mobile-bracket-section header strong {
    color: var(--navy);
    font-size: 18px;
  }

  .mobile-bracket-section header span,
  .mobile-bracket-match span,
  .mobile-bracket-match small {
    color: var(--muted);
  }

  .mobile-bracket-list {
    display: grid;
    gap: 8px;
  }

  .mobile-bracket-match {
    padding: 10px 12px;
    border: 1px solid #d7dde5;
    border-left: 4px solid var(--gold);
    border-radius: 8px;
    background: #f8fafc;
  }

  .mobile-bracket-match strong {
    display: block;
    margin: 5px 0;
    color: #111827;
    font-size: 15px;
  }

  .mobile-bracket-match.compact {
    background: #ffffff;
  }

  .mobile-bracket-final {
    text-align: center;
    background: #10243d;
    color: #ffffff;
  }

  .mobile-bracket-final span {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    color: #10243d;
    background: #f2cf70;
    font-weight: 900;
  }

  .mobile-bracket-final img {
    display: block;
    width: 96px;
    max-width: 42vw;
    height: auto;
    margin: 12px auto;
    border-radius: 8px;
  }

  .mobile-bracket-final strong {
    display: block;
    color: #f2cf70;
    font-size: 24px;
  }

  .mobile-bracket-final p {
    margin: 8px 0 0;
    color: #dbe6f2;
  }

  .coach-strip {
    display: grid;
  }

  .profile-hero {
    grid-template-columns: 1fr;
    padding-right: 0;
  }
}
