/* DKJB design system: tokens, layout, shared components (all pages) */
:root {
  --bg: #f3f5f8; --panel: #ffffff; --panel-2: #f7f9fb; --text: #15191e; --muted: #667080; --line: #e1e5eb;
  --accent: #c9a227; --accent-2: #a8861c; --accent-ink: #141006; --accent-soft: #f7efd2; --good: #16a35a; --good-soft: #e3f6ec;
  --blue: #2563eb; --warn: #fff4d6; --warn-ink: #6b5200; --danger: #c0392b; --danger-soft: #fde8e6;
  --chip: #eef1f5; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 14px rgba(16,24,40,.06);
  --radius: 10px; --nav: #050505; --nav-ink: #e9edf2;
  --band-low: #f3c3b8; --band-mid: #f6dfa6; --band-high: #cfe8b0; --band-top: #9fd99a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1014; --panel: #161a20; --panel-2: #1b2027; --text: #e6e9ed; --muted: #8d97a5; --line: #262c35;
    --accent: #e0b93a; --accent-2: #f0cc55; --accent-ink: #141006; --accent-soft: #3a3014; --good: #2fbf71; --good-soft: #143523;
    --blue: #6aa0ff; --warn: #3a3218; --warn-ink: #f1d68a; --danger: #ff7b6e; --danger-soft: #3d1d1b;
    --chip: #222830; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
    --nav: #000000; --nav-ink: #e9edf2;
    --band-low: #5a2a24; --band-mid: #574a20; --band-high: #34502a; --band-top: #2c6534;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 17px; } h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.muted { color: var(--muted); font-size: 12px; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 16px; }
.hidden { display: none !important; }

/* ---- top nav ---- */
.topnav { position: sticky; top: 0; z-index: 40; background: var(--nav); color: var(--nav-ink); }
.topnav .inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 0 16px; height: 54px; }
.brand { font-weight: 800; font-size: 18px; color: #fff; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.brand span { color: var(--accent); }
.topnav nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.topnav nav a { color: #b9c2cc; padding: 8px 12px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.topnav nav a:hover { color: #fff; background: rgba(255,255,255,.06); text-decoration: none; }
.topnav nav a.on { color: #fff; background: rgba(255,255,255,.1); }
.usermenu { position: relative; }
.usermenu > button { background: rgba(255,255,255,.08); color: #fff; border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 600; cursor: pointer; }
.usermenu .menu { position: absolute; right: 0; top: 40px; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); min-width: 200px; padding: 6px; display: none; }
.usermenu.open .menu { display: block; }
.usermenu .menu a, .usermenu .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px;
  color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--chip); text-decoration: none; }

/* ---- controls ---- */
button, .btn, select, input, textarea { font: inherit; color: var(--text); }
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 600; text-decoration: none; }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.big { padding: 12px 22px; font-size: 16px; border-radius: 10px; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: wait; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
label.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.seg { display: inline-flex; background: var(--chip); padding: 3px; border-radius: 9px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.switch { position: relative; width: 38px; height: 22px; display: inline-block; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--chip); font-size: 12px; }
.chip.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.badge.on { background: var(--accent-soft); color: var(--accent); }
.info { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; background: var(--chip); color: var(--muted);
  font-size: 11px; font-weight: 700; align-items: center; justify-content: center; cursor: help; flex: none; }

/* ---- cards / panels ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > .hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.card > .bd { padding: 12px 14px; }
.banner { padding: 10px 14px; border-radius: 8px; background: var(--warn); color: var(--warn-ink); }
.banner.ok { background: var(--accent-soft); color: var(--accent); }
.banner.err { background: var(--danger-soft); color: var(--danger); }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- team logos / badges ---- */
.tlogo { display: inline-block; width: 18px; height: 18px; background: center/contain no-repeat; vertical-align: -4px; flex: none; }
.tlogo.lg { width: 34px; height: 34px; } .tlogo.md { width: 24px; height: 24px; }
.tbadge { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 800;
  font-size: 8px; width: 18px; height: 18px; vertical-align: -4px; flex: none; }
.tbadge.lg { width: 34px; height: 34px; font-size: 11px; } .tbadge.md { width: 24px; height: 24px; font-size: 9px; }

/* ---- game cards (shared: home strip, optimizer games grid) ---- */
.gcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; cursor: pointer; transition: transform .08s, box-shadow .08s, opacity .15s; user-select: none; }
.gcard:hover { transform: translateY(-1px); }
.gcard .gtop { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); padding: 8px 10px 0; font-weight: 600; }
.gcard .teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 10px; gap: 6px; }
.gcard .team { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.gcard .team b { font-size: 14px; } .gcard .team .muted { font-size: 11px; }
.gcard .at { color: var(--muted); font-weight: 700; font-size: 12px; }
.gcard .gfoot { padding: 6px 10px; font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.band-low { background: var(--band-low); } .band-mid { background: var(--band-mid); } .band-high { background: var(--band-high); } .band-top { background: var(--band-top); }
.gcard.off { opacity: .38; filter: grayscale(.7); }
.gcard.sel { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---- toasts ---- */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 14px;
  box-shadow: var(--shadow); max-width: 360px; }
.toast.err { border-left-color: var(--danger); }

/* ---- footer ---- */
.footer { color: var(--muted); font-size: 12px; text-align: center; padding: 24px 16px 40px; }
.footer a { color: var(--muted); text-decoration: underline; }

@media (max-width: 700px) {
  .topnav .inner { gap: 8px; padding: 0 10px; }
  .brand { font-size: 16px; }
  .wrap { padding: 10px; }
}
@media (max-width: 700px) {
  .brand span { display: none; }
  .usermenu > button { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topnav nav a { padding: 8px 8px; }
}

/* ---- DKJB brand ---- */
.brand { gap: 0; }
.brand-img { height: 44px; width: auto; display: block; }
.brand-img.lg { height: 110px; margin: 0 auto; }
.hero-logo { width: min(360px, 80%); height: auto; display: block; margin-bottom: 14px; }
.topnav { border-bottom: 1px solid #2a2410; }
.topnav nav a.on { color: #f0cc55; background: rgba(224,185,58,.12); }
@media (max-width: 700px) { .brand-img { height: 36px; } }

/* ---- password show/hide ---- */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { width: 100%; padding-right: 42px !important; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted);
  cursor: pointer; padding: 6px; border-radius: 6px; line-height: 0; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--text); background: var(--chip); }

/* Season stats panel (Home hot players/search, optimizer player names) */
.ss-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ss-chip { border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 12px; }
.ss-chip b { display: block; font-size: 16px; }
.ss-chip .ss-up { color: var(--good); } .ss-chip .ss-down { color: var(--danger); }
.ss-log { overflow-x: auto; }
.ss-log table { width: 100%; font-size: 12px; border-collapse: collapse; }
.ss-log td, .ss-log th { padding: 4px 6px; white-space: nowrap; }
.ss-log tr.recent td { background: rgba(240, 204, 85, .08); }
.ss-log tfoot td { font-weight: 700; border-top: 1px solid var(--line); }
.ss-log .res-W { color: var(--good); } .ss-log .res-L { color: var(--danger); }

/* ---- top-right: coins pill, notifications bell, avatar menu ---- */
.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.coin-pill { display: flex; align-items: center; background: rgba(255,255,255,.08); border-radius: 999px; height: 36px; padding: 0 4px 0 12px; }
.coin-pill[hidden] { display: none; }
.coin-pill a { color: #fff; font-weight: 800; display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; text-decoration: none; }
.coin-pill a:hover { text-decoration: none; color: #f0cc55; }
.coin-pill .coin { color: #e0b93a; font-size: 13px; }
.coin-pill .sep { width: 1px; height: 18px; background: rgba(255,255,255,.18); margin: 0 6px 0 10px; }
.coin-pill .plus { width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: #8d97a5; font-size: 20px; font-weight: 700; line-height: 1; cursor: pointer; }
.coin-pill .plus.ready { color: #2fbf71; background: rgba(47,191,113,.12); }
.coin-pill .plus:hover { background: rgba(255,255,255,.1); }
.dropdown { position: relative; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 0; background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover, .dropdown.open .icon-btn { background: rgba(255,255,255,.14); }
.icon-btn .count { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #d93a3a; color: #fff;
  font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--nav); }
.icon-btn .count[hidden] { display: none; }
.avatar-btn { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: #3a3014; color: #f0cc55;
  font-weight: 800; font-size: 14px; border: 2px solid rgba(255,255,255,.12); box-sizing: border-box; }
.avatar.lg { width: 48px; height: 48px; font-size: 17px; flex: none; }
.avatar-btn:hover .avatar, .dropdown.open .avatar { border-color: #e0b93a; }
.dropdown .menu { position: absolute; right: 0; top: 46px; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); min-width: 230px; padding: 6px; display: none; z-index: 60; }
.dropdown.open .menu { display: block; }
.dropdown .menu > a, .dropdown .menu > button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px;
  color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown .menu > a:hover, .dropdown .menu > button:hover { background: var(--chip); text-decoration: none; }
.menu-user { display: flex; gap: 10px; align-items: center; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-user .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.bell-menu { width: 340px; max-width: calc(100vw - 16px); padding: 0 !important; }
.bell-menu .menu-hd { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.bell-menu .link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 12px; }
#bellList { max-height: 60vh; overflow-y: auto; }
.note { display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 13px; }
.note:hover { background: var(--chip); text-decoration: none; }
.note.unread { background: var(--accent-soft); }
.note .ico { font-size: 16px; line-height: 1.2; }
.note .nb { display: block; color: var(--muted); margin-top: 2px; }
.note .nt { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
@media (max-width: 700px) {
  .nav-right { gap: 6px; }
  .coin-pill { padding-left: 9px; height: 34px; }
  .coin-pill .sep { margin: 0 4px 0 7px; }
  .icon-btn, .avatar { width: 34px; height: 34px; }
  .dropdown.bell { position: static; }
  .bell-menu { right: 8px; left: 8px; width: auto; top: 50px; }
}
@media (max-width: 420px) { .coin-pill .sep, .coin-pill .plus { display: none; } .coin-pill { padding-right: 10px; } }

.avatar.xl { width: 80px; height: 80px; font-size: 28px; border-radius: 16px; flex: none; }
.pic-row { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
label.btn { cursor: pointer; }

/* ---- sport bar (under the main nav, like DraftKings) ---- */
.sportbar { position: sticky; top: 54px; z-index: 35; background: #1d2025; border-bottom: 1px solid #2a2f37; }
.sportbar .inner { max-width: 1400px; margin: 0 auto; display: flex; gap: 2px; overflow-x: auto; padding: 0 12px; scrollbar-width: none; }
.sportbar .inner::-webkit-scrollbar { display: none; }
.sportbar [data-sport] { position: relative; display: flex; align-items: center; gap: 7px; padding: 10px 14px; color: #e6e9ed; background: none; border: 0;
  border-bottom: 3px solid transparent; font: inherit; font-weight: 700; font-size: 14px; letter-spacing: .02em; cursor: pointer; white-space: nowrap; text-decoration: none; }
.sportbar [data-sport]:hover { background: rgba(255,255,255,.05); text-decoration: none; }
.sportbar [data-sport].on { border-bottom-color: #e0b93a; color: #f0cc55; }
.sportbar .dot { position: absolute; top: 8px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: #2fbf71; }
.sportbar .tool { margin-left: auto; color: #b9c2cc; font-weight: 600; }
.sport-logo { width: 20px; height: 20px; object-fit: contain; flex: none; }
.sport-logo.lg { width: 56px; height: 56px; }
@media (max-width: 700px) { .sportbar { top: 54px; } .sportbar [data-sport] { padding: 9px 10px; font-size: 13px; } .sportbar [data-sport] span { display: none; } .sportbar [data-sport].on span { display: inline; } }

.lock-badge { display: inline-block; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; white-space: nowrap; vertical-align: middle; }
.is-locked { opacity: .6; }
.quick a.is-locked { text-decoration: line-through; text-decoration-thickness: 1px; }
.lock-note { margin-top: 6px; font-size: 12px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }

.tlogo.head { border-radius: 50%; background-color: var(--panel-2); background-size: cover; background-position: center 20%; border: 1px solid var(--line); }

.card .hd h2 { display: flex; align-items: center; gap: 8px; }
.card .hd h2 > .sport-logo, .card .hd h2 > .tlogo { flex: none; }
.promo h2 { display: flex; align-items: center; gap: 10px; }
.promo h2 .sport-logo { vertical-align: 0; }

td.pname .tlogo.head { width: 24px; height: 24px; vertical-align: -7px; margin-right: 4px; }

/* dialogs: browsers default to black text on a white canvas; use the site's colours */
dialog { color: var(--text); background: var(--panel); border: 1px solid var(--line); }
dialog .muted { color: var(--muted); }

/* F1 team logos sit on a light disc so dark marks (Mercedes, Audi, Aston Martin, Cadillac) read in both themes */
.tlogo.f1 { background-color: #f3f5f8; background-size: 72%; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
