/* Disc'n Dudes Archive Styles */
:root {
  --primary: #2c5f2d;
  --primary-light: #4a8c4b;
  --primary-dark: #1a3d1b;
  --accent: #f0a500;
  --bg: #f5f5f5;
  --bg-card: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #e0e0e0;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --radius: 8px;
  --shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); text-decoration: underline; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.page-header { background: var(--primary-dark); color: white; padding: 1.5rem 0; margin-bottom: 2rem; }
.page-header h1 { font-size: 1.5rem; }
.page-header .subtitle { color: rgba(255,255,255,0.7); font-size: 0.9rem; }

/* Navigation */
.nav { background: var(--primary); padding: 0; }
.nav-inner { display: flex; align-items: center; gap: 0; }
.nav a {
  color: rgba(255,255,255,0.85);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.nav a:hover, .nav a.active {
  background: var(--primary-dark);
  color: white;
  text-decoration: none;
}
.nav .brand {
  font-weight: 700;
  color: white;
  padding-right: 1.5rem;
  font-size: 1rem;
}

/* Cards grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
.card h3 { margin-bottom: 0.5rem; }
.card .stat { color: var(--text-light); font-size: 0.85rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin-bottom: 2rem; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
th, td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--primary); color: white; font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
td { font-size: 0.85rem; }
tr:hover td { background: #f9f9f9; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Scorecard Card Wrapper */
.scorecard-card {
  background: #D4A574;
  border: 2px solid #333;
  border-radius: 4px;
  font-family: 'Courier New', Consolas, monospace;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.scorecard-card-header {
  background: #D4A574;
  padding: 0.5rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  border-bottom: 2px solid #333;
  font-weight: 600;
}
.scorecard-card-header .card-label { font-weight: 700; }
.scorecard-card-footer {
  padding: 0.5rem 1rem;
  background: #D4A574;
  border-top: 2px solid #333;
  font-size: 0.75rem;
}
.scorecard-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.scorecard-table-wrap::-webkit-scrollbar { height: 10px; }
.scorecard-table-wrap::-webkit-scrollbar-track { background: #e5d5c5; }
.scorecard-table-wrap::-webkit-scrollbar-thumb { background: #8B7355; border-radius: 5px; }

/* Scorecard Table */
.scorecard { border-collapse: collapse; width: 100%; min-width: 900px; background: #F5DEB3; }
.scorecard th, .scorecard td { border: 1px solid #333; padding: 0.3rem 0.5rem; text-align: center; font-size: 0.8rem; }
.scorecard th { background: #D4A574; font-weight: 600; font-size: 0.75rem; }
.scorecard .player-name { text-align: left; white-space: nowrap; min-width: 100px; background: #E8D4B8; }
.scorecard th.player-name { background: #D4A574; }
.scorecard td.score-cell { background: #fff; }
.scorecard .hole-deuce { color: #1d4ed8; font-weight: 700; }
.scorecard .hole-ace { color: #dc2626; font-weight: 700; }
.scorecard .hole-win { background: #fef08a; font-weight: 700; }
.scorecard .marker-ctp { color: #3b82f6; font-weight: 700; }
.scorecard .marker-fi { color: #3b82f6; font-weight: 700; }
.scorecard .marker-mo { color: #f59e0b; font-weight: 700; }
.scorecard .total-col { font-weight: 600; background: #E8D4B8; }
.scorecard .col-grand { background: #FFE4B5; }
.scorecard .dude-col { background: #d4edda; color: #155724; font-size: 0.8rem; }
.scorecard .dude-total { background: #c3e6cb; font-weight: 600; }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-season { background: var(--primary-light); color: white; }
.badge-traveling { background: #6f42c1; color: white; }
.badge-fall-fun { background: var(--accent); color: #333; }
.badge-double { background: var(--danger); color: white; }

/* Search */
.search-input {
  width: 100%;
  max-width: 500px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--primary); }

/* Loading & Auth */
.loading { text-align: center; padding: 3rem; color: var(--text-muted); }
.auth-loading { display: flex; justify-content: center; align-items: center; min-height: 50vh; }
.error-msg { background: #f8d7da; color: var(--danger); padding: 1rem; border-radius: var(--radius); margin: 1rem 0; }

/* Stats hub links */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.stats-grid .card { text-align: center; cursor: pointer; }
.stats-grid .card h3 { color: var(--primary); }

/* Responsive */
@media (max-width: 768px) {
  .nav-inner { flex-wrap: wrap; }
  .card-grid { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 1.25rem; }
}
