/* ===========================
   RESET & VARIABLES
=========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #111111;
  --primary-light: #1a1a1a;
  --accent: #f97316;
  --accent-hover: #ea6c00;
  --accent-light: #2d1200;
  --success: #22c55e;
  --success-bg: #14532d;
  --success-text: #86efac;
  --danger: #ef4444;
  --danger-bg: #450a0a;
  --danger-text: #fca5a5;
  --bg: #0a0a0a;
  --card-bg: #141414;
  --text: #f0f0f0;
  --text-muted: #888888;
  --border: #2a2a2a;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.7);
  --radius: 12px;
  --radius-sm: 8px;
}

/* Light mode overrides */
[data-theme="light"] {
  --primary: #1c325c;
  --primary-light: #264478;
  --accent-light: #fff7ed;
  --success-bg:   #dcfce7;
  --success-text: #166534;
  --danger-bg:    #fee2e2;
  --danger-text:  #991b1b;
  --bg:        #f1f5f9;
  --card-bg:   #ffffff;
  --text:      #1e293b;
  --text-muted:#64748b;
  --border:    #e2e8f0;
  --shadow:    0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===========================
   LOGIN PAGE
=========================== */
.login-page {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 100vh;
}

.login-container {
  width: 100%;
  max-width: 440px;
}

.login-card {
  background: transparent;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  padding: 0;
}

/* Black logo panel at top */
.login-logo-panel {
  background: #000000;
  padding: 40px 40px 32px;
  text-align: center;
}

.team-logo-badge {
  width: 260px;
  height: auto;
  margin: 0 auto 10px;
  display: block;
}

.login-tagline {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-top: 4px;
}

/* White form panel below */
.login-form-panel {
  background: #ffffff;
  padding: 36px 40px 44px;
}

.login-form-panel h2 {
  color: #1e293b;
}

.login-form-panel .auth-hint {
  color: #64748b;
}

.login-form-panel .form-group label {
  color: #64748b;
}

.login-form-panel .form-group input {
  background: #f8fafc;
  color: #1e293b;
  border-color: #e2e8f0;
}

.login-form-panel .error-message {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}

.login-card h2 {
  color: var(--text);
  margin-bottom: 20px;
}

/* ===========================
   FORM ELEMENTS
=========================== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  background: var(--card-bg);
  transition: border-color 0.15s;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

.form-group select {
  cursor: pointer;
  appearance: auto;
}

/* Score row layout */
.score-row {
  display: grid;
  grid-template-columns: 1fr 32px 1fr;
  gap: 8px;
  align-items: end;
}

.score-separator {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: 8px;
}

.score-team-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 5px;
}

/* ===========================
   BUTTONS
=========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35);
}

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

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

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.btn-danger:hover:not(:disabled) {
  background: #fca5a5;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  margin-top: 4px;
}

/* ===========================
   MESSAGES
=========================== */
.error-message {
  background: var(--danger-bg);
  color: var(--danger-text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  font-weight: 500;
}

.success-message {
  background: var(--success-bg);
  color: var(--success-text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  font-weight: 500;
}

.auth-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.check-icon {
  font-size: 44px;
  text-align: center;
  margin-bottom: 12px;
}

.auth-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
  text-align: center;
}

.auth-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* ===========================
   UTILITY
=========================== */
.hidden {
  display: none !important;
}

/* ===========================
   APP LAYOUT
=========================== */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  background: var(--primary);
  color: white;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-tagline {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
}

.header-logo-badge {
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

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

.header-user-info {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#user-email {
  font-size: 12px;
  opacity: 0.65;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#logout-btn {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

#logout-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Nav Tabs */
.app-nav {
  background: var(--card-bg);
  border-bottom: 2px solid var(--border);
  display: flex;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 62px;
  z-index: 90;
}

.app-nav::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 22px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all 0.15s;
  background: none;
  font-family: inherit;
}

.nav-tab:hover {
  color: var(--text);
  background: var(--bg);
}

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

.tab-icon {
  font-size: 15px;
}

/* Main content */
.app-main {
  flex: 1;
  padding: 24px 20px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

/* Section */
.section {
  display: none;
}

.section.active {
  display: block;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h2 {
  font-family: 'Barlow Condensed', 'Segoe UI', sans-serif;
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ===========================
   DASHBOARD / HOME
=========================== */
.section-date {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.record-card {
  background: linear-gradient(135deg, var(--primary) 0%, #1a3a5c 100%);
  color: white;
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(13, 33, 55, 0.35);
}

.record-card-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.record-card h3 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.55;
  margin-bottom: 8px;
  font-weight: 700;
}

.record-display {
  font-family: 'Barlow Condensed', 'Segoe UI', sans-serif;
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
}

.record-display .wins { color: #4ade80; }
.record-display .dash { color: rgba(255,255,255,0.25); margin: 0 8px; letter-spacing: 0; }
.record-display .losses { color: #f87171; }

.record-right {
  text-align: right;
}

.record-pct-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.55;
  font-weight: 700;
  margin-bottom: 4px;
}

.record-pct {
  font-family: 'Barlow Condensed', 'Segoe UI', sans-serif;
  font-size: 40px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--accent);
  position: relative;
}

.stat-nav {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat-nav:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stat-nav:hover .stat-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.stat-arrow {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 16px;
  color: var(--accent);
  opacity: 0.3;
  transition: opacity 0.15s, transform 0.15s;
  font-weight: 900;
  line-height: 1;
}

.stat-number {
  font-family: 'Barlow Condensed', 'Segoe UI', sans-serif;
  font-size: 40px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 5px;
  font-weight: 700;
}

/* Dashboard 2-col widget row */
.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-widget {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.widget-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.widget-empty {
  font-size: 13px;
  color: var(--text-muted);
}

/* Category breakdown bars */
.cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.cat-row:last-child {
  margin-bottom: 0;
}

.cat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  width: 80px;
  flex-shrink: 0;
}

.cat-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.cat-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.cat-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  width: 16px;
  text-align: right;
  flex-shrink: 0;
}

/* Category bar colors */
.cat-bar.offense    { background: #1d4ed8; }
.cat-bar.defense    { background: #166534; }
.cat-bar.blob       { background: #92400e; }
.cat-bar.slob       { background: #5b21b6; }
.cat-bar.press-break { background: #9d174d; }
.cat-bar.special    { background: #991b1b; }

/* Quick actions */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-align: left;
}

.quick-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  transform: translateX(3px);
}

.qa-icon {
  font-size: 16px;
}

.recent-title {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

/* ===========================
   CARDS
=========================== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  transition: box-shadow 0.15s;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-family: 'Barlow Condensed', 'Segoe UI', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

.card-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
  white-space: pre-wrap;
  margin-top: 10px;
}

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

/* ===========================
   BADGES
=========================== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 5px;
}

.badge-offense    { background: #dbeafe; color: #1d4ed8; }
.badge-defense    { background: #dcfce7; color: #166534; }
.badge-blob       { background: #fef3c7; color: #92400e; }
.badge-slob       { background: #ede9fe; color: #5b21b6; }
.badge-press-break { background: #fce7f3; color: #9d174d; }
.badge-special    { background: #fee2e2; color: #991b1b; }
.badge-transition { background: #ccfbf1; color: #0f766e; }
.badge-general    { background: #f1f5f9; color: #475569; }

/* ===========================
   GAME RESULT
=========================== */
.result-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.result-w { background: var(--success-bg); color: var(--success-text); }
.result-l { background: var(--danger-bg); color: var(--danger-text); }
.result-t { background: #f1f5f9; color: #475569; }

.game-score {
  font-size: 24px;
  font-weight: 900;
  color: var(--text);
}

.game-score .separator {
  color: var(--text-muted);
  margin: 0 5px;
}

.game-notes-divider {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 10px;
}

/* Season summary bar */
.season-summary {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.season-summary .record {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
}

.season-summary .record-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.season-summary .win-pct {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ===========================
   SEARCH & FILTERS
=========================== */
.search-bar {
  margin-bottom: 12px;
}

.search-bar input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 12px center;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s;
}

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

.filter-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chip {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  transition: all 0.15s;
  font-family: inherit;
}

.chip:hover, .chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ===========================
   EMPTY STATE
=========================== */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 52px;
  margin-bottom: 14px;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.empty-state p {
  font-size: 13px;
}

/* ===========================
   TERMINOLOGY GROUPING
=========================== */
.term-group-letter {
  font-size: 11px;
  font-weight: 900;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.term-group {
  margin-bottom: 22px;
}

/* ===========================
   FORMAT TOOLBAR
=========================== */
.format-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 4px 6px;
}

.format-toolbar + textarea {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.fmt-btn {
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.fmt-btn:hover {
  background: var(--border);
  color: var(--text);
}

.fmt-btn b { font-weight: 900; }
.fmt-btn i { font-style: italic; }
.fmt-btn s { text-decoration: line-through; }

.fmt-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 4px;
}

/* Rendered markdown in cards */
.md-body { font-size: 14px; color: var(--text); line-height: 1.65; margin-top: 10px; }
.md-body p  { margin: 0 0 6px; }
.md-body p:last-child { margin-bottom: 0; }
.md-body ul, .md-body ol { padding-left: 18px; margin: 4px 0; }
.md-body li { margin-bottom: 2px; }
.md-body strong { font-weight: 700; }
.md-body em { font-style: italic; }
.md-body del { text-decoration: line-through; color: var(--text-muted); }

/* ===========================
   MODAL
=========================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
  overflow-y: auto;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.35);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-header h3 {
  /* Overridden by rule at bottom of file */
  color: var(--text);
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--border);
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ===========================
   ANNOUNCEMENTS
=========================== */
.announcement-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  border-left: 5px solid var(--border);
  transition: box-shadow 0.15s;
}

.announcement-card:hover { box-shadow: var(--shadow-lg); }
.announcement-card.type-info     { border-left-color: #1d4ed8; }
.announcement-card.type-important { border-left-color: var(--accent); }
.announcement-card.type-urgent   { border-left-color: var(--danger); }

.announcement-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.type-badge-info      { background: #dbeafe; color: #1d4ed8; }
.type-badge-important { background: #fff7ed; color: #c2410c; }
.type-badge-urgent    { background: #fee2e2; color: #991b1b; }

/* ── Announcement reactions & comments ───────────────────────── */
.ann-reactions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.react-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  color: var(--text);
}
.react-btn:hover { background: var(--border); }
.react-btn.react-active { transform: scale(1.15); }
.react-btn span { font-weight: 700; min-width: 12px; text-align: center; }

.ann-comments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.ann-comment {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: var(--bg);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
}
.ann-comment-author {
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  white-space: nowrap;
}
.ann-comment-author::after { content: ':'; margin-right: 2px; }
.ann-comment-body { flex: 1; color: var(--text); word-break: break-word; }
.ann-comment-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  padding: 0 2px;
  flex-shrink: 0;
  opacity: 0.5;
}
.ann-comment-del:hover { color: var(--danger); opacity: 1; }

.ann-comment-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.ann-comment-input {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text);
}
.ann-comment-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}

.announcement-title {
  font-family: 'Barlow Condensed', 'Segoe UI', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.announcement-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.announcement-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  justify-content: flex-end;
}

/* ===========================
   SETTINGS / SOCIALS
=========================== */
#settings-btn {
  background: rgba(255,255,255,0.12);
  color: white;
  border: 1px solid rgba(255,255,255,0.25);
  width: 34px;
  height: 34px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  font-family: inherit;
}

#settings-btn:hover { background: rgba(255,255,255,0.22); }

#header-socials {
  display: flex;
  align-items: center;
  gap: 6px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  text-decoration: none;
  font-size: 16px;
  transition: background 0.15s;
  color: white;
}

.social-link:hover { background: rgba(255,255,255,0.25); }

/* Play cards — left accent border by category */
.card[data-category="offense"]     { border-left: 4px solid #1d4ed8; }
.card[data-category="defense"]     { border-left: 4px solid #166534; }
.card[data-category="blob"]        { border-left: 4px solid #92400e; }
.card[data-category="slob"]        { border-left: 4px solid #5b21b6; }
.card[data-category="press-break"] { border-left: 4px solid #9d174d; }
.card[data-category="special"]     { border-left: 4px solid #991b1b; }

/* Modal headers use display font */
.modal-header h3 {
  font-family: 'Barlow Condensed', 'Segoe UI', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Login card title */
.login-card h2 {
  font-family: 'Barlow Condensed', 'Segoe UI', sans-serif;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Film Room ───────────────────────────────────────────────── */
.film-card {
  margin-bottom: 20px;
  padding: 0;
  overflow: hidden;
}

.film-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
}

.film-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.film-date {
  font-size: 12px;
  color: var(--text-muted);
}

.film-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.film-embed-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
}

.film-embed-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.film-link {
  display: block;
  padding: 12px 20px;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.film-link:hover { text-decoration: underline; }

.film-notes {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.film-notes strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.film-notes p {
  font-size: 14px;
  color: var(--text-primary);
  white-space: pre-wrap;
  margin: 0;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 640px) {
  .app-main {
    padding: 12px;
  }

  .modal {
    padding: 20px 16px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-overlay {
    align-items: flex-end;
  }

  .modal {
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 100%;
  }

  #user-email {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-row {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 28px 20px;
  }

  .section-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .section-header h2 {
    font-size: 20px;
  }

  .record-display {
    font-size: 50px;
  }

  .record-pct {
    font-size: 30px;
  }

  .nav-tab {
    padding: 12px 12px;
    font-size: 11px;
    gap: 4px;
  }

  .tab-icon {
    font-size: 14px;
  }

  .team-logo-badge {
    width: 160px;
    height: auto;
  }

  /* Schedule cards on mobile */
  .schedule-card {
    padding: 12px 14px;
    gap: 12px;
  }

  .sched-date-block {
    min-width: 38px;
  }

  /* Score row in game modal */
  .score-row {
    gap: 10px;
  }

  /* Plays – mobile tweaks */
  .play-card-header {
    align-items: flex-start;
    gap: 6px;
  }

  .diag-tab-row {
    width: 100% !important;
  }

  .diag-tab {
    flex: 1;
    text-align: center;
  }

  /* Stack name + pin button vertically on mobile */
  .play-name-row {
    flex-direction: column;
    align-items: stretch;
  }

  .play-name-row > #play-pin-btn {
    width: 100%;
    height: auto !important;
    justify-content: center;
  }

  .court-tool {
    font-size: 11px;
    padding: 4px 8px;
  }

  .play-diagram-display {
    max-width: 100%;
  }
}

@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .nav-tab span:not(.tab-icon) {
    display: none;
  }

  .nav-tab {
    padding: 12px 10px;
  }
}

/* ── Player photo ────────────────────────────────────────────── */
.player-photo-upload-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
  flex-shrink: 0;
}

.player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.player-avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Roster ──────────────────────────────────────────────────── */
.roster-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.player-row {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

.player-row:last-child { border-bottom: none; }
.player-row:hover .player-row-main { background: #f8fafc; }

.player-row-main {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 16px;
  user-select: none;
}

.player-row-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
  min-width: 48px;
  line-height: 1;
}

.player-row-info {
  flex: 1;
}

.player-row-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.player-row-pos {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  padding: 2px 6px;
  margin-top: 2px;
}

.player-row-chevron {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.2s;
  margin-left: 8px;
}

.player-row.open .player-row-chevron { transform: rotate(90deg); }

.player-row-detail {
  display: none;
  padding: 0 16px 14px 64px;
  gap: 8px;
  align-items: center;
}

.player-row.open .player-row-detail { display: flex; flex-direction: column; }

.player-detail-chips { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.player-detail-chip  { font-size:12px; background:var(--bg); border:1px solid var(--border); border-radius:20px; padding:2px 10px; color:var(--text-muted); }

.player-row-notes {
  flex: 1;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.player-card-actions {
  display: flex;
  gap: 6px;
}

/* ── Schedule ────────────────────────────────────────────────── */
.schedule-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 5px solid var(--border);
}

.schedule-card.upcoming { border-left-color: var(--accent); }
.schedule-card.past     { border-left-color: var(--text-muted); opacity: 0.75; }
.schedule-card.today    { border-left-color: var(--success); }

.sched-date-block {
  text-align: center;
  min-width: 48px;
}

.sched-month {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.sched-day {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text);
}

.sched-info { flex: 1; }

.sched-opponent {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 3px;
}

.sched-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sched-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.sched-badge.home     { background: #dcfce7; color: #166534; }
.sched-badge.away     { background: #dbeafe; color: #1d4ed8; }
.sched-badge.neutral  { background: #f1f5f9; color: #475569; }
.sched-badge.practice { background: #fef3c7; color: #92400e; }

.schedule-groups h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 20px 0 8px;
}

/* ── View toggle ─────────────────────────────────────────────── */
.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.view-toggle-btn {
  background: none;
  border: none;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.view-toggle-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ── Schedule calendar ───────────────────────────────────────── */
.sched-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.sched-cal-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.sched-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 16px;
}
.sched-cal-hdr {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 0 6px;
}
.sched-cal-cell {
  min-height: 52px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 5px 4px 3px;
  cursor: pointer;
  background: var(--card-bg);
  transition: background 0.12s;
}
.sched-cal-cell.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
  pointer-events: none;
}
.sched-cal-cell.today {
  border-color: var(--accent);
  background: var(--accent-light);
}
.sched-cal-cell.selected {
  background: var(--accent);
  border-color: var(--accent);
}
.sched-cal-cell.selected .sched-cal-daynum {
  color: #fff;
}
.sched-cal-cell:hover:not(.empty):not(.selected) {
  background: var(--bg);
}
.sched-cal-daynum {
  font-size: 12px;
  font-weight: 700;
  display: block;
  color: var(--text);
}
.sched-cal-cell.today .sched-cal-daynum {
  color: var(--accent);
}
.sched-cal-dots {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin-top: 3px;
}
.sched-cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sched-cal-dot.practice,
.sched-cal-dot.dot-orange { background: #f59e0b; }
.sched-cal-dot.game,
.sched-cal-dot.dot-blue   { background: #3b82f6; }
.sched-cal-detail {
  padding-top: 4px;
}
.sched-cal-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.sched-cal-detail-date {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sched-cal-empty-day {
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px 0;
  text-align: center;
}

/* ── Dot color picker ────────────────────────────────────────── */
.dot-color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dot-color-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
  background: var(--card-bg);
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}
.dot-color-btn.active {
  border-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}
.dot-preview {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-preview.dot-blue   { background: #3b82f6; }
.dot-preview.dot-orange { background: #f59e0b; }

/* ── Form details (collapsible sections in modals) ───────────── */
.form-details {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: var(--bg);
}
.form-details summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.form-details summary::before {
  content: '›';
  display: inline-block;
  transition: transform 0.15s;
}
.form-details[open] summary::before { transform: rotate(90deg); }
.form-details summary::-webkit-details-marker { display: none; }
.form-details[open] summary { margin-bottom: 12px; }

/* ── Quarter score table in game modal ───────────────────────── */
.quarter-table { overflow-x: auto; }
.qtr-header, .qtr-row {
  display: grid;
  grid-template-columns: 48px repeat(5, 1fr);
  gap: 4px;
  align-items: center;
  margin-bottom: 4px;
}
.qtr-header span, .qtr-row span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}
.qtr-team-label { font-weight: 700 !important; font-size: 12px !important; }
.qtr-input {
  width: 100%;
  text-align: center;
  padding: 6px 2px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  box-sizing: border-box;
}

/* ── Stats input grid in game modal ──────────────────────────── */
.stats-input-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.stats-input-grid > div { text-align: center; }
.stat-input-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ── Quarter score table in game card ────────────────────────── */
.quarter-score-table {
  overflow-x: auto;
  margin: 8px 0 0;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.quarter-score-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.quarter-score-table th, .quarter-score-table td {
  text-align: center;
  padding: 4px 6px;
  color: var(--text-muted);
}
.quarter-score-table th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.quarter-score-table td:first-child,
.quarter-score-table th:first-child { text-align: left; font-weight: 700; }
.qst-us td { color: var(--accent); }
.qst-final { font-weight: 700 !important; color: var(--text) !important; }

/* ── Game stat chips ─────────────────────────────────────────── */
.game-stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 2px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.game-stat-chip {
  font-size: 11px;
  font-weight: 700;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  color: var(--text-muted);
}

/* ── Player stats table (game modal + game card) ─────────────── */
.player-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.player-stats-table th {
  background: var(--bg);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 8px;
  text-align: center;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.player-stats-table th:first-child,
.player-stats-table td:first-child { text-align: left; width: 36px; }
.player-stats-table th:nth-child(2),
.player-stats-table td:nth-child(2) { text-align: left; }
.player-stats-table td {
  padding: 6px 8px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.player-stats-table tr:last-child td { border-bottom: none; }
.ps-num { font-weight: 700; color: var(--text-muted); font-size: 12px; }
.ps-name { font-weight: 600; }
.player-stats-table .qtr-input { width: 56px; text-align: center; padding: 4px 4px; }
.game-player-stats-collapse {
  margin-top: 10px;
}
.game-player-stats-collapse > summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}
.player-stats-display td { font-size: 13px; }

/* ── Play of the Week card ───────────────────────────────────── */
.pow-card {
  border-left: 4px solid #f59e0b !important;
  margin-bottom: 20px;
}
.pow-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pow-header {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f59e0b;
}
.pow-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.pow-game-ref {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.pow-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 8px;
  white-space: pre-wrap;
}

/* ── Play cards (expandable) ────────────────────────────────── */
.modal-wide { max-width: 620px; }

.play-card { margin-bottom: 10px; }

.play-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.play-card-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.expand-chevron {
  font-size: 20px;
  color: var(--text-muted);
  transition: transform 0.2s;
  line-height: 1;
  flex-shrink: 0;
}

/* Pinned plays */
.pin-star { color: #f59e0b; font-size: 15px; line-height: 1; }
.play-pinned { border-left: 3px solid #f59e0b; }

.btn-pinned {
  background: #fef3c7 !important;
  color: #92400e !important;
  border-color: #f59e0b !important;
}

/* Position tags — modal picker */
.pos-tag-row { display: flex; gap: 6px; flex-wrap: wrap; }

.pos-tag {
  padding: 5px 11px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--card-bg);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  color: var(--text-muted);
}

.pos-tag.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.pos-tag:hover:not(.active) { border-color: var(--text-muted); color: var(--text); }

/* Position badges — card display */
.pos-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  border: 1px solid var(--border);
}

/* Step-by-step — card display */
.play-steps { margin-top: 12px; }

.play-step-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.step-num-badge {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

/* Step editor — modal */
.step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-input {
  flex: 1;
  padding: 7px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--card-bg);
}

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

.step-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
}

.step-remove-btn:hover { color: var(--danger); background: var(--danger-bg); }

/* Diagram tabs */
.diag-tab-row {
  display: flex;
  gap: 3px;
  margin-bottom: 10px;
  background: var(--bg);
  padding: 3px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.diag-tab {
  padding: 4px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-muted);
  transition: all 0.15s;
}

.diag-tab.active {
  background: var(--card-bg);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Diagram preview area (upload) */
.play-diagram-preview-area {
  width: 100%;
  min-height: 70px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 12px;
}

/* Diagram display in play card */
.play-diagram-display {
  width: 100%;
  max-width: 440px;
  border-radius: 8px;
  margin-top: 12px;
  display: block;
}

/* Court tools toolbar */
.court-tools {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.court-tool {
  padding: 5px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-muted);
  transition: all 0.15s;
}

.court-tool.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.court-tool:hover:not(.active) { background: var(--bg); color: var(--text); }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: #1e293b;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  pointer-events: all;
  cursor: pointer;
  max-width: 340px;
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

.toast-success { border-left: 4px solid #22c55e; }
.toast-error   { border-left: 4px solid #ef4444; }
.toast-info    { border-left: 4px solid #3b82f6; }
.toast-warning { border-left: 4px solid #f59e0b; }

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast-success .toast-icon { color: #22c55e; }
.toast-error   .toast-icon { color: #ef4444; }
.toast-info    .toast-icon { color: #3b82f6; }
.toast-warning .toast-icon { color: #f59e0b; }

.toast-msg { flex: 1; line-height: 1.4; }

.toast-out {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(60px) scale(0.85); }
}

@media (max-width: 500px) {
  #toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { max-width: 100%; }
}

/* ============================================================
   NEXT UP BANNER (Home tab)
   ============================================================ */
.next-up-card {
  padding: 0;
  overflow: hidden;
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, #0f2040 100%);
  color: white;
}

.next-up-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
}

.next-up-left { flex: 1; min-width: 0; }

.next-up-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 4px;
}

.next-up-title {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-up-meta {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 3px;
}

.next-up-badge {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  color: white;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.next-up-badge.urgent { background: #ef4444; }
.next-up-badge.soon   { background: #f59e0b; color: #1a1a1a; }

.next-up-more {
  font-size: 11px;
  opacity: 0.65;
  text-align: right;
  padding: 4px 20px 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ============================================================
   WIN STREAK CARD (Home tab)
   ============================================================ */
.streak-card {
  padding: 12px 18px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.streak-hot {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1px solid #fcd34d;
}

.streak-cold {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid var(--border);
}

.streak-icon { font-size: 22px; }

.streak-text { line-height: 1.3; }

/* ============================================================
   PLAYER OF THE GAME BADGE
   ============================================================ */
.potg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 5px 10px;
  background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%);
  border: 1px solid #fcd34d;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #78350f;
}

/* ============================================================
   CARD / ITEM FADE-IN ANIMATION
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeInUp 0.3s ease both;
}

/* Staggered delay for list items */
.fade-in:nth-child(1) { animation-delay: 0ms; }
.fade-in:nth-child(2) { animation-delay: 60ms; }
.fade-in:nth-child(3) { animation-delay: 120ms; }
.fade-in:nth-child(4) { animation-delay: 180ms; }
.fade-in:nth-child(5) { animation-delay: 240ms; }
.fade-in:nth-child(6) { animation-delay: 300ms; }

/* ============================================================
   SEASON SUMMARY STAT BLOCKS
   ============================================================ */
.season-stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  padding: 8px 4px;
}

.season-stat-block .stat-value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.season-stat-block .stat-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.season-stat-block .stat-value.positive { color: #16a34a; }
.season-stat-block .stat-value.negative { color: #dc2626; }
.season-stat-block .stat-value.neutral  { color: var(--text-muted); }

/* ============================================================
   ANNOUNCEMENT SEEN INDICATOR
   ============================================================ */
.ann-seen-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.ann-seen-bar .seen-avatars {
  display: flex;
  gap: -4px;
}

.ann-seen-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}

/* ============================================================
   MAP PICKER (Apple Maps / Google Maps inline chooser)
   ============================================================ */
.map-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.map-picker-label {
  color: var(--text-muted);
  font-size: 13px;
}

.map-picker-btns {
  display: flex;
  gap: 4px;
}

.map-btn {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--accent);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.map-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Map picker inside next-up banner (white on dark) */
.next-up-map .map-picker-label { color: rgba(255,255,255,0.75); }
.next-up-map .map-btn {
  background: rgba(255,255,255,0.15);
  color: white;
  border-color: rgba(255,255,255,0.3);
}
.next-up-map .map-btn:hover {
  background: rgba(255,255,255,0.9);
  color: var(--accent);
}

/* ============================================================
   ROSTER CARD GRID
   ============================================================ */
.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  padding: 4px 0;
}

.roster-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}

.roster-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.rc-photo-wrap {
  position: relative;
  background: var(--accent);
  aspect-ratio: 1 / 1;
}

.rc-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rc-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
  letter-spacing: -0.03em;
  font-family: 'Barlow Condensed', sans-serif;
}

.rc-number {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 13px;
  font-weight: 800;
  color: white;
  background: rgba(0,0,0,0.45);
  padding: 1px 6px;
  border-radius: 8px;
  letter-spacing: 0.02em;
  font-family: 'Barlow Condensed', sans-serif;
}

.rc-body {
  padding: 10px 12px;
  flex: 1;
}

.rc-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 5px;
}

.rc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 5px;
}

.rc-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--accent-light, #e8edf5);
  color: var(--accent);
  letter-spacing: 0.02em;
}

.rc-notes {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 4px;
}

.rc-actions {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.rc-actions .btn { flex: 1; font-size: 11px; padding: 4px 6px; }

@media (max-width: 400px) {
  .roster-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ============================================================
   ANNOUNCEMENT TYPE PICKER
   ============================================================ */
.ann-modal { max-width: 520px; }

.ann-type-picker {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
}

.ann-type-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.ann-type-btn:hover { border-color: var(--accent); background: var(--accent-light, #e8edf5); }

.ann-type-btn.active[data-type="info"]      { border-color: #3b82f6; background: #eff6ff; }
.ann-type-btn.active[data-type="important"] { border-color: #f59e0b; background: #fffbeb; }
.ann-type-btn.active[data-type="urgent"]    { border-color: #ef4444; background: #fef2f2; }

.ann-type-icon { font-size: 20px; line-height: 1; }
.ann-type-label { font-size: 11px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; }

.ann-type-btn.active .ann-type-label { color: var(--text); }
