/* Survivor Pool — sporty, clean, mobile-first. */

:root {
  --navy: #0c1b33;
  --navy-2: #13264a;
  --field: #16a34a;
  --field-dark: #15803d;
  --gold: #f59e0b;
  --red: #dc2626;
  --ink: #16213a;
  --ink-soft: #5b6577;
  --paper: #f4f5f7;
  --card: #ffffff;
  --line: #e3e6ec;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(12 27 51 / .06), 0 4px 14px rgb(12 27 51 / .06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ebf2; --ink-soft: #98a2b6;
    --paper: #0a1220; --card: #121d33; --line: #24314d;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 4px 14px rgb(0 0 0 / .35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100dvh; display: flex; flex-direction: column;
}
main { flex: 1; width: 100%; padding-bottom: 96px; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px; width: 100%; }
a { color: var(--field-dark); }
@media (prefers-color-scheme: dark) { a { color: #4ade80; } }
h1, h2, h3 { line-height: 1.15; margin: .2em 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 750; }
h3 { font-size: 1rem; font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
code { background: var(--paper); padding: 2px 6px; border-radius: 6px; }

/* Top bar */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; }
.topbar-in { display: flex; align-items: center; gap: 18px; min-height: 56px; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand-word { font-weight: 900; letter-spacing: .14em; font-size: 1.02rem; }
.brand-ball { filter: drop-shadow(0 1px 2px rgb(0 0 0 / .5)); }
.mainnav { display: flex; gap: 2px; overflow-x: auto; }
.mainnav a {
  color: #c5cede; text-decoration: none; padding: 8px 12px; border-radius: 8px;
  font-weight: 600; font-size: .92rem; white-space: nowrap;
}
.mainnav a:hover { color: #fff; background: rgb(255 255 255 / .08); }
.mainnav a[aria-current="page"] { color: #fff; background: rgb(255 255 255 / .14); }
.nav-admin { color: #fbbf24 !important; }
.topbar-right { margin-left: auto; }
.usermenu { position: relative; }
.usermenu summary {
  list-style: none; cursor: pointer; font-weight: 600; font-size: .92rem;
  padding: 8px 12px; border-radius: 8px; color: #c5cede; white-space: nowrap;
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu[open] summary, .usermenu summary:hover { background: rgb(255 255 255 / .12); color: #fff; }
.usermenu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  min-width: 180px; padding: 8px; display: grid; gap: 2px; z-index: 60;
}
.usermenu-pop a, .usermenu-pop .linklike {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px;
  color: var(--ink); text-decoration: none; background: none; border: 0;
  font: inherit; font-size: .92rem; cursor: pointer;
}
.usermenu-pop a:hover, .usermenu-pop .linklike:hover { background: var(--paper); }

/* Cards & layout */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin: 0 0 16px;
}
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 22px 0 14px; }
.page-head h1 { margin: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 20px 0 10px; }
.section-head h2 { margin: 0; }
.muted { color: var(--ink-soft); }
.tiny { font-size: .82rem; }
.empty-state { text-align: center; padding: 36px 20px; }

/* Buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 9px; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-weight: 700; font-size: .95rem; padding: 10px 18px;
  text-decoration: none; transition: transform .04s, filter .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--field); color: #fff; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; color: inherit; border-color: var(--line); }
.btn-ghost:hover { background: var(--paper); }
.topbar .btn-ghost { color: #fff; border-color: rgb(255 255 255 / .3); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=search],
input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; background: var(--paper); color: inherit; margin-top: 4px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, .teambtn:focus-visible {
  outline: 2px solid var(--field); outline-offset: 1px;
}
form .btn { margin-top: 12px; }
.inline-form label { display: inline-block; margin-right: 8px; }
.inline-form input, .inline-form select { width: auto; }
.searchbar { display: flex; gap: 8px; margin-bottom: 14px; }
.searchbar input { margin: 0; }
.searchbar .btn { margin: 0; }
.code-input { text-transform: uppercase; letter-spacing: .3em; font-weight: 800; text-align: center; }
.copy-input { font-size: .85rem; cursor: copy; }
.tiny-input { max-width: 180px; }
textarea { resize: vertical; }

/* Flash + chips */
.flash {
  border-radius: 10px; padding: 12px 16px; margin: 12px 0; font-size: .95rem;
  border: 1px solid; display: flow-root;
}
.flash-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash-error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-warn    { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.flash-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
@media (prefers-color-scheme: dark) {
  .flash-success { background: #052e1f; color: #6ee7b7; border-color: #065f46; }
  .flash-error   { background: #3f0d0d; color: #fca5a5; border-color: #7f1d1d; }
  .flash-warn    { background: #3b2a05; color: #fcd34d; border-color: #92400e; }
  .flash-info    { background: #0c2450; color: #93c5fd; border-color: #1e40af; }
}
.deadline-chip {
  background: var(--navy); color: #fff; border-radius: 999px; padding: 7px 16px;
  font-size: .88rem; display: inline-flex; gap: 8px; align-items: center;
}
.deadline-chip .countdown { color: #fbbf24; font-weight: 800; font-variant-numeric: tabular-nums; }
.chip-closed { background: var(--ink-soft); }
.status-pill {
  display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .75rem;
  font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.pill-active { background: #dcfce7; color: #166534; }
.pill-eliminated { background: #fef3c7; color: #92400e; }
.pill-out { background: #e5e7eb; color: #4b5563; }
.pill-pay-due { background: #fee2e2; color: #991b1b; }
.pill-pay-reported { background: #fef3c7; color: #92400e; }
.pill-pay-paid { background: #dcfce7; color: #166534; }
.pill-pay-waived, .pill-pay-refunded { background: #e5e7eb; color: #4b5563; }
@media (prefers-color-scheme: dark) {
  .pill-active { background: #14532d; color: #86efac; }
  .pill-eliminated { background: #451a03; color: #fcd34d; }
  .pill-out, .pill-pay-waived, .pill-pay-refunded { background: #374151; color: #d1d5db; }
  .pill-pay-due { background: #450a0a; color: #fca5a5; }
  .pill-pay-reported { background: #451a03; color: #fcd34d; }
  .pill-pay-paid { background: #14532d; color: #86efac; }
}

/* Hero (logged-out home) */
.hero { text-align: center; padding: 64px 8px 40px; }
.hero-kicker {
  color: var(--field); font-weight: 800; letter-spacing: .22em; text-transform: uppercase;
  font-size: .82rem; margin: 0 0 10px;
}
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); font-weight: 900; margin: 0 0 14px; }
.hero-sub { color: var(--ink-soft); font-size: 1.1rem; max-width: 480px; margin: 0 auto 26px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.feature-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 40px; }
.feature-num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff;
  font-weight: 900; display: grid; place-items: center; margin-bottom: 10px;
}
.feature p { color: var(--ink-soft); font-size: .93rem; margin-bottom: 0; }

/* Auth boxes */
.authbox { max-width: 420px; margin: 40px auto; }
.authbox-alt { font-size: .9rem; margin-top: 16px; }

/* Dashboard entries */
.entry-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.entry-card { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.entry-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.entry-name { font-weight: 800; font-size: 1.05rem; }
.entry-meta { display: flex; gap: 14px; color: var(--ink-soft); font-size: .85rem; }
.entry-pickline { display: flex; align-items: center; gap: 8px; font-size: .92rem; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.entry-pickline .btn { margin: 0 0 0 auto; }
.nopick { color: var(--gold); font-weight: 700; }
.entry-out { opacity: .65; }
.entry-add { border-style: dashed; background: transparent; box-shadow: none; }
.entry-add input { margin-bottom: 4px; }
.mini-logo { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; }
.commish-note { border-left: 4px solid var(--gold); }
.commish-label {
  font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 6px;
}

/* Pick page */
.entry-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.entry-tab {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 7px 14px; text-decoration: none; color: inherit; font-weight: 700; font-size: .9rem;
  white-space: nowrap; display: inline-flex; gap: 8px; align-items: center;
}
.entry-tab.is-active { border-color: var(--field); background: var(--field); color: #fff; }
.tab-sub { font-size: .78rem; opacity: .75; font-weight: 800; }
.tab-out, .tab-eliminated { opacity: .6; }
.matchups { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.matchup { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }
.matchup.is-started, .matchup.is-canceled { opacity: .6; }
.matchup-meta { display: flex; gap: 8px; align-items: center; font-size: .8rem; color: var(--ink-soft); margin-bottom: 8px; }
.spread-tag {
  background: var(--navy); color: #fbbf24; border-radius: 6px; padding: 1px 8px;
  font-weight: 800; font-size: .75rem; letter-spacing: .02em;
}
.spread-na { background: var(--paper); color: var(--ink-soft); border: 1px solid var(--line); }
.matchup-teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: stretch; }
.at-sign { align-self: center; color: var(--ink-soft); font-weight: 700; }
.teambtn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px 10px; border-radius: 10px; border: 2px solid var(--line);
  background: var(--card); color: inherit; cursor: pointer; font: inherit;
  transition: border-color .12s, background .12s;
}
.teambtn:hover:not(:disabled) { border-color: var(--team); }
.teambtn.is-selected { border-color: var(--field); background: color-mix(in srgb, var(--field) 10%, var(--card)); }
.teambtn.is-picked { border-color: var(--field); }
.teambtn:disabled { cursor: not-allowed; opacity: .45; }
.teambtn.is-used { opacity: .35; filter: grayscale(1); }
.team-logo { width: 44px; height: 44px; object-fit: contain; }
.team-names { display: flex; flex-direction: column; line-height: 1.15; }
.team-city { font-size: .72rem; color: var(--ink-soft); }
.team-name { font-weight: 800; font-size: .92rem; }
.team-flag {
  position: absolute; top: 6px; right: 6px; font-size: .62rem; font-weight: 900;
  letter-spacing: .06em; background: var(--ink-soft); color: var(--card);
  border-radius: 5px; padding: 1px 5px;
}
.flag-fav { background: var(--gold); color: #422006; }
.flag-picked { background: var(--field); color: #fff; }
.confirm-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--navy); color: #fff; box-shadow: 0 -6px 24px rgb(0 0 0 / .25);
  padding: 12px 0; animation: rise .18s ease-out;
}
@keyframes rise { from { transform: translateY(100%); } }
.confirm-in { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
#confirm-label { font-weight: 700; }
.confirm-bar .btn { margin: 0; }

/* Standings table */
.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.standings { border-collapse: collapse; width: 100%; font-size: .9rem; }
.standings th, .standings td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.standings thead th {
  background: var(--navy); color: #c5cede; font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; position: sticky; top: 0;
}
.standings .num { text-align: center; }
.standings .sov { font-weight: 800; font-variant-numeric: tabular-nums; }
.sticky-col, .sticky-col-2 { position: sticky; background: var(--card); z-index: 2; }
.sticky-col { left: 0; min-width: 34px; }
.sticky-col-2 { left: 44px; }
.standings thead .sticky-col, .standings thead .sticky-col-2 { background: var(--navy); z-index: 3; }
.player-cell { font-weight: 700; }
.row-dead { opacity: .55; }
.row-leader td { background: color-mix(in srgb, var(--gold) 12%, var(--card)); }
.row-leader .sticky-col, .row-leader .sticky-col-2 { background: color-mix(in srgb, var(--gold) 12%, var(--card)); }
.bb-dot { color: var(--gold); font-weight: 900; margin-left: 3px; }
.pick-chip {
  display: inline-block; min-width: 44px; border-radius: 6px; padding: 2px 6px;
  font-weight: 800; font-size: .78rem; text-align: center;
}
.pick-chip small { font-weight: 700; opacity: .85; margin-left: 2px; }
.chip-win { background: #dcfce7; color: #166534; }
.chip-loss { background: #fee2e2; color: #991b1b; }
.chip-tie, .chip-void { background: #e5e7eb; color: #4b5563; }
.chip-pending { background: var(--paper); color: var(--ink-soft); border: 1px dashed var(--line); }
.chip-none { color: var(--line); background: none; }
@media (prefers-color-scheme: dark) {
  .chip-win { background: #14532d; color: #86efac; }
  .chip-loss { background: #450a0a; color: #fca5a5; }
  .chip-tie, .chip-void { background: #374151; color: #d1d5db; }
}

/* Rules */
.rules-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.rules-list { padding-left: 20px; display: grid; gap: 9px; }

/* Checkout */
.checkout-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.mini-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.mini-table td, .mini-table th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.mini-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.total-row td { border-bottom: 0; font-size: 1.05rem; }
.paymethods { display: grid; gap: 10px; }
.paybtn {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left;
  padding: 14px 16px; border-radius: 10px; border: 2px solid var(--line);
  background: var(--card); font: inherit; color: inherit; cursor: pointer; margin: 0 !important;
}
.paybtn:hover { border-color: var(--field); }
a.paybtn { text-decoration: none; }
.paybtn-card { opacity: .55; }
.paybtn-name { font-weight: 800; }
.paybtn-note { font-size: .82rem; color: var(--ink-soft); }

/* Admin */
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.admin-nav a {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 15px; text-decoration: none; color: inherit; font-weight: 700; font-size: .88rem;
}
.admin-nav a:hover { border-color: var(--field); }
.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-bottom: 18px; }
.stat { text-align: center; padding: 14px 8px; margin: 0; }
.stat-big { font-size: 1.65rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat-good { color: var(--field); } .stat-warn { color: var(--gold); } .stat-bad { color: var(--red); }
.stat-label { font-size: .76rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.admin-cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.owner-card { padding: 14px 16px; }
.owner-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.joincode { font-weight: 900; letter-spacing: .18em; }

/* Footer */
.sitefoot { background: var(--navy); color: #7c89a3; font-size: .82rem; padding: 18px 0; margin-top: 40px; }

@media (max-width: 640px) {
  .topbar-in { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .mainnav { order: 3; width: 100%; }
  .confirm-in { flex-direction: column; align-items: stretch; text-align: center; }
}

/* Lightweight WYSIWYG (admin league message) */
.wysiwyg { margin-top: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.wysiwyg-bar {
  display: flex; gap: 2px; flex-wrap: wrap; padding: 6px;
  border-bottom: 1px solid var(--line);
}
.wysiwyg-btn {
  font: inherit; font-size: .82rem; color: var(--ink); background: none;
  border: 0; border-radius: 6px; padding: 4px 9px; cursor: pointer; line-height: 1.2;
}
.wysiwyg-btn:hover { background: var(--card); }
.wysiwyg-box {
  min-height: 110px; padding: 10px 12px; outline: none;
  overflow-wrap: break-word;
}
.wysiwyg-box:focus-visible { outline: 2px solid var(--field); outline-offset: -1px; border-radius: 0 0 9px 9px; }
.wysiwyg-box p:first-child, .wysiwyg-box ul:first-child, .wysiwyg-box ol:first-child { margin-top: 0; }
.wysiwyg-box p:last-child, .wysiwyg-box ul:last-child, .wysiwyg-box ol:last-child { margin-bottom: 0; }

/* --- First/last name rows + test-league marking (2026-08-04) --- */
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 480px) { .name-row { grid-template-columns: 1fr; } }
.testbar {
  background: repeating-linear-gradient(-45deg, #b45309, #b45309 18px, #92400e 18px, #92400e 36px);
  color: #fff; text-align: center; font-weight: 700; font-size: 13px;
  letter-spacing: .03em; padding: 7px 12px; text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.badge-test {
  display: inline-block; background: #b45309; color: #fff; border-radius: 6px;
  font-size: 11px; font-weight: 800; padding: 2px 7px; vertical-align: middle;
}
