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

:root {
  --primary: #FFFFFF;
  --secondary: #F8F9FA;
  --accent: #1D4ED8;
  --accent2: #D4A017;
  --text: #1C2321;
  --text-muted: #6B7280;
  --card-bg: #FFFFFF;
  --card-border: #E5E7EB;
  --success: #2ecc71;
  --error: #e74c3c;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--primary);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SCREENS ===== */
.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen.hidden {
  display: none;
}

.screen.active {
  display: flex;
}

/* ===== AUTH SCREEN ===== */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.logo-area {
  text-align: center;
  margin-bottom: 40px;
}

.logo-area h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent2);
  letter-spacing: 2px;
}

.logo-area p {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 5px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.form-container {
  width: 100%;
  max-width: 400px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 30px;
}

.admin-card {
  margin-bottom: 28px;
}

.form-container h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  text-align: center;
}

.form-container input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--secondary);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

.form-container input[type="checkbox"] {
  width: auto;
  padding: 0;
  margin-bottom: 0;
}

.form-container input::placeholder {
  color: var(--text-muted);
}

.form-container input:focus {
  border-color: var(--accent2);
}

.switch-form {
  text-align: center;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.switch-form span {
  color: var(--accent2);
  cursor: pointer;
  font-weight: 600;
}

/* ===== BUTTONS ===== */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 6px;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 6px;
}

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

/* ===== MESSAGES ===== */
.message {
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 14px;
  text-align: center;
  font-size: 0.9rem;
}

.message.success {
  background: rgba(46, 204, 113, 0.2);
  border: 1px solid var(--success);
  color: var(--success);
}

.message.error {
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid var(--error);
  color: var(--error);
}

/* ===== NAVIGATION ===== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #F1F3F5;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  z-index: 100;
}
@media (max-width: 600px) {
  .top-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }

  .nav-btn {
    flex-shrink: 0;
  }
}

.picks-toolbar {
  position: sticky;
  top: var(--nav-height, 56px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #EAF0FB;
  box-shadow: 0 0 0 100vmax #EAF0FB;
  clip-path: inset(0 -100vmax);
  border-bottom: 1px solid var(--card-border);
        padding: 12px 8px;
}


.toolbar-away-home {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.toolbar-label {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  color: var(--text);
}

@media (max-width: 600px) {
  .picks-toolbar {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .toolbar-away-home {
    position: static;
    width: 100%;
    order: 3;
  }
}

#week-selector {
    padding: 6px 10px;
    margin-right: auto;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  font-size: 0.9rem;
  background: var(--card-bg);
  color: var(--text);
}

.pick-counter {
    font-weight: 700;
    margin-left: auto;
  font-size: 0.95rem;
  color: var(--accent);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 6px 16px;
  border-radius: 10px;
  transition: color 0.2s;
}

.nav-btn.active {
  color: var(--accent);
}

.nav-icon {
  font-size: 1.4rem;
}

/* ===== SECTIONS ===== */
.section {
  padding: 100px 16px 20px;
  display: none;
}

.section.active {
    display: block;
}

.section-new {
  display: none;
  width: 100%;
  padding: 100px 16px 20px;
}

#app-screen .section-new.active {
  display: block !important;
  width: 100% !important;
}

.section-header {
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ===== TIEBREAKER ===== */
.tiebreaker-container {
  background: var(--card-bg);
  border: 1px solid var(--accent2);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.tiebreaker-container h3 {
  color: var(--accent2);
  margin-bottom: 8px;
}

.tiebreaker-container p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.tiebreaker-container input {
  width: 100%;
  padding: 12px 16px;
  background: var(--secondary);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

/* ===== LEADERBOARD ===== */
.leaderboard-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: var(--card-bg);
  border: 2px solid var(--accent2);
  border-radius: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--accent2);
  border-color: var(--accent2);
  color: var(--primary);
  font-weight: 700;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  gap: 12px;
}

.leaderboard-rank {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-muted);
  min-width: 30px;
}

.leaderboard-rank.top-3 {
  color: var(--accent2);
}

.leaderboard-name {
  flex: 1;
  font-weight: 600;
}

.leaderboard-score {
  font-weight: 700;
  color: var(--accent2);
}

/* ===== ANNOUNCEMENTS ===== */
.announcement-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.announcement-card.pinned {
  border-color: var(--accent2);
}

.announcement-card .pin-label {
  font-size: 0.75rem;
  color: var(--accent2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.announcement-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.announcement-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.announcement-card .date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ===== PROFILE ===== */
.profile-container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
}

.profile-info p {
  padding: 12px 0;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.profile-info p strong {
  color: var(--text);
}

.profile-info p:last-child {
  border-bottom: none;
}

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

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .auth-container {
    max-width: 500px;
    margin: 0 auto;
  }

  .section {
    max-width: 700px;
    margin: 0 auto;
  }
}

/* ===== PICKS SCREEN - GAME CARDS ===== */
.game-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.game-time {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1C2321;
  background: #F7F8F6;
  border-bottom: 1px solid #e5e7eb;
}
.broadcast-network {
  display: inline-block;
  font-weight: 700;
  color: #1C2321;
  margin-right: 8px;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.live-score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.live-score {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1C2321;
  min-width: 32px;
  text-align: center;
}

.status-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b7280;
}

.teams {
  display: flex;
  align-items: stretch;
  background: #ffffff;
}

.team-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  cursor: pointer;
  background: #ffffff;
  color: #1C2321;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.team-option:hover:not(.locked) {
  background: #F0F4F1;
}

.team-option.selected:hover {
  background: #374151;
  color: #ffffff;
}

.team-option.selected {
  background: #374151;
  color: #ffffff;
}

.team-option.locked {
  cursor: not-allowed;
  opacity: 0.6;
}

.team-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 50%;
  padding: 4px;
}

.team-option .team-name {
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  color: inherit;
  margin: 0;
}

.team-option .team-record {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4B5563;
}

.team-option.selected .team-record {
  color: #E5E7EB;
}

.team-option .spread {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: #B8860B;
  color: #ffffff;
}

.team-option.selected .spread {
  background: #ffffff;
  color: #374151;
}

.vs-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #9ca3af;
  padding: 0 8px;
  background: #ffffff;
}
/* ===== FINANCES TABLE ===== */
.finances-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.finances-table thead {
  background: #f1f3f5;
}

.finances-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.finances-table td {
  padding: 14px 16px;
  border-top: 1px solid #e5e7eb;
  font-size: 0.95rem;
}

.finances-table tbody tr:hover {
  background: #f8f9fa;
}
.finance-input {
  width: 90px;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}

.finance-input::-webkit-outer-spin-button,
.finance-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.finance-input[type="text"] {
  -moz-appearance: textfield;
    appearance: textfield;
}

.finances-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.icon-btn {
  background: none;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--card-bg);
}

.standings-grid-wrapper {
  overflow-x: auto;
  border: 1px solid var(--card-border);
  border-radius: 12px;
}

.standings-grid {
  border-collapse: collapse;
  width: 100%;
}

.overall-grid {
  width: auto;
}

.overall-grid th, .overall-grid td {
  width: 1%;
}

.standings-grid th, .standings-grid td {
  padding: 10px 14px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid var(--card-border);
}

.standings-grid thead th {
  background: #F7F8F6;
  font-size: 0.8rem;
  color: #1C2321;
  cursor: pointer;
}

.players-col {
  text-align: left;
  font-weight: 700;
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 2;
}

.pts-col, .ytd-col {
  font-weight: 700;
  color: var(--accent);
}

.tie-col {
  font-weight: 700;
  color: var(--accent);
}

.tiebreaker-matchup {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
}

.game-col-time {
  font-size: 0.7rem;
  color: #6b7280;
  font-weight: 600;
}

.game-col-matchup {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.game-cell {
  font-size: 0.85rem;
  font-weight: 600;
}

.pick-correct {
  background: #dcfce7;
  color: #15803d;
}

.pick-incorrect {
  background: #fee2e2;
  color: #b91c1c;
}

.pick-locked {
  color: #9ca3af;
  font-size: 1rem;
}

.pick-correct-live {
  background: transparent;
  color: #15803d;
  font-weight: 700;
}

.pick-incorrect-live {
  background: transparent;
  color: #b91c1c;
  font-weight: 700;
}

.leaderboard-selector {
  font-size: 16px;
  padding: 8px 12px;
  min-width: 160px;
  margin: 0 8px 12px 0;
}