:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f7fb;
  color: #071421;
  --ink: #071421;
  --muted: #5e6d7a;
  --line: #dce5ec;
  --surface: #ffffff;
  --surface-soft: #f6f9fc;
  --mexico: #087a45;
  --usa: #174a8b;
  --canada: #d3262f;
  --gold: #d8a427;
  --field: #071f3f;
  --field-2: #0f6b4e;
  --red: #d3262f;
  --blue: #174a8b;
}

.locked-match {
  opacity: 0.72;
}

.locked-match .score-input {
  cursor: not-allowed;
  background: #eef1f4;
  color: #667085;
}

.match-locked {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ffe8e8;
  color: #9b1c1c;
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.ranking-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, var(--mexico), var(--usa), var(--canada)) top / 100% 5px no-repeat,
    linear-gradient(180deg, #ffffff 0%, #f4fbf8 100%);
}

.ranking-card::after {
  content: "";
  position: absolute;
  right: -46px;
  bottom: -54px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, transparent 0 34%, rgb(7 31 63 / 0.06) 35% 37%, transparent 38%),
    conic-gradient(from 18deg, rgb(8 122 69 / 0.12), rgb(23 74 139 / 0.1), rgb(211 38 47 / 0.12), rgb(8 122 69 / 0.12));
  pointer-events: none;
}

.ranking-panel {
  position: relative;
  z-index: 1;
  margin: 0;
}

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

.ranking-header h3 {
  margin: 0;
  color: var(--field);
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  line-height: 1;
  font-weight: 1000;
}

.ranking-header h3::after {
  content: "";
  display: block;
  width: 58px;
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mexico), var(--usa), var(--canada));
}

.ranking-header span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eaf3ff;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.ranking-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.ranking-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 34px;
  border: 1px solid rgb(7 31 63 / 0.16);
  border-radius: 8px;
  background: #ffffff;
  color: var(--field);
  font-weight: 1000;
  box-shadow: 0 8px 16px rgb(7 31 63 / 0.08);
  cursor: pointer;
}

.ranking-page-btn:hover:not(:disabled) {
  color: #ffffff;
  border-color: var(--blue);
  background: var(--blue);
}

.ranking-page-btn:disabled {
  color: #b0bac4;
  background: #f2f5f8;
  box-shadow: none;
  cursor: not-allowed;
}

.ranking-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin-bottom: 14px;
  border: 1px solid rgb(7 31 63 / 0.1);
  border-radius: 10px;
  background: rgb(255 255 255 / 0.72);
}

.ranking-mode-btn {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 1000;
  cursor: pointer;
}

.ranking-mode-btn.active {
  color: #ffffff;
  background: linear-gradient(90deg, var(--field), var(--blue));
  box-shadow: 0 10px 20px rgb(23 74 139 / 0.18);
}

.ranking-fecha-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: -6px 0 14px;
}

.ranking-fecha-tabs[hidden] {
  display: none;
}

.ranking-fecha-btn {
  min-height: 32px;
  border: 1px solid rgb(7 31 63 / 0.1);
  border-radius: 8px;
  background: #ffffff;
  color: var(--field);
  font-size: 0.78rem;
  font-weight: 1000;
  cursor: pointer;
}

.ranking-fecha-btn.active {
  border-color: rgb(8 122 69 / 0.28);
  background: #e7f6ef;
  color: var(--field-2);
}

.ranking-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: ranking;
}

.ranking-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid rgb(7 31 63 / 0.09);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.88);
  box-shadow: 0 8px 18px rgb(7 31 63 / 0.06);
}

.ranking-item.ranking-top-1 {
  border-color: rgb(216 164 39 / 0.45);
  background: linear-gradient(90deg, #fff5cf 0%, #ffffff 68%);
}

.ranking-item.ranking-top-2 {
  background: linear-gradient(90deg, #eef4fb 0%, #ffffff 68%);
}

.ranking-item.ranking-top-3 {
  background: linear-gradient(90deg, #fff1e8 0%, #ffffff 68%);
}

.ranking-position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--field);
  color: #ffffff;
  font-weight: 1000;
  box-shadow: inset 0 -2px 0 rgb(255 255 255 / 0.16);
}

.ranking-item.ranking-top-1 .ranking-position {
  background: var(--gold);
}

.ranking-item.ranking-top-2 .ranking-position {
  background: #8b9aaa;
}

.ranking-item.ranking-top-3 .ranking-position {
  background: #c87932;
}

.ranking-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--field);
  font-weight: 900;
}

.ranking-points {
  min-width: 72px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e7f6ef;
  color: var(--field-2);
  font-size: 0.9rem;
  font-weight: 1000;
  text-align: center;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgb(8 122 69 / 0.1) 0 18%, transparent 18% 100%),
    linear-gradient(240deg, transparent 0 69%, rgb(211 38 47 / 0.11) 69% 100%),
    linear-gradient(180deg, #ffffff 0%, #f6f9fc 48%, #eaf0f5 100%);
}

button,
input {
  font: inherit;
}

.app {
  width: min(1520px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.26);
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 0.09) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(0deg, rgb(255 255 255 / 0.08) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(115deg, var(--mexico) 0 25%, transparent 25% 100%),
    linear-gradient(135deg, #071f3f 0%, #174a8b 55%, #d3262f 118%);
  box-shadow: 0 18px 42px rgb(7 31 63 / 0.22);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  background: linear-gradient(90deg, var(--mexico) 0 33.333%, #fff 33.333% 40%, var(--usa) 40% 66.666%, #fff 66.666% 73%, var(--canada) 73% 100%);
}

.title-block {
  max-width: 780px;
}

.subtitle {
  max-width: 620px;
  margin: 8px 0 0;
  color: rgb(255 255 255 / 0.8);
  font-size: clamp(14px, 2vw, 17px);
  font-weight: 700;
}

.header-side {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.host-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.host-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 1000;
  white-space: nowrap;
}

.host-chip.mexico {
  background: var(--mexico);
}

.host-chip.usa {
  background: var(--usa);
}

.host-chip.canada {
  background: var(--canada);
}

.quick-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.quick-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 8px;
  color: rgb(255 255 255 / 0.78);
  background: rgb(255 255 255 / 0.1);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.quick-stats strong {
  color: #fff;
  font-size: 18px;
  font-weight: 1000;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: #f6d06b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 6vw, 54px);
  letter-spacing: 0;
  font-weight: 1000;
  line-height: 0.95;
}

.share-btn,
.logout-btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--field);
  font-weight: 900;
  background: #fff;
  box-shadow: 0 12px 24px rgb(0 0 0 / 0.18);
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.share-btn:hover,
.logout-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 26px rgb(0 0 0 / 0.22);
}

.logout-btn {
  color: #fff;
  background: var(--red);
}

.progress-card,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgb(16 24 32 / 0.08);
}

.progress-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.progress-meta {
  display: grid;
  gap: 2px;
  min-width: 112px;
  color: var(--muted);
}

.progress-meta strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #dfe8e2;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mexico), var(--usa), var(--canada));
  transition: width 180ms ease;
}

.tabs,
.group-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0 12px;
  scrollbar-width: thin;
}

.tab,
.group-pill,
.ghost-btn {
  border: 0;
  cursor: pointer;
  font-weight: 900;
}

.tab {
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--muted);
  background: rgb(255 255 255 / 0.68);
  border: 1px solid transparent;
}

.tab.active {
  color: #fff;
  background: var(--field);
  box-shadow: 0 10px 20px rgb(7 31 63 / 0.16);
}

.group-pill {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #43524b;
  background: #fff;
  border: 1px solid var(--line);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.group-pill.active {
  color: #fff;
  background: linear-gradient(135deg, var(--mexico), var(--usa) 58%, var(--canada));
  border-color: transparent;
  transform: translateY(-2px);
}

.group-pill.disabled {
  opacity: 0.55;
}

.view {
  display: none;
}

.active-view {
  display: grid;
  gap: 16px;
}

#groupsView.active-view {
  grid-template-columns: minmax(320px, 0.78fr) minmax(420px, 1.22fr);
  align-items: start;
}

.matches-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

#thirdsView .card {
  background:
    linear-gradient(90deg, var(--mexico), var(--usa), var(--canada)) top / 100% 5px no-repeat,
    linear-gradient(180deg, #ffffff 0%, #f4fbf8 100%);
  border-color: #cfe5dc;
  padding-top: 24px;
}

#bracketView .card {
  background:
    linear-gradient(90deg, var(--mexico), var(--usa), var(--canada)) top / 100% 5px no-repeat,
    linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
  border-color: #d5e0ea;
  padding-top: 24px;
}

#bracketView .hint,
#bracketView .ko-round h3 {
  color: var(--muted);
}

#bracketView .ko-match,
#bracketView .third-card .ko-match {
  color: var(--ink);
}

#thirdsView .hint,
#bracketView .hint {
  margin: 8px 0 14px;
}

#thirdsView .standings {
  margin-top: 10px;
}

.card {
  padding: 18px;
}

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

.ghost-btn {
  border-radius: 8px;
  padding: 8px 12px;
  background: #eaf3ef;
  color: var(--field);
  border: 1px solid #d5e6de;
}

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

.ghost-btn.danger {
  color: #a8322a;
  background: #fff0ee;
  border-color: #ffd1cc;
}

.standings {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.standings th {
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  text-transform: uppercase;
}

.standings th:first-child,
.standings td:first-child,
.standings th:nth-child(3),
.standings td:nth-child(3),
.standings th:nth-child(4),
.standings td:nth-child(4) {
  text-align: center;
}

.standings td {
  padding: 12px 10px;
  background: var(--surface-soft);
  font-weight: 900;
}

.standings td:first-child {
  border-radius: 8px 0 0 8px;
}

.standings td:last-child {
  border-radius: 0 8px 8px 0;
}

.standings tr:nth-child(-n + 2) td {
  background: #eaf8ef;
}

.standings tr:nth-child(3) td {
  background: #eef7ff;
}

.team {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 900;
  white-space: nowrap;
}

.flag {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.matches {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.match {
  display: grid;
  grid-template-columns: minmax(84px, 1fr) 54px 20px 54px minmax(84px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid #e5eee8;
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.score-input {
  width: 54px;
  height: 42px;
  border: 1px solid #d5dfd9;
  border-radius: 8px;
  text-align: center;
  font-weight: 1000;
  background: #fff;
}

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

.score-input,
.ko-score,
.penalty-score {
  appearance: textfield;
  -moz-appearance: textfield;
}

.score-input:focus {
  border-color: var(--blue);
  outline: 3px solid rgb(31 111 178 / 0.15);
}

.colon {
  color: #94a3b8;
  text-align: center;
  font-weight: 1000;
}

.match-date {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.hint {
  color: var(--muted);
  font-weight: 700;
}

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

.bracket-round {
  display: grid;
  align-content: center;
  gap: 10px;
}

.bracket-round h3 {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  text-transform: uppercase;
}

.bracket-match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 900;
  text-align: center;
}

.bracket-match .team {
  justify-content: center;
}

.bracket-match > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.bracket-match small,
.mini {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.muted-round {
  opacity: 0.55;
}

.score-placeholder {
  color: #94a3b8;
  font-size: 12px;
}

.standings tr.qualified-third td {
  background: #effbf4;
}

.eliminated-third {
  opacity: 0.52;
}

.group-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eaf3ef;
  color: var(--field);
  font-weight: 1000;
}

.q-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--field-2);
  color: #fff;
  font-size: 12px;
  font-weight: 1000;
}

.knockout-bracket {
  display: grid;
  grid-template-columns: 1.35fr 1.2fr 1.05fr 0.95fr 1fr;
  align-items: stretch;
  gap: 44px;
  min-width: 1280px;
  min-height: 1780px;
  margin-top: 18px;
  padding: 10px 0 22px;
}

#bracketView .card {
  overflow-x: auto;
}

.ko-round {
  display: grid;
  grid-template-rows: 24px 1fr;
  min-height: 100%;
}

.ko-round h3 {
  color: var(--ink);
  font-size: 13px;
  font-weight: 1000;
  text-align: center;
  text-transform: uppercase;
}

.ko-round-matches {
  position: relative;
  display: grid;
  grid-template-rows: repeat(32, minmax(28px, 1fr));
  min-height: 1700px;
}

.ko-r32 .ko-match {
  grid-row: calc(var(--match-index) * 2 + 1) / span 2;
}

.ko-r16 .ko-match {
  grid-row: calc(var(--match-index) * 4 + 2) / span 2;
}

.ko-qf .ko-match {
  grid-row: calc(var(--match-index) * 8 + 4) / span 2;
}

.ko-sf .ko-match {
  grid-row: calc(var(--match-index) * 16 + 8) / span 2;
}

.ko-final .ko-match {
  grid-row: 16 / span 2;
}

.ko-match {
  position: relative;
  min-width: 164px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.07);
  overflow: visible;
}

.ko-match::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -44px;
  width: 44px;
  border-top: 2px solid #a8adb5;
}

.ko-match::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -44px;
  width: 44px;
  border-top: 2px solid #a8adb5;
}

.ko-r32 .ko-match::before,
.ko-final .ko-match::after,
.third-card .ko-match::before,
.third-card .ko-match::after {
  display: none;
}

.ko-r32 .ko-round-matches::before,
.ko-r16 .ko-round-matches::before,
.ko-qf .ko-round-matches::before,
.ko-sf .ko-round-matches::before {
  content: "";
  position: absolute;
  inset: 0 -22px 0 auto;
  width: 0;
  pointer-events: none;
  background:
    linear-gradient(#a8adb5, #a8adb5) right calc(3.125% + 0px) / 2px 6.25% no-repeat,
    linear-gradient(#a8adb5, #a8adb5) right calc(15.625% + 0px) / 2px 6.25% no-repeat,
    linear-gradient(#a8adb5, #a8adb5) right calc(28.125% + 0px) / 2px 6.25% no-repeat,
    linear-gradient(#a8adb5, #a8adb5) right calc(40.625% + 0px) / 2px 6.25% no-repeat,
    linear-gradient(#a8adb5, #a8adb5) right calc(53.125% + 0px) / 2px 6.25% no-repeat,
    linear-gradient(#a8adb5, #a8adb5) right calc(65.625% + 0px) / 2px 6.25% no-repeat,
    linear-gradient(#a8adb5, #a8adb5) right calc(78.125% + 0px) / 2px 6.25% no-repeat,
    linear-gradient(#a8adb5, #a8adb5) right calc(90.625% + 0px) / 2px 6.25% no-repeat;
}

.ko-r16 .ko-round-matches::before {
  background:
    linear-gradient(#a8adb5, #a8adb5) right 6.25% / 2px 12.5% no-repeat,
    linear-gradient(#a8adb5, #a8adb5) right 31.25% / 2px 12.5% no-repeat,
    linear-gradient(#a8adb5, #a8adb5) right 56.25% / 2px 12.5% no-repeat,
    linear-gradient(#a8adb5, #a8adb5) right 81.25% / 2px 12.5% no-repeat;
}

.ko-qf .ko-round-matches::before {
  background:
    linear-gradient(#a8adb5, #a8adb5) right 12.5% / 2px 25% no-repeat,
    linear-gradient(#a8adb5, #a8adb5) right 62.5% / 2px 25% no-repeat;
}

.ko-sf .ko-round-matches::before {
  background:
    linear-gradient(#a8adb5, #a8adb5) right 25% / 2px 50% no-repeat;
}

.ko-team {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 42px 18px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-weight: 1000;
}

.ko-team.has-penalty {
  grid-template-columns: minmax(120px, 1fr) 42px 36px 18px;
}

.ko-team + .ko-team {
  border-top: 1px solid #e8f0eb;
}

.ko-team > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.ko-team .team {
  gap: 6px;
  font-size: 11px;
}

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

.ko-score {
  width: 42px;
  height: 28px;
  border: 1px solid #d5dfd9;
  border-radius: 5px;
  text-align: center;
  font-weight: 1000;
  background: #fff;
}

.penalty-inline-label {
  padding: 6px 10px;
  border-top: 1px solid #fde68a;
  color: #92400e;
  background: #fffbeb;
  font-size: 12px;
  font-weight: 900;
}

.penalty-label {
  color: #92400e;
  font-size: 12px;
  font-weight: 900;
}

.penalty-score {
  width: 36px;
  height: 28px;
  border: 1px solid #facc15;
  border-radius: 5px;
  text-align: center;
  color: #b45309;
  font-weight: 1000;
  background: #fff;
}

.ko-score:disabled {
  color: #96a39d;
  background: var(--surface-soft);
}

.ko-winner {
  background: #e4f7ea;
}

.check {
  color: var(--field-2);
}

.change-btn {
  width: 100%;
  border: 0;
  border-top: 1px solid #e8f0eb;
  padding: 7px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.champion-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  min-width: 760px;
  align-items: start;
  margin-top: 24px;
}

.champion-card,
.third-card {
  border-radius: 8px;
  padding: 18px;
  background: #fff7cc;
  border: 2px solid #facc15;
  text-align: center;
}

.champion-card {
  min-height: 180px;
}

.third-card {
  background: var(--surface-soft);
  border-color: var(--line);
}

.champion-card > span,
.third-card > span {
  display: block;
  margin-bottom: 10px;
  color: #92400e;
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}

.champion-card em {
  display: block;
  margin-bottom: 10px;
  color: #92400e;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.champion-card strong,
.third-card strong {
  display: inline-flex;
  justify-content: center;
  font-size: 24px;
}

.champion-card strong {
  display: flex;
  align-items: center;
  justify-content: center;
}

.champion-team {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 54px);
  font-weight: 1000;
}

.champion-team .flag {
  width: 70px;
  height: 70px;
  box-shadow: 0 10px 22px rgb(15 23 42 / 0.18);
}

.third-card .ko-match {
  margin-top: 12px;
  text-align: left;
}

.floating-third {
  position: absolute;
  right: 0;
  top: 62%;
  width: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
  box-shadow: 0 12px 30px rgb(15 23 42 / 0.08);
  text-align: center;
}

.floating-third h3 {
  margin-bottom: 8px;
  color: #92400e;
}

.floating-third strong {
  display: inline-flex;
  margin-bottom: 10px;
  font-size: 16px;
}

.floating-third .ko-match {
  text-align: left;
}

.prizes-card {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  background:
    linear-gradient(90deg, var(--mexico), var(--usa), var(--canada)) top / 100% 5px no-repeat,
    radial-gradient(circle at 82% 12%, rgb(255 255 255 / 0.32), transparent 26%),
    linear-gradient(135deg, #071f3f 0%, #174a8b 52%, #d3262f 120%);
  color: #ffffff;
}

.prizes-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 0.08) 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(0deg, rgb(255 255 255 / 0.08) 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(115deg, rgb(8 122 69 / 0.72) 0 24%, transparent 24% 100%);
  pointer-events: none;
}

.prizes-header,
.prizes-carousel,
.prize-dots {
  position: relative;
  z-index: 1;
}

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

.prizes-header span {
  display: block;
  margin-bottom: 4px;
  color: #f6d06b;
  font-size: 0.76rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prizes-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.15rem, 2.3vw, 1.45rem);
  line-height: 1.05;
}

.prizes-header strong {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.12);
  color: rgb(255 255 255 / 0.88);
  font-size: 0.72rem;
  font-weight: 1000;
  white-space: nowrap;
}

.prizes-carousel {
  position: relative;
  min-height: 250px;
}

.prize-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 46% 1fr;
  align-items: center;
  gap: 16px;
  margin: 0;
  opacity: 0;
  transform: translateX(18px);
  animation: prize-slide 12s infinite;
}

.prize-slide-2 {
  animation-delay: 4s;
}

.prize-slide-3 {
  animation-delay: 8s;
}

.prize-slide img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 18px 22px rgb(0 0 0 / 0.26));
}

.prize-slide figcaption {
  display: grid;
  gap: 6px;
}

.prize-slide figcaption span {
  color: #f6d06b;
  font-size: 0.8rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.prize-slide figcaption strong {
  color: #ffffff;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  line-height: 1;
}

.prize-dots {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.prize-dots span {
  width: 26px;
  height: 5px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.28);
  animation: prize-dot 12s infinite;
}

.prize-dots span:nth-child(2) {
  animation-delay: 4s;
}

.prize-dots span:nth-child(3) {
  animation-delay: 8s;
}

@keyframes prize-slide {
  0%,
  8% {
    opacity: 0;
    transform: translateX(18px);
  }

  12%,
  31% {
    opacity: 1;
    transform: translateX(0);
  }

  36%,
  100% {
    opacity: 0;
    transform: translateX(-18px);
  }
}

@keyframes prize-dot {
  0%,
  10%,
  34%,
  100% {
    background: rgb(255 255 255 / 0.28);
  }

  12%,
  31% {
    background: #f6d06b;
  }
}

@media (max-width: 900px) {
  #groupsView.active-view {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .header-side,
  .host-strip,
  .quick-stats {
    justify-items: stretch;
    justify-content: flex-start;
  }

  .host-chip {
    flex: 1 1 auto;
    justify-content: center;
  }

  .session-actions,
  .share-btn,
  .logout-btn {
    width: 100%;
  }

  .progress-card {
    grid-template-columns: 1fr;
  }

  .prizes-card {
    min-height: 330px;
  }

  .prizes-header {
    flex-direction: column;
  }

  .prizes-carousel {
    min-height: 220px;
  }

  .prize-slide {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 10px;
    text-align: center;
  }

  .prize-slide img {
    justify-self: center;
    width: min(220px, 76%);
  }

  .prize-dots {
    justify-content: center;
  }

  .card-title {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .match {
    grid-template-columns: 1fr 46px 14px 46px 1fr;
    padding: 12px 10px;
  }

  .score-input {
    width: 46px;
  }

  .bracket,
  .knockout-bracket,
  .champion-box {
    grid-template-columns: 1fr;
    min-width: 0;
    min-height: 0;
    margin-top: 12px;
  }

  .ko-round-matches,
  .ko-r16 .ko-round-matches,
  .ko-qf .ko-round-matches,
  .ko-sf .ko-round-matches,
  .ko-final .ko-round-matches {
    gap: 12px;
    padding-top: 0;
    justify-content: flex-start;
  }

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