/* ==========================================================
   BLITZ TRACKER — Core Layout & Panels
   Uses design tokens from css/core/variables.css
   BEM naming with bt- prefix
   ========================================================== */

/* ── APP CONTAINER ── */

.bt-page {
  /* Let page fit inside site-card-shell instead of forcing viewport height */
}

.bt-app {
  position: relative;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}

/* ── SCREEN SYSTEM ── */

.bt-screen {
  display: none;
}

.bt-screen--active {
  display: block;
}

/* ── GAME BOARD: fills viewport ── */

#btGameBoard.bt-screen--active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height, 62px));
  height: calc(100dvh - var(--header-height, 62px));
  overflow: hidden;
}

/* ── SETUP SCREEN ── */

.bt-setup {
  padding: var(--space-6) var(--space-4);
  max-width: 900px;
  margin: 0 auto;
}

.bt-setup__header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.bt-setup__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--gold-500);
  margin: 0 0 var(--space-2);
  letter-spacing: var(--tracking-wide);
}

.bt-setup__subtitle {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
}

.bt-setup__section {
  margin-bottom: var(--space-6);
}

.bt-setup__section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--gold-500);
  margin: 0 0 var(--space-4);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.bt-setup__field {
  margin-bottom: var(--space-4);
}

.bt-setup__field--half {
  flex: 1;
  min-width: 0;
}

.bt-setup__row {
  display: flex;
  gap: var(--space-4);
}

/* ── Two-column team layout ── */
.bt-setup__teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.bt-setup__team {
  min-width: 0;
}

/* ── Compact settings grid ── */
.bt-setup__settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4) var(--space-6);
  align-items: start;
}

.bt-setup__settings-col {
  min-width: 0;
}

.bt-setup__actions {
  margin-top: var(--space-6);
}

.bt-setup__start {
  width: 100%;
}

/* ── FORM ELEMENTS ── */

.bt-label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.bt-input {
  display: block;
  width: 100%;
  height: var(--input-height);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
}

.bt-input:focus {
  border-color: var(--gold-600);
  box-shadow: 0 0 0 3px var(--gold-alpha-20);
}

.bt-input::placeholder {
  color: var(--text-muted);
}

.bt-input--time {
  width: 64px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.bt-input--select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23C79652'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-8);
}

.bt-time-input {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.bt-time-input__sep {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-muted);
  line-height: 1;
}

/* ── RESUME BANNER ── */

.bt-resume {
  background: var(--gradient-gold-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  text-align: center;
}

.bt-resume__text {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  margin: 0 0 var(--space-3);
}

.bt-resume__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

/* ── GAME HEADER ── */

.bt-game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-1) var(--space-3);
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 36px;
  flex-shrink: 0;
}

.bt-game-header__half,
.bt-game-header__turn {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--gold-500);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.bt-game-header__turn {
  color: var(--text-secondary);
}

.bt-game-header__settings {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-base);
  padding: var(--space-1);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bt-game-header__settings:hover {
  color: var(--gold-500);
}

/* ── COACH PANELS ── */

.bt-panels {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.bt-panels__divider {
  height: 2px;
  flex-shrink: 0;
  margin: 0;
  background: linear-gradient(90deg, transparent 5%, var(--gold-500) 50%, transparent 95%);
  box-shadow: 0 0 10px rgba(201, 173, 106, 0.3);
}

.bt-panel {
  position: relative;
  overflow: hidden;
  transition: flex 0.4s ease, background 0.3s ease, opacity 0.3s ease;
}

/* ── ACTIVE PANEL — dominant, centered ── */

.bt-panel--active {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card);
}

.bt-panel--active .bt-panel__logo {
  display: none;
}

.bt-panel--active .bt-panel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0;
}

.bt-panel--active .bt-panel__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--gold-500);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.bt-panel--active .bt-panel__score {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  color: var(--gold-500);
  line-height: 1;
  transition: transform 0.2s ease;
}

/* ── TIMER DISPLAY (active) ── */

.bt-panel--active .bt-panel__timer {
  text-align: center;
  margin: var(--space-2) 0 var(--space-1);
}

.bt-panel--active .bt-timer__digits {
  font-family: var(--font-display);
  font-size: clamp(3rem, 16vw, 5rem);
  color: var(--text-bright);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  display: block;
  text-shadow:
    0 0 20px rgba(201, 173, 106, 0.12),
    0 2px 4px rgba(0, 0, 0, 0.3);
}

.bt-panel--active .bt-timer__label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-top: var(--space-1);
}

.bt-panel--active .bt-panel__info {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bt-panel--active .bt-panel__pool,
.bt-panel--active .bt-panel__turn {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.bt-panel--active .bt-panel__active-badge {
  display: none;
}

/* ── INACTIVE PANEL — compact single row ── */

.bt-panel--inactive {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-elevated);
  opacity: 0.8;
}

.bt-panel--inactive .bt-panel__logo {
  display: none;
}

.bt-panel--inactive .bt-panel__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 0;
  min-width: 0;
  flex-shrink: 1;
}

.bt-panel--inactive .bt-panel__name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 5rem;
}

.bt-panel--inactive .bt-panel__score {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--gold-500);
  line-height: 1;
  flex-shrink: 0;
}

.bt-panel--inactive .bt-panel__timer {
  text-align: right;
  margin: 0;
  margin-left: auto;
  flex-shrink: 0;
}

.bt-panel--inactive .bt-timer__digits {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-bright);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  display: inline;
}

.bt-panel--inactive .bt-timer__label {
  display: none;
}

.bt-panel--inactive .bt-panel__info {
  flex-shrink: 0;
}

.bt-panel--inactive .bt-panel__pool {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.bt-panel--inactive .bt-panel__turn {
  display: none;
}

.bt-panel--inactive .bt-panel__active-badge {
  display: none !important;
}

/* ── Score pop animation ── */

@keyframes bt-score-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.bt-panel__score--pop {
  animation: bt-score-pop 0.3s ease;
}

/* ── Timer visual states ── */

.bt-timer--safe {
  color: var(--status-success, #6CBF6C) !important;
}

.bt-timer--warning {
  color: var(--status-warning) !important;
}

.bt-timer--critical {
  color: var(--status-error) !important;
  animation: bt-pulse 1s ease-in-out infinite;
}

.bt-timer--pooled {
  color: var(--purple-400) !important;
}

.bt-timer--pooled.bt-timer--warning {
  color: var(--status-warning) !important;
}

.bt-timer--pooled.bt-timer--critical {
  color: var(--status-error) !important;
}

@keyframes bt-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.02); }
}

@keyframes bt-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.bt-timer--pooled.bt-timer--critical {
  animation: bt-flash 0.6s ease-in-out infinite;
}

/* ── PAUSE OVERLAY ── */

.bt-pause-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-backdrop);
  background:
    radial-gradient(circle at top, rgba(199, 150, 82, 0.12) 0%, rgba(199, 150, 82, 0.04) 22%, transparent 48%),
    rgba(20, 11, 22, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bt-pause-overlay__content {
  text-align: center;
  padding: var(--space-8);
  width: min(calc(100% - 2rem), 440px);
  background: var(--panel-bg-strong);
  border: 1px solid var(--panel-border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--app-card-shadow);
}

.bt-pause-overlay__title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  color: var(--gold-500);
  margin: 0 0 var(--space-4);
}

.bt-pause-overlay__reason {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin: 0 0 var(--space-8);
}

.bt-pause-overlay__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

.bt-pause-overlay__new {
  margin-top: var(--space-4);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* ── HALF-TIME SCREEN ── */

.bt-halftime,
.bt-end {
  position: relative;
  overflow: hidden;
  padding: var(--space-8) var(--space-4);
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--panel-shadow);
}

.bt-halftime::before,
.bt-end::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--panel-rule);
  pointer-events: none;
}

.bt-halftime > *,
.bt-end > * {
  position: relative;
  z-index: 1;
}

.bt-halftime__title,
.bt-end__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--gold-500);
  margin: 0 0 var(--space-8);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.bt-halftime__scores,
.bt-end__scores {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.bt-halftime__team,
.bt-end__team {
  text-align: center;
}

.bt-halftime__team-name,
.bt-end__team-name {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
}

.bt-halftime__team-score,
.bt-end__team-score {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  color: var(--gold-500);
  line-height: 1;
}

.bt-halftime__vs,
.bt-end__vs {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--text-muted);
}

.bt-halftime__pools {
  margin-bottom: var(--space-8);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-secondary);
}

.bt-halftime__pools p {
  margin: var(--space-1) 0;
}

/* ── END SCREEN STATS ── */

.bt-end__stats {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-8);
  text-align: left;
  box-shadow: var(--shadow-xs);
}

.bt-end__stats-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--gold-500);
  margin: 0 0 var(--space-3);
  text-transform: uppercase;
}

.bt-end__stat-list {
  margin: 0;
}

.bt-end__stat {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.bt-end__stat:last-child {
  border-bottom: none;
}

.bt-end__stat dt {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.bt-end__stat dd {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.bt-end__actions {
  margin-top: var(--space-6);
}

.bt-end__actions .btn {
  width: 100%;
}

/* ── REDUCED MOTION ── */

/* ── TURN TIMELINE ── */

.bt-timeline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-1) var(--space-3);
  background: var(--bg-dark);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.bt-timeline__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.bt-timeline__label {
  font-family: var(--font-button);
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.bt-timeline__cells {
  display: flex;
  gap: 2px;
  flex: 1;
}

.bt-timeline__cell {
  flex: 1;
  text-align: center;
  padding: 2px 0;
  font-family: var(--font-button);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  line-height: 1.4;
}

.bt-timeline__cell--done {
  background: var(--gold-500);
  color: var(--bg-dark);
  border-color: var(--gold-600);
}

.bt-timeline__cell--turnover {
  background: var(--status-error);
  border-color: var(--status-error);
  color: var(--text-bright);
}

.bt-timeline__cell--active {
  background: transparent;
  border-color: var(--gold-500);
  color: var(--gold-500);
  box-shadow: 0 0 6px rgba(201, 173, 106, 0.4);
}

/* ── REDUCED MOTION ── */

@media (prefers-reduced-motion: reduce) {
  .bt-timer--critical {
    animation-duration: 0.01ms !important;
  }

  .bt-panel,
  .bt-input,
  .bt-game-header__settings {
    transition-duration: 0.01ms !important;
  }
}

/* ══════════════════════════════════════════════════════════
   ROSTER CARD PICKER
   ══════════════════════════════════════════════════════════ */

.bt-roster-picker {
  margin-top: var(--space-3);
}

.bt-roster-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-3);
}

.bt-rcard {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-2);
  background: var(--bg-elevated);
  border: 2px solid var(--border-muted);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  text-align: center;
  min-width: 0;
}

.bt-rcard:hover {
  border-color: var(--gold-600);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.bt-rcard--selected {
  border-color: var(--gold-500);
  background: var(--gold-alpha-15);
  box-shadow:
    0 0 0 2px var(--gold-alpha-30),
    0 0 12px var(--gold-alpha-20);
}

.bt-rcard--selected .bt-rcard__name {
  color: var(--gold-500);
}

.bt-rcard--selected::after {
  content: '\f00c';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  background: var(--gold-500);
  color: var(--bg-dark);
  border-radius: 50%;
}

.bt-rcard__logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.bt-rcard__logo--empty {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.5rem;
}

.bt-rcard__name {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.bt-rcard__race {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: capitalize;
}

.bt-rcard__coach {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--gold-600);
  font-style: italic;
}

.bt-rcard__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  padding: var(--space-4);
}

/* ── "+ Create Team" card ── */

.bt-rcard--create {
  border: 2px dashed var(--gold-500);
  background: transparent;
  color: var(--gold-500);
  justify-content: center;
  gap: var(--space-2);
  min-height: 7rem;
}

.bt-rcard--create:hover {
  background: rgba(201, 173, 106, 0.08);
  border-color: var(--gold-400, var(--gold-500));
}

.bt-rcard__create-icon {
  font-size: 1.75rem;
  opacity: 0.8;
}

/* ══════════════════════════════════════════════════════════
   INLINE TEAM CREATION PANEL
   ══════════════════════════════════════════════════════════ */

/* ── Create panel overlay ── */

.bt-create-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 200);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  padding: var(--space-4);
}

.bt-create-panel {
  background: var(--bg-elevated, #2a2035);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg, 0.75rem);
  padding: var(--space-5) var(--space-4);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - var(--space-8));
  max-height: calc(100dvh - var(--space-8));
  overflow-y: auto;
}

.bt-create-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.bt-create-panel__title {
  font-family: var(--font-display);
  font-size: var(--text-xl, 1.25rem);
  color: var(--gold-500);
  margin: 0;
}

.bt-create-panel__field {
  margin-bottom: var(--space-4);
}

.bt-create-panel__hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0 0 var(--space-2);
}

/* Race grid */

.bt-create-panel__race-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr));
  gap: var(--space-2);
  max-height: 18rem;
  overflow-y: auto;
  padding: var(--space-1);
}

.bt-race-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2);
  border-radius: var(--radius-md, 0.5rem);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
}

.bt-race-card:hover {
  border-color: var(--gold-500);
  background: var(--gold-alpha-10);
}

.bt-race-card--selected {
  border-color: var(--gold-500);
  background: var(--gold-alpha-15);
  box-shadow: 0 0 0 2px var(--gold-500);
}

.bt-race-card__icon {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
}

.bt-race-card__name {
  font-size: var(--text-xs, 0.75rem);
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}

/* Positional picker */

.bt-pos-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.bt-pos-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md, 0.5rem);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.bt-pos-row__info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.bt-pos-row__name {
  font-weight: 600;
  font-size: var(--text-sm);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bt-pos-row__stats {
  font-size: var(--text-xs, 0.75rem);
  color: var(--text-muted);
  white-space: nowrap;
}

.bt-pos-row__badge {
  font-size: var(--text-xs, 0.675rem);
  background: var(--gold-500);
  color: var(--bg-primary);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm, 0.25rem);
  font-weight: 700;
  white-space: nowrap;
}

.bt-pos-row__controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.bt-pos-qty-btn {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-muted);
  background: var(--bg-dark);
  color: var(--text-primary, #fff);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
  line-height: 1;
}

.bt-pos-qty-btn:hover {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: var(--bg-primary);
}

.bt-pos-row__qty {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 700;
  font-size: var(--text-sm);
}

.bt-pos-row__limit {
  font-size: var(--text-xs, 0.75rem);
  color: var(--text-muted);
  min-width: 1.5rem;
}

/* Summary + actions */

.bt-create-panel__summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.bt-create-panel__actions {
  display: flex;
  justify-content: center;
  padding-top: var(--space-3);
}

/* ══════════════════════════════════════════════════════════
   AWAY OPTIONS (invite / search divider)
   ══════════════════════════════════════════════════════════ */

.bt-away-options {
  margin-top: var(--space-4);
}

.bt-away-options__or {
  text-align: center;
  margin-bottom: var(--space-3);
  position: relative;
}

.bt-away-options__or::before {
  content: '';
  display: block;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-muted);
}

.bt-away-options__or-text {
  position: relative;
  background: var(--bg-primary);
  padding: 0 var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bt-away-options__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

/* ══════════════════════════════════════════════════════════
   INVITE PANEL
   ══════════════════════════════════════════════════════════ */

.bt-invite-panel {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-lg);
}

.bt-invite-panel__hint {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0 0 var(--space-3);
}

.bt-invite-panel__code-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.bt-invite-panel__code {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--gold-500);
  letter-spacing: 0.2em;
  user-select: all;
}

.bt-invite-panel__status {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0 0 var(--space-2);
}

/* ══════════════════════════════════════════════════════════
   SEARCH PANEL
   ══════════════════════════════════════════════════════════ */

.bt-search-panel {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-lg);
}

.bt-search-panel__input-row {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.bt-search-panel__input-row .bt-input {
  flex: 1;
}

.bt-search-panel__results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-3);
}

.bt-search-panel__loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  padding: var(--space-4);
}

/* ══════════════════════════════════════════════════════════
   INVITE ACCEPT SCREEN
   ══════════════════════════════════════════════════════════ */

.bt-invite-accept {
  padding: var(--space-6) var(--space-4);
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.bt-invite-accept__header {
  margin-bottom: var(--space-4);
}

.bt-invite-accept__header i {
  font-size: 2.5rem;
  color: var(--gold-500);
  margin-bottom: var(--space-2);
  display: block;
}

.bt-invite-accept__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--gold-500);
  margin: 0;
}

.bt-invite-accept__info {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.bt-invite-accept__prompt {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.bt-invite-accept__actions {
  margin-top: var(--space-6);
}

.bt-invite-accept__status {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  margin-top: var(--space-3);
}

/* ══════════════════════════════════════════════════════════
   FRIENDLY TOGGLE & BADGE
   ══════════════════════════════════════════════════════════ */

.bt-toggle__hint {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
  font-weight: 400;
}

.bt-game-header__friendly {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gold-500);
  background: var(--gold-alpha-10, rgba(201, 173, 106, 0.1));
  border: 1px solid var(--gold-600);
  border-radius: var(--radius-full, 100px);
  padding: var(--space-1) var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Status text helpers ── */

.bt-success {
  color: var(--status-success);
}

.bt-error {
  color: var(--status-error);
}

.bt-muted {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ══════════════════════════════════════════════
   GAME HISTORY (setup screen)
   ══════════════════════════════════════════════ */

.bt-history__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-height: 260px;
  overflow-y: auto;
}

.bt-history__empty {
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-align: center;
  padding: var(--space-4) 0;
}

.bt-history__game {
  display: grid;
  grid-template-columns: 3.2rem 1fr auto 1fr 3rem;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--panel-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  font-size: var(--text-sm);
  color: var(--text-secondary, #b0aab8);
}

.bt-history__date {
  color: var(--text-muted);
  font-size: var(--text-xs, 0.75rem);
  white-space: nowrap;
}

.bt-history__teams {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bt-history__teams:last-of-type {
  text-align: right;
}

.bt-history__teams--home-win,
.bt-history__teams--away-win {
  color: var(--gold-500);
  font-weight: 600;
}

.bt-history__score {
  text-align: center;
  font-weight: 700;
  color: var(--text-primary, #fff);
  white-space: nowrap;
}

.bt-history__ot {
  font-size: var(--text-xs, 0.75rem);
  color: var(--gold-500);
  font-weight: 600;
}

.bt-history__dur {
  color: var(--text-muted);
  font-size: var(--text-xs, 0.75rem);
  text-align: right;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════
   TURN STATS (end screen)
   ══════════════════════════════════════════════ */

.bt-turn-stats {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md, 8px);
}

.bt-turn-stats__title {
  font-size: var(--text-base, 1rem);
  font-weight: 600;
  color: var(--gold-500);
  margin: 0 0 var(--space-3);
  text-align: center;
}

.bt-turn-stats__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.bt-turn-stats__table th {
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
  padding: var(--space-1) var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-xs, 0.75rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bt-turn-stats__table th:first-child {
  text-align: left;
}

.bt-turn-stats__table td {
  text-align: center;
  padding: var(--space-1) var(--space-2);
  color: var(--text-secondary, #b0aab8);
}

.bt-turn-stats__table td:first-child {
  text-align: left;
  color: var(--text-muted);
  font-size: var(--text-xs, 0.75rem);
}

.bt-turn-stats__table tr:nth-child(even) {
  background: var(--gold-alpha-5);
}

.bt-turn-stats__turnover {
  color: var(--status-error);
  font-size: var(--text-xs, 0.75rem);
  margin-left: var(--space-1);
}

.bt-turn-stats__bar {
  display: inline-block;
  height: 4px;
  border-radius: 2px;
  background: var(--gold-500);
  vertical-align: middle;
  margin-left: var(--space-1);
  max-width: 60px;
}

.bt-turn-stats__bar--pooled {
  background: var(--gold-700, #a08540);
}
