/* ====================================================================
   STHSMain-CSSOverwrite.css
   --------------------------------------------------------------------
   STHS game sheets include this file automatically if present (via the
   inline <?php If (file_exists("STHSMain-CSSOverwrite.css") == True) ...?>
   hook at the top of every generated .php). We use it to repaint STHS's
   default white/gray theme to match the RWHA dark site theme, without
   modifying the STHS-generated HTML itself.
   ==================================================================== */

/* ---- Page chrome ---- */
body {
  background: #0A0A0B !important;            /* var(--ink) */
  color: #FFFFFF !important;                 /* var(--paper) */
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Helvetica, sans-serif !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* RWHA back bar — STHSMain.js injects an <a class="rwha-gs-backbar"> at
   the top of <body>. Styled here so it matches the site's dark theme. */
.rwha-gs-backbar {
  display: block;
  position: sticky; top: 0;
  z-index: 1000;
  padding: 12px 20px;
  background: #131316;
  border-bottom: 1px solid #2C323A;
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  transition: background 120ms ease;
}
.rwha-gs-backbar:hover { background: #1C1C21; color: #3AB57C !important; }

/* Pull the actual STHS content out from under our sticky bar. */
body > h1:first-of-type { margin-top: 24px !important; }

/* Hide inactive tab panels. STHS marks the first one .active; JS toggles
   the others. Without JS we still only show Summary instead of stacking all 4. */
.tabmain                { display: none !important; }
.tabmain.active         { display: block !important; }

/* ---- Headings ---- */
h1, h2, h3, h4 {
  color: #FFFFFF !important;
  font-family: 'Inter', system-ui, sans-serif !important;
}
.STHSBoxScore_Result {
  font-size: 22px !important;
  letter-spacing: 0.02em;
  padding: 0 20px;
}
.STHSBoxScore_NowTime {
  color: #B8B5AC !important;
  font-weight: 400 !important;
  font-size: 12px !important;
  padding: 0 20px;
}

/* ---- Tables: kill the white/odd-even and apply our dark palette ---- */
table {
  background: transparent !important;
  border-collapse: collapse !important;
}
th {
  background: #1C1C21 !important;
  color: #FFFFFF !important;
  border-bottom: 1px solid #2C323A !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px !important;
  padding: 8px 10px !important;
}
td {
  background: transparent !important;
  color: #FFFFFF !important;
  border-bottom: 1px solid #2C323A !important;
  padding: 7px 10px !important;
  font-size: 13px !important;
}
tr:hover td { background: #131316 !important; }

/* STHS uses alternating row classes — neutralize them. */
.tablesorter tbody tr:nth-child(odd)  td { background: transparent !important; }
.tablesorter tbody tr:nth-child(even) td { background: rgba(255,255,255,0.02) !important; }

/* ---- Tab nav at top (Summary / Team Stats / Lines / Play-by-Play) ---- */
.tabsmain {
  margin: 0 20px !important;
  border: 1px solid #2C323A;
  border-radius: 6px;
  background: #131316;
  overflow: hidden;
}
.tabmain-links {
  list-style: none !important;
  display: flex !important;
  margin: 0 !important; padding: 0 !important;
  background: #131316 !important;
  border-bottom: 1px solid #2C323A !important;
}
.tabmain-links li {
  flex: 1;
  margin: 0 !important;
}
.tabmain-links li a {
  display: block;
  padding: 14px 20px !important;
  background: transparent !important;
  color: #B8B5AC !important;
  text-decoration: none !important;
  text-align: center;
  font-weight: 600 !important;
  font-size: 13px !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 0 !important;
  border-right: 1px solid #2C323A !important;
  transition: background 120ms, color 120ms;
}
.tabmain-links li:last-child a { border-right: 0 !important; }
.tabmain-links li a:hover {
  background: #1C1C21 !important;
  color: #FFFFFF !important;
}
.tabmain-links li.activemain a {
  background: #1C1C21 !important;
  color: #3AB57C !important;                /* team accent */
  border-bottom: 2px solid #3AB57C !important;
}
.tabmain {
  padding: 24px !important;
  background: transparent !important;
}

/* ---- Goals/shots/period header tables at top of Summary ---- */
/* Layout: STHS lays the two tables side-by-side in a wrapper <table>.
   We use table-layout: fixed on the WRAPPER (50%/50% cells), and on the
   inner tables we rely on a <colgroup> that STHSMain.js injects at load
   (40%/15%/15%/15%/15%) — that's the only way to force equal column
   proportions when the first row is a single <th colspan="5">. */
.STHSBoxScore_GoalsShotsMainTable {
  margin: 16px 20px !important;
  width: calc(100% - 40px) !important;
  table-layout: fixed !important;
  border-collapse: separate !important;
  border-spacing: 16px 0 !important;          /* gap between Goals + Shots tables */
}
.STHSBoxScore_GoalsShotsMainTable > tbody > tr > td {
  width: 50%;
  vertical-align: top;
  padding: 0 !important;
  border: 0 !important;
}
.STHSBoxScore_GoalsTable, .STHSBoxScore_ShotsTable {
  width: 100% !important;
  table-layout: fixed !important;             /* respect the <colgroup> JS injects */
  background: #131316 !important;
  border: 1px solid #2C323A;
  border-radius: 6px;
  overflow: hidden;
}
/* Override STHS's STHSW* fixed pixel widths — without these, content
   width still won the fight in some cells. */
.STHSW200, .STHSW140Min, .STHSW140, .STHSW55, .STHSW35, .STHSW25 {
  width: auto !important;
  min-width: 0 !important;
}
/* Left-align team-name cell in row 2 + data rows; center everything else. */
.STHSBoxScore_GoalsTable td:first-child,
.STHSBoxScore_ShotsTable td:first-child {
  text-align: left !important; padding-left: 14px !important;
}
.STHSBoxScore_GoalsTable td:not(:first-child),
.STHSBoxScore_ShotsTable td:not(:first-child) {
  text-align: center !important;
}

.STHSBoxScore_GoalsTable th, .STHSBoxScore_ShotsTable th {
  background: #1C1C21 !important;
  text-align: center !important;
  padding: 10px 8px !important;
  font-size: 11px !important;
  letter-spacing: 0.12em;
  color: #B8B5AC !important;
}
.STHSBoxScore_GoalsPeriodHeader, .STHSBoxScore_ShotsPeriodHeader {
  background: #131316 !important;
  color: #B8B5AC !important;
  font-weight: 700 !important;
  font-size: 11px !important;
}
.STHSBoxScore_GoalsTotalHeader, .STHSBoxScore_ShotsTotalHeader {
  background: #131316 !important;
  color: #3AB57C !important;
  font-weight: 700 !important;
}
.STHSBoxScore_GoalsPeriod, .STHSBoxScore_ShotsPeriod {
  text-align: center !important;
  font-family: 'JetBrains Mono', ui-monospace, monospace !important;
  font-size: 16px !important;
}
.STHSBoxScore_GoalsTotal, .STHSBoxScore_ShotsTotal {
  text-align: center !important;
  font-family: 'JetBrains Mono', ui-monospace, monospace !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #3AB57C !important;
}
.STHSBoxScore_GoalsTeamName, .STHSBoxScore_ShotsTeamName {
  font-weight: 700 !important;
  font-size: 14px !important;
}

/* ---- Period-by-period summary box ---- */
.STHSBoxScore_PeriodPerPeriod {
  width: 100% !important;
}
.STHSBoxScore_PeriodPerPeriod_Header {
  background: #1C1C21 !important;
  color: #3AB57C !important;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 10px 12px !important;
}

/* ---- Player roster tables (Team Stats tab) ---- */
.STHSBoxScore_PlayerStatTitle {
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 16px;
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid #3AB57C;
}

/* ---- Lines tab — proper section spacing + site colors ---- */
/* The team header ("Oilers", "Mongoloids") above each team's lines block. */
.STHSBoxScore_TeamLine {
  color: #FFFFFF !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em;
  padding: 8px 12px 6px !important;
  margin: 36px 0 18px !important;
  border-bottom: 2px solid #3AB57C;
  text-transform: uppercase;
}
.STHSBoxScore_TeamLine:first-of-type { margin-top: 8px !important; }

/* Each lines table (5v5 Forward / 5v5 Defense / PP F / PP D / PK ...). */
.STHSBoxScore_Lines_Table {
  width: 100% !important;
  margin: 0 0 18px !important;
  background: #131316 !important;
  border: 1px solid #2C323A !important;
  border-radius: 6px !important;
  overflow: hidden;
}
/* First row is the section label ("5 vs 5 Forward" etc.) spanning all cols. */
.STHSBoxScore_Lines_Table tr:first-child th {
  background: #1C1C21 !important;
  color: #3AB57C !important;
  text-transform: uppercase !important;
  letter-spacing: 0.14em !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  padding: 12px 14px !important;
  text-align: left !important;
  border-bottom: 1px solid #2C323A !important;
}
/* Column headers (Line # / Left Wing / Center / etc.). */
.STHSBoxScore_Lines_Table tr:nth-child(2) th {
  background: #0A0A0B !important;
  color: #B8B5AC !important;
  font-size: 10px !important;
  letter-spacing: 0.1em !important;
  padding: 8px 10px !important;
  border-bottom: 1px solid #2C323A !important;
  text-align: left !important;
}
/* Data rows. */
.STHSBoxScore_Lines_Table tbody tr td,
.STHSBoxScore_Lines_Table tr td {
  padding: 10px !important;
  font-size: 13px !important;
  border-bottom: 1px solid rgba(42, 42, 49, 0.5) !important;
}
.STHSBoxScore_Lines_Table tr:last-child td { border-bottom: 0 !important; }
.STHSBoxScore_Lines_Table tr:hover td { background: rgba(255, 255, 255, 0.02) !important; }

/* The STHSBlankDiv has zero height by default — give it real breathing room. */
.STHSBlankDiv {
  height: 0 !important;             /* don't double-count — table margin covers spacing */
  display: block !important;
  clear: both;
}
/* Big air between line-sections. */
.STHSBoxScore_Lines_Table + .STHSBlankDiv + .STHSBoxScore_Lines_Table,
.STHSBoxScore_Lines_Table + .STHSBoxScore_Lines_Table {
  margin-top: 32px !important;
}
.STHSBoxScore_Lines_Table {
  margin: 32px 0 0 !important;       /* ensure each table has top space */
}
.STHSBoxScore_Lines_Table:first-of-type { margin-top: 8px !important; }

/* ---- Per-team Lines sub-tabs (injected by STHSMain.js splitLinesByTeam) ---- */
/* The lines panel now starts with a tab bar; each team's content is a
   .rwha-lines-section that's hidden unless .is-active. Style the bar so
   it visually distinct from the main top-of-page tabs. */
.rwha-lines-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 20px;
  padding: 4px;
  background: #1C1C21;
  border: 1px solid #2C323A;
  border-radius: 6px;
  width: fit-content;
}
.rwha-lines-tab {
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 8px 18px;
  background: transparent;
  color: #B8B5AC;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.rwha-lines-tab:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.04); }
.rwha-lines-tab.is-active {
  background: #3AB57C;
  color: #0A0A0B;
}
.rwha-lines-section { display: none; }
.rwha-lines-section.is-active { display: block; }

/* ---- Player link styling — these get rewritten via PlayerReport.php redirect ---- */
a { color: #3AB57C !important; text-decoration: none !important; }
a:hover { text-decoration: underline !important; color: #FFFFFF !important; }

/* ---- Links in the body that aren't player links — softer treatment ---- */
.tabmain-links li a, .STHSBoxScore_TeamName a { color: inherit !important; }

/* ---- Hide STHS's empty footer placeholder ---- */
.STHSFooter, .STHSBoxScore_Footer { display: none !important; }

/* ---- RWHA-branded footer at the very bottom of every game sheet ---- */
/* Emitted by games/<year>/<folder>/Footer.php, which STHS includes on
   the last line of every .php. Provides the closing </body></html> too,
   and silences the warning STHS would otherwise throw for the missing
   include. */
.rwha-gs-footer {
  margin-top: 40px;
  padding: 18px 24px;
  background: #131316;
  border-top: 1px solid #2C323A;
  color: #B8B5AC;
  font-size: 12px;
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: 0.04em;
}
.rwha-gs-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
}
.rwha-gs-footer__brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: #FFFFFF !important;
  text-decoration: none !important;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 12px;
}
.rwha-gs-footer__brand img { display: block; }
.rwha-gs-footer__nav { display: inline-flex; gap: 18px; }
.rwha-gs-footer__nav a {
  color: #B8B5AC !important;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 600;
  transition: color 120ms ease;
}
.rwha-gs-footer__nav a:hover { color: #3AB57C !important; }

/* ---- Mobile tweaks ---- */
@media (max-width: 720px) {
  .tabmain-links { flex-direction: column; }
  .tabmain-links li a { border-right: 0 !important; border-bottom: 1px solid #2C323A !important; }
  .STHSBoxScore_GoalsShotsMainTable { margin: 12px !important; }
  .STHSBoxScore_GoalsShotsMainTable td { display: block; width: 100% !important; }
  table, thead, tbody, tr, td, th { font-size: 11px !important; }
}
