/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Colours — drawn from the GinFana poster */
  --cream:         #F5F0DC;
  --cream-dark:    #EDE5C4;
  --cream-card:    #FBF8EE;
  --burgundy:      #8B2222;
  --burgundy-mid:  #A83030;
  --burgundy-light:#C24040;
  --gold:          #C9A020;
  --gold-light:    #DEB84A;
  --lime:          #7BA600;
  --lime-light:    #A8D400;
  --amber:         #E8980A;
  --text-dark:     #2C1810;
  --text-body:     #4A3728;
  --text-muted:    #7A6555;
  --white:         #FFFFFF;
  --border:        rgba(44, 24, 16, 0.12);

  /* Shadows — warm-tinted */
  --shadow-sm:  0 1px 3px  rgba(44, 24, 16, 0.10);
  --shadow-md:  0 4px 12px rgba(44, 24, 16, 0.12);
  --shadow-lg:  0 8px 28px rgba(44, 24, 16, 0.16);

  /* Border radii */
  --radius-sm:  6px;
  --radius:    12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Spacing scale */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* Typography */
  --font-display: 'Bahiana', sans-serif;
  --font-body:    'Nunito', sans-serif;

  /* Nav */
  --nav-height: 64px;

  /* Page max width */
  --max-width: 1100px;
}


/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--cream);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
}

input, select, textarea {
  font-family: var(--font-body);
}


/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3 {
  font-family: var(--font-body);
  color: var(--text-dark);
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }

.display {
  font-family: var(--font-display);
}

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

.text-center {
  text-align: center;
}


/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--burgundy);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-5);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  flex-shrink: 0;
}

.nav__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.nav__brand-name {
  font-family: 'Bahiana', sans-serif;
  font-size: 2rem;
  color: var(--cream);
  letter-spacing: 0.02em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.nav__link {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  color: rgba(245, 240, 220, 0.85);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.15s, background-color 0.15s;
}

.nav__link:hover {
  color: var(--cream);
  background-color: rgba(255, 255, 255, 0.12);
}

.nav__link--active {
  color: var(--cream);
  background-color: rgba(255, 255, 255, 0.18);
}

.nav__link--admin {
  color: var(--gold-light);
}

.nav__link--admin:hover {
  color: var(--gold-light);
  background-color: rgba(201, 160, 32, 0.18);
}

/* Hamburger — hidden on desktop */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
}

.nav__hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--cream);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* Mobile nav dropdown */
.nav__mobile {
  background-color: var(--burgundy-mid);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.nav__mobile-link {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  color: rgba(245, 240, 220, 0.85);
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.15s, color 0.15s;
}

.nav__mobile-link:hover,
.nav__mobile-link--active {
  color: var(--cream);
  background-color: rgba(255, 255, 255, 0.12);
}

.nav__mobile-link--admin {
  color: var(--gold-light);
}

.nav__lock {
  font-size: 0.7em;
  opacity: 0.7;
}

.nav__link--logout {
  background: none;
  border: none;
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.8rem;
  color: rgba(245, 240, 220, 0.55);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background-color 0.15s;
}

.nav__link--logout:hover {
  color: var(--cream);
  background-color: rgba(255, 255, 255, 0.12);
}

.nav__mobile-link--logout {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: rgba(245, 240, 220, 0.55);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.nav__mobile-link--logout:hover {
  color: var(--cream);
  background-color: rgba(255, 255, 255, 0.12);
}


/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-5) var(--sp-8);
}

.page-header {
  margin-bottom: var(--sp-6);
}

.page-title {
  font-family: var(--font-display);
  color: var(--burgundy);
  margin-bottom: var(--sp-2);
  text-align: center;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
}


/* ============================================================
   TABS
   ============================================================ */
.tabs {
  margin-bottom: var(--sp-6);
}

.tabs__list {
  display: flex;
  gap: var(--sp-2);
  border-bottom: 2px solid var(--cream-dark);
  margin-bottom: var(--sp-5);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs__list::-webkit-scrollbar {
  display: none;
}

.tabs__btn {
  padding: var(--sp-3) var(--sp-5);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.tabs__btn:hover {
  color: var(--text-dark);
}

.tabs__btn--active {
  color: var(--burgundy);
  border-bottom-color: var(--burgundy);
}

.tabs__panel {
  display: none;
}

.tabs__panel--active {
  display: block;
}


/* ============================================================
   CARDS
   ============================================================ */
.card {
  background-color: var(--cream-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card--padded {
  padding: var(--sp-5);
}

.card--highlight {
  border-left: 4px solid var(--burgundy);
}

.card--gold {
  border-left: 4px solid var(--gold);
}


/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge--played {
  background-color: var(--lime);
  color: var(--white);
}

.badge--pending {
  background-color: var(--amber);
  color: var(--white);
}

.badge--eliminated {
  background-color: var(--text-muted);
  color: var(--white);
}


/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  border: 2px solid transparent;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
  cursor: pointer;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background-color: var(--burgundy);
  color: var(--cream);
  border-color: var(--burgundy);
}

.btn--primary:hover:not(:disabled) {
  background-color: var(--burgundy-mid);
  border-color: var(--burgundy-mid);
}

.btn--secondary {
  background-color: transparent;
  color: var(--burgundy);
  border-color: var(--burgundy);
}

.btn--secondary:hover:not(:disabled) {
  background-color: var(--burgundy);
  color: var(--cream);
}

.btn--gold {
  background-color: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

.btn--gold:hover:not(:disabled) {
  background-color: var(--gold-light);
  border-color: var(--gold-light);
}

.btn--ghost {
  background-color: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn--ghost:hover:not(:disabled) {
  color: var(--text-dark);
  border-color: var(--text-muted);
}

.btn--danger {
  background-color: transparent;
  color: #c0392b;
  border-color: #c0392b;
}

.btn--danger:hover:not(:disabled) {
  background-color: #c0392b;
  color: var(--white);
}

.btn--full {
  width: 100%;
}

.btn--sm {
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.85rem;
}


/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.form-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.form-input {
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background-color: var(--white);
  color: var(--text-body);
  font-size: 1rem;
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--burgundy);
}

.form-input[type="number"] {
  -moz-appearance: textfield;
}

.form-input[type="number"]::-webkit-inner-spin-button,
.form-input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

.form-select {
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background-color: var(--white);
  color: var(--text-body);
  font-size: 1rem;
  transition: border-color 0.15s;
  appearance: auto;
}

.form-select:focus {
  outline: none;
  border-color: var(--burgundy);
}

.form-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}


/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
}

.alert--info {
  background-color: rgba(201, 160, 32, 0.12);
  border-left: 4px solid var(--gold);
  color: var(--text-dark);
}

.alert--warning {
  background-color: rgba(232, 152, 10, 0.12);
  border-left: 4px solid var(--amber);
  color: var(--text-dark);
}

.alert--success {
  background-color: rgba(123, 166, 0, 0.12);
  border-left: 4px solid var(--lime);
  color: var(--text-dark);
}

.alert--error {
  background-color: rgba(139, 34, 34, 0.10);
  border-left: 4px solid var(--burgundy);
  color: var(--text-dark);
}


/* ============================================================
   STAT CARDS (Admin dashboard)
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.stat-card {
  background-color: var(--cream-card);
  border-radius: var(--radius);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  text-align: center;
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--burgundy);
  line-height: 1;
  margin-bottom: var(--sp-2);
}

.stat-card__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


/* ============================================================
   GAME CARD
   ============================================================ */
.game-card {
  background-color: var(--cream-card);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.game-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.game-card__number {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-muted);
}

.game-card__score {
  font-family: var(--font-display);
  font-size: 2.8rem;
  color: var(--burgundy);
  letter-spacing: 0.04em;
}

.game-card__teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-3);
  text-align: center;
}

.game-card__team {
  font-weight: 700;
  color: var(--text-dark);
  font-size: 0.95rem;
  line-height: 1.4;
}

.game-card__vs {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-muted);
}


/* ============================================================
   LEADERBOARD TABLE
   ============================================================ */
.leaderboard {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.leaderboard th {
  background-color: var(--burgundy);
  color: var(--cream);
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.leaderboard th:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.leaderboard th:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  text-align: right;
}

.leaderboard td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--cream-dark);
  color: var(--text-body);
}

.leaderboard td:last-child {
  text-align: right;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--burgundy);
}

.leaderboard tr:last-child td {
  border-bottom: none;
}

.leaderboard tr:hover td {
  background-color: rgba(245, 240, 220, 0.6);
}

.leaderboard__rank {
  font-weight: 800;
  color: var(--text-muted);
  width: 2.5rem;
}

.leaderboard__rank--gold   { color: #B8860B; }
.leaderboard__rank--silver { color: #808080; }
.leaderboard__rank--bronze { color: #8B4513; }


/* ============================================================
   PLAYER CARDS
   ============================================================ */
.player-card {
  background: var(--cream-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-4) var(--sp-3);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-body);
  color: var(--text-body);
}

.player-card:hover {
  border-color: var(--burgundy);
  box-shadow: var(--shadow-sm);
  background-color: var(--cream);
}

.player-card__rank {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.player-card__rank--gold   { color: #B8860B; }
.player-card__rank--silver { color: #808080; }
.player-card__rank--bronze { color: #8B4513; }

.player-card__name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
  margin-top: var(--sp-1);
  color: var(--text-dark);
}

.player-card__score {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--burgundy);
  margin-top: var(--sp-2);
  line-height: 1;
}

.player-card__label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.player-card__record {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

.result-pill {
  width: 34px;
  height: 34px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: #fff;
  flex-shrink: 0;
}

.result-pill--won  { background: var(--lime); }
.result-pill--lost { background: #c0392b; }


/* ============================================================
   MODAL / DIALOG
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(44, 24, 16, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  z-index: 200;
}

.modal {
  background-color: var(--cream-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}

.modal__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--burgundy);
  margin-bottom: var(--sp-4);
}

.modal__actions {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

.modal__actions .btn {
  flex: 1;
}


/* ============================================================
   TOURNAMENT BRACKET (drawn, SVG connectors)
   ============================================================ */
.tbk-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.tbk-match {
  background: var(--cream-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.tbk-match--final {
  border-color: var(--gold);
}

.tbk-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-3);
  gap: var(--sp-2);
  font-size: 0.82rem;
  font-weight: 600;
}

.tbk-team:not(:last-child) {
  border-bottom: 1px solid var(--cream-dark);
}

.tbk-team--winner {
  background: rgba(123, 166, 0, 0.12);
  color: var(--lime);
}

.tbk-team--loser {
  opacity: 0.35;
}

.tbk-team--tbd {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 400;
}

.tbk-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tbk-score {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 300;
  color: var(--burgundy);
  opacity: 0.9;
  flex-shrink: 0;
  line-height: 1;
}

.tbk-team--winner .tbk-score {
  color: var(--lime);
}

.tbk-line {
  fill: none;
  stroke: var(--cream-dark);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tbk-champion {
  padding: var(--sp-5) var(--sp-6);
  background: linear-gradient(135deg, var(--burgundy), var(--burgundy-mid));
  border-radius: var(--radius-lg);
  color: var(--cream);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.tbk-champion__label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.75;
  margin-bottom: var(--sp-2);
}

.tbk-champion__name {
  font-family: var(--font-display);
  font-size: 1.8rem;
}


/* ============================================================
   FLEX BRACKET (generic N-round)
   ============================================================ */

.bracket-flex {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: var(--sp-4);
  min-width: max-content;
}

.bracket-flex__round {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 200px;
}

.bracket-flex__label {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--cream-dark);
  margin-bottom: var(--sp-2);
}

.bracket-flex__matches {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: var(--sp-3);
}

.bracket-flex__match {
  background: var(--cream-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.bracket-flex__match--final {
  border-color: var(--gold);
}


/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  border: none;
  border-top: 2px solid var(--cream-dark);
  margin: var(--sp-6) 0;
}


/* ============================================================
   GRID HELPERS
   ============================================================ */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}

.flex-row {
  display: flex;
  gap: var(--sp-4);
}

.flex-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}


/* ============================================================
   RESPONSIVE — MOBILE FIRST
   ============================================================ */
@media (max-width: 768px) {
  /* Nav */
  .nav__links {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }

  /* Layout */
  .main {
    padding: var(--sp-5) var(--sp-4) var(--sp-7);
  }

  /* Grids collapse to single column */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  /* Stat grid stays 2-col on mobile (compact enough) */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Modals go full-width on small screens */
  .modal {
    padding: var(--sp-5);
  }

  .modal__actions {
    flex-direction: column;
  }
}

@media (min-width: 769px) {
  /* Stat grid goes 4-col on desktop */
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================================
   STATUS BAR (below navbar, full-width)
   ============================================================ */

.status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: 7px var(--sp-4);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  flex-wrap: wrap;
}

.status-bar--idle {
  background: #3a2e28;
  color: rgba(245, 240, 220, 0.35);
}

.status-bar--live {
  background: #3a2e28;
  color: var(--cream);
}

.status-bar--done {
  background: #3a2e28;
  color: var(--gold-light);
}

.status-bar__sep {
  color: rgba(245, 240, 220, 0.25);
}

.status-bar__badge {
  background: var(--burgundy);
  color: var(--cream);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 99px;
}

.status-bar__trophy {
  font-size: 0.9rem;
}

/* Pulsing live dot */
.status-bar__dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4caf50;
  box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.6);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0   rgba(76, 175, 80, 0.6); }
  60%  { box-shadow: 0 0 0 5px rgba(76, 175, 80, 0); }
  100% { box-shadow: 0 0 0 0   rgba(76, 175, 80, 0); }
}

/* ============================================================
   BREATHALYZER PANEL (final match card in Eliminatórias)
   ============================================================ */

.bz-panel {
  width: 100%;
  border-top: 1px solid var(--cream-dark);
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  font-size: 0.72rem;
}

.bz-readings-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--sp-1);
}

.bz-team-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bz-team-col--right {
  text-align: right;
}

.bz-reading {
  color: var(--text-muted);
  display: block;
}

.bz-avg {
  font-weight: 700;
  color: var(--burgundy);
  font-size: 0.65rem;
  margin-top: 2px;
}

.bz-handicap-line {
  border-top: 1px dashed var(--cream-dark);
  margin-top: var(--sp-1);
  padding-top: var(--sp-1);
  text-align: center;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.4;
}

.bz-handicap-line--zero {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.65rem;
}

.bz-start {
  font-weight: 400;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.bz-avg-inline {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  margin-top: 1px;
}
