/* ==================================================================
   Screen Standings — standalone CSS for /screen-standings
   Optimized for 1080×2560 portrait kiosk display
   Pixel-based sizing for the kiosk; viewport meta width=1080
   handles scaling on smaller screens.
   ================================================================== */

:root {
  --hd-standings-bg-image: url("/wp-content/plugins/hockeydata-content/assets/bg-u13-endturnier.png");
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body.hd-content-standings-screen {
  min-height: 100%;
  background-color: rgb(21, 61, 138) !important;
  font-family: "Roboto Condensed", "Roboto", Arial, Helvetica, sans-serif;
}

main.hd-content.hd-content-standings-screen {
  min-height: 100%;
  position: relative;
  overflow: visible;
  padding: 20px 24px;
  width: 100%;
  margin: 0 auto;
}

/* Background image — covers full viewport */
main.hd-content.hd-content-standings-screen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 2560px;
  background-image: var(--hd-standings-bg-image);
  background-position: top center;
  background-repeat: no-repeat;
  background-size: 100% auto;
  opacity: 1;
  pointer-events: none;
  z-index: 0;
}

main.hd-content.hd-content-standings-screen > * {
  position: relative;
  z-index: 1;
}

/* --- Section spacing --- */
.hd-standings-section {
  margin-bottom: 16px;
}
.hd-standings-section:last-child {
  margin-bottom: 0;
}

/* --- Heading --- */
.hd-standings-heading {
  font-family: "Roboto Condensed", "Roboto", Arial, Helvetica, sans-serif;
  font-size: 64px;
  font-style: normal;
  font-weight: 900;
  height: auto;
  letter-spacing: 10px;
  line-height: 1.1;
  color: #f2e11f;
  text-shadow: 2px 2px 5px black;
  text-align: left;
  text-transform: uppercase;
  margin: 0 0 8px;
  padding: 8px 20px;
}

/* --- LOS Standings table wrapper (if used) --- */
.hd-content-standings-screen .-hd-los-standings {
  width: 100% !important;
  max-width: 100% !important;
  color: #fff !important;
  font-family: "Roboto Condensed", sans-serif !important;
}

.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px !important;
  background: transparent !important;
}

.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data {
  width: max-content !important;
  min-width: 100% !important;
}

.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data table {
  width: max-content !important;
  min-width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 12px !important;
}

.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data thead th {
  color: #f2e11f !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  line-height: 1.05 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
  background: rgba(30, 88, 199, 0.62) !important;
  padding: 10px 12px !important;
  white-space: nowrap !important;
  position: sticky;
  top: 0;
  z-index: 4;
}

.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data tbody tr {
  background: rgba(9, 24, 58, 0.78) !important;
}

.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data tbody td {
  color: #fff !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
  background: transparent !important;
  padding: 12px 12px !important;
  border: 0 !important;
}

.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data tbody tr td:first-child {
  border-radius: 12px 0 0 12px !important;
}
.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data tbody tr td:last-child {
  border-radius: 0 12px 12px 0 !important;
}

.hd-content-standings-screen .-hd-los-standings .-hd-los-standings-col-tableRank {
  color: #f2e11f !important;
  font-weight: 900 !important;
}
.hd-content-standings-screen .-hd-los-standings .-hd-los-standings-col-teamLongname {
  min-width: 420px !important;
  white-space: normal !important;
  line-height: 1.08 !important;
}
.hd-content-standings-screen .-hd-los-standings .-hd-los-standings-team-logo img {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  object-fit: contain !important;
}
.hd-content-standings-screen .-hd-los-standings .-hd-los-standings-col-points {
  color: #f2e11f !important;
  font-weight: 900 !important;
}

/* Sticky first 3 columns */
.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data thead th:nth-child(1),
.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data tbody td:nth-child(1) {
  position: sticky; left: 0; z-index: 6;
  background: rgba(9, 24, 58, 0.78) !important;
}
.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data thead th:nth-child(2),
.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data tbody td:nth-child(2) {
  position: sticky; left: 62px; z-index: 6;
  background: rgba(9, 24, 58, 0.78) !important;
}
.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data thead th:nth-child(3),
.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data tbody td:nth-child(3) {
  position: sticky; left: 134px; z-index: 6;
  background: rgba(9, 24, 58, 0.78) !important;
}

.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data tbody tr:nth-child(odd) td {
  background-color: rgba(9, 24, 58, 0.78) !important;
}
.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data tbody tr:nth-child(even) td {
  background-color: rgba(12, 31, 74, 0.78) !important;
}
.hd-content-standings-screen .-hd-los-standings .-hd-util-intellitable-data tbody tr td {
  border-top: 1px solid rgba(47, 91, 178, 0.22) !important;
  border-bottom: 1px solid rgba(47, 91, 178, 0.22) !important;
}

/* ==================================================================
   Gameplan schedule rows in standings context
   Override screen-live.css values to fit kiosk height.
   screen-live.css base: center 120px, logos 60px, team-name 30px
   ================================================================== */
.hd-content-standings-screen .hd-live-schedule-list {
  padding: 0;
}

.hd-content-standings-screen .hd-live-schedule-row {
  grid-template-columns: 74px minmax(0, 1fr) 150px minmax(0, 1fr) 74px;
  margin: 4px 0;
  padding: 4px 8px;
}

.hd-content-standings-screen .hd-live-schedule-row a {
  display: contents;
}

.hd-content-standings-screen .hd-live-schedule-center {
  height: 80px !important;
  padding: 4px 6px !important;
  font-size: 20px;
}

.hd-content-standings-screen .hd-live-schedule-center.hd-live-schedule-center-has-score {
  font-size: 3.5em;
}

.hd-content-standings-screen .hd-live-schedule-team-name {
  font-size: 26px;
}

.hd-content-standings-screen .hd-live-schedule-logo img {
  max-width: 50px;
  max-height: 50px;
}

/* Gameplan row link styling */
.hd-live-schedule-row-link {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 150px minmax(0, 1fr) 74px;
  column-gap: 8px;
  align-items: center;
  width: 100%;
  text-decoration: none;
  color: inherit;
}

.hd-live-schedule-row-link:hover,
.hd-live-schedule-row-link:focus {
  text-decoration: none;
  color: inherit;
}

/* ==================================================================
   Custom Tournament Standings Table ("Tabelle")
   Optimized to fit within 1080px (1032px content area)
   12 columns: rank(80) + logo(56) + team(flex) + 9×stat(~65ea)
   ================================================================== */
.hd-tabelle-wrapper {
  width: 100%;
  overflow-x: hidden;
  border-radius: 14px;
}

.hd-tabelle {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 6px;
  font-family: "Roboto Condensed", "Roboto", Arial, Helvetica, sans-serif;
}

.hd-tabelle thead th {
  color: #f2e11f;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: rgba(30, 88, 199, 0.62);
  padding: 8px 6px;
  white-space: nowrap;
  text-align: center;
  height: 48px;
  vertical-align: middle;
  overflow: hidden;
}

.hd-tabelle thead th.hd-tabelle-col-rank,
.hd-tabelle thead th.hd-tabelle-col-logo {
  text-align: center;
}

.hd-tabelle thead th.hd-tabelle-col-team {
  text-align: left;
}

.hd-tabelle tbody tr td {
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  padding: 8px 6px;
  border: 0;
  text-align: center;
  vertical-align: middle;
  height: 90px;
  border-top: 1px solid rgba(47, 91, 178, 0.22);
  border-bottom: 1px solid rgba(47, 91, 178, 0.22);
  overflow: hidden;
}

/* Column widths for table-layout: fixed — must total ~1032px */
.hd-tabelle .hd-tabelle-col-rank  { width: 90px; }
.hd-tabelle .hd-tabelle-col-logo  { width: 70px; }
.hd-tabelle .hd-tabelle-col-team  { /* auto — takes remaining space */ }
.hd-tabelle .hd-tabelle-col-num   { width: 62px; }
.hd-tabelle .hd-tabelle-col-pts   { width: 62px; }

/* Rounded row corners */
.hd-tabelle tbody tr td:first-child {
  border-radius: 12px 0 0 12px;
}
.hd-tabelle tbody tr td:last-child {
  border-radius: 0 12px 12px 0;
}

/* Alternating rows */
.hd-tabelle tbody tr:nth-child(odd) td {
  background-color: rgba(9, 24, 58, 0.78);
}
.hd-tabelle tbody tr:nth-child(even) td {
  background-color: rgba(12, 31, 74, 0.78);
}

/* Rank column */
.hd-tabelle td.hd-tabelle-col-rank {
  color: #f2e11f;
  font-weight: 900;
  text-align: center;
  vertical-align: middle;
}

/* Trophy / medal images */
.hd-tabelle-trophy {
  display: block;
  width: 60px;
  height: 60px;
  margin: 0 auto;
  object-fit: contain;
}

/* Glow effects on trophy/medals */
.hd-tabelle-trophy-1 {
  filter: drop-shadow(0 0 8px rgba(255,215,0,0.6)) drop-shadow(1px 1px 3px rgba(0,0,0,0.5));
}
.hd-tabelle-trophy-2 {
  filter: drop-shadow(0 0 6px rgba(192,192,192,0.5)) drop-shadow(1px 1px 3px rgba(0,0,0,0.5));
}
.hd-tabelle-trophy-3 {
  filter: drop-shadow(0 0 6px rgba(205,127,50,0.5)) drop-shadow(1px 1px 3px rgba(0,0,0,0.5));
}

/* Rank number (for 4th place and beyond) */
.hd-tabelle-rank-num {
  display: block;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  color: #f2e11f;
}
.hd-tabelle-rank-num-plain {
  font-size: 44px;
}

/* Logo column */
.hd-tabelle .hd-tabelle-col-logo {
  text-align: center;
  padding: 4px;
}
.hd-tabelle .hd-tabelle-col-logo img {
  width: 56px;
  height: 56px;
  max-width: 56px;
  max-height: 56px;
  object-fit: contain;
  vertical-align: middle;
}

/* Team name column */
.hd-tabelle td.hd-tabelle-col-team {
  text-align: left;
  white-space: normal;
  line-height: 1.08;
  padding-left: 10px;
}

/* Points column */
.hd-tabelle .hd-tabelle-col-pts {
  color: #f2e11f;
  font-weight: 900;
}

/* ==================================================================
   Livestream Promo
   ================================================================== */
.hd-livestream-promo {
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(9, 24, 58, 0.78);
  border-radius: 14px;
  padding: 20px 30px;
  overflow: hidden;
}

.hd-livestream-qr img {
  display: block;
  width: 150px;
  height: 150px;
}

.hd-livestream-text {
  color: #fff;
  font-family: "Roboto Condensed", "Roboto", Arial, Helvetica, sans-serif;
  min-width: 0;
  flex: 1;
}

.hd-livestream-text p {
  margin: 0 0 8px;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.15;
}

.hd-livestream-text .hd-livestream-url {
  color: #f2e11f;
  font-size: 28px;
  font-weight: 900;
  text-transform: none;
  word-break: break-all;
  overflow-wrap: break-word;
  text-decoration: none;
}

.hd-livestream-text a.hd-livestream-url:hover {
  text-decoration: underline;
}

/* ==================================================================
   Stats Tables (Top Scorer, Beste Torhüter) — ?stats=1 view
   Scoped to .hd-stats-tabelle — no impact on main standings table
   ================================================================== */
.hd-stats-tabelle {
  table-layout: fixed;
}

.hd-stats-tabelle .hd-tabelle-col-stats-nr {
  width: 62px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
}

.hd-stats-tabelle .hd-tabelle-col-stats-name {
  /* auto — takes remaining space */
  text-align: left;
  padding-left: 10px;
  white-space: normal;
  line-height: 1.08;
}

.hd-stats-tabelle .hd-tabelle-col-stats-team {
  width: 200px;
  text-align: left;
  padding-left: 10px;
  white-space: normal;
  line-height: 1.08;
  color: rgba(255, 255, 255, 0.75);
}

.hd-stats-tabelle .hd-tabelle-col-stats-min {
  width: 100px;
  text-align: center;
  font-weight: 700;
}

.hd-stats-tabelle .hd-tabelle-col-stats-ga {
  width: 120px;
  text-align: center;
  color: #f2e11f;
  font-weight: 900;
}

/* ==================================================================
   Mobile Responsive Overrides
   Active ONLY when viewport = device-width (phones / small tablets).
   The kiosk locks viewport to width=1080, so max-width:768px
   NEVER matches on the kiosk — all kiosk styles above stay untouched.
   ================================================================== */
@media screen and (max-width: 768px) {

  /* --- Prevent scrolling past content --- */
  html, body {
    height: auto !important;
    min-height: 100vh;
  }

  /* --- Layout --- */
  main.hd-content.hd-content-standings-screen {
    padding: 10px 12px !important;
    min-height: auto !important;
  }

  /* Background pseudo — match content height, don't force extra scroll */
  main.hd-content.hd-content-standings-screen::before {
    min-height: unset;
    height: 100%;
    background-size: 100% auto;
  }

  /* --- Gameplan section: scale padding-top proportionally --- */
  /* Kiosk: 660px on 1080px width = 61.1%.  Using vw keeps it proportional. */
  .hd-standings-gameplan {
    padding-top: 61vw !important;
  }

  /* --- Section spacing --- */
  .hd-standings-section {
    margin-bottom: 10px;
  }

  /* --- Headings --- */
  .hd-standings-heading {
    font-size: 28px !important;
    letter-spacing: 3px !important;
    padding: 4px 10px !important;
    margin: 0 0 6px !important;
  }

  /* --- Gameplan schedule rows --- */
  .hd-content-standings-screen .hd-live-schedule-row {
    grid-template-columns: 36px minmax(0, 1fr) 72px minmax(0, 1fr) 36px 18px !important;
    margin: 3px 0 !important;
    padding: 3px 4px !important;
    transition: background 0.12s ease;
  }

  /* Tap highlight — brief yellow flash */
  .hd-content-standings-screen .hd-live-schedule-row:active {
    background: rgba(242, 225, 31, 0.18) !important;
  }

  .hd-live-schedule-row-link {
    grid-template-columns: 36px minmax(0, 1fr) 72px minmax(0, 1fr) 36px 18px !important;
    column-gap: 4px !important;
    -webkit-tap-highlight-color: transparent;
  }

  /* Yellow chevron indicating tappable row */
  .hd-live-schedule-row-link::after {
    content: "\203A"; /* › single right-pointing angle */
    color: #f2e11f;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    align-self: center;
    opacity: 0.8;
  }

  .hd-content-standings-screen .hd-live-schedule-center {
    height: 42px !important;
    padding: 2px 4px !important;
    font-size: 13px !important;
  }

  .hd-content-standings-screen .hd-live-schedule-center.hd-live-schedule-center-has-score {
    font-size: 1.8em !important;
  }

  .hd-content-standings-screen .hd-live-schedule-team-name {
    font-size: 13px !important;
  }

  .hd-content-standings-screen .hd-live-schedule-logo img {
    max-width: 28px !important;
    max-height: 28px !important;
  }

  /* --- Tabelle section --- */
  .hd-standings-tabelle {
    margin-top: 14px !important;
  }

  /* Scrollable table wrapper so all columns are accessible */
  .hd-tabelle-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    position: relative;
  }

  /* Scroll indicators — inset shadows toggled by JS */
  .hd-tabelle-wrapper.can-scroll-right {
    box-shadow: inset -28px 0 16px -16px rgba(9, 24, 58, 0.85);
  }
  .hd-tabelle-wrapper.can-scroll-left {
    box-shadow: inset 28px 0 16px -16px rgba(9, 24, 58, 0.85);
  }
  .hd-tabelle-wrapper.can-scroll-left.can-scroll-right {
    box-shadow:
      inset -28px 0 16px -16px rgba(9, 24, 58, 0.85),
      inset 28px 0 16px -16px rgba(9, 24, 58, 0.85);
  }

  .hd-tabelle {
    table-layout: auto !important;
    min-width: 580px;
  }

  .hd-tabelle .hd-tabelle-col-rank { width: 38px !important; }
  .hd-tabelle .hd-tabelle-col-logo { width: 34px !important; }
  .hd-tabelle .hd-tabelle-col-num  { width: 34px !important; }
  .hd-tabelle .hd-tabelle-col-pts  { width: 34px !important; }

  .hd-tabelle thead th {
    font-size: 11px !important;
    padding: 4px 3px !important;
    height: 28px !important;
  }

  .hd-tabelle tbody tr td {
    font-size: 14px !important;
    font-weight: 700 !important;
    padding: 5px 3px !important;
    height: 42px !important;
  }

  .hd-tabelle td.hd-tabelle-col-team {
    padding-left: 6px !important;
    min-width: 130px;
    font-size: 13px !important;
  }

  /* Trophies / medals */
  .hd-tabelle-trophy {
    width: 28px !important;
    height: 28px !important;
  }

  .hd-tabelle-rank-num {
    font-size: 16px !important;
  }
  .hd-tabelle-rank-num-plain {
    font-size: 20px !important;
  }

  /* Team logos in table */
  .hd-tabelle .hd-tabelle-col-logo img {
    width: 26px !important;
    height: 26px !important;
    max-width: 26px !important;
    max-height: 26px !important;
  }

  /* Row corners — smaller radius */
  .hd-tabelle tbody tr td:first-child {
    border-radius: 8px 0 0 8px;
  }
  .hd-tabelle tbody tr td:last-child {
    border-radius: 0 8px 8px 0;
  }

  /* --- Hide QR code sections on mobile --- */
  .hd-standings-livestream {
    display: none !important;
  }

  /* --- Stats tables (mobile) --- */
  .hd-content-stats-screen .hd-standings-stats:first-of-type {
    padding-top: 61vw !important;
  }

  .hd-stats-tabelle {
    table-layout: auto !important;
    min-width: 460px !important;
  }

  .hd-stats-tabelle .hd-tabelle-col-stats-nr {
    width: 30px !important;
  }

  .hd-stats-tabelle .hd-tabelle-col-stats-team {
    width: auto !important;
    min-width: 80px;
  }

  .hd-stats-tabelle .hd-tabelle-col-stats-name {
    min-width: 110px;
    font-size: 13px !important;
  }

  .hd-stats-tabelle .hd-tabelle-col-stats-min {
    width: 55px !important;
    font-size: 13px !important;
  }

  .hd-stats-tabelle .hd-tabelle-col-stats-ga {
    width: 45px !important;
    font-size: 13px !important;
  }

} /* end @media max-width:768px */
