/* =============================================================================
   ACHL "arena tech" theme — design tokens + overrides on STHS / Bootstrap base.
   Edit :root below to retune colors, type, and radii sitewide.
   Deploy: copy this file to ACHLTheme.css before upload if you use the twin-file
   setup (see Header.php), or replace the server STHSMain-CSSOverwrite.css entirely.
   ============================================================================= */

:root {
  /*
   * Logo-adjacent palette (STHS team chrome uses #041E42; legacy footer #003087).
   * Surfaces lean navy so the shell matches sthsheader / league identity.
   */
  --achl-logo-navy: #041e42;
  --achl-logo-royal: #003087;
  --achl-logo-gold: #d4a84b;

  /* Surfaces — lifted mid-tone navy (readable; not cave-dark) */
  --achl-bg-deep: #152238;
  --achl-bg-elevated: #1a2d45;
  --achl-surface-1: #223a58;
  --achl-surface-2: #2a4668;
  --achl-border: rgba(255, 255, 255, 0.11);
  --achl-border-strong: rgba(255, 255, 255, 0.2);

  /* Brand / header — strip slightly lighter than page so menu type pops */
  --achl-header-bg: linear-gradient(180deg, #2a5080 0%, #1e4070 38%, #152a48 100%);
  --achl-header-solid: #1f3f63;
  --achl-navy: var(--achl-logo-navy);

  /* Accent — links on dark backgrounds (saturated enough to scan) */
  --achl-accent: #7cc8ff;
  --achl-accent-dim: rgba(124, 200, 255, 0.45);
  --achl-accent-text: #061018;

  /* Links on white / light grey STHS panels (WCAG contrast; never use --achl-accent here) */
  --achl-link-on-light: #003566;
  --achl-link-on-light-hover: #001f3d;
  /* Body copy on those same light panels (modals, dropdowns, dual-list, etc.) */
  --achl-text-on-light: #1a2233;
  --achl-text-muted-on-light: #4a5568;

  /* Text */
  --achl-text: #f6f8fb;
  --achl-text-muted: #c5ced9;
  --achl-text-on-header: #ffffff;

  /* Type */
  --achl-font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --achl-font-display: "Barlow Condensed", "Arial Narrow", sans-serif;

  --achl-radius: 10px;
  --achl-radius-sm: 6px;
  --achl-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  --achl-transition: 0.18s ease;

  --achl-focus-ring: 0 0 0 3px var(--achl-accent-dim);

  /*
   * Approximate height of sticky #site-top-chrome (team strip + header bar).
   * Used for scroll-padding, in-page anchors, and sticky sidebars (e.g. ACHLAwards).
   * Lower --achl-sticky-chrome-estimate if the header is shortened; raise if it grows.
   */
  --achl-sticky-chrome-estimate: 8.25rem;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --achl-transition: 0.01ms;
  }
}

/* -----------------------------------------------------------------------------
   Base page (body / links / subtle mesh)
   ----------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

@media (min-width: 992px) {
  html {
    scroll-padding-top: calc(var(--achl-sticky-chrome-estimate) + 0.35rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--achl-font-body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--achl-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: var(--achl-bg-deep);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(124, 200, 255, 0.09), transparent 52%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.015) 2px,
      rgba(255, 255, 255, 0.015) 4px
    );
  background-attachment: fixed;
}

body a:link,
body a:visited {
  color: var(--achl-accent);
  font-weight: 600;
  transition: color var(--achl-transition), opacity var(--achl-transition);
}

body a:hover {
  color: #b0dcff;
}

/* Slightly heavier link text in readable zones (header nav keeps its own weights) */
main.achl-main a:link,
main.achl-main a:visited,
footer.achl-app-footer a:link,
footer.achl-app-footer a:visited {
  font-weight: 600;
}

/*
 * body a:link beats weaker rules (e.g. .STHSQuickSearchResults a) and paints ice-blue
 * on white/grey STHS surfaces. Only list containers that stay light after ACHL overrides
 * (tab panels, FilterTip, column selector, captions are dark-themed below).
 */
.ms-container a:link,
.ms-container a:visited,
.dsl-panel a:link,
.dsl-panel a:visited,
.dsl-panel-item-null a:link,
.dsl-panel-item-null a:visited,
.modal-content a:link,
.modal-content a:visited,
.dropdown-menu a:link,
.dropdown-menu a:visited,
body .dropdown-item:link,
body .dropdown-item:visited {
  color: var(--achl-link-on-light) !important;
  font-weight: 600 !important;
}

.ms-container a:hover,
.dsl-panel a:hover,
.modal-content a:hover,
.dropdown-menu a:hover,
body .dropdown-item:hover {
  color: var(--achl-link-on-light-hover) !important;
}

/* -----------------------------------------------------------------------------
   Bootstrap + STHS “paper” surfaces — body uses light text; these stay white/light
   ----------------------------------------------------------------------------- */
body .modal-content {
  background-color: #fff;
  color: var(--achl-text-on-light);
  border-color: rgba(0, 0, 0, 0.12);
}

body .modal-header,
body .modal-footer {
  border-color: rgba(0, 0, 0, 0.08);
}

body .modal-title {
  color: var(--achl-text-on-light);
}

body .modal-content h1,
body .modal-content h2,
body .modal-content h3,
body .modal-content h4,
body .modal-content h5,
body .modal-content h6 {
  color: var(--achl-text-on-light);
}

body .modal-header .close {
  color: var(--achl-text-on-light);
  opacity: 0.65;
  text-shadow: none;
}

body .modal-header .close:hover {
  opacity: 1;
}

body .modal-content .breadcrumb {
  color: var(--achl-text-on-light);
}

body .dropdown-menu {
  background-color: #fff;
  color: var(--achl-text-on-light);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body .dropdown-item:focus,
body .dropdown-item:hover {
  background-color: rgba(0, 53, 102, 0.08);
}

body .dropdown-divider {
  border-top-color: rgba(0, 0, 0, 0.08);
}

body .popover {
  background-color: #fff;
  border-color: rgba(0, 0, 0, 0.12);
}

body .popover-body {
  color: var(--achl-text-on-light);
}

body .popover-header {
  background-color: #f0f4f8;
  color: var(--achl-text-on-light);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body .toast {
  background-color: rgba(255, 255, 255, 0.98);
  color: var(--achl-text-on-light);
}

body .toast-header {
  color: var(--achl-text-on-light);
  background-color: rgba(248, 249, 250, 0.98);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

body .input-group-text {
  background-color: #e8edf2;
  color: var(--achl-text-on-light);
  border-color: rgba(0, 0, 0, 0.12);
}

body .custom-file-label {
  background-color: #fff;
  color: var(--achl-text-on-light);
  border-color: rgba(0, 0, 0, 0.12);
}

body .custom-file-label::after {
  color: var(--achl-text-on-light);
  background-color: #e8edf2;
}

body .pagination .page-link {
  background-color: #fff;
  color: var(--achl-link-on-light);
  border-color: rgba(0, 0, 0, 0.12);
}

body .pagination .page-link:hover {
  background-color: #e8f0f8;
  color: var(--achl-link-on-light-hover);
}

body .pagination .page-item.active .page-link {
  background-color: rgba(0, 53, 102, 0.92);
  border-color: rgba(0, 40, 80, 1);
  color: #fff;
}

body .pagination .page-item.disabled .page-link {
  color: var(--achl-text-muted-on-light);
  background-color: #f0f2f5;
}

body .list-group-item {
  background-color: #fff;
  color: var(--achl-text-on-light);
  border-color: rgba(0, 0, 0, 0.1);
}

body .list-group-item:hover {
  background-color: #f5f7fa;
}

/* Dual-select list (STHSMain.js / depth-style UIs) — white panels, was inheriting body text */
body .dsl-panel,
body .dsl-panel-item,
body .dsl-panel-item-null {
  color: var(--achl-text-on-light);
}

body .dsl-panel-item:hover {
  color: var(--achl-text-on-light);
}

body .dsl-filter-input {
  color: var(--achl-text-on-light) !important;
  background-color: #fff !important;
}

body .dsl-filter-move-all {
  color: var(--achl-text-muted-on-light) !important;
}

body .dsl-filter-move-all:hover {
  color: var(--achl-text-on-light) !important;
}

body .ms-container {
  color: var(--achl-text-on-light);
}

/* .text-muted is tuned for dark page; inside paper panels it must stay dark grey */
body .modal-content .text-muted,
body .dropdown-menu .text-muted,
body .popover-body .text-muted,
body .toast .text-muted,
body .list-group-item .text-muted {
  color: var(--achl-text-muted-on-light) !important;
}

/* STHS team home: white stat cells — darken so links use normal theme contrast */
.STHSPHPTeam_HomePrimaryTableTeamStatTD,
.STHSPHPTeam_HomePrimaryTableLeadersTextTD,
.STHSPHPTeam_HomePrimaryTableLeadersHeadshotTD {
  background: var(--achl-surface-1) !important;
  background-color: var(--achl-surface-1) !important;
  color: var(--achl-text) !important;
  border-color: var(--achl-border) !important;
}

/* Quick search popover is themed dark — body a:link must not win */
.STHSQuickSearchResults a:link,
.STHSQuickSearchResults a:visited {
  color: var(--achl-text) !important;
  font-weight: 600 !important;
}

.STHSQuickSearchResults a:hover {
  color: var(--achl-accent) !important;
}

h1, h2, h3, h4, h5, h6,
.STHSCenter {
  color: var(--achl-text);
}

/* Utility / Web Client banners (replaces STHSMain bare red text on dark pages) */
main.achl-main .STHSDivInformationMessage {
  background: rgba(255, 200, 120, 0.12);
  border: 1px solid rgba(255, 170, 80, 0.42);
  color: #ffeccd;
  font-weight: 600;
  padding: 14px 18px;
  border-radius: var(--achl-radius-sm, 8px);
  text-align: left;
  max-width: 100%;
  box-sizing: border-box;
  line-height: 1.45;
}

/* WebClientRoster.php — column headers sit on jQuery UI light panels; keep dark ink */
#rostereditor h4.columnheader {
  color: var(--achl-text-on-light, #1a2233) !important;
}

/* Backup: main.achl-main color can cascade over rostereditor.css load order */
main.achl-main #rostereditor li.playerrow,
main.achl-main #rostereditor li.playerrow .rowname,
main.achl-main #rostereditor li.playerrow .rowinfoline {
  color: #101820 !important;
}

main.achl-main #rostereditor li.ProScratch.nocontract,
main.achl-main #rostereditor li.ProScratch.nocontract .rowname {
  color: #757575 !important;
}

main.achl-main #rostereditor li.FarmScratch.nocontract,
main.achl-main #rostereditor li.FarmScratch.nocontract .rowname {
  color: #555 !important;
}

/* Bootstrap 4 tables/cards on dark page */
body .table {
  background-color: var(--achl-surface-1);
  color: var(--achl-text);
}

body .table td,
body .table th {
  border-color: var(--achl-border);
}

body .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(255, 255, 255, 0.04);
}

body .card {
  background-color: var(--achl-surface-1);
  border-color: var(--achl-border);
  color: var(--achl-text);
}

body .text-muted {
  color: var(--achl-text-muted) !important;
}

/*
 * Bootstrap light-surface helpers show up inside custom ACHL pages (Milestones,
 * filters, alerts, card headers). Without local resets they inherit the dark-shell
 * text treatment and can become white-on-white or very low contrast.
 */
body .card-header.bg-light,
body .card .bg-light,
body .badge-light,
body .table-light,
body .thead-light th,
body .list-group-item-light,
body .alert-light,
body .alert-warning,
body .alert-info {
  color: var(--achl-text-on-light) !important;
}

body .card-header.bg-light,
body .card .bg-light,
body .table-light,
body .thead-light th,
body .list-group-item-light {
  background-color: #eef3f8 !important;
  border-color: rgba(17, 32, 53, 0.12) !important;
}

body .badge-light {
  background-color: #eef3f8 !important;
  border: 1px solid rgba(17, 32, 53, 0.14) !important;
}

body .alert-light {
  background-color: #eef3f8 !important;
  border-color: rgba(17, 32, 53, 0.14) !important;
}

body .alert-info {
  background-color: #dcecf9 !important;
  border-color: rgba(0, 70, 140, 0.18) !important;
}

body .alert-warning {
  background-color: #f7e4b5 !important;
  border-color: rgba(120, 80, 15, 0.24) !important;
}

body .card-header.bg-light .text-muted,
body .card .bg-light .text-muted,
body .badge-light .text-muted,
body .table-light .text-muted,
body .thead-light .text-muted,
body .list-group-item-light .text-muted,
body .alert-light .text-muted,
body .alert-warning .text-muted,
body .alert-info .text-muted {
  color: var(--achl-text-muted-on-light) !important;
}

body .card-header.bg-light a,
body .card .bg-light a,
body .badge-light a,
body .table-light a,
body .thead-light a,
body .list-group-item-light a,
body .alert-light a,
body .alert-warning a,
body .alert-info a {
  color: var(--achl-link-on-light) !important;
}

body .card .text-dark,
body .table .text-dark,
body .list-group-item .text-dark {
  color: var(--achl-text) !important;
}

body .card-header.bg-light .text-dark,
body .card .bg-light .text-dark,
body .badge-light .text-dark,
body .table-light .text-dark,
body .thead-light .text-dark,
body .list-group-item-light .text-dark,
body .alert-light .text-dark,
body .alert-warning .text-dark,
body .alert-info .text-dark {
  color: var(--achl-text-on-light) !important;
}

body .progress {
  background-color: rgba(255, 255, 255, 0.1);
}

body .progress-bar {
  background-color: var(--achl-accent);
}

main.achl-main .achl-home-inline-link,
main.achl-main .achl-home-inline-link:visited {
  color: inherit;
  text-decoration: none;
}

main.achl-main .achl-home-inline-link:hover {
  color: var(--achl-accent);
  text-decoration: underline;
}

main.achl-main .achl-page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 40px;
}

main.achl-main .achl-legacy-breadcrumb,
main.achl-main .achl-draft-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
  color: var(--achl-text-muted);
  font-size: 0.94rem;
}

main.achl-main .achl-legacy-breadcrumb a,
main.achl-main .achl-draft-breadcrumb a {
  color: var(--achl-accent);
  text-decoration: none;
}

main.achl-main .achl-legacy-header h1,
main.achl-main .achl-draft-hero h1 {
  margin: 0 0 10px;
}

main.achl-main .achl-legacy-subtitle,
main.achl-main .achl-draft-subtitle {
  margin: 0 0 16px;
  max-width: 72ch;
  color: var(--achl-text-muted);
}

main.achl-main .achl-legacy-actions,
main.achl-main .achl-draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin: 0;
}

main.achl-main .achl-legacy-content-wrap {
  overflow: hidden;
}

main.achl-main .achl-legacy-content {
  color: var(--achl-text);
  line-height: 1.6;
}

main.achl-main .achl-legacy-content > :first-child {
  margin-top: 0;
}

main.achl-main .achl-legacy-content img {
  max-width: 100%;
  height: auto;
}

main.achl-main .achl-legacy-content table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  margin: 1rem 0;
}

main.achl-main .achl-legacy-content table th,
main.achl-main .achl-legacy-content table td {
  border: 1px solid var(--achl-border);
  padding: 10px 12px;
  vertical-align: top;
  background: rgba(255, 255, 255, 0.02);
}

main.achl-main .achl-legacy-content table th {
  background: rgba(255, 255, 255, 0.06);
}

main.achl-main .achl-legacy-content a {
  color: var(--achl-accent);
}

main.achl-main .achl-draft-grid {
  display: grid;
  gap: 20px;
}

main.achl-main .achl-draft-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

main.achl-main .achl-draft-summary-card {
  border: 1px solid var(--achl-border);
  border-radius: var(--achl-radius);
  background: rgba(255, 255, 255, 0.03);
  padding: 16px 18px;
}

main.achl-main .achl-draft-summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.45rem;
  font-family: var(--achl-font-display);
  letter-spacing: 0.02em;
}

main.achl-main .achl-draft-summary-card span {
  color: var(--achl-text-muted);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

main.achl-main .achl-draft-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(260px, 0.85fr);
  gap: 20px;
  align-items: start;
}

main.achl-main .achl-draft-board-card,
main.achl-main .achl-draft-sidebar-card {
  padding: 0;
  overflow: hidden;
}

main.achl-main .achl-draft-card-head {
  padding: 18px 20px 10px;
}

main.achl-main .achl-draft-card-head h2,
main.achl-main .achl-draft-card-head h3 {
  margin: 0 0 6px;
}

main.achl-main .achl-draft-card-head p {
  margin: 0;
  color: var(--achl-text-muted);
}

main.achl-main .achl-draft-board-wrap {
  padding: 0 14px 14px;
}

main.achl-main .achl-draft-board-wrap table {
  width: 100%;
}

main.achl-main .achl-draft-sidebar-body {
  padding: 0 20px 20px;
}

main.achl-main .achl-draft-note {
  margin: 0 0 14px;
  color: var(--achl-text-muted);
}

main.achl-main .achl-draft-prospect-list {
  display: grid;
  gap: 8px;
  max-height: 720px;
  overflow: auto;
}

main.achl-main .achl-draft-prospect-item {
  padding: 10px 12px;
  border: 1px solid var(--achl-border);
  border-radius: var(--achl-radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

main.achl-main .achl-draft-link-list {
  display: grid;
  gap: 10px;
}

main.achl-main .achl-draft-link-list a {
  color: var(--achl-accent);
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 980px) {
  main.achl-main .achl-draft-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  main.achl-main .achl-draft-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  main.achl-main .achl-page-shell {
    width: min(100%, calc(100% - 20px));
  }

  main.achl-main .achl-draft-summary {
    grid-template-columns: 1fr;
  }
}

/* TeamFreeAgents.php — collapsible player names (removed inline color:black) */
main.achl-main .achl-page-team-freeagents .achl-fa-player-link {
  color: var(--achl-accent) !important;
  text-decoration: none;
  font-weight: 600;
}

main.achl-main .achl-page-team-freeagents .achl-fa-player-link:hover {
  color: #b0dcff !important;
  text-decoration: underline;
}

main.achl-main .achl-page-team-freeagents .nav-pills .nav-link {
  color: var(--achl-accent);
}

main.achl-main .achl-page-team-freeagents .nav-pills .nav-link:hover {
  color: #b0dcff;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--achl-accent);
  outline-offset: 2px;
}

.STHSPHPMenuOutOfDate {
  background: rgba(200, 60, 60, 0.25);
  border: 1px solid rgba(255, 100, 100, 0.45);
  color: #ffb4b4;
  padding: 10px 14px;
  margin: 8px auto;
  max-width: 900px;
  border-radius: var(--achl-radius-sm);
  text-align: center;
}

/* -----------------------------------------------------------------------------
   Top chrome: team strip + header (see Menu.php #site-top-chrome)
   ----------------------------------------------------------------------------- */
#site-top-chrome {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--achl-header-solid);
  box-shadow: var(--achl-shadow);
  border-bottom: 1px solid var(--achl-border-strong);
}

#site-top-chrome .STHSPHPMenuDiv {
  display: block !important; /* override STHSMain.css mobile hide */
  text-align: center;
  margin: 0;
  padding: 8px 10px 6px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--achl-border);
}

#site-top-chrome .STHSPHPMenuDivTeamImage {
  width: 32px;
  height: 32px;
  vertical-align: middle;
  margin: 2px 3px;
  border-radius: 6px;
  transition: transform var(--achl-transition), box-shadow var(--achl-transition);
}

#site-top-chrome .STHSPHPMenuDiv a:hover .STHSPHPMenuDivTeamImage,
#site-top-chrome .STHSPHPMenuDiv a:focus-visible .STHSPHPMenuDivTeamImage {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px var(--achl-accent-dim);
}

/* -----------------------------------------------------------------------------
   Header bar + mobile layout
   ----------------------------------------------------------------------------- */
#site-header-bar {
  background: var(--achl-header-bg);
  background-color: var(--achl-header-solid);
}

#site-header-bar .league-logo-link {
  display: inline-block;
  line-height: 0;
  border-radius: var(--achl-radius-sm);
  transition: opacity var(--achl-transition), box-shadow var(--achl-transition);
}

#site-header-bar .league-logo-link:hover,
#site-header-bar .league-logo-link:focus-visible {
  opacity: 0.92;
  box-shadow: 0 0 0 2px var(--achl-accent-dim);
}

#site-header-bar #league-logo {
  max-height: 62px;
  width: auto;
  display: block;
}

#site-header-bar #header-container,
#site-header-bar #logo-container {
  background: transparent;
}

/* Mobile / tablet: stack chrome */
@media (max-width: 991px) {
  body {
    padding-top: 0;
    background-attachment: scroll;
  }

  /* Let chrome scroll away — sticky + tall team strip was eating most of the viewport */
  #site-top-chrome {
    position: relative;
    top: auto;
    z-index: auto;
    box-shadow: 0 1px 0 var(--achl-border-strong);
  }

  /* One short row; swipe horizontally for more teams */
  #site-top-chrome .STHSPHPMenuDiv {
    display: block !important;
    text-align: left;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    max-height: 48px;
    padding: 6px 8px;
    scrollbar-width: thin;
  }

  #site-top-chrome .STHSPHPMenuDiv a {
    display: inline-block;
    vertical-align: middle;
  }

  #site-header-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 12px 12px;
  }

  #site-header-bar #header-container {
    display: flex;
    justify-content: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--achl-border);
    margin-bottom: 8px;
  }

  #site-header-bar .STHSGlobalQuickSearch {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 10px 0 !important;
    box-sizing: border-box;
    order: 2;
  }

  #site-header-bar .STHSMobileTeamJump {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    order: 3;
    margin: 0 0 10px 0 !important;
    padding: 10px 12px !important;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--achl-border);
    border-radius: var(--achl-radius-sm);
  }

  #site-header-bar #site-primary-nav {
    order: 4;
    width: 100%;
  }

  #site-header-bar #cssmenu {
    width: 100%;
  }

  /* Hamburger + bars on dark header */
  #site-header-bar #cssmenu #menu-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--achl-border-strong);
    border-radius: var(--achl-radius-sm);
    color: var(--achl-text-on-header);
    font-family: var(--achl-font-display);
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 10px 14px;
    margin-bottom: 8px;
  }

  #site-header-bar #cssmenu #menu-button:after,
  #site-header-bar #cssmenu #menu-button:before {
    border-top-color: var(--achl-text-on-header) !important;
    background: var(--achl-text-on-header) !important;
  }

  #site-header-bar #cssmenu .submenu-button {
    border-left-color: var(--achl-border-strong);
  }

  #site-header-bar #cssmenu .submenu-button:after,
  #site-header-bar #cssmenu .submenu-button:before {
    background: var(--achl-text-on-header) !important;
  }

  #site-header-bar #cssmenu ul li a,
  #site-header-bar #cssmenu ul ul li a {
    color: var(--achl-text) !important;
  }

  #site-header-bar #cssmenu ul ul li a,
  #site-header-bar #cssmenu ul ul ul li a {
    background: rgba(0, 0, 0, 0.25) !important;
  }
}

/* Desktop: single row */
@media (min-width: 992px) {
  body {
    padding-top: 10px;
  }

  #site-header-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 16px;
    padding: 12px 18px 14px;
    overflow: visible;
  }

  #site-header-bar #header-container {
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    background: transparent;
  }

  /*
   * Quick search comes after the nav in the DOM; with flex, later siblings paint
   * on top. Wide mega panels (Teams) extend under that strip, so the pointer hits
   * the search layer and :hover is lost on li.nav-mega. Keep nav above search.
   */
  #site-header-bar #site-primary-nav {
    flex: 1 1 auto;
    min-width: 0;
    order: 2;
    padding: 0;
    margin: 0;
    background: transparent;
    position: relative;
    z-index: 50;
  }

  #site-header-bar #cssmenu {
    width: 100%;
    min-width: 0;
    padding: 0;
    margin: 0;
    background: transparent;
  }

  #site-header-bar #cssmenu > ul {
    padding-left: 8px;
  }

  #site-header-bar .STHSGlobalQuickSearch {
    flex-shrink: 0;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0 0 0 12px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    border-left: 1px solid var(--achl-border-strong) !important;
    position: relative;
    z-index: 40;
    /* One row: label + field (STHSMain.css uses flex-wrap + wide input flex-basis) */
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px 8px;
    box-sizing: border-box;
  }

  /* While results are open, stack above mega menus (nav is z-index 50). */
  #site-header-bar .STHSGlobalQuickSearch.achl-quicksearch-popover-open {
    z-index: 70;
  }

  #site-header-bar .STHSGlobalQuickSearch label {
    margin-right: 0;
    font-size: 0.82em;
    white-space: nowrap;
    flex-shrink: 0;
  }

  #site-header-bar #STHSQuickSearchInput {
    flex: 0 1 auto;
    width: 158px;
    min-width: 120px;
    max-width: min(220px, 28vw);
    padding: 6px 10px;
  }

  #site-header-bar .STHSMobileTeamJump {
    flex-basis: 100%;
    order: 10;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--achl-border);
  }

  #site-header-bar #header-container {
    order: 1;
  }
  #site-header-bar .STHSGlobalQuickSearch {
    order: 3;
  }
  #site-header-bar .STHSMobileTeamJump {
    order: 4;
    display: none !important;
  }
}

/* -----------------------------------------------------------------------------
   Main nav (#cssmenu) — tech / sport styling
   ----------------------------------------------------------------------------- */
#site-header-bar #cssmenu,
#site-top-chrome #cssmenu {
  font-family: var(--achl-font-display);
}

#site-header-bar #cssmenu > ul > li > a,
#site-top-chrome #cssmenu > ul > li > a {
  color: #ffffff !important;
  font-size: 14px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: var(--achl-radius-sm);
  transition: background var(--achl-transition), color var(--achl-transition);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

#site-header-bar #cssmenu > ul > li > a {
  padding: 10px 14px !important;
}

/* Submenu indicator (+): STHS used padding-right 30px; our rule above forced 14px — too tight */
#site-header-bar #cssmenu > ul > li.has-sub > a,
#site-top-chrome #cssmenu > ul > li.has-sub > a {
  padding-right: 38px !important;
}

#site-header-bar #cssmenu > ul > li.has-sub > a:after,
#site-top-chrome #cssmenu > ul > li.has-sub > a:after {
  top: calc(50% - 1px);
  right: 14px;
}

#site-header-bar #cssmenu > ul > li.has-sub > a:before,
#site-top-chrome #cssmenu > ul > li.has-sub > a:before {
  top: calc(50% - 4px);
  right: 17px;
}

#site-header-bar #cssmenu > ul > li.has-sub:hover > a:before,
#site-top-chrome #cssmenu > ul > li.has-sub:hover > a:before {
  top: calc(50% - 1px);
}

#site-header-bar #cssmenu ul ul li.has-sub > a {
  padding-right: 40px !important;
}

#site-header-bar #cssmenu ul ul li.has-sub > a:after {
  top: calc(50% - 1px);
  right: 14px;
}

#site-header-bar #cssmenu ul ul li.has-sub > a:before {
  top: calc(50% - 4px);
  right: 17px;
}

#site-header-bar #cssmenu ul ul > li.has-sub:hover > a:before {
  top: calc(50% - 1px);
}

/* Top-level hover: blue wash like Stats/Teams (avoid white wash + white text) */
#site-header-bar #cssmenu > ul > li:hover > a,
#site-top-chrome #cssmenu > ul > li:hover > a {
  color: #ffffff !important;
  background: rgba(124, 200, 255, 0.22) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

#site-header-bar #cssmenu > ul > li.has-sub > a:after,
#site-header-bar #cssmenu > ul > li.has-sub > a:before,
#site-top-chrome #cssmenu > ul > li.has-sub > a:after,
#site-top-chrome #cssmenu > ul > li.has-sub > a:before {
  background: #ffffff !important;
}

#site-header-bar #cssmenu ul ul,
#site-top-chrome #cssmenu ul ul {
  background: var(--achl-surface-1) !important;
  border: 1px solid var(--achl-border-strong);
  border-radius: var(--achl-radius-sm);
  box-shadow: var(--achl-shadow);
}

/*
 * STHS sets ul ul li a to #f2f2f2 + black text. We override text to light but
 * must kill the grey/white row bg or labels vanish (non–mega-menus only got this bug).
 */
#site-header-bar #cssmenu ul ul li a,
#site-top-chrome #cssmenu ul ul li a {
  color: var(--achl-text) !important;
  background: rgba(0, 0, 0, 0.2) !important;
  font-family: var(--achl-font-body);
  font-size: 15px;
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 600;
  border-bottom-color: var(--achl-border) !important;
}

#site-header-bar #cssmenu ul ul li a:hover,
#site-top-chrome #cssmenu ul ul li a:hover,
#site-header-bar #cssmenu ul ul li:hover > a,
#site-top-chrome #cssmenu ul ul li:hover > a {
  background: rgba(124, 200, 255, 0.18) !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

/* Third-level flyouts (Tools → Players → …) */
#site-header-bar #cssmenu ul ul ul li a,
#site-top-chrome #cssmenu ul ul ul li a {
  background: rgba(0, 0, 0, 0.28) !important;
  color: var(--achl-text) !important;
}

#site-header-bar #cssmenu ul ul ul li a:hover,
#site-top-chrome #cssmenu ul ul ul li a:hover {
  background: rgba(124, 200, 255, 0.2) !important;
  color: #ffffff !important;
}

#site-header-bar #cssmenu ul ul li.has-sub > a:after,
#site-header-bar #cssmenu ul ul li.has-sub > a:before {
  background: var(--achl-text-muted) !important;
}

li.activemain a,
li.activemain a:hover {
  color: var(--achl-accent) !important;
}

/* -----------------------------------------------------------------------------
   Mega menus (Standings & stats, Teams) — desktop wide panels
   ----------------------------------------------------------------------------- */
#site-header-bar .site-primary-nav {
  display: block;
}

@media (min-width: 992px) {
  /*
   * Floated top-level LIs only wrap in-flow content (the <a>), so the absolutely
   * positioned panel sits below the anchor without extending the LI’s hover box.
   * Moving the pointer into the panel crosses a dead gap → menu closes. Fix by
   * overlapping the panel slightly into the trigger and padding the panel top.
   */
  #site-header-bar #cssmenu > ul > li.nav-mega {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: -10px;
  }

  #site-header-bar #cssmenu > ul > li.nav-mega > ul.nav-mega-panel {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 20px 32px;
    min-width: 520px;
    max-width: min(960px, calc(100vw - 40px));
    padding: 18px 20px 20px;
    box-sizing: border-box;
    top: calc(100% - 8px) !important;
    padding-top: 20px;
    left: 0 !important;
    right: auto !important;
    margin: 0 !important;
    z-index: 120;
    /* Opaque panel: STHS zeros nested li heights; without a solid stack children looked “empty” */
    background: linear-gradient(
      165deg,
      var(--achl-surface-2) 0%,
      var(--achl-surface-1) 42%,
      #2a4a6e 100%
    ) !important;
    background-color: var(--achl-surface-1) !important;
    border: 1px solid rgba(212, 168, 75, 0.22);
    border-radius: var(--achl-radius);
    box-shadow:
      0 16px 48px rgba(0, 0, 0, 0.55),
      0 0 0 1px rgba(255, 255, 255, 0.06);
    /* Long team/stat lists: keep panel in view; scroll inside instead of clipping */
    max-height: min(85vh, 720px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    align-content: start;
  }

  #site-header-bar #cssmenu > ul > li.nav-mega:hover > ul.nav-mega-panel,
  #site-header-bar #cssmenu > ul > li.nav-mega:focus-within > ul.nav-mega-panel,
  #site-header-bar #cssmenu > ul > li.nav-mega.nav-mega-open > ul.nav-mega-panel {
    display: grid;
  }

  /*
   * Only one Stats/Teams mega visible while the pointer is anywhere on the top bar:
   * avoids two wide panels when moving between items or from sticky :hover.
   */
  #site-header-bar
    #cssmenu
    > ul:hover
    > li.nav-mega:not(:hover):not(:focus-within):not(.nav-mega-open)
    > ul.nav-mega-panel {
    display: none !important;
  }

  /* League / Today deep flyouts (3rd level+): scroll instead of clipping */
  #site-header-bar #cssmenu > ul > li > ul ul ul {
    max-height: min(68vh, 520px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  #site-header-bar #cssmenu .nav-mega-panel > li {
    float: none !important;
    height: auto !important;
    min-height: 0 !important;
  }

  #site-header-bar #cssmenu .nav-mega-panel li.nav-heading {
    list-style: none;
    padding: 8px 8px 4px;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--achl-text-muted);
    pointer-events: none;
  }

  #site-header-bar #cssmenu .nav-mega-panel li.nav-heading:first-child {
    margin-top: 0;
  }

  #site-header-bar #cssmenu .nav-col-title {
    display: block;
    font-family: var(--achl-font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--achl-logo-gold);
    padding: 6px 8px 12px;
    border-bottom: 1px solid rgba(212, 168, 75, 0.28);
    margin-bottom: 8px;
  }

  #site-header-bar #cssmenu .nav-col-subtitle {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--achl-text-muted);
    padding: 6px 8px;
    margin-bottom: 4px;
  }

  #site-header-bar #cssmenu .nav-mega-panel li.nav-mega-col > ul,
  #site-header-bar #cssmenu .nav-mega-panel .nav-mega-season-inner,
  #site-header-bar #cssmenu .nav-mega-panel .nav-mega-season-inner > li > ul {
    position: static !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
    width: 100% !important;
    display: block !important;
    box-shadow: none !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    background: rgba(0, 0, 0, 0.22) !important;
    border-radius: var(--achl-radius-sm);
    padding: 8px 6px !important;
  }

  /*
   * STHSMain.css: #cssmenu ul ul li { height: 0 } + transition — only direct
   * li:hover > ul > li gets height. Nested mega rows stay at 0 → invisible “no background”.
   */
  #site-header-bar #cssmenu .nav-mega-panel li,
  #site-header-bar #cssmenu .nav-mega-panel ul li {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    transition: none !important;
  }

  #site-header-bar #cssmenu .nav-mega-panel ul {
    overflow: visible !important;
  }

  #site-header-bar #cssmenu .nav-mega-panel li a {
    width: auto !important;
    max-width: none;
  }

  #site-header-bar #cssmenu .nav-mega-panel-teams li a {
    white-space: normal;
    display: block;
    padding: 9px 12px !important;
    margin: 2px 0;
    border-radius: var(--achl-radius-sm);
    background: rgba(255, 255, 255, 0.06) !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
  }

  #site-header-bar #cssmenu .nav-mega-panel-teams li a:hover,
  #site-header-bar #cssmenu .nav-mega-panel-teams li a:focus-visible {
    background: rgba(110, 176, 255, 0.14) !important;
    color: var(--achl-accent) !important;
  }

  /* Standings mega: same row treatment for dense link lists */
  #site-header-bar #cssmenu .nav-mega-panel-stats .nav-mega-col > ul > li > a {
    display: block;
    white-space: normal;
    padding: 8px 12px !important;
    margin: 2px 0;
    border-radius: var(--achl-radius-sm);
    background: rgba(255, 255, 255, 0.06) !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
  }

  #site-header-bar #cssmenu .nav-mega-panel-stats .nav-mega-col > ul > li > a:hover,
  #site-header-bar #cssmenu .nav-mega-panel-stats .nav-mega-col > ul > li > a:focus-visible {
    background: rgba(110, 176, 255, 0.14) !important;
    color: var(--achl-accent) !important;
  }

  #site-header-bar #cssmenu .nav-mega-season-inner ul > li > a {
    display: block;
    white-space: normal;
    padding: 6px 8px !important;
    margin: 1px 0;
    border-radius: var(--achl-radius-sm);
    background: rgba(255, 255, 255, 0.04) !important;
  }

  #site-header-bar #cssmenu .nav-mega-span-full {
    grid-column: 1 / -1;
  }

  #site-header-bar #cssmenu .nav-mega-season-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    margin-top: 4px;
  }

  #site-header-bar #cssmenu .nav-mega-season-inner > li.nav-mega-subcol {
    height: auto !important;
  }

  #site-header-bar #cssmenu .nav-mega-season-block > .nav-col-title {
    margin-bottom: 0;
  }
}

@media (max-width: 991px) {
  #site-header-bar #cssmenu ul.nav-mega-panel {
    position: relative !important;
    left: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    transform: none !important;
    grid-template-columns: 1fr !important;
    padding: 6px 0 10px !important;
    box-sizing: border-box;
    max-height: min(70vh, 520px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    align-content: start;
  }

  #site-header-bar #cssmenu .nav-mega-panel li,
  #site-header-bar #cssmenu .nav-mega-panel li.nav-heading {
    height: auto !important;
    float: none !important;
  }

  #site-header-bar #cssmenu .nav-mega-panel li.nav-mega-col > ul,
  #site-header-bar #cssmenu .nav-mega-panel .nav-mega-season-inner,
  #site-header-bar #cssmenu .nav-mega-panel .nav-mega-season-inner > li > ul {
    position: relative !important;
    left: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  #site-header-bar #cssmenu .nav-mega-season-inner {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #site-header-bar #cssmenu .nav-col-title,
  #site-header-bar #cssmenu .nav-col-subtitle {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/*
 * STHS hamburger mode kicks in at max-width 768px (STHSMain.css). Until then, megas
 * use desktop hover — do not require .open above that width.
 */
@media (max-width: 768px) {
  #site-header-bar #cssmenu > ul > li.nav-mega > ul.nav-mega-panel:not(.open) {
    display: none !important;
  }

  #site-header-bar #cssmenu > ul > li.nav-mega > ul.nav-mega-panel.open {
    display: grid !important;
  }
}

/* -----------------------------------------------------------------------------
   Global quick search
   ----------------------------------------------------------------------------- */
.STHSGlobalQuickSearch {
  width: 95%;
  max-width: 1400px;
  margin: 0 auto 10px auto;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--achl-border-strong);
  border-radius: var(--achl-radius);
  position: relative;
  box-sizing: border-box;
}

.STHSGlobalQuickSearch label {
  color: var(--achl-text-on-header);
  font-family: var(--achl-font-display);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 12px;
  margin-right: 10px;
}

#STHSQuickSearchInput {
  width: min(520px, 100%);
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--achl-border-strong);
  border-radius: var(--achl-radius-sm);
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  font-family: var(--achl-font-body);
  transition: box-shadow var(--achl-transition), border-color var(--achl-transition);
}

#STHSQuickSearchInput::placeholder {
  color: rgba(0, 0, 0, 0.55);
}

#STHSQuickSearchInput:focus {
  outline: none;
  border-color: var(--achl-accent);
  box-shadow: var(--achl-focus-ring);
}

.STHSQuickSearchResults {
  display: none;
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(100% + 8px);
  background: var(--achl-surface-1);
  border: 1px solid var(--achl-border-strong);
  border-radius: var(--achl-radius);
  padding: 8px 10px;
  box-shadow: var(--achl-shadow);
  z-index: 9999;
  max-height: 340px;
  overflow: auto;
}

.STHSQuickSearchResults a {
  display: block;
  padding: 8px 8px;
  border-radius: var(--achl-radius-sm);
  color: var(--achl-text);
  text-decoration: none;
}

.STHSQuickSearchResults a:hover {
  background: rgba(124, 200, 255, 0.14);
  color: var(--achl-accent);
  text-decoration: none;
}

/* Mobile team jump (below header on small screens) */
.STHSMobileTeamJump {
  display: none;
  font-family: var(--achl-font-body);
}

.STHSMobileTeamJump label {
  color: var(--achl-text-muted);
  margin-right: 6px;
}

.STHSMobileTeamJump select {
  max-width: 55%;
  font-size: 0.9em;
  background: var(--achl-surface-2);
  color: var(--achl-text);
  border: 1px solid var(--achl-border-strong);
  border-radius: var(--achl-radius-sm);
  padding: 6px 8px;
}

.STHSMobileTeamJump button {
  margin-left: 6px;
  font-size: 0.9em;
  padding: 6px 12px;
  border-radius: var(--achl-radius-sm);
  border: 1px solid var(--achl-accent);
  background: rgba(110, 176, 255, 0.15);
  color: var(--achl-accent);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--achl-transition);
}

.STHSMobileTeamJump button:hover {
  background: rgba(110, 176, 255, 0.28);
}

@media (max-width: 991px) {
  .STHSMobileTeamJump {
    display: flex;
  }
}

/* -----------------------------------------------------------------------------
   Wide table wrappers (horizontal scroll)
   ----------------------------------------------------------------------------- */
.STHSPHPStanding_Table,
.STHSPHPPlayersStat_Table,
.STHSPHPGoaliesStat_Table,
.STHSPHPTeamsStat_Table,
.STHSIndex_HeadlineTable {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--achl-surface-1);
  border: 1px solid var(--achl-border);
  border-radius: var(--achl-radius-sm);
}

@media (max-width: 767px) {
  body {
    font-size: 14px;
  }

  table {
    font-size: 0.95em;
  }

  .STHSPHPStanding_Table::before,
  .STHSPHPPlayersStat_Table::before,
  .STHSPHPGoaliesStat_Table::before,
  .STHSPHPTeamsStat_Table::before,
  .STHSIndex_HeadlineTable::before {
    content: "Scroll sideways for full table \2192";
    display: block;
    padding: 6px 8px;
    font-size: 0.8em;
    color: var(--achl-text-muted);
    background: var(--achl-surface-2);
    border-bottom: 1px solid var(--achl-border);
  }
}

/* -----------------------------------------------------------------------------
   Tables (.tablesorter, .basictablesorter) — readable on dark page
   ----------------------------------------------------------------------------- */
.tablesorter,
table.basictablesorter {
  font-family: var(--achl-font-body) !important;
  font-size: 13px !important;
  background-color: var(--achl-surface-1) !important;
  color: var(--achl-text);
  border: 1px solid var(--achl-border) !important;
  border-radius: var(--achl-radius-sm);
}

.tablesorter th,
.tablesorter td,
table.basictablesorter th,
table.basictablesorter td {
  border-color: var(--achl-border) !important;
}

.tablesorter th,
.tablesorter thead td,
.tablesorter .header,
.tablesorter .tablesorter-header,
table.basictablesorter thead tr th,
table.basictablesorter thead tr td {
  background: var(--achl-surface-2) !important;
  color: var(--achl-text);
  font-size: 12px !important;
  text-shadow: none !important;
  font-weight: 600;
}

.tablesorter .headerSortUp,
.tablesorter .tablesorter-headerSortUp,
.tablesorter .tablesorter-headerAsc,
.tablesorter .headerSortDown,
.tablesorter .tablesorter-headerSortDown,
.tablesorter .tablesorter-headerDesc {
  background: rgba(110, 176, 255, 0.12) !important;
  color: var(--achl-accent) !important;
}

.tablesorter tbody tr:nth-child(odd),
.tablesorter tfoot tr:nth-child(odd) {
  background-color: var(--achl-surface-1) !important;
}

.tablesorter tbody tr:nth-child(even),
.tablesorter tfoot tr:nth-child(even) {
  background-color: rgba(30, 55, 85, 0.82) !important;
}

.tablesorter tbody > tr:hover > td,
.tablesorter tbody > tr.hover > td {
  background-color: rgba(110, 176, 255, 0.08) !important;
}

.tablesorter .tablesorter-filter-row,
.tablesorter .tablesorter-filter-row td {
  background-color: var(--achl-surface-2) !important;
}

.tablesorter input.tablesorter-filter,
.tablesorter select.tablesorter-filter {
  background-color: var(--achl-bg-elevated) !important;
  border-color: var(--achl-border-strong) !important;
  color: var(--achl-text) !important;
  border-radius: var(--achl-radius-sm);
}

.tablesorter_ColumnSelectorButton,
.tablesorter_Reset,
.tablesorter_Output {
  background: rgba(110, 176, 255, 0.15) !important;
  border: 1px solid var(--achl-accent) !important;
  color: var(--achl-accent) !important;
  border-radius: var(--achl-radius-sm) !important;
  font-weight: 600;
}

.tablesorter_ColumnSelector {
  background: var(--achl-surface-1) !important;
  border: 1px solid var(--achl-border-strong) !important;
  border-radius: var(--achl-radius);
}

caption {
  background-color: var(--achl-surface-1);
  color: var(--achl-text);
}

table.basictablesorter tbody tr:nth-child(odd) {
  background-color: var(--achl-surface-1) !important;
}

table.basictablesorter tbody tr:nth-child(even) {
  background-color: rgba(30, 55, 85, 0.82) !important;
}

table.basictablesorter tbody > tr:hover > td {
  background: rgba(110, 176, 255, 0.08) !important;
}

table.basictablesorter thead tr .headerSortDown,
table.basictablesorter thead tr .headerSortUp {
  background-color: rgba(110, 176, 255, 0.12) !important;
}

/*
 * jQuery tablesorter theme.default.min.css + STHS set per-td backgrounds (#fff) and
 * dark text. Our tr-level striping loses to td rules → light cells + inherited body
 * text (invisible). Force every cell + tab panels (ProTeam #tabmain1, etc.).
 */
body table.tablesorter caption {
  color: var(--achl-text) !important;
}

body table.tablesorter thead tr th,
body table.tablesorter thead tr td,
body table.tablesorter thead .tablesorter-header,
body table.tablesorter thead .header {
  background-color: var(--achl-surface-2) !important;
  background-image: none !important;
  color: var(--achl-text) !important;
  text-shadow: none !important;
  border-color: var(--achl-border) !important;
}

body table.tablesorter tbody tr > th,
body table.tablesorter tbody tr > td,
body table.tablesorter tfoot tr > th,
body table.tablesorter tfoot tr > td {
  color: var(--achl-text) !important;
  border-color: var(--achl-border) !important;
}

body table.tablesorter tbody tr:nth-child(odd) > td,
body table.tablesorter tbody tr:nth-child(odd) > th,
body table.tablesorter tfoot tr:nth-child(odd) > td,
body table.tablesorter tfoot tr:nth-child(odd) > th {
  background-color: var(--achl-surface-1) !important;
}

body table.tablesorter tbody tr:nth-child(even) > td,
body table.tablesorter tbody tr:nth-child(even) > th,
body table.tablesorter tfoot tr:nth-child(even) > td,
body table.tablesorter tfoot tr:nth-child(even) > th {
  background-color: rgba(30, 55, 85, 0.88) !important;
}

body table.tablesorter tbody > tr:hover > td,
body table.tablesorter tbody > tr:hover > th,
body table.tablesorter tbody > tr.hover > td {
  background-color: rgba(124, 200, 255, 0.14) !important;
}

body table.tablesorter tbody tr.tablesorter-no-sort th,
body table.tablesorter tbody tr.tablesorter-no-sort td {
  background-color: var(--achl-surface-2) !important;
  color: var(--achl-text) !important;
  font-weight: 600;
}

body table.tablesorter .tablesorter-filter-row th,
body table.tablesorter .tablesorter-filter-row td {
  background-color: var(--achl-surface-2) !important;
  color: var(--achl-text) !important;
}

body table.tablesorter thead tr th.headerSortUp,
body table.tablesorter thead tr th.headerSortDown,
body table.tablesorter thead tr th.tablesorter-headerSortUp,
body table.tablesorter thead tr th.tablesorter-headerSortDown,
body table.tablesorter thead tr th.tablesorter-headerAsc,
body table.tablesorter thead tr th.tablesorter-headerDesc {
  background-color: rgba(124, 200, 255, 0.16) !important;
  color: var(--achl-accent) !important;
}

body table.basictablesorter tbody tr > td,
body table.basictablesorter tbody tr > th,
body table.basictablesorter thead tr > th,
body table.basictablesorter thead tr > td,
body table.basictablesorter tfoot tr > td {
  color: var(--achl-text) !important;
  border-color: var(--achl-border) !important;
}

body table.basictablesorter tbody tr:nth-child(odd) > td,
body table.basictablesorter tbody tr:nth-child(odd) > th {
  background-color: var(--achl-surface-1) !important;
}

body table.basictablesorter tbody tr:nth-child(even) > td,
body table.basictablesorter tbody tr:nth-child(even) > th {
  background-color: rgba(30, 55, 85, 0.88) !important;
}

/* Team / player pages: non-tablesorter STHS tables (grey/white cells) */
main.achl-main .STHSPHPTeamStat_Table th,
main.achl-main .STHSPHPTeamStat_Table td,
main.achl-main .STHSPHPPlayerStat_Table th,
main.achl-main .STHSPHPPlayerStat_Table td,
main.achl-main .STHSPHPTeamStatDepthChart_Table td,
main.achl-main .STHSPHPTeamStatDepthChart_Table th {
  background-color: var(--achl-surface-1) !important;
  color: var(--achl-text) !important;
  border-color: var(--achl-border) !important;
}

main.achl-main .STHSPHPTeamStat_Table th,
main.achl-main .STHSPHPPlayerStat_Table th {
  background-color: var(--achl-surface-2) !important;
}

main.achl-main .STHSPHPTeamStat_TableTitle,
main.achl-main .STHSPHPTeamStat_TeamNameHeader,
main.achl-main .STHSPHPPlayerStat_TabHeader,
main.achl-main .STHSPHPPlayerStat_PlayerNameHeader {
  color: var(--achl-text) !important;
}

/* Team home tab: game rows / nested stat tables */
main.achl-main .STHSPHPTeam_HomePrimaryTable,
main.achl-main .STHSPHPTeam_HomePrimaryTable td,
main.achl-main .STHSPHPTeam_HomePrimaryTable th,
main.achl-main .STHSPHPTeam_HomeTeamStatTable th,
main.achl-main .STHSPHPTeam_HomeTeamStatTable td,
main.achl-main .STHSPHPTeam_HomeTable td,
main.achl-main .STHSPHPTeam_HomeTable th {
  color: var(--achl-text) !important;
  border-color: var(--achl-border) !important;
}

main.achl-main .STHSPHPTeam_HomePrimaryTableTeamName,
main.achl-main .STHSPHPTeam_HomePrimaryTableHeader,
main.achl-main .STHSPHPTeam_HomePrimaryTableTeamInfo,
main.achl-main .STHSPHPTeam_HomePrimaryTableTeamScore {
  color: var(--achl-text) !important;
}

/* ProTeam / FarmTeam tab bodies (class tabmain, not tabmain-content) */
.tabsmain.standard,
main.achl-main .tabsmain.standard {
  color: var(--achl-text);
}

main.achl-main .tabmain {
  padding: 8px 0 20px;
  color: var(--achl-text);
}

main.achl-main .tabmain table {
  color: var(--achl-text);
}

main.achl-main .tabmain a:link,
main.achl-main .tabmain a:visited {
  color: var(--achl-accent);
}

/*
 * Safety net for legacy STHS "paper" panels that still render white/light internals
 * inside the dark shell. These containers need explicit dark text or they regress
 * back to white-on-white when body text inherits from the shell.
 */
main.achl-main .FilterTip,
main.achl-main .tablesorter_ColumnSelector,
main.achl-main .tabmain.STHSPHPPlayerStat_Tabmain,
main.achl-main .STHSBoxScore_PeriodPerPeriod,
main.achl-main .STHSBoxScore_PeriodPerPeriod td,
main.achl-main .STHSBoxScore_PeriodPerPeriod th,
main.achl-main .STHSBoxScore_PeriodPerPeriod_Header {
  color: var(--achl-text-on-light) !important;
}

main.achl-main .STHSBoxScore_PeriodPerPeriod,
main.achl-main .STHSBoxScore_PeriodPerPeriod td {
  background-color: #ffffff !important;
}

main.achl-main .STHSBoxScore_PeriodPerPeriod th,
main.achl-main .STHSBoxScore_PeriodPerPeriod_Header {
  background-color: #eef3f8 !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}

main.achl-main .FilterTip a:link,
main.achl-main .FilterTip a:visited,
main.achl-main .tablesorter_ColumnSelector a:link,
main.achl-main .tablesorter_ColumnSelector a:visited,
main.achl-main .STHSBoxScore_PeriodPerPeriod a:link,
main.achl-main .STHSBoxScore_PeriodPerPeriod a:visited {
  color: var(--achl-link-on-light) !important;
}

/* -----------------------------------------------------------------------------
   Index / home layout + score ticker
   ----------------------------------------------------------------------------- */
.STHSIndex_Score,
.STHSIndex_NewsTD,
.STHSIndex_Top5 {
  vertical-align: top;
}

@media (max-width: 991px) {
  .STHSIndex_Main {
    width: 100%;
  }

  .STHSIndex_Score,
  .STHSIndex_NewsTD,
  .STHSIndex_Top5 {
    display: block;
    width: 100%;
  }
}

.STHSIndex_NewsDiv {
  max-height: 600px;
  overflow-y: auto;
}

.STHSIndex_Main {
  margin: 16px auto;
  border-collapse: collapse;
}

/* Kill legacy STHSMain white “card” TDs — match dark theme */
.STHSIndex_Score,
.STHSIndex_NewsTD,
.STHSIndex_Top5 {
  padding: 10px;
  background-color: transparent !important;
  box-shadow: none !important;
  border-radius: 0;
}

.STHSIndex_NewsDiv article {
  background-color: var(--achl-surface-1) !important;
  border: 1px solid var(--achl-border-strong) !important;
  border-radius: var(--achl-radius);
  color: var(--achl-text);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  transition: border-color var(--achl-transition), box-shadow var(--achl-transition);
}

.STHSIndex_NewsDiv article:hover {
  border-color: rgba(110, 176, 255, 0.25);
}

.STHSIndex_NewsDiv article a {
  color: var(--achl-accent);
}

.STHSIndex_NewsDiv article time,
.STHSIndex_NewsDiv article .news-meta {
  color: var(--achl-text-muted);
}

.STHSTableFullW,
.STHSIndex_GamesResult,
.STHSIndex_HeadlineTable,
.STHSIndex_Top5Table {
  border-radius: var(--achl-radius);
  border: 1px solid var(--achl-border);
  background: var(--achl-surface-1);
  overflow: hidden;
}

.STHSIndex_LastestResult,
.STHSIndex_TheNews,
.STHSIndex_Headline {
  font-family: var(--achl-font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 1px solid var(--achl-border-strong);
  background: linear-gradient(90deg, rgba(110, 176, 255, 0.12), transparent);
  color: var(--achl-text);
}

@media (min-width: 992px) {
  .STHSIndex_NewsTD {
    width: 50%;
    padding-right: 20px;
    border-right: 1px solid var(--achl-border);
  }

  .STHSIndex_Top5 {
    width: 50%;
    padding-left: 20px;
  }
}

.STHSIndex_Hero {
  width: 95%;
  max-width: 1200px;
  margin: 16px auto;
}

#ScoreTicker {
  border: 1px solid var(--achl-border-strong);
  border-radius: var(--achl-radius);
  padding: 6px 0;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  cursor: grab;
  user-select: none;
  background: linear-gradient(180deg, #1a2d45 0%, #223a58 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#ScoreTickerInner {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
}

.ScoreTickerItem {
  display: inline-block;
  padding: 6px 20px;
  white-space: nowrap;
  border-right: 1px solid var(--achl-border);
  color: var(--achl-text);
  font-size: 14px;
}

.ScoreTickerItem strong {
  color: var(--achl-accent);
  font-weight: 700;
}

#ScoreTicker.dragging {
  cursor: grabbing;
}

/* -----------------------------------------------------------------------------
   Homepage rebuild
   ----------------------------------------------------------------------------- */
.achl-homepage {
  padding: 18px 0 34px;
}

.achl-home-shell {
  width: min(1360px, calc(100% - 28px));
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.achl-home-hero,
.achl-home-rail,
.achl-home-lower {
  display: grid;
  gap: 16px;
}

.achl-home-hero {
  grid-template-columns: minmax(0, 0.96fr) minmax(360px, 1.04fr);
  align-items: start;
}

.achl-home-hero-side,
.achl-home-status-list,
.achl-home-trend-list,
.achl-home-news-list,
.achl-home-transaction-list {
  display: grid;
  gap: 14px;
}

.achl-home-rail {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.achl-home-lower-offseason {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
}

.achl-home-lower-season {
  grid-template-columns: 1fr;
}

.achl-home-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    rgba(10, 20, 36, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.achl-home-hero-story {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: start;
  background:
    radial-gradient(circle at top left, rgba(85, 170, 245, 0.17), transparent 42%),
    linear-gradient(120deg, rgba(78, 138, 223, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    rgba(10, 20, 36, 0.88);
  border-color: rgba(124, 200, 255, 0.22);
}

.achl-home-eyebrow,
.achl-home-section-kicker {
  font-family: var(--achl-font-display);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8ec9ff;
  margin-bottom: 10px;
}

.achl-home-story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--achl-text-muted);
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.achl-home-story-team {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.achl-home-hero-story h1 {
  font-family: var(--achl-font-display);
  font-size: clamp(1.85rem, 3.3vw, 2.65rem);
  line-height: 1.01;
  letter-spacing: -0.02em;
  max-width: 10.5ch;
  margin: 0 0 12px;
}

.achl-home-hero-copy {
  max-width: 52ch;
  color: #d6dfeb;
  font-size: 0.96rem;
  margin: 0 0 10px;
}

.achl-home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.achl-home-button,
.achl-home-button:link,
.achl-home-button:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 142px;
  padding: 11px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4baaf0, #2f7fd1);
  color: #f7fbff !important;
  text-decoration: none;
  font-weight: 700;
}

.achl-home-button:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

.achl-home-text-link,
.achl-home-text-link:link,
.achl-home-text-link:visited {
  color: #9fd4ff !important;
  text-decoration: none;
  font-weight: 700;
}

.achl-home-stack-card h2,
.achl-home-column-card h2,
.achl-home-lower h2 {
  font-family: var(--achl-font-display);
  font-size: clamp(1.22rem, 1.8vw, 1.72rem);
  line-height: 1;
  margin: 0 0 8px;
}

.achl-home-stack-card p,
.achl-home-column-card p,
.achl-home-destination-card span,
.achl-home-status-card small,
.achl-home-trend-card small,
.achl-home-news-card span,
.achl-home-transaction-card span:last-child,
.achl-home-empty {
  color: var(--achl-text-muted);
}

.achl-home-compact-list,
.achl-home-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.achl-home-compact-list li,
.achl-home-race-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.achl-home-compact-list li:first-child,
.achl-home-race-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.achl-home-news-card,
.achl-home-destination-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  text-decoration: none;
}

.achl-home-news-card {
  min-height: 0;
  align-content: start;
}

.achl-home-compact-list--scores li {
  grid-template-columns: minmax(0, 1fr) auto;
}

.achl-home-hero-side > .achl-home-stack-card:first-child {
  background:
    radial-gradient(circle at top right, rgba(96, 170, 242, 0.11), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.018)),
    rgba(10, 22, 40, 0.88);
  border-color: rgba(124, 200, 255, 0.24);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.achl-home-column-card--news {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    rgba(11, 23, 42, 0.84);
  border-color: rgba(122, 193, 255, 0.16);
}

.achl-home-column-card--movement {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
    rgba(14, 26, 45, 0.8);
  border-color: rgba(141, 206, 255, 0.14);
}

.achl-home-column-card--signals {
  background:
    radial-gradient(circle at top right, rgba(78, 138, 223, 0.12), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
    rgba(9, 21, 38, 0.88);
  border-color: rgba(101, 182, 248, 0.22);
}

.achl-home-lower-season > .achl-home-panel {
  background:
    radial-gradient(circle at top right, rgba(78, 138, 223, 0.1), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.016)),
    rgba(10, 21, 38, 0.9);
  border-color: rgba(124, 200, 255, 0.18);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
}

.achl-home-news-card strong,
.achl-home-destination-card strong,
.achl-home-transaction-card strong,
.achl-home-trend-card strong,
.achl-home-status-card strong {
  color: var(--achl-text);
  display: block;
}

.achl-home-card-time {
  color: var(--achl-text-muted);
  font-size: 0.8rem;
  display: block;
}

.achl-home-news-card:hover,
.achl-home-destination-card:hover {
  border-color: rgba(124, 200, 255, 0.35);
  transform: translateY(-1px);
}

.achl-home-headline-link,
.achl-home-headline-link:visited {
  color: var(--achl-text);
  text-decoration: none;
}

.achl-home-headline-link:hover {
  color: var(--achl-accent);
}

.achl-home-news-topline,
.achl-home-race-team {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.achl-home-team-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 24px;
}

.achl-home-stack-card--next {
  background:
    radial-gradient(circle at top right, rgba(96, 170, 242, 0.1), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
    rgba(12, 24, 42, 0.82);
  border-color: rgba(124, 200, 255, 0.18);
}

.achl-home-stars-list {
  display: grid;
  gap: 10px;
}

.achl-home-star-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.achl-home-star-rank {
  width: 58px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, rgba(255, 205, 90, 0.26), rgba(255, 185, 54, 0.1));
  color: #ffd86c;
  font-family: var(--achl-font-display);
}

.achl-home-star-rank span {
  position: static;
  font-size: 0.8rem;
  line-height: 1;
}

.achl-home-star-rank strong {
  font-size: 1.05rem;
  line-height: 1;
}

.achl-home-star-body {
  min-width: 0;
}

.achl-home-star-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--achl-text);
  font-weight: 700;
}

.achl-home-star-body small {
  display: block;
  margin-top: 4px;
  color: var(--achl-text-muted);
}

.achl-home-transaction-card,
.achl-home-trend-card,
.achl-home-status-card {
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.achl-home-transaction-card {
  border-left: 3px solid rgba(124, 200, 255, 0.26);
}

.achl-home-trend-card {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(110, 191, 250, 0.12);
}

.achl-home-status-card {
  background: rgba(255, 255, 255, 0.028);
}

.achl-home-race-conference-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    rgba(12, 24, 42, 0.86);
  border-color: rgba(124, 200, 255, 0.2);
}

.achl-home-race-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 6px;
}

.achl-home-race-summary-item {
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.achl-home-race-summary-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--achl-text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.achl-home-race-summary-item strong {
  font-size: 0.96rem;
}

.achl-home-lower .achl-home-panel {
  padding: 17px;
}

.achl-home-lower .achl-home-status-card,
.achl-home-lower .achl-home-trend-card {
  padding: 10px 12px;
}

.achl-home-chip {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(76, 167, 240, 0.16);
  color: #a8daff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.achl-home-destination-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.achl-home-tabs .tabmain-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.achl-home-tabs .tabmain-links a {
  display: inline-flex;
  padding: 10px 15px;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(230, 240, 255, 0.78) !important;
  text-decoration: none;
}

.achl-home-stack-card--next p {
  margin-bottom: 10px;
}

.achl-home-tabs .tabmain {
  padding-top: 6px;
}

.achl-home-tabs .tabmain-links li.activemain a,
.achl-home-tabs .tabmain-links a:hover {
  color: #fff !important;
  background: linear-gradient(135deg, rgba(75, 170, 240, 0.25), rgba(47, 127, 209, 0.2));
  border-color: rgba(124, 200, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.achl-home-race-table {
  display: grid;
}

.achl-home-race-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.achl-home-empty {
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

@media (max-width: 1180px) {
  .achl-home-hero,
  .achl-home-lower-offseason,
  .achl-home-rail,
  .achl-home-race-columns {
    grid-template-columns: 1fr;
  }

  .achl-home-hero-story h1 {
    max-width: 15ch;
  }

  .achl-home-race-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .achl-home-shell {
    width: min(100% - 18px, 1360px);
    gap: 14px;
  }

  .achl-home-panel {
    padding: 18px;
    border-radius: 16px;
  }

  .achl-home-hero-story {
    min-height: 0;
  }

  .achl-home-hero-story h1 {
    max-width: none;
    font-size: clamp(1.9rem, 11vw, 3rem);
  }

  .achl-home-hero-actions {
    align-items: flex-start;
  }

  .achl-home-compact-list li,
  .achl-home-race-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .achl-home-tabs .tabmain-links {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .achl-home-race-summary {
    grid-template-columns: 1fr;
  }
}

/* -----------------------------------------------------------------------------
   Tabs (team pages) — align with theme
   ----------------------------------------------------------------------------- */
.tabmain-links a,
.tabmenu-links a,
table.MenuSTHS a {
  color: var(--achl-text-muted) !important;
  border-radius: var(--achl-radius-sm) var(--achl-radius-sm) 0 0;
  transition: color var(--achl-transition), background var(--achl-transition);
}

.tabmain-links a:hover,
.tabmenu-links a:hover,
table.MenuSTHS a:hover {
  color: var(--achl-text) !important;
}

li.activemain a,
li.activemain a:hover {
  color: var(--achl-accent) !important;
}

.tabmain-content,
.tabmenu-content {
  background: var(--achl-surface-1);
  border: 1px solid var(--achl-border);
  border-radius: 0 var(--achl-radius-sm) var(--achl-radius-sm) var(--achl-radius-sm);
}

/* -----------------------------------------------------------------------------
   Forms, Bootstrap controls, STHS buttons
   ----------------------------------------------------------------------------- */
body .form-control,
body select:not(.tablesorter-filter),
body textarea,
body input[type="text"],
body input[type="search"],
body input[type="password"],
body input[type="email"],
body input[type="number"],
body input[type="date"],
body input[type="url"] {
  background-color: var(--achl-surface-2);
  border: 1px solid var(--achl-border-strong);
  color: var(--achl-text);
  border-radius: var(--achl-radius-sm);
}

body .form-control:focus,
body select:focus,
body textarea:focus,
body input[type="text"]:focus,
body input[type="search"]:focus,
body input[type="password"]:focus,
body input[type="email"]:focus,
body input[type="number"]:focus {
  background-color: var(--achl-bg-elevated);
  border-color: var(--achl-accent);
  color: var(--achl-text);
  box-shadow: var(--achl-focus-ring);
}

body .form-control::placeholder,
body input::placeholder,
body textarea::placeholder {
  color: var(--achl-text-muted);
}

body .btn-primary {
  background: rgba(110, 176, 255, 0.2);
  border-color: var(--achl-accent);
  color: var(--achl-accent);
}

body .btn-primary:hover,
body .btn-primary:focus {
  background: rgba(110, 176, 255, 0.32);
  border-color: var(--achl-accent);
  color: #fff;
}

body .btn-secondary,
body .btn-outline-secondary {
  background: var(--achl-surface-2);
  border-color: var(--achl-border-strong);
  color: var(--achl-text);
}

body .btn-secondary:hover,
body .btn-outline-secondary:hover {
  background: var(--achl-surface-1);
  border-color: var(--achl-accent);
  color: var(--achl-accent);
}

body .btn-outline-primary {
  border-color: var(--achl-accent);
  color: var(--achl-accent);
}

body .btn-outline-primary:hover {
  background: rgba(110, 176, 255, 0.15);
  color: #fff;
}

.SubmitButton {
  background: rgba(110, 176, 255, 0.18) !important;
  border: 1px solid var(--achl-accent) !important;
  color: var(--achl-accent) !important;
  font-family: var(--achl-font-body) !important;
  border-radius: var(--achl-radius-sm) !important;
  padding: 6px 16px !important;
  cursor: pointer;
  transition: background var(--achl-transition), color var(--achl-transition);
}

.SubmitButton:hover {
  background: rgba(110, 176, 255, 0.3) !important;
  color: #fff !important;
}

.FilterTip {
  background-color: var(--achl-surface-1) !important;
  border: 1px solid var(--achl-border-strong) !important;
  color: var(--achl-text);
  border-radius: var(--achl-radius-sm);
}

/* -----------------------------------------------------------------------------
   #cssmenuLogin (pages without full site header chrome)
   ----------------------------------------------------------------------------- */
#cssmenuLogin {
  font-family: var(--achl-font-display);
}

#cssmenuLogin > ul > li > a {
  color: var(--achl-text-on-header) !important;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: var(--achl-radius-sm);
  transition: background var(--achl-transition), color var(--achl-transition);
}

#cssmenuLogin > ul > li.has-sub > a {
  padding-right: 36px !important;
}

#cssmenuLogin > ul > li.has-sub > a:after {
  top: calc(50% - 1px);
  right: 13px;
}

#cssmenuLogin > ul > li.has-sub > a:before {
  top: calc(50% - 4px);
  right: 16px;
}

#cssmenuLogin > ul > li.has-sub:hover > a:before {
  top: calc(50% - 1px);
}

#cssmenuLogin > ul > li:hover > a {
  color: #fff !important;
  background: rgba(110, 176, 255, 0.12);
}

#cssmenuLogin > ul > li.has-sub > a:after,
#cssmenuLogin > ul > li.has-sub > a:before {
  background: var(--achl-text-on-header) !important;
}

#cssmenuLogin ul ul {
  background: var(--achl-surface-1) !important;
  border: 1px solid var(--achl-border-strong);
  border-radius: var(--achl-radius-sm);
  box-shadow: var(--achl-shadow);
}

#cssmenuLogin ul ul li a {
  color: var(--achl-text) !important;
  font-family: var(--achl-font-body);
  font-size: 14px;
  text-transform: none;
  letter-spacing: normal;
}

#cssmenuLogin ul ul li a:hover {
  background: rgba(110, 176, 255, 0.1) !important;
  color: var(--achl-accent) !important;
  text-decoration: none !important;
}

@media (max-width: 991px) {
  #cssmenuLogin #menu-button {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--achl-border-strong);
    border-radius: var(--achl-radius-sm);
    color: var(--achl-text-on-header);
    font-family: var(--achl-font-display);
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 10px 14px;
    margin-bottom: 8px;
  }

  #cssmenuLogin #menu-button:after,
  #cssmenuLogin #menu-button:before {
    border-top-color: var(--achl-text-on-header) !important;
    background: var(--achl-text-on-header) !important;
  }

  #cssmenuLogin .submenu-button:after,
  #cssmenuLogin .submenu-button:before {
    background: var(--achl-text) !important;
  }

  #cssmenuLogin ul li a,
  #cssmenuLogin ul ul li a {
    color: var(--achl-text) !important;
  }
}

/* -----------------------------------------------------------------------------
   Team name in main nav (dark bar; legacy classes use black text)
   ----------------------------------------------------------------------------- */
#site-header-bar #cssmenu > ul > li > a[class*="STHSPHPTeamHeader_TeamNameColor"],
#site-top-chrome #cssmenu > ul > li > a[class*="STHSPHPTeamHeader_TeamNameColor"] {
  color: var(--achl-text-on-header) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

#site-header-bar #cssmenu > ul > li:hover > a[class*="STHSPHPTeamHeader_TeamNameColor"],
#site-top-chrome #cssmenu > ul > li:hover > a[class*="STHSPHPTeamHeader_TeamNameColor"] {
  color: #fff !important;
}

/* ProTeam stats line under name — readable on dark body below banner */
body .STHSPHPTeamHeader_Stat {
  color: var(--achl-text-muted);
}

/* -----------------------------------------------------------------------------
   Content width, subtle motion (sticky chrome: see #site-top-chrome above)
   ----------------------------------------------------------------------------- */
body .STHSTableFullW {
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .STHSTableFullW,
  .STHSIndex_GamesResult,
  .STHSIndex_HeadlineTable,
  .STHSIndex_Top5Table {
    transition: box-shadow var(--achl-transition), transform var(--achl-transition);
  }

  .STHSTableFullW:hover,
  .STHSIndex_GamesResult:hover,
  .STHSIndex_HeadlineTable:hover,
  .STHSIndex_Top5Table:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  }

  #ScoreTicker {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      0 0 20px rgba(110, 176, 255, 0.06);
  }
}

/* -----------------------------------------------------------------------------
   Misc: hide team strip duplicate rule on mobile (legacy STHSMain)
   ----------------------------------------------------------------------------- */
@media all and (max-width: 768px) {
  #site-top-chrome .STHSPHPMenuDiv {
    padding: 6px 8px;
  }
}

/* -----------------------------------------------------------------------------
   Pro team Finance tab — multi-year salary outlook
   ----------------------------------------------------------------------------- */
.STHSPHPTeam_FinanceSalaryOutlook {
  width: 100%;
  table-layout: fixed;
}

.STHSPHPTeam_FinanceSalaryOutlook th.STHSPHPTeam_FinanceSalaryOutlookHead {
  background: #0d0d0d;
  color: #f6f8fa;
  font-weight: 600;
  font-size: 0.82rem;
  text-align: center;
  vertical-align: middle;
  padding: 10px 6px;
  border: 1px solid var(--achl-border-strong, rgba(255, 255, 255, 0.14));
}

.STHSPHPTeam_FinanceSalaryOutlook td.STHSPHPTeam_FinanceSalaryOutlookCell {
  background: var(--achl-surface-1, #1c2128);
  color: var(--achl-text, #e6edf3);
  text-align: center;
  vertical-align: top;
  padding: 12px 8px;
  border: 1px solid var(--achl-border, rgba(255, 255, 255, 0.08));
}

.STHSPHPTeam_FinanceSalaryOutlookTotal {
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
}

.STHSPHPTeam_FinanceSalaryOutlookRetained {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--achl-text-muted, #8b949e);
  line-height: 1.3;
}

@media all and (max-width: 900px) {
  .STHSPHPTeam_FinanceSalaryOutlook th.STHSPHPTeam_FinanceSalaryOutlookHead,
  .STHSPHPTeam_FinanceSalaryOutlook td.STHSPHPTeam_FinanceSalaryOutlookCell {
    font-size: 0.72rem;
    padding: 8px 4px;
  }

  .STHSPHPTeam_FinanceSalaryOutlookRetained {
    font-size: 0.68rem;
  }
}

/* -----------------------------------------------------------------------------
   Playoff boxscores (ACHL-PLF-*.php): inline :root is light; these reinforce dark skin
   after overwrite + ACHLAppShell load.
   ----------------------------------------------------------------------------- */
.achl-boxscore-shell {
  width: 100%;
}

.achl-boxscore-shell .STHSBoxScore_MainDiv,
.achl-boxscore-shell .tabmain-content,
.achl-boxscore-shell .tabmain {
  color: var(--achl-text, #e6edf3);
}

.achl-boxscore-shell .STHSBoxScore_MainDiv {
  padding: 12px 10px 20px;
  border: 1px solid var(--achl-border, rgba(255, 255, 255, 0.08));
  border-radius: var(--achl-radius, 10px);
  background:
    linear-gradient(180deg, rgba(20, 34, 56, 0.94) 0%, rgba(17, 29, 49, 0.98) 100%);
  box-shadow: var(--achl-shadow, 0 10px 28px rgba(0, 0, 0, 0.35));
}

.achl-boxscore-shell .tabmain-links a:link,
.achl-boxscore-shell .tabmain-links a:visited {
  color: var(--achl-text-muted, #c5ced9) !important;
}

.achl-boxscore-shell .tabmain-links li.activemain a,
.achl-boxscore-shell .tabmain-links a:hover {
  color: var(--achl-accent, #7cc8ff) !important;
}

.achl-boxscore-shell .STHSBoxScore_Result,
.achl-boxscore-shell .STHSBoxScore_NowTime,
.achl-boxscore-shell .STHSBoxScore_Goals th,
.achl-boxscore-shell .STHSBoxScore_Shots th,
main.achl-main .STHSBoxScore_Result,
main.achl-main .STHSBoxScore_NowTime,
main.achl-main .STHSBoxScore_Goals th,
main.achl-main .STHSBoxScore_Shots th {
  color: var(--achl-text, #e6edf3);
}

.achl-boxscore-shell table.STHSBoxScore_GoalsTable,
.achl-boxscore-shell table.STHSBoxScore_ShotsTable,
.achl-boxscore-shell table[class*="STHSBoxScore"],
main.achl-main table.STHSBoxScore_GoalsTable,
main.achl-main table.STHSBoxScore_ShotsTable,
main.achl-main table[class*="STHSBoxScore"] {
  background: var(--achl-surface-1, #1c2128);
  color: var(--achl-text, #e6edf3);
}

.achl-boxscore-shell table[class*="STHSBoxScore"] th,
main.achl-main table[class*="STHSBoxScore"] th {
  background: var(--achl-surface-2, #22272e);
  color: var(--achl-text, #e6edf3);
}

.achl-boxscore-shell table[class*="STHSBoxScore"] td,
main.achl-main table[class*="STHSBoxScore"] td {
  border-color: var(--achl-border, rgba(255, 255, 255, 0.08));
}

.achl-boxscore-shell .STHSBoxScore_Lines_Table,
.achl-boxscore-shell .STHSBoxScore_Lines_Table th,
.achl-boxscore-shell .STHSBoxScore_Lines_Table td {
  background: var(--achl-surface-1, #1c2128);
  color: var(--achl-text, #e6edf3);
  border-color: var(--achl-border, rgba(255, 255, 255, 0.08));
}

.achl-boxscore-shell .STHSBoxScore_PeriodPerPeriod a:link,
.achl-boxscore-shell .STHSBoxScore_PeriodPerPeriod a:visited,
.achl-boxscore-shell table[class*="STHSBoxScore"] a:link,
.achl-boxscore-shell table[class*="STHSBoxScore"] a:visited {
  color: var(--achl-accent, #7cc8ff) !important;
}
