/* =========================================================
   Reset & Base
   ========================================================= */
* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
html { color: var(--font-color); font-size: 16px; }
body {
  color: var(--font-color);
  background-color: var(--bg-color);
  margin: 0;
  overflow: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Arial", "Helvetica Neue", sans-serif;
}

/* =========================================================
   CSS Variables
   ========================================================= */
:root {
  --heading-color: #424242;
  --font-color: #545454;
  --font-colorh: #616060;
  --bg-color: #fff;
  --bg-colora: rgba(255,255,255,0);
  --tr-color: #F0F0F0;
  --border-color: #dbdbdb;
  --light-color: #69b551;
  --highlight-color1: #99d98f;
  --close-icon-c: rgba(0,0,0,0.3);
  --alert-bg: rgba(212,175,55,0.99);
  --alert-color: rgba(255,255,255,1);
  --glass-bg: rgba(255,255,255,0.85);
  --glass-border: rgba(255,255,255,0.4);
  --glass-border-table: rgba(0,0,0,0.07);
  --glass-shadow: rgba(255,255,255,0.5);
  --glass-backdrop: blur(16px) saturate(180%);
  --modalc: rgba(255,255,255,0.35);
  --modalc2: rgba(0,0,0,0.35);
  --modalc3: rgba(0,0,0,0.35);

  /* timezone visibility */
  --pt: inline;
  --ct: none;
  --et: none;
}

[data-time="ct"] { --pt: none; --ct: inline; --et: none; }
[data-time="et"] { --pt: none; --ct: none;   --et: inline; }

/* =========================================================
   Links
   ========================================================= */
a { text-decoration: none; color: var(--light-color); text-align: center; cursor: pointer; }
button { cursor: pointer; }

/* =========================================================
   Layout
   ========================================================= */
.wrapper  { max-width: 95vw; margin: 0 auto; position: relative; }
.content  { margin: auto; }

#header {
  text-align: left;
  padding-bottom: 1.25em;
  padding-top: 25px;
  position: relative;
}

/* =========================================================
   Header row
   ========================================================= */
.header-flex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

#heading1 {
  color: var(--heading-color);
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 2.25rem;
  flex-shrink: 0;
}

/* =========================================================
   View picker (custom dropdown)
   ========================================================= */
.view-picker-wrap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  width: 14rem;
  z-index: 30;
}

.custom-picker {
  position: relative;
  max-width: 14rem;
  width: 100%;
}

.picker-trigger {
  display: flex;
  align-items: center;
  gap: 0.5em;
  width: 100%;
  font-size: 1.05rem;
  padding: 0.45em 1.1em;
  border-radius: 1.2em;
  border: 1.5px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--font-color);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10), 0 1.5px 6px rgba(0,0,0,0.07);
  font-weight: 500;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  transition: box-shadow 0.2s;
}
.picker-trigger:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.15); }

.picker-icon-slot,
.picker-opt-icon {
  width: 1.4rem;
  height: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.picker-icon-slot img, .picker-opt-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.picker-icon-slot svg, .picker-opt-icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.picker-label {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker-caret {
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform 0.2s;
}
.custom-picker.open .picker-caret { transform: rotate(180deg); }

.picker-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  list-style: none;
  padding: 0.3rem;
  margin: 0;
  background: var(--bg-color);
  border: 1.5px solid var(--glass-border);
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 200;
  max-height: 70vh;
  overflow-y: auto;
}
.custom-picker.open .picker-menu { display: block; }

.picker-option {
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.42em 0.75em;
  border-radius: 0.65rem;
  cursor: pointer;
  color: var(--font-color);
  transition: background 0.12s;
  font-size: 0.95rem;
}
.picker-option:hover { background: rgba(128,128,128,0.12); }
.picker-option.selected { background: rgba(128,128,128,0.10); font-weight: 600; }
.picker-opt-label { white-space: nowrap; }

.picker-ap-badge {
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* =========================================================
   Hamburger
   ========================================================= */
#hamburger {
  font-size: 2.25rem;
  cursor: pointer;
  width: 1em;
  height: 1em;
  display: inline-block;
  flex-shrink: 0;
}
.bar {
  display: block;
  width: 22px;
  height: 4px;
  margin: 4px auto;
  background: var(--font-color);
  border-radius: 2px;
  opacity: 0.95;
}
#hamburger:hover .bar { background: var(--font-colorh); opacity: 1; }

/* =========================================================
   Week picker (inline in th.col-game)
   ========================================================= */
th.col-game .custom-picker { max-width: 100%; }
th.col-game .picker-trigger {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  color: inherit;
}
th.col-game .picker-trigger:hover { box-shadow: none; opacity: 1; }

/* =========================================================
   View sections
   ========================================================= */
.views-container { width: 100%; }
.view-section { display: none; }

/* =========================================================
   Today's Games — scoreboard grid
   ========================================================= */
.no-games {
  margin-top: 2rem;
  opacity: 0.45;
  font-size: 0.95rem;
  text-align: center;
}
.today-games-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 540px;
}

.game-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: var(--glass-bg);
  border: 1.5px solid var(--glass-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  text-decoration: none;
  color: var(--font-color);
  transition: box-shadow 0.18s, background-color 0.18s;
  cursor: pointer;
}
.game-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.13); background: rgba(255,255,255,0.97); }
.game-card-live { border-color: var(--highlight-color1); background: rgba(153,217,143,0.10); }

.td-team {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  font-weight: 500;
  min-width: 0;
}
.td-away { justify-content: flex-end; text-align: right; flex-direction: row-reverse; }
.td-home { justify-content: flex-start; text-align: left; }
.td-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-record { font-size: 0.75rem; opacity: 0.55; white-space: nowrap; }

.td-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 5.5rem;
  text-align: center;
}
.td-score-live { color: #1a7a00; }
.td-score-pre  { font-size: 0.88rem; font-weight: 500; }
.td-period { font-size: 0.72rem; font-weight: 400; opacity: 0.65; margin-top: 0.1rem; }

.td-tv {
  font-size: 0.75rem;
  opacity: 0.55;
  white-space: nowrap;
  padding-left: 0.2rem;
}

/* =========================================================
   Conference standings table
   ========================================================= */
.standings-table-wrap {
  max-width: 640px;
  margin: 0 auto;
}

.standings-table thead {
  position: sticky;
  position: -webkit-sticky;
  top: 0;
  z-index: 20;
  background-color: var(--bg-color);
}

.standings-table {
  opacity: 0;
  transition: opacity 0.4s ease;
  border-spacing: 0;
  width: 100%;
  font-size: 1rem;
  color: var(--font-color);
}
body.js-loaded .standings-table { opacity: 1; }

.standings-table thead th {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(84,84,84,0.6);
  padding: 0.35rem 0.5rem;
  border-bottom: 1.5px solid var(--glass-border-table);
  white-space: nowrap;
  text-align: left;
}
.standings-table tbody tr {
  border-bottom: 1px solid var(--glass-border-table);
  transition: background-color 0.15s;
}
.standings-table tbody tr:last-child { border-bottom: none; }
.standings-table tbody tr:hover { background: rgba(0,0,0,0.025); }
.standings-table td {
  padding: 0.3rem 0.5rem;
  vertical-align: middle;
  white-space: nowrap;
}

/* columns */
.col-team {
  min-width: 8rem;
  padding-right: 0.75rem !important;
}

.ap-rank {
  display: inline-block;
  vertical-align: middle;
  width: 1.4rem;
  min-width: 1.4rem;
  text-align: right;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.55;
  margin-right: 0.4rem;
}
.ap-rank-empty {
  opacity: 0;
  pointer-events: none;
}
.team-logo { display: inline-flex; vertical-align: middle; align-items: center; margin-right: 0.4rem; }
.team-name-full  { display: inline; vertical-align: middle; font-size: 0.95rem; }
.team-name-abbr  { display: none; vertical-align: middle; font-size: 0.95rem; }

.col-conf, .col-overall {
  font-size: 0.95rem;
  text-align: center;
  min-width: 3.5rem;
}
.standings-table thead th.col-conf,
.standings-table thead th.col-overall { text-align: center; }
.col-game {
  width: 1px;
  white-space: nowrap;
}

/* =========================================================
   Game cells (in conference standings col-game)
   ========================================================= */
.game-status-box {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  min-height: 1.8rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.gameip {
  background: rgba(255,255,255,0.95) !important;
  border: 2px solid var(--glass-border);
  box-shadow: inset 0 0 8px 3px var(--glass-shadow), 0 2px 8px rgba(0,0,0,0.08);
}
.gamefinal { background: rgba(255,255,255,0.2); border: 1px solid rgba(105,181,81,0.25); }

.game-hover-text {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--font-color) !important;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(8px);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.game-status-box:hover .game-hover-text {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}
.game-status-box:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.game-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.15rem 0.3rem;
  gap: 0.2rem;
}
.game-time {
  font-size: 0.88rem;
  white-space: nowrap;
  min-width: 6.5rem;
  display: inline-block;
  text-align: center;
}
.game-vs {
  font-size: 0.75rem;
  opacity: 0.5;
  width: 1.2rem;
  text-align: center;
}
.game-result {
  width: 1.2rem;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
}
.game-scores {
  font-size: 0.88rem;
  min-width: 3rem;
  text-align: center;
}
.score-sep { opacity: 0.45; padding: 0 0.1rem; }
.game-logo { width: 1.2rem; min-width: 1.2rem; text-align: center; }
.game-opp-abbr { display: none; }
.game-period { font-size: 0.82rem; }

#game1 { display: flex; align-items: center; width: 100%; justify-content: center; gap: 0.3rem; }

.game-cell-empty { display: block; min-height: 1.8rem; min-width: 10rem; }
.game-cell-ppd { font-size: 0.82rem; opacity: 0.55; display: flex; align-items: center; gap: 0.3rem; padding: 0.15rem; }

/* timezone visibility */
#pt { display: var(--pt); }
#ct { display: var(--ct); }
#et { display: var(--et); }

/* =========================================================
   Modal / Option window
   ========================================================= */
.option-window {
  position: fixed;
  background-color: var(--modalc);
  inset: 0;
  z-index: 999;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  text-align: center;
}
.option-window > div {
  width: 475px;
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 1rem;
  transform: translate(-50%, -50%);
  padding: 1.25em;
  background: var(--glass-bg);
  box-shadow: 0 8px 32px 0 rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  border: 2px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}
.modal-window {
  position: fixed;
  background: var(--modalc);
  inset: 0;
  z-index: 999;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.modal-window > div {
  width: 475px;
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 1.25rem;
  transform: translate(-50%, -50%);
  border: 2.5px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  padding: 2em;
  background: var(--glass-bg);
}
.modal-window.active,
.option-window.active {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}
.modal-close {
  color: var(--close-icon-c);
  position: absolute;
  right: 5%; top: 5%;
  font-size: 1.3em;
  background: var(--glass-bg);
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 0.25em 0.5em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#modal-blur-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#modal-blur-overlay.active { opacity: 1; pointer-events: auto; }

/* =========================================================
   Options panel
   ========================================================= */
h1 { font-size: 1.8rem; color: var(--heading-color); }

.options-label {
  display: block;
  color: var(--font-color);
  opacity: 0.75;
  font-size: 1rem;
  margin-top: 1em;
  margin-bottom: 0.5em;
}
.options-credit {
  color: var(--font-color);
  opacity: 0.65;
  font-size: 0.8rem;
}

#timezone-picker {
  font-size: 1.1rem;
  padding: 0.5em 1.2em;
  border-radius: 1.2em;
  border: 1.5px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--font-color);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  font-weight: 500;
  appearance: none;
  outline: none;
  transition: box-shadow 0.2s;
  text-align: center;
  font-family: inherit;
}
#timezone-picker:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.18); }

/* =========================================================
   Sticky thead (narrow layout)
   ========================================================= */
thead.is-sticky {
  background-color: var(--bg-color);
  backdrop-filter: blur(80px);
  -webkit-backdrop-filter: blur(80px);
}

/* =========================================================
   Footer
   ========================================================= */
#footer { padding-bottom: 2rem; }

/* =========================================================
   Media Queries
   ========================================================= */
@media (max-width: 50rem) {
  .header-flex-row { flex-wrap: wrap; }
  #heading1 { order: 0; width: calc(100% - 2.5rem); }
  #hamburger { order: 1; position: absolute; top: 25px; right: 0; }
  .view-picker-wrap { z-index: 201; position: static; transform: none; order: 2; width: 100%; margin-top: 0.6rem; justify-content: center; }

  .today-games-grid { max-width: 100%; }

  .standings-table-wrap { max-width: 100%; width: fit-content; overflow: visible; }
  .standings-table { width: auto; }

  .team-name-full { display: none; }
  .team-name-abbr { display: none; }
  .col-team { min-width: 3rem; padding-right: 0.25rem !important; }

  .option-window > div, .modal-window > div {
    width: 90%;
    max-width: 475px;
  }

}

@media (max-width: 360px) {
  .td-record { display: none; }
  .td-tv     { display: none; }
}
