/* CSS Variables - Light Mode */
:root {
  --primary-color: #2c5232;
  --primary-dark: #1e3a22;
  --primary-light: #4a7c52;
  --accent-color: #d4af37;
  --background: #f5f5f5;
  --surface: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --border-color: #e0e0e0;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --under-par: #c41e3a;
  --over-par: #1e90ff;
  --even-par: #333333;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
  --radius: 8px;
  --radius-lg: 12px;
}

/* Dark Mode */
[data-theme="dark"] {
  --primary-color: #4a7c52;
  --primary-dark: #3d6844;
  --primary-light: #5e9466;
  --accent-color: #e4bf47;
  --background: #1a1a1a;
  --surface: #2d2d2d;
  --text-primary: #e8e8e8;
  --text-secondary: #a0a0a0;
  --border-color: #404040;
  --success: #34c759;
  --warning: #ffcc00;
  --danger: #ff453a;
  --under-par: #ff6b6b;
  --over-par: #4dabf7;
  --even-par: #d0d0d0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* Dark mode specific overrides */
[data-theme="dark"] .message-content.system-message {
  background: linear-gradient(135deg, #4a4528 0%, #5c5323 100%);
  color: #f5d485;
  border-color: #9a7b2c;
}

[data-theme="dark"] .alert-success {
  background: #1d4a2a;
  color: #7dd99a;
}

[data-theme="dark"] .alert-error {
  background: #4a1d1d;
  color: #ff8a8a;
}

[data-theme="dark"] .nav-link.active {
  background: rgba(74, 124, 82, 0.25);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--text-secondary);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Layout */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.app-header {
  background: var(--surface);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.logo h1 {
  font-family: 'Roboto Slab', serif;
  font-size: 1.5rem;
  color: var(--primary-color);
}

.main-nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--primary-color);
  background: rgba(44, 82, 50, 0.1);
}

.nav-link.active {
  color: var(--primary-color);
  background: rgba(44, 82, 50, 0.15);
}

.user-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

#user-info {
  display: none;
  align-items: center;
  gap: 10px;
}

/* Auth state classes */
.auth-show-signed-out {
  display: flex !important;
}

.auth-show-signed-in {
  display: none !important;
}

body.signed-in .auth-show-signed-out {
  display: none !important;
}

body.signed-in .auth-show-signed-in {
  display: flex !important;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

/* Dark Mode Toggle */
.theme-toggle {
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 44px;
  height: 24px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  padding: 2px;
}

.theme-toggle:hover {
  border-color: var(--primary-color);
}

.theme-toggle::before {
  content: "☀️";
  font-size: 12px;
  position: absolute;
  left: 4px;
  transition: opacity 0.3s;
}

.theme-toggle::after {
  content: "🌙";
  font-size: 12px;
  position: absolute;
  right: 4px;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.theme-toggle .toggle-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary-color);
  border-radius: 50%;
  transition: transform 0.3s;
  z-index: 1;
}

[data-theme="dark"] .theme-toggle::before {
  opacity: 0.4;
}

[data-theme="dark"] .theme-toggle::after {
  opacity: 1;
}

[data-theme="dark"] .theme-toggle .toggle-thumb {
  transform: translateX(20px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

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

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

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* Tournament Banner */
.tournament-banner {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  padding: 24px 20px;
  text-align: center;
}

.tournament-banner h2 {
  font-family: 'Roboto Slab', serif;
  font-size: 2rem;
  margin-bottom: 8px;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-lineup_open {
  background: var(--success);
}

.status-in_progress {
  background: var(--warning);
  color: #333;
}

.status-completed {
  background: var(--text-secondary);
}

/* Main Content */
.app-main {
  flex: 1;
  padding: 30px 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* Welcome Card */
.welcome-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.welcome-card h2 {
  font-family: 'Roboto Slab', serif;
  margin-bottom: 16px;
}

.welcome-card p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 30px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.action-card {
  background: var(--background);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

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

.action-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.action-card h3 {
  margin-bottom: 4px;
  color: var(--primary-color);
}

.action-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* Rules Section */
.rules-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow);
}

.rules-section h3 {
  font-family: 'Roboto Slab', serif;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.rules-section ul {
  list-style: none;
  padding: 0;
}

.rules-section li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.rules-section li:last-child {
  border-bottom: none;
}

/* Lineup Builder */
.lineup-builder {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow);
}

.lineup-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.lineup-tab {
  flex: 1;
  padding: 14px 20px;
  border: 2px solid var(--border-color);
  background: var(--background);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}

.lineup-tab:hover {
  border-color: var(--primary-light);
}

.lineup-tab.active {
  border-color: var(--primary-color);
  background: rgba(44, 82, 50, 0.1);
  color: var(--primary-color);
}

.tab-status {
  font-size: 13px;
  padding: 2px 8px;
  background: var(--surface);
  border-radius: 10px;
  font-weight: 500;
}

.lineup-tab.active .tab-status {
  background: var(--primary-color);
  color: white;
}

.lineup-tab.locked {
  opacity: 0.7;
  background: var(--background);
}

.lineup-tab.locked .lock-icon {
  margin-right: 8px;
}

.lineup-tab.locked.active {
  border-color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
}

.lineup-tab.locked.active .tab-status {
  background: var(--text-secondary);
}

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

.lineup-locked-banner {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
}

.lineup-locked-banner p {
  margin: 0;
  font-size: 14px;
}

.lineup-locked-banner p:first-child {
  color: var(--danger);
  font-size: 16px;
  margin-bottom: 8px;
}

.lineup-locked-banner p:last-child {
  color: var(--text-secondary);
}

.lineup-info-banner {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--accent-color);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.lineup-info-banner p {
  margin: 0;
  font-size: 14px;
  color: var(--text-primary);
}

.lineup-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

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

.cap-item {
  text-align: center;
}

.cap-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.cap-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.progress {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar {
  height: 100%;
  transition: width 0.3s, background-color 0.3s;
}

.bg-success { background: var(--success); }
.bg-warning { background: var(--warning); }
.bg-danger { background: var(--danger); }

.budget-warning {
  background: #fff3cd;
  color: #856404;
  padding: 12px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.lineup-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 20px;
}

.selected-golfers-section h3,
.golfer-pool-section h3 {
  margin-bottom: 16px;
  font-family: 'Roboto Slab', serif;
}

.lineup-info-banner .secondary-note {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  font-style: italic;
}

/* Golfer Slots */
.golfer-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--background);
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 2px dashed var(--border-color);
}

.golfer-slot.filled {
  border-style: solid;
  border-color: var(--primary-color);
  background: white;
}

.golfer-slot.filled.locked {
  border-color: var(--text-secondary);
  background: var(--background);
}

.golfer-slot.filled.locked .slot-number {
  background: var(--text-secondary);
}

.golfer-slot.empty {
  opacity: 0.6;
}

.slot-number {
  width: 28px;
  height: 28px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.slot-empty {
  color: var(--text-secondary);
  font-style: italic;
}

.golfer-slot .golfer-name {
  flex: 1;
  font-weight: 500;
}

.golfer-slot .golfer-salary {
  color: var(--primary-color);
  font-weight: 600;
}

.remove-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

/* Golfer Pool */
#golfer-search {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 100%;
  margin-bottom: 16px;
  font-size: 14px;
}

#golfer-pool {
  max-height: 400px;
  overflow-y: auto;
}

.golfer-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.golfer-item:hover {
  background: var(--background);
}

.golfer-item.selected {
  background: rgba(44, 82, 50, 0.1);
  border-color: var(--primary-color);
}

.golfer-item.cannot-afford {
  opacity: 0.5;
  cursor: not-allowed;
}

.golfer-item .golfer-name {
  font-weight: 500;
}

.golfer-item .golfer-salary {
  color: var(--primary-color);
  font-weight: 600;
}

/* Leaderboard */
.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.leaderboard-header h2 {
  margin: 0;
}

.leaderboard-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.leaderboard-toggle {
  display: flex;
  background: var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Tournament Selector */
.tournament-selector-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.tournament-selector-container label {
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.tournament-selector {
  padding: 10px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  background: var(--surface);
  cursor: pointer;
  min-width: 200px;
}

.tournament-selector:focus {
  outline: none;
  border-color: var(--primary-color);
}

.season-indicator {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 12px;
  background: var(--background);
  border-radius: var(--radius);
}

.season-indicator a {
  color: var(--primary-color);
  text-decoration: none;
}

.season-indicator a:hover {
  text-decoration: underline;
}

.toggle-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.toggle-btn:hover:not(.active) {
  background: rgba(44, 82, 50, 0.1);
  color: var(--primary-color);
}

.leaderboard-view {
  display: none;
}

.leaderboard-view.active {
  display: block;
}

/* Season Standings */
.season-standings-table {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border-collapse: collapse;
}

.season-standings-table th {
  background: var(--accent-color);
  color: var(--text-primary);
  padding: 14px 12px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
}

.season-standings-table th.pos { width: 50px; }
.season-standings-table th.player { text-align: left; min-width: 120px; }
.season-standings-table th.tournament { 
  min-width: 100px; 
  max-width: 180px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.season-standings-table th.season-total { width: 80px; }

.season-standings-table td {
  padding: 14px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.season-standings-table td.player { text-align: left; }

.season-standings-table tbody tr:hover {
  background: var(--background);
}

.season-standings-table .current-user {
  background: rgba(44, 82, 50, 0.1);
}

.tournament-abbrev {
  font-weight: 600;
}

.season-total {
  font-weight: 700;
  font-size: 15px;
}

/* Round Selector */
.round-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

.round-buttons {
  display: flex;
  gap: 8px;
}

.round-btn {
  padding: 8px 16px;
  border: 2px solid var(--border-color);
  background: var(--surface);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.round-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary-color);
}

.round-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Hole-by-Hole Scorecard */
.hole-by-hole-container {
  padding: 8px;
}

.hole-by-hole-container .round-title {
  margin-bottom: 12px;
  color: var(--primary-color);
  font-size: 16px;
}

.no-scores-message {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--accent-color);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  text-align: center;
}

.no-scores-message p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.no-lineup-message {
  background: var(--background);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.no-lineup-message p {
  margin: 0;
  color: var(--text-secondary);
}

.no-lineup-message p:first-child {
  margin-bottom: 8px;
  color: var(--text-primary);
}

.lineup-hidden-message {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--accent-color);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.lineup-hidden-message p {
  margin: 0;
  color: var(--text-secondary);
}

.lineup-hidden-message p:first-child {
  margin-bottom: 8px;
  color: var(--accent-color);
  font-weight: 600;
}

.scorecard-scroll {
  overflow-x: auto;
  margin: 0 -8px;
  padding: 0 8px;
}

.hole-scorecard {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.hole-scorecard th,
.hole-scorecard td {
  padding: 8px 6px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.hole-scorecard th {
  background: var(--primary-color);
  color: white;
  font-weight: 500;
}

.hole-scorecard .golfer-col {
  text-align: left;
  min-width: 160px;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hole-scorecard .golfer-salary {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: normal;
}

.hole-scorecard .subtotal {
  background: rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

.hole-scorecard .total-col {
  background: rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.hole-scorecard .par-row td {
  background: var(--background);
  font-weight: 500;
}

.hole-scorecard .golfer-row td {
  background: var(--surface);
}

.hole-scorecard .best-ball-row td {
  background: rgba(44, 82, 50, 0.1);
  border-top: 2px solid var(--primary-color);
}

.hole-scorecard .best-score {
  background: rgba(44, 82, 50, 0.2) !important;
  font-weight: 700;
}

/* Season Details */
.season-row {
  cursor: pointer;
  transition: background 0.2s;
}

.season-row:hover {
  background: var(--background);
}

.season-row .expand-icon {
  font-size: 10px;
  color: var(--text-secondary);
  transition: transform 0.2s;
  margin-left: 8px;
}

.season-row.expanded .expand-icon {
  transform: rotate(180deg);
}

.season-standings-table td.player {
  text-align: left;
}

.season-standings-table .player-name {
  display: inline;
}

.season-details {
  display: none;
}

.season-details.show {
  display: table-row;
}

.season-details td {
  padding: 16px;
  background: var(--background);
}

.tournament-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.tournament-detail-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  border-left: 4px solid var(--primary-color);
}

.tournament-detail-card.no-entry {
  border-left-color: var(--border-color);
  opacity: 0.6;
}

.tournament-detail-name {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.tournament-detail-position {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.tournament-detail-score {
  font-size: 20px;
  font-weight: 700;
}

.season-info {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.season-info span {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Bogey Pot Banner */
.bogey-pot-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

[data-theme="dark"] .bogey-pot-banner {
  background: linear-gradient(135deg, #4a4528 0%, #5c5323 100%);
  border-color: #9a7b2c;
}

.bogey-pot-icon {
  font-size: 40px;
}

.bogey-pot-info {
  flex: 1;
}

.bogey-pot-label {
  font-size: 14px;
  font-weight: 600;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .bogey-pot-label {
  color: #f5d485;
}

.bogey-pot-amount {
  font-size: 32px;
  font-weight: 700;
  color: #78350f;
  font-family: 'Roboto Slab', serif;
}

[data-theme="dark"] .bogey-pot-amount {
  color: #fcd34d;
}

.bogey-pot-details {
  font-size: 13px;
  color: #92400e;
  background: rgba(255, 255, 255, 0.5);
  padding: 8px 16px;
  border-radius: var(--radius);
}

[data-theme="dark"] .bogey-pot-details {
  color: #f5d485;
  background: rgba(0, 0, 0, 0.2);
}

/* Tournament Stats Section (real-time eagles/bogeys) */
.tournament-stats-section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

/* Eagles & Bogeys Section */
.eagles-bogeys-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-card h3 {
  font-family: 'Roboto Slab', serif;
  font-size: 18px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.stat-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.no-stat-data {
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
  padding: 20px;
  background: var(--background);
  border-radius: var(--radius);
}

.stat-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.stat-row {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: var(--background);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.stat-row:hover {
  background: var(--border-color);
}

.stat-row.current-user {
  background: rgba(44, 82, 50, 0.15);
  border: 1px solid var(--primary-color);
}

.stat-row.leader {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
}

[data-theme="dark"] .stat-row.leader {
  background: linear-gradient(135deg, #4a4528 0%, #5c5323 100%);
  border-color: #9a7b2c;
}

.stat-rank {
  font-weight: 700;
  color: var(--text-secondary);
  width: 30px;
  text-align: center;
}

.stat-row.leader .stat-rank {
  color: #92400e;
}

[data-theme="dark"] .stat-row.leader .stat-rank {
  color: #fcd34d;
}

.stat-name {
  flex: 1;
  font-weight: 500;
}

.stat-value {
  font-weight: 700;
  font-size: 14px;
}

.stat-value.eagles {
  color: var(--primary-color);
}

.stat-value.bogeys {
  color: var(--danger);
}

.section-title {
  font-family: 'Roboto Slab', serif;
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.leaderboard-table {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border-collapse: collapse;
}

.leaderboard-table th {
  background: var(--primary-color);
  color: white;
  padding: 14px 12px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
}

.leaderboard-table th.pos { width: 50px; }
.leaderboard-table th.player { text-align: left; }
.leaderboard-table th.round { width: 60px; }
.leaderboard-table th.total { width: 70px; }

.leaderboard-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

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

.leaderboard-row {
  cursor: pointer;
  transition: background 0.2s;
}

.leaderboard-row:hover {
  background: var(--background);
}

.leaderboard-row.current-user {
  background: rgba(44, 82, 50, 0.1);
}

.leaderboard-row td {
  padding: 14px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.leaderboard-row td.player {
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.expand-icon {
  font-size: 10px;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.leaderboard-row.expanded .expand-icon {
  transform: rotate(180deg);
}

.golfer-details {
  display: none;
}

.golfer-details.show {
  display: table-row;
}

.golfer-details td {
  padding: 12px;
  background: var(--background);
}


.golfer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Golfer Scores Table (expanded view) */
.golfer-scores-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 13px;
}

.golfer-scores-table th,
.golfer-scores-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.golfer-scores-table th {
  background: var(--primary-light);
  color: white;
  font-weight: 500;
  font-size: 12px;
}

.golfer-scores-table th:first-child,
.golfer-scores-table td:first-child {
  text-align: left;
}

.golfer-scores-table .golfer-name-cell {
  font-weight: 500;
  color: var(--text-primary);
}

.golfer-scores-table tbody tr:hover {
  background: rgba(44, 82, 50, 0.05);
}

.golfer-scores-table .best-ball-summary {
  background: rgba(44, 82, 50, 0.1);
  border-top: 2px solid var(--primary-color);
}

.golfer-scores-table .best-ball-summary td {
  border-bottom: none;
}

.golfer-scores-table .inactive-round {
  opacity: 0.4;
}

.rounds-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  background: var(--accent-color);
  color: var(--text-primary);
  border-radius: 10px;
  margin-left: 6px;
  font-weight: 500;
}

.split-lineup-info {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  padding: 8px 0;
}

.lineup-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius);
  font-weight: 500;
}

.lineup-badge.r12 {
  background: rgba(44, 82, 50, 0.15);
  color: var(--primary-color);
}

.lineup-badge.r34 {
  background: rgba(212, 175, 55, 0.2);
  color: #8b7a2f;
}

.golfer-chip {
  background: var(--primary-color);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
}

/* Score Colors */
.under-par { color: var(--under-par); font-weight: 600; }
.over-par { color: var(--over-par); font-weight: 600; }
.even-par { color: var(--even-par); }

/* Scorecard */
.scorecard {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow);
}

.scorecard h3 {
  font-family: 'Roboto Slab', serif;
  margin-bottom: 20px;
}

.scorecard-header {
  margin-bottom: 24px;
}

.golfers-picked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.round-scorecard {
  margin-bottom: 30px;
}

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

.round-scorecard h4 {
  margin: 0;
  color: var(--primary-color);
}

.round-golfers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.golfer-chip.small {
  font-size: 11px;
  padding: 3px 10px;
}

/* Lineup Display (pre-tournament) */
.lineup-display {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.lineup-section {
  background: var(--background);
  border-radius: var(--radius);
  padding: 16px;
}

.lineup-section h4 {
  margin: 0 0 12px 0;
  color: var(--primary-color);
  font-size: 14px;
}

.lineup-section .golfers-picked {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.no-lineup {
  color: var(--text-secondary);
  font-style: italic;
}

.scorecard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.scorecard-table th,
.scorecard-table td {
  padding: 8px 6px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.scorecard-table th {
  background: var(--primary-color);
  color: white;
  font-weight: 500;
}

.scorecard-table th:first-child {
  text-align: left;
  width: 80px;
}

.par-row td {
  background: var(--background);
  font-weight: 500;
}

.best-ball-row td {
  font-weight: 600;
}

.scorecard-total {
  margin-top: 20px;
  padding: 16px;
  background: var(--background);
  border-radius: var(--radius);
  font-size: 1.2rem;
}

/* History */
.history-list {
  display: grid;
  gap: 16px;
}

.history-item {
  background: var(--surface);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.history-item h4 {
  margin-bottom: 4px;
}

.history-date {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

.history-standings {
  width: 100%;
}

.history-standings .loading-placeholder,
.history-standings .no-standings {
  color: var(--text-secondary);
  font-size: 14px;
  padding: 8px 0;
}

.history-standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.history-standings-table th,
.history-standings-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.history-standings-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
}

.history-standings-table th.pos,
.history-standings-table td.pos {
  width: 50px;
  text-align: center;
}

.history-standings-table th.total,
.history-standings-table td.total {
  width: 70px;
  text-align: center;
  font-weight: 600;
}

.history-standings-table tbody tr:first-child td {
  font-weight: 600;
  color: var(--primary-color);
}

.expand-standings-btn {
  margin-top: 12px;
  width: 100%;
  background: var(--background);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.expand-standings-btn:hover {
  background: var(--surface);
  color: var(--text-primary);
}

/* Hall of Fame */
.history-section h2 {
  margin-bottom: 20px;
  font-size: 24px;
}

.hall-of-fame-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.hall-of-fame-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  table-layout: fixed;
}

.hall-of-fame-table th,
.hall-of-fame-table td {
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  width: calc((100% - 70px) / 5);
}

.hall-of-fame-table th {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hall-of-fame-table th.year-col,
.hall-of-fame-table td.year-col {
  width: 70px;
}

.hall-of-fame-table th.year-col {
  background: var(--primary-dark);
}

.hall-of-fame-table td.year-col {
  font-weight: 700;
  font-size: 18px;
  background: var(--background);
}

.hall-of-fame-table tbody tr:hover {
  background: rgba(74, 124, 82, 0.05);
}

.winner-cell {
  vertical-align: middle;
}

.winner-cell.empty {
  color: var(--text-secondary);
}

.winner-cell.season-champion {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

[data-theme="dark"] .winner-cell.season-champion {
  background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
}

.winner-name {
  display: block;
  font-weight: 600;
  font-size: 15px;
}

.winner-score {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

@media (max-width: 768px) {
  .hall-of-fame-table th,
  .hall-of-fame-table td {
    padding: 10px 8px;
    font-size: 13px;
  }
  
  .hall-of-fame-table th {
    font-size: 11px;
  }
  
  .winner-name {
    font-size: 13px;
  }
  
  .winner-score {
    font-size: 11px;
  }
  
  .hall-of-fame-table td.year-col {
    font-size: 14px;
  }
}

/* Rules Page */
.rules-page {
  max-width: 900px;
  margin: 0 auto;
}

.rules-title {
  text-align: center;
  font-size: 32px;
  margin-bottom: 8px;
  font-family: 'Roboto Slab', serif;
}

.rules-intro {
  text-align: center;
  color: var(--text-secondary);
  font-size: 18px;
  margin-bottom: 30px;
}

.rules-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.rules-card h3 {
  font-family: 'Roboto Slab', serif;
  font-size: 22px;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.rules-card h4 {
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.rules-card p {
  margin-bottom: 12px;
  line-height: 1.6;
}

.rules-card ul, .rules-card ol {
  margin-left: 0;
  padding-left: 20px;
}

.rules-card li {
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Highlight Card (What's New) */
.highlight-card {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border: 2px solid var(--primary-color);
}

[data-theme="dark"] .highlight-card {
  background: linear-gradient(135deg, #1b3d1f 0%, #2c5232 100%);
}

.highlight-card h3 {
  color: var(--primary-dark);
}

[data-theme="dark"] .highlight-card h3 {
  color: var(--primary-light);
}

.new-features {
  list-style: none;
  padding-left: 0;
}

.new-features li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .new-features li {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.new-features li:last-child {
  border-bottom: none;
}

.feature-badge {
  font-size: 28px;
  flex-shrink: 0;
}

.new-features li div p {
  margin: 4px 0 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Steps */
.rules-steps {
  list-style: none;
  padding-left: 0;
  counter-reset: none;
}

.rules-steps li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.rules-steps li:last-child {
  border-bottom: none;
}

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

.rules-steps li div p {
  margin: 4px 0 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Example Box */
.example-box {
  background: var(--background);
  padding: 16px;
  border-radius: var(--radius);
  border-left: 4px solid var(--primary-color);
  margin: 16px 0;
}

.example-box .birdie {
  color: #e53935;
  font-weight: bold;
}

/* Rules Grid */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 16px;
}

.rules-grid-item {
  background: var(--background);
  padding: 20px;
  border-radius: var(--radius);
}

.rules-grid-item h4 {
  margin-bottom: 12px;
}

.rules-grid-item ul, .rules-grid-item ol {
  margin-bottom: 0;
}

/* Warning Box */
.rules-warning {
  background: #fff3cd;
  color: #856404;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-top: 16px;
  font-weight: 500;
}

[data-theme="dark"] .rules-warning {
  background: #4a3f00;
  color: #ffd54f;
}

/* Note */
.rules-note {
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 12px;
}

/* Bogey Card */
.bogey-card {
  border: 2px solid #f44336;
}

.bogey-payout {
  background: var(--background);
  padding: 20px;
  border-radius: var(--radius);
  margin: 16px 0;
  text-align: center;
}

.payout-split {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 12px;
  font-size: 20px;
  font-weight: bold;
}

/* Prizes Grid */
.prizes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.prize-category {
  background: var(--background);
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
}

.prize-category h4 {
  margin-bottom: 12px;
  color: var(--primary-color);
}

.prize-category ul {
  list-style: none;
  padding: 0;
}

.prize-category li {
  padding: 6px 0;
}

/* Other Rules */
.other-rules {
  display: grid;
  gap: 20px;
}

.rule-item {
  background: var(--background);
  padding: 20px;
  border-radius: var(--radius);
}

.rule-item h4 {
  margin-bottom: 8px;
}

.rule-item p {
  margin-bottom: 8px;
}

.rule-item p:last-child {
  margin-bottom: 0;
}

/* Contact Card */
.contact-card {
  text-align: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
}

.contact-card h3 {
  color: white;
}

.contact-card p {
  opacity: 0.95;
}

.contact-methods {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.contact-methods span {
  font-weight: 500;
  font-size: 15px;
}

/* Rules Mobile */
@media (max-width: 768px) {
  .rules-title {
    font-size: 26px;
  }
  
  .rules-intro {
    font-size: 16px;
  }
  
  .rules-card {
    padding: 20px;
  }
  
  .rules-card h3 {
    font-size: 20px;
  }
  
  .rules-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .payout-split {
    gap: 20px;
    font-size: 18px;
  }
  
  .contact-methods {
    flex-direction: column;
    gap: 12px;
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  padding: 30px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--background);
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: white;
  padding: 14px 24px;
  border-radius: var(--radius);
  opacity: 0;
  transition: all 0.3s;
  z-index: 1001;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success { background: var(--success); }
.toast.warning { background: var(--warning); color: #333; }
.toast.error { background: var(--danger); }

/* Last Updated Timestamp */
.last-updated {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}


.last-updated::before {
  content: "🔄";
  font-size: 12px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.no-data {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  background: var(--surface);
  border-radius: var(--radius);
}

/* Footer */
.app-footer {
  background: var(--text-primary);
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .main-nav {
    order: 3;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }

  .nav-link {
    padding: 6px 10px;
    font-size: 13px;
  }

  .user-section {
    gap: 8px;
  }

  .tournament-banner {
    padding: 16px 12px;
  }

  .tournament-banner h2 {
    font-size: 1.3rem;
  }

  .container {
    padding: 0 12px;
  }

  .view h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
  }

  .salary-cap-display {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
  }

  .lineup-columns {
    grid-template-columns: 1fr;
  }

  .lineup-actions {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .lineup-actions .btn {
    padding: 10px 12px;
    font-size: 13px;
    flex: 1;
    text-align: center;
    white-space: nowrap;
  }

  .lineup-actions .btn-lg {
    padding: 10px 12px;
    font-size: 13px;
  }

  /* Leaderboard Table Mobile */
  .leaderboard-table {
    font-size: 11px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 8px 4px;
    white-space: nowrap;
  }

  .leaderboard-table th.player,
  .leaderboard-table td.player {
    position: sticky;
    left: 0;
    background: var(--surface);
    z-index: 1;
    min-width: 100px;
  }

  .leaderboard-table th.player {
    background: var(--accent-color);
  }

  .player-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
  }

  /* Season Standings Mobile */
  .season-standings-table {
    font-size: 11px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .season-standings-table th,
  .season-standings-table td {
    padding: 8px 6px;
    white-space: nowrap;
  }

  .season-standings-table th.player,
  .season-standings-table td.player {
    position: sticky;
    left: 0;
    background: var(--surface);
    z-index: 1;
  }

  .season-standings-table th.player {
    background: var(--accent-color);
  }

  .season-standings-table th.tournament {
    min-width: 70px;
    max-width: 70px;
    font-size: 10px;
  }

  /* Hole-by-hole Scorecard Mobile */
  .hole-scorecard {
    font-size: 10px;
  }

  .hole-scorecard th,
  .hole-scorecard td {
    padding: 4px 2px;
    min-width: 22px;
  }

  .hole-scorecard .golfer-col {
    position: sticky;
    left: 0;
    background: var(--surface);
    z-index: 1;
    min-width: 100px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hole-scorecard .golfer-salary {
    font-size: 10px;
  }

  .scorecard-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px;
    padding: 0 12px;
  }

  /* Round selector mobile */
  .round-selector {
    flex-wrap: wrap;
    gap: 6px;
  }

  .round-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  /* View toggle mobile */
  .view-toggle {
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
  }

  .view-toggle-btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  /* Tournament selector mobile */
  .tournament-selector-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
  }

  .tournament-selector {
    width: 100%;
  }

  /* Season info mobile */
  .season-info {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }

  /* Bogey pot banner mobile */
  .bogey-pot-banner {
    flex-direction: column;
    text-align: center;
    gap: 8px;
    padding: 16px;
  }

  /* Eagles/Bogeys section mobile */
  .eagles-bogeys-section {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 12px;
  }

  /* Golfer details in expanded row */
  .golfer-details-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .golfer-card {
    padding: 10px;
  }

  /* Action cards mobile */
  .action-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .action-card {
    padding: 16px;
  }

  /* Chat panel mobile */
  .chat-panel {
    width: 100%;
    right: 0;
    bottom: 0;
    top: auto;
    height: 70vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .chat-toggle {
    bottom: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
  }

  /* Last updated text mobile */
  .last-updated {
    font-size: 11px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .nav-link {
    padding: 5px 8px;
    font-size: 12px;
  }

  .lineup-actions .btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  .lineup-actions .btn-lg {
    padding: 8px 10px;
    font-size: 12px;
  }

  .leaderboard-table {
    font-size: 10px;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 6px 3px;
  }

  .player-name {
    max-width: 60px;
  }

  .hole-scorecard {
    font-size: 9px;
  }

  .hole-scorecard th,
  .hole-scorecard td {
    padding: 3px 1px;
    min-width: 18px;
  }

  .hole-scorecard .golfer-col {
    min-width: 55px;
    max-width: 55px;
    font-size: 9px;
  }

  .hole-scorecard .golfer-salary {
    display: none;
  }

  .season-standings-table th.tournament {
    min-width: 55px;
    max-width: 55px;
  }
}

/* Chat Panel */
.chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: all 0.2s;
}

.chat-toggle:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.chat-toggle.active {
  background: var(--primary-dark);
}

.chat-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 360px;
  height: 500px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 199;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.2s ease;
}

.chat-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--primary-color);
  color: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.chat-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-align: center;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 85%;
}

.chat-message.own {
  align-self: flex-end;
}

.chat-message.system {
  align-self: center;
  max-width: 95%;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.message-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.message-avatar-placeholder {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border-color);
}

.message-author {
  font-weight: 500;
  color: var(--text-primary);
}

.message-time {
  color: var(--text-secondary);
  font-size: 11px;
}

.message-delete-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}

.chat-message:hover .message-delete-btn {
  opacity: 1;
}

.message-delete-btn:hover {
  color: var(--danger);
}

.system-message .message-delete-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.system-message {
  position: relative;
}

.message-content {
  background: var(--background);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-message.own .message-content {
  background: var(--primary-color);
  color: white;
}

.message-content.system-message {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  border: 1px solid #f59e0b;
}

.system-icon {
  font-size: 18px;
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  position: relative;
}

.reaction-btn {
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

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

.reaction-btn.active {
  background: rgba(44, 82, 50, 0.1);
  border-color: var(--primary-color);
}

.reaction-btn[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 100;
  margin-bottom: 4px;
}

.add-reaction-btn {
  background: var(--background);
  border: 1px dashed var(--border-color);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
}

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

.reaction-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 6px;
  display: none;
  gap: 4px;
  box-shadow: var(--shadow);
  z-index: 10;
}

.reaction-picker.show {
  display: flex;
}

.reaction-picker .reaction-btn {
  border: none;
  padding: 4px 8px;
}

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

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: var(--primary-color);
}

.chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-send:hover {
  background: var(--primary-dark);
}
