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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
  font-size: 15px;
}

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

.auth-box {
  max-width: 400px; margin: 80px auto; background: white;
  border-radius: 12px; padding: 2rem; border: 1px solid #e5e5e5;
}
.auth-box h1 { font-size: 24px; font-weight: 600; margin-bottom: 4px; }
.subtitle { color: #666; font-size: 14px; margin-bottom: 1.5rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: #1a1a1a; color: white;
}
.logo { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; font-size: 13px; }

.container { max-width: 800px; margin: 0 auto; padding: 2rem 1rem; }

input, select {
  display: block; width: 100%; padding: 10px 12px; margin-bottom: 10px;
  border: 1px solid #ddd; border-radius: 8px; font-size: 14px;
  background: white; color: #1a1a1a;
}
input:focus, select:focus { outline: none; border-color: #378ADD; }

.btn-primary {
  display: inline-block; padding: 10px 20px; background: #1a1a1a;
  color: white; border: none; border-radius: 8px; font-size: 14px;
  cursor: pointer; font-weight: 500;
}
.btn-primary:hover { background: #333; }
.btn-secondary {
  display: inline-block; padding: 10px 20px; background: white;
  color: #1a1a1a; border: 1px solid #ddd; border-radius: 8px;
  font-size: 14px; cursor: pointer;
}
.btn-secondary:hover { background: #f5f5f5; }
.btn-ghost {
  background: transparent; border: none; cursor: pointer;
  color: inherit; font-size: 14px; padding: 6px 10px;
}
.btn-ghost:hover { opacity: 0.7; }

.tabs, .league-nav { display: flex; gap: 4px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 16px; border: 1px solid #ddd; background: white;
  border-radius: 8px; font-size: 13px; cursor: pointer; color: #666;
}
.tab-btn.active { background: #1a1a1a; color: white; border-color: #1a1a1a; }

.card {
  background: white; border: 1px solid #e5e5e5; border-radius: 12px;
  padding: 1.25rem; margin-bottom: 10px;
}
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.card-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 1rem; }

.league-card {
  background: white; border: 1px solid #e5e5e5; border-radius: 10px;
  padding: 1rem 1.25rem; cursor: pointer; display: flex;
  justify-content: space-between; align-items: center;
}
.league-card:hover { border-color: #378ADD; }
.league-card-name { font-weight: 600; font-size: 15px; }
.league-card-meta { font-size: 12px; color: #888; margin-top: 2px; }

.invite-code-display {
  font-size: 32px; font-weight: 700; letter-spacing: 6px;
  text-align: center; padding: 1rem; background: #f5f5f5;
  border-radius: 8px; margin: 1rem 0; font-family: monospace;
}
.hint { font-size: 12px; color: #888; margin-top: 8px; }

.draft-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #1a1a1a; color: white; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}

.draft-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  padding: 1rem; max-width: 1200px; margin: 0 auto;
}
.draft-left h3, .draft-right h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.draft-filters { display: flex; gap: 8px; margin-bottom: 10px; }
.draft-filters input { flex: 1; margin-bottom: 0; }
.draft-filters select { width: 90px; margin-bottom: 0; }

.player-list { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; }
.player-row {
  background: white; border: 1px solid #e5e5e5; border-radius: 8px;
  padding: 10px 12px; display: flex; align-items: center; justify-content: space-between;
}
.player-row.drafted { opacity: 0.4; pointer-events: none; }
.player-name { font-weight: 500; font-size: 14px; }
.player-meta { font-size: 12px; color: #888; }

.pos-tag {
  font-size: 11px; font-weight: 600; padding: 2px 7px;
  border-radius: 5px; margin-right: 6px;
}
.pos-QB { background: #E6F1FB; color: #0C447C; }
.pos-RB { background: #EAF3DE; color: #27500A; }
.pos-WR { background: #EEEDFE; color: #3C3489; }
.pos-TE { background: #FAEEDA; color: #633806; }
.pos-K  { background: #F1EFE8; color: #444; }
.pos-DEF { background: #FCEBEB; color: #791F1F; }

.draft-board { max-height: 75vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.pick-row {
  background: white; border: 1px solid #e5e5e5; border-radius: 8px;
  padding: 8px 12px; display: flex; gap: 10px; align-items: center; font-size: 13px;
}
.pick-num { color: #888; min-width: 30px; }
.pick-team { color: #888; font-size: 12px; }

.your-turn-banner {
  background: #378ADD; color: white; text-align: center;
  padding: 10px; font-weight: 600; font-size: 14px; border-radius: 8px;
  margin-bottom: 10px;
}

.divider { text-align: center; color: #aaa; font-size: 13px; margin: 1rem 0; }
.message { margin-top: 10px; font-size: 13px; min-height: 20px; }
.message.error { color: #c0392b; }
.message.success { color: #27ae60; }
.actions-row { display: flex; gap: 10px; margin-top: 1rem; }
.league-tab { display: none; }
.league-tab.active { display: block; }
.member-row {
  display: flex; justify-content: space-between; font-size: 13px;
  padding: 6px 0; border-bottom: 1px solid #f0f0f0;
}

@media (max-width: 600px) {
  .draft-layout { grid-template-columns: 1fr; }
  .auth-box { margin: 20px; }
}