﻿/**
 * BirdieLogic - Component Styles
 * Badminton Brand Consistent
 */

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

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

.btn-icon {
  font-size: var(--font-size-lg);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 40%, transparent);
}

[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
}

[data-theme="light"] .btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(35, 55, 70, 0.3);
}

[data-theme="light"] .modal {
  background: #ffffff;
  border: none;
}

[data-theme="light"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .modal-titlebar {
  background: var(--navy);
  border-bottom: none;
}

[data-theme="light"] .modal-titlebar-heading {
  color: #ffffff;
}

[data-theme="light"] .modal-titlebar-close {
  color: #ffffff;
}

[data-theme="light"] .btn-success {
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
}

[data-theme="light"] .tab.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

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

.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--bg-card);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
  color: var(--white);
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
  color: var(--white);
}

.btn-warning:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
  color: var(--white);
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-large,
.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--font-size-lg);
}

.btn-small,
.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-size-sm);
}

.btn-block {
  width: 100%;
}

/* Google Sign-in Button */
.btn-google {
  background: white;
  color: #333;
  border: 1px solid var(--border);
}

.btn-google:hover:not(:disabled) {
  background: #f5f5f5;
}

.btn-google img {
  width: 18px;
  height: 18px;
}

/* Score Buttons - Large tap targets for scoring */
.btn-score {
  min-width: 120px;
  min-height: 80px;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-lg);
  flex-direction: column;
  gap: var(--space-xs);
}

.btn-score-team {
  flex: 1;
  min-height: 100px;
  font-size: var(--font-size-3xl);
}

.btn-score-team-1 {
  background: linear-gradient(160deg, rgba(255,255,255,0.12) 0%, rgba(0,0,0,0.18) 100%), var(--team-1);
}

.btn-score-team-2 {
  background: linear-gradient(160deg, rgba(255,255,255,0.12) 0%, rgba(0,0,0,0.18) 100%), var(--team-2);
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label,
.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="password"],
select,
textarea,
.form-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus,
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 182, 166, 0.2);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--danger);
  margin-top: var(--space-xs);
}

select,
.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.hint,
.form-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* Checkboxes & Radios */
.checkbox-label,
.radio-label,
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
}

.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"],
.form-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

/* Match Cards */
.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.match-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.match-team-players {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: var(--font-weight-normal);
}

.match-stage-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.match-umpire {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.match-status-slot {
  min-width: 80px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.match-number-slot {
  display: flex;
  align-items: center;
  gap: 4px;
}

.matches-log-btn {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.3;
  font-size: var(--font-size-xs);
  padding: 0 2px;
  line-height: 1;
}

.matches-log-btn:hover {
  opacity: 1;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
}

.badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.badge-info {
  background: rgba(59, 130, 246, 0.2);
  color: var(--info);
}

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

.badge-secondary {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
}

.badge-neutral {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-secondary);
}

/* Live Indicator */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

/* ===== MODALS ===== */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: var(--navy-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.3s ease;
  z-index: var(--z-modal);
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-lg {
  max-width: 700px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--font-size-2xl);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-md);
  overflow-y: auto;
  flex: 1;
}

.modal-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-color);
  background: var(--primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-titlebar-heading {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--navy-dark);
  margin: 0;
}

.modal-titlebar-spacer {
  flex: 1;
}

.modal-titlebar-close {
  background: transparent;
  border: none;
  color: var(--navy-dark);
  font-size: var(--font-size-2xl);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.modal-titlebar-close:hover {
  opacity: 1;
}

.modal--custom {
  overflow: hidden;
}

.modal-body--custom {
  max-height: 70vh;
}

.modal-backdrop--fullscreen {
  padding: 0;
}
.modal-backdrop--fullscreen .modal {
  width: 100%;
  height: 100%;
  max-width: 100% !important;
  max-height: 100%;
  border-radius: 0;
  margin: 0;
}
.modal-backdrop--fullscreen .modal-body--custom {
  max-height: none;
  flex: 1;
  overflow-y: auto;
}

.modal-body-footer-row {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.modal-body-footer-row--end {
  justify-content: flex-end;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border-color);
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-lg);
  scrollbar-width: none;
  position: relative;
}

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

/* Fade hint indicating scrollable tabs */
.tabs-wrap {
  position: relative;
}

.tabs-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 1px;
  width: 32px;
  background: linear-gradient(to right, transparent, var(--bg-body-solid));
  pointer-events: none;
  z-index: 1;
}

/* Avatar with hover-to-upload */
.pr-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 50%;
}
.pr-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.15s;
}
.pr-avatar-wrap:hover .pr-avatar-overlay {
  opacity: 1;
}

.tab {
  flex-shrink: 0;
  padding: var(--space-sm) var(--space-md);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--menu-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-lg);
  animation: toastSlideIn 0.3s ease;
  min-width: 280px;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--info); }

/* ===== LOADING STATES ===== */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== AVATAR ===== */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm { width: 32px; height: 32px; font-size: var(--font-size-sm); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--font-size-xl); }

/* ===== DIVIDER ===== */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: var(--space-lg) 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== SCORING UI SPECIFIC ===== */

/* Score Display */
.score-display {
  text-align: center;
  padding: var(--space-xl);
}

.score-games {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.score-points {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-extrabold);
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.score-points .team-1 {
  color: var(--team-1);
}

.score-points .team-2 {
  color: var(--team-2);
}

.score-separator {
  color: var(--text-muted);
  margin: 0 var(--space-md);
}

/* Service Indicator */
.service-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--warning-subtle);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--warning);
}

.service-indicator .shuttlecock {
  font-size: var(--font-size-lg);
}

.service-indicator .court-side {
  text-transform: uppercase;
  font-weight: var(--font-weight-bold);
}

/* Court View (for doubles) */
.court-view {
  background: var(--bg-court);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin: var(--space-md) 0;
}

.court-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: var(--space-sm);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-xs);
}

.court-half:last-child {
  margin-bottom: 0;
}

.court-net {
  text-align: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.15em;
  color: #000;
  background: rgba(0, 0, 0, 0.25);
  border-top: 2px dashed rgba(0, 0, 0, 0.4);
  border-bottom: 2px dashed rgba(0, 0, 0, 0.4);
  padding: 4px 0;
  margin: 2px 0;
}

.court-team-label {
  grid-column: 1 / -1;
  text-align: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xs);
  padding: 2px 10px;
  border-radius: 50px;
  color: #fff;
}

.court-position {
  padding: var(--space-md);
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--white);
}

.court-position.serving {
  background: var(--warning);
  color: var(--text-inverse);
  font-weight: var(--font-weight-bold);
}

.court-position.receiving {
  border: 2px dashed var(--warning);
}

/* Court view header with rotate button */
.court-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}
.court-view-header h4 {
  margin: 0;
}
.btn-rotate-court {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  font-size: var(--font-size-sm);
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1.4;
}
.btn-rotate-court:hover { background: var(--bg-hover); color: var(--text); }

/* Horizontal (umpire-side) court layout — flat 3-column grid */
.court-view.court-horizontal {
  display: grid;
  grid-template-columns: 1fr 24px 1fr;
  grid-template-rows: auto 1fr 1fr;
  gap: 2px;
  min-height: 240px;
}
.court-view.court-horizontal .ch-label {
  grid-column: auto;
  margin-bottom: 0;
  font-size: var(--font-size-sm);
  padding: 4px 10px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}
.court-view.court-horizontal .court-position {
  display: flex;
  align-items: center;
  justify-content: center;
}
.ch-net {
  /* spacer in the label row — invisible */
}
.ch-net-active {
  grid-row: span 2;     /* spans both player rows so NET sits centered */
  background: rgba(0, 0, 0, 0.25);
  border-left: 2px dashed rgba(0, 0, 0, 0.4);
  border-right: 2px dashed rgba(0, 0, 0, 0.4);
  writing-mode: vertical-rl;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.1em;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Rally History */
.rally-history {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-top: var(--space-md);
}

.rally-point {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
}

.rally-point.team-1 {
  background: var(--team-1);
  color: var(--team-1-text, var(--white));
}

.rally-point.team-2 {
  background: var(--team-2);
  color: var(--team-2-text, var(--white));
}

.rally-point.fault {
  background: var(--danger);
  color: var(--white);
}

.rally-point.let {
  background: var(--gray-500);
  color: var(--white);
}

/* Game Score Cards */
.game-scores {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-md);
}

.game-score {
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-family: var(--font-mono);
}

.game-score.current {
  background: var(--primary);
  color: var(--white);
  font-weight: var(--font-weight-bold);
}
[data-theme="light"] .game-score.current {
  background: #1a5c8a;
}

.game-score.won-1 {
  border-bottom: 3px solid var(--team-1);
  background: color-mix(in srgb, var(--team-1) 14%, var(--bg-card));
}

.game-score.won-2 {
  border-bottom: 3px solid var(--team-2);
  background: color-mix(in srgb, var(--team-2) 14%, var(--bg-card));
}

/* Interval/Break Indicator */
.interval-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: fit-content;
  margin: 0 auto var(--space-md);
  padding: 0.3rem 1rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--info, #3b82f6);
  background: rgba(59,130,246,0.1);
  border: 1.5px solid rgba(59,130,246,0.35);
}

/* Game Win Celebration */
.celebration-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-toast);
  cursor: pointer;
  animation: fadeIn 0.3s ease;
}

.celebration-content {
  text-align: center;
  padding: var(--space-xl) var(--space-2xl);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.celebration-icon {
  font-size: 4rem;
  margin-bottom: var(--space-md);
}

.celebration-message {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
}

.celebration-overlay.game_win {
  background: rgba(0, 0, 0, 0.85);
}

.celebration-overlay.game_win .celebration-message {
  font-size: 2.5rem;
  color: var(--gold);
}

.celebration-overlay.match_win {
  background: rgba(0, 0, 0, 0.9);
}

.celebration-overlay.match_win .celebration-message {
  font-size: 3rem;
  background: linear-gradient(135deg, #ffd700, var(--teal), #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== SPECTATOR CELEBRATION OVERLAY ===== */
.bl-spect-celebration {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  background: #000;
  animation: fadeIn 0.4s ease;
}
.bl-spect-celebration__header {
  height: 20%;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, #0f1c28, #1a2d40);
  color: #fff;
  text-align: center;
  gap: 0.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.bl-spect-celebration__icon { font-size: 1.6rem; line-height: 1; }
.bl-spect-celebration__title {
  font-size: clamp(1rem, 4vw, 1.5rem);
  font-weight: 700;
  color: var(--gold, #ffd700);
  margin: 0;
}
.bl-spect-celebration__score {
  font-size: clamp(1.6rem, 7vw, 2.8rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.1;
}
.bl-spect-celebration__subtitle {
  font-size: clamp(1.3rem, 5.5vw, 2rem);
  font-weight: 800;
  color: #fff;
  margin-top: 0.2rem;
  line-height: 1.1;
}
.bl-spect-celebration__next {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  margin-top: 0.6rem;
  letter-spacing: 0.04em;
  animation: bl-spect-pulse 2s ease-in-out infinite;
}
@keyframes bl-spect-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.bl-spect-celebration__ad {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #111;
}
.bl-spect-celebration__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  opacity: 0;
  z-index: 0;
}
.bl-spect-celebration__img.active {
  opacity: 1;
  z-index: 2;
  transition: transform 0.25s ease-out;
}
.bl-spect-celebration__img.next {
  z-index: 1;
}
.bl-spect-celebration__img.exiting {
  opacity: 1;
  z-index: 3;
  transform: translateX(108%) rotate(8deg);
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.bl-spect-celebration__img-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: rgba(255,255,255,0.1);
}
.bl-spect-celebration__dots {
  position: absolute;
  bottom: 2.8rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 7px;
  z-index: 2;
}
.bl-spect-celebration__dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transition: background 0.3s;
}
.bl-spect-celebration__dots span.active { background: #fff; }
.bl-spect-celebration__progress {
  position: absolute;
  bottom: 1.1rem;
  left: 1rem;
  right: 1rem;
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  overflow: hidden;
  z-index: 2;
}
.bl-spect-celebration__progress-bar {
  height: 100%;
  background: var(--primary, #4ade80);
  width: 0%;
}
.bl-spect-no-img {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: rgba(255,255,255,0.08);
}
.bl-spect-celebration__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.bl-spect-celebration__close:hover { background: rgba(255,255,255,0.28); }

/* ===== ANIMATIONS ===== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-pulse { animation: pulse 2s infinite; }
.animate-slide-in { animation: slideIn 0.3s ease; }
.animate-fade-in { animation: fadeIn 0.3s ease; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-md);
}

/* ===== SETTINGS MODAL ===== */
.settings-section {
  margin-bottom: var(--space-lg);
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-color);
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
}

.settings-table td {
  padding: var(--space-xs) 0;
  font-size: var(--font-size-sm);
}

.settings-label {
  color: var(--text-muted);
  width: 50%;
}

.settings-value {
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  text-align: right;
}

.settings-hint {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin: 0 0 var(--space-md);
}

.settings-court-teams {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.settings-court-team {
  background: var(--surface-2, var(--bg-card));
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.settings-team-header {
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-sm);
}

.settings-positions {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-sm);
}

.settings-position {
  color: var(--text-primary);
}

.position-label {
  color: var(--text-muted);
  margin-right: var(--space-xs);
}

.positions-divider {
  color: var(--text-muted);
  align-self: center;
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* ── Impersonation banner ─────────────────────────────────────────────────── */
.impersonation-banner {
  background: linear-gradient(90deg, #7c3aed 0%, #5b21b6 100%);
  color: #f5f3ff;
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-size-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.impersonation-banner.hidden { display: none; }
.impersonation-banner__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  text-align: center;
}
.impersonation-banner__text { flex: 1 1 12rem; line-height: 1.4; }
.impersonation-banner__btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.95);
  color: #4c1d95;
  border: none;
  font-weight: 600;
}
.impersonation-banner__btn:hover:not(:disabled) { background: #fff; }
