/* LaxForNerds 2027: shared header and new pages. Old pages load this for the header only (.hdr). */

/* ---------- header (all pages) ---------- */
.hdr { background: #fff; border-bottom: 1px solid #dcdcdc; font-family: Arial, sans-serif; text-align: left; }
.hdr-in { max-width: 1100px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 22px; box-sizing: border-box; }
.hdr-logo { display: block; line-height: 0; }
.hdr-logo img { width: 52px; height: 52px; display: block; max-width: none; }
.hdr-nav { display: flex; gap: 20px; font-size: 14px; font-weight: bold; flex: 1 1 auto; white-space: nowrap; }
.hdr-nav a, .hdr-nav a:visited { color: #1E88E5; text-decoration: none; padding: 6px 2px; border-bottom: 3px solid transparent; }
.hdr-nav a:hover { text-decoration: underline; }
.hdr-nav a[aria-current="page"] { color: #003366; border-bottom-color: #003366; }
.hdr-search { position: relative; display: flex; align-items: center; gap: 6px; border: 1px solid #ccc; border-radius: 6px; padding: 0 10px; background: #fff; height: 36px; box-sizing: border-box; }
.hdr-search input { border: 0; outline: none; font: inherit; font-size: 13px; width: 200px; background: transparent; }
.hdr-searchbtn { display: none; border: 1px solid #ccc; background: #fff; border-radius: 6px; width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; margin-left: auto; }
.hdr-results { position: absolute; top: 40px; right: 0; width: 300px; max-width: calc(100vw - 32px); background: #fff; border: 1px solid #ccc; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.15); z-index: 1000; max-height: 60vh; overflow-y: auto; }
.hdr-results a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: #000; text-decoration: none; font-size: 13px; border-bottom: 1px solid #eee; }
.hdr-results a:hover, .hdr-results a.on { background: #f0f4f8; }
.hdr-results .meta { margin-left: auto; color: #666; font-size: 11px; white-space: nowrap; }
.hdr-results .none { padding: 10px; color: #666; font-size: 12px; }
@media (max-width: 700px) {
  .hdr-in { padding: 6px 12px 0; gap: 0 12px; }
  .hdr-logo img { width: 40px; height: 40px; }
  .hdr-nav { order: 3; width: 100%; overflow-x: auto; gap: 18px; font-size: 13px; scrollbar-width: none; }
  .hdr-nav::-webkit-scrollbar { display: none; }
  .hdr-nav a { padding: 8px 0; }
  .hdr-search { display: none; }
  .hdr-searchbtn { display: inline-flex; border: 0; }
  .hdr.searching .hdr-search { display: flex; order: 2; width: 100%; margin: 6px 0; }
  .hdr.searching .hdr-search input { width: 100%; font-size: 16px; }
  .hdr.searching .hdr-results { left: 0; right: 0; width: auto; }
}

/* ---------- new pages ---------- */
body.lfn { margin: 0; background: #f9f9f9; font-family: Arial, sans-serif; font-size: 12px; color: #000; }
.lfn a { color: #1E88E5; }
.lfn a:hover { color: #003366; }
.lfn main { max-width: 1100px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 14px; box-sizing: border-box; }
.lfn h1, .lfn h2 { margin: 0; }
.lfn h2 { font-size: 14px; }
.lfn .card { background: #fff; border: 1px solid #ccc; border-radius: 6px; }
.lfn .muted { color: #555; }
.lfn .small { font-size: 11px; }
.lfn .rk { display: inline-block; min-width: 2em; font-size: .75em; color: #555; }
.lfn table { border-collapse: collapse; }
.lfn th, .lfn td { padding: 7px 10px; border: 1px solid #ccc; text-align: center; white-space: nowrap; }
.lfn th { background: #eee; }
.lfn th.sortable { cursor: pointer; }
.lfn th.asc::after { content: " ▲"; font-size: 9px; }
.lfn th.desc::after { content: " ▼"; font-size: 9px; }
.lfn .tablewrap { overflow-x: auto; }
.lfn .sticky { position: sticky; left: 0; z-index: 1; text-align: left; }
.lfn .team { font-weight: bold; text-shadow: 0.3px 0.3px 0.6px rgba(0,0,0,.2); text-align: left; }
.lfn .team a { text-decoration: none; }
.lfn .pill { font-weight: bold; padding: 3px 7px; border-radius: 4px; text-decoration: none; white-space: nowrap; display: inline-block; }
.lfn .champ { background: #F4B400; color: #000; font-size: 10px; font-weight: bold; padding: 1px 5px; border-radius: 3px; margin-left: 4px; }
.lfn .traj { color: #fff; font-size: 10px; font-weight: bold; padding: 2px 6px; border-radius: 4px; }
.lfn .info { border: 0; background: none; color: #666; font-size: 11px; cursor: pointer; padding: 0 2px; font-family: inherit; }
.lfn .btn { background: #e0e0e0; color: #000; border: 0; border-radius: 6px; padding: 8px 14px; font: inherit; min-height: 36px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; box-sizing: border-box; }
.lfn .btn:hover { background: #ffeb84; color: #000; }
.lfn .btn.on { background: #003366; color: #fff; font-weight: bold; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; justify-content: center; }
.filters .grp { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filters .lab { font-weight: bold; margin-right: 4px; }
.filters-toggle { display: none; }
.lfn .meta { margin: 0; text-align: center; color: #444; }

/* My Teams */
.myteams { padding: 10px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.myteams h2 { font-size: 13px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.myteams .mt { display: flex; align-items: center; gap: 6px; text-decoration: none; color: #000; border: 1px solid #e3e3e3; border-radius: 6px; padding: 4px 8px 4px 4px; }
.myteams .hint { color: #555; font-size: 11px; margin-left: auto; }

/* Movers */
.movers { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.movers .head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.movers .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 28px; }
.movers .col { display: flex; flex-direction: column; gap: 5px; }
.movers .mv { display: flex; align-items: center; gap: 8px; }
.movers .ch { color: #444; font-variant-numeric: tabular-nums; }
.movers .d { margin-left: auto; font-weight: bold; font-variant-numeric: tabular-nums; }
.movers .up { color: #0F7A00; }
.movers .down { color: #B00020; }
.movers .more { display: none; }

/* rankings table */
.tabs { display: flex; border-bottom: 1px solid #ccc; background: #f4f4f4; }
.tabs a { border-bottom: 3px solid transparent; color: #333; font-size: 13px; font-weight: bold; padding: 12px 18px; text-decoration: none; min-height: 44px; box-sizing: border-box; display: flex; align-items: center; }
.tabs a[aria-current="page"] { border-bottom-color: #003366; background: #fff; color: #003366; }
.rtable { width: 100%; }
.rtable tr.hidden { display: none; }
.rtable .det { display: none; }
.rtable .chev { display: none; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 1px solid #e3e3e3; flex-wrap: wrap; }

/* team page */
.teambar { border-radius: 6px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-shadow: 1px 1px 2px rgba(0,0,0,.5); }
.teambar h1 { font-size: 24px; }
.teambar .sub { font-size: 13px; margin-top: 2px; }
.teambar .sub a { color: inherit; }
.teambar .acts { display: flex; gap: 8px; text-shadow: none; align-items: center; }
.teambar .act { border: 0; border-radius: 6px; padding: 8px 14px; font: inherit; font-weight: bold; min-height: 40px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.summary { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.summary .top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.summary .big { font-size: 34px; font-weight: bold; color: #003366; }
.summary .rec { font-size: 26px; font-weight: bold; }
.summary .badge { color: #fff; font-weight: bold; padding: 4px 10px; border-radius: 6px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tile { border: 1px solid #ccc; border-radius: 6px; padding: 8px 10px; }
.tile .l { font-size: 11px; color: #333; }
.tile .v { font-size: 18px; font-weight: bold; }
.history { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; max-width: 520px; }
.history .bar { position: relative; height: 6px; background: #eee; border-radius: 4px; }
.history .mid { position: absolute; left: 50%; top: 0; width: 1px; height: 100%; background: #aaa; }
.twocol { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; align-items: start; }
.twocol section, .players { display: flex; flex-direction: column; gap: 6px; }
.thead-team th { color: inherit; }
.win { background: #d4edda; }
.loss { background: #f8d7da; }
.sectabs { display: none; }

/* Teams index */
.tgroups { display: flex; flex-direction: column; gap: 14px; }
.tgroup { padding: 12px; }
.tgroup .list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* definitions popup */
.active-tooltip { position: fixed; background: #222; color: #fff; padding: 8px 10px; border-radius: 6px; font-size: 12px; line-height: 1.4; white-space: normal; max-width: min(280px, calc(100vw - 16px)); z-index: 10000; pointer-events: none; }

/* ---------- phones ---------- */
@media (max-width: 700px) {
  .lfn main { padding: 10px 12px 32px; gap: 10px; }
  .lfn th, .lfn td { padding: 9px 7px; }
  .filters-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 0 14px; background: #003366; color: #fff; border: 0; border-radius: 6px; font: inherit; font-weight: bold; font-size: 14px; cursor: pointer; }
  .filters { display: none; background: #fff; border: 1px solid #ccc; border-radius: 6px; padding: 12px; flex-direction: column; align-items: stretch; gap: 10px; }
  .filters.open { display: flex; }
  .filters .lab { width: 64px; }
  .filters .btn { min-height: 40px; padding: 0 12px; }
  .lfn .meta { font-size: 11px; }
  .myteams { flex-wrap: nowrap; overflow-x: auto; padding: 8px 10px; }
  .myteams .mt { white-space: nowrap; border-radius: 18px; }
  .myteams .hint { display: none; }
  .movers .cols { gap: 4px 14px; }
  .movers .ch { display: none; }
  .movers .col .mv:nth-child(n+4) { display: none; }
  .movers.all .col .mv:nth-child(n+4) { display: flex; }
  .movers .more { display: block; align-self: flex-start; background: none; border: 0; padding: 6px 0; color: #1E88E5; font: inherit; font-weight: bold; cursor: pointer; }
  .tabs a { flex: 1; justify-content: center; padding: 0 8px; }
  /* rankings: rank, team and two numbers; the rest opens under the row */
  .rtable .wide { display: none; }
  .rtable .chev { display: table-cell; padding: 0; width: 40px; }
  .rtable .chev button { width: 40px; height: 40px; border: 0; background: none; font-size: 14px; color: #555; cursor: pointer; }
  .rtable td, .rtable th { border-left: 0; border-right: 0; }
  .rtable .team { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
  .rtable tr.open + tr.det { display: table-row; }
  .rtable .det td { background: #f6f8fb; text-align: left; white-space: normal; padding: 8px 12px; }
  .rtable .det .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
  .teambar { padding: 10px 8px 10px 14px; }
  .teambar h1 { font-size: 21px; }
  .teambar .act .lbl { display: none; }
  .teambar .act { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .summary { padding: 12px; gap: 10px; }
  .summary .big { font-size: 32px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .twocol { grid-template-columns: minmax(0, 1fr); }
  /* team page: one section at a time */
  .sectabs { display: flex; background: #fff; border: 1px solid #ccc; border-radius: 6px; overflow: hidden; }
  .sectabs button { flex: 1; border: 0; background: #fff; color: #333; font: inherit; font-weight: bold; min-height: 44px; cursor: pointer; }
  .lfn [data-sec] { display: none; }
  .lfn [data-sec].shown { display: flex; }
}
