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

:root {
  /* Colors - Light Mode (Default) */
  --bg-body: linear-gradient(145deg, #f0f4f8 0%, #e2e8f0 50%, #cbd5e1 100%);
  --bg-card: #ffffff;
  --bg-panel: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-subtle-2: #f1f5f9;
  --bg-input: #ffffff;
  --bg-modal: #ffffff;
  --bg-hover: #f8fafc;

  --btn-danger-bg: #fee2e2;
  --btn-danger-text: #ef4444;
  --btn-danger-hover: #fecaca;

  --btn-secondary-bg: #ffffff;
  --btn-secondary-text: #475569;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;

  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-dashed: #cbd5e1;

  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.04), 0 10px 40px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 8px 16px rgba(0, 0, 0, 0.06), 0 20px 60px rgba(0, 0, 0, 0.12);

  --toggle-bg: #f1f5f9;
  --toggle-knob: #ffffff;

  --team-logo-bg: linear-gradient(145deg, #f1f5f9, #e2e8f0);
}

[data-theme="dark"] {
  /* Colors - Dark Mode */
  --bg-body: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
  --bg-card: #1e293b;
  --bg-panel: #1e293b;
  --bg-subtle: #334155;
  --bg-subtle-2: #0f172a;
  --bg-input: #0f172a;
  --bg-modal: #1e293b;
  --bg-hover: #334155;

  --btn-danger-bg: rgba(239, 68, 68, 0.15);
  --btn-danger-text: #fca5a5;
  --btn-danger-hover: rgba(239, 68, 68, 0.25);

  --btn-secondary-bg: #1e293b;
  --btn-secondary-text: #cbd5e1;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-inverse: #1e293b;

  --border-subtle: #334155;
  --border-strong: #475569;
  --border-dashed: #475569;

  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.2), 0 10px 40px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.3), 0 24px 70px rgba(0, 0, 0, 0.5);

  --toggle-bg: #334155;
  --toggle-knob: #f8fafc;

  --team-logo-bg: linear-gradient(145deg, #334155, #1e293b);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 24px;
}

/* Main Layout */
.app-container {
  max-width: 1500px;
  margin: 0 auto;
}

/* Settings Panel (Collapsible Header) */
.settings-panel {
  background: var(--bg-panel);
  border-radius: 0 0 24px 24px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

.settings-panel.collapsed .settings-content {
  display: none;
}

.settings-panel.collapsed {
  background: transparent;
  box-shadow: none;
  margin-bottom: 20px;
}

/* Header Bar - Replaces simple toggle */
/* Header Bar - Centered Layout */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Center main content */
  gap: 32px;
  /* Gap between title, actions, settings */
  padding: 10px 24px;
  background: var(--bg-panel);
  border-radius: 20px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  position: relative;
  min-height: 52px;
}

.settings-panel.collapsed .header-bar {
  background: transparent;
  box-shadow: none;
}

/* Brand in Header */
.brand-small {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 1.1rem;
  letter-spacing: -0.5px;
  margin: 0;
  /* No margin-right auto */
}

/* Header Actions (Add / Clear) */
.header-actions {
  display: flex;
  gap: 20px;
  align-items: center;
}



.settings-trigger {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: transparent;
  border-radius: 50%;
  margin: 0;
  /* No auto margins */
}

/* Center the actions or keep them near brand?
   Request: "one line as Title | Add Team | Clear teams | Settings"
*/


.header-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
}

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


.settings-trigger {
  /* justify-self: end; - Removed for flex centering */
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: transparent;
  border-radius: 50%;
}

.settings-panel:not(.collapsed) .settings-trigger {
  transform: rotate(180deg);
  background: var(--bg-subtle-2);
}

.settings-panel:not(.collapsed) .header-bar {
  /* Ensure header remains visible/styled nicely even when expanded */
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 24px 24px 0 0;
  box-shadow: none;
}

.settings-trigger svg {
  width: 24px;
  height: 24px;
}

.settings-content {
  padding: 40px 24px 24px 24px;
  text-align: center;
  animation: slideDownPanel 0.3s ease;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -1px;
  text-transform: uppercase;
  margin: 0;
}

h1 span {
  background: linear-gradient(135deg, #64748b 0%, #0f172a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 6px;
  font-weight: 500;
}

.brand-large {
  margin-bottom: 32px;
}

.brand-large h1 {
  font-size: 3rem;
  margin-bottom: 4px;
}



/* Controls Container */
.controls-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
}

/* Row 1: Actions - Removed */
/* .control-group.actions {
  display: none;
} */


/* Row 2: Settings Filters */
.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: center;
  align-items: center;
}

.control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.control-group label {
  font-size: 0.7rem;
  letter-spacing: 1.2px;
  font-weight: 800;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

/* Action Buttons */
.action-btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.action-btn.primary {
  background: var(--text-primary);
  color: var(--bg-card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

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

.action-btn.danger:hover {
  background: var(--btn-danger-hover);
  color: #dc2626;
}

/* Toggle Switch - Redesigned */
.toggle-switch {
  position: relative;
  width: 140px;
  /* Wider for text */
  height: 44px;
  background: var(--toggle-bg);
  border-radius: 22px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.toggle-switch.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
}

/* The sliding knob */
.switch-knob {
  position: absolute;
  left: 4px;
  width: 36px;
  height: 36px;
  background: var(--toggle-knob);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  z-index: 2;
}

.toggle-switch.active .switch-knob {
  transform: translateX(96px);
  /* width 140 - 4 - 36 - 4 = 96 */
}

/* Labels */
.switch-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  z-index: 1;
  transition: color 0.3s ease;
}

.toggle-switch.active .switch-label {
  color: var(--bg-card);
}

/* Pill Selector - Segmented Control Style */
.pill-selector,
#timezoneSelect {
  display: flex;
  background: var(--bg-subtle-2);
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  gap: 2px;
}

#timezoneSelect {
  height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  appearance: none;
  /* Remove default arrow */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
}

#timezoneSelect:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.pill {
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

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

.pill.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 800;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transform: scale(1.02);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
  max-width: 1500px;
  margin: 0 auto;
}

.card {
  background: var(--bg-card);
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.04),
    0 10px 40px rgba(0, 0, 0, 0.08);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card.selected {
  /* Only highlight via shadow/transform, no border to avoid halo effect on unselected if transition persists */
  transform: translateY(-4px);
  box-shadow:
    0 12px 24px rgba(59, 130, 246, 0.15),
    0 24px 60px rgba(59, 130, 246, 0.2);
}

.card.dragging {
  opacity: 0.4;
  border: 2px dashed #94a3b8;
}


.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.delete-btn {
  position: absolute;
  top: 28px;
  right: 16px;
  background: rgba(241, 245, 249, 0.9);
  color: #64748b;
  border: 1px solid #e2e8f0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.delete-btn.show {
  opacity: 1;
  pointer-events: auto;
}

.delete-btn:hover {
  background: white;
  color: #ef4444;
  border-color: #fee2e2;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Updated Reorder Controls */
.reorder-controls {
  position: absolute;
  top: 28px;
  right: 56px;
  display: flex;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.reorder-controls.show {
  opacity: 1;
  pointer-events: auto;
}

.reorder-btn {
  background: rgba(241, 245, 249, 0.9);
  color: #64748b;
  border: 1px solid #e2e8f0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.reorder-btn:hover {
  background: white;
  color: #1e293b;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}


.card-accent {
  height: 20px;
  background: linear-gradient(90deg, var(--team-color), var(--team-color-light, var(--team-color)));
}

.card-body {
  padding: 24px;
}

.card-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.team-logo {
  width: 72px;
  height: 72px;
  background: white;
  /* Logos look best on white usually, or distinct bg */
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  overflow: hidden;
  /* smooth corners for img */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  /* slightly elevated */
}

.team-logo img {
  width: 85%;
  height: 85%;
  object-fit: contain;
  display: block;
}

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

.team-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.league {
  font-size: 0.75rem;
  color: #fff;
  margin-top: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--team-color);
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
}

.position-badge {
  background: linear-gradient(145deg, var(--team-color), var(--team-color));
  color: #fff;
  padding: 8px 12px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.position-visual {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
}

.position-number {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.position-suffix {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  text-transform: uppercase;
}

.position-division {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.9;
  line-height: 1.1;
  margin-top: 2px;
}

.record-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  background: var(--bg-subtle);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.record-item {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 4px 0;
}

.record-item.wins {
  color: #16a34a;
}

.record-item.draws {
  color: var(--text-secondary);
}

.record-item.losses {
  color: #dc2626;
}

.record-item.pct {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.record-separator {
  color: var(--border-strong);
  font-weight: 400;
}

.section-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 10px;
}

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

.result {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.result.active {
  outline: 3px solid var(--text-primary);
  outline-offset: 2px;
  transform: translateY(-4px);
}

.result.W {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
}

.result.L {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
}

.result.D {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
  color: #fff;
}

.match-details {
  background: var(--bg-subtle);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  display: none;
  animation: slideDown 0.25s ease;
  border: 1px solid var(--border-subtle);
}

.match-details.show {
  display: block;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.match-details .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}

.match-details .detail-row:last-child {
  border-bottom: none;
}

.match-details .label {
  color: var(--text-secondary);
  font-weight: 500;
}

.match-details .value {
  font-weight: 700;
  color: var(--text-primary);
}

.stats-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle-2);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border-subtle);
}

.stats-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.stats-toggle-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stats-toggle-icon {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  transition: transform 0.3s ease;
}

.stats-toggle.open .stats-toggle-icon {
  transform: rotate(180deg);
}

.leaders {
  background: var(--bg-subtle);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border-subtle);
  display: none;
  animation: slideDown 0.25s ease;
}

.leaders.show {
  display: block;
}

.leaders-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.leader-item {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.leader-item:hover {
  border-color: var(--team-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.leader-item.yellow {
  border-left: 4px solid #f59e0b;
}

.leader-item.red {
  border-left: 4px solid #ef4444;
}

.leader-category {
  font-size: 0.6rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 6px;
}

.leader-player {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}

.leader-value {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--team-color);
  margin-top: 4px;
}

.next-game {
  background: var(--bg-subtle);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--team-color);
}

.next-game::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: var(--team-color);
  opacity: 0.08;
  border-radius: 50%;
  transform: translate(30%, -30%);
}

.next-label {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 12px;
}

.opponent {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.venue {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.countdown {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--team-color);
  margin-top: 14px;
  text-shadow: 0 2px 20px var(--team-color);
}

.countdown.live {
  color: #ef4444;
  animation: pulse 1.5s infinite;
}

.countdown.done {
  color: var(--text-secondary);
  text-shadow: none;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.2s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: var(--bg-card);
  border-radius: 24px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.modal-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-tertiary);
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group select,
.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: var(--bg-input);
  color: var(--text-primary);
}

.form-group select:focus,
.form-group input:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.form-group select:disabled,
.form-group input:disabled {
  background: var(--bg-subtle-2);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

.team-list {
  max-height: 300px;
  overflow-y: auto;
  margin-top: 12px;
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-subtle);
}

.team-list-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-list-item:last-child {
  border-bottom: none;
}

.team-list-item:hover:not(.disabled) {
  background: var(--bg-card);
  padding-left: 20px;
}

.team-list-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.team-list-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
}

.team-list-league {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.add-icon {
  font-size: 1.5rem;
  color: #f97316;
  font-weight: 700;
}

.already-added {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.no-results {
  padding: 40px;
  text-align: center;
  color: var(--text-tertiary);
  font-weight: 500;
}

.btn-secondary {
  padding: 12px 24px;
  border: 2px solid var(--border-subtle);
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-danger {
  padding: 12px 24px;
  border: none;
  background: var(--btn-danger-bg);
  color: var(--btn-danger-text);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: var(--btn-danger-hover);
  color: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

@media (max-width: 640px) {
  body {
    padding: 16px;
  }

  .card-body {
    padding: 20px;
  }

  .team-name {
    font-size: 1.2rem;
  }

  .team-logo {
    width: 60px;
    height: 60px;
  }

  .grid {
    gap: 20px;
  }

  h1 {
    font-size: 2.2rem;
  }

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

  .leader-player {
    font-size: 0.7rem;
  }

  .record-row {
    gap: 4px;
    padding: 10px 12px;
  }

  .record-item {
    font-size: 0.75rem;
  }

  .result {
    width: 40px;
    height: 40px;
  }

  .modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 20px;
  }

  .delete-btn {
    opacity: 1;
  }
}