:root {
  --table-border: #7b7b7b;
}
* {
  box-sizing: border-box;
  font-family: Verdana, Geneva, Tahoma, sans-serif, serif;
  margin: 0;
}

body {
  min-width: max-content;
  margin-bottom: 30px;
  background: #f3f2f1;
}

.headerLink {
  text-decoration: none;
  display: inline-block;
}
#header {
  margin-bottom: 10px;
  width: max-content;
  min-width: 100%;
  text-align: center;
  border-bottom: 3px solid #27273d;
}
.headerAoS {
  background-image: linear-gradient(12deg, #5a5d63, #9aa0c3);
}
.header40k {
  background-color: black;
}
#header h1, #header h2 {
  color: #ffe993;
  text-shadow: 1px 2px 4px black;
}
#header h1, #header h2 {
  margin: 30px;
}
#header h2 {
  font-weight: normal;
}

.returnLink {
  text-align: center;
  text-decoration: none;
  font-weight: bold;
  margin: 0 0 20px;
}

.returnLink a {
  background-color: #6e727f;
  border-radius: 5px;
  border: 3px solid #27273d;
  padding: 15px;
  display: inline-block;
  color: white;
  text-decoration: none;
  font-variant: small-caps;
  font-style: italic;
  font-size: 1.2em;
}
.returnLink a:hover {
  background-color: #5c647e;
}



#about {
  padding: 0 2vw 30px;
  width: 100%;
  max-width: 600px;
}
main {
  color: black;
}


#results-container {
  flex-wrap: flex;
  align-items: center;
  margin: 40px 0 10px;
}
table {
  cursor: pointer;
  text-align: center;
  border-spacing: 0;
  -webkit-tap-highlight-color: transparent;
}
thead tr:last-child th {
  border-bottom: 3px solid var(--table-border);
}
thead th.monthlyTotal {
  font-size: 0.85em;
}
tbody th.monthlyTotal {
  font-weight: normal;
}
tbody td, tbody th {
  border-width: 1px 0;
  border-style: solid;
  border-top-color: var(--table-border);
  border-bottom-color: var(--table-border);
  border-right-color: transparent;
  border-left-color: transparent;
  padding: 0 1px;
}
th {
  min-width: 40px;
  padding: 0 10px;
}
th.titleCell span {
  font-weight: normal;
}
th.highlight-player {
  background-color: rgb(241, 220, 100) !important;
}
th.highlight-opponent {
  background-color: rgb(194, 194, 194) !important;
}
#results tbody td {
  min-width: 50px;
  transition: background-color 0.5s ease-in-out, color 0.5s ease-in-out;
  position: relative; /* for positioning ::before */
}
#results tbody td[class*='result-']::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}
#results tbody td[class*='highlight-']::before {
  opacity: 1;
  transition: opacity 0s;
}
#results tbody td[class*='highlight-'] {
  padding: 0;
  border-width: 1px;
  border-color: white;
  transition: background-color 0s, color 0s;
}
td[class*='highlight-'][class*='result-'], td[class*='highlight-'][class*='result-'] span.secretBonus {
  color: white;
  transition: color 0s;
}
.result-win {
  background-image: linear-gradient(45deg,#66a1dd,#a4c7eb);
}
.result-draw {
  background-image: linear-gradient(45deg,#ddca5e,#f1e59e);
}
.result-lose {
  background-image: linear-gradient(45deg,#ec7f64,#ffbc97);
}
.result-unplayed {
  background-color: #d8d8d8;
}
td.result-win::before {
  background-image: linear-gradient(45deg,#083a97,#2b63ca);
}
td.result-draw::before {
  background-image: linear-gradient(45deg,#8b7e00,#a89a19);
}
td.result-lose::before {
  background-image: linear-gradient(45deg,#8f0101,#c21515);
}
td[class*='highlight-'].result-unplayed {
  background-color: #505050 !important;
}
/* .result-win {
  background-color: #a4c7eb;
}
.result-draw {
  background-color: rgb(243, 231, 163);
}
.result-lose {
  background-color: #ffbc97;
}
.result-unplayed {
  background-color: rgb(216, 216, 216);
}
td[class*='highlight-'].result-win {
  background-color: rgb(18 70 165) !important;
}
td[class*='highlight-'].result-draw {
  background-color: rgb(156, 141, 0) !important;
}
td[class*='highlight-'].result-lose {
  background-color: rgb(143, 1, 1) !important;
}
td[class*='highlight-'].result-unplayed {
  background-color: rgb(80, 80, 80) !important;
} */
td span {
  position: relative; /* to show cell content over the ::before */
}
th.titleCell {
  border-right: 2px solid var(--table-border);
}
.left-border {
  border-left: 2px solid var(--table-border);
}
.factionSpan, .secretBonus {
  display:inline-block;
  color: #444;
  font-size: 0.8em;
  white-space: nowrap;
  transition: color 0.5s ease-in-out;
}
td .secretBonus {
  transform: translate(0,-0.3rem) scale(1.3);
}
span.asterisk {
  color: #444;
  display: inline-block;
  transform: scale(1.3);
}
tfoot tr:first-child th, tfoot tr:first-child td {
  border-top: 3px solid var(--table-border);
}
.legend {
  margin: 10px 10px 0;
  color: #444;
}
.legend div {
  margin-bottom: 10px;
}
#options {
  margin: 10px 0 10px 30px;
  width: max-content;
  color: #333;
  border: 1px solid #333;
  padding: 3px;
  border-radius: 5px;
  background: #f9edc8;
}
#options #sortCompetitors {
  display: flex;
  flex-direction: column;
}
#options label {
  margin-right: 10px;
  padding: 3px 0;
}
#options label:hover {
  background-color: rgb(245 228 134);
}
#options label input[type="radio"] {
  transform: translate(0,1px);
}
#modal {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  background: white;
  text-align: center;
  cursor: pointer;
  z-index: 100;
}
body.displayModal #modal {
  display: block;
}
body.displayModal #tableContainer {
  display: none;
}
#modalImg {
  max-width: 100%;
}

/* averages display */
body:not(.displayAvg) .avg {
  display: none;
}
/* points difference display */
body:not(.displayDiff) .diff {
  display: none;
}



.info-title {
  margin: 30px 0 10px 1vw;
  font-weight: bold;
  font-size: 1.3rem;
}

#gameRules {
  margin-top: 30px;
}
#gameRules td {
  padding-left: 5px;
  padding-right: 5px;
}

/* responsive display gameRules table styles */
.responsive-wide {
  display: none;
}
td.monthlyBonus-wide {
  background-color: white;
  text-align: left;
}
tr.monthlyBonusTR td {
  padding-bottom: 15px;
  text-align: left;
}
#gameRules tbody tr:nth-child(3n+1) {
  background-color: #c0dfff;
}
#gameRules tbody tr:nth-child(3n+2) {
  background-color: #a4c7eb;
}

#playerInfo {
  display: block;
  margin-top: 20px;
}
#playerInfo td {
  padding: 2px 10px;
}
#playerInfo tbody tr:nth-child(2n+1) {
  background-color: #c0dfff;
}
#playerInfo tbody tr:nth-child(2n) {
  background-color: #a4c7eb;
}



@media all and (min-width: 1000px) {
  #tableContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .responsive-narrow {
    display: none;
  }
  .responsive-wide {
    display: table-cell;
  }
}