/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  background: #f5f5f5;
  color: #222;
  --page-bg: #f5f5f5;
}

/* ── Environment backgrounds ── */
body.env-development { background-color: #e8f0ff; --page-bg: #e8f0ff; }
body.env-staging     { background-color: #fff8e1; --page-bg: #fff8e1; }

a { color: #1a73e8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Site header ── */
.site-header {
  background: #1a1a2e;
  color: #fff;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  display: flex;
  align-items: center;
  min-height: 52px;
  flex-wrap: wrap;
}

.site-header__logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  flex: 1;
}

/* Hamburger button — mobile only */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

/* Nav container — full row on desktop */
.site-header__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.site-nav {
  display: flex;
  gap: 0.25rem;
}

.site-nav__link {
  color: #ccc;
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  font-size: 0.9rem;
  text-decoration: none;
}

.site-nav__link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

.site-header__user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #aaa;
}

.site-header__name { white-space: nowrap; }

.btn-logout {
  background: none;
  border: 1px solid #555;
  color: #ccc;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-logout:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Mobile: show hamburger, collapse nav */
@media (max-width: 600px) {
  .nav-toggle { display: block; }

  .site-header__right {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 0 0.75rem;
    gap: 0;
  }

  .site-header__right.open { display: flex; }

  .site-nav { flex-direction: column; width: 100%; }

  .site-nav__link {
    padding: 0.6rem 0.5rem;
    width: 100%;
    border-radius: 0;
    font-size: 1rem;
  }

  .site-header__user {
    padding: 0.5rem 0.5rem 0;
    width: 100%;
    border-top: 1px solid #333;
    margin-top: 0.25rem;
  }
}

.btn-logout {
  background: none;
  border: 1px solid #555;
  color: #ccc;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ── Flash messages ── */
.flash-alert { background: #fde8e8; color: #c00; padding: 0.75rem 1rem; border-left: 4px solid #c00; margin: 0.5rem 1rem; border-radius: 4px; }
.flash-notice { background: #e8f5e9; color: #2e7d32; padding: 0.75rem 1rem; border-left: 4px solid #2e7d32; margin: 0.5rem 1rem; border-radius: 4px; }

/* ── Main content wrapper ── */
main, .container { max-width: 900px; margin: 1rem auto; padding: 0 1rem; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #f0f0f0; text-decoration: none; }
.btn-primary { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.btn-primary:hover { background: #1558b0; color: #fff; }

/* ── Action bar ── */
.action-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.action-bar form { margin: 0; }
.action-bar .btn { white-space: nowrap; }

/* ── Tab nav ── */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  background: #e0e4ec;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  margin: 1rem 0;
}
.tab-nav__item {
  padding: 0.4rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #555;
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
}
.tab-nav__item:hover { color: #222; background: rgba(255,255,255,0.5); text-decoration: none; }
.tab-nav__item--active { background: #fff; color: #1a73e8; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.tab-nav__item--current { background: #fff; color: #333; box-shadow: 0 1px 3px rgba(0,0,0,0.15); cursor: default; }
.tab-nav__item--primary { background: #1a73e8; color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.tab-nav__item--primary:hover { background: #1558b0; color: #fff; text-decoration: none; }
.tab-nav form { display: contents; }

.tab-nav__dropdown { position: relative; }
.tab-nav__dropdown > summary { list-style: none; }
.tab-nav__dropdown > summary::-webkit-details-marker { display: none; }
.tab-nav__dropdown[open] > summary { background: #fff; color: #1a73e8; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.tab-nav__dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 4px;
  display: flex;
  flex-direction: column;
  min-width: 170px;
  z-index: 50;
}
.tab-nav__dropdown-menu .tab-nav__item { text-align: left; width: 100%; }
.tab-nav__dropdown-menu .tab-nav__item:hover { background: #f0f4ff; color: #1a73e8; }
.tab-nav__item--muted { color: #888; font-weight: 500; }
.admin-flow-hint { background: #fff8e1; color: #7a5b00; border-left: 4px solid #f0b400; padding: 0.6rem 1rem; border-radius: 4px; margin: 0.75rem 0; font-size: 0.9rem; }

/* ── Game header ── */
.game-header { margin-bottom: 1rem; }
.game-meta { color: #666; font-size: 0.9rem; margin-top: 0.25rem; }
.game-header__title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.game-header__name { margin: 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; color: #0a1628; }
@media (max-width: 480px) {
  .tab-nav__item { padding: 0.3rem 0.45rem; font-size: 0.75rem; }
  .tab-nav { padding: 2px; }
  .tab-nav__item--mob-hide { display: none; }
  .mob-hide { display: none; }
  .wildcards-subrow__cell { font-size: 0.65em; }
}
/* ── Match summary on game page ── */
.match-summary { display: flex; gap: 1rem; margin: 1rem 0; flex-wrap: wrap; }
.match-summary__item { background: #f8f8f8; border: 1px solid #e8e8e8; border-radius: 8px; padding: 0.6rem 1rem; flex: 1; min-width: 200px; }
.match-summary__label { display: block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: #999; margin-bottom: 0.25rem; }
.match-summary__fixture { display: block; font-size: 0.95rem; margin-bottom: 0.15rem; }

/* ── Status badge ── */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-right: 0.5rem;
}
.status-draft    { background: #fff3cd; color: #856404; }
.status-active   { background: #d1e7dd; color: #0f5132; }
.status-complete { background: #e2e3e5; color: #383d41; }

/* ── Tables ── */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th { background: #f0f0f0; text-align: left; padding: 0.5rem 0.75rem; white-space: nowrap; }
.data-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #eee; vertical-align: top; }
.data-table tr:hover td { background: #fafafa; }

.scoring-rules-table th, .scoring-rules-table td { padding: 0.3rem 0.5rem; font-size: 0.85rem; text-align: center; }
.scoring-rules-table th:first-child, .scoring-rules-table td:first-child { text-align: left; }
.scoring-rules-points-input { width: 3rem; padding: 0.2rem 0.3rem; }
.scoring-rules-na { color: #ccc; }

.player-stats__controls { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.5rem; flex-wrap: wrap; }
.player-stats__key { font-size: 0.7rem; color: #888; margin: 0 0 1rem; line-height: 1.5; }
.player-stats-table th, .player-stats-table td { text-align: center; padding: 0.35rem 0.5rem; font-size: 0.9rem; }
.player-stats-table th:nth-child(2), .player-stats-table td:nth-child(2),
.player-stats-table th:nth-child(4), .player-stats-table td:nth-child(4) { text-align: left; }
.player-stats-table th:nth-child(1), .player-stats-table td:nth-child(1) {
  position: sticky;
  left: 0;
  width: 2.5rem;
  z-index: 2;
  background: var(--page-bg, #f5f5f5);
}
.player-stats-table th:nth-child(2), .player-stats-table td:nth-child(2) {
  position: sticky;
  left: 2.5rem;
  z-index: 2;
  background: var(--page-bg, #f5f5f5);
  box-shadow: 2px 0 4px -2px rgba(0, 0, 0, 0.08);
}
.player-stats-table thead th:nth-child(1), .player-stats-table thead th:nth-child(2) {
  z-index: 3;
  background: #f0f0f0;
}
.pos-badge { font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 3px; }
.pos-badge--goalkeeper { background: #fef3c7; color: #92400e; }
.pos-badge--defender { background: #dbeafe; color: #1e40af; }
.pos-badge--midfielder { background: #dcfce7; color: #166534; }
.pos-badge--forward { background: #fee2e2; color: #991b1b; }

/* ── Utility ── */
.muted { color: #999; font-size: 0.85rem; }

h2 { margin: 1.5rem 0 0.75rem; font-size: 1.2rem; }

/* ── Current player highlight ── */
.current-player td { background: #e8f0fe !important; }
/* ── Standings chart + movement ── */
.standings-chart-wrap { height: 300px; position: relative; margin-bottom: 1.5rem; }
.movement-up { color: #16a34a; font-size: 0.72em; margin-left: 3px; font-weight: 600; }
.movement-down { color: #dc2626; font-size: 0.72em; margin-left: 3px; font-weight: 600; }
/* ── Game complete notice (carousel) ── */
.notices-complete { padding: 0 0.5rem; width: 100%; max-width: 500px; margin: 0 auto; }
.notices-complete__heading { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.6rem; text-align: center; }
.notices-complete__podium { display: flex; flex-direction: column; gap: 0.25rem; }
.notices-complete__place { display: grid; grid-template-columns: 1.75rem 1fr 3rem 7.5rem; align-items: center; gap: 0.4rem; padding: 0.15rem 0; }
.notices-complete__medal { font-size: 1.1rem; text-align: center; }
.notices-complete__name { font-weight: 600; font-size: 0.95rem; }
.notices-complete__pts { color: #444; font-size: 0.95rem; text-align: right; }
.notices-complete__pts-label { font-size: 0.72rem; color: #888; }
.notices-complete__prize { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: #16a34a; font-weight: 700; font-size: 0.9rem; }
.notices-complete__prize-row { display: flex; align-items: center; gap: 4px; }
.notices-complete__prize-amt { white-space: nowrap; }
.notices-complete__payment { margin-top: 0.6rem; padding: 0.4rem 0.5rem; background: #fef9c3; border: 1px solid #fde68a; border-radius: 4px; font-size: 0.82rem; text-align: center; }
.notices-complete__payment--admin { background: #f0f4ff; border-color: #c7d2fe; }
.notices-complete__pay-link { color: #1e40af; font-weight: 700; }
.notices-complete__paid-toggle {
  display: inline-block;
  font-size: 0.65em;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  border: none;
  border-radius: 3px;
  padding: 1px 5px;
  cursor: pointer;
  white-space: nowrap;
}
.notices-complete__paid-toggle--paid { color: #166534; background: #dcfce7; }
.notices-complete__paid-check { font-size: 0.7em; color: #166534; font-weight: 700; white-space: nowrap; }
.notices-complete__ready-badge { font-size: 0.65em; font-weight: 700; white-space: nowrap; }
.notices-complete__ready-badge--ready { color: #166534; }
.notices-complete__ready-badge--missing { color: #b91c1c; }
/* ── Game complete banner (standings page) ── */
.game-complete-banner { background: linear-gradient(135deg, #fef9c3, #fde68a); border: 1px solid #f59e0b; border-radius: 8px; padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; text-align: center; }
.game-complete-banner__trophy { font-size: 2rem; line-height: 1; margin-bottom: 0.25rem; }
.game-complete-banner h2 { margin: 0 0 0.25rem; font-size: 1.3rem; }
.game-complete-banner p { margin: 0; color: #555; }
/* ── Star player ── */
.star-player { color: #e8a000; font-weight: 600; }
.wildcard-icon { width: 14px; height: 11px; vertical-align: middle; }
.wildcard-live {
  color: #2e7d32;
  font-weight: 600;
}
.pick-eliminated { opacity: 0.5; }
.pick-eliminated img { filter: grayscale(1); }
.pick-eliminated-tag {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.65em;
  font-weight: 700;
  color: #c00;
  background: #fde8e8;
  border-radius: 3px;
  padding: 0 4px;
  vertical-align: middle;
}
.pick-eliminated-tag--gold { color: #92400e; background: #fef3c7; }
.pick-eliminated-tag--silver { color: #475569; background: #e2e8f0; }
.pick-eliminated-tag--bronze { color: #92400e; background: #fde3c7; }
.wildcards-subrow td { padding-top: 0 !important; border-top: none !important; }
.wildcards-subrow__cell { font-size: 0.72em; color: #7a6500; }
.wildcards-subrow__cell .team-flag { height: 6px; width: auto; margin-right: 0.15rem; }
.match-stakes__player--wildcard { font-size: 0.85em; }
.match-stakes__wildcard-name { color: #b45309; font-weight: 600; margin-right: 3px; }
.match-stakes__wildcard-owner { color: #999; font-size: 0.8em; }
.match-stakes__wildcards {
  grid-column: 1 / -1;
  border-top: 1px solid #eee;
  padding-top: 0.25rem;
  margin-top: 0.2rem;
}
.match-stakes__wildcards > summary {
  color: #7a6500;
  font-size: 0.8em;
  cursor: pointer;
  list-style: none;
  padding: 0.1rem 0;
}
.match-stakes__wildcards > summary::-webkit-details-marker { display: none; }
.match-stakes__wildcards-body {
  display: grid;
  grid-template-columns: 1fr 70px 1fr 110px;
  margin-top: 0.25rem;
}
.match-stakes__wildcards-home { text-align: right; }
.match-stakes__wildcards-away { text-align: left; }
.match-stakes__wildcards-home, .match-stakes__wildcards-away { min-width: 0; }
.star-select {
  font-size: 0.8rem;
  max-width: 160px;
  display: block;
  margin-bottom: 0.25rem;
}

.btn-star-save {
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}
/* ── Draft board ── */
.draft-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.next-pick-card {
  background: #1a73e8;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.next-pick-done { background: #2e7d32; }
.next-pick-label { font-size: 0.8rem; opacity: 0.8; white-space: nowrap; }
.next-pick-name { font-size: 1.1rem; font-weight: 700; }

.pot-section {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.pot-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.pot-header h2 { margin: 0; font-size: 1.1rem; }

.team-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.team-chip {
  background: #e8f0fe;
  color: #1a73e8;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.pick-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem;
  background: #f8f8f8;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.form-select {
  padding: 0.4rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  flex: 1;
  min-width: 150px;
}

/* ── Page header ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Match day ── */
.match-day { margin-bottom: 2rem; }

.match-day__heading {
  font-size: 1rem;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Badges ── */
.badge-today {
  background: #1a73e8;
  color: #fff;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.group-badge {
  background: #f0f0f0;
  color: #555;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* ── Match card ── */
.match-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.match-card--played { border-left: 4px solid #2e7d32; }
.match-card__full { width: 100%; }

.match-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 160px;
}

.match-time { font-size: 0.8rem; color: #888; }

.match-card__grid {
  display: grid;
  grid-template-columns: 1fr 70px 1fr 110px;
  align-items: center;
  gap: 0 0.5rem;
  width: 100%;  
}

.match-card__home { text-align: right; font-weight: 600; font-size: 0.95rem; min-width: 0; }
.match-card__away { text-align: left; font-weight: 600; font-size: 0.95rem; min-width: 0; }
.match-card__score { text-align: center; font-weight: 700; font-size: 1.1rem; min-width: 50px; color: #222; }
.match-card__toggle { text-align: right; white-space: nowrap; }

.match-card__home-events { text-align: right; font-size: 0.8rem; color: #444; padding-top: 0.4rem; min-width: 0; }
.match-card__away-events { text-align: left; font-size: 0.8rem; color: #444; padding-top: 0.4rem; min-width: 0; }
.match-card__event { padding: 0.1rem 0; }
.match-card__pens {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  line-height: 1.2;
  color: #6b7280;
  white-space: nowrap;
}
details.match-card__details > .match-card__home-events { grid-column: 1; }
details.match-card__details > .match-card__away-events { grid-column: 3; }

details.match-card__details { width: 100%; }
details.match-card__details > summary { display: block; list-style: none; cursor: pointer; }

details.match-card__details > summary::-webkit-details-marker { display: none; }
details.match-card__details .match-card__toggle::after { content: ' ▶'; font-size: 0.7rem; color: #888; }
details.match-card__details[open] .match-card__toggle::after { content: ' ▼'; font-size: 0.7rem; color: #888; }

.match-stakes {
  display: grid;
  grid-template-columns: 1fr 70px 1fr 110px;
  font-size: 0.8rem;
  color: #555;
  margin: 0.3rem 0 0;
	width: 100%;
}
.match-stakes__home {
  text-align: right;
}
.match-stakes__away {
  text-align: left;
}
.match-stakes__player {
  padding: 0.1rem 0;
}
.match-stakes__pts {
  font-weight: 600;
  color: #333;
  margin-left: 0.3rem;
}
.match-stakes__game-tag { font-size: 0.62rem; color: #bbb; margin-left: 0.3rem; }
/* Stakes in match show context */
.match-entry .match-stakes { grid-template-columns: 1fr 1fr; background: #f5f7ff; border-radius: 6px; padding: 0.6rem 0.75rem; margin: 0 0 1rem; }
.match-entry .match-stakes__spacer { display: none; }
.match-entry .match-stakes__filler { display: none; }
.match-entry .match-stakes__player { padding: 0.2rem 0; font-size: 0.875rem; color: #333; }
.match-entry .match-stakes__home { border-right: 1px solid #dde; padding-right: 0.5rem; }
.match-entry .match-stakes__away { padding-left: 0.5rem; }
.match-entry .match-stakes__pts { background: #e8f0ff; color: #1a73e8; border-radius: 3px; padding: 1px 5px; font-size: 0.75rem; margin-left: 0.3rem; }

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

/* ── Payment summary ── */
.payment-summary {
  background: #f5f7ff;
  border: 1px solid #dde3f0;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  align-items: center;
}

.pay-stat { color: #555; }
.pay-confirmed { color: #2e7d32; font-weight: 600; }
.pay-pending   { color: #b45309; font-weight: 600; }
.pay-unpaid    { color: #c00; font-weight: 600; }

.payment-details {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #555;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
}

.team-flag {
  vertical-align: middle;
  margin-right: 0.3rem;
  display: inline-block;
}
.team-flag--right {
  vertical-align: middle;
  margin-left: 0.3rem;
  display: inline-block;
}
.team-flag--bracket {
  height: 11px;
  width: auto;
  vertical-align: middle;
  margin-right: 4px;
  display: inline-block;
}

/* ── Payment name colours ── */
.pay-name--unpaid  { color: #c00; }
.pay-name--pending { color: #b45309; }
.pay-name--paid    { color: #2e7d32; }

/* ── Payment badge ── */
.payment-badge {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 5px;
}
.payment-badge--unpaid  { background: #c00; }
.payment-badge--pending { background: #f59e0b; }
.payment-badge--paid    { background: #2e7d32; }

.payment-dot--unpaid {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #c00;
  border: none;
  cursor: pointer;
  padding: 0;
  vertical-align: middle;
  margin-right: 5px;
}

.payment-dot--mine {
  width: 14px;
  height: 14px;
  box-shadow: 0 0 0 2px white, 0 0 0 3px currentColor;
}

.payment-dot--unpaid.payment-dot--mine {
  animation: pulse-unpaid 1.5s infinite;
}

@keyframes pulse-unpaid {
  0%   { box-shadow: 0 0 0 2px white, 0 0 0 3px #c00; }
  50%  { box-shadow: 0 0 0 2px white, 0 0 0 5px #c00; }
  100% { box-shadow: 0 0 0 2px white, 0 0 0 3px #c00; }
}

.payment-badge--mine {
  width: 14px;
  height: 14px;
  box-shadow: 0 0 0 2px white, 0 0 0 3px currentColor;
}

/* ── Payment action buttons ── */
.btn-pay-claim {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-pay-confirm {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
}

.login-card {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  text-align: center;
}

.login-logo {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.login-card h1 {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.form-group {
  text-align: left;
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.form-group--inline { display: flex; align-items: center; gap: 0.5rem; }
.form-group--inline input[type="checkbox"] { width: auto; margin: 0; }
.form-group--inline label { margin: 0; font-weight: 400; }

.form-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
}

.btn-full {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
}
.draft-message-box {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 600px;
}

.draft-message-box pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}
/* ── Page header ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.page-header h1 { margin: 0; }
.page-header .action-bar { margin: 0; }

/* ── Role badges ── */
.role-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}
.role-system_admin { background: #cfe2ff; color: #084298; }
.role-game_admin   { background: #fff3cd; color: #856404; }
.role-player       { background: #e2e3e5; color: #383d41; }

/* ── Small / danger buttons ── */
.btn-sm { font-size: 0.8rem; padding: 0.25rem 0.6rem; }
.btn-danger { background: #dc3545; color: #fff; border-color: #dc3545; }
.btn-danger:hover { background: #bb2d3b; color: #fff; }

/* ── Actions cell ── */
.actions-cell { white-space: nowrap; }
.actions-cell form { display: inline; }

/* ── Utility ── */
.text-ok { color: #2e7d32; }
.btn-unset-star {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0 2px;
  line-height: 1;
}
.btn-unset-star:hover { color: #c00; }
/* ── Mobile ── */
@media (max-width: 600px) {
  h1 { font-size: 1.3rem; }
  h2 { font-size: 1.05rem; margin: 0.75rem 0 0.4rem; }

  main, .container { padding: 0 0.5rem; margin: 0.5rem auto; }

  .page-header { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .page-header h1 { margin: 0; }

  .action-bar { gap: 0.35rem; }
  .action-bar .btn { font-size: 0.8rem; padding: 0.35rem 0.6rem; }

  .data-table { font-size: 0.8rem; }
  .data-table th,
  .data-table td { padding: 0.35rem 0.4rem; }

  /* Hide Edit column on game show — players don't need it */
  .data-table .col-edit { display: none; }

  .payment-summary { font-size: 0.8rem; gap: 0.4rem; }

  .star-select { max-width: 110px; font-size: 0.75rem; }

  .next-pick-card { padding: 0.6rem 0.75rem; }
  .next-pick-name { font-size: 1rem; }

  .pot-section { padding: 0.75rem; }

  .pick-form { flex-direction: column; }
  .pick-form .form-select { width: 100%; }
  .pick-form .btn { width: 100%; }
	
	/* Standings — hide point breakdown columns, keep total */
	  .standings-breakdown { display: none; }
	/* Match cards */
	  .match-card__meta { min-width: unset; width: 100%; justify-content: space-between; }
	  .team-name { font-size: 0.75rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
		.match-card__grid,
		.match-stakes { grid-template-columns: 1fr 50px 1fr 92px; width: 100%; }
		.match-stakes__player { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
		.match-stakes__wildcards-body { grid-template-columns: 1fr 30px 1fr; }
		.match-card__home, .match-card__away { font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
		.match-card__toggle { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; white-space: normal; }
		.match-card__toggle .btn-sm { font-size: 0.68rem; padding: 0.2rem 0.4rem; white-space: nowrap; }
}
/* ── Rules page ── */
.rules-page { max-width: 600px; }
.rules-section { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 1.25rem; margin-bottom: 1.25rem; }
.rules-section h2 { margin: 0 0 0.75rem; font-size: 1.05rem; }
.rules-section p { font-size: 0.95rem; color: #444; margin-bottom: 0.75rem; }
.rules-section p:last-child { margin-bottom: 0; }
.pts { font-weight: 700; text-align: right; width: 60px; }
.pts--positive { color: #2e7d32; }
.pts--negative { color: #c00; }
.pts--neutral  { color: #888; }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}
.modal-box {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box h2 { margin: 0 0 1rem; }
.modal-box h3 { margin: 1rem 0 0.5rem; font-size: 0.95rem; color: #555; text-transform: uppercase; letter-spacing: 0.04em; }
.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #999;
  line-height: 1;
}
.modal-close:hover { color: #333; }
/* ── Match entry ── */
.match-entry { max-width: 500px; margin: 0 auto; }

.match-entry__header {
  background: #1a1a2e;
  color: #fff;
  border-radius: 8px;
  padding: 1.25rem 1rem;
  text-align: center;
  margin-bottom: 1rem;
}

.match-entry__teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.match-entry__team {
  font-weight: 700;
  font-size: 1rem;
  flex: 1;
}

.match-entry__team:first-child { text-align: right; }
.match-entry__team:last-child  { text-align: left; }

.match-entry__score {
  font-size: 1.5rem;
  font-weight: 700;
  min-width: 60px;
  text-align: center;
}

.score-entry-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.score-team {
  font-size: 0.85rem;
  font-weight: 600;
  flex: 1;
  min-width: 60px;
}

.score-team:first-child { text-align: right; }

.score-sep { font-size: 1.2rem; font-weight: 700; color: #666; }

.match-entry__meta { font-size: 0.8rem; opacity: 0.7; margin: 0; }
.back-link { max-width: 500px; margin: 0.5rem auto 1rem; }
.back-link a { font-size: 0.875rem; color: #666; }
.back-link a:hover { color: #1a73e8; text-decoration: none; }

.entry-section {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.entry-section__title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
  margin: 0 0 0.75rem;
}

.stat-list { margin-bottom: 1rem; }

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

.stat-chips { display: flex; gap: 0.3rem; }

.stat-chip {
  background: #f0f0f0;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.8rem;
}

.stat-chip--red { background: #fde8e8; }

.stat-entry-row {
  display: flex;
  gap: 0.75rem;
  margin: 0.75rem 0;
  align-items: flex-end;
}

.stat-entry-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.stat-entry-field label { font-weight: 600; }

.entry-count { width: 60px; text-align: center; font-size: 1.1rem; padding: 0.4rem; }

.entry-checkbox { width: 24px; height: 24px; cursor: pointer; }

.entry-details { margin-top: 0.75rem; }

.entry-summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #3b5bdb;
  padding: 0.4rem 0;
  list-style: none;
}
.entry-summary::-webkit-details-marker { display: none; }
.entry-summary::before { content: "+ "; }
details[open] .entry-summary::before { content: "− "; }

.btn-remove {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.2rem;
  line-height: 1;
}

.btn-remove:hover { color: #c00; }

.match-status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.match-status-badge--unstarted  { background: #f0f0f0; color: #666; }
.match-status-badge--first_half  { background: #d4f5d4; color: #1a7a1a; }
.match-status-badge--second_half { background: #b6edb6; color: #155215; }
.match-status-badge--ht         { background: #fff3cd; color: #856404; }
.match-status-badge--ft         { background: #cfe2ff; color: #084298; }
.match-status-badge--completed  { background: #e2e3e5; color: #41464b; }
.match-status-badge--et_first_half  { background: #ffe8cc; color: #7a4000; }
.match-status-badge--et_ht          { background: #fff3cd; color: #856404; }
.match-status-badge--et_second_half { background: #ffd9a8; color: #6b3500; }
.match-status-badge--ft_et          { background: #cfe2ff; color: #084298; }
.match-status-badge--penalties      { background: #e8d5ff; color: #5a00a8; }
.match-status-badge--ft_draw  { background: #cfe2ff; color: #084298; }
.match-status-badge--ft_aet   { background: #cfe2ff; color: #084298; }
.match-status-badge--aet_draw { background: #e8d5ff; color: #5a00a8; }
.match-status-badge--ft_pens  { background: #cfe2ff; color: #084298; }

/* ── Points breakdown ── */
.breakdown-section { border: 1px solid #e8e8e8; border-radius: 8px; padding: 1rem 1.25rem; margin: 1rem 0; }
.breakdown-team { margin: 0 0 0.75rem; font-size: 1.1rem; }
.breakdown-star { margin: 0.75rem 0 0.25rem; font-size: 0.95rem; }
.breakdown-total-row td { background: #f8f8f8; font-size: 0.85rem; color: #666; border-top: 2px solid #e0e0e0; }

/* ── Prize positions ── */
.prize-position-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }

/* ── Button variants ── */
.btn-warning { background: #f59e0b; color: #fff; border: none; }
.btn-warning:hover { background: #d97706; }
.btn-success { background: #2e7d32; color: #fff; border: none; }
.btn-success:hover { background: #1b5e20; }

/* ── Form card ── */
.form-card { max-width: 480px; }
.form-errors { background: #fde8e8; border: 1px solid #f5c6cb; border-radius: 4px; padding: 0.75rem 1rem; margin-bottom: 1rem; color: #842029; font-size: 0.9rem; }
.form-errors p { margin: 0.25rem 0; }
.form-hint { font-size: 0.8rem; color: #888; margin: 0.2rem 0 0.5rem; }

/* ── Player search (transfer admin) ── */
.player-search-wrapper { position: relative; }
.player-search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 16rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}
.player-search-group {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: bold;
  color: #666;
  background: #f5f5f5;
}
.player-search-option {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}
.player-search-option:hover {
  background: #e8f0ff;
}
.player-search-empty {
  padding: 0.4rem 0.6rem;
  color: #999;
  font-style: italic;
}
.prize-position-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.prize-position-label { min-width: 2.5rem; font-weight: 600; font-size: 0.9rem; }
.prize-position-input { max-width: 120px; }

.pay-prize { font-weight: 600; color: #333; background: #eef0f8; border: 1px solid #dde3f0; border-radius: 4px; cursor: default; padding: 0.15rem 0.5rem; font-size: inherit; white-space: nowrap; }
.pay-prize--paid { color: #2e7d32; background: #e8f5e9; border-color: #c8e6c9; }
button.pay-prize { cursor: pointer; }
button.pay-prize:hover { border-color: #1a73e8; color: #1a73e8; background: #e8f0ff; }
.prize-summary { width: 100%; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.35rem; padding-top: 0.4rem; border-top: 1px solid #dde3f0; }
a.pay-name { text-decoration: none; padding: 0.1rem 0.25rem; border-radius: 3px; }
a.pay-name:hover { background: #e8f0ff; text-decoration: none; }
.pts-cell { padding: 0 !important; }
.pts-link { display: block; padding: 0.5rem 0.75rem; text-decoration: none; color: inherit; border-radius: 4px; }
.pts-link:hover { background: #e8f0ff; text-decoration: none; }
.payment-dot--paid {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2e7d32;
  border: none;
  cursor: pointer;
  padding: 0;
  vertical-align: middle;
  margin-right: 5px;
}

/* ── Points Breakdown ── */
.breakdown-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.breakdown-card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 1rem;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  gap: 0.5rem;
}
.breakdown-card__total {
  font-weight: 700;
  white-space: nowrap;
}
.breakdown-card__footer {
  display: flex;
  gap: 1.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-top: 1px solid #e0e0e0;
  background: #fafafa;
}
.breakdown-table { margin: 0; border: none; }
.breakdown-table td { font-size: 0.85rem; padding: 0.3rem 0.75rem; border-bottom: 1px solid #f0f0f0; }
.breakdown-table tr:last-child td { border-bottom: none; }
.breakdown-date { color: #888; white-space: nowrap; }
.breakdown-result { font-weight: 700; text-align: center; width: 24px; }
.breakdown-result--win  { color: #2e7d32; }
.breakdown-result--draw { color: #e65100; }
.breakdown-result--loss { color: #999; }
.breakdown-pts { text-align: right; white-space: nowrap; color: #555; }
.breakdown-pts strong { color: #111; }
.breakdown-star-pts { color: #b8860b; margin-left: 0.3rem; }
.breakdown-inplay { background: #fff8e1; }
.breakdown-inplay .breakdown-result { color: #999; }

/* ── Group Standings ── */
.group-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: start;
}
.group-section { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
.group-card > summary { display: block; list-style: none; cursor: pointer; }
.group-card > summary::-webkit-details-marker { display: none; }
.group-section__heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}
.group-card__toggle::after { content: ' ▶'; font-size: 0.7rem; color: #888; }
details.group-card[open] .group-card__toggle::after { content: ' ▼'; font-size: 0.7rem; color: #888; }
.group-table { margin: 0; font-size: 0.8rem; }
.group-table th, .group-table td { padding: 0.25rem 0.4rem; }
.group-team-col { min-width: 120px; }
.group-num-col { text-align: center; width: 28px; }
.group-advances td:first-child { border-left: 3px solid #2e7d32; }
.group-third td:first-child { border-left: 3px solid #e65100; }
.group-eliminated { color: #999; }
.third-place-cutoff td { border-top: 2px dashed #c00; }
.group-results-list {
  border-top: 1px solid #e0e0e0;
  padding: 0.25rem 0;
  background: #fafafa;
}
.group-result-row {
  display: grid;
  grid-template-columns: 52px 1fr 44px 1fr;
  align-items: center;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border-bottom: 1px solid #f0f0f0;
}
.group-result-row:last-child { border-bottom: none; }
.group-result__info { font-size: 0.7rem; color: #888; line-height: 1.2; white-space: nowrap; }
.group-result__time { font-size: 0.65rem; }
.group-result__status { font-weight: 700; font-size: 0.7rem; }
.group-result__status--live { color: #2e7d32; }
.group-result__team { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-result__home { text-align: right; }
.group-result__score { text-align: center; font-weight: 700; font-size: 0.8rem; }
.third-place-wrap { overflow-x: auto; display: flex; justify-content: center; margin-bottom: 2rem; }
.third-place-table { width: auto; min-width: 420px; }
.group-drafter { font-size: 0.62rem; color: #bbb; margin-left: 0.15rem; }
.group-live td:first-child { background-color: #e8f5e9; }
.group-live { font-weight: 500; }
.group-team-cell { display: flex; align-items: center; justify-content: space-between; gap: 0.25rem; }
.group-live-badge { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; color: #fff; background: #2e7d32; border-radius: 3px; padding: 1px 4px; margin-left: auto; white-space: nowrap; }
@media (max-width: 900px) { .group-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .group-grid { grid-template-columns: 1fr; }
  .group-hide-mobile { display: none; }
  .third-place-table { width: 100%; min-width: 0; }
}
/* ── Profile ── */
.profile-section-card { border: 1px solid #e0e0e0; border-radius: 8px; padding: 1.25rem; margin-bottom: 1.5rem; background: #fff; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 0.5rem; }
.profile-avatar-preview { margin-bottom: 0.5rem; }
.form-card { max-width: 600px; margin: 0 auto; }
.profile-header { display: flex; align-items: center; gap: 1rem; }
.profile-avatar--header { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.profile-avatar-placeholder { width: 60px; height: 60px; border-radius: 50%; background: #e0e0e0; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.profile-name { margin: 0; }
.profile-email { margin: 0.1rem 0 0; }
.sort-code-row { display: flex; align-items: center; gap: 0.4rem; }
.sort-code-box { width: 3rem !important; text-align: center; }
.sort-code-sep { font-weight: 700; color: #888; }
.nav-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 0.25rem; }

@keyframes stream-flash {
  0%   { background-color: rgba(255, 220, 50, 0.5); }
  100% { background-color: transparent; }
}
.stream-flash {
  animation: stream-flash 1.2s ease-out;
}
@keyframes bracket-flash {
  0%   { box-shadow: 0 6px 16px rgba(26, 115, 232, 0.35); background-color: rgba(26, 115, 232, 0.08); transform: translateY(-3px); }
  60%  { transform: translateY(0); }
  100% { box-shadow: 0 1px 3px rgba(0,0,0,0.06); background-color: #fff; }
}
.bracket-flash {
  animation: bracket-flash 1.0s ease-out;
}
/* ── Bracket visual ── */
.bracket-visual { display: flex; overflow-x: auto; gap: 8px; padding: 12px 0 4px; -webkit-overflow-scrolling: touch; position: relative; }
.bracket-col { min-width: 155px; flex-shrink: 0; display: flex; flex-direction: column; height: 1280px; overflow: visible; }
.bracket-col__body { flex: 1; display: flex; flex-direction: column; overflow: visible; }
/* Pairs: each pair fills equal vertical space and contains two slots */
.bracket-pair { flex: 1; display: flex; flex-direction: column; position: relative; }
.bracket-pair--single { justify-content: center; }
/* Slots: each slot fills half the pair and centers its card */
.bracket-slot { flex: 1; display: flex; align-items: center; position: relative; }
/* "]" connector exits right side of each pair into the column gap */
.bracket-col:not(.bracket-col--last) .bracket-pair:not(.bracket-pair--single)::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 25%;
  bottom: 25%;
  width: 12px;
  border-top: 1.5px solid #c8c8c8;
  border-right: 1.5px solid #c8c8c8;
  border-bottom: 1.5px solid #c8c8c8;
  border-radius: 0 3px 3px 0;
  pointer-events: none;
  z-index: 1;
}
/* "→" stub enters left side of each slot in non-first columns */
.bracket-col:not(:first-child) .bracket-slot::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 12px;
  height: 0;
  border-top: 1.5px solid #c8c8c8;
  pointer-events: none;
}
/* Match cards — link is the outer element */
.bracket-match__link { display: block; text-decoration: none; color: inherit; margin: 2px 4px 2px 12px; width: 100%; box-sizing: border-box; }
.bracket-col:first-child .bracket-match__link { margin-left: 4px; }
.bracket-match__link:hover { text-decoration: none; }
.bracket-match__link:hover .bracket-match { border-color: #0066cc; box-shadow: 0 1px 5px rgba(0,102,204,0.15); background: #f0f4ff; }
.bracket-match { border: 1px solid #ddd; border-radius: 5px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.06); overflow: hidden; }
.bracket-match--tbd { opacity: 0.25; border-style: dashed; box-shadow: none; }
.bracket-match--empty { border: none; box-shadow: none; background: transparent; min-height: 44px; }
.bracket-match--live { border-color: #28a745; background: #f4fff6; }
.bracket-match__date { display: flex; justify-content: space-between; align-items: center; font-size: 0.6rem; color: #aaa; padding: 3px 7px; background: #fafafa; border-bottom: 1px solid #eee; }
.bracket-match__status { font-size: 0.6rem; font-weight: 700; color: #888; }
.bracket-match__status--live { color: #28a745; }
.bracket-match__row { display: flex; justify-content: space-between; align-items: center; padding: 4px 7px; gap: 4px; }
.bracket-match__row + .bracket-match__row { border-top: 1px solid #eee; }
.bracket-match__row--winner { background: #f0f4ff; }
.bracket-match__team { font-size: 0.7rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; flex: 1; min-width: 0; }
.bracket-match__row--winner .bracket-match__team { font-weight: 700; color: #0055bb; }
.bracket-match__team-score { font-size: 0.72rem; font-weight: 700; color: #555; flex-shrink: 0; min-width: 14px; text-align: right; }
.bracket-match__row--winner .bracket-match__team-score { color: #0055bb; }
.bracket-match__pens { font-size: 0.55rem; vertical-align: sub; color: inherit; }
.bracket-match__row--winner .bracket-match__pens { color: #0055bb; }
.bracket-3p { margin-top: 16px; margin-left: calc(3 * (155px + 8px)); display: inline-block; }
.bracket-3p__label { font-size: 0.7rem; color: #888; margin-bottom: 4px; }
.bracket-final-group { display: contents; }
.bracket-3p-col { display: none; }
.bracket-3p-wrapper { margin-top: 16px; width: 155px; }
@media (min-width: 769px) {
  .bracket-3p-wrapper { display: none; }
}
@media (max-width: 768px) {
  .bracket-3p-wrapper { display: none; }
  .bracket-final-group { display: flex; flex-direction: column; position: relative; }
  .bracket-3p-col { position: absolute; top: 693px; left: 0; display: block; min-width: 155px; }
}
.bracket-3p .bracket-match__link { margin-left: 4px; width: 155px; }
.bracket-3p-desktop-box { position: absolute; z-index: 2; }
.bracket-3p-desktop-connector { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 1; }
.bracket-3p-desktop-connector__seg { position: absolute; border-color: #c8c8c8; border-style: solid; border-width: 0; border-radius: 0 3px 3px 0; }
.bracket-3p-desktop-connector__seg--right { border-right-width: 1.5px; }
.bracket-3p-desktop-connector__seg--top { border-top-width: 1.5px; }
.bracket-3p-desktop-connector__seg--bottom { border-bottom-width: 1.5px; }
.bracket-sticky-headers {
  position: sticky;
  top: 52px; /* height of .site-header, which is also sticky at top:0 */
  z-index: 10;
  background: #fff;
  overflow: hidden;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.bracket-sticky-headers__inner {
  display: flex;
  gap: 8px;
  padding: 8px 0;
}
.bracket-sticky-headers__cell {
  flex-shrink: 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #444;
}
/* Round sections */
.bracket-round-section { margin-top: 2rem; }
.bracket-round-section h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid #0066cc; padding-bottom: 4px; margin-bottom: 1rem; }
/* Notices Carousel */
.notices-carousel { margin: 0.75rem 0; border: 1px solid #d0d7de; border-radius: 8px; background: #fff; }
.notices-carousel__slides { display: grid; }
.notices-carousel__slide { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; grid-area: 1 / 1; }
.notices-carousel__slide--hidden { visibility: hidden; pointer-events: none; }
.notices-carousel__slide--success { background: #dcfce7; border-left: 4px solid #16a34a; }
.notices-carousel__slide--info    { background: #eff6ff; border-left: 4px solid #3b82f6; }
.notices-carousel__slide--warning { background: #fffbeb; border-left: 4px solid #f59e0b; }
.notices-carousel__icon { font-size: 1.1rem; flex-shrink: 0; }
.notices-carousel__text { flex: 1; font-size: 0.9rem; }
.notices-carousel__link { margin-left: 0.4rem; font-weight: 600; }
.notices-carousel__nav  { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.35rem; background: #f0f2f5; border-top: 1px solid #d0d7de; }
.notices-carousel__dots { display: flex; gap: 0.35rem; }
.notices-carousel__dot  { width: 8px; height: 8px; border-radius: 50%; background: #c0c8d0; transition: background 0.2s; }
.notices-carousel__dot--active { background: #3b82f6; }
.notices-carousel__arrow { background: none; border: none; font-size: 1.3rem; color: #666; cursor: pointer; padding: 0 0.3rem; line-height: 1; }
.notices-carousel__arrow:hover { color: #222; }
/* Finance card inside carousel */
.notices-finance { padding: 0.75rem 1rem; font-size: 0.88rem; display: flex; flex-direction: column; gap: 0.4rem; width: 100%; }
.notices-finance__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
.notices-finance__pool { margin-left: auto; }
.notices-finance__prizes { flex-wrap: nowrap; overflow-x: auto; padding-right: 1rem; }
.notices-finance__bank { font-size: 0.82rem; color: #555; background: #f8f9fa; border: 1px solid #e0e4ec; border-radius: 4px; padding: 0.4rem 0.6rem; margin-top: 0.1rem; }
.notices-finance__bank p { margin: 0; }
@media (max-width: 480px) {
  .notices-finance__prizes .pay-prize { font-size: 0.72rem; padding: 0.08rem 0.28rem; }
  .notices-finance__prizes { gap: 0.25rem; }
}
/* Wildstar Draft Board */
/* Admin queue overview */
.ws-admin-queues { display: flex; flex-direction: column; gap: 1.5rem; }
.ws-admin-queue__player { border: 1px solid #e0e4ec; border-radius: 8px; padding: 1rem; }
.ws-admin-queue__name { margin: 0 0 0.75rem; font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.ws-admin-queue__pos-badge { background: #e0e4ec; border-radius: 4px; padding: 0.1rem 0.4rem; font-size: 0.8rem; font-weight: 600; }
.ws-admin-queue__cols { display: flex; gap: 2rem; flex-wrap: wrap; }
.ws-admin-queue__col { flex: 1; min-width: 220px; }
.ws-admin-queue__col--dead { opacity: 0.6; }
.ws-admin-queue__dead-heading { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: #888; margin: 0 0 0.4rem; }
.ws-admin-queue__item { display: flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0; font-size: 0.88rem; }
.ws-admin-queue__item--dead { text-decoration: line-through; }
.ws-admin-queue__rank { width: 1.4rem; text-align: right; color: #888; font-size: 0.8rem; flex-shrink: 0; }
.ws-admin-queue__pname { font-weight: 500; }
.ws-admin-queue__team { font-size: 0.8rem; }
.ws-progress { background: #f0f2f5; border: 1px solid #d0d7de; border-radius: 8px; padding: 0.5rem 1rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.ws-progress__bar { height: 6px; background: #d0d7de; border-radius: 3px; overflow: hidden; }
.ws-progress__fill { height: 100%; background: #3b82f6; border-radius: 3px; transition: width 0.4s; }
.ws-progress__label { font-size: 0.85rem; color: #555; }
.ws-current { margin-bottom: 1rem; }
.ws-current__card { display: flex; align-items: flex-start; gap: 0.75rem; padding: 1rem; border-radius: 8px; border: 1px solid #d0d7de; }
.ws-current__card--yours   { background: #dcfce7; border-color: #16a34a; }
.ws-current__card--waiting { background: #eff6ff; border-color: #3b82f6; }
.ws-current__card--complete { background: #f0fdf4; border-color: #16a34a; }
.ws-current__icon { font-size: 1.4rem; flex-shrink: 0; }
.ws-current__body { display: flex; flex-direction: column; gap: 0.25rem; }
.ws-countdown { font-size: 0.85rem; color: #555; }
.ws-countdown--urgent { color: #c00; font-weight: 600; }
.ws-pool { margin-bottom: 1.5rem; }
.ws-pool__controls { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
#ws-pool-list { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start; margin-top: 0.5rem; }
#ws-pool-list, #ws-bonus-pool-list { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start; margin-top: 0.5rem; }
.ws-pool__group { flex: 0 1 calc(25% - 0.6rem); min-width: 155px; background: #f8f9fa; border: 1px solid #e0e4ec; border-radius: 8px; overflow: hidden; margin-bottom: 0; }
.ws-pool__team-name { display: flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.6rem; background: #e8f0ff; font-size: 0.8rem; font-weight: 700; color: #1e3a8a; border-bottom: 1px solid #c7d7f7; }
.ws-pool__row { display: flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.6rem; border-bottom: 1px solid #f0f2f5; }
.ws-pool__row:last-child { border-bottom: none; }
.ws-pool__pos { font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.3rem; border-radius: 3px; min-width: 1.8rem; text-align: center; background: #e0e4ec; color: #444; }
.ws-pool__pos--goalkeeper { background: #fef3c7; color: #92400e; }
.ws-pool__pos--defender { background: #dbeafe; color: #1e40af; }
.ws-pool__pos--midfielder { background: #dcfce7; color: #166534; }
.ws-pool__pos--forward { background: #fee2e2; color: #991b1b; }
.ws-pool__name { flex: 1; font-size: 0.85rem; }
@media (max-width: 600px) { .ws-pool__group { flex: 0 1 calc(50% - 0.4rem); } }
.ws-grid { margin-bottom: 1.5rem; }
.ws-grid__table { font-size: 0.85rem; }
.ws-grid__round-head { font-size: 0.8rem; color: #666; white-space: nowrap; }
.ws-grid__player-name { white-space: nowrap; }
.ws-grid__row--me td { background: #eff6ff; }
.ws-grid__row--picking td { background: #dcfce7; }
.ws-grid__row--me.ws-grid__row--picking td { background: #bbf7d0; }
.ws-grid__cell { font-size: 0.82rem; }
.ws-grid__cell--current { background: #fef9c3 !important; }
.ws-grid__pick-name { font-weight: 500; }
.ws-grid__pick-pos { font-size: 0.75rem; margin-left: 0.2rem; }
.ws-picking-badge { display: inline-block; font-size: 0.7rem; background: #16a34a; color: #fff; border-radius: 10px; padding: 0.1rem 0.4rem; margin-left: 0.3rem; }
.ws-my-picks { margin-bottom: 1.5rem; }
.ws-my-picks__list { display: flex; flex-direction: column; gap: 0.4rem; }
.ws-my-picks__item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; background: #f8f9fa; border-radius: 6px; font-size: 0.9rem; }
.ws-my-picks__num { font-size: 0.75rem; color: #888; min-width: 3.5rem; }
/* Wildstar Queue */
.ws-queue { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.ws-queue__item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; background: #f8f9fa; border: 1px solid #e0e4ec; border-radius: 6px; }
.ws-queue__pos { font-size: 0.75rem; color: #888; min-width: 1.25rem; text-align: center; }
.ws-queue__arrows { display: flex; flex-direction: column; gap: 1px; }
.ws-queue__arrow { background: none; border: 1px solid #d0d7de; border-radius: 3px; font-size: 0.65rem; line-height: 1; padding: 1px 4px; cursor: pointer; color: #555; }
.ws-queue__arrow:hover:not(:disabled) { background: #e8f0ff; border-color: #3b82f6; color: #3b82f6; }
.ws-queue__arrow:disabled { opacity: 0.3; cursor: default; }
.ws-queue__player { flex: 1; font-size: 0.9rem; }
.ws-queue__remove { color: #888; border-color: #ddd; }
.ws-queue__remove:hover { color: #c00; border-color: #c00; }
.ws-queue__in-queue { font-size: 0.78rem; color: #16a34a; font-weight: 600; }
.ws-queue__full { font-size: 0.78rem; }
.ws-queue-split { display: flex; gap: 1.5rem; align-items: flex-start; }
.ws-queue-split__col { flex: 1; min-width: 0; }
.ws-queue-split__col--dead { flex: 0 0 300px; }
.ws-queue__item--dead { opacity: 0.65; background: #fdf2f2; border-color: #f5c6c6; }
.ws-queue__dead-name { color: #888; text-decoration: line-through; }
.ws-queue__dead-reason { font-size: 0.75rem; color: #c00; white-space: nowrap; margin-right: 0.5rem; }
.ws-queue__dead-reason--picked { color: #1a7340; font-weight: 600; }
.ws-admin-queue__item--picked { opacity: 1; }
.ws-queue__item--picked { background: #f0fdf4; border-color: #bbf7d0; }
.ws-queue__picked-reason { font-size: 0.75rem; color: #16a34a; white-space: nowrap; margin-right: 0.5rem; font-weight: 600; }
.ws-queue__drag { cursor: grab; color: #aaa; margin-right: 0.25rem; font-size: 1.1rem; user-select: none; }
.ws-queue__item--dragging { opacity: 0.4; }
.ws-queue__item--dragover { border-top: 2px solid #3b82f6; }
.ws-queue-locked-notice { background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.88rem; color: #92400e; margin-bottom: 1rem; }
.ws-defer-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid rgba(0,0,0,0.1); }
.ws-draft-info { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; padding: 0.6rem 0.75rem; background: #f0f4ff; border: 1px solid #c7d7f7; border-radius: 6px; font-size: 0.875rem; margin-bottom: 1.25rem; }
@media (max-width: 640px) { .ws-queue-split { flex-direction: column; } .ws-queue-split__col--dead { flex: 1; } }
/* Wildstar pre-queue notice card */
.notices-wspq { padding: 0 0.5rem; width: 100%; max-width: 500px; margin: 0 auto; }
.notices-wspq__top { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.2rem 1rem; margin-bottom: 0.55rem; }
.notices-wspq__title { font-size: 0.92rem; }
.notices-wspq__when { font-size: 0.8rem; color: #1e40af; }
.notices-wspq__body { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.notices-wspq__stats { display: flex; gap: 0; }
.notices-wspq__stat { display: flex; flex-direction: column; align-items: center; padding: 0.2rem 0.85rem; border-right: 1px solid rgba(59,130,246,0.3); }
.notices-wspq__stat:last-child { border-right: none; }
.notices-wspq__num { font-size: 1.15rem; font-weight: 700; color: #1e3a8a; line-height: 1.1; }
.notices-wspq__stat--mine .notices-wspq__num { color: #166534; }
.notices-wspq__label { font-size: 0.67rem; color: #4b6aa5; text-align: center; text-transform: uppercase; letter-spacing: 0.04em; }
.notices-wspq__actions { display: flex; align-items: center; gap: 0.75rem; }
.notices-wspq__closes { font-size: 0.78rem; color: #4b6aa5; }
/* Wildstar draft notice card */
.notices-wsdraft { padding: 0 0.5rem; width: 100%; max-width: 500px; margin: 0 auto; }
.notices-wsdraft__top { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.2rem 1rem; margin-bottom: 0.55rem; }
.notices-wsdraft__title { font-size: 0.92rem; }
.notices-wsdraft__when { font-size: 0.8rem; color: #1e40af; font-weight: 600; }
.notices-wsdraft__body { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.notices-wsdraft__stats { display: flex; gap: 0; }
.notices-wsdraft__stat { display: flex; flex-direction: column; align-items: center; padding: 0.2rem 0.85rem; border-right: 1px solid rgba(59,130,246,0.3); }
.notices-wsdraft__stat:last-child { border-right: none; }
.notices-wsdraft__num { font-size: 1.15rem; font-weight: 700; color: #1e3a8a; line-height: 1.1; }
.notices-wsdraft__stat--mine .notices-wsdraft__num { color: #166534; }
.notices-wsdraft__label { font-size: 0.67rem; color: #4b6aa5; text-align: center; text-transform: uppercase; letter-spacing: 0.04em; }
.notices-wsdraft__actions { display: flex; align-items: center; }
.notices-wsdraft__stat--mine .ws-countdown { display: inline-block; min-width: 4.6rem; text-align: center; }
.notices-wsdraft--yours .notices-wsdraft__title { animation: ws-notice-pulse 2.5s ease-in-out infinite; }
.notices-wsdraft--yours .notices-wsdraft__title strong { color: #166534; font-size: 1.05em; letter-spacing: -0.01em; }
@keyframes ws-notice-pulse { 0%,100% { opacity:1; } 50% { opacity:0.65; } }
/* QF replacement pool */
.replacement-team { margin-bottom: 1rem; }
.replacement-team__name { font-weight: 700; font-size: 0.9rem; color: #444; margin-bottom: 0.35rem; }
.replacement-team__players { display: flex; flex-wrap: wrap; gap: 4px; }
.replacement-claim-btn { background: #f0f4ff; border: 1px solid #c7d2fe; color: #1e40af; font-size: 0.8rem; }
.replacement-claim-btn:hover { background: #dbeafe; }
.notices-wsreplace { padding: 0 0.5rem; width: 100%; max-width: 500px; margin: 0 auto; }
.notices-wsreplace__top { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.2rem 1rem; margin-bottom: 0.55rem; }
.notices-wsreplace__title { font-size: 0.92rem; }
.notices-wsreplace__when { font-size: 0.8rem; color: #1e40af; font-weight: 600; }
.notices-wsreplace__body { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.notices-wsreplace__desc { font-size: 0.82rem; color: #444; margin: 0; flex: 1; }
.notices-wsreplace__claimed { font-size: 0.88rem; flex: 1; }
.notices-wsreplace__body { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }

/* Table Predictor */
.table-predictor-config-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 0.75rem; }
.table-predictor-config-row .form-input { width: 100%; }
.table-predictor-summary { margin-bottom: 1.5rem; }
.tp-lock-note, .tp-legend, .tp-list, .tp-actions, .tp-help, .tp-back { max-width: 420px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
.tp-lock-note { margin-top: 0.6rem; margin-bottom: 0.6rem; font-size: 0.8rem; }
.tp-legend { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; margin-bottom: 0.6rem; font-size: 0.78rem; }
.tp-legend__swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1px solid rgba(0,0,0,0.1); }
.tp-legend__swatch--top { background: hsl(140, 40%, 60%); }
.tp-legend__swatch--middle { background: #f5efe2; }
.tp-legend__swatch--bottom { background: hsl(0, 50%, 70%); }
.tp-list { display: flex; flex-direction: column; gap: 2px; padding: 2px; border: 1px solid #e5e7eb; border-radius: 10px; }
.tp-row { display: flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.5rem; border-radius: 5px; background: #fff; border: 1px solid rgba(0,0,0,0.06); }
.tp-row__drag { cursor: grab; color: #6b7280; font-size: 0.85rem; }
.tp-row__pos { font-weight: 700; width: 1.2rem; text-align: center; font-size: 0.78rem; }
.tp-row__team { display: flex; align-items: center; gap: 0.35rem; flex: 1; font-size: 0.78rem; }
.tp-row--dragging { opacity: 0.5; }
.team-badge { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; }
.tp-actions { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.tp-help { margin-top: 0.5rem; font-size: 0.72rem; }
.tp-back { margin-top: 0.6rem; }
@media (max-width: 480px) {
  .tp-lock-note, .tp-legend, .tp-list, .tp-actions, .tp-help, .tp-back { margin-left: 1.1rem; margin-right: 1.1rem; }
  .tp-row { padding: 0.16rem 0.4rem; gap: 0.3rem; }
  .tp-row__team { font-size: 0.72rem; }
  .tp-row__pos { width: 1rem; font-size: 0.7rem; }
  .team-badge { width: 14px; height: 14px; }
  .tp-legend { font-size: 0.7rem; gap: 0.35rem; }
}