/* Player Explorer (js/player-explorer.js). Phone and iPad-upright rules are
   in css/mobile.css with the rest of the phone layout. */
#player-explorer-overlay .trend-modal { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; padding: 0.9rem 1.25rem 0.5rem; display: flex; flex-direction: column; box-sizing: border-box; }
#player-explorer-overlay .pe-head-note { font-size: 0.72rem; color: var(--text2); background: var(--surface2, #f0f0eb); border: 1px solid var(--border); border-radius: 5px; padding: 0.2rem 0.5rem; }
#player-explorer-root { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }

.pe { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pe-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.9rem; padding: 0.2rem 0 0.5rem; }
.pe-ctl { display: flex; align-items: center; gap: 0.35rem; }
.pe-ctl[hidden] { display: none; }   /* Type (Reg. Season / Playoffs) until the season has a playoff game */
.pe-ctl > label { font-size: 0.64rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text3); }
.pe select, .pe input[type=number], .pe input[type=search], .pe input[type=date] { font-family: inherit; font-size: 0.8rem; border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.45rem; background: var(--surface); color: var(--text); }
.pe input[type=search] { width: 160px; }
.pe-range { display: none; }
.pe-range.open { display: flex; align-items: center; gap: 0.35rem; }
.pe-range span { font-size: 0.75rem; color: var(--text3); }
.pe-pills { display: flex; gap: 0.25rem; }
.pe-pills button { font-family: inherit; font-size: 0.74rem; padding: 0.28rem 0.6rem; border: 1px solid var(--border); border-radius: 5px; color: var(--text2); background: var(--surface); cursor: pointer; white-space: nowrap; }
.pe-pills button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pe-pills button:disabled { opacity: 0.4; cursor: default; }

.pe-views { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; flex: none; }
.pe-views::-webkit-scrollbar { display: none; }
.pe-views button { font-family: inherit; font-size: 0.8rem; font-weight: 500; padding: 0.5rem 0.85rem; border: none; border-bottom: 3px solid transparent; background: none; color: var(--text2); cursor: pointer; white-space: nowrap; }
.pe-views button.on { color: var(--navy, #00205B); border-bottom-color: var(--oilers-orange, #D14520); font-weight: 600; }

.pe-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; padding: 0.5rem 0; min-height: 2.4rem; }
.pe-chips { display: contents; }
.pe-chip { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.74rem; background: var(--accent-light); color: var(--accent); border: 1px solid #b8d2f2; border-radius: 999px; padding: 0.15rem 0.3rem 0.15rem 0.6rem; font-weight: 500; }
.pe-chip button { border: none; background: none; color: var(--accent); cursor: pointer; font-size: 0.95rem; line-height: 1; padding: 0 0.2rem; }
.pe-add-filter { font-family: inherit; font-size: 0.74rem; border: 1px dashed var(--text3); border-radius: 999px; padding: 0.2rem 0.65rem; background: none; color: var(--text2); cursor: pointer; }
.pe-fe { display: none; align-items: center; gap: 0.3rem; }
.pe-fe.open { display: inline-flex; }
/* Right-click on a mouse, press-and-hold on a touch screen; hidden while the + Stat filter row is open. */
.pe-filter-hint { font-size: 0.74rem; color: var(--text2); }
.pe-fe.open + .pe-filter-hint { display: none; }
.pe-hint-touch { display: none; }
@media (hover: none) { .pe-hint-mouse { display: none; } .pe-hint-touch { display: inline; } }
.pe-fe input { width: 80px; }
.pe-ok { font-family: inherit; font-size: 0.74rem; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 6px; padding: 0.3rem 0.6rem; cursor: pointer; }
.pe-count { margin-left: auto; font-size: 0.72rem; color: var(--text3); }

.pe-table-wrap { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--border); border-radius: 8px; overscroll-behavior: contain; }
.pe-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.pe-table thead th { position: sticky; top: 0; z-index: 2; background: var(--navy, #00205B); color: #fff; font-weight: 600; font-size: 0.7rem; padding: 0.45rem 0.55rem; text-align: center; white-space: nowrap; cursor: pointer; user-select: none; }
.pe-table thead th.l { text-align: center; }
.pe-table thead th.pe-s2 { text-align: left; }
.pe-table thead th.sorted::after { content: " \25BE"; }
.pe-table thead th.sorted.asc::after { content: " \25B4"; }
.pe-table tbody td { padding: 0.36rem 0.55rem; text-align: center; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.pe-table tbody td.l { text-align: center; }
.pe-table tbody td.pe-s2 { text-align: left; }
.pe-table tbody tr { cursor: pointer; }
.pe-table tbody tr:hover td { background-color: #f7f9fc; }
.pe-table tbody tr.sel td { background-color: var(--accent-light); }
.pe-table td.good, .pe-log td.good { background: var(--good-bg); color: var(--good-text); font-weight: 600; }
.pe-table td.bad, .pe-log td.bad { background: var(--bad-bg); color: var(--bad-text); font-weight: 600; }
.pe-table tbody tr:hover td.good { background: #bfcde0; }
.pe-table tbody tr:hover td.bad { background: #ddbbbb; }
.pe-s1, .pe-s2 { position: sticky; z-index: 1; background: var(--surface); }
.pe-table thead .pe-s1, .pe-table thead .pe-s2 { z-index: 3; background: var(--navy, #00205B); }
.pe-s1 { left: 0; width: 34px; min-width: 34px; color: var(--text3); }
.pe-s2 { left: 34px; border-right: 1px solid var(--border); }
.pe-name { font-weight: 600; }
.pe-edm .pe-name { }
.pe-team { display: inline-flex; align-items: center; gap: 0.3rem; }
.pe-logo { width: 16px; height: 16px; background-size: contain; background-repeat: no-repeat; background-position: center; display: inline-block; flex-shrink: 0; }
.pe-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pe-traded { font-size: 0.64rem; color: var(--text3); margin-left: 0.2rem; }
.pe-msg { padding: 1.5rem !important; color: var(--text3); text-align: left !important; }
.pe-foot { padding: 0.45rem 0 0.2rem; font-size: 0.68rem; color: var(--text3); display: flex; gap: 1.2rem; flex-wrap: wrap; }
.pe-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 0.25rem; }
.pe-sw.good { background: var(--good-bg); }
.pe-sw.bad { background: var(--bad-bg); }

/* Player card: a side drawer (a full-screen sheet on a phone) */
.pe-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.18); opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 300; }
.pe-scrim.open { opacity: 1; pointer-events: auto; }
.pe-card { position: fixed; top: var(--hdr-h, 0px); right: 0; bottom: 0; width: min(680px, 100vw); background: var(--surface); box-shadow: -6px 0 24px rgba(0, 0, 0, 0.15); transform: translateX(100%); transition: transform 0.18s; z-index: 301; display: flex; flex-direction: column; }
.pe-card:not(.open) { visibility: hidden; transition: transform 0.18s, visibility 0s 0.18s; }
.pe-card.open { transform: none; }
.pe-ch { padding: 0.9rem 1.25rem 0.75rem; background: var(--navy, #00205B); color: #fff; display: flex; align-items: flex-start; gap: 0.9rem; border-bottom: 3px solid var(--oilers-orange, #D14520); }
.pe-ch .num { font-size: 1.9rem; font-weight: 700; line-height: 1; opacity: 0.9; }
.pe-ch .who { min-width: 0; flex: 1; }
.pe-ch .nm { font-size: 1.2rem; font-weight: 700; }
.pe-ch .meta { font-size: 0.74rem; opacity: 0.82; margin-top: 0.2rem; white-space: nowrap; overflow: hidden; }
.pe-x { margin-left: auto; background: none; border: 1px solid rgba(255, 255, 255, 0.4); color: #fff; border-radius: 6px; padding: 0.3rem 0.65rem; cursor: pointer; font-family: inherit; flex-shrink: 0; }
.pe-cb { flex: 1; overflow-y: auto; padding: 1rem 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; overscroll-behavior: contain; }
.pe-st { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text3); margin-bottom: 0.45rem; }
.pe-st small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.pe-dim { color: var(--text3); font-size: 0.8rem; }
.pe-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.pe-tile { border: 1px solid var(--border); border-radius: 8px; padding: 0.55rem 0.65rem; }
.pe-tile .k { font-size: 0.66rem; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.pe-tile .v { font-size: 1.2rem; font-weight: 700; margin: 0.1rem 0 0.35rem; font-variant-numeric: tabular-nums; }
.pe-tile .pc { font-size: 0.64rem; color: var(--text3); margin-top: 0.25rem; }
.pe-bar { height: 5px; background: var(--grid); border-radius: 3px; overflow: hidden; }
.pe-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.pe-bar i.good { background: var(--good-text); }
.pe-bar i.bad { background: var(--bad-text); }
.pe-mini-wrap, .pe-log-wrap { border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; }
.pe-mini, .pe-log { width: 100%; border-collapse: collapse; font-size: 0.76rem; font-variant-numeric: tabular-nums; }
.pe-mini th, .pe-log th { background: var(--surface2, #f0f0eb); color: var(--text2); font-size: 0.64rem; font-weight: 600; padding: 0.35rem 0.5rem; text-align: center; white-space: nowrap; position: sticky; top: 0; }
.pe-mini td, .pe-log td { padding: 0.32rem 0.5rem; text-align: center; border-top: 1px solid var(--grid); white-space: nowrap; }
.pe-mini .l, .pe-log .l { text-align: left; }
.pe-mini th.l, .pe-log th.l { text-align: left; }
.pe-log tr.flash td { animation: pe-flash 1.6s ease-out; }
@keyframes pe-flash { 0%, 40% { background: #fff3c4; } 100% { background: transparent; } }
.pe-chart { border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.6rem 0.35rem; position: relative; }
.pe-chart svg { display: block; width: 100%; height: 140px; cursor: pointer; }
.pe-bar-r.up { fill: #8fb0d9; }
.pe-bar-r.down { fill: #d9a3a3; }
.pe-bar-r.hl { fill-opacity: 1; stroke: var(--navy, #00205B); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.pe-mid { stroke: #bbb; stroke-dasharray: 4 4; }
.pe-roll { fill: none; stroke: var(--navy, #00205B); stroke-width: 2; }
.pe-tip { position: absolute; top: 0.4rem; z-index: 2; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); padding: 0.4rem 0.55rem; font-size: 0.72rem; line-height: 1.35; pointer-events: none; white-space: nowrap; }
.pe-lg { display: flex; gap: 1rem; font-size: 0.66rem; color: var(--text2); margin-top: 0.3rem; flex-wrap: wrap; }
.pe-lg i { display: inline-block; width: 12px; height: 3px; vertical-align: middle; margin-right: 0.3rem; }
.pe-lg i.up { background: #8fb0d9; }
.pe-lg i.down { background: #d9a3a3; }
.pe-lg i.roll { background: var(--navy, #00205B); }

/* Line Combos */
.pe.pe-mode-combos .pe-filters, .pe.pe-mode-combos #pe-pos, .pe.pe-mode-combos .pe-search { display: none; }
.pe.pe-mode-combos .pe-ctl:has(#pe-pos),
.pe.pe-mode-combos .pe-ctl:has(#pe-min), .pe.pe-mode-combos .pe-ctl:has(#pe-team) { display: none; }
.pe-combos { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: 0.5rem; }
.pe-combos[hidden], .pe-table-wrap[hidden] { display: none; }
.pe-cb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.8rem; padding-bottom: 0.5rem; }
.pe-btn { font-family: inherit; font-size: 0.75rem; padding: 0.3rem 0.65rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; }
.pe-btn:hover { border-color: var(--accent); color: var(--accent); }
.pe-btn.sm { font-size: 0.68rem; padding: 0.15rem 0.45rem; }
.pe-cb-err { padding: 0.3rem 0; }
.pe-cb-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px 1fr; gap: 0.9rem; }
.pe-cb-rail { overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem; display: flex; flex-direction: column; gap: 0.7rem; overscroll-behavior: contain; }
.pe-cb-rg { display: flex; flex-wrap: wrap; gap: 0.3rem; align-content: flex-start; }
.pe-cb-rg .pe-st { width: 100%; margin-bottom: 0.1rem; }
.pe-cb-hint { font-size: 0.68rem; line-height: 1.35; }
.pe-cb-chip { display: inline-flex; gap: 0.25rem; align-items: center; font-size: 0.74rem; padding: 0.22rem 0.5rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: grab; user-select: none; }
.pe-cb-chip b { color: var(--text3); font-weight: 600; }
.pe-cb-chip.placed { opacity: 0.45; }
.pe-cb-chip.sel { border-color: var(--accent); background: var(--accent-light); color: var(--accent); opacity: 1; }
.pe-cb-board { overflow-y: auto; display: flex; flex-direction: column; gap: 0.55rem; padding-right: 0.2rem; overscroll-behavior: contain; }
.pe-cb-unit { border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.6rem; }
.pe-cb-uh { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.pe-cb-label { font-weight: 700; color: var(--navy, #00205B); width: 2.6rem; font-size: 0.8rem; }
.pe-cb-slot { min-width: 8.5rem; font-size: 0.78rem; padding: 0.3rem 0.55rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface2, #f0f0eb); cursor: pointer; }
.pe-cb-slot b { color: var(--text3); }
.pe-cb-slot.empty { border-style: dashed; color: var(--text3); text-align: center; background: none; }
.pe-cb-slot.over { border-color: var(--accent); background: var(--accent-light); }
.pe-cb-acts { margin-left: auto; display: inline-flex; gap: 0.35rem; align-items: center; }
.pe-cb-vid { font-family: inherit; font-size: 0.72rem; border: 1px solid var(--border); border-radius: 6px; padding: 0.2rem 0.3rem; background: var(--surface); }
.pe-cb-res { margin-top: 0.4rem; display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.pe-cb-row { display: flex; gap: 0.6rem; }
.pe-cb-row .k { width: 9rem; flex-shrink: 0; color: var(--text2); font-weight: 600; }
.pe-cb-row.sub .k { font-weight: 400; }
.pe-cb-row.sub { color: var(--text2); }
.pe-good-t { color: var(--good-text); }
.pe-bad-t { color: var(--bad-text); }
.pe-cb-sugg { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.pe-cb-sugg .pe-st { width: 100%; }
.pe-cb-pick { font-family: inherit; font-size: 0.74rem; padding: 0.25rem 0.55rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; }
.pe-cb-pick span { color: var(--text3); }
.pe-cb-pick:hover { border-color: var(--accent); }
.pe-table td.pe-clip { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.pe-table td.pe-clip:hover { color: var(--accent); }
.pe.pe-mode-combos .pe-foot { display: none; }

/* Card: actions, panels, note, linemates / opponents */
.pe-card-acts { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pe-panel { border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem; margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; background: var(--surface2, #f0f0eb); font-size: 0.78rem; }
.pe-panel .pe-st { width: 100%; margin-bottom: 0; }
.pe-panel textarea { width: 100%; font-family: inherit; font-size: 0.8rem; border: 1px solid var(--border); border-radius: 6px; padding: 0.4rem; box-sizing: border-box; }
.pe-panel input, .pe-panel select { font-family: inherit; font-size: 0.8rem; border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.45rem; background: var(--surface); }
.pe-panel.pe-saved { color: var(--good-text); background: var(--good-bg); border-color: var(--good-bg); }
.pe-note { border-left: 3px solid var(--oilers-orange, #D14520); padding: 0.3rem 0 0.3rem 0.6rem; font-size: 0.8rem; }
.pe-mates { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }

/* Movers */
.pe-movers { flex: 1; min-height: 0; overflow-y: auto; padding-top: 0.5rem; }
.pe-movers[hidden] { display: none; }
.pe.pe-mode-movers .pe-filters, .pe.pe-mode-movers .pe-foot { display: none; }
.pe.pe-mode-movers .pe-controls > :not(.pe-mp-ctl):not(.pe-per-ctl) { display: none; }
.pe-movers-list { display: flex; flex-direction: column; gap: 0.3rem; }
.pe-mover { font-size: 0.8rem; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-left-width: 4px; border-radius: 6px; cursor: pointer; }
.pe-mover.up { border-left-color: var(--good-text); }
.pe-mover.down { border-left-color: var(--bad-text); }
.pe-mover.up .pe-mv-arrow { color: var(--good-text); }
.pe-mover.down .pe-mv-arrow { color: var(--bad-text); }
.pe-mv-stat { font-weight: 600; color: var(--navy, #00205B); margin: 0 0.25rem; }
.pe-mv-foot { font-size: 0.7rem; margin-top: 0.6rem; }

/* Print sheet: the card alone on one portrait page (printSheet lays it out
   off screen with .pe-print-measure, then zooms it to fit). */
#pe-print-root { display: none; font-family: 'Rubik', sans-serif; color: #000; box-sizing: border-box; }
#pe-print-root.pe-print-measure { display: flex; position: fixed; left: -20000px; top: 0; }
#pe-print-root { flex-direction: column; gap: 0.6rem; }
#pe-print-root .pe-print-head { font-size: 1.1rem; font-weight: 700; border-bottom: 2px solid #00205B; padding-bottom: 0.2rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
#pe-print-root .pe-print-head span { font-size: 0.65rem; font-weight: 400; color: #555; }
#pe-print-root .pe-tiles { grid-template-columns: repeat(3, 1fr); }
#pe-print-root .pe-mates { grid-template-columns: 1fr 1fr; }
#pe-print-root .pe-mini-wrap, #pe-print-root .pe-log-wrap { overflow: visible; }
#pe-print-root .pe-log, #pe-print-root .pe-mini { font-size: 0.68rem; }
#pe-print-root .pe-log th, #pe-print-root .pe-log td { padding: 0.2rem 0.35rem; }
#pe-print-root svg { height: 110px; }
#pe-print-root .pe-chart .pe-lg { font-size: 0.6rem; }
@media print {
  body.pe-print-mode > *:not(#pe-print-root) { display: none !important; }
  body.pe-print-mode #pe-print-root { display: flex; position: static; width: 715px !important; }
  body.pe-print-mode #pe-print-root section, body.pe-print-mode #pe-print-root .pe-log-wrap { break-inside: avoid; }
  body.pe-print-mode { background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
}

/* 5v5 Selector (its own tab, and Line Combos' Full split): with or without
   you. The page takes .pe-mode-combos, so the same controls hide. */
.pe-selector .pe-cb-chip { cursor: pointer; }
.pe-sp-ord { font-style: normal; font-size: 0.62rem; font-weight: 700; color: var(--accent); }
.pe-sp-slots { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.55rem; }
.pe-sp-slot { display: inline-flex; align-items: center; gap: 0.3rem; cursor: default; background: var(--accent-light); border-color: var(--accent); }
.pe-sp-mv, .pe-sp-x { border: 0; background: none; cursor: pointer; color: var(--text3); font: 600 0.9rem/1 inherit; padding: 0 0.15rem; }
.pe-sp-mv:hover, .pe-sp-x:hover { color: var(--accent); }
.pe-sp-empty-hint { font-size: 0.8rem; line-height: 1.45; max-width: 46rem; }
.pe-sp-inline { margin-top: 0.45rem; }
.pe-sp-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.3rem; font-size: 0.72rem; }
.pe-btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
/* The column count changes with how many players are picked, so a plain
   table that scrolls sideways inside its box, never the page. */
.pe-sp-wrap { overflow-x: auto; }
.pe-sp-table { border-collapse: collapse; width: 100%; font-size: 0.76rem; font-variant-numeric: tabular-nums; }
.pe-sp-table th { font-size: 0.66rem; font-weight: 700; color: var(--text2); padding: 0.25rem 0.45rem; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
.pe-sp-table th.l, .pe-sp-table td.l { text-align: left; }
.pe-sp-hn { text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 600; }
.pe-sp-table td { padding: 0.28rem 0.45rem; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
.pe-sp-table td b { color: var(--text3); font-weight: 600; }
.pe-sp-table tbody tr:nth-child(even) td { background: var(--surface2, #f0f0eb); }
/* Which players are on and off is the row's whole point: "w/o" reads dimmed. */
.pe-sp-table td.pe-sp-wo { color: var(--text3); }
/* All of them on: the row the selection was made for, findable at 32 rows. */
.pe-sp-table tr.pe-sp-all td { font-weight: 700; }
.pe-sp-table tr.pe-sp-all td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
/* A combination that never happened stays, at 0:00: its absence is the finding. */
.pe-sp-table tr.pe-sp-empty td { color: var(--text3); }
.pe-sp-table tfoot td { border-top: 2px solid var(--border); border-bottom: 0; font-weight: 700; }
.pe-sp-vc { padding: 0.12rem 0.3rem !important; }

/* Column order: drag a stat heading (js wireColumnDrag) */
.pe-table thead th.pe-drag { cursor: grab; -webkit-touch-callout: none; -webkit-user-select: none; }
.pe-table thead th.pe-dragging { opacity: 0.45; }
.pe-table thead th.pe-drop-l { box-shadow: inset 3px 0 0 var(--oilers-orange, #D14520); }
.pe-table thead th.pe-drop-r { box-shadow: inset -3px 0 0 var(--oilers-orange, #D14520); }
.pe-col-ghost { position: fixed; z-index: 1000; pointer-events: none; background: var(--navy, #00205B); color: #fff; font: 600 0.72rem 'Rubik', sans-serif; padding: 0.35rem 0.6rem; border-radius: 5px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); white-space: nowrap; }
#pe-colreset[hidden] { display: none; }

/* Print this tab (js printTab): landscape, the tab's results only */
#pe-tab-print-root { display: none; font-family: 'Rubik', sans-serif; color: #000; box-sizing: border-box; }
#pe-tab-print-root.pe-print-measure { display: block; position: fixed; left: -20000px; top: 0; }
#pe-tab-print-root .pe-tp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 2px solid #00205B; padding-bottom: 0.25rem; margin-bottom: 0.5rem; font-size: 0.95rem; }
#pe-tab-print-root .pe-tp-head span { font-size: 0.65rem; color: #555; white-space: nowrap; }
#pe-tab-print-root .pe-table { width: 100%; font-size: 0.72rem; }
#pe-tab-print-root .pe-table thead th { position: static; cursor: default; padding: 0.3rem 0.4rem; }
#pe-tab-print-root .pe-table tbody td { padding: 0.22rem 0.4rem; text-decoration: none; }
#pe-tab-print-root .pe-table tbody tr { break-inside: avoid; }
#pe-tab-print-root .pe-table .pe-s1, #pe-tab-print-root .pe-table .pe-s2 { position: static; }
#pe-tab-print-root .pe-cb-board, #pe-tab-print-root .pe-cb-main, #pe-tab-print-root .pe-movers-list { display: block; overflow: visible; }
#pe-tab-print-root .pe-cb-unit, #pe-tab-print-root .pe-mover { break-inside: avoid; margin-bottom: 0.4rem; }
#pe-tab-print-root .pe-sp-table { width: 100%; }
@media print {
  body.pe-tabprint-mode > *:not(#pe-tab-print-root) { display: none !important; }
  body.pe-tabprint-mode { background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.pe-tabprint-mode #pe-tab-print-root { display: block; position: static; width: 975px !important; }
  body.pe-tabprint-mode #pe-tab-print-root thead { display: table-header-group; }
}

/* Manpower picker (SportLogiq iCE's tree) and Period pills. */
.pe-mp-ctl { position: relative; }
.pe-mp-btn { font: inherit; font-size: 0.78rem; font-weight: 600; padding: 0.22rem 0.55rem; border: 1px solid var(--pe-line, #c9ced6);
  border-radius: 6px; background: var(--pe-bg, #fff); color: inherit; cursor: pointer; white-space: nowrap; min-width: 4.5rem; text-align: left; }
.pe-mp-btn:disabled { opacity: 0.45; cursor: default; }
.pe-mp-caret { font-size: 0.65rem; opacity: 0.6; margin-left: 0.25rem; }
.pe-mp-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; background: #fff; color: #1a1f2b; border: 1px solid #c9ced6;
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.18); padding: 0.5rem 0.6rem; width: 15rem; max-height: min(70vh, 34rem);
  max-height: min(70dvh, 34rem); overflow-y: auto; font-size: 0.8rem; }
.pe-mp-pop[hidden] { display: none; }
.pe-mp-pop label { display: flex; align-items: center; gap: 0.4rem; padding: 0.16rem 0; cursor: pointer; }
.pe-mp-pop input { margin: 0; }
.pe-mp-all { font-weight: 700; border-bottom: 1px solid #e3e6eb; padding-bottom: 0.3rem !important; margin-bottom: 0.2rem; }
.pe-mp-grp { padding: 0.2rem 0; border-bottom: 1px solid #eef0f3; }
.pe-mp-gh { font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: #59607a; margin: 0.15rem 0; }
.pe-mp-row.sub { padding-left: 1.2rem !important; }
.pe-mp-note { font-size: 0.7rem; color: #6b7280; margin-top: 0.35rem; line-height: 1.3; }
.pe-cb-mp { font-weight: 600; font-size: 0.8rem; white-space: nowrap; }

/* Right-click column filter (desktop). */
.pe-colmenu { position: fixed; z-index: 400; width: 17rem; background: #fff; color: #1a1f2b; border: 1px solid #c9ced6; border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.22); padding: 0.6rem 0.7rem; font-size: 0.8rem; display: flex; flex-direction: column; gap: 0.45rem; }
.pe-cm-h { font-weight: 700; }
.pe-colmenu select, .pe-colmenu input { font: inherit; padding: 0.25rem 0.4rem; border: 1px solid #c9ced6; border-radius: 5px; min-width: 0; }
.pe-colmenu input.bad { border-color: #c0392b; }
.pe-cm-vals { display: flex; align-items: center; gap: 0.35rem; }
.pe-cm-vals input { flex: 1; }
.pe-cm-vals [hidden] { display: none; }
.pe-cm-note { font-size: 0.7rem; color: #6b7280; }
.pe-cm-btns { display: flex; flex-wrap: wrap; gap: 0.3rem; }

/* Custom tabs: the + button, rename box, the tab's own bar, sharing and the
   import strip. */
.pe-views .pe-views-custom { font-style: italic; }
.pe-views .pe-views-add { font-weight: 700; min-width: 2rem; }
/* NHL.com reports: the NHL tab's Report dropdown sits right of it in the tab bar. */
.pe-views .pe-views-nhl-sel { align-self: center; flex: none; font: inherit; font-size: 0.78rem; margin: 0 0.4rem 0 0.1rem; padding: 0.15rem 0.3rem; border: 1px solid var(--border); border-radius: 5px; background: var(--bg, #fff); color: var(--text); }
.pe-views .pe-views-nhl-sel[hidden] { display: none; }
.pe-lock-sub.pe-nhl-sub { font-weight: 500; opacity: 0.7; }
.pe-views-rename { font: inherit; font-size: 0.82rem; padding: 0.2rem 0.4rem; width: 10rem; border: 1px solid #2f6fd6; border-radius: 5px; }
.pe-custom-bar, .pe-inbox { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; font-size: 0.78rem; padding: 0.35rem 0; }
.pe-custom-bar[hidden], .pe-inbox[hidden] { display: none; }
.pe-ct-sum { font-weight: 700; }
.pe-share { flex-basis: 100%; border: 1px solid #d5dae2; border-radius: 8px; padding: 0.5rem 0.6rem; display: flex; flex-direction: column; gap: 0.4rem; }
.pe-share-list { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; max-height: 12rem; overflow-y: auto; }
.pe-share-list label { display: flex; align-items: center; gap: 0.3rem; cursor: pointer; }
.pe-inbox { flex-direction: column; align-items: stretch; }
.pe-inbox-item { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; background: #fff7dc; border: 1px solid #ecd58a; border-radius: 6px; padding: 0.35rem 0.6rem; }
.pe-inbox-item > span { flex: 1; min-width: 12rem; }
.pe-cm-sep { border-top: 1px solid #e3e6eb; margin: 0.1rem 0; }
.pe-cm-h2 { font-weight: 700; font-size: 0.74rem; color: #59607a; }
.pe-cm-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.pe-cm-in { font-size: 0.72rem; color: #6b7280; padding: 0.2rem 0.3rem; }

/* Custom tabs: the table takes only the width its columns need, from the
   left; the page scrolls sideways as usual if there are a lot of them. */
.pe-table.pe-table-fit { width: auto; }
.pe-table.pe-table-fit th, .pe-table.pe-table-fit td { padding-left: 0.7rem; padding-right: 0.7rem; }
#pe-tab-print-root .pe-table.pe-table-fit { width: auto; }

/* Locked columns (custom tabs): an orange heading with what it's locked to. */
.pe-table thead th.pe-locked { background: #cf6a17; color: #fff; }
.pe-table thead th.pe-locked.sorted { background: #b85a0f; }
.pe-lock-sub { display: block; font-size: 0.62rem; font-weight: 600; opacity: 0.92; white-space: nowrap; margin-top: 0.1rem; text-transform: none; letter-spacing: 0; }
.pe-cm-lock { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 0.5rem; align-items: center; }
.pe-cm-lock label { font-size: 0.72rem; color: #59607a; }
#pe-tab-print-root .pe-table thead th.pe-locked { background: #cf6a17 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* Each game's xGF% on its bar in the card's chart. */
.pe-chart-plot { position: relative; }
.pe-bar-lab { position: absolute; font-size: 0.62rem; font-weight: 700; line-height: 1; color: #2b4a7e; pointer-events: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pe-bar-lab.down { color: #8a3a3a; }
.pe-bar-lab.in { color: #fff; }

.pe-opp-game { font: inherit; font-size: 0.72rem; text-transform: none; letter-spacing: 0; padding: 0.1rem 0.3rem; margin-left: 0.25rem; border: 1px solid #c9ced6; border-radius: 5px; vertical-align: middle; }

/* Player card: his basic line above the Snapshot. */
.pe-statline { display: grid; grid-auto-flow: column; grid-auto-columns: auto; gap: 0.4rem; }
.pe-sl { border: 1px solid var(--border, #d5dae2); border-radius: 7px; padding: 0.35rem 0.4rem; text-align: center; }
.pe-sl .k { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text3, #6b7280); }
.pe-sl .v { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pe-sl .v small { font-size: 0.66rem; font-weight: 600; color: var(--text3, #6b7280); }
@media screen and (max-width: 700px) { .pe-statline { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); } }

/* Player card bio line; Lineup Optimizer panel. */
.pe-ch .pe-bio { font-size: 0.78rem; font-weight: 600; margin-top: 0.1rem; }
.pe-opt { border: 1px solid var(--border, #d5dae2); border-radius: 8px; padding: 0.5rem 0.7rem; margin: 0.4rem 0; display: flex; flex-direction: column; gap: 0.35rem; }
.pe-opt-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.pe-opt-ctl label { font-size: 0.64rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text3, #6b7280); }
.pe-opt-ctl input { width: 5rem; font: inherit; padding: 0.2rem 0.4rem; border: 1px solid #c9ced6; border-radius: 5px; }
.pe-opt-ctl input.bad { border-color: #c0392b; }
.pe-opt-ctl select { font: inherit; padding: 0.2rem 0.3rem; }
.pe-opt-note { font-size: 0.72rem; }
.pe-opt-res { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-size: 0.82rem; }
.pe-cb-total { font-size: 0.8rem; white-space: nowrap; align-self: center; }
/* Dropdown caret: the native arrow sat against the right edge. Our own,
   inset from the edge, on every Player Explorer select. */
#player-explorer-root select, .pe-colmenu select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.6rem center; background-size: 10px 6px;
  padding-right: 1.75rem !important;
}
.pe-snap-h { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pe-snap-mp button { font-size: 0.68rem; padding: 0.12rem 0.5rem; text-transform: none; letter-spacing: 0; }
#player-explorer-root #pe-to-cal { left: auto; right: 0; }
.pe-name .pe-num { color: var(--text3, #6b7280); font-variant-numeric: tabular-nums; }
/* Traded players: +/- beside the name, one sub-row per team (oldest first). */
.pe-exp { margin-left: 0.35rem; width: 1.15rem; height: 1.15rem; line-height: 1rem; padding: 0; border: 1px solid var(--border, #d5dae2); border-radius: 4px; background: var(--surface); color: var(--text2); font: 600 0.8rem/1 inherit; cursor: pointer; vertical-align: middle; }
.pe-exp:hover { border-color: var(--accent); color: var(--accent); }
.pe-team + .pe-team { margin-left: 0.4rem; }
.pe-table tr.pe-stint td { background: var(--surface2, #f4f5f7); font-size: 0.92em; color: var(--text2); }
.pe-table tr.pe-stint td.pe-s1, .pe-table tr.pe-stint td.pe-s2 { background: var(--surface2, #f4f5f7); }
.pe-stint-l { padding-left: 1.4rem; color: var(--text3, #6b7280); }
.pe-pick-tag { margin-left: 0.35rem; font-size: 0.68rem; font-weight: 600; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 0 0.3rem; }
.pe-table tr.pe-stint { cursor: pointer; }
.pe-table tr.pe-stint:hover td { background: var(--accent-light, #e8f0fb); }
.pe-table tr.pe-stint.on td { background: var(--accent-light, #e8f0fb); color: var(--text); font-weight: 600; }
.pe-tile { position: relative; }
.pe-tile-scope { position: absolute; top: 0.45rem; right: 0.6rem; font-size: 0.62rem; color: var(--text3, #9aa0a8); opacity: 0.8; letter-spacing: 0.02em; }

/* A player's card opened from outside the page (a recap name: openPlayerCard
   in index.html): the overlay shows only the card and its scrim, over the
   page the name was clicked on. */
#player-explorer-overlay.pe-card-only { background: transparent; pointer-events: none; z-index: 246; }
#player-explorer-overlay.pe-card-only > .trend-modal { visibility: hidden; }
#player-explorer-overlay.pe-card-only .pe-card { visibility: visible; pointer-events: auto; }
#player-explorer-overlay.pe-card-only .pe-scrim { visibility: visible; }
#player-explorer-overlay.pe-card-only .pe-scrim.open { pointer-events: auto; }
.pe-opt-out { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; align-items: center; margin: 0.35rem 0; font-size: 0.74rem; }
.pe-opt-out-g { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.pe-opt-out-g b { color: var(--text3); font-size: 0.68rem; margin-right: 0.15rem; }
.pe-opt-p { font: inherit; font-size: 0.72rem; padding: 0.1rem 0.4rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
.pe-opt-p.out { text-decoration: line-through; color: var(--bad-text, #b42318); border-color: #f1b8b3; background: #fdf0ef; }
