/* Shared styles for every league page. */

/* Page header */
body {
    font-family: Arial, sans-serif;
    margin-left: 20px;
}
.headerbag {
    display: inline-block;
}
.header {
    display: inline-block;
}
.divtitle {
    font-family: Amethysta;
    display: inline-block;
    letter-spacing: 1px;
    position: relative;
    text-align: center;
}
.show {
    font-size: 22px;
    line-height: 19px;
}
.me {
    font-size: 41px;
    line-height: 32px;
}
.the {
    font-size: 30px;
    line-height: 22px;
}
.highlights {
    font-family: Amethysta;
    display: inline-block;
    letter-spacing: 1px;
    position: relative;
    font-size: 96px;
    line-height: 108px;
}
.league-container {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    place-items: center;
}
.leagueicons {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
    justify-self: left;
}
.col-1 {
    margin: 10px;
    display: flex;
    align-items: center;
}
.col-end {
    display: flex;
    align-items: center;
    text-align: right;
    justify-self: right;
}
.selector {
    display: block;
    margin: 0 auto;
}

/* Week, round and day labels */
.weeklabel,
.roundlabel {
    background-color: #000000;
    color: #FFFFFF;
    font-family: Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
    font-size: 40px;
    font-weight: 1000;
    height: 76px;
    letter-spacing: 1px;
    line-height: 76px;
    margin-right: 16px;
    margin-top: 16px;
    text-align: center;
    width: 10%;
    min-width: max-content;
    padding-right: 20px;
    padding-left: 20px;
}
.daylabel {
    background-color: #FFFFFF;
    color: #FF0000;
    font-family: Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
    font-size: 30px;
    font-weight: 700;
    height: 58px;
    letter-spacing: 1px;
    line-height: 58px;
    min-width: max-content;
}
.labelcontainer {
    float: left;
    width: 14.9%;
    height: 100%;
    min-width: max-content;
}

/* Regular season games */
.daycontainer {
    background: #FFF;
    flex-direction: row;
    flex-wrap: wrap;
}
.gamecontainer {
    display: flex;
    background: #FFF;
    flex-direction: row;
    flex-wrap: wrap;
}
.game {
    display: flex;
    position: relative;
    border-left: 1px solid #000;
    border-top: 1px solid #ffffff;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #000;
    background: #FFF;
    flex-direction: row;
    flex-wrap: wrap;
    transition: background-color 1.5s, opacity 1.5s;
}
img.flipped {
    -webkit-transform: scaleX(-1);
    transform: scaleX(-1);
}
.postponed {
    position: absolute;
    bottom: 35%;
    color: red;
    font-size: 25px;
    font-weight: bold;
    rotate: 20deg;
}
/* Playoff games (nwsl) have their date in small text under the logos */
.game.dated {
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}
.matchup {
    display: flex;
}
.gamedate {
    color: #6B6B6B;
    font-family: Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
    font-size: 14px;
    padding-bottom: 4px;
}
.scheduled-game {
    opacity: 0.5;
}
.highlight-game {
    opacity: 1 !important;
}

/* Playoff series */
.seriescontainer {
    display: flex;
    border-bottom: solid 1px black;
    align-items: center;
}
.serieslabel {
    display: flex;
    flex-direction: column;
}
.playoffgamecontainer {
    display: flex;
    color: #AFAEAE;
    font-family: Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
    font-size: 30px;
    font-weight: 1000;
    height: 76px;
    letter-spacing: 1px;
    text-align: center;
    width: 10%;
    min-width: max-content;
    padding-left: 20px;
    align-items: center;
    justify-content: center;
}
.playoffdate {
    font-size: 20px;
    display: block;
}
.playoffgame,
.playoffgameprev {
    transition: background-color 1.5s, opacity 1.5s;
}
.playoffgame a,
.playoffgameprev a {
    text-decoration: none;
    color: black;
}
/* The latest game stays red until it's been watched, then turns black. */
.playoffgame a:link {
    color: red;
}
.playoffgame a:visited {
    color: black;
}
.playoffgame a:hover,
.playoffgame a:active,
.playoffgameprev a:hover,
.playoffgameprev a:active {
    text-decoration: underline;
}

/* Footer */
.footer {
    font-family: Amethysta;
    font-size: 19px;
    display: block;
    letter-spacing: 1px;
    position: relative;
    text-align: right;
    border-top: 1px solid #ffffff;
}

/* NFL lays out its games differently from the other leagues. */
.nfl .daycontainer {
    border-bottom: 1px solid #000;
}
.nfl .daylabel {
    margin-top: 16px;
}
.nfl .game {
    border-top: none;
    border-right: none;
    border-bottom: none;
    padding: 10px;
}

/* Phone layout. Nothing here applies above 900px, so computers are untouched. */
@media (max-width: 900px) {
  html { -webkit-text-size-adjust: 100%; }
  body { margin: 0 10px; }

  .headerbag, .header { display: block; }
  .divtitle { display: block; }
  .show, .me, .the { display: inline; font-size: 16px; line-height: 1.2; }
  .highlights {
    display: block;
    font-size: min(11.5vw, 96px);
    line-height: 1.15;
    white-space: nowrap;
    text-align: center;
  }
  .league-container { grid-template-columns: 1fr; row-gap: 8px; }
  .leagueicons { margin: 0; justify-self: center; flex-wrap: nowrap; }
  .col-1 { margin: 6px; }
  .col-end { justify-self: center; }
  #highlightSelect { width: 100%; max-width: 100%; min-height: 44px; font-size: 16px; }

  .weeklabel, .roundlabel {
    width: auto;
    min-width: 0;
    height: auto;
    margin-right: 0;
    font-size: 26px;
    line-height: 1.2;
    padding: 10px 12px;
  }
  .daylabel, .nfl .daylabel { font-size: 24px; height: 44px; line-height: 44px; min-width: 0; margin-top: 8px; }
  .labelcontainer { float: none; width: auto; min-width: 0; height: auto; }

  .gamecontainer { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .game, .nfl .game {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 6px;
    align-items: center;
    justify-content: center;
    min-width: 0;
  }
  .game img { width: 100% !important; height: auto; display: block; }
  /* Unplayed games have bare <img> children; played games wrap them in <a>. */
  .game > a, .game > img { flex: 1 1 0; min-width: 0; }
  .game.dated { gap: 2px; justify-content: space-between; }
  .matchup { width: 100%; gap: 8px; }
  .matchup > a, .matchup > img { flex: 1 1 0; min-width: 0; }
  .postponed { font-size: 16px; }

  .seriescontainer { flex-wrap: wrap; padding: 8px 0; }
  .serieslabel { flex-direction: row; width: 100%; }
  .serieslabel img { width: 56px; }
  .playoffgamecontainer {
    width: auto;
    min-width: 0;
    height: auto;
    padding: 8px 12px 8px 0;
    font-size: 20px;
    letter-spacing: 0;
  }
  .playoffdate { font-size: 14px; }

  .footer { font-size: 14px; letter-spacing: 0; text-align: center; overflow-wrap: anywhere; }
}

/* Video modal (player.js) */
.player-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 20, 0.85);
}
.player-modal[hidden] { display: none; }
.player-modal:focus { outline: none; }
.player-box {
  position: relative;
  width: min(calc(100% - 16px), calc(80vh * 16 / 9));
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 0 25px 10px rgba(0, 0, 0, 0.45);
}
.player-frame, .player-frame iframe { width: 100%; height: 100%; border: 0; }
.player-close {
  position: absolute;
  top: -40px;
  right: 0;
  padding: 0 8px;
  font-size: 32px;
  line-height: 36px;
  color: #eee;
  background: none;
  border: 0;
  cursor: pointer;
}
.player-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
  color: #eee;
}
.player-fallback[hidden] { display: none; }
.player-fallback a { color: #8ab4ff; }
