/* ── Font ──────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap');

/* ── Reset & base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:        #0b7a52;  /* Augusta green, refreshed */
  --green-dark:   #07553a;
  --green-light:  #e7f5ee;
  --green-mid:    #0e8f60;
  --gold:         #cea94e;
  --gold-light:   #fbf3df;
  --gold-dark:    #a9822f;
  --silver:       #a0a0a0;
  --silver-light: rgba(160,160,160,.1);
  --bronze:       #b87333;
  --bronze-light: rgba(184,115,51,.1);
  --text:         #17211c;
  --text-muted:   #647069;
  --bg:           #f6f4ee;
  --card-bg:      #ffffff;
  --border:       #e7e2d4;
  --radius:       16px;
  --radius-sm:    10px;
  --shadow:       0 1px 2px rgba(15,35,26,.05), 0 10px 28px -8px rgba(15,35,26,.12);
  --shadow-hover: 0 20px 44px -12px rgba(15,35,26,.24);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(1100px 480px at 50% -10%, rgba(11,122,82,.06), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  animation: pageFadeIn .2s ease;
  letter-spacing: -.005em;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ────────────────────────────────────────────────────── */
header {
  background: linear-gradient(155deg, var(--green-mid) 0%, var(--green-dark) 78%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(7,85,58,.22);
  padding-top: env(safe-area-inset-top);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.22rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  letter-spacing: -.01em;
}
.logo:hover { text-decoration: none; }

.logo-flag {
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  height: 32px;
  min-width: 32px;
  padding: 0 .3rem;
  white-space: nowrap;
  background: rgba(255,255,255,.14);
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.logo-img {
  height: 58px;
  width: auto;
  display: block;
}

.logo-sub {
  font-size: .68rem;
  font-weight: 600;
  opacity: .75;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-left: .2rem;
}

nav {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.nav-user {
  font-size: .85rem;
  opacity: .9;
  margin-right: .2rem;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .55rem 1.15rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #ddb968 0%, var(--gold) 100%);
  color: #2b2108;
  font-weight: 700;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 6px 14px -6px rgba(169,130,47,.5);
}

.btn:hover { text-decoration: none; filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 10px 20px -8px rgba(169,130,47,.55); }
.btn:active { transform: translateY(0) scale(.97); }

.btn-sm { padding: .4rem .8rem; font-size: .82rem; border-radius: 9px; }

.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(255,255,255,.15); filter: none; transform: none; }

/* Ghost-style button for use on the page's light background (not the dark header) */
.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn-outline:hover { background: #f2f1ea; filter: none; transform: none; }

.btn-block { display: block; width: 100%; text-align: center; padding: .7rem; margin-top: .5rem; }

/* ── Main & cards ──────────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 2.2rem 1rem;
  width: 100%;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.2rem;
  transition: box-shadow .18s;
}
.card:hover { box-shadow: var(--shadow-hover); }

/* ── Page header ───────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.4rem;
}

.page-header h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: .3rem;
}

.last-updated {
  font-size: .82rem;
  color: var(--text-muted);
}

/* ── Leaderboard table ─────────────────────────────────────────── */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
}

.leaderboard-table th {
  text-align: left;
  padding: .7rem .9rem;
  background: var(--green-light);
  color: var(--green-dark);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid var(--border);
}

.leaderboard-table td {
  padding: .9rem .9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.leaderboard-table tbody tr:last-child td { border-bottom: none; }

.leaderboard-table tbody tr:hover { background: var(--green-light); }

.leaderboard-table tbody tr.my-row {
  background: #fffbea;
}
.leaderboard-table tbody tr.my-row:hover { background: #fff5c8; }

/* Top-3 row tints */
.leaderboard-table tbody tr.row-gold   { background: var(--gold-light); }
.leaderboard-table tbody tr.row-silver { background: var(--silver-light); }
.leaderboard-table tbody tr.row-bronze { background: var(--bronze-light); }
.leaderboard-table tbody tr.row-gold:hover   { background: rgba(206,169,78,.2); }
.leaderboard-table tbody tr.row-silver:hover { background: rgba(160,160,160,.18); }
.leaderboard-table tbody tr.row-bronze:hover { background: rgba(184,115,51,.18); }

/* Medals */
.medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: .85rem;
  color: #fff;
}
.medal.gold   { background: var(--gold); color: #1a1a1a; box-shadow: 0 2px 6px rgba(206,169,78,.45); }
.medal.silver { background: var(--silver); box-shadow: 0 2px 6px rgba(160,160,160,.4); }
.medal.bronze { background: var(--bronze); box-shadow: 0 2px 6px rgba(184,115,51,.4); }

.no-pick  { color: var(--text-muted); font-style: italic; }
.tbc      { color: var(--text-muted); font-size: .82rem; }

/* Score badges (semantic — over/under par colouring left as-is) */
.score-badge {
  display: inline-block;
  padding: .25rem .6rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: .9rem;
}
.score-badge.under { background: #c3e6cb; color: #0a4020; }
.score-badge.over  { background: #f5c6cb; color: #5a0d14; }
.score-badge.even  { background: #d6d8db; color: #2b2d30; }

.points-key {
  text-align: center;
  color: var(--text-muted);
  font-size: .82rem;
  padding: .8rem 1.5rem;
}
.points-key h3 { font-size: .85rem; margin-bottom: .3rem; color: var(--text); }

/* ── Auth forms ────────────────────────────────────────────────── */
.auth-container {
  display: flex;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1.2rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  margin-bottom: .35rem;
  color: var(--text);
}

.form-group input {
  width: 100%;
  padding: .6rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(11,122,82,.14);
}

.form-group small {
  display: block;
  margin-top: .3rem;
  font-size: .78rem;
  color: var(--text-muted);
}

.auth-link {
  margin-top: 1rem;
  text-align: center;
  font-size: .88rem;
  color: var(--text-muted);
}

/* ── Alerts ────────────────────────────────────────────────────── */
.alert {
  padding: .8rem 1.05rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.1rem;
  font-size: .9rem;
  font-weight: 500;
}
.alert-error   { background: #fdecea; color: #9a2f26; border: 1px solid #f5c9c3; }
.alert-success { background: var(--green-light); color: var(--green-dark); border: 1px solid #bfe5d3; }
.alert-info    { background: var(--green-light); color: var(--green-dark); border: 1px solid #bfe5d3; }

/* ── Countdown / deadline urgency ─────────────────────────────────── */
.countdown-timer {
  display: inline-block;
  font-weight: 700;
  padding: .1rem .55rem;
  border-radius: 20px;
  background: var(--border);
  color: var(--text);
}
.countdown-timer.countdown-urgent {
  background: var(--gold-light);
  color: var(--gold-dark);
}
.countdown-timer.countdown-critical {
  background: #fbe3e0;
  color: #b5392c;
  animation: countdown-pulse 1s infinite;
}
@keyframes countdown-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}
.deadline-banner {
  background: #fbe3e0;
  border: 1px solid #e2695c;
  color: #9a2f22;
  padding: .8rem 1.05rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.1rem;
  font-size: .92rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.deadline-banner a {
  color: #9a2f22;
  text-decoration: underline;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Pick page specifics ───────────────────────────────────────── */
.pick-deadline {
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.pick-display {
  text-align: center;
  padding: 1.5rem;
}
.pick-label { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.pick-name  { font-size: 1.8rem; font-weight: 800; color: var(--green-dark); margin-top: .3rem; }

/* ── Empty state ───────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3.2rem 1.4rem;
  color: var(--text-muted);
  border: 1.5px dashed var(--border);
  background: linear-gradient(180deg, #fff, #fafaf6);
}
.empty-state-icon {
  font-size: 2.4rem;
  margin-bottom: .8rem;
  display: block;
  opacity: .55;
}
.empty-state p { font-size: .95rem; }

/* ── Footer ────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.3rem 1rem;
  font-size: .78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ── Draft board ───────────────────────────────────────────────── */
.section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1.05rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  letter-spacing: -.01em;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 5px; height: 1.1rem;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--gold), var(--green-mid));
  flex-shrink: 0;
}

.mt-lg    { margin-top: 2.2rem; }
.mt-small { margin-top: .5rem; }
.muted    { color: var(--text-muted); font-size: .85rem; }
.label-small { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }

.draft-board-wrap { overflow-x: auto; }

.draft-board {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  min-width: 500px;
}
.draft-board th {
  padding: .5rem .7rem;
  background: var(--green-light);
  color: var(--green-dark);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid var(--border);
  text-align: center;
}
.draft-board td {
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  min-width: 110px;
}
.draft-board td.pick-round {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 700;
  text-align: left;
  min-width: 60px;
  background: var(--green-light);
}
.draft-board td.cell-current {
  background: #fffde7;
  box-shadow: inset 0 0 0 2px var(--gold);
}
.pick-name-cell { font-weight: 700; font-size: .85rem; }
.cell-picking   { font-size: .8rem; color: var(--gold-dark); font-weight: 700; }
.cell-empty     { color: #ccc; }

/* Pick form */
.pick-form-card   { border: 2px solid var(--gold); }
.your-squad-mini  { margin-bottom: 1rem; }

/* Player selection grid */
.player-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  max-height: 320px;
  overflow-y: auto;
  padding: .5rem 0;
  margin-bottom: .5rem;
}

.player-btn {
  padding: .4rem .85rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  font-size: .85rem;
  cursor: pointer;
  transition: background .1s, border-color .1s, color .1s;
  white-space: nowrap;
}
.player-btn:hover   { background: var(--green-light); border-color: var(--green); }
.player-btn.selected {
  background: var(--green);
  border-color: var(--green-dark);
  color: #fff;
  font-weight: 700;
}

.pick-confirm-bar {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .75rem 1rem;
  background: var(--gold-light);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  margin-top: .5rem;
  flex-wrap: wrap;
}

.pill-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; }
.pill {
  display: inline-block;
  padding: .2rem .6rem;
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 700;
}
.pill-taken { background: #fdecea; color: #9a2f26; }

.taken-details { margin-top: 1rem; font-size: .85rem; }
.taken-details summary { cursor: pointer; color: var(--text-muted); }

/* Admin */
/* Registered players list */
.registered-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.reg-player {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .8rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: .88rem;
}
.reg-pos  { font-weight: 700; color: var(--text-muted); font-size: .78rem; }
.reg-name { font-weight: 700; }

.admin-hint    { font-size: .78rem; color: var(--text-muted); margin-top: .6rem; }
.admin-section { margin-bottom: .8rem; }
.admin-divider { border-top: 1px solid var(--border); margin: .8rem 0; }

.tournament-selected {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: .3rem;
}
.tournament-selected-name {
  font-weight: 700;
  font-size: .92rem;
  color: var(--green-dark);
}

/* Tournament list table */
.tournament-table td { vertical-align: middle; }
.tournament-row { cursor: pointer; }
.tournament-row:hover { background: var(--green-light); }
.tournament-name { cursor: pointer; font-weight: 600; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .55rem;
  border-radius: 20px;
  font-size: .74rem;
  font-weight: 700;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-live     { background: #e5f6ea; color: #1c7d3c; }
.status-draft    { background: var(--gold-light); color: var(--gold-dark); }
.status-upcoming { background: #eef0ee; color: #4d564f; }
.status-done     { background: #eef0ee; color: #4d564f; }

.admin-card   { border: 1px dashed var(--border); background: #fafaf6; }
.admin-row    { display: flex; gap: .6rem; flex-wrap: wrap; }
.btn-danger   { background: #c0392b; color: #fff; box-shadow: none; }
.btn-danger:hover { background: #a93226; filter: none; transform: none; }

/* Squads grid */
.squads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.squad-card { padding: 1rem; }
.squad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .6rem;
}
.squad-picks { padding-left: 1.2rem; font-size: .88rem; line-height: 1.8; }

/* ── Home page extras ──────────────────────────────────────────── */
.team-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: .4rem;
  vertical-align: middle;
}

.disq-badge {
  display: inline-block;
  padding: .1rem .35rem;
  background: #c0392b;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  border-radius: 3px;
  margin-left: .4rem;
  vertical-align: middle;
}

.cut-status { font-size: .85rem; font-weight: 600; }
.cut-ok  { color: #155724; }
.cut-bad { color: #721c24; }

/* Squad breakdown table */
.squad-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  margin-bottom: .5rem;
}
.squad-table th {
  text-align: left;
  padding: .3rem .4rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.squad-table td {
  padding: .4rem .4rem;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.squad-table tr.counting-row {
  background: var(--green-light);
}
.squad-table tr.counting-row td:first-child {
  font-weight: 700;
}

.counts-badge {
  display: inline-block;
  padding: .05rem .3rem;
  background: var(--green);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 3px;
  margin-left: .3rem;
  vertical-align: middle;
}

.cut-badge {
  display: inline-block;
  padding: .1rem .35rem;
  background: #7f8c8d;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  border-radius: 3px;
}


/* ── Round status bar ───────────────────────────────────────────── */
.round-status-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .55rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.round-status-done      { background: var(--green-light); color: var(--green-dark); }
.round-status-live      { background: #d1fae5; color: #065f46; animation: pulseLive 2s ease-in-out infinite; }
.round-status-suspended { background: var(--gold-light); color: var(--gold-dark); }

@keyframes pulseLive {
  0%, 100% { opacity: 1; }
  50%       { opacity: .7; }
}

.round-scores  { white-space: nowrap; }
.round-chip {
  display: inline-block;
  padding: .1rem .35rem;
  background: #e9ecef;
  color: var(--text);
  border-radius: 4px;
  font-size: .78rem;
  margin-right: .2rem;
  font-weight: 600;
}
.round-chip.under { background: #d4edda; color: #155724; }
.round-chip.over  { background: #f8d7da; color: #721c24; }
.round-chip.even  { background: #e9ecef; color: var(--text); }

.squad-note { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }

/* Counting players (home table) */
.counting-players { display: flex; flex-wrap: wrap; gap: .3rem; }
.counting-players .pill em { font-style: normal; opacity: .75; margin-left: .2rem; }

/* Rules card */
.rules-card { padding: 1rem 1.5rem; }
.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem .8rem;
  font-size: .82rem;
  color: var(--text-muted);
}
.rules-grid strong { color: var(--text); }

.card-footnote { font-size: .78rem; color: var(--text-muted); margin-top: .6rem; }

/* ── Nav avatar ─────────────────────────────────────────────────── */
a.nav-user {
  display: flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  color: var(--text);
  font-size: .88rem;
  font-weight: 600;
}
a.nav-user:hover { color: var(--green); }
.nav-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.5);
}
.nav-avatar-initial {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  border: 2px solid rgba(255,255,255,.5);
  color: #fff;
  font-size: .85rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Inline player avatar (standings, lobbies, winner cards) ──────── */
.player-avatar {
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--border);
}
.player-avatar-initial {
  border-radius: 50%;
  background: linear-gradient(155deg, var(--green-mid), var(--green-dark));
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--border);
}

/* Active nav item */
.nav-dropdown-item.active {
  color: var(--green);
  font-weight: 700;
  background: var(--green-light);
}


/* ── Profile page ────────────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: auto auto;
  gap: 1rem;
  align-items: start;
}
.profile-avatar-card { grid-row: 1 / 3; }
.avatar-preview { display: flex; justify-content: center; margin-bottom: .5rem; }
.avatar-img {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}
.avatar-placeholder {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--green-mid), var(--green-dark));
  color: #fff;
  font-size: 2.5rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
@media (max-width: 600px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-avatar-card { grid-row: auto; }
}

/* ── Drag-to-reorder pick order ─────────────────────────────────── */
.drag-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.drag-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .75rem;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: grab;
  user-select: none;
}
.drag-item.dragging { opacity: .4; cursor: grabbing; }
.drag-handle { color: var(--text-muted); font-size: 1rem; cursor: grab; touch-action: none; padding: .2rem .4rem; }

/* ── Game lobby ─────────────────────────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
  align-items: stretch;
}
/* Direct grid children are the per-game-type accent wrapper divs (see home.ejs) —
   stretch them, then stretch .game-card inside to fill, so every card in a row
   matches height regardless of how much text a given game type has. */
.games-grid > div { display: flex; }
.game-card {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  flex: 1;
  position: relative;
  overflow: hidden;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s ease;
}
.game-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--green);
}
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.game-card:active { transform: translateY(-1px) scale(.985); transition: transform .06s ease; }
.game-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.game-card-name { font-size: 1.08rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.game-card-tournament { font-size: .84rem; margin: .2rem 0 0; }
.game-card-meta { font-size: .82rem; }
.game-card-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; padding-top: .35rem; }
.game-type-badge { font-size: .7rem; font-weight: 700; padding: .22rem .55rem; border-radius: 20px; white-space: nowrap; letter-spacing: -.005em; }
.game-type-golf       { background: var(--green-light); color: var(--green-dark); }
.game-type-lms         { background: var(--gold-light); color: var(--gold-dark); }
.game-type-scorecard   { background: #e5f1fb; color: #1c5a8a; }

/* Per game-type accent stripe on the card's left edge */
.accent-lms .game-card::before       { background: var(--gold); }
.accent-scorecard .game-card::before { background: #2f7cb3; }

/* ── Golf Scorecard: hole score colours (gross vs par) — semantic, unchanged ── */
.score-eagle  { background: #fde68a; color: #78350f; font-weight: 700; border-radius: 4px; padding: .05rem .3rem; }
.score-birdie { background: #fecaca; color: #7f1d1d; font-weight: 700; border-radius: 4px; padding: .05rem .3rem; }
.score-par    { background: #bfdbfe; color: #1e3a8a; border-radius: 4px; padding: .05rem .3rem; }
.score-bogey  { background: #bbf7d0; color: #14532d; border-radius: 4px; padding: .05rem .3rem; }
.score-double { background: #e5e7eb; color: #1f2937; border-radius: 4px; padding: .05rem .3rem; }
.score-other  { background: #111827; color: #fff; border-radius: 4px; padding: .05rem .3rem; }

/* ── Last Man Standing (semantic result colours unchanged) ────────── */
.lms-eliminated td { opacity: .55; }
.lms-pick-cell { white-space: nowrap; font-size: .82rem; }
.lms-pick { padding: .15rem .4rem; border-radius: 4px; font-size: .78rem; font-weight: 600; display: inline-block; }
.lms-pick.win    { background: #d1fae5; color: #065f46; }
.lms-pick.loss   { background: #fee2e2; color: #991b1b; }
.lms-pick.draw   { background: #fef3c7; color: #92400e; }
.lms-pick.pending { background: #f3f4f6; color: #374151; }
.lms-pick.no-pick { background: #fee2e2; color: #991b1b; font-style: italic; }

.lms-fixture {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .5rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
}
.lms-fixture:last-child { border-bottom: none; }
.lms-fixture-vs { text-align: center; }

.lms-team-btn {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .8rem;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: center;
  width: 100%;
}
.lms-team-btn:hover:not([disabled]) { border-color: var(--green); background: var(--green-light); }
.lms-team-btn.selected { border-color: var(--green); background: var(--green-light); color: var(--green-dark); }
.lms-team-btn.lms-team-used, .lms-team-btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ── Nav dropdown ───────────────────────────────────────────────── */
.nav-dropdown { position: relative; }

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: .45rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: #fff;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  padding: .3rem .65rem .3rem .3rem;
  border-radius: 999px;
  transition: background .15s;
}
.nav-dropdown-trigger:hover { background: rgba(255,255,255,.18); }
.nav-username { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-caret { font-size: .68rem; opacity: .75; }

.nav-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + .5rem);
  min-width: 185px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  z-index: 100;
  padding: .35rem;
}
.nav-dropdown-menu.open { display: block; }

.nav-dropdown-item {
  display: block;
  width: 100%;
  padding: .55rem .7rem;
  font-size: .87rem;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  white-space: nowrap;
}
.nav-dropdown-item:hover { background: var(--green-light); color: var(--green-dark); text-decoration: none; }
.nav-dropdown-btn { width: 100%; }
.nav-dropdown-divider { height: 1px; background: var(--border); margin: .35rem .3rem; }

/* ── Tournament list (create page) ─────────────────────────────── */
.tournament-list { display: flex; flex-direction: column; gap: .3rem; max-height: 340px; overflow-y: auto; }
.tournament-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem .8rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.tournament-row:hover { border-color: var(--green); background: var(--green-light); }
.tournament-row.selected { border-color: var(--green); background: var(--green-light); }
.tournament-row-info { display: flex; flex-direction: column; gap: .1rem; }
.tournament-row-name { font-weight: 700; font-size: .9rem; }
.tournament-row-check { color: var(--green); font-weight: 700; font-size: 1rem; }
.form-label { font-size: .82rem; font-weight: 700; color: var(--text); }

/* ── Winners Club ───────────────────────────────────────────────── */
.winners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.1rem;
  margin-top: .9rem;
}
.winner-card {
  background: linear-gradient(180deg, #fffdf6 0%, var(--card-bg) 22%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  text-decoration: none;
  color: var(--text);
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s ease;
  position: relative;
  overflow: hidden;
}
.winner-card::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), #f2dfa6, var(--gold));
}
.winner-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); text-decoration: none; }
.winner-card-tournament { display: flex; flex-direction: column; gap: .15rem; }
.winner-card-name { font-weight: 800; font-size: .98rem; letter-spacing: -.01em; }
.winner-card-prizes { display: flex; flex-direction: column; gap: .5rem; border-top: 1px solid var(--border); padding-top: .7rem; }
.winner-entry { display: flex; align-items: center; gap: .5rem; font-size: .87rem; }
.winner-trophy {
  font-size: .82rem;
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold-light);
  border-radius: 50%;
}
.winner-label { color: var(--text-muted); font-size: .77rem; flex-shrink: 0; }
.winner-name { font-weight: 800; color: var(--green-dark); }

/* ── Profile stats ─────────────────────────────────────────────── */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .88rem;
  padding: .15rem 0;
}

/* ── Player world rank in draft ─────────────────────────────────── */
.player-rank {
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 400;
}

/* ── Hall of fame ───────────────────────────────────────────────── */
.hof-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
}
.hof-table th {
  text-align: left;
  padding: .6rem .8rem;
  background: var(--green-light);
  color: var(--green-dark);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid var(--border);
}
.hof-table td {
  padding: .7rem .8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.hof-table tbody tr:last-child td { border-bottom: none; }
.hof-table tbody tr:hover { background: var(--green-light); }

/* ── Responsive ────────────────────────────────────────────────── */

/* Leaderboard table: scrollable on small screens */
.leaderboard-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 600px) {
  /* General spacing */
  main { padding: 1rem .75rem; }
  .card { padding: 1rem; }

  /* Page header actions: stack vertically */
  .page-header { display: flex; flex-direction: column; align-items: flex-start; }

  /* Leaderboard table */
  .leaderboard-table { font-size: .82rem; }
  .leaderboard-table td { padding: .7rem .5rem; }
  .leaderboard-table th { padding: .6rem .5rem; }
  /* Hide "Best player" column (5th) on the Golf Draft team standings table only —
     scoped narrowly so it doesn't eat a column from other leaderboard-table uses
     (e.g. LMS's weekly picks, or Golf Scorecard's per-player scoring grid) */
  .team-standings-table th:nth-child(5),
  .team-standings-table td:nth-child(5) { display: none; }

  /* Squads: single column */
  .squads-grid { grid-template-columns: 1fr; }
  .games-grid  { grid-template-columns: 1fr; }
  .winners-grid { grid-template-columns: 1fr; }
  .rules-grid { grid-template-columns: 1fr; }

  /* Draft board: horizontal scroll already set via .draft-board-wrap */
  .draft-board { min-width: 420px; font-size: .8rem; }
  .draft-board th, .draft-board td { padding: .4rem .4rem; min-width: 90px; }

  /* Player grid: 2 cols on phone */
  .player-grid { max-height: 220px; }
  .player-btn  { font-size: .8rem; padding: .35rem .65rem; }

  /* Sticky confirm pick bar on mobile */
  .pick-confirm-bar {
    position: sticky;
    bottom: 0;
    z-index: 50;
    border-radius: 0;
    box-shadow: 0 -2px 12px rgba(0,0,0,.15);
    margin: 0 -1rem;
    padding: .75rem 1rem;
  }

  /* Header: smaller logo text */
  .logo-sub { display: none; }
  .nav-username { max-width: 80px; }

  /* Auth card */
  .auth-card { padding: 1.2rem; }

  /* LMS fixture grid */
  .lms-fixture { grid-template-columns: 1fr auto 1fr; gap: .3rem; }
  .lms-team-btn { font-size: .8rem; padding: .4rem .5rem; }

  /* Touch targets — increase to be more finger-friendly */
  .btn-sm { padding: .55rem 1rem; font-size: .85rem; }
  .player-btn { padding: .55rem .85rem; font-size: .85rem; }
  .nav-dropdown-trigger { padding: .5rem .7rem; }
  .drag-handle { padding: .55rem .6rem; font-size: 1.1rem; }

  /* Profile stats: stack to single column */
  .stats-cols { grid-template-columns: 1fr !important; }

  /* Team name input: full width */
  .team-name-input { width: 100%; min-width: unset; }

  /* Nav dropdown: constrain width on narrow screens */
  .nav-dropdown-menu { min-width: 160px; }

}
/* End @media 600px */
