.matches-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 55% 32% at 50% -6%, rgba(233, 194, 100, 0.1), transparent 72%),
    var(--bg);
}

.matches-wrap {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.matches-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(18px);
}

.matches-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 20px;
}

.matches-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.matches-brand-mark {
  display: block;
  width: 31px;
}

.matches-brand-mark svg {
  width: 100%;
  height: auto;
}

.matches-brand-type {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.matches-brand-type strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.07em;
}

.matches-brand-type sup {
  color: var(--gold);
  font-size: 0.5em;
  vertical-align: super;
}

.matches-brand-type small {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.matches-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
  margin-right: 23px;
}

.matches-nav a {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.matches-nav a:hover,
.matches-nav a.is-active {
  color: var(--ink);
}

.matches-nav a.is-active {
  position: relative;
}

.matches-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  transform: translateX(-50%);
}

.matches-header-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.matches-account-link {
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 8px;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.matches-account-link:hover,
.matches-account-link.has-user,
.matches-account-link.is-admin {
  border-color: rgba(233, 194, 100, 0.5);
  background: rgba(233, 194, 100, 0.06);
  color: var(--gold);
}

.official-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #62d49a;
  box-shadow: 0 0 0 4px rgba(98, 212, 154, 0.1);
}

.matches-main {
  padding: 74px 0 52px;
}

.matches-heading {
  margin-bottom: 41px;
}

.matches-eyebrow {
  color: var(--gold);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.matches-heading h1 {
  margin: 14px 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(56px, 8vw, 92px);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.085em;
}

.matches-heading h1 span {
  color: var(--gold);
}

.matches-intro {
  max-width: 480px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.matches-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.matches-dates {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.matches-dates::-webkit-scrollbar {
  display: none;
}

.matches-date {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font: inherit;
  transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.matches-date:hover {
  border-color: rgba(233, 194, 100, 0.45);
  color: var(--ink);
}

.matches-date.is-active {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--bg);
}

.matches-date span {
  font-size: 10px;
  font-weight: 600;
}

.matches-date small {
  color: var(--muted-2);
  font-size: 8px;
}

.matches-date.is-active small {
  color: rgba(7, 11, 20, 0.6);
}

.matches-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.matches-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid rgba(98, 212, 154, 0.25);
  border-radius: 999px;
  color: #86dba9;
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.matches-source i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #62d49a;
}

.matches-source.is-stale {
  border-color: rgba(233, 194, 100, 0.25);
  color: var(--gold);
}

.matches-source.is-stale i {
  background: var(--gold);
}

.matches-refresh {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 8px;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.matches-refresh:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.matches-refresh:disabled {
  opacity: 0.45;
  cursor: wait;
}

.matches-refresh svg {
  width: 11px;
  height: 11px;
}

.matches-bar {
  display: flex;
  align-items: center;
  gap: 25px;
  min-height: 48px;
  margin-bottom: 13px;
  padding: 0 13px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.matches-bar > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.matches-bar strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.matches-bar span,
.matches-bar p {
  color: var(--muted-2);
  font-size: 8px;
}

.matches-bar p {
  margin: 0 0 0 auto;
}

.matches-board {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(12, 20, 33, 0.72);
}

.matches-board[hidden],
.matches-empty[hidden] {
  display: none;
}

.match-row {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  padding: 13px 17px;
  border-bottom: 1px solid rgba(242, 238, 228, 0.075);
}

.match-row:last-child {
  border-bottom: 0;
}

.match-row:hover {
  background: rgba(255, 255, 255, 0.022);
}

.match-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.match-no {
  color: var(--gold);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.match-league {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-time {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.match-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 35px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.match-team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

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

.match-team.away {
  justify-content: flex-start;
}

.match-team strong {
  overflow: hidden;
  color: #e4e6e8;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-code {
  display: grid;
  place-items: center;
  width: 27px;
  height: 30px;
  flex: 0 0 auto;
  clip-path: polygon(50% 0, 92% 17%, 92% 70%, 50% 100%, 8% 70%, 8% 17%);
  background: #1a2c43;
  color: #a9c8e8;
  font-size: 6px;
  font-weight: 700;
}

.match-team.home .match-code {
  order: 2;
}

.match-vs {
  color: #617086;
  font-size: 8px;
  font-weight: 700;
  text-align: center;
}

.match-state {
  justify-self: end;
  padding: 5px 7px;
  border: 1px solid rgba(98, 212, 154, 0.22);
  border-radius: 999px;
  color: #86dba9;
  font-size: 7px;
  white-space: nowrap;
}

.match-state.is-live {
  border-color: rgba(233, 194, 100, 0.28);
  color: var(--gold);
}

.match-state.is-closed {
  border-color: var(--line);
  color: var(--muted-2);
}

.matches-empty {
  padding: 52px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.matches-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.matches-empty p {
  margin: 7px 0 0;
  color: var(--muted-2);
  font-size: 9px;
}

.matches-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 13px;
  color: var(--muted-2);
  font-size: 7px;
}

.matches-footer b {
  color: var(--muted);
  font-weight: 500;
}

@media (max-width: 760px) {
  .matches-wrap {
    width: calc(100% - 30px);
  }

  .matches-header-inner {
    flex-wrap: wrap;
    min-height: 0;
    padding: 13px 0 10px;
    gap: 10px;
  }

  .matches-header-tools {
    margin-left: auto;
  }

  .matches-nav {
    order: 3;
    flex: 0 0 100%;
    gap: 18px;
    margin: 0;
    padding-top: 9px;
    border-top: 1px solid var(--line);
  }

  .matches-nav a {
    font-size: 9px;
  }

  .matches-nav a.is-active::after {
    bottom: -6px;
  }

  .matches-account-link {
    min-height: 28px;
    padding: 0 8px;
    font-size: 7px;
  }

  .matches-main {
    padding-top: 48px;
  }

  .matches-heading {
    margin-bottom: 30px;
  }

  .matches-heading h1 {
    font-size: clamp(48px, 15vw, 70px);
  }

  .matches-intro {
    margin-top: 15px;
    font-size: 10px;
  }

  .matches-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .matches-dates {
    width: 100%;
  }

  .matches-actions {
    width: 100%;
    justify-content: space-between;
  }

  .matches-bar {
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 9px 12px;
  }

  .matches-bar p {
    flex: 0 0 100%;
    margin-left: 0;
  }

  .match-row {
    grid-template-columns: 1fr auto;
    gap: 9px 12px;
    padding: 13px;
  }

  .match-meta {
    grid-column: 1;
  }

  .match-teams {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  }

  .match-team strong {
    font-size: 13px;
  }

  .match-state {
    grid-column: 2;
    grid-row: 1;
  }

  .matches-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

/* Compact theme toggle in the matches header */
.matches-header .theme-toggle {
  width: 31px;
  height: 31px;
}

.matches-header .theme-toggle .theme-icon {
  width: 14px;
  height: 14px;
}

@media (max-width: 760px) {
  .matches-header .theme-toggle {
    width: 28px;
    height: 28px;
  }
}

/* Match page light theme */
html[data-theme="light"] {
  --bg: #f2ecdf;
  --bg-deep: #e9dfcf;
  --surface: #fffaf2;
  --surface-2: #f7f0e4;
  --surface-3: #eee4d4;
  --ink: #0b1526;
  --muted: #586476;
  --muted-2: #778194;
  --line: rgba(11, 21, 38, 0.14);
  --line-strong: rgba(11, 21, 38, 0.22);
  --gold: #8a6114;
  --gold-deep: #6f4d0e;
  --gold-soft: #b6872c;
  --gold-ink: #f8f1e4;
}

html[data-theme="light"] .matches-header {
  background: rgba(242, 236, 223, 0.9);
  border-bottom-color: var(--line);
}

html[data-theme="light"] .matches-date {
  background: rgba(255, 255, 255, 0.42);
}

html[data-theme="light"] .matches-date.is-active {
  color: #0b1526;
}

html[data-theme="light"] .matches-date.is-active small {
  color: rgba(11, 21, 38, 0.68);
}

html[data-theme="light"] .matches-board {
  background: rgba(255, 252, 246, 0.72);
}

html[data-theme="light"] .match-row {
  border-bottom-color: rgba(11, 21, 38, 0.09);
}

html[data-theme="light"] .match-row:hover {
  background: rgba(11, 21, 38, 0.035);
}

html[data-theme="light"] .match-team strong {
  color: #0b1526;
}

html[data-theme="light"] .match-code {
  background: #e7eef7;
  color: #31557a;
}

html[data-theme="light"] .match-vs {
  color: #8a94a3;
}

html[data-theme="light"] .match-state {
  border-color: rgba(42, 125, 80, 0.24);
  color: #27734c;
}

html[data-theme="light"] .match-state.is-live {
  border-color: rgba(138, 97, 20, 0.35);
  color: var(--gold);
}

html[data-theme="light"] .match-state.is-closed {
  color: var(--muted-2);
}

html[data-theme="light"] .matches-empty {
  background: rgba(255, 255, 255, 0.42);
}

html[data-theme="light"] .matches-footer b {
  color: var(--muted);
}

html[data-theme="light"] .matches-source {
  border-color: rgba(42, 125, 80, 0.28);
  color: #27734c;
}

html[data-theme="light"] .matches-source i {
  background: #2f8d5e;
}

html[data-theme="light"] .matches-source.is-stale {
  border-color: rgba(138, 97, 20, 0.3);
  color: var(--gold);
}

html[data-theme="light"] .matches-source.is-stale i {
  background: var(--gold);
}

/* Clickable match analysis */
.match-row {
  cursor: pointer;
}

.match-row:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.analysis-dialog {
  width: min(650px, calc(100% - 34px));
  max-height: 88vh;
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(233, 194, 100, 0.24);
  border-radius: 20px;
  background: #08111e;
  color: var(--ink);
  box-shadow: 0 46px 120px rgba(0, 0, 0, 0.66);
}

.analysis-dialog::backdrop {
  background: rgba(2, 6, 13, 0.76);
  backdrop-filter: blur(5px);
}

.analysis-close {
  z-index: 3;
}

.analysis-head {
  padding: 28px 30px 18px;
  border-bottom: 1px solid var(--line);
}

.analysis-kicker {
  color: var(--gold);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.analysis-head h2 {
  margin: 9px 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(25px, 4vw, 35px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.analysis-head p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
}

.analysis-body {
  padding: 20px 30px 25px;
}

.analysis-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.analysis-label em {
  padding: 3px 7px;
  border: 1px solid rgba(233, 194, 100, 0.3);
  border-radius: 999px;
  color: var(--gold);
  font-size: 7px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.analysis-content {
  max-height: 52vh;
  overflow-y: auto;
  margin-top: 13px;
  color: #d9dde2;
  font-size: 11px;
  line-height: 1.95;
  white-space: pre-line;
}

.analysis-content p {
  margin: 0 0 13px;
}

.analysis-content p:last-child {
  margin-bottom: 0;
}

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

.analysis-disclaimer {
  margin: 18px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 7px;
  line-height: 1.7;
}

html[data-theme="light"] .analysis-dialog {
  border-color: var(--page-line);
  background: #fbf8f1;
  color: var(--page-ink);
}

html[data-theme="light"] .analysis-head {
  border-bottom-color: var(--page-line);
}

html[data-theme="light"] .analysis-head h2,
html[data-theme="light"] .analysis-label {
  color: var(--page-ink);
}

html[data-theme="light"] .analysis-kicker,
html[data-theme="light"] .analysis-label em {
  color: var(--page-gold);
}

html[data-theme="light"] .analysis-head p,
html[data-theme="light"] .analysis-content {
  color: var(--page-muted);
}

html[data-theme="light"] .analysis-label em {
  border-color: rgba(138, 97, 20, 0.3);
}

html[data-theme="light"] .analysis-disclaimer {
  border-top-color: var(--page-line);
  color: var(--page-muted-2);
}

@media (max-width: 760px) {
  .analysis-dialog {
    width: calc(100% - 22px);
    max-height: 90vh;
  }

  .analysis-head {
    padding: 24px 19px 15px;
  }

  .analysis-body {
    padding: 17px 19px 20px;
  }

  .analysis-content {
    max-height: 48vh;
    font-size: 10px;
  }
}

.analysis-simulated-notice {
  margin: 16px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(233, 194, 100, 0.26);
  border-radius: 6px;
  background: rgba(233, 194, 100, 0.07);
  color: var(--gold);
  font-size: 8px;
  line-height: 1.65;
}

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

.analysis-card {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.analysis-card.is-wide {
  grid-column: 1 / -1;
}

.analysis-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 8px;
}

.analysis-card-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
}

.analysis-card-head em {
  padding: 2px 6px;
  border: 1px solid rgba(233, 194, 100, 0.25);
  border-radius: 999px;
  color: var(--gold);
  font-size: 6px;
  font-style: normal;
  white-space: nowrap;
}

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

.analysis-pair small,
.analysis-stat small {
  display: block;
  color: var(--muted-2);
  font-size: 7px;
}

.analysis-pair p,
.analysis-stat p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
  word-break: break-word;
}

.analysis-stat + .analysis-stat {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

html[data-theme="light"] .analysis-simulated-notice {
  border-color: rgba(138, 97, 20, 0.25);
  background: rgba(138, 97, 20, 0.07);
  color: var(--page-gold);
}

html[data-theme="light"] .analysis-card {
  border-color: var(--page-line);
  background: rgba(255, 255, 255, 0.46);
}

html[data-theme="light"] .analysis-card-head h3 {
  color: var(--page-ink);
}

html[data-theme="light"] .analysis-card-head em {
  border-color: rgba(138, 97, 20, 0.26);
  color: var(--page-gold);
}

html[data-theme="light"] .analysis-pair small,
html[data-theme="light"] .analysis-stat small {
  color: var(--page-muted-2);
}

html[data-theme="light"] .analysis-pair p,
html[data-theme="light"] .analysis-stat p {
  color: var(--page-muted);
}

html[data-theme="light"] .analysis-stat + .analysis-stat {
  border-top-color: var(--page-line);
}

@media (max-width: 760px) {
  .analysis-extra {
    grid-template-columns: 1fr;
  }

  .analysis-card.is-wide {
    grid-column: auto;
  }

  .analysis-pair {
    gap: 9px;
  }
}

/* AI simulated data as visual cards */
.lineup-viz,
.form-viz,
.rank-viz {
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.lineup-formation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.lineup-formation strong {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.03em;
}

.lineup-formation span {
  color: var(--muted-2);
  font-size: 6px;
}

.lineup-pitch {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 174px;
  padding: 12px 7px;
  border: 1px solid rgba(98, 212, 154, 0.18);
  border-radius: 7px;
  background:
    linear-gradient(90deg, transparent 49.6%, rgba(255, 255, 255, 0.09) 49.6%, rgba(255, 255, 255, 0.09) 50.4%, transparent 50.4%),
    repeating-linear-gradient(0deg, rgba(98, 212, 154, 0.035) 0 38px, rgba(98, 212, 154, 0.075) 38px 39px),
    linear-gradient(180deg, rgba(34, 95, 66, 0.34), rgba(10, 35, 26, 0.38));
}

.lineup-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
}

.lineup-row.is-goalkeeper {
  margin-top: auto;
}

.lineup-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 30px;
  color: var(--muted);
}

.lineup-dot i {
  display: block;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(233, 194, 100, 0.6);
  border-radius: 50%;
  background: rgba(233, 194, 100, 0.15);
  box-shadow: 0 0 0 3px rgba(233, 194, 100, 0.05);
}

.lineup-dot small {
  overflow: hidden;
  width: 100%;
  color: #bdc7c2;
  font-size: 6px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  text-overflow: clip;
}

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

.form-badge {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 8px;
  font-weight: 700;
}

.form-badge.is-win {
  border-color: rgba(98, 212, 154, 0.3);
  background: rgba(98, 212, 154, 0.14);
  color: #86dba9;
}

.form-badge.is-draw {
  border-color: rgba(233, 194, 100, 0.28);
  background: rgba(233, 194, 100, 0.12);
  color: var(--gold);
}

.form-badge.is-loss {
  border-color: rgba(255, 111, 106, 0.28);
  background: rgba(255, 111, 106, 0.1);
  color: var(--red);
}

.rank-main {
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: var(--gold);
}

.rank-main strong {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.rank-main span {
  font-size: 9px;
}

.rank-caption {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 7px;
}

html[data-theme="light"] .lineup-pitch {
  border-color: rgba(42, 125, 80, 0.2);
  background:
    linear-gradient(90deg, transparent 49.6%, rgba(11, 21, 38, 0.1) 49.6%, rgba(11, 21, 38, 0.1) 50.4%, transparent 50.4%),
    repeating-linear-gradient(0deg, rgba(42, 125, 80, 0.035) 0 38px, rgba(42, 125, 80, 0.08) 38px 39px),
    linear-gradient(180deg, rgba(220, 239, 224, 0.65), rgba(238, 246, 236, 0.75));
}

html[data-theme="light"] .lineup-dot small {
  color: #365047;
}

html[data-theme="light"] .lineup-formation strong {
  color: var(--page-gold);
}

html[data-theme="light"] .form-badge.is-win {
  color: #27734c;
}

html[data-theme="light"] .form-badge.is-draw {
  color: var(--page-gold);
}

html[data-theme="light"] .form-badge.is-loss {
  color: #b64d49;
}

html[data-theme="light"] .rank-main {
  color: var(--page-gold);
}

html[data-theme="light"] .rank-caption {
  color: var(--page-muted);
}

@media (max-width: 760px) {
  .lineup-pitch {
    min-height: 154px;
    gap: 5px;
  }

  .lineup-row {
    gap: 2px;
  }

  .lineup-dot {
    width: 27px;
  }

  .lineup-dot i {
    width: 16px;
    height: 16px;
  }

  .lineup-dot small {
    font-size: 5px;
  }

  .form-badge {
    width: 23px;
    height: 23px;
  }
}

/* Player names, benches and zoomable lineup */
.lineup-formation > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lineup-zoom-button {
  padding: 3px 6px;
  border: 1px solid rgba(233, 194, 100, 0.26);
  border-radius: 4px;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-size: 6px;
  white-space: nowrap;
}

.lineup-zoom-button:hover {
  background: rgba(233, 194, 100, 0.1);
}

.lineup-pitch {
  min-height: 208px;
  gap: 5px;
}

.lineup-row {
  gap: 3px;
}

.lineup-dot {
  width: 38px;
  gap: 2px;
}

.lineup-dot i {
  width: 16px;
  height: 16px;
}

.lineup-dot strong {
  overflow: hidden;
  width: 100%;
  color: var(--ink);
  font-size: 6.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  text-overflow: clip;
}

.lineup-dot small {
  color: #93a49b;
  font-size: 5.5px;
}

.lineup-subs {
  display: flex;
  gap: 5px;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 6.5px;
  line-height: 1.55;
}

.lineup-subs strong {
  flex: 0 0 auto;
  color: var(--gold);
  font-weight: 600;
}

.lineup-subs em {
  color: var(--muted-2);
  font-style: normal;
}

.analysis-empty {
  margin: 4px 0;
  color: var(--muted-2);
  font-size: 8px;
}

.lineup-zoom-dialog {
  width: min(850px, calc(100% - 34px));
  max-height: 92vh;
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(233, 194, 100, 0.24);
  border-radius: 20px;
  background: #08111e;
  color: var(--ink);
  box-shadow: 0 46px 120px rgba(0, 0, 0, 0.66);
}

.lineup-zoom-dialog::backdrop {
  background: rgba(2, 6, 13, 0.8);
  backdrop-filter: blur(5px);
}

.lineup-zoom-head {
  padding: 26px 30px 16px;
  border-bottom: 1px solid var(--line);
}

.lineup-zoom-head h2 {
  margin: 8px 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(23px, 3.5vw, 32px);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.lineup-zoom-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 8px;
}

.lineup-zoom-content {
  padding: 20px 30px 26px;
}

.lineup-zoom-content .lineup-pitch {
  min-height: 410px;
  gap: 15px;
  padding: 22px 18px;
  border-color: rgba(98, 212, 154, 0.28);
}

.lineup-zoom-content .lineup-row {
  gap: 22px;
}

.lineup-zoom-content .lineup-dot {
  width: 68px;
  gap: 4px;
}

.lineup-zoom-content .lineup-dot i {
  width: 30px;
  height: 30px;
  border-width: 2px;
}

.lineup-zoom-content .lineup-dot strong {
  font-size: 10px;
}

.lineup-zoom-content .lineup-dot small {
  font-size: 8px;
}

.lineup-zoom-content .lineup-subs {
  margin-top: 13px;
  font-size: 9px;
  line-height: 1.8;
}

html[data-theme="light"] .lineup-zoom-dialog {
  border-color: var(--page-line);
  background: #fbf8f1;
  color: var(--page-ink);
}

html[data-theme="light"] .lineup-zoom-head {
  border-bottom-color: var(--page-line);
}

html[data-theme="light"] .lineup-zoom-head h2 {
  color: var(--page-ink);
}

html[data-theme="light"] .lineup-dot strong {
  color: var(--page-ink);
}

html[data-theme="light"] .lineup-dot small {
  color: #577064;
}

html[data-theme="light"] .lineup-zoom-button {
  border-color: rgba(138, 97, 20, 0.26);
  color: var(--page-gold);
}

html[data-theme="light"] .lineup-subs,
html[data-theme="light"] .lineup-subs em,
html[data-theme="light"] .analysis-empty {
  color: var(--page-muted);
}

html[data-theme="light"] .lineup-subs strong {
  color: var(--page-gold);
}

@media (max-width: 760px) {
  .lineup-pitch {
    min-height: 185px;
    padding: 10px 4px;
  }

  .lineup-dot {
    width: 33px;
  }

  .lineup-dot strong {
    font-size: 5.5px;
  }

  .lineup-dot small {
    font-size: 5px;
  }

  .lineup-zoom-dialog {
    width: calc(100% - 18px);
    max-height: 94vh;
  }

  .lineup-zoom-head {
    padding: 22px 18px 14px;
  }

  .lineup-zoom-content {
    padding: 14px 10px 20px;
  }

  .lineup-zoom-content .lineup-pitch {
    min-height: 330px;
    padding: 17px 8px;
  }

  .lineup-zoom-content .lineup-row {
    gap: 10px;
  }

  .lineup-zoom-content .lineup-dot {
    width: 54px;
  }

  .lineup-zoom-content .lineup-dot i {
    width: 24px;
    height: 24px;
  }

  .lineup-zoom-content .lineup-dot strong {
    font-size: 8px;
  }

  .lineup-zoom-content .lineup-dot small {
    font-size: 6px;
  }
}

.analysis-lineup-source {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 7px;
  line-height: 1.7;
  word-break: break-all;
}

.analysis-lineup-source a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

html[data-theme="light"] .analysis-lineup-source {
  color: var(--page-muted-2);
}

html[data-theme="light"] .analysis-lineup-source a {
  color: var(--page-gold);
}

.lineup-zoom-content .lineup-dot strong {
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

.lineup-avatar {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid hsla(var(--avatar-hue, 42), 55%, 62%, 0.75);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, hsla(var(--avatar-hue, 42), 70%, 76%, 0.5), transparent 35%),
    hsl(var(--avatar-hue, 42), 36%, 27%);
  color: #f1e9d8;
  font-size: 5.5px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.lineup-zoom-content .lineup-avatar {
  width: 30px;
  height: 30px;
  border-width: 2px;
  font-size: 9px;
}

html[data-theme="light"] .lineup-avatar {
  border-color: hsla(var(--avatar-hue, 42), 48%, 40%, 0.55);
  background:
    radial-gradient(circle at 32% 24%, hsla(var(--avatar-hue, 42), 70%, 90%, 0.7), transparent 38%),
    hsl(var(--avatar-hue, 42), 40%, 78%);
  color: #17221c;
  text-shadow: none;
}

@media (max-width: 760px) {
  .lineup-avatar {
    width: 16px;
    height: 16px;
    font-size: 5px;
  }

  .lineup-zoom-content .lineup-avatar {
    width: 24px;
    height: 24px;
    font-size: 7px;
  }
}

.lineup-avatar.has-photo {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.lineup-avatar-initial {
  position: relative;
  z-index: 0;
}

.lineup-avatar.has-photo img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 22%;
}

.matches-sports {
  display: inline-flex;
  gap: 4px;
  margin-top: 17px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
}

.matches-sport {
  height: 31px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 9px;
  font-weight: 600;
}

.matches-sport:hover {
  color: var(--ink);
}

.matches-sport.is-active {
  background: var(--gold);
  color: #07101f;
}

.match-row.is-basketball {
  cursor: default;
}

html[data-theme="light"] .matches-sports {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.4);
}

html[data-theme="light"] .matches-sport {
  color: var(--muted);
}

html[data-theme="light"] .matches-sport.is-active {
  background: var(--gold);
  color: #fffaf2;
}

/* Basketball analysis roster */
.basketball-roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.basketball-player {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.basketball-player .lineup-avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  font-size: 6px;
}

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

.basketball-player strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 7px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.basketball-player small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lineup-zoom-content .basketball-roster {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lineup-zoom-content .basketball-player {
  padding: 10px;
  gap: 9px;
}

.lineup-zoom-content .basketball-player .lineup-avatar {
  width: 36px;
  height: 36px;
  font-size: 10px;
}

.lineup-zoom-content .basketball-player strong {
  font-size: 11px;
}

.lineup-zoom-content .basketball-player small {
  font-size: 8px;
}

html[data-theme="light"] .basketball-player {
  border-color: var(--page-line);
  background: rgba(255, 255, 255, 0.55);
}

html[data-theme="light"] .basketball-player strong {
  color: var(--page-ink);
}

html[data-theme="light"] .basketball-player small {
  color: var(--page-muted-2);
}

@media (max-width: 760px) {
  .basketball-roster {
    grid-template-columns: 1fr;
  }

  .lineup-zoom-content .basketball-roster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

.analysis-card[hidden] {
  display: none !important;
}
