* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

header {
  background: #1e293b;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  border-bottom: 1px solid #334155;
  flex-wrap: wrap;
}

header h1 { font-size: 1.25rem; color: #38bdf8; }

nav { display: flex; flex-wrap: wrap; gap: .25rem; }
nav a {
  color: #94a3b8;
  text-decoration: none;
  padding: .35rem .65rem;
  border-radius: 4px;
  font-size: .875rem;
  transition: color .15s, background .15s;
}
nav a:hover { color: #e2e8f0; background: #334155; }

main { padding: 2rem; flex: 1; min-width: 0; max-width: 1100px; margin: 0 auto; overflow-y: auto; }

/* ── App layout (sidebar + content) ──────────────────────────────────────── */
#layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #1e293b;
  border-right: 1px solid #334155;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: .75rem 0;
}

.sidebar-bottom {
  flex-shrink: 0;
  border-top: 1px solid #334155;
  padding: .25rem 0;
}

.sidebar-bottom-btn {
  display: block;
  width: 100%;
  padding: .5rem 1rem;
  text-align: left;
  font-family: inherit;
  font-size: .85rem;
  color: #94a3b8;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: background .1s, color .1s;
}
.sidebar-bottom-btn:hover { background: #243447; color: #e2e8f0; }

.sidebar-label {
  font-size: .65rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .5rem 1rem .25rem;
  font-weight: 600;
}

.sidebar-league-btn {
  display: block;
  width: 100%;
  padding: .5rem 1rem;
  text-align: left;
  font-family: inherit;
  font-size: .85rem;
  color: #94a3b8;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 0;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background .1s, color .1s;
}
.sidebar-league-btn:hover { background: #243447; color: #e2e8f0; }
.sidebar-league-btn.active {
  background: #162032;
  color: #38bdf8;
  border-left-color: #38bdf8;
  font-weight: 600;
}

.sidebar-new-btn {
  display: block;
  width: calc(100% - 2rem);
  margin: .75rem 1rem 0;
  padding: .4rem .75rem;
  text-align: center;
  font-family: inherit;
  font-size: .8rem;
  color: #64748b;
  background: none;
  border: 1px dashed #334155;
  border-radius: 4px;
  cursor: pointer;
  transition: background .1s, color .1s, border-color .1s;
}
.sidebar-new-btn:hover { background: #243447; color: #94a3b8; border-color: #475569; }

.sidebar-team-label {
  margin-top: 1.25rem;
  padding: .5rem 1rem;
  font-size: .75rem;
  color: #475569;
  border-top: 1px solid #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── League picker screen ─────────────────────────────────────────────────── */
.picker-card {
  cursor: pointer;
  transition: background .1s, border-color .1s;
}
.picker-card:hover { background: #243447; border-color: #38bdf8; }

.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card h2 { font-size: 1rem; color: #38bdf8; margin-bottom: .5rem; }
.card h3 { font-size: .95rem; color: #cbd5e1; margin-bottom: .5rem; }

button {
  background: #0ea5e9;
  color: white;
  border: none;
  padding: .5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: .875rem;
  transition: background .15s;
}
button:hover { background: #0284c7; }
button:disabled { background: #334155; color: #475569; cursor: not-allowed; }
button.secondary { background: #334155; }
button.secondary:hover { background: #475569; }

input, select {
  background: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: .5rem;
  border-radius: 4px;
  width: 100%;
  margin-bottom: .75rem;
}
input:focus, select:focus { outline: none; border-color: #38bdf8; }

/* ── Rarity badges ────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.badge.common    { background: #475569; }
.badge.uncommon  { background: #166534; color: #bbf7d0; }
.badge.rare      { background: #1e40af; color: #bfdbfe; }
.badge.epic      { background: #6b21a8; color: #e9d5ff; }
.badge.legendary { background: #92400e; color: #fde68a; }

/* ── Event banner ─────────────────────────────────────────────────────────── */
.event-banner {
  background: linear-gradient(135deg, #1e3a5f, #1e293b);
  border: 1px solid #38bdf8;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  color: #38bdf8;
  font-size: .9rem;
}

/* ── Context bar (league selector + filters) ──────────────────────────────── */
.context-bar { padding: 1rem 1.25rem; }
.context-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}
.context-field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-width: 140px;
}
.context-field label {
  font-size: .75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  cursor: pointer;
  color: #94a3b8;
  text-transform: none;
  letter-spacing: 0;
}
.toggle-label input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: #0ea5e9;
}

/* ── Position filter tabs ─────────────────────────────────────────────────── */
.pos-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .85rem;
}
.tab-btn {
  background: #334155;
  color: #94a3b8;
  font-size: .8rem;
  padding: .3rem .75rem;
  border-radius: 4px;
}
.tab-btn:hover { background: #475569; color: #e2e8f0; }
.tab-btn.active { background: #0ea5e9; color: #fff; }

/* ── Player list ──────────────────────────────────────────────────────────── */
.player-list-head {
  display: grid;
  /* grid-template-columns set inline — dynamic per position filter */
  gap: .75rem;
  padding: .5rem 1rem;
  font-size: .7rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid #334155;
  background: #162032;
}

/* Sortable column header spans */
.sort-col {
  color: #475569;
  transition: color .15s;
  white-space: nowrap;
}
.sort-col:hover { color: #94a3b8; }
.sort-active { color: #38bdf8 !important; }

/* Individual stat cells in position-specific view */
.stat-cell {
  font-size: .85rem;
  color: #94a3b8;
  text-align: right;
  padding-right: .1rem;
  white-space: nowrap;
}

.player-row {
  display: grid;
  /* grid-template-columns set inline — dynamic per position filter */
  gap: .75rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid #162032;
  align-items: center;
  transition: background .1s;
}
.player-row:hover { background: #243447; }
.player-row:last-child { border-bottom: none; }

.pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 22px;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}

.player-name-col strong { display: block; font-size: .9rem; color: #e2e8f0; }
.nfl-tag {
  display: inline-block;
  margin-top: .15rem;
  font-size: .7rem;
  color: #64748b;
  background: #0f172a;
  padding: .1rem .35rem;
  border-radius: 3px;
}

.player-stats-col {
  font-size: .8rem;
  color: #94a3b8;
  line-height: 1.4;
}
.wk-label {
  display: block;
  font-size: .7rem;
  color: #475569;
  margin-top: .1rem;
}

.player-pts-col {
  text-align: right;
  font-weight: 700;
  font-size: .95rem;
  color: #38bdf8;
}

.player-action-col { text-align: right; }

.on-roster-badge {
  display: inline-block;
  font-size: .72rem;
  background: #1e3a5f;
  color: #38bdf8;
  padding: .2rem .55rem;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fa-badge {
  display: inline-block;
  font-size: .72rem;
  color: #475569;
  border: 1px solid #334155;
  padding: .2rem .55rem;
  border-radius: 999px;
}

.draft-btn {
  background: #16a34a;
  font-size: .8rem;
  padding: .35rem .8rem;
}
.draft-btn:hover:not(:disabled) { background: #15803d; }

/* ── Compare button (per-row toggle) ──────────────────────────────────────── */
.player-cmp-col { display: flex; align-items: center; justify-content: center; }

.cmp-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  background: #334155;
  color: #64748b;
  font-size: .85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.cmp-btn:hover:not(.cmp-selected) { background: #475569; color: #e2e8f0; }
.cmp-btn.cmp-selected { background: #0ea5e9; color: #fff; }

/* ── Compare selection tray ───────────────────────────────────────────────── */
.compare-tray {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: .65rem 1rem;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}

.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: #162032;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: .2rem .5rem .2rem .3rem;
}
.compare-chip button:hover { color: #f87171 !important; }

.compare-slot-empty {
  font-size: .8rem;
  color: #475569;
  border: 1px dashed #334155;
  border-radius: 999px;
  padding: .2rem .75rem;
}

/* ── Compare results panel ────────────────────────────────────────────────── */
.compare-panel { margin-top: .25rem; }

.compare-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.compare-player-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 1rem;
}

.compare-vs-badge {
  font-size: 1.1rem;
  font-weight: 700;
  color: #475569;
  text-align: center;
  padding: 0 .5rem;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.compare-table thead tr { background: #162032; }
.compare-table th {
  padding: .5rem 1rem;
  font-size: .7rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid #334155;
  font-weight: 700;
}
.compare-table th:first-child { text-align: left; }
.compare-table th:not(:first-child) { text-align: center; }
.compare-table td {
  padding: .5rem 1rem;
  border-bottom: 1px solid #162032;
  color: #94a3b8;
}
.compare-table td:not(:first-child) { text-align: center; color: #e2e8f0; }
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table tbody tr:hover { background: #243447; }

.compare-win  { color: #4ade80 !important; font-weight: 700; }
.compare-lose { color: #475569 !important; }
.compare-tie  { color: #94a3b8; }

/* ── Team header (My Team page) ───────────────────────────────────────────── */
.team-header-card { padding: 1.25rem; }

.team-header-top {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.team-logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.team-logo-lg {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid #334155;
  display: block;
}

.team-logo-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  background: #1e293b;
  border: 2px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.team-header-info {
  flex: 1;
  min-width: 200px;
}

.team-header-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #e2e8f0;
}

.team-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem;
  margin-bottom: .75rem;
}

.rename-form-row {
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}

.team-stats-bar {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: .25rem;
}

.team-stat {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.team-stat-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
}

.team-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #38bdf8;
}

/* ── Roster view ──────────────────────────────────────────────────────────── */
.roster-section-head {
  background: #1e3a5f;
  color: #38bdf8;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .45rem 1rem;
}

.roster-row {
  display: grid;
  grid-template-columns: 64px 44px 1fr auto;
  gap: .75rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid #162032;
  align-items: center;
  font-size: .875rem;
}
.roster-row:hover { background: #243447; }
.roster-row:last-child { border-bottom: none; }

.slot-label {
  font-size: .75rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: .02em;
}

/* ── Standings table ──────────────────────────────────────────────────────── */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.standings-table thead tr {
  background: #162032;
  color: #475569;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.standings-table th, .standings-table td {
  padding: .6rem 1rem;
  border-bottom: 1px solid #162032;
}
.standings-table tbody tr:hover { background: #243447; }
.standings-table tbody tr:last-child td { border-bottom: none; }
.my-team-row td:nth-child(2) { color: #38bdf8; }

/* ── Matchup cards ────────────────────────────────────────────────────────── */
.matchup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.matchup-card { padding: 1rem 1.25rem; }
.my-matchup { border-color: #38bdf8; }

.matchup-teams {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .25rem;
}
.matchup-team {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem .75rem;
  background: #0f172a;
  border-radius: 6px;
  border: 1px solid #334155;
}
.matchup-team.winner { border-color: #22c55e; }
.matchup-team.winner .team-score { color: #22c55e; }
.team-name { font-size: .85rem; color: #cbd5e1; font-weight: 600; }
.team-score { font-size: 1.1rem; font-weight: 700; color: #38bdf8; margin-left: .5rem; }
.matchup-vs { color: #475569; font-size: .8rem; flex-shrink: 0; }

.status-badge {
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-badge.sched  { background: #1e293b; color: #64748b; border: 1px solid #334155; }
.status-badge.live   { background: #064e3b; color: #34d399; }
.status-badge.final  { background: #1e293b; color: #94a3b8; }

/* ── Matchup detail page (head-to-head) ──────────────────────────────────────── */
.mu-scoreboard { margin-bottom: 1rem; }

.mu-score-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.mu-score-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.mu-score-team-right { align-items: flex-end; }
.mu-score-name {
  font-size: .9rem;
  font-weight: 600;
  color: #94a3b8;
}
.mu-score-pts {
  font-size: 2.2rem;
  font-weight: 700;
  color: #38bdf8;
  line-height: 1;
}
.mu-score-name.mu-winner { color: #e2e8f0; }
.mu-score-pts.mu-winner  { color: #22c55e; }
.mu-vs {
  color: #475569;
  font-size: .9rem;
  font-weight: 600;
  flex-shrink: 0;
}

.mu-card { padding: 0; overflow: hidden; }

.mu-team-headers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #162032;
  border-bottom: 1px solid #334155;
  padding: .5rem 1rem;
}
.mu-team-hdr {
  font-size: .8rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mu-team-hdr-right { text-align: right; }
.mu-team-hdr.mu-winner { color: #22c55e; }

.mu-section-label {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #475569;
  padding: .35rem 1rem .2rem;
  background: #0f172a;
  border-top: 1px solid #1e293b;
}

.mu-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #0f172a;
}
.mu-row:last-child { border-bottom: none; }
.mu-bench { opacity: .75; }
.mu-bench:hover { opacity: 1; }

.mu-player {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .75rem;
  min-width: 0;
}
.mu-right {
  flex-direction: row-reverse;
  border-left: 1px solid #0f172a;
}

.mu-slot {
  font-size: .6rem;
  font-weight: 700;
  color: #475569;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}
.mu-name {
  flex: 1;
  font-size: .8rem;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.mu-name-right { text-align: right; }
.mu-empty { color: #334155; }
.mu-empty-slot { width: 30px; height: 18px; flex-shrink: 0; }
.mu-pts {
  font-size: .85rem;
  font-weight: 700;
  color: #38bdf8;
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
}
.mu-right .mu-pts { text-align: left; }

/* ── Avatars ──────────────────────────────────────────────────────────────── */
.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #334155;
  flex-shrink: 0;
}

.avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #334155;
  display: block;
}

.avatar-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #1e293b;
  border: 3px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

/* ── Profile page ─────────────────────────────────────────────────────────── */
.profile-card {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.profile-avatar-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  min-width: 120px;
}

.profile-fields {
  flex: 1;
  min-width: 260px;
}

.profile-username {
  font-size: 1.1rem;
  color: #e2e8f0;
  margin-bottom: 1rem;
}

.field-label {
  display: block;
  font-size: .75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .3rem;
}

.btn-upload {
  background: #334155;
  color: #e2e8f0;
  border: none;
  padding: .4rem .9rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: .8rem;
  transition: background .15s;
}
.btn-upload:hover { background: #475569; }

/* ── Home dashboard widgets ───────────────────────────────────────────────── */
.home-widgets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.home-widget-full {
  grid-column: 1 / -1;
}

.home-widget-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 1.25rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.home-widget-card:hover {
  background: #243447;
  border-color: #475569;
}

.home-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.home-widget-arrow {
  color: #475569;
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 400;
}

@media (max-width: 600px) {
  .home-widgets { grid-template-columns: 1fr; }
  .home-widget-full { grid-column: 1; }
}

/* ── Invite notice / cards ────────────────────────────────────────────────── */
.invite-notice {
  cursor: pointer;
  border-color: #38bdf8;
  padding: .75rem 1.25rem;
  transition: background .15s;
}
.invite-notice:hover { background: #243447; }

.invite-card {
  border-color: #f59e0b;
}

/* ── Card Catalogue ─────────────────────────────────────────────────────────── */
.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 1.25rem;
}

.tc-card {
  aspect-ratio: 5 / 7;
  border-radius: 10px;
  border: 2px solid #334155;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #0a1120;
  transition: transform .15s, box-shadow .15s;
}
.tc-card:hover { transform: translateY(-4px) scale(1.02); z-index: 1; }

.tc-card.common    { border-color: #475569; }
.tc-card.uncommon  { border-color: #16a34a; box-shadow: 0 0 8px rgba(22,163,74,.3); }
.tc-card.rare      { border-color: #2563eb; box-shadow: 0 0 10px rgba(37,99,235,.4); }
.tc-card.epic      { border-color: #7c3aed; box-shadow: 0 0 14px rgba(124,58,237,.5); }
.tc-card.legendary { border-color: #d97706; box-shadow: 0 0 20px rgba(217,119,6,.6); }

.tc-card-header {
  padding: .35rem .45rem .3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .3rem;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.3);
}
.tc-card.legendary .tc-card-header {
  background: linear-gradient(90deg, rgba(120,53,15,.6), rgba(0,0,0,.4));
}

.tc-card-name {
  font-size: .62rem;
  font-weight: 700;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.tc-rarity-pip {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.tc-card.common    .tc-rarity-pip { background: #475569; }
.tc-card.uncommon  .tc-rarity-pip { background: #16a34a; }
.tc-card.rare      .tc-rarity-pip { background: #2563eb; }
.tc-card.epic      .tc-rarity-pip { background: #7c3aed; }
.tc-card.legendary .tc-rarity-pip { background: #d97706; }

.tc-card-art {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  min-height: 0;
}
.tc-card.common    .tc-card-art { background: #060d18; }
.tc-card.uncommon  .tc-card-art { background: #030f06; }
.tc-card.rare      .tc-card-art { background: #02071e; }
.tc-card.epic      .tc-card-art { background: #08031a; }
.tc-card.legendary .tc-card-art { background: #120500; }

.tc-card-body {
  padding: .4rem .45rem .3rem;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,.05);
}

.tc-card-flavor {
  font-size: .57rem;
  font-style: italic;
  color: #94a3b8;
  line-height: 1.3;
  margin-bottom: .3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tc-card-effect {
  font-size: .56rem;
  font-weight: 600;
  color: #cbd5e1;
  line-height: 1.2;
  padding-top: .25rem;
  border-top: 1px solid #1e293b;
}

.tc-card-footer {
  padding: .25rem .45rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,.05);
  background: rgba(0,0,0,.25);
}

.tc-card-timing {
  font-size: .48rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Full-bleed image for cards with uploaded art */
.tc-card > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Admin upload overlay — visible on hover */
.tc-upload-btn {
  position: absolute;
  bottom: .35rem;
  right: .35rem;
  width: 22px;
  height: 22px;
  background: rgba(15,23,42,.88);
  border: 1px solid #475569;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
  z-index: 2;
  color: #94a3b8;
  line-height: 1;
  user-select: none;
}
.tc-card:hover .tc-upload-btn { opacity: 1; }
.tc-upload-btn:hover { background: rgba(14,165,233,.85); color: #fff; border-color: #0ea5e9; }

/* ── Card Draft Drag-and-Drop ────────────────────────────────────────────────── */

.cd-boxes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 700px) {
  .cd-boxes { grid-template-columns: repeat(2, 1fr); }
}

.cd-box {
  border: 2px dashed #334155;
  border-radius: 10px;
  padding: .6rem;
  background: #0a1120;
  min-height: 180px;
  transition: border-color .15s, background .15s;
}
.cd-box.cd-drag-over {
  border-color: #38bdf8;
  background: #0c1e35;
}

.cd-box-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .6rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid #1e293b;
}
.cd-box-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: #38bdf8;
  line-height: 1;
}
.cd-box-label {
  font-size: .72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.cd-box-count {
  margin-left: auto;
  font-size: .7rem;
  color: #475569;
  font-variant-numeric: tabular-nums;
}
.cd-box-count.cd-box-count-full {
  color: #f87171;
  font-weight: 600;
}
.cd-box.cd-box-full-state {
  border-color: #450a0a;
}

.cd-box-grid {
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: .6rem;
}

.cd-box-empty {
  color: #334155;
  font-size: .78rem;
  text-align: center;
  padding: 1.5rem .5rem;
  font-style: italic;
}

.cd-pool {
  border: 2px dashed transparent;
  border-radius: 10px;
  padding: .5rem;
  transition: border-color .15s, background .15s;
  min-height: 80px;
}
.cd-pool.cd-drag-over {
  border-color: #334155;
  background: #080f1c;
}

.cd-card-wrap {
  position: relative;
  cursor: grab;
}
.cd-card-wrap:active { cursor: grabbing; }
.cd-card-wrap.cd-dragging { opacity: .4; }

.cd-claimed-badge,
.cd-copies-badge {
  position: absolute;
  bottom: .3rem;
  left: .3rem;
  right: .3rem;
  background: rgba(0,0,0,.8);
  font-size: .55rem;
  text-align: center;
  padding: .2rem .3rem;
  border-radius: 3px;
  line-height: 1.3;
  pointer-events: none;
}
.cd-claimed-badge { color: #4ade80; }
.cd-copies-badge  { color: #94a3b8; }

/* ── Draft Room ──────────────────────────────────────────────────────────────── */

#app.draft-mode {
  padding: 0;
  max-width: none;
  margin: 0;
  overflow: hidden;
}

.draft-room {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.draft-header {
  flex-shrink: 0;
  background: #162032;
  border-bottom: 2px solid #334155;
  padding: .55rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  min-height: 50px;
}

.draft-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.draft-left {
  width: 248px;
  flex-shrink: 0;
  border-right: 1px solid #334155;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.draft-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.draft-right {
  width: 240px;
  flex-shrink: 0;
  border-left: 1px solid #334155;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.draft-col-head {
  flex-shrink: 0;
  background: #162032;
  padding: .35rem .75rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e293b;
  min-height: 28px;
}

.draft-col-scroll {
  flex: 1;
  overflow-y: auto;
}

/* Timeline */
.draft-round-header {
  background: #0a1120;
  padding: .2rem .6rem;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #334155;
  border-top: 1px solid #1e293b;
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 1;
}

.draft-pick-row {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .5rem;
  border-bottom: 1px solid #0a1120;
  font-size: .78rem;
  transition: background .1s;
  min-height: 34px;
  border-left: 2px solid transparent;
}
.draft-pick-row:hover { background: #1e293b; }
.draft-pick-row.current-pick {
  background: #071a0e;
  border-left-color: #4ade80;
}
.draft-pick-row.my-pick-row {
  background: #08132a;
}
.draft-pick-row.my-pick-row.current-pick {
  background: #071a0e;
}
.draft-pick-num {
  font-size: .62rem;
  color: #334155;
  width: 20px;
  flex-shrink: 0;
  text-align: right;
  font-weight: 600;
}
.draft-pick-team {
  color: #475569;
  font-size: .72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.draft-pick-player {
  color: #e2e8f0;
  font-weight: 600;
  font-size: .76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.draft-pick-player:hover { color: #38bdf8; cursor: pointer; }

/* Draft grid */
.draft-grid-table {
  border-collapse: collapse;
  font-size: .7rem;
  min-width: 100%;
}
.draft-grid-table th {
  background: #0a1120;
  color: #475569;
  padding: .3rem .35rem;
  font-size: .62rem;
  text-align: center;
  border: 1px solid #162032;
  position: sticky;
  top: 0;
  z-index: 1;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.draft-grid-table td {
  padding: .22rem .3rem;
  border: 1px solid #0a1120;
  text-align: center;
  min-width: 72px;
  max-width: 90px;
  vertical-align: middle;
  height: 38px;
}
.draft-grid-cell-filled { background: #0f172a; cursor: pointer; }
.draft-grid-cell-filled:hover { background: #1e293b; }
.draft-grid-cell-current {
  background: #071a0e;
  box-shadow: inset 0 0 0 1px #4ade80;
}
.draft-grid-cell-mine { background: #08132a; }
.draft-grid-cell-mine.draft-grid-cell-filled { background: #0c1f3d; }
.draft-grid-cell-empty { background: #060c18; }

/* Draft board grid overlay */
.draft-grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(2, 6, 23, 0.97);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.draft-grid-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem 1.1rem;
  background: #0a1120;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}
.draft-grid-overlay-body {
  flex: 1;
  overflow: auto;
  padding: .9rem 1rem;
}

/* Search area */
.draft-search-area {
  flex-shrink: 0;
  padding: .5rem .6rem;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.draft-search-input {
  width: 100%;
  margin: 0;
  padding: .35rem .55rem;
  font-size: .82rem;
  background: #162032;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #e2e8f0;
}
.draft-search-input:focus { outline: none; border-color: #38bdf8; }
.draft-pos-tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.draft-pos-tab {
  padding: .18rem .42rem;
  border-radius: 3px;
  font-size: .68rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity .12s;
}
.draft-pos-tab.inactive { opacity: .45; }
.draft-pos-tab:hover { opacity: 1; }

/* Player rows */
.draft-player-row {
  display: grid;
  grid-template-columns: 34px 1fr 54px 72px;
  gap: .35rem;
  padding: .38rem .6rem;
  border-bottom: 1px solid #0a1120;
  align-items: center;
  transition: background .1s;
  font-size: .8rem;
  border-left: 2px solid transparent;
}
.draft-player-row:hover { background: #1e293b; }
.draft-player-row.in-queue { border-left-color: #38bdf8; background: #08132a; }
.draft-player-row.in-queue:hover { background: #0f2040; }
.draft-player-name {
  font-weight: 600;
  color: #e2e8f0;
  font-size: .82rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.draft-player-name:hover { color: #38bdf8; }
.draft-player-nfl { font-size: .67rem; color: #64748b; }
.draft-player-pts { font-weight: 700; color: #38bdf8; text-align: right; font-size: .84rem; }
.draft-player-pts-label { font-size: .6rem; color: #475569; text-align: right; }

/* Roster slots (right panel) */
.draft-roster-slot {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .55rem;
  border-bottom: 1px solid #0a1120;
  font-size: .76rem;
  cursor: default;
  transition: background .1s;
}
.draft-roster-slot.filled { cursor: pointer; }
.draft-roster-slot.filled:hover { background: #1e293b; }
.draft-slot-label {
  font-size: .62rem;
  width: 32px;
  flex-shrink: 0;
  font-weight: 700;
  text-transform: uppercase;
}
.draft-slot-player { color: #e2e8f0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.draft-slot-empty { color: #2d3a4a; font-style: italic; font-size: .72rem; }

/* Queue */
.draft-queue-item {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .28rem .45rem;
  border-bottom: 1px solid #0a1120;
  font-size: .76rem;
  transition: background .1s;
}
.draft-queue-item:hover { background: #1e293b; }
.draft-queue-item.drafted { opacity: .38; }
.draft-queue-rank { font-size: .6rem; color: #334155; width: 16px; text-align: center; flex-shrink: 0; }
.draft-queue-name {
  flex: 1;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.draft-queue-name:hover { color: #38bdf8; }
.draft-queue-btn {
  background: none;
  border: none;
  color: #334155;
  cursor: pointer;
  padding: .12rem .22rem;
  font-size: .72rem;
  border-radius: 2px;
  transition: color .1s, background .1s;
  min-width: 0;
  line-height: 1;
}
.draft-queue-btn:hover { color: #94a3b8; background: #1e293b; }
.draft-queue-btn:disabled { opacity: .25; cursor: default; }
.draft-queue-btn.danger:hover { color: #f87171; background: transparent; }

/* Player info panel */
.draft-player-panel {
  position: absolute;
  right: -420px;
  top: 0;
  bottom: 0;
  width: 400px;
  background: #1a2744;
  border-left: 1px solid #334155;
  z-index: 50;
  transition: right .22s ease;
  overflow-y: auto;
  box-shadow: -6px 0 24px rgba(0,0,0,.55);
  display: flex;
  flex-direction: column;
}
.draft-player-panel.open { right: 0; }

.draft-panel-close {
  position: sticky;
  top: 0;
  background: #162032;
  padding: .55rem .75rem;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1;
  flex-shrink: 0;
}

/* Clock / timer elements */
.your-pick-badge {
  display: inline-flex;
  align-items: center;
  background: #071a0e;
  border: 1px solid #4ade80;
  border-radius: 4px;
  padding: .25rem .6rem;
  color: #4ade80;
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .02em;
  animation: dr-pulse .9s infinite alternate;
}
@keyframes dr-pulse {
  from { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
  to   { box-shadow: 0 0 8px 3px rgba(74,222,128,.2); }
}

.draft-timer { font-size: 1rem; font-weight: 700; color: #38bdf8; }
.draft-timer.warn  { color: #f59e0b; }
.draft-timer.urgent { color: #f87171; animation: dr-blink .55s infinite alternate; }
@keyframes dr-blink { from { opacity: 1; } to { opacity: .55; } }

/* Stat cards inside player panel */
.dp-stat-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: .55rem .7rem;
  flex: 1;
  min-width: 90px;
}
.dp-stat-label { font-size: .62rem; color: #475569; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .2rem; }
.dp-stat-val { font-size: 1.05rem; font-weight: 700; color: #38bdf8; }
.dp-stat-sub { font-size: .68rem; color: #64748b; margin-top: .1rem; }

/* Commission config panel inside right col */
.draft-config-panel {
  padding: .65rem .75rem;
  border-top: 1px solid #334155;
  background: #0f172a;
}
.draft-config-panel label { display: block; font-size: .65rem; color: #475569; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .2rem; margin-top: .4rem; }
.draft-config-panel select,
.draft-config-panel input { margin: 0 0 .4rem; padding: .3rem .45rem; font-size: .8rem; }
