:root {
  --ice: #f1f6ee;          /* chalk-white field card bg */
  --ice-2: #e3edda;
  --navy: #0a3a1f;         /* deep end-zone green (primary dark) */
  --navy-2: #114a2a;
  --steel: #2f8f4e;        /* mid field green (secondary) */
  --red: #c8362b;          /* penalty-flag action red */
  --red-dk: #97271f;
  --silver: #c7d3e0;
  --ink: #10261a;
  --gold: #e2b34a;         /* yard-marker gold */
  --cream: #f5edd8;
  --cream-2: #eef3e6;
  --field: #0d5c2f;
  --brown: #7a4a24;        /* pigskin */
  --line: rgba(10, 58, 31, 0.14);
  --shadow: 0 12px 34px rgba(8, 40, 22, 0.30);
  --serif: "Georgia", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    repeating-linear-gradient(90deg, transparent 0 119px, rgba(255,255,255,.025) 119px 120px),
    radial-gradient(1200px 640px at 50% -8%, #115e32 0%, var(--field) 55%, #07401f 100%) fixed;
  background-color: var(--field);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1000px; margin: 0 auto; padding: 22px 18px 70px; }
.hidden { display: none !important; }

/* ---------- Arcade cross-promo bar ---------- */
.arcade-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 7px; margin: 0 0 6px; padding: 7px 4px 12px;
  border-bottom: 1px solid rgba(245, 237, 216, 0.1);
}
.arcade-tag {
  font-family: var(--sans); font-size: 10.5px; font-weight: 800;
  letter-spacing: 2px; text-transform: uppercase; color: var(--gold);
}
.arcade-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(245, 237, 216, 0.06);
  border: 1px solid rgba(245, 237, 216, 0.15);
  color: #f5edd8; text-decoration: none;
  font-family: var(--serif); font-weight: 800; font-size: 13px;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.arcade-link i {
  font-style: normal; font-family: var(--sans); font-weight: 700;
  font-size: 9px; letter-spacing: 1px; text-transform: uppercase; opacity: .55;
}
.arcade-link:hover {
  background: rgba(245, 237, 216, 0.13);
  border-color: var(--gold); transform: translateY(-1px);
}
.arcade-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 620px) {
  .arcade-tag { width: 100%; text-align: center; margin-bottom: 1px; }
  .arcade-link { font-size: 12px; padding: 4px 9px; }
  .arcade-link i { display: none; }
}

/* ---------- Masthead ---------- */
.masthead { text-align: center; padding: 14px 0 20px; position: relative; }
.logo-btn {
  appearance: none; background: none; border: none; padding: 0; cursor: pointer;
  display: inline-block; line-height: 0; transition: transform .12s;
}
.logo-btn:hover { transform: scale(1.04); }
.logo-btn:active { transform: scale(.98); }
.ball {
  width: 116px; height: 116px; display: inline-block;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.4));
}
.home-btn {
  position: absolute; left: 0; top: 18px; z-index: 5;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.10); color: var(--ice);
  border: 1px solid rgba(255,255,255,.20); border-radius: 999px;
  padding: 9px 16px; font-family: var(--sans); font-weight: 800; font-size: 13px;
  cursor: pointer; transition: background .15s, transform .08s;
}
.home-btn:hover { background: rgba(255,255,255,.20); }
.home-btn:active { transform: translateY(1px); }
.home-btn svg { display: block; }
@media (max-width: 520px) {
  .home-btn { top: 14px; padding: 8px 12px; font-size: 0; gap: 0; }
  .home-btn svg { width: 18px; height: 18px; }
}
.tagline {
  color: var(--gold); font-weight: 800; letter-spacing: 3px;
  font-size: 12px; text-transform: uppercase; margin-top: 8px;
}

/* ---------- Panels ---------- */
.panel {
  background: var(--ice);
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.5);
  position: relative;
  overflow: hidden;
}
.panel::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px;
  background: linear-gradient(90deg, var(--field), var(--gold));
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: none; cursor: pointer; font-family: var(--sans);
  font-weight: 800; letter-spacing: .4px; border-radius: 999px;
  padding: 13px 26px; font-size: 15px; transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 6px 0 var(--red-dk); }
.btn-red:hover { background: #d8453a; }
.btn-red:active { box-shadow: 0 2px 0 var(--red-dk); }
.btn-navy { background: var(--navy); color: var(--ice); }
.btn-navy:hover { background: var(--navy-2); }
.btn-ghost { background: #fff; color: var(--navy); border: 2px solid var(--line); }
.btn-ghost:hover { background: var(--ice-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-lg { padding: 17px 38px; font-size: 18px; }

/* ---------- Intro ---------- */
.intro { padding: 32px 30px 34px; text-align: center; }
.intro h2 { font-family: var(--serif); font-size: 27px; color: var(--navy); margin-bottom: 10px; }
.intro p { color: #2f4636; max-width: 600px; margin: 0 auto 12px; line-height: 1.6; }
.rules { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin: 24px 0 26px; text-align: left; }
.rule { background: #fff; border-radius: 12px; padding: 16px; border: 1px solid var(--line); }
.rule .num { font-family: var(--serif); font-weight: 800; color: var(--red); font-size: 22px; }
.rule h4 { color: var(--navy); margin: 6px 0 4px; font-size: 15px; }
.rule p { font-size: 13px; color: #50664f; margin: 0; }
.load-note { color: #44604c; font-size: 13px; margin-top: 14px; }

/* ---------- Mode indicator ---------- */
.modeIndicator {
  display: inline-block; background: rgba(255,255,255,.12); color: var(--ice);
  font-weight: 800; font-size: 13px; letter-spacing: .5px; padding: 7px 16px;
  border-radius: 999px; margin: 0 auto 14px; border: 1px solid rgba(255,255,255,.18);
}
#game { text-align: center; }

/* ---------- Board layout ---------- */
.board { display: grid; grid-template-columns: 330px 1fr; gap: 16px; text-align: left; }
@media (max-width: 760px) { .board { grid-template-columns: 1fr; } }

.lineup-panel { padding: 16px; }
.play-panel { padding: 20px; min-height: 360px; }

/* ---------- Bar ---------- */
.bar { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.bar-item { display: flex; flex-direction: column; }
.bar-item .k { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: #50664f; font-weight: 700; }
.bar-item .v { font-size: 14px; font-weight: 800; color: var(--navy); }

/* ---------- Lineup board ---------- */
.lineup { display: flex; flex-direction: column; gap: 6px; }
.slot {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 11px; min-height: 48px; transition: background .15s, border-color .15s;
}
.slot .pos {
  flex: 0 0 44px; text-align: center; font-weight: 800; font-size: 12px;
  color: #fff; background: var(--navy); border-radius: 7px; padding: 6px 0;
}
.slot.filled .pos { background: var(--steel); }
.slot[data-slot="K"] .pos, .slot[data-slot="DST"] .pos { background: var(--brown); }
.slot .nm { font-weight: 800; color: var(--ink); font-size: 14px; }
.slot .meta { font-size: 11px; color: #50664f; }
.slot .statline { font-size: 11px; color: #3f5a47; font-weight: 700; margin-top: 2px; }
.slot .empty { color: #5c7660; font-size: 13px; font-style: italic; }
.slot .ov { margin-left: auto; font-weight: 800; color: var(--navy); font-size: 18px; text-align: right; line-height: 1; }
.slot .ov small { display: block; font-size: 8px; letter-spacing: 1px; color: #5c7660; }
.slot.target { border-color: var(--red); background: #fff6f4; box-shadow: 0 0 0 2px rgba(200,54,43,.18); }

.slot.openslot { cursor: pointer; }
.slot.openslot:hover { border-color: var(--steel); background: #f1faf2; }
.slot .slot-filter { margin-left: auto; color: #b6cab9; font-size: 18px; font-weight: 700; opacity: 0; transition: opacity .12s; }
.slot.openslot:hover .slot-filter { opacity: 1; }
.slot.filtering { border-color: var(--steel); background: #ebf7ed; box-shadow: 0 0 0 2px rgba(47,143,78,.25); }
.slot.filtering .slot-filter { opacity: 1; color: var(--steel); }
.slot.filtering .pos { background: var(--steel); }

/* ---------- Reels ---------- */
.reels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.reel {
  background: var(--navy); border-radius: 12px; padding: 16px 12px; text-align: center;
  border: 2px solid var(--navy-2); overflow: hidden; position: relative;
}
.reel-label { color: var(--gold); font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 800; margin-bottom: 8px; }
.reel-val { color: var(--ice); font-family: var(--serif); font-weight: 800; font-size: 22px; line-height: 1.15; min-height: 52px; display: flex; align-items: center; justify-content: center; }
.reel.spin .reel-val { animation: flick .07s linear infinite; opacity: .85; }
@keyframes flick { 0% { transform: translateY(-2px); } 50% { transform: translateY(2px); } 100% { transform: translateY(-2px); } }

.play-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }

/* ---------- Candidate cards ---------- */
.cands { margin-top: 18px; }
.cands-title { font-weight: 800; color: var(--navy); font-size: 15px; margin-bottom: 12px; text-align: center; }
.cands-title .filter-hint { font-weight: 600; color: #5c7660; font-size: 12px; font-style: italic; }
.filter-clear {
  appearance: none; border: none; cursor: pointer; font-family: var(--sans);
  background: var(--steel); color: #fff; font-weight: 800; font-size: 11px;
  padding: 4px 11px; border-radius: 999px; margin-left: 6px; letter-spacing: .3px;
  vertical-align: middle;
}
.filter-clear:hover { background: #36a259; }
.cards-empty {
  grid-column: 1 / -1; text-align: center; color: #50664f; font-size: 14px;
  padding: 22px 14px; background: #fff; border: 1px dashed var(--line); border-radius: 12px;
}
.cards-empty .filter-clear { margin-top: 8px; display: inline-block; }
.sortbar { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 14px; }
.sortbar .sortchip { border: 1px solid var(--line); background: var(--ice-2); color: var(--navy); font-family: var(--sans); font-weight: 800; font-size: 12.5px; padding: 6px 13px; border-radius: 999px; cursor: pointer; }
.sortbar .sortchip:hover { border-color: var(--gold); }
.sortbar .sortchip.active { background: var(--navy); color: var(--gold); border-color: var(--navy); }
.sortbar .sortchip .caret { font-size: 10px; opacity: .9; }

/* Row-list candidate cards */
.cards { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.pcard {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto;
  grid-template-areas: "tag info metrics"; column-gap: 12px; align-items: center;
  padding: 11px 14px; background: #fff; border-bottom: 1px solid var(--line);
  cursor: pointer; text-align: left; width: 100%; transition: background .1s;
  position: relative; appearance: none; border-left: none; border-right: none; border-top: none;
  border-radius: 0; font-family: var(--sans);
}
.pcard:last-child { border-bottom: none; }
.pcard:hover { background: rgba(226,179,74,.12); }
.pcard .pos-tag {
  grid-area: tag; display: flex; align-items: center; justify-content: center;
  background: var(--navy); color: #fff; font-size: 10px; font-weight: 800;
  padding: 4px 6px; border-radius: 6px; letter-spacing: .6px; min-width: 38px; flex-shrink: 0;
}
.pos-QB  { background: #b8432e !important; }
.pos-RB  { background: #2f8f4e !important; }
.pos-WR  { background: #2b6cb0 !important; }
.pos-TE  { background: #8a5cc0 !important; }
.pos-K   { background: #c89a3a !important; color: #20180a !important; }
.pos-DST { background: #4a5568 !important; }
.pcard .pcard-info { grid-area: info; min-width: 0; }
.pcard .nm { font-weight: 800; font-size: 15px; color: var(--ink); line-height: 1.15; margin: 0; }
.pcard .yr { font-size: 11px; color: #5b6f5e; margin: 1px 0 0; font-weight: 700; }
.pcard .ln { font-size: 11px; color: #44604c; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .pcard-metrics { grid-area: metrics; display: flex; gap: 12px; flex-shrink: 0; align-items: center; }
.pcard .met { text-align: center; min-width: 36px; }
.pcard .met .mv { font-weight: 800; font-size: 16px; color: var(--navy); line-height: 1; }
.pcard .met .ml { font-size: 9px; color: #6b7d6b; text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }
.pcard .met.pct .mv { color: var(--red); }
.pcard .met.cost .mv { color: #1c5a3a; }
.pcard .met.cost .ml { color: #4f8a68; }
.pcard.hidden-stats .pcard-metrics, .pcard.hidden-stats .ln { filter: blur(5px); }

/* ---------- Budget meter (Jets Mode) ---------- */
.game-budget { max-width: 520px; margin: 0 auto 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.gb-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.gb-spent { font-weight: 800; font-size: 20px; color: var(--navy); }
.gb-spent.over { color: var(--red); }
.gb-remain { font-size: 13px; font-weight: 700; color: #50664f; }
.gb-track { height: 9px; background: var(--ice-2); border-radius: 999px; overflow: hidden; }
.gb-meter { height: 100%; width: 0; background: var(--steel); border-radius: 999px; transition: width .25s; }
.gb-meter.warn { background: var(--brown); }

/* ---------- Position filter chips (posbar) ---------- */
.posbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; justify-content: center; }
.poschip { border: 1px solid var(--line); background: var(--cream-2); color: var(--navy); font-family: var(--sans); font-weight: 800; font-size: 12px; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.poschip:hover { border-color: var(--gold); }
.poschip.active { background: var(--navy); color: var(--gold); border-color: var(--navy); }
.cands-count { font-size: 12px; color: #4f6450; margin: 0 0 8px; letter-spacing: .2px; text-align: center; }

/* ---------- Result ---------- */
.result { padding: 30px 28px 34px; text-align: center; }
.record { font-family: var(--serif); font-weight: 800; font-size: 84px; color: var(--field); line-height: 1; }
.record .l { color: var(--brown); }
.points { margin-top: 4px; font-weight: 800; font-size: 15px; letter-spacing: 1.5px; color: var(--navy); opacity: .6; }
.points span { font-weight: 700; opacity: .8; }
.vtag { display: inline-block; margin: 10px 0 4px; font-weight: 800; letter-spacing: 1px; font-size: 18px; padding: 8px 22px; border-radius: 999px; background: var(--gold); color: var(--navy); }
.vtag.perfect { background: var(--brown); color: #fff; }
.vtag.tank { background: #4a5568; color: #fff; }
.vtag.jets { background: #1c5a3a; color: var(--gold); }
.weak.jets { background: rgba(28,90,58,.10); border-color: rgba(28,90,58,.30); color: #1c5a3a; }
.vline { color: #2f4636; max-width: 520px; margin: 8px auto 0; line-height: 1.5; }
.boxscore { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin: 22px 0; }
.bs { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 6px; }
.bs .k { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: #50664f; font-weight: 700; }
.bs .v { font-size: 22px; font-weight: 800; color: var(--navy); }
.weak { background: #fff6f4; border: 1px solid rgba(200,54,43,.25); border-radius: 10px; padding: 11px 14px; color: #7a2a23; font-size: 13px; margin: 4px 0 18px; }
.weak.ringer { background: #eef4ff; border-color: rgba(43,108,176,.3); color: #1d4a73; }
.roster-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 22px; }
@media (max-width: 520px) { .roster-strip { grid-template-columns: repeat(2,1fr); } .boxscore { grid-template-columns: repeat(2,1fr); } }
.rs-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: left; }
.rs-card .p { font-size: 10px; font-weight: 800; color: var(--field); letter-spacing: .5px; }
.rs-card .n { font-weight: 800; color: var(--ink); font-size: 14px; line-height: 1.15; margin-top: 2px; }
.rs-card .s { font-size: 11px; font-weight: 800; color: var(--navy); margin-top: 2px; }
.rs-card .m { font-size: 11px; color: #50664f; margin-top: 2px; }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: var(--ice); padding: 12px 22px; border-radius: 999px;
  font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  box-shadow: var(--shadow); z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.foot { text-align: center; color: rgba(241,246,238,.45); font-size: 12px; margin-top: 26px; }
.foot a { color: rgba(241,246,238,.8); font-weight: 700; text-decoration: none; border-bottom: 1px solid rgba(226,179,74,.5); }
.foot a:hover { color: var(--gold); }

/* ---------- Mode toggle ---------- */
.mode-toggle { display: inline-flex; flex-wrap: wrap; justify-content: center; background: #fff; border-radius: 14px; padding: 5px; gap: 4px; margin: 6px 0 20px; border: 1px solid var(--line); }
.mode-toggle button { border: none; background: transparent; padding: 9px 16px; border-radius: 999px; font-weight: 800; cursor: pointer; color: var(--navy); font-size: 13px; font-family: var(--sans); transition: background .15s, color .15s; }
.mode-toggle button:hover { background: var(--ice-2); }
.mode-toggle button.on { background: var(--navy); color: var(--ice); }

/* ---------- Daily card ---------- */
.daily-card { padding: 20px 22px; margin-top: 16px; text-align: left; }
.dc-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.dc-num { font-family: var(--serif); font-weight: 800; font-size: 30px; color: var(--red); flex: 0 0 auto; }
.dc-title { font-family: var(--serif); font-weight: 800; color: var(--navy); font-size: 19px; }
.dc-desc { font-size: 13px; color: #4c6350; margin-top: 3px; line-height: 1.45; }
.dc-result { background: var(--ice-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 14px; color: var(--navy); margin-bottom: 12px; }
.dc-share { margin-left: 8px; border: 1px solid var(--line); background: transparent; color: var(--navy); font-family: var(--sans); font-weight: 800; font-size: 11px; padding: 4px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.dc-share:hover { border-color: var(--gold); }
.dc-result .rk { color: var(--red); }
.daily-card .btn { width: 100%; }

/* ---------- Challenge card (head-to-head) ---------- */
.challenge-card { padding: 20px 22px; margin-top: 16px; text-align: center; border: 2px solid rgba(200,54,43,.4); }
.cc-text { color: var(--navy); font-size: 15px; line-height: 1.55; margin-bottom: 14px; }
.cc-text b { color: var(--red); }
.challenge-card .btn { width: 100%; }
.vs { display: flex; flex-direction: column; gap: 2px; background: var(--navy); color: var(--ice); border-radius: 12px; padding: 12px 18px; margin: 12px auto 4px; max-width: 420px; }
.vs b { font-size: 17px; }
.vs span { font-size: 13px; color: rgba(241,246,238,.75); }

/* ---------- Constraint banner ---------- */
.constraint-banner { background: rgba(226,179,74,.16); border: 1px solid rgba(226,179,74,.5); color: var(--cream); border-radius: 12px; padding: 11px 16px; font-size: 13px; line-height: 1.45; margin-bottom: 14px; text-align: center; }
.constraint-banner b { color: var(--gold); }

/* ---------- Daily leaderboard panel ---------- */
.lb { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 4px 0 20px; text-align: left; }
.lb-title { font-family: var(--serif); font-weight: 800; color: var(--navy); font-size: 16px; margin-bottom: 12px; text-align: center; }
.lb-you { background: var(--navy); color: var(--ice); border-radius: 10px; padding: 10px 14px; font-size: 14px; text-align: center; margin-bottom: 12px; }
.lb-list { display: flex; flex-direction: column; gap: 3px; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 14px; }
.lb-row:nth-child(odd) { background: #f1f7ee; }
.lb-row.me { background: rgba(226,179,74,.22); font-weight: 800; }
.lb-rank { flex: 0 0 28px; font-weight: 800; color: #50664f; }
.lb-name { flex: 1; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-wl { font-weight: 800; color: var(--navy); }
.lb-join { display: flex; gap: 8px; margin-bottom: 6px; }
.lb-join input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; font-size: 14px; font-family: var(--sans); }
.lb-join .btn { padding: 10px 20px; }
.lb-note { font-size: 12px; color: #56705a; text-align: center; margin-top: 8px; }
.lb-loading, .lb-err { text-align: center; color: #50664f; padding: 14px; font-size: 14px; }
.lb-err { color: var(--red); }

/* ---------- Result mode switcher ---------- */
.again-label { color: #56705a; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; margin: 22px 0 10px; }
.again-modes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.amode { border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 999px; padding: 9px 16px; font-weight: 800; font-size: 13px; cursor: pointer; font-family: var(--sans); transition: background .15s; }
.amode:hover { background: var(--ice-2); }
.amode.cur { background: var(--navy); color: var(--ice); border-color: var(--navy); }
.modeIndicator.daily { background: rgba(226,179,74,.22); color: var(--gold); border-color: rgba(226,179,74,.4); }

/* ---------- Mode goal subtitle (in-game) ---------- */
.mode-goal { font-size: 12px; color: #bfe0c8; margin: 3px auto 0; letter-spacing: .2px; text-align: center; max-width: 520px; line-height: 1.45; }
.mode-goal:empty { display: none; }

/* ---------- Mobile layout reorder: play-panel before lineup-panel ---------- */
@media (max-width: 760px) {
  .board { display: flex; flex-direction: column; }
  .play-panel { order: 1; }
  .lineup-panel { order: 2; }
}

/* ---------- Sticky roster dock ---------- */
.roster-dock { position: fixed; bottom: 0; left: 0; right: 0; background: var(--navy); border-top: 1px solid rgba(245,237,216,.15); padding: 10px 12px env(safe-area-inset-bottom, 8px); display: flex; gap: 6px; overflow-x: auto; z-index: 40; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.roster-dock::-webkit-scrollbar { display: none; }
.roster-dock.hidden { display: none; }
.rd-slot { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; min-width: 40px; padding: 4px 6px; border-radius: 8px; border: 1px solid rgba(245,237,216,.18); background: rgba(245,237,216,.06); cursor: default; }
.rd-slot.filled { background: rgba(226,179,74,.18); border-color: rgba(226,179,74,.45); }
.rd-slot.target { outline: 2px solid var(--gold); outline-offset: 1px; }
.rd-slot .rd-pos { font-size: 9px; font-weight: 800; letter-spacing: .8px; color: var(--gold); text-transform: uppercase; line-height: 1; }
.rd-slot .rd-name { font-size: 9px; color: rgba(245,237,216,.7); margin-top: 2px; max-width: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.rd-slot.filled .rd-name { color: var(--cream); }
body.has-dock { padding-bottom: 76px; }

@media (max-width: 480px) {
  .pcard { column-gap: 8px; padding: 10px 11px; }
  .pcard .pos-tag { min-width: 32px; padding: 3px 4px; }
  .pcard .pcard-metrics { gap: 8px; }
  .pcard .met { min-width: 28px; }
  .pcard .met .mv { font-size: 15px; }
  .pcard .nm { font-size: 14px; }
}

/* ---------- Keyboard focus visibility ---------- */
button:focus-visible, input:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.home-btn:focus-visible, .logo-btn:focus-visible { outline-color: var(--gold); }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (min-width: 761px) {
  .roster-dock { display: none; }
  body.has-dock { padding-bottom: 0; }
}

/* ---------- Leaderboard modal ---------- */
.lb-open-btn { position: absolute; top: 0; right: 0; background: var(--gold); color: var(--navy); border: none; border-radius: 20px; padding: 8px 14px; font-weight: 800; font-size: 13px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.22); z-index: 5; }
.lb-open-btn:hover { filter: brightness(1.06); }
.lb-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.82); z-index: 60; align-items: center; justify-content: center; padding: 16px; }
.lb-overlay.show { display: flex; }
.lb-modal { background: var(--ice); border: 1px solid var(--line); border-radius: 16px; max-width: 460px; width: 100%; max-height: 86vh; overflow: auto; padding: 18px; }
.lb-mhead { display: flex; justify-content: space-between; align-items: center; }
.lb-mhead h3 { font-weight: 800; color: var(--navy); font-size: 22px; margin: 0; }
.lb-mclose { background: none; border: none; color: var(--gold); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.lb-msub { font-size: 12px; letter-spacing: .5px; text-transform: uppercase; color: var(--steel); margin: 2px 0 14px; }
.lb-msub-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 14px; }
.lb-msub-row .lb-msub { margin: 0; }
/* Score detail — tap a leaderboard row to see the roster behind it */
.detail-overlay { z-index: 70; } /* stacks over the leaderboard modal (60) */
.lb-row.lb-click { cursor: pointer; }
.lb-row.lb-click:hover { background: rgba(226,179,74,.18); }
.lb-row.me.lb-click:hover { background: rgba(226,179,74,.36); }
.lb-row.lb-click::after { content: "›"; color: #9db4a1; font-weight: 800; flex: none; }
.lb-row.me.lb-click::after { color: var(--navy); }
#detailBody .roster-strip { margin: 10px 0 4px; }
/* Modal tabs (Today's Daily / All-Time) + the all-time mode chips */
.lb-tabs { display: flex; gap: 8px; margin: 10px 0 8px; }
.lb-tabs button {
  flex: 1; border: 1px solid var(--line); background: var(--cream-2); color: var(--navy);
  font-family: var(--sans); font-weight: 800; font-size: 13px; padding: 8px 10px;
  border-radius: 999px; cursor: pointer;
}
.lb-tabs button:hover { border-color: var(--gold); }
.lb-tabs button.on { background: var(--navy); color: var(--gold); border-color: var(--navy); }
.lb-modes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.lb-modes button {
  border: 1px solid var(--line); background: var(--cream-2); color: var(--navy);
  font-family: var(--sans); font-weight: 800; font-size: 12px; padding: 5px 11px;
  border-radius: 999px; cursor: pointer;
}
.lb-modes button:hover { border-color: var(--gold); }
.lb-modes button.on { background: var(--red); color: #fff; border-color: var(--red); }
.lb-dim { color: var(--steel); font-weight: 500; }
/* ===== Arcade-bar controls — Home + Leaderboard live in the top arcade bar ===== */
.arcade-bar .home-btn,
.arcade-bar .lb-open-btn {
  position: static; inset: auto; z-index: auto;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 5px 12px;
  font-family: var(--sans); font-weight: 800; font-size: 12.5px; line-height: 1;
  white-space: nowrap; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, filter .15s ease, transform .15s ease;
}
.arcade-bar .home-btn {
  background: rgba(245,237,216,.08); color: #f5edd8;
  border: 1px solid rgba(245,237,216,.28); box-shadow: none;
}
.arcade-bar .home-btn:hover { background: rgba(245,237,216,.16); border-color: var(--gold); transform: translateY(-1px); }
.arcade-bar .home-btn svg { width: 15px; height: 15px; display: block; }
.arcade-bar .lb-open-btn {
  background: var(--gold); color: var(--navy); border: 1px solid var(--gold);
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
}
.arcade-bar .lb-open-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
@media (max-width: 560px) {
  .arcade-bar .home-btn span { display: none; }
  .arcade-bar .home-btn { padding: 6px 9px; }
}
