body {
  font-family: 'F1', sans-serif;
  font-size: 16px;
  letter-spacing: .2px;
  margin: 0;
  --f1: #e10600;
  --f1-text: #FFF;
  --f1-border: .5rem solid var(--f1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  word-break: break-word;
}

::selection {
  background: transparent;
}

/* Title */
#app-title {
  margin-bottom: 2rem;
  padding: 1rem 0;
  display: flex;
  justify-content: space-between;
  font-family: 'F1Bold', sans-serif;
  border-image: conic-gradient(var(--f1) 0 0) fill 1 //0 100vw;
  color: var(--f1-text);
}

#app-title h1 {
  text-transform: uppercase;
}

#race-count {
  display: grid;
  align-content: center;
}

/* Layout */
#app-wrapper {
  max-width: 95%;
  margin: 1vw auto;
}

#table-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
}

/* Table Layout */
.table {
  position: relative;
  overflow: hidden;
}

.table:not(.chart) .grid-table {
  overflow-x: auto;
}

.table-rows .tr,
.table-columns .grid-table {
  display: grid;
}

.table.players .tr {
  grid-template-columns: 2rem repeat(6, 9rem);
}

@media screen and (min-width: 1000px){
  .table.players .tr {
    grid-template-columns: 2rem repeat(6, 1fr);
  }
}

.table.teams .grid-table,
.table.drivers .grid-table {
  grid-template-columns: 2rem repeat(8, 1fr);
}

.table.teammates .grid-table {
  grid-template-columns: 2rem 2fr repeat(7, 1fr);
}

.ti {
  min-width: max-content;
}

/* Table Design */
.table {
  padding: 2rem;
  /* box-shadow:
    0px 0px 2.2px rgba(0, 0, 0, 0.02),
    0px 0px 5.3px rgba(0, 0, 0, 0.028),
    0px 0px 10px rgba(0, 0, 0, 0.035),
    0px 0px 17.9px rgba(0, 0, 0, 0.042),
    0px 0px 33.4px rgba(0, 0, 0, 0.05),
    0px 0px 80px rgba(0, 0, 0, 0.07);
  border-radius: 1rem; */
}


.table::before{
  content: '';
  position: absolute;
  display: block;
  inset: 0 0 calc(100% - 4.5rem) 0;
  border-top-right-radius: 1rem;
  z-index: -1;
  background-image: url('./bg1.png');
  background-size: 30px;
}

.table::after {
  content: '';
  position: absolute;
  display: block;
  inset: 0;
  border-top-right-radius: 1rem;
  border-top: var(--f1-border);
  border-right: var(--f1-border);
  z-index: -1;
}

.tt {
  margin-bottom: 1rem;
  font-size: 1.4rem;
  text-transform: uppercase;
  font-family: 'F1Bold', sans-serif;
}

.ti {
  cursor: default;
}

.table-rows .ti {
  padding: 0.4em;
  min-width: 8ch;
  background-color: inherit;
}

.table-rows :not(.th) .ti {
  border-bottom: 1px dotted rgba(0, 0, 0, .1);
}

.table-columns .ti {
  display: flex;
  height: 1.8rem;
  align-items: center;
  padding-inline: .4em;
  transition: background-color .15s ease-in-out;
}

.table-columns .th {
  font-family: 'F1Bold', sans-serif;
  border-bottom: 1px solid rgba(0, 0, 0, .75);
}

.table-rows .th .ti {
  border-bottom: 1px solid rgba(0, 0, 0, .75);
}

.tch {
  color: rgb(0 0 0 / 60%);
}

.tc {
  min-width: max-content;
}

.tc .ti:nth-child(2n +3) {
  background: rgb(0 0 0 / 10%);
}

/* Table Hover */
.table .table-rows .tr:not(.th):hover {
  background-color: #e1070048;
}

.table .tc:first-of-type .ti:not(.th):hover {
  border-image: conic-gradient(#e1070048 0 0) fill 1 //0 100vw;
}

.table:not(.teammates) .ti.highlight {
  background-color: #e1070048;
}

/* Team Handle */
.team-handle::before {
  content: '';
  display: inline-block;
  width: 0.5em;
  aspect-ratio: 1;
  margin-right: 0.5em;
  background-color: rgb(0, 0, 0);
  border-radius: 50%;
}

.team-handle[data-constructor="red_bull"]::before {
  background-color: #3671C6;
}

.team-handle[data-constructor="ferrari"]::before {
  background-color: #E8002D;
}

.team-handle[data-constructor="mercedes"]::before {
  background-color: #27F4D2;
}

.team-handle[data-constructor="aston_martin"]::before {
  background-color: #229971;
}

.team-handle[data-constructor="alpine"]::before {
  background-color: #FF87BC;
}

.team-handle[data-constructor="mclaren"]::before {
  background-color: #FF8000;
}

.team-handle[data-constructor="sauber"]::before {
  background-color: #52E252;
}

.team-handle[data-constructor="williams"]::before {
  background-color: #64C4FF;
}

.team-handle[data-constructor="haas"]::before {
  background-color: #B6BABD;
}

.team-handle[data-constructor="rb"]::before {
  background-color: #6692FF;
}

/* Loading */
.loading {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: opacity .5s;
  list-style: none;
  width: 45ch;
  max-width: 80%;
}

.loading.remove {
  opacity: 0;
}

.loading li {
  display: flex;
  align-items: center;
  padding-left: 1em;
}

.loading li:last-child {
  padding-left: 2.6ch;
}

.loading li:before {
  content: "✅";
  display: inline-block;
  font-size: 0.8em;
  transform: translateX(-0.4em);
  border-radius: 50%;
}

.loading li:last-child:before {
  content: " ";
  width: 0.8em;
  height: 0.8em;
  border: 2px solid rgba(0, 0, 0, 5);
  border-color: rgba(0, 0, 0, 5) transparent rgba(0, 0, 0, 5) transparent;
  animation: lds-dual-ring 1.2s linear infinite;
  margin-left: -1.6em;
  position: absolute;
}

@keyframes lds-dual-ring {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Error */
.error{
  font-size: clamp(10rem, 30vw, 30rem);
  text-align: center;
}

/* Mobile */
@media screen and (max-width: 800px){
  .table.chart {
    display: none;
  }
}

@font-face {
  font-family: F1;
  font-display: auto;
  src: url(./fonts/Formula1-Regular.woff2) format("woff2"), url(./fonts/Formula1-Regular.woff) format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap
}

@font-face {
  font-family: F1Bold;
  font-display: auto;
  src: url(./fonts/Formula1-Bold.woff2) format("woff2"), url(./fonts/Formula1-Bold.woff) format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap
}

@font-face {
  font-family: F1Black;
  font-display: auto;
  src: url(./fonts/Formula1-Black.woff2) format("woff2"), url(./fonts/Formula1-Black.woff) format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap
}