:root {
  --bg: #F7FAFF;
  --card: #FFFFFF;
  --blue: #005CFF;
  --blue-glow: #0078D7;
  --gold: #D7B45A;
  --gold-light: #9A6A00;
  --text: #102033;
  --muted: #667085;
  --line: rgba(0, 92, 255, 0.16);
  --danger: #DC2626;
  --green: #159947;
  --amber: #C77700;
  --panel: #FFFFFF;
  --shadow: 0 16px 38px rgba(16, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
}

body.has-modal {
  overflow: hidden;
}

body.auth-pending {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

[hidden] {
  display: none !important;
}

noscript {
  display: block;
  margin: 1rem;
  color: var(--gold-light);
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.25rem;
  padding: 2rem;
  text-align: center;
  background: var(--bg);
  transition:
    opacity 260ms ease,
    visibility 260ms ease;
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-logo {
  width: 5.5rem;
  height: 5.5rem;
  object-fit: cover;
  border: 1px solid rgba(215, 180, 90, 0.7);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 92, 255, 0.18);
}

.loader {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid rgba(0, 92, 255, 0.14);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    linear-gradient(180deg, rgba(247, 250, 255, 0.92), rgba(247, 250, 255, 0.98)),
    var(--bg);
  transition:
    opacity 220ms ease,
    visibility 220ms ease;
}

body.is-authenticated .auth-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  width: min(100%, 24rem);
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FFFFFF;
  text-align: center;
  box-shadow: 0 22px 52px rgba(16, 32, 51, 0.14);
}

.auth-logo {
  width: 4.8rem;
  height: 4.8rem;
  object-fit: cover;
  border: 1px solid rgba(215, 180, 90, 0.64);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(0, 92, 255, 0.16);
}

.auth-copy {
  max-width: 19rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.google-signin-button {
  width: 100%;
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
  border: 1px solid rgba(16, 32, 51, 0.14);
  border-radius: 8px;
  background: #FFFFFF;
  color: var(--text);
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(16, 32, 51, 0.08);
}

.google-signin-button:not(:disabled) {
  cursor: pointer;
}

.google-signin-button:not(:disabled):hover {
  border-color: rgba(0, 92, 255, 0.34);
  box-shadow: 0 12px 26px rgba(0, 92, 255, 0.12);
}

.google-signin-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.google-mark {
  width: 1.55rem;
  height: 1.55rem;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 92, 255, 0.16);
  border-radius: 50%;
  color: var(--blue);
  font-weight: 950;
  line-height: 1;
}

.auth-status {
  min-height: 1.15rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.auth-status.is-error {
  color: var(--danger);
}

.account-widget {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 0.8rem);
  right: calc(env(safe-area-inset-right) + 0.8rem);
  z-index: 35;
  transform: translateZ(0);
  will-change: transform;
}

.account-avatar-button {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 12px 28px rgba(16, 32, 51, 0.2);
}

.account-avatar-button img,
.account-summary img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-avatar-button:not(:disabled) {
  cursor: pointer;
}

.account-menu {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  width: min(18.5rem, calc(100vw - 1.6rem));
  display: grid;
  gap: 0.9rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 20px 46px rgba(16, 32, 51, 0.18);
}

.account-summary {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.account-summary img {
  border-radius: 50%;
}

.account-summary strong,
.account-summary span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-summary strong {
  font-size: 0.92rem;
}

.account-summary span {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.signout-button {
  min-height: 2.55rem;
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
  font-weight: 900;
}

.signout-button:not(:disabled) {
  cursor: pointer;
}

.signout-button:not(:disabled):hover {
  background: rgba(220, 38, 38, 0.13);
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.app-shell {
  width: min(100%, 48rem);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem 7.6rem;
}

.topbar {
  display: grid;
  gap: 1rem;
  padding: 0.75rem 0 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: 3.6rem;
  height: 3.6rem;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid rgba(215, 180, 90, 0.5);
  border-radius: 8px;
  box-shadow: 0 0 24px rgba(0, 163, 255, 0.32);
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  font-size: clamp(1.7rem, 9vw, 2.6rem);
  color: var(--blue);
}

h2 {
  font-size: 1.55rem;
}

h3 {
  font-size: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.install-button,
.refresh-pill,
.count-pill,
.status-badge {
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  white-space: nowrap;
}

.install-button {
  border: 1px solid rgba(215, 180, 90, 0.62);
  background: rgba(215, 180, 90, 0.12);
  color: var(--gold-light);
  padding: 0 0.8rem;
  font-weight: 800;
}

.refresh-pill,
.count-pill,
.status-badge {
  border: 1px solid var(--line);
  color: var(--blue);
  background: #FFFFFF;
  padding: 0 0.7rem;
  font-size: 0.75rem;
  font-weight: 800;
}

.warning {
  margin: 0.35rem 0 1rem;
  padding: 0.75rem;
  border: 1px solid rgba(215, 180, 90, 0.35);
  border-radius: 8px;
  background: rgba(215, 180, 90, 0.08);
  color: var(--gold-light);
  font-size: 0.82rem;
  line-height: 1.35;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.55rem 0 1rem;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.match-detail,
.match-card,
.group-card,
.leader-card,
.bracket-match {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.match-detail {
  margin-bottom: 1rem;
  overflow: hidden;
}

.detail-hero {
  padding: 1rem;
  background:
    linear-gradient(120deg, rgba(0, 92, 255, 0.08), rgba(215, 180, 90, 0.1)),
    #FFFFFF;
}

.match-meta,
.match-line,
.score-row,
.stat-line,
.player-row,
.odds-row,
.standing-row,
.bracket-row {
  display: flex;
  align-items: center;
}

.match-meta {
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.score-row {
  justify-content: space-between;
  gap: 0.8rem;
}

.team {
  min-width: 0;
  flex: 1 1 0;
}

.team.away {
  text-align: right;
}

.team-flag {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(0, 92, 255, 0.16);
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 4px 10px rgba(16, 32, 51, 0.08);
  line-height: 1;
}

.team-flag img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.flag-detail {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.42rem;
  font-size: 1.95rem;
}

.team:not(.away) .flag-detail {
  margin-right: auto;
}

.team.away .flag-detail {
  margin-left: auto;
}

.flag-match {
  width: 3.15rem;
  height: 3.15rem;
  font-size: 2rem;
}

.flag-inline {
  width: 1.25em;
  height: 1.25em;
  border-radius: 5px;
  font-size: 0.82em;
}

.flag-bracket {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 5px;
}

.team-name {
  display: block;
  font-size: clamp(1.05rem, 5vw, 1.35rem);
  font-weight: 900;
  line-height: 1.1;
}

.team-sub {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.team-scorers {
  display: grid;
  gap: 0.22rem;
  margin-top: 0.5rem;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.25;
}

.team.away .team-scorers {
  justify-items: end;
}

.team-scorer {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.score {
  min-width: 4.7rem;
  text-align: center;
  color: var(--gold-light);
  font-size: 1.65rem;
  font-weight: 950;
  text-shadow: none;
}

.live-dot {
  width: 0.55rem;
  height: 0.55rem;
  display: inline-block;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
}

.status-live {
  color: var(--green);
  border-color: rgba(21, 153, 71, 0.38);
  background: rgba(21, 153, 71, 0.08);
}

.status-finished {
  color: var(--gold-light);
  border-color: rgba(215, 180, 90, 0.48);
  background: rgba(215, 180, 90, 0.1);
}

.status-upcoming {
  color: var(--blue);
  border-color: rgba(0, 163, 255, 0.48);
  background: rgba(0, 92, 255, 0.07);
}

.detail-section {
  padding: 1rem;
  border-top: 1px solid var(--line);
}

.detail-section h3 {
  margin-bottom: 0.7rem;
  color: var(--gold-light);
}

.expert-chat,
.probability-list,
.odds-table,
.ratings-grid,
.stats-grid {
  display: grid;
  gap: 0.55rem;
}

.expert-message {
  display: grid;
  gap: 0.2rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--blue-glow);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.38;
}

.expert-message strong {
  color: var(--blue);
}

.expert-message:nth-child(2n) {
  border-left-color: var(--gold);
}

.muted {
  color: var(--muted);
}

.lineup-field {
  position: relative;
  display: grid;
  gap: 0.9rem;
  min-width: 0;
  padding: 0.85rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px) 50% 0 / 28% 100%,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 3.2rem, transparent 3.2rem 6.4rem),
    linear-gradient(135deg, #0D6B35, #178C45 48%, #0B5B31);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.16),
    inset 0 0 32px rgba(0, 0, 0, 0.16);
}

.lineup-field::before {
  content: "";
  position: absolute;
  inset: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 6px;
  pointer-events: none;
}

.lineup-field > * {
  position: relative;
  z-index: 1;
}

.lineup-midline {
  z-index: 0;
  height: 2px;
  margin: 0.1rem -0.2rem;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 0 0 1px rgba(19, 112, 57, 0.25);
}

.lineup-team {
  display: grid;
  gap: 0.62rem;
  min-width: 0;
}

.lineup-team-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem 0.55rem;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

.lineup-team-header strong {
  min-width: 0;
  font-size: 0.86rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.lineup-team-header span {
  min-height: 1.45rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.42rem;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.68rem;
  font-weight: 900;
}

.lineup-team-header .lineup-source {
  grid-column: 1 / -1;
  margin-top: 0;
  color: rgba(255, 255, 255, 0.86);
  text-shadow: none;
}

.lineup-source {
  display: block;
  margin-top: 0.25rem;
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.35;
}

.lineup-lines {
  display: grid;
  gap: 0.46rem;
}

.lineup-role-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.42rem;
  min-height: 5.75rem;
}

.lineup-player-card {
  width: 4.35rem;
  min-height: 5.65rem;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.26rem;
  padding: 0.32rem;
  border: 2px solid var(--gold);
  border-radius: 7px;
  background: #FFFFFF;
  color: var(--text);
  box-shadow: 0 6px 14px rgba(16, 32, 51, 0.16);
}

.lineup-card-top {
  min-height: 2rem;
  display: flex;
  justify-content: space-between;
  gap: 0.22rem;
}

.lineup-card-stack,
.lineup-card-rating {
  min-width: 1.45rem;
  min-height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: rgba(215, 180, 90, 0.14);
  color: var(--gold-light);
  font-weight: 950;
}

.lineup-card-stack {
  grid-template-rows: repeat(2, minmax(0, 1fr));
  font-size: 0.56rem;
}

.lineup-card-stack small {
  color: var(--text);
  font-size: 0.56rem;
  font-weight: 900;
}

.lineup-card-rating {
  margin-left: auto;
  font-size: 0.72rem;
}

.lineup-card-body {
  align-self: end;
  display: grid;
  gap: 0.1rem;
  text-align: center;
}

.lineup-card-body strong {
  color: var(--text);
  font-size: 0.61rem;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.lineup-card-body small {
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 750;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.stats-grid {
  gap: 0.75rem;
}

.stat-line {
  gap: 0.65rem;
}

.stat-line span {
  width: 2.6rem;
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 850;
}

.stat-line b {
  width: 6rem;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.bar {
  position: relative;
  height: 0.55rem;
  flex: 1 1 auto;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 92, 255, 0.1);
}

.bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--blue-glow));
}

.bar.away i {
  inset: 0 0 0 auto;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.player-row,
.odds-row,
.standing-row,
.bracket-row {
  justify-content: space-between;
  gap: 0.75rem;
}

.player-row,
.odds-row {
  min-height: 2.4rem;
  border-bottom: 1px solid rgba(0, 92, 255, 0.1);
  font-size: 0.86rem;
}

.player-row:last-child,
.odds-row:last-child {
  border-bottom: 0;
}

.match-winner-odds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.match-winner-odds span {
  display: grid;
  gap: 0.2rem;
  min-height: 3.7rem;
  align-content: center;
  padding: 0.55rem;
  border: 1px solid rgba(0, 92, 255, 0.14);
  border-radius: 8px;
  background: rgba(0, 92, 255, 0.06);
}

.match-winner-odds small,
.bet-card span,
.bet-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.match-winner-odds b,
.bet-card b {
  color: var(--gold-light);
  font-size: 1rem;
  font-weight: 950;
}

.bet-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
  gap: 0.55rem;
}

.bet-card {
  display: grid;
  gap: 0.45rem;
  min-height: 7rem;
  padding: 0.75rem;
  border: 1px solid rgba(0, 92, 255, 0.2);
  border-radius: 8px;
  background: #FFFFFF;
}

.bet-card strong {
  min-width: 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.bet-card footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: auto;
}

.rating {
  color: var(--gold-light);
  font-weight: 950;
}

.match-list,
.groups-grid,
.players-boards,
.bracket-list {
  display: grid;
  gap: 0.8rem;
}

.match-section {
  display: grid;
  gap: 0.65rem;
}

.match-stream-section {
  display: grid;
  gap: 0.65rem;
}

.match-section + .match-section,
.match-stream-section + .match-stream-section,
.team-panel + .match-section {
  margin-top: 1rem;
}

.match-section-header,
.match-stream-header,
.team-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.match-section-header {
  padding: 0 0.15rem;
}

.match-stream-header {
  padding: 0 0.15rem;
}

.match-section-header h3,
.match-stream-header h3 {
  color: var(--blue);
}

.match-section-header span,
.match-stream-header span {
  min-width: 2rem;
  min-height: 2rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  background: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 900;
}

.match-section-list {
  display: grid;
  gap: 0.65rem;
}

.match-stream-list {
  display: grid;
  gap: 0.65rem;
}

.match-day-separator,
.match-round-separator {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.match-day-separator::before,
.match-day-separator::after,
.match-round-separator::before,
.match-round-separator::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: rgba(0, 92, 255, 0.16);
}

.match-round-separator {
  margin-top: 0.7rem;
  color: var(--blue);
}

.match-round-separator::before,
.match-round-separator::after {
  height: 3px;
  border-radius: 999px;
  background: rgba(0, 92, 255, 0.32);
}

.match-card {
  width: 100%;
  padding: 0.85rem;
  border-color: var(--line);
  text-align: left;
  cursor: pointer;
}

.match-feed-card {
  display: block;
}

.match-feed-live {
  border-color: rgba(21, 153, 71, 0.48);
  box-shadow: 0 0 0 1px rgba(21, 153, 71, 0.1), var(--shadow);
}

.match-card.is-selected {
  border-color: rgba(215, 180, 90, 0.82);
  box-shadow: 0 0 0 1px rgba(215, 180, 90, 0.18), var(--shadow);
}

.match-card:focus-visible,
.tab-button:focus-visible,
.icon-button:focus-visible,
.stage-tab:focus-visible,
.install-button:focus-visible {
  outline: 3px solid rgba(215, 180, 90, 0.58);
  outline-offset: 2px;
}

.match-card .match-meta {
  margin-bottom: 0.55rem;
}

.match-card .match-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
}

.match-team {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 0.42rem;
}

.match-team-away {
  justify-items: end;
}

.match-card .team-name {
  min-width: 0;
  font-size: clamp(1.08rem, 4vw, 1.22rem);
  overflow-wrap: anywhere;
}

.match-team-away .team-name {
  text-align: right;
}

.compact-score {
  min-width: 4.6rem;
  color: var(--gold-light);
  text-align: center;
  font-size: 0.92rem;
  font-weight: 950;
}

.match-card-scorers {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(0, 92, 255, 0.12);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
}

.team-link {
  cursor: pointer;
}

.team-link:hover {
  color: var(--gold-light);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.modal-team-link {
  cursor: pointer;
}

.modal-team-link:hover {
  color: var(--gold-light);
}

.team-panel {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem;
  border: 1px solid rgba(215, 180, 90, 0.45);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(215, 180, 90, 0.12), rgba(0, 92, 255, 0.12)),
    var(--panel);
  box-shadow: var(--shadow);
}

.team-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.team-summary-grid span {
  min-width: 0;
  padding: 0.6rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 92, 255, 0.04);
  text-align: center;
}

.team-summary-grid strong,
.team-summary-grid small {
  display: block;
}

.team-summary-grid strong {
  color: var(--gold-light);
  font-size: 1.15rem;
}

.team-summary-grid small,
.team-next {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.team-next {
  margin: 0;
  line-height: 1.35;
}

.team-match-list {
  display: grid;
  gap: 0.45rem;
}

.team-match-row {
  display: grid;
  grid-template-columns: minmax(4.2rem, 0.7fr) minmax(0, 1.5fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.7rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FFFFFF;
  text-align: left;
  cursor: pointer;
}

.team-match-row > span:first-child {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.team-match-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.standings-subtabs {
  position: sticky;
  top: 0;
  z-index: 9;
  display: flex;
  gap: 0.45rem;
  margin: 0 -1rem 1rem;
  padding: 0.55rem 1rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 250, 255, 0.96);
  backdrop-filter: blur(18px);
  scrollbar-width: none;
}

.standings-subtabs::-webkit-scrollbar {
  display: none;
}

.standing-view-tab {
  flex: 0 0 auto;
  min-height: 2.25rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}

.standing-view-tab.is-active {
  border-color: rgba(215, 180, 90, 0.78);
  background: rgba(215, 180, 90, 0.12);
  color: var(--gold-light);
}

.standing-view {
  display: none;
}

.standing-view.is-active {
  display: block;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dot {
  width: 0.55rem;
  height: 0.55rem;
  display: inline-block;
  border-radius: 50%;
}

.dot.qualified {
  background: var(--green);
}

.dot.best-third {
  background: var(--amber);
}

.dot.eliminated {
  background: var(--danger);
}

.group-card,
.leader-card {
  overflow: hidden;
}

.group-card header,
.leader-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 92, 255, 0.05);
}

.group-card h3,
.leader-card h3 {
  color: var(--blue);
}

.group-complete {
  border-color: rgba(21, 153, 71, 0.54);
}

.group-pending {
  border-color: rgba(215, 180, 90, 0.72);
}

.group-live {
  border-color: rgba(220, 38, 38, 0.62);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.1), var(--shadow);
}

.group-phase {
  flex: 0 0 auto;
  padding: 0.35rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.group-complete .group-phase {
  color: var(--green);
  background: rgba(21, 153, 71, 0.08);
}

.group-pending .group-phase {
  color: var(--gold-light);
  background: rgba(215, 180, 90, 0.1);
}

.group-live .group-phase {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.08);
}

.standings-table {
  display: grid;
}

.standing-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.1rem 1.9rem 1.7rem minmax(4.6rem, auto);
  column-gap: 0.4rem;
  align-items: center;
  min-height: 2.65rem;
  padding: 0 0.65rem;
  border-bottom: 1px solid rgba(0, 92, 255, 0.1);
  font-size: 0.78rem;
}

.standing-row:last-child {
  border-bottom: 0;
}

.standing-row.is-head {
  min-height: 2rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.team-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  gap: 0.45rem;
  font-weight: 850;
}

.standing-numbers {
  display: contents;
  text-align: right;
}

.standing-numbers span {
  min-width: 0;
  text-align: right;
}

.standing-numbers span:last-child {
  text-align: left;
}

.status-stripe {
  width: 0.22rem;
  height: 1.55rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--muted);
}

.status-stripe.qualified {
  background: var(--green);
}

.status-stripe.best-third {
  background: var(--amber);
}

.status-stripe.eliminated {
  background: var(--danger);
}

.team-status-text {
  font-weight: 950;
}

.team-status-text.status-qualified {
  color: var(--green);
}

.team-status-text.status-best-third {
  color: var(--amber);
}

.team-status-text.status-eliminated {
  color: var(--danger);
}

.players-boards {
  margin-top: 1rem;
}

.players-boards.players-boards-single {
  margin-top: 0;
  grid-template-columns: 1fr;
}

.best-third-card .team-cell > span:last-child {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
}

.best-third-card .team-cell small {
  display: block;
  font-size: 0.7rem;
  font-weight: 750;
}

.leader-list {
  display: grid;
  gap: 0;
  padding: 0 0.85rem;
}

.leader-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-wrap: anywhere;
}

.leader-name .muted {
  margin-left: 0.1rem;
}

.leader-player.is-eliminated {
  margin: 0 -0.85rem;
  padding-right: 0.85rem;
  padding-left: 0.85rem;
  background: rgba(220, 38, 38, 0.08);
}

.leader-player.is-eliminated strong,
.leader-player.is-eliminated small,
.leader-player.is-eliminated .rating {
  color: var(--danger);
}

.stage-arrows {
  display: inline-flex;
  gap: 0.45rem;
}

.icon-button {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgba(215, 180, 90, 0.55);
  border-radius: 8px;
  background: rgba(215, 180, 90, 0.1);
  color: var(--gold-light);
  font-size: 1.8rem;
  line-height: 1;
}

.stage-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.stage-tabs::-webkit-scrollbar {
  display: none;
}

.stage-tab {
  flex: 0 0 auto;
  min-height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--blue);
  padding: 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 850;
}

.stage-tab.is-active {
  border-color: rgba(215, 180, 90, 0.78);
  background: rgba(215, 180, 90, 0.12);
  color: var(--gold-light);
}

.bracket-stage {
  touch-action: pan-y;
}

.bracket-scroll {
  margin-right: -1rem;
  margin-left: -1rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 1rem 0.7rem;
  scrollbar-width: thin;
}

.bracket-tree {
  position: relative;
  min-width: 100%;
}

.bracket-connectors {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bracket-connector {
  position: absolute;
  pointer-events: none;
}

.connector-line {
  position: absolute;
  display: block;
  background: rgba(108, 124, 147, 0.32);
}

.connector-line-start,
.connector-line-end {
  height: 2px;
  transform: translateY(-1px);
}

.connector-line-vertical {
  width: 2px;
  transform: translateX(-1px);
}

.bracket-connector.is-winner .connector-line {
  background: var(--blue);
}

.bracket-connector.is-winner .connector-line-start,
.bracket-connector.is-winner .connector-line-end {
  height: 4px;
  transform: translateY(-2px);
}

.bracket-connector.is-winner .connector-line-vertical {
  width: 4px;
  transform: translateX(-2px);
}

.bracket-column {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
}

.bracket-column h3 {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: 0.55rem;
  padding: 0.4rem 0;
  background: var(--bg);
  color: var(--blue);
  font-size: 0.86rem;
}

.bracket-column.is-active h3 {
  color: var(--gold-light);
}

.bracket-match {
  position: absolute;
  right: 0;
  left: 0;
  padding: 0.78rem 0.85rem;
  overflow: hidden;
  cursor: pointer;
}

.bracket-match.is-projected {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.88);
}

.bracket-row {
  min-height: 1.9rem;
  align-items: center;
}

.bracket-team {
  min-width: 0;
  font-weight: 850;
  line-height: 1.08;
}

.bracket-team-label,
.bracket-team-options {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.42rem;
}

.bracket-team-label span:last-child {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.bracket-team-label.is-locked-slot span:last-child {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: var(--blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.bracket-team-options {
  gap: 0.32rem;
}

.bracket-option-separator {
  color: var(--muted);
  font-weight: 900;
}

.bracket-score {
  color: var(--gold-light);
  font-weight: 950;
}

.bracket-row.is-winner .bracket-team,
.bracket-row.is-winner .bracket-score {
  color: var(--blue);
  font-weight: 950;
}

.bracket-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.1;
}

.bracket-meta span {
  min-width: 0;
}

.bracket-meta span:first-child {
  font-weight: 900;
}

.bracket-meta span:last-child {
  text-align: right;
}

.match-modal[hidden],
.team-modal[hidden] {
  display: none;
}

.match-modal,
.team-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: end;
}

.team-modal {
  z-index: 40;
}

.match-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 32, 51, 0.42);
  backdrop-filter: blur(6px);
}

.match-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(100%, 48rem);
  max-height: min(86vh, 46rem);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  background: var(--panel);
  box-shadow: 0 -22px 46px rgba(16, 32, 51, 0.18);
}

.match-modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.modal-score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.35rem;
  font-weight: 950;
}

.modal-score-row span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: clamp(1.08rem, 4vw, 1.22rem);
  overflow-wrap: anywhere;
}

.modal-score-row .flag-inline {
  width: 3.15rem;
  height: 3.15rem;
  font-size: 2rem;
  border-radius: 8px;
}

.modal-score-row span:last-child {
  justify-content: end;
  text-align: right;
}

.modal-score-row strong {
  color: var(--gold-light);
}

.match-modal-tabs {
  display: flex;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 250, 255, 0.96);
  scrollbar-width: none;
}

.match-modal-tabs::-webkit-scrollbar {
  display: none;
}

.match-modal-tab {
  flex: 0 0 auto;
  min-height: 2.2rem;
  padding: 0 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
}

.match-modal-tab.is-active {
  border-color: rgba(215, 180, 90, 0.78);
  background: rgba(215, 180, 90, 0.12);
  color: var(--gold-light);
}

#matchModalBody {
  min-height: 0;
  overflow-y: auto;
}

.team-modal-body {
  min-height: 0;
  overflow-y: auto;
}

.team-modal-title-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.team-modal-title-row .flag-detail {
  margin: 0;
}

.team-state-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  margin-top: 0.45rem;
  padding: 0 0.62rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(0, 92, 255, 0.07);
  font-size: 0.74rem;
  font-weight: 950;
}

.team-state-eliminated {
  border-color: rgba(220, 38, 38, 0.32);
  color: var(--danger);
  background: rgba(220, 38, 38, 0.08);
}

.team-state-champion,
.team-state-final,
.team-state-semifinals,
.team-state-quarterfinals,
.team-state-round16,
.team-state-round32 {
  border-color: rgba(21, 153, 71, 0.32);
  color: var(--green);
  background: rgba(21, 153, 71, 0.08);
}

.team-detail-section {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.team-detail-section:last-child {
  border-bottom: 0;
}

.team-detail-section h3 {
  color: var(--gold-light);
}

.team-form-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.form-dot {
  width: 1rem;
  height: 1rem;
  border: 2px solid #FFFFFF;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(16, 32, 51, 0.14);
}

.form-win {
  background: var(--green);
}

.form-loss {
  background: var(--danger);
}

.form-draw {
  background: #98A2B3;
}

.team-lineup-card {
  display: grid;
  gap: 0.62rem;
  padding: 0.75rem;
  border: 1px solid rgba(0, 92, 255, 0.14);
  border-radius: 8px;
  background: rgba(0, 92, 255, 0.04);
}

.team-lineup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.team-lineup-meta span {
  min-height: 1.7rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 900;
}

.team-recent-list {
  display: grid;
  gap: 0.5rem;
}

.team-recent-row {
  display: grid;
  grid-template-columns: minmax(4.8rem, 0.7fr) minmax(0, 1.4fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FFFFFF;
  text-align: left;
  cursor: pointer;
}

.team-recent-row > span:first-child {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.team-recent-row strong {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.32rem;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  line-height: 1.2;
}

.team-recent-row b {
  flex: 0 0 auto;
  color: var(--gold-light);
}

@media (max-width: 34rem) {
  .team-recent-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .team-recent-row > span:first-child {
    grid-column: 1 / -1;
  }

  .team-recent-row strong {
    flex-wrap: wrap;
  }
}

.external-link-button {
  display: inline-flex;
  min-height: 2.4rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
  padding: 0 0.9rem;
  border-radius: 8px;
  background: var(--blue);
  color: #FFFFFF;
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration: none;
}

.bottom-tabs {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.2rem 0;
  width: min(100%, 48rem);
  margin: 0 auto;
  padding: 0.5rem max(0.75rem, env(safe-area-inset-right)) max(0.42rem, env(safe-area-inset-bottom))
    max(0.75rem, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}

.tab-button {
  display: grid;
  min-height: 3.5rem;
  place-items: center;
  gap: 0.25rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.tab-button img {
  width: 1.28rem;
  height: 1.28rem;
  filter: invert(37%) sepia(11%) saturate(618%) hue-rotate(179deg) brightness(93%) contrast(88%);
}

.tab-button.is-active {
  color: var(--blue);
  background: rgba(0, 92, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 92, 255, 0.14);
}

.tab-button.is-active img {
  filter: invert(22%) sepia(97%) saturate(4588%) hue-rotate(218deg) brightness(101%) contrast(104%);
}

.footer-credit {
  grid-column: 1 / -1;
  margin: -0.05rem 0 0;
  color: var(--blue);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  opacity: 0.68;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed rgba(0, 92, 255, 0.24);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 42rem) {
  .topbar {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .header-actions {
    justify-content: end;
  }

  .ratings-grid,
  .players-boards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .groups-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
