:root {
  color-scheme: light;
  --ink: #17201c;
  --muted: #68736f;
  --paper: #fbfaf5;
  --panel: #ffffff;
  --line: #d8ddd5;
  --field: #0d6a4d;
  --field-dark: #094531;
  --gold: #e1a22e;
  --red: #cf3f45;
  --blue: #2769c9;
  --aqua: #2f9f9a;
  --shadow: 0 18px 50px rgba(17, 32, 27, 0.16);
  --radius: 8px;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(13, 106, 77, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(225, 162, 46, 0.08) 1px, transparent 1px),
    var(--paper);
  background-size: 64px 64px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  overflow: hidden;
  color: #f7fff9;
  background:
    radial-gradient(circle at 20% 10%, rgba(225, 162, 46, 0.32), transparent 30%),
    linear-gradient(160deg, var(--field-dark), var(--field) 62%, #19485f);
}

.brand {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: linear-gradient(135deg, #fff7d5, #e8c451);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.brand-mark img {
  width: 44px;
  height: 44px;
  display: block;
}

.brand h1,
.toolbar h2,
.team-intro h3,
.info-panel h3,
.panel-header h3,
.quiz-status h3,
.sources-header h3,
.integration-panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 22px;
  line-height: 1.2;
}

.brand p,
.toolbar p,
.sources-header p {
  margin: 5px 0 0;
}

.brand p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.sidebar-controls {
  display: grid;
  gap: 12px;
}

.field,
.select-wrap {
  display: grid;
  gap: 7px;
}

.field span,
.select-wrap span,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.sidebar .field span {
  color: rgba(255, 255, 255, 0.78);
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus,
select:focus,
button:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(225, 162, 46, 0.22);
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.tab-button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  color: #eefdf6;
  background: rgba(255, 255, 255, 0.12);
}

.tab-button.active {
  color: #10221b;
  background: #fff1bd;
  border-color: #fff1bd;
  font-weight: 800;
}

.team-count {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.team-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.team-list::-webkit-scrollbar {
  width: 8px;
}

.team-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

.team-button {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  padding: 8px;
  color: #f7fff9;
  text-align: left;
  background: rgba(255, 255, 255, 0.1);
}

.team-button.active {
  border-color: #fff1bd;
  background: rgba(255, 241, 189, 0.24);
}

.team-button img,
.identity-card img,
.compare-flag,
.random-flag {
  display: block;
  object-fit: cover;
  background: #f4f4f4;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.team-button img {
  width: 42px;
  height: 30px;
  border-radius: 4px;
}

.team-button strong {
  display: block;
  font-size: 14px;
}

.team-button span {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  margin-top: 2px;
}

.team-button em {
  color: #fff1bd;
  font-style: normal;
  font-weight: 900;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 32px rgba(17, 32, 27, 0.08);
}

.toolbar h2 {
  font-size: 24px;
}

.toolbar-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.select-wrap {
  min-width: 230px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--red), var(--gold));
}

.secondary-button {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.team-spotlight,
.radar-panel,
.info-panel,
.live-header,
.live-panel,
.ranking-header,
.ranking-table-panel,
.group-board-panel,
.compare-card,
.compare-radar,
.comparison-table-wrap,
.random-card,
.quiz-shell,
.sources-header,
.source-card,
.integration-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 36px rgba(17, 32, 27, 0.08);
}

.team-spotlight {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(220px, 36%) 1fr;
  min-height: 300px;
}

.team-spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49%, rgba(255, 255, 255, 0.45) 50%, transparent 51%),
    radial-gradient(circle at 50% 50%, transparent 0 64px, rgba(255, 255, 255, 0.45) 65px 67px, transparent 68px),
    linear-gradient(135deg, rgba(13, 106, 77, 0.1), rgba(39, 105, 201, 0.08));
  pointer-events: none;
}

.flag-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 28px;
  background: linear-gradient(155deg, #11392b, #0d6a4d);
}

.identity-card {
  position: relative;
  display: grid;
  align-content: center;
  gap: 10px;
  margin: 0;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 255, 255, 0.1);
}

.flag-card {
  width: min(220px, 100%);
  border-color: transparent;
  padding: 0;
  background: transparent;
}

.identity-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.identity-card figcaption {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.kit-chip {
  position: absolute;
  left: 18px;
  bottom: 18px;
  max-width: calc(100% - 36px);
  border-radius: 999px;
  padding: 8px 12px;
  color: #10221b;
  background: #fff1bd;
  font-size: 13px;
  font-weight: 800;
}

.team-intro {
  position: relative;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 34px;
}

.team-intro h3 {
  font-size: 38px;
  line-height: 1.12;
}

.nickname {
  margin: 0;
  color: var(--red);
  font-weight: 900;
}

.summary {
  max-width: 760px;
  margin: 0;
  color: #31413b;
  line-height: 1.75;
}

.tag-row,
.star-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.star-badge-card {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  border: 1px solid rgba(13, 106, 77, 0.18);
  border-radius: var(--radius);
  padding: 10px;
  background: #f8faf5;
}

.star-badge-card img {
  display: block;
  width: 70px;
  aspect-ratio: 1;
  border-radius: 8px;
  padding: 7px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.star-badge-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.star-badge-card strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 16px;
}

.star-badge-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.star-badge-card.missing-badge span::after {
  content: " · 暂无缓存";
}

.tag,
.star-pill {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.tag {
  color: #0b4735;
  background: #dff3e8;
}

.star-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  max-width: 100%;
  border: 0;
  color: #653c00;
  background: #fff0c8;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.star-pill span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.star-pill em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 5px;
  color: rgba(101, 60, 0, 0.78);
  background: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-style: normal;
  line-height: 1.2;
}

.star-pill[data-match="candidate"] {
  color: #173a63;
  background: #e7f0fb;
}

.star-pill[data-match="candidate"] em {
  color: rgba(23, 58, 99, 0.78);
}

.star-pill:hover,
.star-pill:focus-visible {
  background: #ffe5a2;
  box-shadow: 0 8px 18px rgba(101, 60, 0, 0.14);
  transform: translateY(-1px);
  outline: none;
}

.star-pill[data-match="candidate"]:hover,
.star-pill[data-match="candidate"]:focus-visible {
  background: #d7e8fb;
}

.radar-panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.panel-header strong {
  color: var(--field);
  font-size: 34px;
}

canvas {
  width: 100%;
  max-width: 100%;
  margin-top: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.info-panel {
  min-height: 180px;
  padding: 18px;
}

.info-panel h3 {
  font-size: 17px;
  margin-bottom: 12px;
}

.info-panel p,
.info-panel li,
.info-panel dd {
  color: #36443f;
  line-height: 1.72;
}

.info-panel ul {
  margin: 0;
  padding-left: 18px;
}

.info-panel dl {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 8px 10px;
  margin: 0;
}

.info-panel dt {
  color: var(--muted);
  font-weight: 800;
}

.info-panel dd {
  margin: 0;
}

.wide-panel {
  grid-column: span 2;
}

.quote-panel {
  border-color: rgba(225, 162, 46, 0.46);
  background: #fff9e8;
}

.quote-panel p {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #2c332f;
}

.player-modal[hidden] {
  display: none;
}

.player-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(9, 24, 19, 0.56);
}

.player-dialog {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
  gap: 18px;
  width: min(860px, 100%);
  max-height: calc(100vh - 44px);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--radius);
  padding: 18px;
  background: #fffdfa;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
  font-size: 22px;
  line-height: 1;
}

.modal-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.player-media {
  display: grid;
  place-items: center;
  min-height: 280px;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #11392b, #0d6a4d);
}

.player-media img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.player-photo-fallback {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  color: #fff1bd;
  background: rgba(255, 255, 255, 0.14);
  font-size: 30px;
  font-weight: 900;
}

.player-content {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 22px 34px 22px 0;
  overflow: auto;
}

.player-content h3 {
  margin: 0;
  font-size: 30px;
}

.player-desc {
  margin: 0;
  color: var(--red);
  font-weight: 900;
}

.player-content p {
  margin: 0;
  color: #36443f;
  line-height: 1.75;
}

.player-candidates {
  display: grid;
  gap: 8px;
}

.candidate-button {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
  background: #fff;
}

.candidate-button:hover,
.candidate-button:focus-visible {
  border-color: var(--gold);
  background: #fff9e8;
  outline: none;
}

.candidate-button strong {
  font-size: 14px;
}

.candidate-button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.link-button.disabled-link {
  opacity: 0.58;
  pointer-events: none;
}

.live-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
  margin-bottom: 16px;
}

.live-header h3,
.live-panel h3 {
  margin: 0;
}

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

.live-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
}

.live-panel {
  min-width: 0;
  padding: 18px;
}

.live-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  color: #0b4735;
  background: #dff3e8;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-badge.loading {
  color: #5b3a00;
  background: #fff1bd;
}

.status-badge.error {
  color: #7a1b21;
  background: #ffe2e5;
}

.live-summary,
.worldcup-rank-card,
.ranking-card,
.sportsdb-card,
.match-list,
.commons-gallery {
  color: #36443f;
}

.worldcup-rank-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.worldcup-rank-card > div {
  border: 1px solid rgba(13, 106, 77, 0.24);
  border-radius: var(--radius);
  padding: 10px;
  background: #eef8f2;
}

.worldcup-rank-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.worldcup-rank-card strong {
  display: block;
  margin-top: 5px;
  color: var(--field);
  font-size: 18px;
}

.live-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stat-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #f8faf5;
}

.stat-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-box strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 22px;
}

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

.match-item {
  display: grid;
  grid-template-columns: minmax(110px, 0.75fr) minmax(0, 1.25fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
}

.match-item.reminder-ready,
.bracket-match.reminder-ready {
  cursor: pointer;
}

.match-item.reminder-ready {
  box-shadow: inset 3px 0 0 rgba(13, 106, 77, 0.28);
}

.match-item.reminder-ready:hover,
.match-item.reminder-ready:focus-visible,
.bracket-match.reminder-ready:hover,
.bracket-match.reminder-ready:focus-visible {
  border-color: rgba(13, 106, 77, 0.55);
  background: #f1fbf5;
  box-shadow: 0 0 0 3px rgba(13, 106, 77, 0.11);
  outline: none;
}

.match-item.reminder-locked,
.bracket-match.reminder-locked {
  cursor: default;
}

.match-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.match-teams {
  font-weight: 900;
}

.match-score {
  min-width: 58px;
  border-radius: 999px;
  padding: 6px 9px;
  text-align: center;
  color: white;
  background: var(--field);
  font-weight: 900;
}

.reminder-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid rgba(13, 106, 77, 0.22);
  border-radius: var(--radius);
  padding: 12px;
  background: #f8faf5;
}

.reminder-panel.picked {
  animation: reminder-picked 1.2s ease;
}

@keyframes reminder-picked {
  0% {
    box-shadow: 0 0 0 0 rgba(225, 162, 46, 0.42);
    border-color: rgba(225, 162, 46, 0.72);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(225, 162, 46, 0);
  }
}

.reminder-header,
.reminder-actions,
.reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reminder-header h4 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 18px;
}

.reminder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.reminder-grid > .field {
  min-width: 0;
}

.reminder-grid > .field:first-child {
  grid-column: 1 / -1;
}

.reminder-grid > .email-field,
.reminder-grid > .recipient-list {
  grid-column: 1 / -1;
}

.email-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.icon-add-button {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid rgba(13, 106, 77, 0.36);
  border-radius: var(--radius);
  color: #fff;
  background: var(--field);
  font-size: 22px;
  font-weight: 900;
}

.icon-add-button:hover,
.icon-add-button:focus-visible {
  background: #075f45;
  outline: none;
}

.recipient-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 30px;
}

.recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid rgba(13, 106, 77, 0.28);
  border-radius: 999px;
  padding: 5px 7px 5px 10px;
  color: var(--field);
  background: #edf8f2;
  font-size: 12px;
  font-weight: 900;
}

.recipient-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipient-chip button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(13, 106, 77, 0.74);
  font-size: 15px;
  line-height: 1;
}

.recipient-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reminder-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

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

.reminder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, 0.32fr) minmax(104px, 0.34fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: #fff;
}

.reminder-row-main {
  min-width: 0;
}

.reminder-row-main strong,
.reminder-row-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reminder-row-main strong {
  color: var(--ink);
  font-size: 13px;
}

.reminder-row-main span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-field {
  display: grid;
  gap: 4px;
}

.mini-field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.mini-field select {
  min-height: 34px;
  padding: 0 8px;
  font-size: 12px;
}

.reminder-service {
  margin: 0;
  border: 1px dashed rgba(13, 106, 77, 0.24);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.reminder-service.ok {
  color: #0b6a4b;
  border-style: solid;
  background: #edf8f2;
}

.icon-text-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 9px;
  color: var(--red);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.icon-text-button:hover,
.icon-text-button:focus-visible {
  border-color: rgba(195, 37, 45, 0.42);
  background: #fff1f2;
  outline: none;
}

.knockout-panel {
  grid-column: 1 / -1;
}

.knockout-bracket {
  display: grid;
  gap: 12px;
  color: #36443f;
}

.knockout-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(13, 106, 77, 0.18);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #f6faf4;
}

.knockout-summary strong {
  color: var(--ink);
  font-size: 18px;
}

.knockout-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.knockout-scroller {
  overflow: auto;
  padding: 2px 2px 12px;
}

.knockout-board {
  display: grid;
  grid-template-columns: repeat(var(--round-count), minmax(220px, 1fr));
  gap: 18px;
  min-width: max(1080px, 100%);
  align-items: start;
}

.bracket-round {
  min-width: 0;
}

.bracket-round h4 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  color: var(--ink);
  background: #f5f7f3;
}

.bracket-match-stack {
  display: grid;
  gap: 10px;
}

.bracket-match {
  position: relative;
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
}

.bracket-match:not(.final-column)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -19px;
  width: 18px;
  border-top: 2px solid rgba(13, 106, 77, 0.22);
}

.bracket-match.selected-match {
  border-color: rgba(225, 162, 46, 0.82);
  box-shadow: 0 0 0 2px rgba(225, 162, 46, 0.16);
}

.bracket-match-meta,
.bracket-ground {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bracket-ground {
  display: block;
  min-height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-team {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(34px, auto);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(216, 221, 213, 0.88);
  border-radius: var(--radius);
  padding: 7px 8px;
  background: #fafbf8;
}

.bracket-team-name {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.bracket-team img {
  width: 28px;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.bracket-seed {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 22px;
  border-radius: 5px;
  color: var(--muted);
  background: #eef1eb;
  font-size: 12px;
  font-weight: 900;
}

.bracket-team strong,
.bracket-team small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-team strong {
  color: var(--ink);
  font-size: 13px;
}

.bracket-team small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.bracket-score {
  display: inline-grid;
  place-items: center;
  justify-self: end;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  color: var(--muted);
  background: #eef1eb;
  font-weight: 900;
  line-height: 1;
}

.bracket-score.has-detail {
  min-width: 44px;
  min-height: 34px;
  border-radius: 999px;
  gap: 2px;
  padding: 4px 6px;
}

.bracket-score-main,
.bracket-score-detail {
  display: block;
}

.bracket-score-detail {
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.bracket-team.winner {
  border-color: rgba(13, 106, 77, 0.48);
  background: #ecf8f1;
}

.bracket-team.winner .bracket-score {
  color: #fff;
  background: var(--field);
}

.bracket-team.eliminated {
  filter: grayscale(1);
  opacity: 0.48;
  background: #f1f2ef;
}

.bracket-team.placeholder {
  border-style: dashed;
  background: #f8faf5;
}

.bracket-team.active {
  border-color: var(--gold);
  background: #fff8df;
}

.standings-table-wrap {
  margin-bottom: 12px;
  overflow-x: auto;
}

.standings-table-wrap h4 {
  margin: 0 0 8px;
}

.standings-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.standings-table th,
.standings-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 9px;
  text-align: left;
  font-size: 13px;
}

.standings-table th {
  color: var(--muted);
  background: #f5f7f3;
  font-weight: 900;
}

.standings-table .active-row {
  background: #fff6dc;
}

.standings-table .active-row td:first-child {
  border-left: 4px solid var(--gold);
}

.ranking-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
  margin-bottom: 16px;
}

.ranking-header h3,
.ranking-table-title h3,
.group-card h4 {
  margin: 0;
}

.ranking-controls {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(180px, 1fr);
  gap: 12px;
  min-width: min(460px, 100%);
}

.podium-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.podium-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 13px;
  align-items: center;
  min-height: 136px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(17, 32, 27, 0.08);
}

.podium-card:first-child {
  margin-top: 24px;
}

.podium-card:nth-child(2) {
  border-color: rgba(225, 162, 46, 0.58);
  background: linear-gradient(135deg, #fff9e8, #fff);
}

.podium-card:nth-child(3) {
  margin-top: 34px;
}

.podium-rank {
  position: absolute;
  right: 14px;
  top: 10px;
  color: rgba(13, 106, 77, 0.12);
  font-size: 58px;
  font-weight: 900;
  line-height: 1;
}

.podium-card img,
.ranking-team img,
.group-row img {
  display: block;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.podium-card img {
  width: 74px;
  aspect-ratio: 4 / 3;
}

.podium-card h4 {
  margin: 0;
  font-size: 22px;
}

.podium-card p {
  margin: 5px 0 0;
  color: #36443f;
  line-height: 1.55;
}

.ranking-table-panel,
.group-board-panel {
  padding: 18px;
  margin-bottom: 16px;
}

.ranking-table-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ranking-table-wrap {
  overflow-x: auto;
}

.ranking-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.ranking-table th,
.ranking-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

.ranking-table th {
  color: var(--muted);
  background: #f5f7f3;
  font-size: 12px;
  font-weight: 900;
}

.ranking-table tbody tr:hover {
  background: #fffdf3;
}

.folded-row td {
  color: var(--muted);
  background: #f8faf5;
  text-align: center;
  font-weight: 800;
}

.inline-action {
  min-height: 28px;
  margin-left: 8px;
  border: 1px solid rgba(13, 106, 77, 0.25);
  border-radius: 999px;
  padding: 0 10px;
  color: #0b4735;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.inline-action:hover {
  border-color: var(--gold);
  background: #fff9e8;
}

.table-action {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
}

.table-action:hover {
  border-color: var(--gold);
  background: #fff9e8;
}

.rank-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #0b4735;
  background: #dff3e8;
  font-weight: 900;
}

.rank-number.top-rank {
  color: #553500;
  background: #fff1bd;
}

.ranking-team {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  min-width: 190px;
}

.ranking-team img {
  width: 48px;
  height: 34px;
}

.ranking-team strong {
  display: block;
}

.ranking-team span,
.form-strip span {
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  max-width: 210px;
  border-radius: 999px;
  padding: 6px 9px;
  color: #0b4735;
  background: #dff3e8;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill.out {
  color: #7a1b21;
  background: #ffe2e5;
}

.status-pill.pending {
  color: #5b3a00;
  background: #fff1bd;
}

.form-strip {
  display: flex;
  gap: 4px;
}

.th-help {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.help-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(13, 106, 77, 0.3);
  border-radius: 50%;
  color: #0b4735;
  background: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: help;
}

.help-tip::after {
  display: none;
  content: "";
}

.floating-help-tip {
  position: fixed;
  z-index: 1000;
  max-width: min(280px, calc(100vw - 24px));
  border: 1px solid rgba(13, 106, 77, 0.22);
  border-radius: var(--radius);
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 14px 32px rgba(17, 32, 27, 0.18);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.55;
  pointer-events: none;
}

.form-badge {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.form-badge.W {
  background: var(--field);
}

.form-badge.D {
  background: var(--gold);
}

.form-badge.L {
  background: var(--red);
}

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

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

.group-card h4 {
  padding: 12px;
  color: var(--ink);
  background: #f5f7f3;
}

.group-row {
  display: grid;
  grid-template-columns: 28px 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 9px 12px;
  color: var(--ink);
  text-align: left;
  background: #fff;
}

.group-row:hover {
  background: #fffdf3;
}

.group-row img {
  width: 34px;
  height: 24px;
}

.group-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-row small {
  color: var(--muted);
  font-weight: 800;
}

.group-row.active {
  background: #fff6dc;
}

.compact-field {
  margin-bottom: 10px;
}

.full-button,
.link-button {
  width: 100%;
}

.link-button {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.sportsdb-card {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

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

.sports-media a {
  display: grid;
  place-items: center;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: #f7f8f4;
}

.sports-media img {
  max-width: 100%;
  max-height: 112px;
  object-fit: contain;
}

.local-badge-media {
  grid-template-columns: minmax(96px, 140px);
}

.local-badge-media a {
  min-height: 118px;
}

.sports-meta {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 6px 10px;
  margin: 0;
}

.sports-meta dt {
  color: var(--muted);
  font-weight: 800;
}

.sports-meta dd {
  margin: 0;
}

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

.commons-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.commons-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #f4f4f4;
}

.commons-body {
  display: grid;
  gap: 6px;
  padding: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.commons-body strong {
  color: var(--ink);
}

.commons-body a {
  color: var(--blue);
  font-weight: 800;
}

.ranking-tools {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.ranking-tools textarea {
  width: 100%;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  color: var(--ink);
  resize: vertical;
}

.ranking-tools input[type="file"] {
  height: auto;
  padding: 9px;
  background: #fff;
}

.ranking-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #f8faf5;
}

.ranking-card strong {
  font-size: 24px;
  color: var(--field);
}

.notice {
  border-left: 4px solid var(--gold);
  padding: 10px 12px;
  background: #fff9e8;
  line-height: 1.65;
}

.compare-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.compare-controls strong {
  display: grid;
  place-items: center;
  min-height: 42px;
  color: var(--red);
  font-size: 24px;
}

.compare-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.2fr) minmax(220px, 0.8fr);
  gap: 16px;
}

.compare-card,
.compare-radar,
.prediction-panel,
.comparison-table-wrap {
  padding: 18px;
}

.compare-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.compare-flag {
  width: 116px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
}

.compare-card h3 {
  margin: 0;
  font-size: 24px;
}

.mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-tags span {
  border-radius: 999px;
  padding: 5px 8px;
  color: #0b4735;
  background: #dff3e8;
  font-size: 12px;
  font-weight: 800;
}

.comparison-table-wrap {
  margin-top: 16px;
}

.prediction-panel {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.prediction-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.prediction-header h3 {
  margin: 0;
}

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

.probability-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.probability-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.probability-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.probability-card strong {
  color: var(--ink);
  font-size: 24px;
}

.probability-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef1ec;
}

.probability-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--field);
}

.probability-card.draw .probability-bar span {
  background: var(--gold);
}

.probability-card.away .probability-bar span {
  background: #2769c9;
}

.prediction-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.prediction-note strong {
  color: var(--ink);
  margin-right: 8px;
}

.compare-api-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

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

.external-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #f8faf5;
}

.external-card.error {
  border-color: rgba(207, 63, 69, 0.28);
  background: #fff3f4;
}

.external-card h4 {
  margin: 8px 0;
}

.external-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius);
}

.comparison-table th,
.comparison-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
}

.comparison-table th {
  color: var(--muted);
  background: #f5f7f3;
}

.comparison-table td:last-child,
.comparison-table th:last-child {
  text-align: right;
}

.verdict {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 4px solid var(--gold);
  background: #fff9e8;
  line-height: 1.7;
}

.random-stage {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: calc(100vh - 180px);
}

.random-card {
  width: min(720px, 100%);
  overflow: hidden;
}

.random-hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
  padding: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--field-dark), var(--field), #235a87);
}

.random-flag {
  width: 180px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
}

.random-hero h3 {
  margin: 0;
  font-size: 34px;
}

.random-body {
  padding: 22px;
}

.random-body p {
  line-height: 1.72;
}

.random-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quiz-shell {
  max-width: 820px;
  margin: 0 auto;
  padding: 22px;
}

.quiz-status {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.quiz-status strong {
  color: var(--field);
  font-size: 28px;
}

.quiz-question {
  margin: 26px 0 16px;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.45;
}

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

.quiz-option {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  text-align: left;
  color: var(--ink);
  background: #fff;
}

.quiz-option.correct {
  border-color: #1c8a5e;
  background: #dff3e8;
}

.quiz-option.wrong {
  border-color: var(--red);
  background: #ffe6e8;
}

.quiz-feedback {
  min-height: 36px;
  margin: 14px 0;
  color: #31413b;
  font-weight: 800;
}

.sources-header {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 1.1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
  margin-bottom: 16px;
}

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

.source-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.source-card h4 {
  margin: 0;
  font-size: 18px;
}

.source-card p {
  margin: 0;
  color: #36443f;
  line-height: 1.62;
}

.source-card a {
  color: var(--blue);
  overflow-wrap: anywhere;
  font-weight: 800;
}

.source-badge {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 8px;
  color: #10221b;
  background: #fff1bd;
  font-size: 12px;
  font-weight: 900;
}

.integration-panel {
  margin-top: 16px;
  padding: 18px;
}

.integration-panel li {
  margin: 8px 0;
  line-height: 1.7;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .team-list {
    max-height: 330px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-layout,
  .compare-layout,
  .live-grid,
  .podium-grid,
  .group-board,
  .source-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .toolbar,
  .toolbar-actions,
  .live-header,
  .ranking-header,
  .team-spotlight,
  .random-hero,
  .sources-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar-actions,
  .random-actions {
    align-items: stretch;
  }

  .select-wrap {
    min-width: 0;
  }

  .ranking-controls {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .team-intro {
    padding: 22px;
  }

  .team-intro h3 {
    font-size: 30px;
  }

  .flag-stage,
  .player-dialog {
    grid-template-columns: 1fr;
  }

  .player-content {
    padding: 0;
  }

  .detail-grid,
  .team-list,
  .live-summary,
  .worldcup-rank-card,
  .match-item,
  .reminder-grid,
  .reminder-row,
  .probability-grid,
  .compare-api-controls,
  .external-comparison,
  .sports-media,
  .commons-gallery,
  .quiz-options,
  .compare-controls {
    grid-template-columns: 1fr;
  }

  .wide-panel {
    grid-column: span 1;
  }

  .compare-controls strong {
    min-height: 26px;
  }

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