:root {
  --bg: #060815;
  --card: rgba(255, 255, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.14);
  --stroke: rgba(255, 255, 255, 0.16);
  --text: #f7fbff;
  --muted: #9fb0c8;
  --muted-2: #6f7d99;
  --green: #54f4b6;
  --gold: #ffd166;
  --blue: #63a4ff;
  --pink: #ff5fad;
  --red: #ff6b6b;
  --shadow: 0 24px 100px rgba(0, 0, 0, .36);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(99, 164, 255, .20), transparent 34%),
    radial-gradient(circle at 80% 0%, rgba(255, 95, 173, .18), transparent 32%),
    linear-gradient(145deg, #050713, #0a1027 55%, #041111);
  overflow-x: hidden;
}

button, input { font: inherit; }
button { cursor: pointer; }

.bg-orb {
  position: fixed;
  width: 26rem;
  height: 26rem;
  border-radius: 999px;
  filter: blur(45px);
  opacity: .28;
  pointer-events: none;
  z-index: 0;
}
.orb-one { background: #14f1c3; left: -8rem; bottom: 2rem; }
.orb-two { background: #7c3cff; right: -10rem; top: 10rem; }
.orb-three { background: #ffb703; right: 30%; bottom: -12rem; }

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
  position: relative;
  z-index: 1;
}

.glass {
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.06));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.hidden { display: none !important; }

.login-screen {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
  gap: 24px;
  align-items: center;
}

.brand-panel, .login-card, .panel, .topbar, .score-card {
  border-radius: 28px;
}

.brand-panel {
  padding: clamp(28px, 6vw, 72px);
}

.brand-kicker, .eyebrow {
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .75rem;
  font-weight: 800;
  margin: 0 0 10px;
}

.brand-panel h1 {
  font-size: clamp(2.8rem, 7vw, 6.8rem);
  line-height: .88;
  letter-spacing: -.075em;
  margin: 0;
  max-width: 860px;
}

.brand-panel p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 690px;
}

.stat-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-grid div {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
}

.stat-grid strong { display: block; font-size: 2rem; }
.stat-grid span { color: var(--muted); font-size: .9rem; }

.login-card {
  padding: 28px;
  display: grid;
  gap: 16px;
}

.logo-mark {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 2.3rem;
  background: linear-gradient(135deg, rgba(84,244,182,.2), rgba(99,164,255,.18));
  border: 1px solid var(--stroke);
}

.login-card h2 { margin: 0; font-size: 2rem; }
.login-card label { color: var(--muted); font-weight: 700; display: grid; gap: 8px; }

input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(6,8,21,.58);
  color: var(--text);
  outline: none;
}

input:focus { border-color: rgba(84,244,182,.75); box-shadow: 0 0 0 4px rgba(84,244,182,.12); }

.primary-btn, .ghost-btn, .danger-btn, .filter {
  border: 0;
  border-radius: 16px;
  padding: 13px 16px;
  color: var(--text);
  font-weight: 800;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #06111a;
}

.ghost-btn, .filter {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
}

.danger-btn {
  background: rgba(255,107,107,.14);
  border: 1px solid rgba(255,107,107,.34);
}

.primary-btn:hover, .ghost-btn:hover, .danger-btn:hover, .filter:hover, .team-card:hover { transform: translateY(-2px); }

.primary-btn.small { padding: 10px 14px; font-size: .9rem; }
.full { width: 100%; }

.microcopy, .note { color: var(--muted-2); line-height: 1.55; }

.dashboard { display: grid; gap: 18px; }

.topbar {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 10px;
  z-index: 5;
}
.topbar h1 { margin: 0; }
.topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(84,244,182,.12);
  border: 1px solid rgba(84,244,182,.24);
  color: var(--green);
  font-weight: 900;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 18px;
}
.score-card { padding: 24px; }
.score-card h2 { margin: 0 0 8px; font-size: clamp(1.65rem, 3vw, 3rem); letter-spacing: -.04em; }
.score-card p { margin: 0; color: var(--muted); }
.gradient-card { background: linear-gradient(135deg, rgba(84,244,182,.22), rgba(99,164,255,.14), rgba(255,95,173,.12)); }

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(340px, .55fr);
  gap: 18px;
}
.bottom-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, .45fr); }
.panel { padding: 22px; }
.panel-header { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 16px; }
.panel-header h2 { margin: 0; font-size: 1.7rem; letter-spacing: -.035em; }
.wrap { align-items: flex-start; flex-wrap: wrap; }

.join-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.players-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.player-chip {
  border-radius: 999px;
  padding: 10px 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  font-weight: 800;
}
.player-chip.active { color: #06111a; background: var(--green); }

.draft-tracker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  max-height: 170px;
  overflow: auto;
  padding-right: 6px;
}
.draft-pick-dot {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 900;
}
.draft-pick-dot.current { background: var(--gold); color: #191204; }
.draft-pick-dot.done { background: rgba(84,244,182,.18); color: var(--green); }

.leaderboard { display: grid; gap: 10px; }
.leader-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
}
.leader-row strong { display: block; }
.leader-row small { color: var(--muted); }
.leader-points { font-size: 1.4rem; font-weight: 900; color: var(--green); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.filter { padding: 9px 12px; font-size: .86rem; color: var(--muted); }
.filter.active { color: #06111a; background: var(--green); border-color: var(--green); }

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.team-card {
  text-align: left;
  min-height: 94px;
  border-radius: 22px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  color: var(--text);
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.12);
  transition: transform .18s ease, background .18s ease, border .18s ease, opacity .18s ease;
}
.team-card.claimed { opacity: .68; }
.team-card.mine { border-color: rgba(84,244,182,.72); background: rgba(84,244,182,.12); opacity: 1; }
.team-card.locked { cursor: not-allowed; }
.flag { font-size: 1.8rem; }
.team-meta { display: grid; gap: 4px; }
.team-name { font-size: .98rem; }
.team-sub { color: var(--muted); }
.team-points {
  min-width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: rgba(255,255,255,.1);
}

.match-feed { display: grid; gap: 10px; }
.match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
}
.match-row .score { font-size: 1.3rem; font-weight: 900; color: var(--gold); }
.match-row .right { text-align: right; }
.match-row small { display: block; color: var(--muted); margin-top: 2px; }

.rules-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.rules-box div {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
}
.rules-box span { color: var(--muted); display: block; }
.rules-box strong { font-size: 2rem; }

@media (max-width: 980px) {
  .login-screen, .hero-grid, .panel-grid, .bottom-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { position: static; align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .app-shell { width: min(100% - 18px, 1240px); padding-top: 12px; }
  .team-grid { grid-template-columns: 1fr; }
  .join-row { grid-template-columns: 1fr; }
  .topbar-actions { width: 100%; }
  .topbar-actions button, .topbar-actions .pill { flex: 1; justify-content: center; }
  .brand-panel h1 { font-size: 3rem; }
}


/* Enriched draft intelligence cards */
.team-tools {
  display: grid;
  gap: 10px;
  justify-items: end;
}
.team-search {
  width: min(430px, 100%);
  padding: 11px 14px;
  border-radius: 14px;
}
.note.tight { margin: 6px 0 0; }
.team-card {
  min-height: 0;
  display: block;
  padding: 14px;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.095), rgba(255,255,255,.045));
  border: 1px solid rgba(255,255,255,.12);
}
.team-card:hover {
  transform: translateY(-2px);
  border-color: rgba(84,244,182,.38);
  background: rgba(255,255,255,.105);
}
.team-head {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
}
.team-actions {
  display: grid;
  gap: 7px;
  justify-items: end;
}
.team-points {
  min-width: 52px;
  height: 30px;
  font-size: .78rem;
  border-radius: 11px;
}
.pick-btn {
  border: 1px solid rgba(84,244,182,.65);
  color: #06111a;
  background: var(--green);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: .8rem;
  font-weight: 900;
}
.pick-btn:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
}
.player-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 12px;
}
.player-chips span {
  padding: 6px 8px;
  border-radius: 999px;
  color: #dff7ff;
  background: rgba(99,164,255,.13);
  border: 1px solid rgba(99,164,255,.2);
  font-size: .72rem;
  font-weight: 800;
}
.team-statline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.team-statline span {
  padding: 10px;
  border-radius: 16px;
  background: rgba(0,0,0,.14);
  border: 1px solid rgba(255,255,255,.08);
}
.team-statline small {
  display: block;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.team-statline strong {
  display: block;
  font-size: 1.25rem;
  margin-top: 3px;
}
.team-stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 11px 0 0;
}
.team-stats-strip span {
  padding: 6px 8px;
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255,255,255,.065);
  border: 1px solid rgba(255,255,255,.08);
  font-size: .72rem;
  font-weight: 800;
}
.draft-note {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
  margin: 12px 0 0;
}
.empty-grid { grid-column: 1 / -1; }

@media (max-width: 980px) {
  .team-tools { justify-items: stretch; }
}


/* V3: rating explainer + recent form instead of live W-D-L */
.rating-guide {
  margin-top: 12px;
  width: min(720px, 100%);
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(84,244,182,.12), rgba(99,164,255,.08));
  border: 1px solid rgba(84,244,182,.18);
}
.rating-guide strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: .98rem;
}
.rating-guide span {
  color: var(--muted);
  line-height: 1.45;
  font-size: .84rem;
}
.rating-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rating-legend span {
  padding: 6px 8px;
  border-radius: 999px;
  color: #dff7ff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  font-size: .72rem;
  font-weight: 900;
}
.team-statline {
  grid-template-columns: .8fr 1.2fr;
}
.rating-box strong {
  color: var(--green);
}
.form-box strong {
  font-size: .96rem;
  letter-spacing: .12em;
  white-space: nowrap;
}
.last-five {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.form-pill {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: .74rem;
  font-weight: 950;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
  color: var(--muted);
}
.form-pill.w {
  color: #06111a;
  background: var(--green);
  border-color: rgba(84,244,182,.9);
}
.form-pill.d {
  color: #191204;
  background: var(--gold);
  border-color: rgba(255,209,102,.9);
}
.form-pill.l {
  color: #ffe9e9;
  background: rgba(255,107,107,.36);
  border-color: rgba(255,107,107,.54);
}
@media (max-width: 560px) {
  .team-statline { grid-template-columns: 1fr; }
  .rating-guide { padding: 12px; }
}

/* V4: two-page flow: draft page + team page */
.page-section {
  display: grid;
  gap: 18px;
}
.page-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
}
.tab-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}
.tab-btn.active {
  color: #06111a;
  background: var(--green);
}
.draft-hero-grid,
.team-hero-grid {
  grid-template-columns: 1.2fr 1fr 1fr;
}
.draft-layout-grid {
  grid-template-columns: minmax(0, .95fr) minmax(320px, .55fr);
}
.team-layout-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, .55fr);
}
.complete-banner {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}
.complete-banner h2 { margin: 0 0 6px; }
select,
.owner-select {
  width: 100%;
  color: var(--text);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}
select option { color: #09111f; }
.owner-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.owner-summary div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(0,0,0,.14);
  border: 1px solid rgba(255,255,255,.08);
}
.owner-summary span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
  margin-bottom: 5px;
}
.owner-summary strong {
  display: block;
  font-size: 1.02rem;
  line-height: 1.2;
}
.mini-team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mini-team-card {
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,.095), rgba(255,255,255,.045));
  border: 1px solid rgba(255,255,255,.12);
}
.mini-team-head {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
}
.mini-team-head strong { display: block; }
.mini-team-head small { color: var(--muted); }
.mini-points {
  min-width: 54px;
  text-align: center;
  border-radius: 999px;
  padding: 8px 9px;
  color: #06111a;
  background: var(--green);
  font-weight: 950;
  font-size: .82rem;
}
.mini-team-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 8px;
}
.mini-team-meta span {
  padding: 6px 8px;
  border-radius: 999px;
  color: #dff7ff;
  background: rgba(99,164,255,.13);
  border: 1px solid rgba(99,164,255,.2);
  font-size: .72rem;
  font-weight: 800;
}
.mini-team-card p {
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
  font-size: .84rem;
}
.upcoming-row .score {
  color: var(--green);
}
.draft-order-panel .draft-tracker {
  max-height: 310px;
}
.draft-panel .players-list {
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .draft-hero-grid,
  .team-hero-grid,
  .draft-layout-grid,
  .team-layout-grid,
  .owner-summary,
  .mini-team-grid {
    grid-template-columns: 1fr;
  }
  .topbar { gap: 12px; }
  .page-tabs { order: 3; width: 100%; }
  .tab-btn { flex: 1; }
  .complete-banner { flex-direction: column; align-items: flex-start; }
}


/* V5: Team page scoreboard polish */
.owner-tabs {
  width: 100%;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.owner-tab {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  padding: 11px 13px;
  color: var(--muted);
  background: rgba(255,255,255,.07);
  text-align: left;
  min-width: 145px;
  transition: transform .18s ease, border .18s ease, background .18s ease;
}
.owner-tab:hover {
  transform: translateY(-2px);
  border-color: rgba(84,244,182,.35);
}
.owner-tab.active {
  color: #06111a;
  background: linear-gradient(135deg, var(--green), var(--blue));
  border-color: rgba(84,244,182,.65);
}
.owner-tab strong,
.owner-tab span {
  display: block;
}
.owner-tab span {
  margin-top: 3px;
  font-size: .76rem;
  font-weight: 900;
  opacity: .86;
}
.last-game-chip.w {
  color: #06111a;
  background: var(--green);
  border-color: rgba(84,244,182,.9);
}
.last-game-chip.d {
  color: #191204;
  background: var(--gold);
  border-color: rgba(255,209,102,.9);
}
.last-game-chip.l {
  color: #ffe9e9;
  background: rgba(255,107,107,.36);
  border-color: rgba(255,107,107,.54);
}
.last-game-chip.pending {
  color: var(--muted);
  background: rgba(255,255,255,.065);
}
@media (max-width: 560px) {
  .owner-tab { width: 100%; }
}


/* V7: dynamic even-draft roster rule */
.draft-setup-summary {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(84,244,182,.10);
  border: 1px solid rgba(84,244,182,.22);
  display: grid;
  gap: 4px;
}
.draft-setup-summary strong {
  color: var(--green);
  font-size: 1rem;
}
.draft-setup-summary span {
  color: var(--muted);
  line-height: 1.45;
}
.bottom-results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

/* V9: custom in-page draft guard modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 42% 18%, rgba(255,209,102,.2), transparent 34%),
    radial-gradient(circle at 64% 80%, rgba(84,244,182,.16), transparent 32%),
    rgba(2, 4, 13, .72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.draft-guard-modal {
  position: relative;
  width: min(560px, 100%);
  border-radius: 30px;
  padding: 24px;
  animation: modalPop .18s ease-out;
}
@keyframes modalPop {
  from { transform: translateY(12px) scale(.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255,255,255,.08);
  font-size: 1.35rem;
  line-height: 1;
}
.modal-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,209,102,.23), rgba(255,107,107,.15));
  border: 1px solid rgba(255,209,102,.28);
  font-size: 1.8rem;
}
.draft-guard-modal h2 {
  margin: 0;
  font-size: clamp(1.7rem, 5vw, 2.45rem);
  line-height: 1;
  letter-spacing: -.055em;
}
.modal-message {
  color: var(--muted);
  line-height: 1.55;
  margin: 12px 0 16px;
}
.guard-choice-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 20px;
  background: rgba(255,107,107,.1);
  border: 1px solid rgba(255,107,107,.22);
}
.guard-choice-card strong { display: block; }
.guard-choice-card small { color: var(--muted); }
.guard-choice-score {
  padding: 8px 10px;
  border-radius: 999px;
  color: #ffe9e9;
  background: rgba(255,107,107,.22);
  border: 1px solid rgba(255,107,107,.34);
  font-weight: 950;
  white-space: nowrap;
}
.modal-section-title {
  margin: 0 0 8px;
  color: var(--muted-2);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 950;
}
.guard-alternatives {
  display: grid;
  gap: 8px;
}
.guard-alt-card {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 18px;
  background: rgba(84,244,182,.09);
  border: 1px solid rgba(84,244,182,.18);
}
.guard-alt-card strong { display: block; }
.guard-alt-card small { color: var(--muted); }
.guard-alt-score {
  color: #06111a;
  background: var(--green);
  border-radius: 999px;
  padding: 7px 9px;
  font-size: .78rem;
  font-weight: 950;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
@media (max-width: 560px) {
  .draft-guard-modal { padding: 20px; border-radius: 24px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
}

/* V10: draft room assist panels + richer team dashboard */
.draft-live-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr) minmax(300px, .8fr);
  gap: 18px;
}
.best-available-list,
.draft-queue-list,
.pick-history-feed,
.projection-board,
.scoring-log {
  display: grid;
  gap: 10px;
}
.available-row,
.pick-history-row,
.projection-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
}
.queued-row { grid-template-columns: 30px 42px 1fr auto; }
.available-row strong,
.pick-history-row strong,
.projection-row strong { display: block; }
.available-row small,
.pick-history-row small,
.projection-row small { color: var(--muted); }
.available-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}
.queue-btn,
.queue-mini-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  color: var(--muted);
  background: rgba(255,255,255,.08);
  font-size: 1rem;
  font-weight: 950;
}
.queue-btn.active,
.queue-mini-btn.active {
  color: #191204;
  background: var(--gold);
  border-color: rgba(255,209,102,.9);
}
.queue-btn:disabled,
.queue-mini-btn:disabled { opacity: .5; cursor: not-allowed; }
.mini-draft-btn {
  padding: 8px 10px;
  border-radius: 12px;
  font-size: .76rem;
}
.queue-rank,
.pick-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #06111a;
  background: var(--green);
  font-size: .76rem;
  font-weight: 950;
}
.pick-history-row { grid-template-columns: 42px 36px 1fr; }
.pick-history-feed {
  max-height: 370px;
  overflow: auto;
  padding-right: 4px;
}
.team-actions {
  grid-template-columns: 1fr 1fr;
  align-items: center;
}
.team-actions .team-points { grid-column: 1 / -1; justify-self: end; }
.team-actions .pick-btn { white-space: nowrap; }
.team-insight-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .65fr);
}
.dashboard-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.dashboard-stat-grid div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(0,0,0,.14);
  border: 1px solid rgba(255,255,255,.08);
}
.dashboard-stat-grid span,
.dashboard-stat-grid small {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
}
.dashboard-stat-grid strong {
  display: block;
  margin: 5px 0 3px;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  letter-spacing: -.04em;
}
.dashboard-stat-grid small {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
  color: var(--muted-2);
}
.mini-upcoming-strip {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.mini-upcoming-card {
  padding: 12px;
  border-radius: 18px;
  background: rgba(99,164,255,.1);
  border: 1px solid rgba(99,164,255,.18);
}
.mini-upcoming-card strong,
.mini-upcoming-card span { display: block; }
.mini-upcoming-card span { color: var(--muted); margin-top: 4px; font-size: .8rem; }
.projection-row {
  grid-template-columns: 34px 1fr 58px;
}
.projection-row > span {
  justify-self: end;
  padding: 8px 10px;
  border-radius: 999px;
  color: #06111a;
  background: var(--green);
  font-weight: 950;
}
.status-chip.alive {
  color: #06111a;
  background: var(--green);
  border-color: rgba(84,244,182,.9);
}
.status-chip.risk {
  color: #191204;
  background: var(--gold);
  border-color: rgba(255,209,102,.9);
}
.status-chip.eliminated {
  color: #ffe9e9;
  background: rgba(255,107,107,.36);
  border-color: rgba(255,107,107,.54);
}
.mini-team-card.status-risk { border-color: rgba(255,209,102,.25); }
.mini-team-card.status-eliminated { opacity: .7; border-color: rgba(255,107,107,.25); }
.score-log-item {
  border-radius: 18px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  overflow: hidden;
}
.score-log-item summary {
  list-style: none;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
  cursor: pointer;
}
.score-log-item summary::-webkit-details-marker { display: none; }
.score-log-item summary em {
  font-style: normal;
  color: #06111a;
  background: var(--green);
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 950;
}
.score-log-matches {
  display: grid;
  gap: 8px;
  padding: 0 13px 13px;
}
.score-log-matches div {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0,0,0,.12);
}
.score-log-matches span { color: var(--muted); }
.score-log-matches em { color: var(--green); font-style: normal; font-weight: 950; }
.bottom-results-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, .75fr);
}

@media (max-width: 980px) {
  .draft-live-grid,
  .team-insight-grid,
  .dashboard-stat-grid,
  .mini-upcoming-strip,
  .bottom-results-grid {
    grid-template-columns: 1fr;
  }
  .best-available-list,
  .draft-queue-list {
    max-height: none;
  }
}

@media (max-width: 560px) {
  .topbar {
    position: static;
    padding: 12px;
  }
  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .topbar-actions .pill,
  .topbar-actions button {
    min-height: 42px;
    padding: 10px;
    font-size: .82rem;
  }
  .page-tabs {
    position: sticky;
    bottom: 10px;
    z-index: 10;
    order: 10;
    border-radius: 18px;
  }
  .score-card,
  .panel { padding: 16px; border-radius: 22px; }
  .available-row,
  .queued-row {
    grid-template-columns: 34px 1fr;
  }
  .available-row .flag,
  .queued-row .flag { grid-row: span 2; }
  .available-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 48px 1fr;
  }
  .mini-draft-btn { width: 100%; }
  .pick-history-feed { max-height: 260px; }
  .mini-team-head { grid-template-columns: 36px 1fr; }
  .mini-points { grid-column: 1 / -1; width: 100%; }
  .match-row { grid-template-columns: 1fr; text-align: left; }
  .match-row .right { text-align: left; }
  .match-row .score { justify-self: start; }
}


/* V16: Supabase live app polish */
.app-notice {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(24px);
  z-index: 100;
  max-width: min(560px, calc(100% - 28px));
  padding: 13px 16px;
  border-radius: 18px;
  color: var(--text);
  background: rgba(8, 13, 30, .92);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  font-weight: 800;
}
.app-notice.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.app-notice.success { border-color: rgba(84,244,182,.55); }
.app-notice.error { border-color: rgba(255,107,107,.65); }
.flag img {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: cover;
  vertical-align: middle;
  border: 1px solid rgba(255,255,255,.18);
}
.player-row,
.tracker-row,
.leaderboard-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text);
}
.tracker-row { grid-template-columns: 46px 1fr; }
.tracker-row.active { background: rgba(255,209,102,.18); border-color: rgba(255,209,102,.42); }
.tracker-row.done { opacity: .72; }
.leaderboard-row { grid-template-columns: 34px 1fr auto auto; }
.leaderboard-row em { color: var(--green); font-style: normal; font-weight: 950; }
.leaderboard-row small { color: var(--muted); }
.team-card.drafted { opacity: .66; }
.match-row { grid-template-columns: 1fr auto; }
.match-row .score { justify-self: end; }
.team-card .pick-btn:disabled,
.team-card .queue-btn:disabled,
.primary-btn:disabled,
.ghost-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

/* V18: final login mode + locked draft tab */
.final-login-note {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(93, 239, 198, .08);
  border: 1px solid rgba(93, 239, 198, .18);
}
.final-login-note strong { display: block; margin-bottom: 4px; }
.final-login-note code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 12px 14px;
  border-radius: 16px;
  color: #06111a;
  background: var(--green);
  font-weight: 950;
  letter-spacing: .08em;
}
.tab-btn.disabled {
  opacity: .45;
  pointer-events: none;
}
@media (max-width: 560px) {
  .final-login-note { grid-template-columns: 1fr; }
  .final-login-note code { width: 100%; }
}

/* V21: draft guard modal layout fix */
.draft-guard-modal {
  width: min(720px, 100%);
  max-height: min(86vh, 880px);
  overflow: auto;
}
.guard-choice-card,
.guard-alt-card,
.guard-alt {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
}
.guard-choice-card .flag,
.guard-alt-card .flag,
.guard-alt .flag {
  width: 38px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}
.guard-team-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.guard-team-copy strong,
.guard-alt-card strong,
.guard-alt strong,
.guard-choice-card strong {
  font-size: 1rem;
  line-height: 1.1;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.guard-team-copy small,
.guard-alt-card small,
.guard-alt small,
.guard-choice-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .82rem;
}
.guard-alternatives {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.guard-alt {
  gap: 10px;
  padding: 11px 12px;
  border-radius: 18px;
  background: rgba(84,244,182,.09);
  border: 1px solid rgba(84,244,182,.18);
}
.guard-alt-score,
.guard-choice-score {
  min-width: 44px;
  text-align: center;
}
@media (max-width: 700px) {
  .draft-guard-modal { width: min(560px, 100%); }
  .guard-alternatives { grid-template-columns: 1fr; }
}

/* V22: commissioner draft order editor */
.draft-order-editor {
  margin-top: 16px;
  padding: 15px;
  border-radius: 22px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.12);
}
.draft-order-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.draft-order-editor-head h3 {
  margin: 2px 0 4px;
  font-size: 1.05rem;
}
.draft-order-editor-list {
  display: grid;
  gap: 9px;
}
.draft-order-edit-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(8, 13, 31, .48);
  border: 1px solid rgba(255,255,255,.10);
}
.draft-order-rank {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #06111a;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-weight: 950;
}
.draft-order-person {
  display: grid;
  gap: 2px;
}
.draft-order-person small {
  color: var(--muted);
  font-weight: 800;
}
.draft-order-actions {
  display: flex;
  gap: 6px;
}
.icon-btn {
  width: 38px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-size: 1rem;
}
.ghost-btn.small {
  padding: 9px 11px;
  font-size: .82rem;
}
.player-row em {
  color: var(--green);
  font-style: normal;
  font-weight: 950;
}
@media (max-width: 560px) {
  .draft-order-editor-head {
    flex-direction: column;
  }
  .draft-order-edit-row {
    grid-template-columns: 34px 1fr;
  }
  .draft-order-actions {
    grid-column: 2;
  }
}

/* V25: branded logo on login, draft page, and team page */
.logo-mark {
  overflow: hidden;
  padding: 0;
}
.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 240px;
}
.topbar-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid rgba(84,244,182,.34);
  box-shadow: 0 12px 36px rgba(84,244,182,.13), 0 0 0 1px rgba(255,255,255,.08) inset;
  flex: 0 0 auto;
}
.page-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
}
.page-brand::after {
  content: "";
  position: absolute;
  inset: auto -10% -70% 30%;
  height: 140%;
  background: radial-gradient(circle, rgba(84,244,182,.16), transparent 64%);
  pointer-events: none;
}
.page-logo {
  width: 92px;
  height: 92px;
  border-radius: 26px;
  object-fit: cover;
  border: 1px solid rgba(255,209,102,.36);
  box-shadow: 0 18px 60px rgba(0,0,0,.32), 0 0 38px rgba(84,244,182,.16);
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}
.page-brand > div {
  position: relative;
  z-index: 1;
}
.page-brand h2 {
  margin: 0 0 6px;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  letter-spacing: -.045em;
}
.page-brand .note {
  margin: 0;
}
@media (max-width: 720px) {
  .page-brand {
    align-items: flex-start;
  }
  .page-logo {
    width: 72px;
    height: 72px;
    border-radius: 22px;
  }
  .topbar-logo {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }
}
@media (max-width: 430px) {
  .page-brand {
    flex-direction: column;
  }
}
