:root {
  --bg: #050814;
  --bg-2: #08111f;
  --panel: #101a2d;
  --panel-2: #142136;
  --line: #26354f;
  --line-strong: #3c4e70;
  --text: #f8fafc;
  --muted: #a8b5ca;
  --soft: #dbeafe;
  --blue: #3b82f6;
  --blue-2: #1d4ed8;
  --gold: #f59e0b;
  --green: #22c55e;
  --red: #ef4444;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  background:
    radial-gradient(circle at 15% 0%, rgba(37, 99, 235, 0.2), transparent 34rem),
    radial-gradient(circle at 90% 10%, rgba(245, 158, 11, 0.13), transparent 30rem),
    linear-gradient(180deg, #050814, #07101c 46%, #050814);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 8px clamp(14px, 2.4vw, 28px);
  background: rgba(5, 8, 20, 0.9);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  font-weight: 1000;
  background: linear-gradient(135deg, var(--blue), var(--gold));
  box-shadow: 0 0 28px rgba(59, 130, 246, 0.34);
}

.brand strong,
.brand span {
  display: block;
}

.brand span:last-child {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.deadline-timers {
  flex: 1 1 420px;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
  max-width: 520px;
}

.deadline-timer {
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(96, 165, 250, 0.22);
}

.deadline-timer span,
.deadline-timer small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
}

.deadline-timer strong {
  display: block;
  margin: 1px 0;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 16px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.deadline-timer.champion strong {
  color: #fbbf24;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.header-actions button,
.file-button,
.primary-button,
.secondary-button,
.danger-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--soft);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(96, 165, 250, 0.28);
  font-weight: 900;
}

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

.compact-button {
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.danger-button {
  color: #fee2e2;
  border-color: rgba(239, 68, 68, 0.42);
}

.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.app-main {
  width: min(1800px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 12px 0 28px;
}

.hero {
  margin-bottom: 10px;
}

.panel,
.match-card,
.player-card,
.loading-panel {
  background: linear-gradient(180deg, rgba(20, 33, 54, 0.98), rgba(12, 20, 35, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 12px;
}

.panel h1,
.panel h2,
.panel h3 {
  margin: 0;
}

.panel-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-title p {
  margin: 3px 0 0;
  color: var(--muted);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-toggle.active {
  color: #052e16;
  background: linear-gradient(135deg, #34d399, #facc15);
  border-color: rgba(250, 204, 21, 0.72);
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.24);
}

.player-panel {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.system-panel {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(320px, 0.65fr) minmax(360px, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.system-panel h2 {
  margin-top: 2px;
  font-size: 18px;
}

.system-panel .notice {
  margin-top: 0;
}

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

.metric {
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(5, 8, 20, 0.36);
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(18px, 2.2vw, 26px);
}

.player-toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  margin-bottom: 8px;
}

.player-toolbar input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--text);
  background: rgba(5, 8, 20, 0.44);
  border: 1px solid var(--line);
}

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

.player-slot {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(5, 8, 20, 0.34);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.player-slot.active {
  border-color: rgba(96, 165, 250, 0.66);
  background: rgba(37, 99, 235, 0.16);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.14);
}

.player-tab {
  grid-column: 2;
  min-height: 54px;
  padding: 8px 10px;
  border-radius: 0;
  text-align: left;
  color: var(--muted);
  background: transparent;
  border: 0;
}

.player-tab.active {
  color: var(--text);
  background: transparent;
}

.player-tab small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.champion-pick {
  grid-column: 1;
  grid-row: 1;
  min-width: 88px;
  min-height: 54px;
  padding: 6px 9px;
  border-radius: 0;
  color: #fef3c7;
  border: 0;
  border-right: 1px solid rgba(245, 158, 11, 0.22);
  background: rgba(120, 53, 15, 0.14);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  touch-action: manipulation;
  text-align: left;
}

.champion-pick.has-pick {
  color: #fff7ed;
  border-right-color: rgba(245, 158, 11, 0.66);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(59, 130, 246, 0.12));
}

.champion-pick-label {
  display: block;
  margin-bottom: 3px;
  color: rgba(254, 243, 199, 0.74);
  font-size: 9px;
  font-weight: 900;
}

.champion-pick-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.champion-pick-main .flag,
.empty-flag {
  width: 22px;
  height: 22px;
}

.champion-pick-main span:last-child {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.champion-pick-main strong,
.champion-pick-main em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.champion-pick-main em {
  color: #fbbf24;
  font-size: 10px;
  font-style: normal;
}

.empty-flag {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  border: 1px dashed rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.08);
}

.champion-pick small {
  display: block;
  margin-top: 2px;
  color: rgba(254, 243, 199, 0.76);
  font-size: 9px;
  font-weight: 700;
}

.champion-pick.locked {
  cursor: not-allowed;
  opacity: 0.62;
}

.champion-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}

.champion-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(10px);
}

.champion-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(82dvh, 720px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(8, 17, 31, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.champion-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.champion-dialog-head h2 {
  margin: 2px 0 4px;
  font-size: clamp(20px, 3vw, 28px);
}

.champion-dialog-head p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.icon-close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.24);
  font-size: 24px;
  line-height: 1;
}

.champion-grid {
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
  padding: 14px;
}

.champion-team-option {
  min-height: 96px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 12px;
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.62);
  touch-action: manipulation;
}

.champion-team-option:hover,
.champion-team-option:focus-visible {
  border-color: rgba(96, 165, 250, 0.72);
  background: rgba(37, 99, 235, 0.22);
  outline: none;
}

.champion-team-option.selected {
  border-color: rgba(245, 158, 11, 0.86);
  background: rgba(245, 158, 11, 0.18);
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.36);
}

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

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

.champion-team-option span:last-child {
  color: #fbbf24;
  font-size: 11px;
  font-weight: 900;
}

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

.player-card {
  display: grid;
  grid-template-columns: 42px minmax(120px, 1fr) 92px 82px 132px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  box-shadow: none;
}

.rank {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.14);
  font-weight: 1000;
}

.score-big {
  font-size: 24px;
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

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

.score-stat {
  display: grid;
  justify-items: end;
  min-width: 0;
  text-align: right;
}

.score-stat-total {
  min-width: 92px;
}

.score-stat-rate {
  min-width: 82px;
}

.accuracy-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(34px, 1fr));
  gap: 5px;
  min-width: 132px;
}

.accuracy-split span {
  display: grid;
  place-items: center;
  gap: 1px;
  padding: 5px 6px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 7px;
  background: rgba(2, 6, 23, 0.32);
}

.accuracy-split strong {
  color: #f8fafc;
  font-size: 17px;
  line-height: 1;
}

.accuracy-split small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0;
}

.accuracy-split span:nth-child(1) small {
  color: #60a5fa;
}

.accuracy-split span:nth-child(2) small {
  color: #c084fc;
}

.accuracy-split span:nth-child(3) small {
  color: #f59e0b;
}

.round-section {
  margin-top: 16px;
}

.round-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}

.round-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.5), transparent);
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
}

.match-card {
  padding: 12px;
  box-shadow: none;
}

.match-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.24);
  font-size: 12px;
  font-weight: 900;
}

.badge.live {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.34);
}

.badge.done {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.34);
}

.teams,
.score-board {
  display: grid;
  gap: 8px;
}

.score-board-head,
.score-board-row {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) repeat(var(--score-input-columns), 70px);
  align-items: center;
  gap: 8px;
}

.score-board-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.score-board-head span:first-child {
  text-align: left;
}

.team-pill {
  display: flex;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(5, 8, 20, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.16);
  font-weight: 950;
}

.team-pill.winner {
  border-color: rgba(34, 197, 94, 0.58);
  background: rgba(34, 197, 94, 0.12);
}

.flag {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: #172033;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-input {
  width: 70px;
  min-height: 42px;
  border-radius: 8px;
  color: var(--text);
  text-align: center;
  background: rgba(5, 8, 20, 0.52);
  border: 1px solid var(--line);
  font-weight: 950;
}

.score-input:disabled,
.winner-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.actual-score {
  display: grid;
  width: 70px;
  min-height: 42px;
  place-items: center;
  padding: 4px;
  border-radius: 8px;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.24);
  font-weight: 1000;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}

.winner-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.winner-actions button {
  min-height: 38px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(5, 8, 20, 0.38);
  border: 1px solid rgba(148, 163, 184, 0.16);
  font-weight: 900;
}

.winner-actions button.selected {
  color: white;
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.58);
}

.match-card.locked {
  border-color: rgba(245, 158, 11, 0.32);
}

.locked-badge {
  color: #fed7aa;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.34);
}

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

.comparison div {
  min-height: 44px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(5, 8, 20, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.comparison strong {
  display: block;
}

.notice {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
  font-weight: 800;
}

.error {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.36);
}

.loading-panel {
  padding: 24px;
}

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

  .status-strip,
  .comparison {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .app-header,
  .player-toolbar,
  .player-card {
    grid-template-columns: 1fr;
  }

  .accuracy-split {
    width: 100%;
    min-width: 0;
  }

  .score-stat,
  .score-stat-total,
  .score-stat-rate {
    min-width: 0;
    justify-items: start;
    text-align: left;
  }

  .app-header {
    align-items: stretch;
  }

  .header-actions {
    justify-content: stretch;
  }

  .header-actions button,
  .file-button {
    flex: 1;
    justify-content: center;
  }

  .match-grid,
  .status-strip,
  .comparison {
    grid-template-columns: 1fr;
  }
}

/* 2026-06-29 bracket tracker refresh */
.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.view-tabs {
  position: sticky;
  top: 76px;
  z-index: 8;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 20, 0.86);
  backdrop-filter: blur(16px);
}

.view-tabs button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-weight: 1000;
}

.view-tabs button.active {
  color: #dcfce7;
  border-color: rgba(34, 197, 94, 0.56);
  background: rgba(34, 197, 94, 0.16);
}

.leader-chip {
  justify-self: end;
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(13, 17, 23, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.leader-chip strong {
  color: var(--text);
}

.bracket-panel {
  padding: 14px;
  overflow: hidden;
}

.bracket-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  overscroll-behavior-x: contain;
}

.bracket-scroll::-webkit-scrollbar {
  height: 10px;
}

.bracket-scroll::-webkit-scrollbar-track {
  background: #161b22;
}

.bracket-scroll::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 999px;
}

.bracket-board {
  display: grid;
  min-width: 1540px;
  grid-template-columns: 420px 360px 340px 320px 340px;
  gap: 14px;
  align-items: stretch;
}

.bracket-column {
  display: grid;
  align-content: start;
  gap: 10px;
}

.bracket-column h3 {
  position: sticky;
  top: 132px;
  z-index: 2;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(48, 54, 61, 0.92);
  border-radius: 8px;
  color: #f0b429;
  background: #161b22;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  text-transform: uppercase;
}

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

.bracket-column.r16 .bracket-column-stack {
  padding-top: 50px;
  gap: 72px;
}

.bracket-column.qf .bracket-column-stack {
  padding-top: 132px;
  gap: 226px;
}

.bracket-column.sf .bracket-column-stack {
  padding-top: 300px;
  gap: 530px;
}

.bracket-column.finals .bracket-column-stack {
  padding-top: 350px;
  gap: 32px;
}

.match-card {
  position: relative;
  border-color: #30363d;
  background: #161b22;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.match-card::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -14px;
  width: 14px;
  height: 1px;
  background: rgba(48, 54, 61, 0.9);
}

.bracket-column.finals .match-card::after {
  display: none;
}

.match-top {
  align-items: flex-start;
}

.score-board {
  gap: 6px;
}

.score-board-head,
.score-board-row {
  grid-template-columns: minmax(128px, 1fr) repeat(var(--score-input-columns), 58px);
  gap: 6px;
}

.team-pill {
  min-height: 36px;
  padding: 4px 8px;
  border-color: #30363d;
  background: #0d1117;
}

.flag {
  width: 24px;
  height: 24px;
}

.score-input,
.actual-score {
  width: 58px;
  min-height: 36px;
  border-color: #30363d;
  background: #0d1117;
}

.actual-score {
  color: #f0b429;
}

.winner-actions {
  grid-template-columns: 1fr;
}

.winner-actions button {
  min-height: 34px;
  background: #0d1117;
  border-color: #30363d;
}

.winner-actions button.selected {
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.58);
}

.odds-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.odds-strip span {
  min-height: 24px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #c9d1d9;
  background: rgba(13, 17, 23, 0.78);
  border: 1px solid #30363d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

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

.comparison div {
  min-height: 0;
  background: rgba(13, 17, 23, 0.72);
  border-color: #30363d;
}

.score-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 14px;
  margin-bottom: 14px;
}

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

.rules-grid article,
.detail-grid article {
  padding: 12px;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: #0d1117;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 8px;
}

.detail-grid article.score-event {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 7px;
  min-height: 126px;
  aspect-ratio: 1 / 0.82;
  padding: 9px;
}

.score-event > strong {
  justify-self: start;
  color: #f8fafc;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rules-grid h3 {
  margin: 0 0 6px;
  color: #f0b429;
  font-size: 15px;
}

.rules-grid p,
.detail-grid p {
  margin: 0;
  color: var(--muted);
}

.score-parts {
  display: flex;
  flex-wrap: wrap;
  align-content: end;
  justify-content: flex-start;
  gap: 4px;
  margin-top: 0;
}

.score-chip {
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 1000;
  line-height: 1.25;
  border: 1px solid currentColor;
  background: rgba(148, 163, 184, 0.1);
}

.score-chip-winner {
  color: #34d399;
}

.score-chip-regular {
  color: #60a5fa;
}

.score-chip-extra {
  color: #c084fc;
}

.score-chip-penalty {
  color: #f59e0b;
}

.score-chip-champion {
  color: #f472b6;
}

.score-chip-route {
  color: #e5e7eb;
}

.rules-grid code {
  color: #dcfce7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.score-detail {
  border: 1px solid #30363d;
  border-radius: 8px;
  background: #101827;
  overflow: hidden;
}

.score-detail + .score-detail {
  margin-top: 6px;
}

.score-detail summary {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  cursor: default;
  user-select: none;
}

.score-detail summary span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 8px;
  padding: 0 10px 10px;
}

@media (max-width: 1100px) {
  .score-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .view-tabs {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .leader-chip {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: space-between;
  }

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

  .detail-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }

  .detail-grid article.score-event {
    min-height: 118px;
    aspect-ratio: 1 / 0.86;
  }

  .score-event .score-parts {
    justify-content: flex-start;
  }
}

/* compact card pass: three-letter teams, inline odds, direct result coloring */
.bracket-board {
  min-width: 1380px;
  grid-template-columns: 340px 300px 280px 260px 280px;
}

.match-card {
  padding: 10px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.score-board-head,
.score-board-row {
  grid-template-columns: minmax(90px, 1fr) repeat(var(--score-input-columns), 50px);
  gap: 6px;
}

.team-pill {
  min-height: 36px;
  padding: 4px 7px;
}

.team-name {
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 1000;
}

.team-odds {
  margin-left: auto;
  color: #f0b429;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 900;
}

.score-input,
.actual-score {
  width: 50px;
  min-height: 36px;
}

.actual-score {
  color: #f0b429;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.winner-actions {
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.score-input.is-correct,
.actual-score.is-correct,
.winner-actions button.is-correct {
  color: #dcfce7;
  border-color: rgba(34, 197, 94, 0.74);
  background: rgba(34, 197, 94, 0.18);
}

.score-input.is-wrong,
.actual-score.is-wrong,
.winner-actions button.is-wrong {
  color: inherit;
  border-color: inherit;
  background: inherit;
}

.match-points {
  margin-top: 8px;
  color: #dcfce7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 1000;
  text-align: right;
}

@keyframes winner-breathe {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(34, 197, 94, 0);
  }
  50% {
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.72);
  }
}

/* final compact bracket cards */
.bracket-board {
  position: relative;
  min-width: 1240px;
  grid-template-columns: 226px 226px 208px 198px 208px;
  gap: 18px;
  align-items: start;
}

.bracket-column {
  position: relative;
  z-index: 1;
}

.bracket-column h3 {
  position: static;
  top: auto;
  min-height: 24px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.2;
}

.bracket-column-stack {
  position: relative;
  height: 1510px;
}

.bracket-column.r16 .bracket-column-stack {
  padding-top: 0;
  gap: 0;
}

.bracket-column.qf .bracket-column-stack {
  padding-top: 0;
  gap: 0;
}

.bracket-column.sf .bracket-column-stack {
  padding-top: 0;
  gap: 0;
}

.bracket-column.finals .bracket-column-stack {
  padding-top: 0;
  gap: 0;
}

.match-card {
  position: absolute;
  top: var(--match-top);
  left: 0;
  right: 0;
  width: 100%;
  padding: 6px;
  min-height: 76px;
  height: 76px;
  overflow: visible;
}

.match-card.urgent-deadline {
  border-color: rgba(250, 204, 21, 0.92);
  box-shadow:
    0 0 0 1px rgba(250, 204, 21, 0.22),
    0 0 18px rgba(250, 204, 21, 0.2);
}

.match-card.in-progress {
  border-color: rgba(45, 212, 191, 0.92);
  box-shadow:
    0 0 0 1px rgba(45, 212, 191, 0.24),
    0 0 18px rgba(14, 165, 233, 0.22);
}

.match-card.urgent-deadline::before,
.match-card.in-progress::before {
  position: absolute;
  top: -9px;
  right: 8px;
  z-index: 3;
  padding: 1px 6px;
  border-radius: 999px;
  color: #111827;
  background: #facc15;
  font-size: 9px;
  font-weight: 1000;
  line-height: 1.35;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.route-bonus {
  position: absolute;
  top: -13px;
  left: 8px;
  z-index: 4;
  padding: 0 7px 1px;
  border-radius: 999px;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 14px;
  font-style: italic;
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 1.25;
  pointer-events: none;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.5),
    0 0 10px currentColor;
}

.route-bonus-2 {
  color: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.62);
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.76), rgba(226, 232, 240, 0.28));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 0 14px rgba(203, 213, 225, 0.34);
}

.route-bonus-1-5 {
  color: #fed7aa;
  border: 1px solid rgba(251, 146, 60, 0.72);
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.9), rgba(251, 146, 60, 0.32));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 14px rgba(251, 146, 60, 0.38);
}

.route-bonus-3 {
  color: #fef3c7;
  border: 1px solid rgba(251, 191, 36, 0.72);
  background: linear-gradient(135deg, rgba(146, 64, 14, 0.88), rgba(250, 204, 21, 0.34));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 16px rgba(251, 191, 36, 0.42);
}

.match-card.urgent-deadline::before {
  content: "今晚截止";
}

.match-card.in-progress::before {
  content: "进行中";
  color: #042f2e;
  background: #2dd4bf;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.28),
    0 0 14px rgba(45, 212, 191, 0.38);
}

.match-card::after {
  display: none;
}

.score-board {
  gap: 4px;
  height: 100%;
  align-content: center;
}

.score-board-row {
  grid-template-columns: minmax(66px, 1fr) repeat(var(--score-input-columns), minmax(30px, 39px));
  gap: 3px;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.18);
}

.team-pill {
  display: flex;
  position: relative;
  width: 100%;
  min-height: 30px;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  overflow: hidden;
  color: var(--text);
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #0d1117;
  cursor: pointer;
}

.team-pill:disabled {
  cursor: not-allowed;
  opacity: 0.82;
}

.team-pill.selected {
  color: var(--text);
  border-color: #30363d;
  background: #0d1117;
}

.team-pill.actual-result {
  color: #dcfce7;
  border-color: rgba(34, 197, 94, 0.62);
  background: rgba(34, 197, 94, 0.14);
  animation: winner-breathe 1.35s ease-in-out infinite;
}

.team-pill.selected.actual-result {
  color: #dcfce7;
  border-color: rgba(34, 197, 94, 0.62);
  background: rgba(34, 197, 94, 0.14);
  box-shadow:
    0 0 12px rgba(34, 197, 94, 0.28);
}

.flag {
  width: 18px;
  height: 18px;
}

.team-pill.champion-team .flag {
  overflow: visible;
}

.team-pill.champion-team .flag::before {
  content: "";
  position: absolute;
  top: -7px;
  left: -6px;
  z-index: 2;
  width: 14px;
  height: 11px;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  clip-path: polygon(0 100%, 0 38%, 24% 62%, 42% 0, 58% 62%, 76% 28%, 100% 62%, 100% 100%);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

.team-pill.champion-team .flag::after {
  content: "";
  position: absolute;
  top: 3px;
  left: -5px;
  z-index: 2;
  width: 12px;
  height: 3px;
  border-radius: 999px;
  background: #fbbf24;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.7);
  pointer-events: none;
}

.team-name {
  font-size: 11px;
}

.team-odds {
  font-size: 9px;
}

.score-input,
.actual-score {
  width: 100%;
  min-height: 30px;
  border-radius: 6px;
  font-size: 11px;
}

.score-input {
  appearance: textfield;
  -webkit-appearance: none;
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.actual-score {
  padding: 2px;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.winner-actions,
.match-top,
.score-board-head,
.odds-strip,
.comparison,
.match-points {
  display: none !important;
}

/* final layout and mobile adaptation */
.hero {
  display: block;
}

.bracket-column {
  z-index: 1;
}

.match-card {
  z-index: 2;
}

.score-board-row.selected {
  border-color: transparent;
  border-left-color: rgba(59, 130, 246, 0.95);
  border-left-width: 4px;
  background: rgba(59, 130, 246, 0.06);
}

.score-board-row.actual-result {
  border-color: rgba(34, 197, 94, 0.78);
  background: rgba(34, 197, 94, 0.15);
}

.score-board-row.selected.actual-result {
  border-color: rgba(34, 197, 94, 0.78);
  border-left-color: rgba(59, 130, 246, 0.95);
  border-left-width: 4px;
  background: rgba(34, 197, 94, 0.15);
  box-shadow: none;
}

.score-board-row.earned-route {
  padding-left: 2px;
}

.score-board-row.earned-route .team-pill {
  border-left: 4px solid #b45309;
  box-shadow:
    -8px 0 16px rgba(251, 146, 60, 0.36),
    0 0 10px rgba(180, 83, 9, 0.18);
}

.match-card.locked .score-input:disabled {
  opacity: 0.72;
}

.score-board-row.selected .score-input,
.score-board-row.selected .actual-score {
  border-color: #30363d;
  background: rgba(13, 17, 23, 0.72);
}

.score-board-row.actual-result .score-input,
.score-board-row.actual-result .actual-score {
  border-color: rgba(34, 197, 94, 0.52);
  background: rgba(34, 197, 94, 0.12);
}

.score-board-row.actual-result .actual-score.actual-winner-score {
  color: #ffd166;
  border-color: rgba(245, 158, 11, 0.8);
  background:
    linear-gradient(90deg, rgba(245, 158, 11, 0.2), rgba(34, 197, 94, 0.1));
  box-shadow: inset 0 0 10px rgba(245, 158, 11, 0.18);
}

.system-panel {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.system-panel .status-strip {
  grid-template-columns: repeat(4, minmax(72px, 1fr));
}

.system-panel .notice {
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 980px) {
  .app-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .deadline-timers {
    width: 100%;
    max-width: none;
    flex: none;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .header-actions button,
  .file-button,
  .primary-button,
  .secondary-button,
  .danger-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  .app-main {
    width: min(100vw - 16px, 1800px);
    padding-top: 8px;
  }

  .panel {
    padding: 10px;
  }

  .panel-title {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

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

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

  .player-tab {
    min-height: 46px;
  }

  .view-tabs {
    position: static;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .leader-chip {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: space-between;
  }

  .bracket-panel {
    padding: 8px;
  }

  .bracket-scroll {
    margin: 0;
    padding: 0 0 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .bracket-board {
    min-width: 1180px;
    grid-template-columns: 218px 218px 200px 190px 200px;
    gap: 16px;
  }

  .bracket-column.r16 .bracket-column-stack {
    padding-top: 0;
    gap: 0;
  }

  .bracket-column.qf .bracket-column-stack {
    padding-top: 0;
    gap: 0;
  }

  .bracket-column.sf .bracket-column-stack {
    padding-top: 0;
    gap: 0;
  }

  .bracket-column.finals .bracket-column-stack {
    padding-top: 0;
    gap: 0;
  }

  .score-board-row {
    grid-template-columns: minmax(62px, 1fr) repeat(var(--score-input-columns), minmax(28px, 36px));
  }

  .team-pill {
    min-height: 28px;
    padding: 2px 5px;
  }

  .flag {
    width: 18px;
    height: 18px;
  }

  .team-name {
    font-size: 11px;
  }

  .team-odds {
    font-size: 9px;
  }

  .score-input,
  .actual-score {
    width: 100%;
    min-height: 28px;
    font-size: 10px;
  }

  .system-panel {
    grid-template-columns: 1fr;
  }

  .system-panel .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-layout,
  .rules-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .brand span:last-child {
    display: none;
  }

  .header-actions {
    grid-template-columns: 1fr;
  }

  .deadline-timers {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .deadline-timer {
    min-height: 40px;
    padding: 6px 8px;
  }

  .deadline-timer strong {
    font-size: 13px;
  }

  .deadline-timer span,
  .deadline-timer small {
    font-size: 9px;
  }

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

  .player-slot {
    grid-template-columns: minmax(106px, auto) minmax(0, 1fr);
  }

  .champion-pick {
    min-height: 48px;
  }

  .status-strip,
  .system-panel .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    padding: 7px;
  }

  .metric strong {
    font-size: 20px;
  }

  .panel-title p {
    font-size: 12px;
  }

  .bracket-board {
    min-width: 1120px;
  }

  .champion-modal {
    align-items: end;
    padding: 10px;
  }

  .champion-dialog {
    width: 100%;
    max-height: 88dvh;
    border-radius: 16px 16px 10px 10px;
  }

  .champion-dialog-head {
    padding: 12px;
  }

  .champion-dialog-head p:last-child {
    font-size: 12px;
  }

  .champion-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .champion-team-option {
    min-height: 90px;
    padding: 8px 6px;
  }

  .champion-team-option .flag {
    width: 38px;
    height: 38px;
  }
}
