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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0b1220;
  color: #e0e0e0;
  min-height: 100vh;
}

nav {
  background: linear-gradient(135deg, #0d2240, #1a3a5c);
  border-bottom: 3px solid #f47321;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav .logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: #f47321;
  text-decoration: none;
  letter-spacing: -0.5px;
  text-shadow: 0 0 10px rgba(244, 115, 33, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav .logo img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #f47321;
  cursor: pointer;
  transition: transform 0.15s;
}

nav .logo img:hover { transform: scale(1.1); }

/* Full-size photo overlay */
.photo-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.photo-overlay.active { display: flex; }

.photo-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(244, 115, 33, 0.3);
}

nav a {
  color: #8ab4e0;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: all 0.15s;
}

nav a:hover, nav a.active {
  color: #fff;
  background: rgba(244, 115, 33, 0.2);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #fff;
}

h2 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  color: #c0d0e0;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tabs button {
  padding: 0.5rem 1rem;
  border: 1px solid #1e3a5f;
  background: #0d2240;
  color: #8ab4e0;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}

.tabs button:hover { background: #163050; color: #fff; }
.tabs button.active { background: #f47321; color: #fff; border-color: #f47321; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: #0f2035;
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.85rem;
}

th {
  background: #162d4a;
  color: #8ab4e0;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  padding: 0.6rem 0.75rem;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid #1a3350;
  white-space: nowrap;
}

tr:hover td { background: rgba(255, 255, 255, 0.03); }

.pick-correct { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.pick-wrong { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.pick-pending { color: #8ab4e0; }
.pick-none { color: #3a5570; }

/* Leaderboard specifics */
.owed { color: #f87171; font-weight: 600; }
.owed-zero { color: #4ade80; }
.pot-total {
  font-size: 1.8rem;
  font-weight: 800;
  color: #f47321;
  margin-bottom: 1.5rem;
}
.pot-label {
  font-size: 0.8rem;
  color: #6a8aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.champ-winner {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(244, 115, 33, 0.08));
  border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Scores page */
.game-card {
  background: #0f2035;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.game-card.in-progress { border-left: 3px solid #f47321; }
.game-card.final { border-left: 3px solid #4ade80; }
.game-card.scheduled { border-left: 3px solid #2a4a6a; }

.game-teams {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.game-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
}

.game-team.winner { font-weight: 700; color: #fff; }
.game-team .seed { color: #6a8aaa; font-size: 0.75rem; margin-right: 0.5rem; }
.game-team .score { font-size: 1.1rem; font-weight: 700; min-width: 2rem; text-align: right; }
.game-status { font-size: 0.75rem; color: #6a8aaa; min-width: 5rem; text-align: right; }
.game-status.live { color: #f47321; font-weight: 600; }

/* Admin */
.admin-section {
  background: #0f2035;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

input, select {
  background: #0b1220;
  border: 1px solid #1e3a5f;
  color: #e0e0e0;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

input:focus, select:focus {
  outline: none;
  border-color: #f47321;
}

select { cursor: pointer; }

button {
  background: #f47321;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s;
}

button:hover { background: #d9621a; }
button.secondary { background: #1e3a5f; }
button.secondary:hover { background: #2a4a70; }
button.danger { background: #dc2626; }
button.danger:hover { background: #b91c1c; }

.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.participants-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.participant-chip {
  background: #162d4a;
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.participant-chip .remove {
  cursor: pointer;
  color: #6a8aaa;
  font-size: 0.7rem;
}

.participant-chip .remove:hover { color: #f87171; }

/* Admin pick grid */
.pick-grid-wrapper {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.pick-grid select {
  width: 100%;
  min-width: 80px;
  font-size: 0.75rem;
  padding: 0.25rem 0.35rem;
}

.pick-grid td { padding: 0.3rem; }
.pick-grid th { padding: 0.4rem 0.3rem; font-size: 0.65rem; }

.save-indicator {
  display: inline-block;
  font-size: 0.75rem;
  margin-left: 0.5rem;
  transition: opacity 0.3s;
}

.save-indicator.saved { color: #4ade80; }
.save-indicator.saving { color: #f47321; }
.save-indicator.error { color: #f87171; }

/* Scrollable table */
.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
}

/* Championship section */
.champ-predictions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.champ-card {
  background: #162d4a;
  border-radius: 6px;
  padding: 0.75rem;
}

.champ-card .name { font-weight: 600; margin-bottom: 0.5rem; }
.champ-card label { font-size: 0.75rem; color: #6a8aaa; display: block; margin-bottom: 0.2rem; }
.champ-card input { width: 100%; margin-bottom: 0.5rem; }
.champ-card select { width: 100%; margin-bottom: 0.5rem; }

.msg {
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.msg-success { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.msg-error { background: rgba(239, 68, 68, 0.15); color: #f87171; }

@media (max-width: 768px) {
  .container { padding: 1rem; }
  nav { padding: 0.5rem 1rem; gap: 0.75rem; }
  .pot-total { font-size: 1.4rem; }
}
