/* AInnouncR - Mike 2.0 */
/* Sneat-inspired clean admin UI — light mode, soft shadows, professional */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Sneat palette */
  --bg-body: #f5f5f9;
  --bg-card: #ffffff;
  --bg-surface: #ffffff;
  --bg-input: #f5f5f9;
  --bg-hover: #f0f0f4;
  --text-heading: #32393f;
  --text-primary: #566a7f;
  --text-secondary: #8592a3;
  --text-muted: #a1acb8;
  --border: #e7e7e8;
  --border-light: #eceef1;
  --primary: #696cff;
  --primary-light: rgba(105, 108, 255, 0.08);
  --primary-hover: #5b5eeb;
  --accent: #ffab00;
  --accent-light: rgba(255, 171, 0, 0.12);
  --success: #71dd37;
  --success-light: rgba(113, 221, 55, 0.12);
  --danger: #ff3e1d;
  --danger-light: rgba(255, 62, 29, 0.12);
  --warning: #ffab00;
  --warning-light: rgba(255, 171, 0, 0.12);
  --info: #03c3ec;
  --info-light: rgba(3, 195, 236, 0.12);
  --home-color: #696cff;
  --home-dark: #5b5eeb;
  --away-color: #ff3e1d;
  --away-dark: #d63516;
  --preview-color: #ffab00;
  --play-color: #71dd37;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-card: 0 2px 6px rgba(67, 89, 113, 0.12);
  --shadow-md: 0 4px 16px rgba(67, 89, 113, 0.15);
  --shadow-lg: 0 8px 32px rgba(67, 89, 113, 0.2);
  --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* ─── Header ─── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 3px rgba(67, 89, 113, 0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-left, .header-right { width: 80px; }
.header-right { text-align: right; }

.app-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  letter-spacing: -0.3px;
}

.app-version {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  margin-top: -2px;
}

.icon-btn {
  background: var(--bg-body);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.icon-btn:hover { background: var(--bg-hover); color: var(--text-heading); }

.score-display { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
.score.home-score { color: var(--home-color); }
.score.away-score { color: var(--away-color); }
.score-sep { color: var(--text-muted); margin: 0 4px; }

/* ─── Period Strip ─── */
.period-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.period-strip::-webkit-scrollbar { display: none; }

.period-nav-btn {
  background: var(--bg-body);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.period-nav-btn:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-heading); }
.period-nav-btn:disabled { opacity: 0.3; cursor: default; }

.period-segments {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.period-segments::-webkit-scrollbar { display: none; }

.period-chip {
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  background: var(--bg-body);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
  transition: all var(--transition);
  letter-spacing: 0.3px;
}

.period-chip:hover { background: var(--bg-hover); color: var(--text-primary); }
.period-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(105, 108, 255, 0.35);
}

.score-report-btn {
  background: var(--bg-body);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 34px;
  height: 30px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.score-report-btn:hover {
  background: var(--warning-light);
  border-color: var(--warning);
  color: var(--warning);
}

/* ─── Tab Bar ─── */
.tab-bar {
  display: flex;
  background: var(--bg-card);
  padding: 0 16px;
  border-bottom: 1px solid var(--border-light);
}

.tab {
  flex: 1;
  padding: 14px 0;
  text-align: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  letter-spacing: -0.1px;
}

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

.tab-content { display: none; }
.tab-content.active { display: flex; flex-direction: column; }

/* ─── Score Bar ─── */
.score-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
}

.team-score {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
}

.team-score.home { color: var(--home-color); }
.team-score.away { color: var(--away-color); }
.team-score-num { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.team-name { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }

.score-vs {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-adjust {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.score-adjust:hover { background: var(--bg-hover); color: var(--text-heading); }

/* ─── Rosters ─── */
.rosters {
  display: flex;
  flex: 1;
  overflow-y: auto;
  max-height: calc(100vh - 425px);
  max-height: calc(100dvh - 425px);
  margin: 0 12px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  background: var(--bg-card);
  overflow: hidden;
}

.rosters > .roster { overflow-y: auto; max-height: inherit; }

.roster { flex: 1; }
.home-roster { border-right: 1px solid var(--border-light); }

.roster-header {
  padding: 12px;
  font-weight: 700;
  font-size: 11px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: sticky;
  top: 0;
  z-index: 1;
  color: white;
}

.roster-header.home { background: var(--home-color); }
.roster-header.away { background: var(--away-color); }

.roster-list { font-size: 14px; }

.player-row {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: all 0.12s ease;
  min-height: 48px;
  background: var(--bg-card);
}

.player-row:last-child { border-bottom: none; }
.player-row:active { transform: scale(0.98); }
.player-row:hover { background: var(--bg-hover); }

.home-roster .player-row { border-left: 3px solid var(--home-color); }
.away-roster .player-row { border-left: 3px solid var(--away-color); }

.home-roster .player-row:nth-child(even) { background: rgba(105, 108, 255, 0.03); }
.away-roster .player-row:nth-child(even) { background: rgba(255, 62, 29, 0.03); }

.player-row.selected {
  background: var(--primary-light) !important;
  border-left-color: var(--primary);
}

.player-name { font-weight: 600; color: var(--text-heading); letter-spacing: -0.2px; }
.player-pos { color: var(--text-muted); font-size: 12px; font-weight: 600; }

/* ─── Action Bar ─── */
.action-bar {
  display: flex;
  gap: 8px;
  padding: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.action-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  color: white;
  transition: all var(--transition);
  min-height: 44px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
}

.action-btn:active { transform: scale(0.93); }
.action-btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

/* ─── Sequence Bar ─── */
.sequence-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-card);
  margin: 0 12px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  min-height: 44px;
  flex-wrap: wrap;
}

.sequence-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1.2px;
  white-space: nowrap;
}

.sequence-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }

.chip {
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all var(--transition);
}

.chip:hover { opacity: 0.75; transform: scale(0.95); }

.chip.player-chip.home { background: var(--home-color); }
.chip.player-chip.away { background: var(--away-color); }
.chip.team-chip.home { background: var(--home-dark); }
.chip.team-chip.away { background: var(--away-dark); }
.chip.action-chip { background: var(--text-secondary); }

.clear-btn {
  background: var(--bg-body);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.clear-btn:hover { background: var(--bg-hover); color: var(--text-heading); }

/* ─── Custom Input ─── */
.custom-input-bar {
  padding: 10px 12px;
  display: flex;
  gap: 8px;
}

.custom-text-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-heading);
  font-size: 14px;
  font-family: inherit;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition);
}

.custom-text-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-light); }
.custom-text-input::placeholder { color: var(--text-muted); }

.generate-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.generate-btn:hover { background: var(--primary-hover); }

/* ─── Audio Bar ─── */
.audio-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
}

.audio-text {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  border-left: 4px solid var(--border);
  min-height: 48px;
  display: flex;
  align-items: center;
  line-height: 1.4;
  box-shadow: var(--shadow-card);
}

.audio-text.has-text {
  color: var(--text-heading);
  border-left-color: var(--primary);
  background: var(--primary-light);
  border-color: transparent;
  border-left-color: var(--primary);
}

.audio-controls { display: flex; gap: 8px; flex-shrink: 0; }

.audio-btn {
  padding: 12px 22px;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  min-height: 48px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.audio-btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }
.audio-btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.audio-btn:active:not(:disabled) { transform: translateY(0); }
.audio-btn.loading { opacity: 0.5; pointer-events: none; }

.preview-btn { background: var(--preview-color); color: #fff; }
.play-btn { background: var(--play-color); color: #fff; }

/* ─── Announcements Tab ─── */
.announcements-container {
  padding: 16px;
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
}

.announcement-list {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Swipe wrapper */
.announcement-item-wrapper {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
}

.announcement-item-wrapper:last-child { border-bottom: none; }

.announcement-swipe-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 120px;
  background: var(--danger);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.announcement-item {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background var(--transition), transform 0.25s ease;
}

.announcement-item:hover { background: var(--bg-hover); }
.reorder-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-right: 10px;
  flex-shrink: 0;
}

.reorder-btn {
  background: var(--bg-body);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 8px;
  width: 22px;
  height: 18px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  padding: 0;
}

.reorder-btn:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-heading); }
.reorder-btn:disabled { opacity: 0.25; cursor: default; }

.announcement-title { color: var(--text-heading); font-size: 14px; flex: 1; font-weight: 500; }

.announcement-controls { display: flex; gap: 8px; align-items: center; }

.status-badge {
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.ready { background: var(--success-light); color: #56ca00; }
.status-badge.pending { background: var(--bg-body); color: var(--text-muted); }
.status-badge.auto { background: var(--warning-light); color: #e09600; }
.status-badge.edited { background: rgba(105, 108, 255, 0.12); color: var(--primary); }

.announcement-play-btn {
  background: var(--play-color);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.announcement-play-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.announcement-play-btn:hover:not(:disabled) { filter: brightness(1.05); }

.announcement-render-btn {
  background: transparent;
  border: 1px solid var(--preview-color);
  color: var(--preview-color);
  border-radius: 50px;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all var(--transition);
}

.announcement-render-btn:hover { background: var(--warning-light); }

.announcement-preview-btn {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 50px;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all var(--transition);
}

.announcement-preview-btn:hover { background: var(--primary-light); }

.add-announcement-btn {
  width: 100%;
  padding: 16px;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  transition: all var(--transition);
}

.add-announcement-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

.empty-list-msg { padding: 20px; color: var(--text-muted); font-size: 13px; text-align: center; }

/* ─── Modals ─── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(67, 89, 113, 0.4);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  margin-top: 24px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border: none;
}

.modal.small { max-width: 440px; }

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

.modal-header h2 { font-size: 18px; font-weight: 700; color: var(--text-heading); }

.modal-close {
  background: var(--bg-body);
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--bg-hover); color: var(--text-heading); }

.modal-body { padding: 24px; overflow-y: auto; overflow-x: hidden; flex: 1; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

.setting-group { margin-bottom: 24px; }

.setting-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.setting-input, .setting-select, .setting-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-heading);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.setting-input:focus, .setting-select:focus, .setting-textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.setting-textarea { resize: vertical; }
.setting-input::placeholder, .setting-textarea::placeholder { color: var(--text-muted); }

.team-inputs { display: flex; gap: 8px; }
.team-inputs .short { width: 110px; }

.color-input {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 3px;
  background: var(--bg-card);
}

.voice-row { display: flex; gap: 8px; }
.voice-row .setting-select { flex: 1; }

.refresh-btn {
  background: var(--bg-body);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition);
}

.refresh-btn:hover { color: var(--primary); background: var(--primary-light); }

.data-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

.data-btn {
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-heading);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.data-btn:hover { background: var(--bg-hover); border-color: var(--text-muted); }
.data-btn.primary { background: var(--primary); color: white; border-color: var(--primary); }
.data-btn.primary:hover { background: var(--primary-hover); }
.data-btn.danger { color: var(--danger); border-color: var(--danger); }
.data-btn.danger:hover { background: var(--danger-light); }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-heading);
  font-weight: 500;
}

.checkbox-input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ─── Roster Edit ─── */
.roster-management { display: flex; flex-direction: column; gap: 24px; }
.roster-edit-section { flex: 1; }
.roster-edit-section h4 { font-size: 13px; color: var(--text-heading); font-weight: 700; margin-bottom: 10px; }

.player-edit-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.player-edit-row input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-heading);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--transition);
}

.player-edit-row input:focus { border-color: var(--primary); outline: none; }

.player-edit-row .num-input { width: 44px; text-align: center; font-weight: 700; }
.player-edit-row .name-input { flex: 1; min-width: 0; }
.player-edit-row .pos-input { width: 40px; text-align: center; }

.year-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  color: var(--text-heading);
  font-size: 12px;
  font-family: inherit;
  width: 80px;
  cursor: pointer;
}

.pronounce-input { width: 90px; font-style: italic; color: var(--primary) !important; }

.player-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  transition: color var(--transition);
}

.player-remove-btn:hover { color: var(--danger); }

.add-player-btn {
  background: var(--bg-body);
  border: 2px dashed var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 8px;
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: all var(--transition);
}

.add-player-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

/* ─── Energy & Sport Settings ─── */
.team-energy-row { margin-top: 10px; }

.energy-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
  font-weight: 700;
}

.energy-select { width: 100%; }

.setting-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ─── Sport Config — Segment Editor ─── */
.segments-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.segment-pill {
  padding: 4px 10px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.setting-group-card {
  background: var(--bg-body);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  border: 1px solid var(--border-light);
}

/* ─── Sport Badge (header) ─── */
.sport-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: default;
  white-space: nowrap;
  border: 1px solid rgba(105, 108, 255, 0.2);
}

/* ─── Segment Editor (editable list) ─── */
.segment-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.segment-reset-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}

.segment-reset-btn:hover { color: var(--primary); background: var(--primary-light); }

.segment-edit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.segment-edit-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.segment-drag-handle {
  color: var(--text-muted);
  font-size: 14px;
  cursor: grab;
  flex-shrink: 0;
  line-height: 1;
  padding: 2px;
}

.segment-name-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--text-heading);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: border-color var(--transition);
}

.segment-name-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-light);
}

.segment-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all var(--transition);
}

.segment-remove-btn:hover { color: var(--danger); background: var(--danger-light); }

.segment-add-btn {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 2px dashed var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all var(--transition);
  font-family: inherit;
}

.segment-add-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ─── Action Editor (custom sport) ─── */
.action-editor-section {
  border-top: 1px solid var(--border-light);
  padding-top: 4px;
}

.action-edit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.action-edit-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-label-input {
  flex: 2;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--text-heading);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-transform: uppercase;
  transition: border-color var(--transition);
}

.action-label-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px var(--primary-light); }

.action-id-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-family: monospace;
  transition: border-color var(--transition);
}

.action-id-input:focus { border-color: var(--primary); outline: none; }

.action-color-input {
  width: 34px;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  background: var(--bg-card);
}

.action-points-input {
  width: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 6px;
  color: var(--text-heading);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  flex-shrink: 0;
  transition: border-color var(--transition);
}

.action-points-input:focus { border-color: var(--primary); outline: none; }

.action-dark-text-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

/* ─── Audio Bar: pulse-hint on auto-populate ─── */
@keyframes pulse-hint {
  0%   { box-shadow: 0 0 0 0 rgba(105, 108, 255, 0.5); }
  50%  { box-shadow: 0 0 0 8px rgba(105, 108, 255, 0.0); }
  100% { box-shadow: 0 0 0 0 rgba(105, 108, 255, 0); }
}

.audio-bar.pulse-hint {
  animation: pulse-hint 0.9s ease-out 2;
  border-radius: var(--radius-md);
}

/* ─── Music Tab ─── */
.music-container {
  padding: 16px;
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
}

.music-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.music-hint-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.music-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
}

.music-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.music-card-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.music-card-meta { flex: 1; }
.music-card-title { font-size: 15px; font-weight: 700; color: var(--text-heading); }
.music-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.music-status-badge {
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.music-status-badge.loaded { background: var(--success-light); color: #56ca00; }
.music-status-badge.empty { background: var(--bg-body); color: var(--text-muted); }
.music-status-badge.small { padding: 2px 8px; font-size: 9px; }

.music-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.music-btn {
  padding: 8px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.3px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.music-btn.upload {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.music-btn.upload:hover { background: var(--primary); color: white; }

.music-btn.preview {
  background: var(--warning-light);
  border: 1px solid var(--warning);
  color: var(--warning);
}

.music-btn.preview:hover { background: var(--warning); color: white; }
.music-btn.preview:disabled { opacity: 0.35; cursor: not-allowed; }

.music-btn.clear.danger {
  background: var(--danger-light);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.music-btn.clear.danger:hover { background: var(--danger); color: white; }
.music-btn.clear.danger:disabled { opacity: 0.35; cursor: not-allowed; }

.music-btn.small {
  padding: 5px 10px;
  font-size: 11px;
  min-height: 30px;
}

.stop-music-btn {
  width: 100%;
  padding: 12px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.3px;
  margin-top: 8px;
  margin-bottom: 4px;
}

.stop-music-btn:hover {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

.stop-music-btn.active {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
  animation: pulse-stop 1.5s ease-in-out infinite;
}

@keyframes pulse-stop {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* ─── Atmosphere Controls ─── */
.atmosphere-volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.atmosphere-vol-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 52px;
  flex-shrink: 0;
}

.atmosphere-vol-slider {
  flex: 1;
  accent-color: var(--primary);
  cursor: pointer;
  height: 4px;
}

.atmosphere-vol-slider:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.atmosphere-vol-value {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.music-btn.play-atm {
  background: var(--success-light);
  border: 1px solid var(--success);
  color: #56ca00;
}

.music-btn.play-atm:hover { background: var(--success); color: white; }
.music-btn.play-atm:disabled { opacity: 0.35; cursor: not-allowed; }

.music-btn.stop-atm {
  background: var(--danger);
  border: 1px solid var(--danger);
  color: white;
  animation: pulse-stop 1.5s ease-in-out infinite;
}

.music-btn.stop-atm:hover { opacity: 0.85; }

/* ─── Walkup Music ─── */
.walkup-team-block {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.walkup-team-header {
  padding: 10px 16px;
  font-weight: 700;
  font-size: 11px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: white;
}

.walkup-team-header.home { background: var(--home-color); }
.walkup-team-header.away { background: var(--away-color); }

.walkup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  min-height: 48px;
}

.walkup-row:last-child { border-bottom: none; }

.walkup-number {
  font-size: 12px;
  font-weight: 800;
  min-width: 36px;
  padding: 3px 8px;
  border-radius: 50px;
  text-align: center;
}

.walkup-number.home { background: rgba(105, 108, 255, 0.1); color: var(--home-color); }
.walkup-number.away { background: rgba(255, 62, 29, 0.1); color: var(--away-color); }

.walkup-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-heading);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── iOS / Touch / Responsive ─── */
input, select, textarea { font-size: 16px !important; }

@supports (padding: env(safe-area-inset-bottom)) {
  .audio-bar { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* Tablet */
@media (min-width: 768px) {
  .rosters { max-height: calc(100vh - 445px); }
  .action-btn { padding: 12px 24px; font-size: 13px; }
  .player-row { padding: 12px 16px; }
}

/* Phone */
@media (max-width: 480px) {
  .app-title { font-size: 18px; }
  .action-bar { gap: 6px; padding: 10px; }
  .action-btn { padding: 8px 12px; font-size: 11px; flex: 1; min-width: 0; }
  .score-bar { margin: 8px; padding: 10px 12px; }
  .rosters { margin: 0 8px; }
  .sequence-bar { margin: 0 8px; }
  .audio-bar { padding: 10px 8px; }

  .audio-bar { flex-wrap: wrap; }
  .audio-text { width: 100%; margin-bottom: 8px; }
  .audio-controls { width: 100%; }
  .audio-controls .audio-btn { flex: 1; }

  .team-inputs { flex-wrap: wrap; }
}

/* Landscape phone */
@media (max-height: 500px) {
  .rosters { max-height: calc(100vh - 300px); }
  .player-row { padding: 6px 12px; min-height: 40px; }
}
