/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform 80ms ease, opacity var(--transition);
  text-align: center;
  line-height: 1.2;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.96);
}

.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

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

.btn-accent {
  background: var(--green);
  color: #000;
}

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

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-ghost:active {
  background: var(--bg-elevated);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.1rem;
  width: 100%;
  max-width: 340px;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-lg:has(.btn-hint) {
  flex-direction: column;
  gap: 2px;
}

.btn-hint {
  font-size: 0.7em;
  font-weight: 400;
  opacity: 0.6;
  pointer-events: none;
}

/* === Sport Picker === */
.sport-picker {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.btn-sport {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 8px;
  flex: 1 1 0;
  min-height: 110px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  transition: border-color var(--transition), background var(--transition);
}

.btn-sport:active,
.btn-sport.selected {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.sport-icon {
  font-size: 2.5rem;
}

.sport-icon-img {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px;
  max-height: 40px;
  object-fit: contain;
  display: block;
}

/* === Team Load/Save === */
.team-load-save {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.team-picker {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.team-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.team-picker-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.team-picker-load {
  flex: 1;
  text-align: left;
  justify-content: flex-start;
  white-space: nowrap;
  overflow: hidden;
}

.team-picker-load strong {
  margin-right: 6px;
}

.team-picker-detail {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.75rem;
}

.team-picker-swatch {
  display: inline-block;
  width: 28px;
  height: 14px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid rgba(255,255,255,0.15);
}

/* === Colour Picker === */
.color-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-preview-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-jersey-preview {
  width: 28px;
  height: 34px;
  border-radius: 4px 4px 2px 2px;
  border: 2px solid rgba(255,255,255,0.15);
  background: var(--bg-elevated);
  flex-shrink: 0;
  position: relative;
}

.color-jersey-preview::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 4px;
  background: var(--bg);
  border-radius: 0 0 3px 3px;
}

.color-preview {
  height: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex: 1;
}

.color-clear {
  font-size: 0.7rem;
  flex-shrink: 0;
}

.color-swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition), transform 80ms ease;
  padding: 0;
  position: relative;
}

.color-swatch:active {
  transform: scale(0.9);
}

.color-swatch.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
}

.color-swatch.selected::after {
  content: attr(data-order);
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: var(--accent);
  color: #000;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Home Loading / Offline === */
.home-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 0;
}

.home-loading .loading-text {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.home-offline {
  text-align: center;
  padding: 20px 0;
}

.home-offline p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* === Auth === */
.home-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.user-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
}

.auth-back-link {
  align-self: flex-start;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-back-link:hover {
  color: var(--accent);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin-bottom: 12px;
  animation: auth-pulse 2s ease-in-out infinite;
}

@keyframes auth-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(79,195,247,0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(79,195,247,0); }
}

.auth-header h2 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

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

.auth-card .form-group {
  margin-bottom: 16px;
}

.auth-card .form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.auth-card .input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color 0.2s;
}

.auth-card .input:focus {
  border-color: var(--accent);
  outline: none;
}

.auth-error {
  color: var(--red);
  font-size: 0.85rem;
  min-height: 20px;
  margin-bottom: 8px;
}

.auth-actions {
  margin-bottom: 12px;
}

.auth-submit {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(79,195,247,0.3);
}

.auth-footer {
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
}

.auth-toggle {
  display: block;
  margin: 4px auto;
  text-align: center;
  font-size: 0.85rem;
  padding: 8px 12px;
}

/* === Player Entry === */
.player-entry {
  margin-top: 12px;
  margin-bottom: 12px;
}

.player-entry-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.player-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.player-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px 6px 10px;
  font-size: 0.85rem;
  width: 100%;
}

.player-list li .num {
  font-weight: 700;
  color: var(--accent);
  min-width: 32px;
  flex-shrink: 0;
}

.player-list li .input-player-label {
  flex: 1;
  padding: 4px 8px;
  font-size: 0.8rem;
  min-width: 0;
}

.player-list li .remove-player {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.9rem;
  line-height: 1;
}

/* === Squad Assign Dropdown === */
.select-squad-assign {
  flex: 1;
  padding: 4px 8px;
  font-size: 0.8rem;
  min-width: 0;
  appearance: auto;
  -webkit-appearance: menulist;
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.quick-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 8px;
}

.quick-add-row .input {
  flex: 1;
  min-width: 0;
}

/* === Scoreboard === */
.scoreboard {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px 6px;
}

.name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 2px;
}

.name-row .team-label {
  flex: 1;
  text-align: center;
  min-width: 0;
  overflow-wrap: break-word;
}

.name-row .team-label:first-child {
  text-align: right;
}

.name-row .team-label:last-child {
  text-align: left;
}

.name-divider {
  font-size: 0.7rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.team-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex: 1;
}

.team-score.home {
  justify-content: center;
  text-align: right;
}

.team-score.away {
  justify-content: center;
  text-align: left;
}

.team-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.team-label:active {
  color: var(--accent);
}

.score-value {
  font-size: 1.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #fff;
}

.score-divider {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-dim);
}

.timer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  padding-bottom: 4px;
}

#match-period {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

#match-clock {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

#btn-timer-toggle {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s, color 0.2s;
}

#btn-timer-toggle.timer-paused {
  background: var(--green, #4caf50);
  color: #fff;
  animation: pulse-glow 1.5s infinite;
}

#btn-timer-toggle.timer-running {
  background: var(--red, #f44336);
  color: #fff;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(76, 175, 80, 0); }
}

.since-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 3px 0 6px;
}

.since-item {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.since-item strong {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* === Live Content === */
.live-content {
  padding: 8px 10px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

/* === Team Toggle === */
.team-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 3px;
}

.btn-toggle {
  flex: 1;
  padding: 8px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn-toggle.active {
  background: var(--accent);
  color: #000;
}

.btn-toggle.active[data-team="home"] {
  background: var(--home-gradient);
  color: var(--home-text);
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.btn-toggle.active[data-team="away"] {
  background: var(--away-gradient);
  color: var(--away-text);
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* === Event Grid === */
.event-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.btn-event {
  padding: 14px 4px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius);
  min-height: 52px;
  line-height: 1.2;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
}

.btn-event:active {
  background: rgba(255,255,255,0.08);
  border-color: var(--accent);
}

/* Left accent stripe for category distinction */
.btn-goal { border-left: 3px solid #43a047; }
.btn-point { border-left: 3px solid #1e88e5; }
.btn-wide { border-left: 3px solid #7e57c2; }
.btn-short { border-left: 3px solid #8d6e63; }
.btn-tackle { border-left: 3px solid #00acc1; }
.btn-puckout-won { border-left: 3px solid #3949ab; display: inline-block; }
.btn-puckout-lost { border-left: 3px solid #e53935; display: inline-block; }
.btn-card { border-left: 3px solid #ff8f00; }
.btn-undo { color: var(--text-muted); }
.btn-2pointer { border-left: 3px solid #f06292; }

/* Sub-option source buttons */
.btn-from-free { border-left: 3px solid #00897b; }
.btn-from-pen { border-left: 3px solid #ef6c00; }
.btn-from-placed { border-left: 3px solid #7b1fa2; }

/* Tackle sub-options */
.btn-block { border-left: 3px solid #00838f; }
.btn-hook { border-left: 3px solid #006064; }

/* Card sub-options */
.btn-yellow { border-left: 3px solid var(--yellow); }
.btn-red { border-left: 3px solid var(--red); }

/* === Event Sub-options Panel === */
.event-sub {
  margin-bottom: 12px;
}

.event-sub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

/* debounce visual feedback */
.btn-event.cooldown {
  opacity: 0.5;
  pointer-events: none;
}

/* Period button confirm state */
.btn.confirming {
  background: var(--red) !important;
  color: #fff !important;
  animation: confirmPulse 600ms ease infinite alternate;
}

@keyframes confirmPulse {
  from { opacity: 1; }
  to { opacity: 0.7; }
}

#btn-undo-period {
  color: var(--yellow);
}

/* === Player Picker === */
.player-picker {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.picker-panel {
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 16px;
  max-height: 60dvh;
  overflow-y: auto;
  animation: slideUp 200ms ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.btn-player {
  padding: 12px 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
  text-align: center;
}

.btn-player:active {
  background: var(--accent);
  color: #000;
}

.btn-player.unknown {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  grid-column: span 2;
}

/* === Sub Overlay === */
.sub-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sub-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* === Recent Events === */
.recent-events {
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
  max-height: 140px;
  overflow-y: auto;
}

.recent-events ul {
  list-style: none;
}

.recent-events li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.recent-events li:last-child {
  border-bottom: none;
}

.recent-events .event-info {
  display: flex;
  gap: 8px;
  align-items: center;
}

.recent-events .event-time {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
}

.recent-events .event-player {
  color: var(--accent);
  font-weight: 600;
}

.recent-events .event-type {
  color: var(--text-muted);
}

.recent-events .event-half {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.recent-events .event-team {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-dim);
}

.recent-events .event-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.recent-events .event-dot.home-dot { background: var(--home-gradient); }
.recent-events .event-dot.away-dot { background: var(--away-gradient); }

/* Player picker team colour strip */
.picker-panel .picker-header {
  border-bottom: 3px solid var(--accent);
  padding-bottom: 10px;
}

.picker-panel.home-picker .picker-header {
  border-image: var(--home-gradient) 1;
}

.picker-panel.away-picker .picker-header {
  border-image: var(--away-gradient) 1;
}

.recent-events .event-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.recent-events .btn-edit-event {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.85rem;
}

.recent-events .btn-edit-event:active {
  color: var(--accent);
}

.recent-events .btn-delete-event {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.85rem;
}

.recent-events .btn-delete-event.delete-confirming {
  color: var(--red);
  font-weight: 700;
  animation: confirmPulse 600ms ease infinite alternate;
}

/* === Edit Time Input === */
.edit-time-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-time-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.input-time {
  width: 70px;
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  padding: 6px 8px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* === Recent header with Add button === */
.recent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.recent-header h3 {
  margin: 0;
}

.btn-add-event {
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  cursor: pointer;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius);
}

.btn-add-event:active {
  background: var(--bg-elevated);
}

/* === Go Live Button === */
.btn-go-live {
  background: var(--green);
  color: #000;
  font-weight: 700;
}

/* === Match Controls === */
.match-controls {
  display: flex;
  gap: 8px;
  padding: 12px 0 24px;
  flex-wrap: wrap;
}

.match-controls .btn {
  flex: 1;
  min-width: 100px;
}

/* === Summary === */
.summary-exports {
  margin-top: 0 !important;
  justify-content: center;
}

.summary-scoreboard {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}

.summary-scoreboard .final-score {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 8px 0;
}

.summary-scoreboard .half-scores {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.summary-section {
  margin-bottom: 16px;
}

.summary-section h3 {
  margin-bottom: 8px;
}

/* Stats table */
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  table-layout: fixed;
}

.stats-table th,
.stats-table td {
  padding: 5px 2px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.stats-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
}

.stats-table .num-col {
  font-weight: 700;
  color: var(--accent);
  text-align: left;
  width: 24px;
}

.stats-table .name-col {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-table .score-col {
  font-weight: 600;
  width: 26px;
}

/* Left-align # and Name headers */
.stats-table th:first-child,
.stats-table th:nth-child(2) {
  text-align: left;
}

/* Shot stats */
.shot-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.shot-stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}

.shot-stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.shot-stat-card .stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  margin-top: 4px;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.tl-half-divider {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  padding: 8px 0 4px;
  letter-spacing: 0.5px;
}

.timeline-event {
  position: relative;
  padding: 4px 0 8px 12px;
  font-size: 0.8rem;
}

.timeline-event::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-event.away-event::before {
  background: var(--orange);
}

.timeline-event .tl-time {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.timeline-event .tl-detail {
  color: var(--text-muted);
}

/* === Session Banner === */
.session-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--green);
  font-size: 0.8rem;
}

.session-banner .live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulseDot 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.6); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(76, 175, 80, 0); }
}

.session-banner .live-label {
  font-weight: 800;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.7rem;
}

.session-banner .session-code {
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--accent);
}

.session-banner .sync-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
}
.sync-status.reconnecting {
  color: var(--yellow, #ffc107);
  background: rgba(255, 193, 7, 0.15);
}
.sync-status.offline {
  color: var(--red, #f44336);
  background: rgba(244, 67, 54, 0.15);
}

.session-banner .participant-count {
  color: var(--text-dim);
  font-size: 0.75rem;
  margin-left: auto;
}

/* === Join Session Screen === */
.join-screen {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.join-screen .form-group {
  width: 100%;
  max-width: 300px;
}

.join-screen .screen-actions {
  width: 100%;
  max-width: 300px;
}

.join-code-input {
  font-family: monospace;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 6px;
  text-align: center;
  text-transform: uppercase;
  width: 100%;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4px;
  margin-bottom: 16px;
}

/* === History === */
.history-list {
  list-style: none;
}

.history-list li {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color var(--transition);
}

.history-list li:active {
  border-color: var(--accent);
}

.history-list .match-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.history-list .match-score {
  font-size: 0.9rem;
  color: var(--accent);
}

.history-list .match-date {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.history-list .history-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* === Manage Teams === */
.teams-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-select-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition);
}

.team-select-item:active {
  background: var(--bg-elevated);
}

.team-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.team-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.team-card-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
  margin-right: 8px;
}

.team-age-label {
  font-size: 0.7rem;
  color: var(--accent);
  background: rgba(79, 195, 247, 0.1);
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
}

.team-age-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.team-age-row label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.team-age-select {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.85rem;
  max-width: 160px;
}

.team-card-players {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.team-card-players li {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px 6px 6px;
  font-size: 0.85rem;
}

.input-num-edit {
  width: 44px;
  padding: 4px 2px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  color: var(--accent);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
  -moz-appearance: textfield;
}

.input-num-edit::-webkit-inner-spin-button,
.input-num-edit::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.team-card-players li .input-player-label {
  flex: 1;
  padding: 4px 8px;
  font-size: 0.8rem;
  min-width: 0;
}

.team-card-add {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.team-card-add .input-sm {
  width: 52px;
  padding: 8px 4px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius);
}

.team-card-add .input-player-label {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.85rem;
  min-width: 0;
  border-radius: var(--radius);
}

.team-select-item .team-card-count {
  margin-left: auto;
  margin-right: 0;
}

/* === New Team Form === */
.new-team-name {
  width: 100%;
  margin-bottom: 12px;
  font-size: 1.1rem;
  padding: 10px 12px;
}

.color-picker-section {
  margin-bottom: 12px;
}

.color-picker-section label {
  display: block;
  margin-bottom: 6px;
}

.color-picker-section .color-preview {
  height: 24px;
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.new-team-save {
  width: 100%;
  margin-top: 8px;
}

/* === 2-Pointer Button === */
.btn-2pointer { background: #f57c00; color: #fff; }

/* === Edit Overlay === */
.edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-form .event-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.edit-form .event-grid .btn-event {
  padding: 8px 2px;
  font-size: 0.65rem;
  min-height: 36px;
}

.edit-form .picker-grid {
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

/* Player grid with names (tracked team in edit overlay) */
.edit-form .picker-grid-names {
  grid-template-columns: repeat(3, 1fr);
}

.picker-grid-names .btn-player {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  padding: 8px 10px;
}

.picker-grid-names .player-num {
  font-weight: 700;
  min-width: 22px;
}

.picker-grid-names .player-name {
  font-size: 0.7rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Highlight the currently selected type/player in edit overlay */
.edit-selected {
  outline: 3px solid var(--accent) !important;
  outline-offset: -3px;
}

/* === Quick Team Row === */
.quick-team-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.quick-team-row .input {
  flex: 1;
}

/* === Draft Matches === */
.draft-matches {
  width: 100%;
}

.draft-matches h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.draft-matches ul {
  list-style: none;
  padding: 0;
}

.draft-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
}

.draft-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.draft-teams {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draft-sport {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.draft-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* === Watch History === */
.watch-history {
  width: 100%;
}

.watch-history h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.watch-history ul {
  list-style: none;
}

.watch-history li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin-bottom: 6px;
}

.watch-history .watch-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.watch-history .watch-teams {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watch-history .watch-sport {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.watch-history .watch-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.watch-history .btn-remove {
  padding: 4px 8px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* === Spectator Mode === */
.spectator-mode .team-toggle,
.spectator-mode #event-grid,
.spectator-mode #event-sub,
.spectator-mode .match-controls,
.spectator-mode #player-picker,
.spectator-mode #sub-overlay,
.spectator-mode #edit-overlay,
.spectator-mode #simple-score-panel {
  display: none !important;
}

.spectator-mode #btn-timer-toggle {
  display: none !important;
}

.spectator-mode .btn-add-event {
  display: none !important;
}

/* Keep the Home button visible for spectators */
.spectator-mode .match-controls {
  display: flex !important;
}
.spectator-mode .match-controls > *:not(#btn-live-home):not(#btn-chat) {
  display: none !important;
}

/* === Chat === */
.chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  max-height: 70dvh;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  min-height: 120px;
  max-height: 50dvh;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 24px 0;
}

.chat-msg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
  padding: 4px 8px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.chat-msg-mine {
  background: rgba(76, 175, 80, 0.15);
}

.chat-author {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
}

.chat-msg-mine .chat-author {
  color: var(--green);
}

.chat-text {
  font-size: 0.85rem;
  color: var(--text);
  word-break: break-word;
  flex: 1 1 100%;
}

.chat-time {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-left: auto;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.chat-input-row .input {
  flex: 1;
  min-width: 0;
}

.chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  margin-left: 4px;
}

.chat-actions {
  margin-left: auto;
  display: flex;
  gap: 2px;
}

.btn-chat-action {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.btn-chat-action:hover { opacity: 1; }

.chat-msg-muted {
  opacity: 0.5;
}

.chat-muted-label {
  font-size: 0.6rem;
  color: var(--red);
  font-weight: 700;
  text-transform: uppercase;
}

/* === Match Confirmation Screen === */
.confirm-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  margin-bottom: 16px;
}

.confirm-match-title {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.confirm-matchup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.confirm-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.confirm-jersey {
  width: 48px;
  height: 56px;
  border-radius: 6px 6px 2px 2px;
  border: 2px solid rgba(255,255,255,0.15);
  position: relative;
}

/* Collar notch */
.confirm-jersey::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 6px;
  background: var(--bg-surface);
  border-radius: 0 0 4px 4px;
}

.confirm-team-name {
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.confirm-player-count {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.confirm-vs {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
  flex-shrink: 0;
}

.confirm-details {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.confirm-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

/* === Undo Toast === */
.toast-undo {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: normal;
}

.toast-undo .btn-undo-action {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

/* === Share Overlay === */
.share-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.share-panel {
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 16px;
  text-align: center;
  animation: slideUp 200ms ease;
}

.share-panel h3 {
  margin-bottom: 12px;
  color: var(--text);
}

.share-code {
  font-family: monospace;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--accent);
  background: var(--bg-elevated);
  padding: 12px 20px;
  border-radius: var(--radius);
  display: inline-block;
  margin-bottom: 16px;
}

.share-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.share-actions .btn {
  min-width: 120px;
}

/* === Match Ended Banner === */
.match-ended-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--red);
  animation: slideDown 300ms ease;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.match-ended-banner .ended-label {
  font-weight: 800;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.8rem;
}

.match-ended-banner .ended-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  flex: 1;
}

/* WATCHING banner style */
.spectator-banner {
  border-bottom-color: var(--accent) !important;
}
.spectator-banner .live-dot {
  background: var(--accent) !important;
  animation: none !important;
}
.spectator-banner .live-label {
  color: var(--accent) !important;
}

/* === Live Now (followed clubs) === */
.live-now {
  width: 100%;
}

.live-now h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.live-now-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
}

.live-now-mine {
  border-color: var(--green);
  background: rgba(102, 187, 106, 0.06);
}

.live-now-followed {
  border-color: var(--accent);
  background: rgba(79, 195, 247, 0.04);
}

.live-now-item .live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}

.live-now-info {
  flex: 1;
  min-width: 0;
}

.live-now-teams {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-now-title {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.live-now-sport {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.live-now-admin {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.live-now-host-uid {
  font-size: 0.65rem;
  color: var(--text-dim);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Follow chips (Settings screen) */
.settings-followed-clubs {
  margin-top: 8px;
}

.followed-clubs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.follow-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

.follow-chip-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}
.follow-chip-remove:hover {
  color: var(--red);
}

.follow-input-row {
  display: flex;
  gap: 6px;
}
.follow-input-row .input {
  flex: 1;
}

/* === Club & Follow inputs (home screen) === */
.club-setting {
  width: 100%;
  max-width: 280px;
  margin-top: 12px;
}

.club-setting label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}

.settings-card > label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.settings-card .form-hint {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 0.72rem;
}

.settings-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-settings-link {
  width: 100%;
  justify-content: flex-start;
  padding: 12px 14px;
  font-size: 0.9rem;
}

.club-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.club-input-row .input {
  flex: 1;
  min-width: 0;
}

/* === Club Autocomplete === */
.club-autocomplete {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 200;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 200px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.club-autocomplete-item {
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.club-autocomplete-item:hover,
.club-autocomplete-item.active {
  background: var(--bg-surface);
}

.club-county {
  font-size: 0.7rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* === Simple Score Panel (Score Only mode) === */
.simple-score-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px 0;
}

.simple-team {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.simple-team-name {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 12px;
  text-align: center;
}

.simple-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.simple-btn {
  padding: 20px 8px !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  min-height: 60px !important;
}

.simple-undo {
  align-self: center;
  min-width: 120px;
}

/* === Player Stats Dashboard === */
.stats-filters {
  margin-bottom: 16px;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.filter-row select,
.filter-row input[type="date"] {
  flex: 1;
  min-width: 0;
}

.stats-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -16px;
  padding: 0 16px;
}

.stats-table-container .stats-table {
  min-width: 700px;
}

.stats-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.stats-table th.sortable:hover {
  color: var(--accent);
}

.stats-table th.sorted-asc::after {
  content: ' ▲';
  font-size: 0.7em;
}

.stats-table th.sorted-desc::after {
  content: ' ▼';
  font-size: 0.7em;
}

.stats-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 16px;
}

/* === Pitch Location Overlay === */
.pitch-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.pitch-overlay.hidden {
  display: none;
}

.pitch-panel {
  background: var(--bg-surface, var(--bg-elevated));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 16px;
  position: relative;
  z-index: 1;
}

.pitch-header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pitch-direction-prompt {
  text-align: center;
  padding: 12px 0;
}

.pitch-direction-prompt p {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.pitch-direction-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.pitch-direction-buttons .btn {
  min-width: 120px;
}

.pitch-container {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

.pitch-svg {
  width: 100%;
  max-width: 420px;
  background: #1a5c2a;
  border-radius: var(--radius);
  cursor: crosshair;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.pitch-actions {
  display: flex;
  justify-content: center;
  padding-top: 12px;
}

.pitch-actions .btn {
  min-width: 140px;
}

/* === Shot Map (Summary) === */
.shot-map-card {
  text-align: center;
  margin-bottom: 12px;
}

.shot-map-card .stat-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
  font-weight: 600;
}

.shot-map-pitch {
  width: 100%;
  max-width: 360px;
  background: #1a5c2a;
  border-radius: var(--radius);
}

.shot-map-legend {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.shot-map-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.shot-map-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.shot-map-legend .dot-scored { background: var(--green); }
.shot-map-legend .dot-missed { background: var(--red); }

.shot-map-half-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 16px 0 8px;
  text-align: center;
}
