/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Default (light) design tokens ───────────────────────────────────────── */
:root {
  --green:       #18693a;
  --green-light: #22a35a;
  --green-muted: #d4edda;
  --red:         #c0392b;
  --red-muted:   #fde8e8;
  --gold:        #c9a227;
  --gray:        #6c757d;
  --gray-light:  #f4f6f8;
  --gray-mid:    #dee2e6;
  --white:       #ffffff;
  --text:        #1a1a1a;
  --text-muted:  #6c757d;
  --border:      #dee2e6;
  --shadow:      0 2px 8px rgba(0,0,0,.08);
  --radius:      8px;
  --font:        'Segoe UI', system-ui, sans-serif;
  --header-h:    85px; /* header height used to offset sticky nav */
}

/* ── Dark mode overrides ──────────────────────────────────────────────────── */
[data-theme="dark"] {
  --green:       #22a35a;
  --green-light: #2dcb6e;
  --green-muted: #1a3d2a;
  --red:         #e05555;
  --gray-light:  #121212;
  --gray-mid:    #2a2a2a;
  --white:       #1e1e1e;
  --text:        #e8e8e8;
  --text-muted:  #9a9ab0;
  --border:      #333344;
  --shadow:      0 2px 8px rgba(0,0,0,.4);
}

/* ── Per-major theme overrides ────────────────────────────────────────────── */
body.theme-masters { --green: #1a6b3c; --green-light: #2d9a4e; --green-muted: #d4f0dc; }
body.theme-pga     { --green: #003087; --green-light: #004bb5; --green-muted: #d4dff5; }
body.theme-usopen  { --green: #3c638e; --green-light: #4a7cb0; --green-muted: #d4e3f0; }
body.theme-theopen { --green: #1a2456; --green-light: #2d3a80; --green-muted: #d4d8f0; }

body {
  font-family: var(--font);
  background: var(--gray-light);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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


/* ===== HEADER ===== */
.site-header {
  background: #1a2035;
  color: #f5f0e8;
  padding: .65rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* mix-blend-mode: screen removes the black background (black → transparent, light content stays) */
.header-logo {
  height: 64px;
  max-height: 70px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
  mix-blend-mode: screen;
}

.header-brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  transition: opacity .15s;
}
.header-brand-link:hover { opacity: .8; text-decoration: none; }

.header-brand { display: flex; align-items: center; gap: .75rem; }
.site-title-block { display: flex; flex-direction: column; line-height: 1.15; }
/* Cream/serif display font to match logo aesthetic */
.site-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f5f0e8;
  letter-spacing: .03em;
  font-family: Georgia, 'Times New Roman', serif;
}
.site-tagline { font-size: .7rem; font-weight: 500; color: #c9a227; text-transform: uppercase; letter-spacing: .08em; }

.header-controls { display: flex; align-items: center; gap: .75rem; }

.theme-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: .95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: rgba(255,255,255,.12); }

/* Submit Picks — bright green with white border so it pops on the dark header.
   background uses !important so it overrides the later .btn { background } rule. */
.btn-picks-header {
  background: #2d9a4e !important;
  color: #ffffff !important;
  border: 1.5px solid #4dc874;
  font-size: .82rem;
  font-weight: 600;
}
.btn-picks-header:hover { background: #34b85c !important; border-color: #5de080; }

/* Standings link in admin header — !important for same reason as above */
.btn-nav-header {
  background: rgba(255,255,255,.1) !important;
  color: #f5f0e8 !important;
  border: 1px solid rgba(255,255,255,.25);
  font-size: .82rem;
}
.btn-nav-header:hover { background: rgba(255,255,255,.18) !important; }

.nav-admin-link {
  color: rgba(245,240,232,.55);
  font-size: .78rem;
  padding: .3rem .6rem;
  border-radius: 4px;
  transition: color .15s;
}
.nav-admin-link:hover { color: #f5f0e8; text-decoration: none; }
.nav-admin-link.nav-admin-active { color: #f5f0e8; font-weight: 600; }


/* ===== MAJOR NAVIGATION BAR ===== */
.major-nav {
  background: #141e32;
  border-bottom: 1px solid rgba(255,255,255,.07);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: var(--header-h);
  z-index: 49;
}
.major-nav::-webkit-scrollbar { display: none; }

.major-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  padding: 0 1rem;
  white-space: nowrap;
}

.major-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: .7rem 1rem;
  font-size: .875rem;
  font-family: var(--font);
  font-weight: 500;
  color: rgba(245,240,232,.55);
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  flex-shrink: 0;
}
.major-tab:hover { color: #f5f0e8; }
.major-tab.active { color: #f5f0e8; }

.major-tab.tab-home.active    { border-bottom-color: #c9a227; }
.major-tab.tab-masters.active { border-bottom-color: #2d9a4e; }
.major-tab.tab-pga.active     { border-bottom-color: #c9a227; }
.major-tab.tab-usopen.active  { border-bottom-color: #4a7cb0; }
.major-tab.tab-theopen.active { border-bottom-color: #c0c0c0; }
.major-tab.tab-season.active  { border-bottom-color: #c9a227; }


/* ===== MAJOR PANELS ===== */
.main-content { flex: 1; }
.major-panel { display: none; min-height: 400px; }
.major-panel.panel-active { display: block; }

.major-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.major-logo {
  height: 64px;
  max-width: 200px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.major-banner-info {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.masters-banner  { background: #f0faf3; border-left: 5px solid #1a6b3c; }
.pga-banner      { background: #eef1fa; border-left: 5px solid #003087; }
.usopen-banner   { background: #eef3fa; border-left: 5px solid #3c638e; }
.theopen-banner  { background: #eeeffe; border-left: 5px solid #1a2456; }
.season-banner   { background: #faf5e0; border-left: 5px solid #c9a227; min-height: 96px; }

.major-title  { font-size: 1.35rem; font-weight: 800; letter-spacing: .02em; line-height: 1.2; color: #1a1a2e; }
.major-detail { font-size: .82rem; font-weight: 400; color: #5a6070; }
.major-year   { font-size: .95rem; font-weight: 500; color: #5a6070; }

.major-official-link {
  margin-left: auto;
  align-self: flex-end;
  font-size: .75rem;
  font-weight: 500;
  color: #5a6070;
  text-decoration: none;
  padding: .3rem .65rem;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: var(--radius);
  white-space: nowrap;
  background: rgba(255,255,255,.55);
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.major-official-link:hover { background: rgba(255,255,255,.85); color: #1a1a2e; text-decoration: none; }
[data-theme="dark"] .major-official-link { color: var(--text-muted); background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.12); }
[data-theme="dark"] .major-official-link:hover { background: rgba(255,255,255,.14); color: var(--text); }


/* ===== YEAR TAB BAR (sits above inner day tabs) ===== */
.year-tab-bar {
  display: flex;
  gap: .4rem;
  padding: .75rem 0 .5rem;
  align-items: center;
}

.year-tab {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .3rem .85rem;
  font-size: .82rem;
  font-family: var(--font);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  letter-spacing: .03em;
}
.year-tab:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.year-tab.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.year-tab:disabled,
.year-tab.year-tab-empty {
  opacity: .4;
  cursor: not-allowed;
}


/* ===== INNER TAB BAR (Day tabs within each major) ===== */
.inner-tab-bar {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.inner-tab-bar::-webkit-scrollbar { display: none; }

.inner-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: .55rem 1rem;
  font-size: .875rem;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.inner-tab:hover { color: var(--green); background: var(--green-muted); border-radius: 4px 4px 0 0; }
.inner-tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 700; background: var(--green-muted); border-radius: 4px 4px 0 0; }

.inner-panel { display: none; }
.inner-panel.inner-panel-active { display: block; }

/* Final Payouts tab — muted grey pill style, distinct from live-data tabs */
.tab-payouts {
  color: var(--text-muted);
  background: var(--gray-light);
  border-radius: 99px;
  padding: .3rem .85rem;
  margin: .35rem .25rem .35rem 0;
  border: 1px solid var(--border);
  font-size: .8rem;
  align-self: center;
}
.tab-payouts:hover { color: var(--text); background: var(--gray-mid); }
.tab-payouts.active {
  background: #495057;
  color: #fff;
  border-color: #495057;
  border-bottom-color: #495057;
}
[data-theme="dark"] .tab-payouts { background: #2a2a2a; border-color: #444; }
[data-theme="dark"] .tab-payouts.active { background: #555; border-color: #555; }

.coming-soon {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .95rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}


/* ===== LAYOUT CONTAINER ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}


/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  font-size: .875rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  text-decoration: none;
}
.btn:hover { background: var(--gray-light); text-decoration: none; }
.btn-primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn-primary:hover { background: var(--green-light); border-color: var(--green-light); color: #fff; }
.btn-danger  { background: var(--red);   color: #fff; border-color: var(--red); }
.btn-sm  { font-size: .8rem;  padding: .3rem .7rem; }
.btn-lg  { font-size: 1rem;   padding: .65rem 1.5rem; }
.btn-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }


/* ===== FORMS ===== */
.form-row {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: 1rem;
}
.form-row label { font-size: .875rem; font-weight: 600; color: var(--text); }
.form-row input,
.form-row select,
.form-row textarea {
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: var(--font);
  background: var(--white);
  color: var(--text);
  width: 100%;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(24,105,58,.12);
}
.field-hint { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }
.required   { color: var(--red); }
.form-error {
  color: var(--red);
  font-size: .875rem;
  padding: .5rem .75rem;
  background: var(--red-muted);
  border-radius: var(--radius);
  margin-top: .5rem;
}


/* ===== HOME PAGE ===== */
.home-hero {
  text-align: center;
  padding: 2.25rem 1rem 1.25rem;
}
.home-hero-logo {
  width: 160px;
  height: 160px;
  object-fit: contain;
  border-radius: 12px;
  margin: 0 auto 1rem;
  display: block;
}
.home-title    { font-size: 1.75rem; font-weight: 800; color: var(--text); margin-bottom: .35rem; }
.home-subtitle { color: var(--text-muted); font-size: 1rem; }

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.home-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}
.home-card-title {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .85rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--green);
  color: var(--green);
}

.rules-list {
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  font-size: .875rem;
  line-height: 1.45;
}

.contacts-pay-note {
  font-size: .85rem;
  font-weight: 600;
  color: var(--green);
  background: var(--green-muted);
  border-radius: var(--radius);
  padding: .5rem .75rem;
  margin-bottom: .85rem;
}
.contacts-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  font-size: .9rem;
  margin-bottom: 1.25rem;
}
.contacts-list li { line-height: 1.5; }
.contact-detail { font-size: .82rem; color: var(--text-muted); }
.contact-detail a { color: var(--green); }

.submission-count-display {
  background: var(--gray-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: .875rem;
  color: var(--text-muted);
}
.count-label { font-weight: 500; }
.count-value { font-size: 1.5rem; font-weight: 800; color: var(--green); line-height: 1; }

.home-submit-btn {
  width: 100%;
  justify-content: center;
  font-size: .95rem;
  padding: .65rem 1.25rem;
}


/* ===== SEASON PROGRESS / STATUS ===== */
.season-progress-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.season-progress-label {
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  padding-top: .1rem;
}
.season-major-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .85rem;
}
.sms-item {
  font-size: .82rem;
  padding: .2rem .65rem;
  border-radius: 99px;
  font-weight: 500;
  white-space: nowrap;
}
.sms-complete { background: var(--green-muted); color: var(--green); border: 1px solid var(--green); }
.sms-pending  { background: var(--gray-light);  color: var(--text-muted); border: 1px solid var(--border); }

/* Bonus pool projection block */
.season-payout-projection { margin-top: 1.25rem; }
.season-bp-breakdown {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.season-bp-title { font-size: .95rem; font-weight: 700; margin-bottom: .85rem; color: var(--text); }
.season-bp-rows  { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .85rem; }
.season-bp-row {
  display: flex;
  justify-content: space-between;
  font-size: .875rem;
  padding: .3rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.season-bp-row:last-child { border-bottom: none; }
.season-bp-total { font-weight: 700; font-size: .95rem; }
.season-bp-amt.populated { color: var(--green); font-weight: 600; }
.season-bp-amt.pending   { color: var(--text-muted); }
.season-bp-payouts {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: .75rem;
  border-top: 2px solid var(--gold);
}
.season-bp-payout-item { font-size: .9rem; color: var(--text); }
.season-bp-payout-item strong { color: var(--gold); font-size: 1rem; }


/* Season banner logo — sits inside the gold-bordered season-banner */
.season-banner-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.season-logo {
  height: 100px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
  mix-blend-mode: screen;
}
.season-banner-titles { display: flex; flex-direction: column; gap: .2rem; }
.season-year-sub {
  font-size: .9rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .05em;
  font-family: Georgia, 'Times New Roman', serif;
}
@media (max-width: 600px) {
  .season-logo { height: 72px; }
}


/* ===== SEASON LEADERBOARD ===== */
.season-header-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.season-pool-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 140px;
}
.pool-label  { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: .2rem; }
.pool-amount { font-size: 2.2rem; font-weight: 800; color: var(--gold); line-height: 1; }
.season-rule { font-size: .875rem; color: var(--text-muted); flex: 1; line-height: 1.5; }


/* ===== LOCK COUNTDOWN ===== */
.lock-countdown {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius);
  padding: .4rem .85rem;
  font-size: .875rem;
  color: #795548;
  margin-bottom: 1rem;
}
[data-theme="dark"] .lock-countdown { background: #2a2000; border-color: #665500; color: #ddb860; }


/* ===== PRIZE SECTION ===== */
.prize-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.section-title { font-size: 1rem; font-weight: 700; margin-bottom: .75rem; color: var(--text); }
.prize-grid    { display: flex; flex-wrap: wrap; gap: .5rem; }
.prize-item    { background: var(--gray-light); border-radius: var(--radius); padding: .35rem .75rem; font-size: .85rem; white-space: nowrap; }
.prize-item strong { color: var(--gold); }


/* ===== STATUS BAR ===== */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
  font-size: .85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: .5rem;
}
.status-right  { display: flex; align-items: center; gap: .75rem; }
.status-label  { font-weight: 600; padding: .2rem .6rem; border-radius: 99px; font-size: .8rem; }
.status-open   { background: var(--green-muted); color: var(--green); }
.status-locked { background: #fff3cd; color: #856404; }
.status-final  { background: #e2e3e5; color: #495057; border-radius: 3px; }
[data-theme="dark"] .status-locked { background: #2a2000; color: #ddb860; }
[data-theme="dark"] .status-final  { background: #2a2a2a; color: #aaaaaa; border-radius: 3px; }


/* ===== SEARCH BAR ===== */
.search-bar {
  margin-bottom: .75rem;
}
.standings-search {
  width: 100%;
  max-width: 380px;
  padding: .4rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: var(--font);
  background: var(--white);
  color: var(--text);
}
.standings-search:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(24,105,58,.1);
}


/* ===== STANDINGS TABLE ===== */
.table-wrapper {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
}
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.standings-table th {
  background: var(--green);
  color: #fff;
  padding: .6rem .75rem;
  text-align: left;
  white-space: nowrap;
  font-weight: 600;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.standings-table th.col-tier { text-align: center; }
.standings-table th.sortable { cursor: pointer; user-select: none; }
.standings-table th.sortable:hover { background: var(--green-light); }
.sort-icon { font-size: .7rem; opacity: .6; }
.standings-table th.pool-sort-asc  .sort-icon::after { content: '▲'; opacity: 1; }
.standings-table th.pool-sort-desc .sort-icon::after { content: '▼'; opacity: 1; }
.standings-table td {
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.standings-table tr:last-child td { border-bottom: none; }
.standings-table tr:hover td { background: var(--gray-light); }

/* Column widths — stretch tier columns, constrain rank/total */
.col-rank  { width: 52px;  text-align: center; }
.col-name  { min-width: 130px; }
.col-total { width: 68px;  text-align: center; font-weight: 700; }
.col-tier  { min-width: 110px; font-size: .82rem; text-align: center; padding: .35rem .4rem !important; }

/* Player name inside tier cell — always uses body text color (readable in both modes) */
.player-name-cell {
  color: var(--text);
  font-weight: 500;
  display: block;
  line-height: 1.3;
  text-align: center;
}

/* Mini card around each player+score in tier cells */
.tier-cell-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .2rem .45rem;
  min-width: 82px;
  background: var(--white);
}
/* Yellow halo: the card stays opaque so yellow only shows in the padding gap */
td.top-4-pick .tier-cell-card {
  border-color: #c8a000;
  background: var(--white);
}
[data-theme="dark"] td.top-4-pick .tier-cell-card {
  border-color: #8a7200;
  background: var(--white);
}

/* Score value inside tier and total cells */
.score-val { display: inline-block; }

/* Score color classes — only apply to the score value, not the cell */
.score-under { color: var(--green); font-weight: 700; }
.score-over  { color: var(--red);   font-weight: 700; }
.score-even  { color: #1971c2;      font-weight: 700; }   /* blue = distinct from green/red */
.score-mc    { color: var(--text-muted); font-style: italic; font-weight: 400; }

/* Dark mode score adjustments — brighter green for contrast on dark background */
[data-theme="dark"] .score-under { color: #4ade80; }
[data-theme="dark"] .score-even  { color: #4dabf7; }

/* Top-4 scoring players per entry — soft yellow highlight */
td.top-4-pick {
  background: #fffbea !important;
}
[data-theme="dark"] td.top-4-pick {
  background: #4a4200 !important;
}

/* Top-3 rank badges */
.rank-1 { color: var(--gold);  font-weight: 800; font-size: 1.05rem; }
.rank-2 { color: var(--gray);  font-weight: 700; }
.rank-3 { color: #a05a2c;      font-weight: 700; }


/* ===== TOURNAMENT SELECTION GRID ===== */
.major-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 680px;
  margin: 1.5rem auto 0;
}

.major-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  user-select: none;
}

.major-card--open {
  cursor: pointer;
  border-color: var(--mc-color);
}
.major-card--open:hover,
.major-card--open:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.13);
  outline: none;
}

.major-card--locked { opacity: .52; cursor: default; }

/* Per-major accent colors */
.major-card--masters  { --mc-color: #1a6b3c; }
.major-card--pga      { --mc-color: #003087; }
.major-card--usopen   { --mc-color: #3c638e; }
.major-card--theopen  { --mc-color: #1a2456; }

.major-card-badge {
  display: inline-block;
  background: var(--mc-color);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .2rem .65rem;
  border-radius: 4px;
  margin-bottom: .85rem;
}

.major-card-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .2rem;
  line-height: 1.3;
}

.major-card-year {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .85rem;
}

.major-card-open-label {
  display: inline-block;
  background: var(--mc-color);
  color: #fff;
  font-size: .875rem;
  font-weight: 700;
  padding: .45rem 1.1rem;
  border-radius: 6px;
}

.major-card-locked-label {
  font-size: .875rem;
  color: var(--text-muted);
}

.major-card-deadline {
  font-size: .73rem;
  color: var(--text-muted);
  margin-top: .55rem;
}

.pick-form-back {
  margin-bottom: 1rem;
  display: inline-block;
  color: var(--text-muted);
  border-color: var(--border);
  font-size: .8rem;
}

@media (max-width: 500px) {
  .major-select-grid { grid-template-columns: 1fr; }
}


/* ===== PICK FORM ===== */
.form-header    { margin-bottom: 1.5rem; }
.form-title     { font-size: 1.4rem; font-weight: 700; }
.form-deadline  { color: var(--text-muted); font-size: .875rem; margin-top: .25rem; }
.picks-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  max-width: 680px;
}
.form-section       { margin-bottom: 1.75rem; }
.form-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--green);
  color: var(--green);
}
.picks-instruction      { font-size: .875rem; color: var(--text-muted); margin-bottom: 1rem; }
.tier-picks-container   { display: flex; flex-direction: column; gap: .75rem; }
.tier-row               { display: flex; align-items: center; gap: 1rem; }
.tier-label {
  font-weight: 700;
  font-size: .875rem;
  min-width: 60px;
  color: var(--green);
  background: var(--green-muted);
  padding: .3rem .6rem;
  border-radius: 4px;
  text-align: center;
}
.tier-row select    { flex: 1; }
.form-submit-row    { margin-top: 1.5rem; }


/* ===== BANNERS (locked / success / no data) ===== */
.locked-banner, .success-banner, .no-data {
  text-align: center;
  padding: 3rem 1.5rem;
}
.locked-icon, .success-icon { font-size: 3rem; margin-bottom: 1rem; }
.locked-banner h2, .success-banner h2 { font-size: 1.5rem; margin-bottom: .5rem; }
.locked-banner p,  .success-banner p  { color: var(--text-muted); margin-bottom: 1.5rem; }


/* ===== ADMIN PANEL ===== */
.auth-panel {
  max-width: 400px;
  margin: 3rem auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.auth-panel h2 { margin-bottom: 1.25rem; font-size: 1.25rem; }
.auth-form .btn { width: 100%; justify-content: center; margin-top: .5rem; }

.admin-tabs {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
}
.tab-btn {
  background: none;
  border: none;
  padding: .6rem 1.1rem;
  font-size: .9rem;
  font-family: var(--font);
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--green); }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }

.tab-panel        { display: none; }
.tab-panel.active { display: block; }

.panel-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.panel-header h2 { font-size: 1.15rem; font-weight: 700; flex: 1; }

.card-list { display: flex; flex-direction: column; gap: .75rem; }
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.card-info h3 { font-size: 1rem; font-weight: 700; }
.card-info p  { font-size: .82rem; color: var(--text-muted); margin-top: .2rem; }
.card-actions { display: flex; gap: .5rem; flex-wrap: wrap; }


/* ===== TIERS EDITOR ===== */
.tiers-editor { display: flex; flex-direction: column; gap: 1.25rem; }
.tier-editor-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.tier-editor-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; gap: .5rem; flex-wrap: wrap; }
.tier-editor-header h3 { font-size: .95rem; font-weight: 700; color: var(--green); }
.tier-header-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.golfer-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.golfer-tag {
  background: var(--green-muted);
  color: var(--green);
  border-radius: 99px;
  padding: .25rem .75rem;
  font-size: .82rem;
  display: flex;
  align-items: center;
  gap: .35rem;
  cursor: pointer;
  user-select: none;
  border: 2px solid transparent;
  transition: border-color .15s, background .15s;
}
.golfer-tag:hover { border-color: var(--green); }
.golfer-tag--selected {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.golfer-tag--selected .remove-golfer { color: #fff; }
.golfer-tag .remove-golfer {
  cursor: pointer;
  font-weight: 700;
  opacity: .6;
  background: none;
  border: none;
  color: inherit;
  font-size: .85rem;
  padding: 0;
  line-height: 1;
}
.golfer-tag .remove-golfer:hover { opacity: 1; }
.btn-danger-outline {
  background: none;
  color: var(--red);
  border-color: var(--red);
}
.btn-danger-outline:hover { background: var(--red); color: #fff; }
.btn-remove-selected {
  background: none;
  color: var(--red);
  border-color: var(--red);
}
.btn-remove-selected:hover { background: var(--red); color: #fff; }
.add-golfer-row { display: flex; gap: .5rem; }
.add-golfer-row input { flex: 1; }
.tier-count { font-size: .8rem; font-weight: 400; color: var(--text-muted); margin-left: .4rem; }
.bulk-add-panel { margin-top: .75rem; }
.bulk-add-panel textarea { width: 100%; padding: .5rem; border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font); font-size: .875rem; resize: vertical; background: var(--white); color: var(--text); }
.bulk-add-actions { display: flex; gap: .5rem; margin-top: .5rem; }


/* ===== ADMIN PICKS TABLE ===== */
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th {
  background: var(--gray-light);
  padding: .5rem .75rem;
  text-align: left;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.admin-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--gray-light); }


/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 100;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
}
.modal.hidden, .modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  pointer-events: all;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 1.25rem; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}


/* ===== PRIZE CALCULATOR ===== */
.prize-calc table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 1rem; }
.prize-calc th, .prize-calc td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); text-align: left; }
.prize-calc th { font-weight: 700; background: var(--gray-light); }
.prize-breakdown { background: var(--gray-light); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.prize-breakdown p { margin-bottom: .35rem; font-size: .9rem; }
.prize-breakdown p:last-child { margin-bottom: 0; }
.success-picks-table { margin: 1rem auto; border-collapse: collapse; min-width: 240px; }
.success-picks-table td { padding: .35rem .75rem; font-size: .9rem; border-bottom: 1px solid var(--border); text-align: left; }
.success-tier-label { font-weight: 700; color: var(--green); width: 60px; }
.success-warning { background: #fff8e1; border: 1px solid #f0c040; border-radius: var(--radius); padding: .75rem 1rem; font-size: .875rem; color: #7a5c00; max-width: 480px; margin: 1rem auto 0; text-align: left; }
[data-theme="dark"] .success-warning { background: #2a2000; border-color: #7a5c00; color: #f0c040; }
.success-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }


/* ===== PICKS / PAYMENTS SEARCH CONTROLS ===== */
.picks-controls {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.picks-controls input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: .4rem .65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--text);
  font-size: .875rem;
}
.payments-controls {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.payments-controls input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: .4rem .65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--text);
  font-size: .875rem;
}
.payments-controls select {
  padding: .4rem .65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--text);
  font-size: .875rem;
}

/* ===== PAYMENT TRACKING ===== */
.payment-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.payment-stat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1.25rem;
  text-align: center;
  min-width: 120px;
}
.payment-stat .stat-label {
  display: block;
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .25rem;
}
.payment-stat .stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}
.payment-stat--collected { border-color: var(--green); }
.payment-stat--collected .stat-value { color: var(--green); }
.payment-stat--outstanding { border-color: #e67e22; }
.payment-stat--outstanding .stat-value { color: #e67e22; }
[data-theme="dark"] .payment-stat--outstanding .stat-value { color: #f0a060; }
.payment-row--paid td { opacity: .6; }
.payment-paid-cell { text-align: center; }
.payment-checkbox { width: 18px; height: 18px; cursor: pointer; accent-color: var(--green); }
.payment-comment {
  width: 100%;
  min-width: 150px;
  padding: .3rem .5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--text);
  font-size: .85rem;
}

/* ===== UTILITY ===== */
.hidden       { display: none !important; }
.muted        { color: var(--text-muted); font-size: .875rem; }
.loading-msg  { color: var(--text-muted); padding: 2rem; text-align: center; font-size: .95rem; }
.no-data      { color: var(--text-muted); padding: 2rem; text-align: center; }
.last-updated { font-size: .8rem; }


/* ===== STATUS LABEL IN INNER TAB BAR ===== */
.inner-tab-status {
  margin-left: auto;
  align-self: center;
  padding: 0 .75rem;
  flex-shrink: 0;
}


/* ===== TOURNAMENT POT STRIP ===== */
.tournament-pot-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem .9rem;
  padding: .45rem 1.5rem;
  background: #f0f2f5;
  border-top: 1px solid var(--border);
  border-bottom: 2px solid var(--border);
  font-size: .78rem;
  color: var(--text-muted);
}
[data-theme="dark"] .tournament-pot-strip { background: #1c1c20; }
.pot-strip-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .7rem;
  color: var(--text);
  padding: .15rem .5rem;
  background: var(--green-muted);
  border-radius: 3px;
  border: 1px solid var(--border);
}
.pot-divider { color: var(--border); }
.tournament-pot-strip strong { color: var(--gold); }


/* ===== SEARCH BAR WITH ANALYSIS BUTTON ===== */
.search-bar-with-btn {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}
.btn-analysis {
  background: var(--white);
  border: 1.5px solid var(--green);
  color: var(--green);
  font-weight: 600;
  font-size: .82rem;
  padding: .38rem .9rem;
  white-space: nowrap;
}
.btn-analysis:hover { background: var(--green-muted); }
.btn-analysis-active {
  background: var(--green) !important;
  color: #fff !important;
  border-color: var(--green) !important;
}


/* ===== PLAYER ANALYSIS VIEW ===== */
.player-analysis-view { margin-top: .5rem; }
.pa-back-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.pa-view-title { font-weight: 700; font-size: 1rem; color: var(--text); }
.pa-section-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin: 1.25rem 0 .65rem;
}
.pa-grid { display: grid; gap: 1rem; }
.pa-grid-tiers    { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.pa-grid-insights { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.pa-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.pa-card-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--green-muted);
}
.pa-subtitle { font-size: .78rem; font-weight: 400; color: var(--text-muted); }

.pa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.pa-table th {
  background: var(--gray-light);
  padding: .35rem .6rem;
  text-align: left;
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.pa-table td { padding: .4rem .6rem; border-bottom: 1px solid var(--border); }
.pa-table tr:last-child td { border-bottom: none; }
.pa-table tr.pa-top-pick td { background: #fffbea; font-weight: 600; }
[data-theme="dark"] .pa-table tr.pa-top-pick td { background: #3a3500; }

/* Ownership bar */
.pa-bar-wrap {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.pa-bar {
  height: 8px;
  background: var(--green);
  border-radius: 99px;
  min-width: 2px;
  max-width: 120px;
  flex-shrink: 0;
}

/* Unique / stacked stat display */
.pa-stat-big {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: .25rem;
  line-height: 1;
}
.pa-stat-sub  { font-size: .9rem; font-weight: 400; color: var(--text-muted); }
.pa-stat-note { font-size: .82rem; color: var(--text-muted); margin-top: .4rem; }
.pa-stacked-list {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  font-size: .875rem;
}

@media (max-width: 600px) {
  .pa-grid-tiers    { grid-template-columns: 1fr; }
  .pa-grid-insights { grid-template-columns: 1fr; }
}


/* ===== PGA SCOREBOARD TABLE ===== */
.pgasb-wrapper {
  display: inline-block;
  max-width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
}
.pgasb-table {
  width: auto;
  border-collapse: collapse;
  font-size: .875rem;
}
.pgasb-table th {
  padding: .55rem .75rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #fff;
  white-space: nowrap;
}
/* Per-tournament header colors */
.pgasb-head-masters th { background: #1a6b3c; }
.pgasb-head-pga     th { background: #003087; }
.pgasb-head-usopen  th { background: #3c638e; }
.pgasb-head-theopen th { background: #1a2456; }

.pgasb-table td {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
.pgasb-table tr:last-child td { border-bottom: none; }
.pgasb-table tr:hover td { background: var(--gray-light); }
.pgasb-table tr.pgasb-cut td { color: var(--text-muted); font-style: italic; }

.pgasb-col-pos    { width: 48px;  text-align: center; font-weight: 700; }
.pgasb-col-player { font-weight: 600; white-space: nowrap; }
.pgasb-col-total  { width: 64px;  text-align: center; font-weight: 800; }
.pgasb-col-total-border { border-left: 2px solid var(--border); border-right: 2px solid var(--border); }
.pgasb-col-round  { width: 52px;  text-align: center; }
.pgasb-col-status { width: 72px;  text-align: center; font-size: .78rem; }

/* Scoreboard controls bar */
.pgasb-controls { display: flex; gap: .5rem; align-items: center; margin-bottom: .75rem; flex-wrap: wrap; }
.pgasb-controls .standings-search { flex: 1; min-width: 160px; }
.pgasb-entry-select { padding: .45rem .75rem; border: 1px solid var(--border); border-radius: .375rem; background: var(--card-bg); color: var(--text); font-size: .875rem; min-width: 180px; max-width: 260px; }
[data-theme="dark"] .pgasb-entry-select { background: var(--card-bg); color: var(--text); }

/* Owned / Tier columns */
.pgasb-col-owned     { width: 80px; text-align: center; font-size: .8rem; white-space: nowrap; }
.pgasb-col-tier-pick { width: 64px; text-align: center; font-size: .8rem; }
.pgasb-pct           { color: var(--text-muted); font-size: .75rem; }

/* Entry filter highlight/dim */
.pgasb-entry-pick { background: rgba(251,191,36,.15) !important; }
[data-theme="dark"] .pgasb-entry-pick { background: rgba(251,191,36,.12) !important; }
.pgasb-entry-dim  { opacity: .4; }
.pgasb-tier-badge { display: inline-block; background: #003087; color: #fff; font-size: .68rem; font-weight: 700; padding: .05rem .3rem; border-radius: .2rem; margin-left: .3rem; vertical-align: middle; }

.pgasb-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.pgasb-sortable:hover { opacity: .8; }
.pgasb-sort-icon::after { content: ''; font-size: .7rem; margin-left: .25rem; opacity: .5; }
.pgasb-sort-asc  .pgasb-sort-icon::after { content: '▲'; opacity: 1; }
.pgasb-sort-desc .pgasb-sort-icon::after { content: '▼'; opacity: 1; }

.pgasb-placeholder {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}
.pgasb-loading { padding: 2rem; text-align: center; color: var(--text-muted); font-size: .9rem; }


/* ===== FINAL PAYOUTS PANEL ===== */
.fp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.fp-header-masters {
  background: linear-gradient(135deg, #1a6b3c 0%, #2d9a4e 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(26,107,60,.25);
}
.fp-header-pga {
  background: linear-gradient(135deg, #003087 0%, #1a56b0 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,48,135,.25);
}
.fp-header-usopen {
  background: linear-gradient(135deg, #1a3a6b 0%, #2e5fa3 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(26,58,107,.25);
}
.fp-header-theopen {
  background: linear-gradient(135deg, #1a1a1a 0%, #3a3a3a 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.fp-header-left { display: flex; align-items: center; gap: 1rem; }
.fp-trophy-icon { font-size: 2.5rem; line-height: 1; }
.fp-title    { font-size: 1.2rem; font-weight: 800; color: #fff; margin-bottom: .2rem; }
.fp-subtitle { font-size: .82rem; color: rgba(255,255,255,.75); }

.fp-pool-stats { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.fp-stat { display: flex; flex-direction: column; align-items: center; text-align: center; }
.fp-stat-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: rgba(255,255,255,.7); margin-bottom: .15rem; }
.fp-stat-val   { font-size: 1.3rem; font-weight: 800; color: #ffd700; line-height: 1; }

/* Tie-split info note */
.fp-tie-note {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-left: 4px solid #c9a227;
  border-radius: var(--radius);
  padding: .65rem 1rem;
  font-size: .875rem;
  color: #5a4000;
  margin-bottom: 1.25rem;
}
[data-theme="dark"] .fp-tie-note { background: #2a2000; border-color: #665500; color: #ddb860; }

/* Two-column layout for place finishers + daily winners */
.fp-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 768px) { .fp-two-col { grid-template-columns: 1fr; } }

.fp-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.fp-section-title {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
}
.fp-section-title-masters  { border-bottom-color: #1a6b3c; color: #1a6b3c; }
.fp-section-title-pga      { border-bottom-color: #003087; color: #003087; }
.fp-section-title-usopen   { border-bottom-color: #1a3a6b; color: #1a3a6b; }
.fp-section-title-theopen  { border-bottom-color: #2c2c2c; color: #2c2c2c; }
[data-theme="dark"] .fp-section-title-usopen  { color: #6fa3e0; border-bottom-color: #6fa3e0; }
[data-theme="dark"] .fp-section-title-theopen { color: #b0b0b0; border-bottom-color: #b0b0b0; }

/* Place finisher cards */
.fp-finisher-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-bottom: .75rem;
  background: var(--gray-light);
  transition: background .15s;
}
.fp-finisher-card:last-child { margin-bottom: 0; }
.fp-finisher-card.fp-tied { border-left: 3px solid #c9a227; }

.fp-finisher-top {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.fp-rank-badge {
  font-size: .95rem;
  font-weight: 700;
  white-space: nowrap;
  min-width: 72px;
}
.fp-finisher-names  { flex: 1; display: flex; flex-direction: column; gap: .1rem; }
.fp-finisher-name   { font-weight: 700; font-size: .95rem; color: var(--text); }
.fp-finisher-picksname { font-size: .78rem; color: var(--text-muted); font-style: italic; }
.fp-finisher-payout {
  font-size: 1rem;
  font-weight: 800;
  color: #1a6b3c;
  white-space: nowrap;
}
[data-theme="dark"] .fp-finisher-payout { color: #4ade80; }

/* Golfer pick chips beneath each finisher */
.fp-picks-row { margin-top: .5rem; }
.fp-picks-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.fp-pick-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: .15rem .55rem;
  font-size: .75rem;
}
.fp-pick-name  { color: var(--text-muted); }
.fp-pick-score { font-weight: 700; }
.fp-loading    { color: var(--text-muted); font-size: .875rem; padding: 1rem 0; }

/* Daily winner cards */
.fp-daily-winners { display: flex; flex-direction: column; gap: .65rem; }
.fp-daily-card {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  background: var(--gray-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem 1rem;
}
.fp-daily-card-top {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.fp-round-badge {
  font-size: .8rem;
  font-weight: 800;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  letter-spacing: .03em;
}
.fp-round-badge-masters { background: #1a6b3c; color: #fff; }
.fp-round-badge-pga     { background: #003087; color: #fff; }
.fp-winner-name   { flex: 1; font-weight: 600; font-size: .9rem; }
.fp-live-badge    { display: inline-block; background: #f59e0b; color: #000; font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: .25rem; margin-left: .4rem; vertical-align: middle; }
.fp-finisher-sub  { font-size: .8rem; color: var(--text-muted); padding: .1rem .25rem .25rem; }
.fp-winner-payout { font-weight: 800; color: #1a6b3c; font-size: .95rem; }
[data-theme="dark"] .fp-winner-payout { color: #4ade80; }


/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 1.25rem;
  font-size: .8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}


/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root { --header-h: 69px; }
  .major-tab       { padding: .65rem .8rem; font-size: .82rem; }
  .major-logo      { height: 48px; max-width: 160px; }
  .major-title     { font-size: 1.05rem; }
  .home-title      { font-size: 1.35rem; }
  .home-grid       { grid-template-columns: 1fr; }
  .inner-tab       { padding: .45rem .75rem; font-size: .82rem; }
  .season-header-bar { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .btn-nav-header   { display: none; }
  /* Admin link hidden in portrait — shown again in landscape via the block below */
  .nav-admin-link   { display: none; }
  /* Keep Submit Picks visible; shrink it so it fits alongside the theme toggle */
  .btn-picks-header { font-size: .75rem; padding: .28rem .55rem; }
  .header-logo     { height: 48px; }
  .site-name       { font-size: 1rem; }
  /* Official scoreboard link: wrap to its own row on all phone sizes in portrait */
  .major-banner         { flex-wrap: wrap; }
  .major-official-link  {
    display: block !important;
    margin-left: 0;
    align-self: auto;
    width: 100%;
    text-align: center;
    margin-top: .35rem;
    font-size: .72rem;
  }
}

/* Show Admin link when phone is in landscape */
@media (max-width: 900px) and (orientation: landscape) {
  .nav-admin-link { display: inline-block; }
}

@media (max-width: 600px) {
  :root { --header-h: 59px; }
  .site-header     { padding: .65rem .75rem; }
  .header-controls { flex-shrink: 0; gap: .4rem; }
  .header-brand-link { flex-shrink: 1; min-width: 0; overflow: hidden; }
  .header-logo     { height: 38px; }
  .site-name       { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .major-tab       { padding: .6rem .65rem; font-size: .78rem; }
  .standings-table { font-size: .8rem; }
  .standings-table th, .standings-table td { padding: .45rem .5rem; }
  .picks-form      { padding: 1rem; }
  .tier-row        { flex-direction: column; align-items: flex-start; }
  .tier-label      { min-width: auto; }
  .modal-box       { padding: 1.25rem; }
  .container       { padding: 1rem .75rem; }
  .standings-search { max-width: 100%; }
  /* Prevent wide banners/tables from causing horizontal page overflow on mobile */
  .major-panel     { overflow-x: hidden; }
  .major-logo      { flex-shrink: 1; }
}

/* ── Admin edit pick search ── */
.edit-pick-search-results {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: .5rem;
}
.edit-pick-search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .4rem;
  cursor: pointer;
  transition: background .12s;
}
.edit-pick-search-row:hover { background: var(--gray-light); }
.ep-real-name { font-weight: 600; }
.ep-picks-name { font-size: .85rem; color: var(--text-muted); }

/* ── Edit pick feature (picks.html) ── */
.edit-pick-banner {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--bg-alt, #f5f7f5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
.edit-pick-banner-label { font-size: .9rem; color: var(--text-muted); }

.edit-pick-card {
  display: block;
  padding: .85rem 1rem;
  margin-bottom: .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
}
.edit-pick-card:hover { background: var(--gray-light); }

.tier-locked-pick {
  padding: .35rem .5rem;
  color: var(--text-muted);
  font-style: italic;
}

.success-pin-reminder {
  margin: .75rem 0;
  padding: .75rem 1rem;
  background: #fffbea;
  border: 1px solid #f0c040;
  border-radius: var(--radius);
  font-size: .95rem;
}
[data-theme="dark"] .success-pin-reminder {
  background: #2a2410;
  border-color: #8a6a00;
  color: #f0d070;
}

/* ── Dark mode: home tab background matches logo black ── */
[data-theme="dark"] #panel-home { background: #000; }

/* ── Dark mode: Pool Payouts label — keep text dark for readability against light major-theme badge ── */
[data-theme="dark"] .pot-strip-label { color: #0a1535; }

/* ── Admin page: always show the back-to-leaderboard button on mobile ── */
@media (max-width: 768px) {
  .btn-back-home { display: inline-flex !important; }
}
