:root {
  color-scheme: dark;
  --bg: #07110d;
  --panel: rgba(16, 31, 24, 0.88);
  --panel-strong: rgba(23, 48, 36, 0.96);
  --line: rgba(190, 241, 205, 0.16);
  --ink: #f3fff5;
  --muted: #9bb6a4;
  --soft: #d8eedf;
  --green: #39d77c;
  --mint: #9affc6;
  --cyan: #52d7ff;
  --gold: #f5c85f;
  --red: #ff647c;
  --blue: #6aa9ff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background:
    radial-gradient(circle at 14% 4%, rgba(57, 215, 124, 0.2), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(82, 215, 255, 0.15), transparent 24rem),
    linear-gradient(145deg, #07110d 0%, #0b1711 48%, #06100b 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(1900px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 44px;
  display: flex;
  flex-direction: column;
}

.topbar {
  order: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 8px 0 12px;
}

.eyebrow,
.panel-label {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 6px;
  font-size: clamp(32px, 3.6vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 19px;
  letter-spacing: 0;
}

.lead {
  max-width: 740px;
  margin-top: 8px;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.4;
}

.source-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.source-card strong,
.source-card span {
  display: block;
}

.source-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.live-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(57, 215, 124, 0.16);
}

.command-strip {
  order: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 22, 16, 0.72);
}

.command-strip button,
.team-button {
  min-height: 32px;
  padding: 0 11px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--green), #1baa61);
  border-radius: 6px;
  font-weight: 800;
}

.command-strip button:nth-child(2) {
  background: linear-gradient(180deg, var(--gold), #bd8a25);
}

.command-strip button:nth-child(n + 3) {
  color: var(--soft);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

#favoriteBtn.active,
#favoriteBtn:hover,
#favoritePathBtn.active,
#favoritePathBtn:hover {
  color: #06100b;
  background: linear-gradient(180deg, #f5c85f, #ff7ccd);
}

.favorite-select {
  min-height: 32px;
  width: min(260px, 100%);
  color: var(--soft);
  border: 1px solid rgba(245, 200, 95, 0.34);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  padding: 0 10px;
  font-weight: 800;
}

.favorite-select.active {
  color: #180f00;
  background: linear-gradient(180deg, #ffe869, #f5c85f);
}

.favorite-status {
  display: none;
  min-height: 32px;
  align-items: center;
  padding: 0 10px;
  color: #180f00;
  border: 1px solid rgba(255, 229, 103, 0.96);
  border-radius: 6px;
  background: linear-gradient(180deg, #ffe869, #f5c85f);
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 0 18px rgba(245, 200, 95, 0.34);
}

.favorite-status.active {
  display: inline-flex;
}

.data-status {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  border: 1px solid rgba(154, 255, 198, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  font-weight: 800;
}

.favorite-route-view {
  order: 3;
  margin-top: 12px;
}

.favorite-route-view[hidden] {
  display: none;
}

body.favorite-route-mode .focus-grid,
body.favorite-route-mode .bracket-section,
body.favorite-route-mode .all-groups-panel,
body.favorite-route-mode .dashboard,
body.favorite-route-mode .qualified-panel {
  display: none;
}

.favorite-route-heading {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 22, 16, 0.78);
  box-shadow: var(--shadow);
}

.favorite-route-heading button {
  min-height: 34px;
  color: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
}

.favorite-route-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.45fr 1.1fr;
  gap: 12px;
  align-items: stretch;
}

.favorite-route-panel,
.favorite-empty {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.favorite-route-summary {
  display: grid;
  gap: 18px;
  align-content: space-between;
  background:
    radial-gradient(circle at 78% 18%, rgba(245, 200, 95, 0.18), transparent 12rem),
    var(--panel-strong);
}

.favorite-route-summary h3 {
  margin: 4px 0;
  color: var(--ink);
  font-size: 34px;
  letter-spacing: 0;
}

.favorite-route-summary span,
.route-panel-head span,
.favorite-empty p,
.favorite-path-empty p {
  color: var(--muted);
  font-size: 13px;
}

.route-rank-card {
  padding: 14px;
  border: 1px solid rgba(245, 200, 95, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(245, 200, 95, 0.14), rgba(255, 255, 255, 0.05));
}

.route-rank-card span,
.route-rank-card small {
  display: block;
}

.route-rank-card strong {
  display: block;
  margin: 4px 0;
  color: var(--gold);
  font-size: 42px;
  line-height: 1;
}

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

.route-panel-head h3 {
  margin: 0;
  color: var(--mint);
  font-size: 18px;
}

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

.favorite-route-match {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) 46px 12px 46px minmax(86px, 1fr) 58px;
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
}

.favorite-route-match.locked {
  background: rgba(57, 215, 124, 0.07);
}

.favorite-route-match input {
  width: 100%;
  height: 32px;
  color: var(--ink);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 16px;
  font-weight: 900;
}

.favorite-route-match input:disabled {
  color: var(--mint);
  opacity: 1;
}

.route-team {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 950;
}

.route-team.away {
  text-align: right;
}

.route-team.favorite-team {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 5px;
}

.route-match-chip {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: right;
}

.favorite-standings {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.favorite-standings th,
.favorite-standings td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: right;
}

.favorite-standings th:nth-child(2),
.favorite-standings td:nth-child(2) {
  text-align: left;
}

.favorite-standings tr.favorite-team {
  color: #180f00;
  background: linear-gradient(180deg, #ffe869, #f5c85f);
}

.favorite-standings tr.favorite-team::before {
  content: none;
}

.favorite-path-panel {
  margin-top: 12px;
}

.favorite-path-map {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.path-anchor,
.path-step,
.favorite-path-empty {
  border: 1px solid rgba(154, 255, 198, 0.18);
  border-radius: 8px;
  background: rgba(4, 12, 20, 0.62);
}

.path-anchor {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
  border-color: rgba(255, 229, 103, 0.8);
  background: linear-gradient(180deg, rgba(245, 200, 95, 0.18), rgba(4, 12, 20, 0.72));
}

.path-anchor span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.path-anchor strong {
  font-size: 28px;
}

.path-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 10px;
}

.path-step {
  position: relative;
  padding: 12px;
  min-height: 142px;
}

.path-step::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  width: 10px;
  height: 2px;
  background: rgba(245, 200, 95, 0.48);
}

.path-step-head,
.path-versus {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.path-step-head span {
  color: var(--gold);
  font-weight: 950;
}

.path-step-head small,
.path-step p {
  color: var(--muted);
  font-size: 11px;
}

.path-versus {
  margin: 18px 0 12px;
}

.path-versus strong {
  min-width: 0;
  flex: 1;
  color: var(--ink);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.path-versus strong:last-child {
  text-align: right;
}

.path-versus span {
  color: var(--mint);
  font-size: 11px;
  font-weight: 950;
}

.path-step.advance {
  border-color: rgba(57, 215, 124, 0.4);
}

.path-step.stopped {
  border-color: rgba(255, 124, 205, 0.5);
  background: rgba(77, 18, 43, 0.36);
}

.path-step.future {
  border-color: rgba(245, 200, 95, 0.32);
}

.favorite-path-empty {
  padding: 16px;
}

.progress-pill {
  margin-left: auto;
  padding: 6px 10px;
  color: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
}

.dashboard {
  order: 6;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 12px;
  margin: 16px 0 0;
}

.summary-panel,
.story-panel,
.rail-panel,
.group-card,
.round-column {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.summary-panel,
.story-panel {
  padding: 12px;
}

.summary-panel h2 {
  margin-top: 5px;
  color: var(--mint);
  font-size: clamp(22px, 2.2vw, 30px);
}

.summary-panel p:not(.panel-label) {
  margin-top: 8px;
  color: var(--soft);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.mini-stats div {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.mini-stats strong,
.mini-stats span {
  display: block;
}

.mini-stats strong {
  font-size: 20px;
}

.mini-stats span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.story-list {
  display: grid;
  gap: 7px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.story-list li {
  padding: 6px 8px;
  color: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  line-height: 1.35;
  font-size: 12px;
}

.main-grid {
  order: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 12px;
  align-items: start;
}

.focus-grid {
  grid-template-columns: minmax(0, 1fr) 330px;
}

.today-section {
  min-width: 0;
}

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

.today-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

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

.today-card-head span {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.today-card-head strong {
  color: var(--muted);
  font-size: 12px;
}

.today-card .match-row {
  grid-template-columns: minmax(74px, 1fr) 54px 14px 54px minmax(74px, 1fr);
  gap: 8px;
  padding: 10px;
}

.today-card .match-row input {
  height: 42px;
  font-size: 22px;
  font-weight: 900;
}

.today-card .team-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
}

.today-card .team-name.away {
  justify-content: flex-end;
}

.today-card .team-name.favorite-team {
  display: inline-flex;
}

.team-flag {
  display: inline-block;
  flex: 0 0 auto;
  width: 26px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  object-fit: cover;
}

.today-card .versus {
  font-size: 18px;
  font-weight: 900;
}

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

.today-rank {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 7px 8px;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  font-weight: 800;
}

.today-rank.safe {
  color: var(--mint);
  border-color: rgba(57, 215, 124, 0.28);
}

.today-rank.third {
  color: var(--gold);
  border-color: rgba(245, 200, 95, 0.28);
}

.today-rank b {
  float: right;
}

.favorite-team {
  position: relative;
  color: #180f00 !important;
  border-color: rgba(255, 229, 103, 0.96) !important;
  background:
    linear-gradient(180deg, #ffe869 0%, #f5c85f 55%, #d7951d 100%) !important;
  text-shadow: none !important;
  box-shadow:
    0 0 0 2px rgba(255, 232, 105, 0.36),
    0 0 24px rgba(245, 200, 95, 0.46) !important;
}

.team-name.favorite-team {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid rgba(255, 229, 103, 0.96);
  border-radius: 5px;
  font-weight: 950;
}

.favorite-team::before {
  content: "★";
  margin-right: 4px;
  color: #6e3300;
  font-weight: 950;
}

.trophy-card strong.favorite-team {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 34px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.section-heading span {
  color: var(--muted);
  font-size: 13px;
}

.bracket-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.bracket-tools button {
  min-width: 34px;
  min-height: 30px;
  color: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
}

.bracket-tools button:hover {
  color: #06100b;
  background: linear-gradient(180deg, var(--gold), #bd8a25);
}

.section-heading.compact {
  align-items: start;
  margin-bottom: 10px;
}

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

.group-card {
  padding: 8px;
}

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.group-head h3 {
  margin: 0;
  font-size: 16px;
}

.group-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

.match-row {
  display: grid;
  grid-template-columns: minmax(42px, 1fr) 32px 8px 32px minmax(42px, 1fr);
  gap: 3px;
  align-items: center;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
}

.match-row.locked {
  background: rgba(57, 215, 124, 0.07);
}

.match-row input {
  width: 100%;
  height: 22px;
  color: var(--ink);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.22);
}

.match-row input:disabled {
  color: var(--mint);
  opacity: 1;
}

.team-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
}

.team-name.away {
  text-align: right;
}

.versus {
  color: var(--muted);
  text-align: center;
}

.lock-chip {
  display: none;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.standings-table {
  width: 100%;
  margin-top: 7px;
  border-collapse: collapse;
  font-size: 11px;
}

.compact-standings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  margin-top: 7px;
}

.standing-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  min-width: 0;
  padding: 3px 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.045);
}

.standing-chip strong,
.standing-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standing-chip strong {
  font-size: 10px;
}

.standing-chip span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.standings-table th,
.standings-table td {
  padding: 4px 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: right;
}

.standings-table th:first-child,
.standings-table td:first-child {
  text-align: left;
}

.rank-badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 17px;
  height: 17px;
  margin-right: 4px;
  border-radius: 999px;
  color: #06100b;
  background: var(--green);
  font-size: 10px;
  font-weight: 900;
}

.rank-badge.third {
  background: var(--gold);
}

.rank-badge.out {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

.side-rail {
  display: grid;
  gap: 10px;
  position: sticky;
  top: 10px;
}

.rail-panel {
  padding: 10px;
}

.qualified-panel {
  display: none;
}

.qualified-list,
.third-ranking {
  display: grid;
  gap: 6px;
}

.qualified-row,
.third-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
}

.qualified-row strong,
.third-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-chip {
  color: #06100b;
  background: var(--mint);
  border-radius: 5px;
  padding: 3px 5px;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.stat-chip {
  display: none;
  color: var(--muted);
  font-size: 12px;
}

.third-row.qualified {
  border-color: rgba(57, 215, 124, 0.34);
}

.third-row.eliminated {
  opacity: 0.55;
}

.third-row.favorite-team {
  grid-template-columns: 46px minmax(0, 1fr);
}

.third-row.favorite-team::before,
.qualified-row.favorite-team::before {
  content: none;
}

.third-row.favorite-team .slot-chip::before,
.qualified-row.favorite-team .slot-chip::before {
  content: "★";
  margin-right: 3px;
}

.third-row.favorite-team strong {
  overflow: visible;
  text-overflow: clip;
}

.bracket-section {
  order: 4;
  margin-top: 16px;
}

.all-groups-panel {
  order: 5;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 22, 16, 0.72);
  box-shadow: var(--shadow);
}

.all-groups-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 900;
}

.all-groups-panel summary::-webkit-details-marker {
  display: none;
}

.all-groups-panel summary small {
  color: var(--muted);
  font-size: 12px;
}

.all-groups-panel[open] {
  padding-bottom: 12px;
}

.all-groups-panel .groups-section {
  padding: 0 12px 4px;
}

.bracket-grid {
  overflow: hidden;
  padding-bottom: 8px;
  border-radius: 8px;
}

.bracket-viewport {
  overflow: hidden;
  min-height: 820px;
  border-radius: 8px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.bracket-viewport.dragging {
  cursor: grabbing;
}

.bracket-canvas {
  width: max-content;
  transform-origin: 0 0;
  will-change: transform;
}

.bracket-canvas button,
.bracket-canvas input,
.bracket-canvas select {
  user-select: auto;
}

.bracket-empty,
.bracket-board {
  min-width: 1120px;
  border: 1px solid rgba(154, 255, 198, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(3, 8, 20, 0.56), rgba(3, 10, 7, 0.82)),
    radial-gradient(circle at 50% 52%, rgba(82, 215, 255, 0.16), transparent 19rem),
    url("./assets/bracket-bg.png") center / cover no-repeat,
    linear-gradient(135deg, rgba(27, 22, 92, 0.48), rgba(7, 17, 13, 0.96) 48%, rgba(31, 14, 77, 0.5));
  box-shadow: var(--shadow), inset 0 0 44px rgba(82, 215, 255, 0.08);
}

.bracket-empty {
  padding: 18px;
}

.bracket-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.bracket-side h3,
.bracket-center h3 {
  margin: 0 0 12px;
  color: var(--mint);
  text-align: center;
}

.bracket-lane {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.86fr;
  gap: 12px;
  min-height: 720px;
}

.bracket-side.right .bracket-lane {
  grid-template-columns: 0.86fr 1fr 1.2fr;
}

.bracket-stage {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 10px;
  position: relative;
}

.bracket-stage::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 24px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(154, 255, 198, 0.28), transparent);
}

.bracket-side.left .bracket-stage::before {
  right: -6px;
}

.bracket-side.right .bracket-stage::before {
  left: -6px;
}

.stage-r16,
.stage-qf {
  padding-block: 40px;
}

.stage-qf {
  padding-block: 128px;
}

.bracket-match {
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(154, 255, 198, 0.16);
  border-radius: 7px;
  background: rgba(4, 12, 20, 0.62);
  box-shadow: inset 0 0 20px rgba(82, 215, 255, 0.06);
}

.bracket-match.favorite-match {
  border-color: rgba(255, 229, 103, 0.96);
  box-shadow:
    0 0 0 2px rgba(255, 232, 105, 0.3),
    0 0 28px rgba(245, 200, 95, 0.36),
    inset 0 0 20px rgba(245, 200, 95, 0.1);
}

.bracket-center {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.final-card,
.trophy-card {
  padding: 12px;
  border: 1px solid rgba(154, 255, 198, 0.16);
  border-radius: 8px;
  background: rgba(4, 12, 20, 0.62);
}

.final-card > span,
.trophy-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 24px;
  font-weight: 900;
}

.trophy-card {
  min-height: 320px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  place-items: center;
  gap: 8px;
  border-color: rgba(245, 200, 95, 0.38);
  background:
    linear-gradient(180deg, rgba(4, 12, 20, 0.4), rgba(4, 12, 20, 0.82)),
    radial-gradient(circle at center 42%, rgba(245, 200, 95, 0.24), transparent 62%),
    rgba(4, 12, 20, 0.68);
}

.trophy-card img {
  width: min(78%, 210px);
  max-height: 230px;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(245, 200, 95, 0.22));
}

.trophy-card strong {
  color: var(--mint);
  font-size: 34px;
  letter-spacing: 0;
  line-height: 1;
}

.match-code {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.team-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  margin-top: 5px;
  padding: 0 10px;
  color: var(--soft);
  text-align: left;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.team-button:hover,
.team-button.selected {
  color: #06100b;
  background: linear-gradient(180deg, var(--green), #19a55d);
}

.team-button.favorite-team,
.standing-chip.favorite-team,
.today-rank.favorite-team,
.qualified-row.favorite-team,
.third-row.favorite-team {
  color: #180f00 !important;
  border-color: rgba(255, 229, 103, 0.96) !important;
  background: linear-gradient(180deg, #ffe869 0%, #f5c85f 55%, #d7951d 100%) !important;
  box-shadow:
    0 0 0 2px rgba(255, 232, 105, 0.36),
    0 0 24px rgba(245, 200, 95, 0.46) !important;
}

.team-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.035);
}

.seed-tag {
  color: inherit;
  opacity: 0.74;
  font-size: 12px;
}

.empty-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.tie-warning {
  display: none;
  margin-top: 10px;
  color: var(--gold);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1280px) {
  .dashboard {
    grid-template-columns: 1fr 1fr;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .focus-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

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

  .favorite-route-layout {
    grid-template-columns: 1fr;
  }

  .path-steps {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    padding-top: 18px;
  }

  .topbar,
  .main-grid,
  .focus-grid,
  .today-matches,
  .mini-stats {
    grid-template-columns: 1fr;
  }

  .groups-grid,
  .side-rail {
    grid-template-columns: 1fr;
  }

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

  .side-rail {
    position: static;
  }

  .source-card {
    min-width: 0;
  }

  .progress-pill {
    margin-left: 0;
  }

  .match-row {
    grid-template-columns: minmax(54px, 1fr) 42px 10px 42px minmax(54px, 1fr);
  }

  .today-card .match-row {
    grid-template-columns: minmax(58px, 1fr) 48px 10px 48px minmax(58px, 1fr);
  }

  .today-card .team-name {
    font-size: 14px;
  }

  .today-ranks {
    grid-template-columns: 1fr;
  }

  .bracket-tools {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .bracket-viewport {
    min-height: 620px;
  }

  .favorite-route-heading,
  .route-panel-head,
  .favorite-path-map {
    grid-template-columns: 1fr;
  }

  .favorite-route-heading,
  .route-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .favorite-route-layout,
  .path-steps {
    grid-template-columns: 1fr;
  }

  .favorite-route-match {
    grid-template-columns: minmax(64px, 1fr) 42px 10px 42px minmax(64px, 1fr);
  }

  .route-match-chip {
    display: none;
  }

  .path-step::before {
    display: none;
  }
}
