@font-face {
  font-family: "F1-bold"; /* set name */
  src: url(../fonts/F1-Bold.ttf); /* url of the font */
}

@font-face {
  font-family: "F1-regular"; /* set name */
  src: url(../fonts/F1-Regular.ttf); /* url of the font */
}

@font-face {
  font-family: "F1-black"; /* set name */
  src: url(../fonts/F1-Black.ttf); /* url of the font */
}

* {
    font-family: 'F1-Regular', sans-serif;
}

.bg-purple {
    background-color: rgb(146 75 154) !important;
}

.text-purple {
    color: rgb(146 75 154) !important;
}

.bg-orange {
    background-color: rgb(245,125,1) !important;
}

.text-orange {
    color: rgb(245,125,1) !important;
}

body {
    height: 90vh;
}

body .container-fluid, body .container-fluid .row {
    height: 90vh;
}

/* GRID */

.standing-table {
    display: grid;
    grid-template-columns: 3rem 7rem 1fr 15rem 14rem;
    grid-auto-rows: minmax(4rem,1fr);
    height: 100%;
}

.standing-table-cell {
    display: flex;
    justify-content: center;
    align-items: center;
}

.standing-table-cell.cell-1 {
    flex-direction: column;
    margin-bottom: 1px;
}

.standing-table-cell.cell-2 {
    display: grid;
    grid-template-rows: 0.4fr 0.5fr;

    &.has-nt {
        background: rgb(165 0 0) !important;
    }
}

.standing-table-cell.cell-3 {
    flex-direction: column;
    align-items: stretch;
}

.cell-3-bottom-row {
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    padding-left: 0.3rem;
    padding-right: .3rem;
}

.standing-table-cell.cell-4 {
    padding-top:5px;
    padding-bottom: 5px;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;

    &.qualif-mode {
        display:grid;
        font-size: small;
        padding-right: .2rem;
        grid-template-columns: minmax(1.5rem, 2rem) minmax(3.5rem, 1fr) minmax(4rem, 1fr) minmax(2.5rem, 3rem);
        grid-template-rows: minmax(0.3rem, 4rem) repeat(3, minmax(0.3rem, 1.2rem)) minmax(0.3rem, 4rem);
        align-content: center;
        font-weight: 700;

        .cell-1 {
            text-align:end;
            padding-right: .2rem;
        }

        .cell-2 {
            text-align:end;
            padding-right: .2rem;
        }

        .cell-3 {
            text-align:end;
            padding-right: .2rem;
        }

        .cell-4 {
            text-align:end;
            padding-right: .2rem;
        }


    }
}

.cell-4-right {
    flex: 0.7;
    align-self: stretch;
}

.cell-4-left, .cell-4-right {
    display: flex;
    flex-direction: column;
}

.cell-4-left {
    justify-content: flex-end;
}

.cell-1 {
    grid-column: 1;
}

.cell-2 {
    grid-column: 2;
}

.cell-3 {
    grid-column: 3;
}

.cell-4 {
    grid-column: 4;
}

.cell-5 {
    grid-column: 5;
}

.row-1 {
    grid-row: 1;
}
.row-2 {
    grid-row: 2;
    background: rgb(44,48,52);
}
.row-3 {
    grid-row: 3;
}
.row-4 {
    grid-row: 4;
    background: rgb(44,48,52);
}
.row-5 {
    grid-row: 5;
}
.row-6 {
    grid-row: 6;
    background: rgb(44,48,52);
}
.row-7 {
    grid-row: 7;
}
.row-8 {
    grid-row: 8;
    background: rgb(44,48,52);
}
.row-9 {
    grid-row: 9;
}
.row-10 {
    grid-row: 10;
    background: rgb(44,48,52);
}
.row-11 {
    grid-row: 1;
}
.row-12 {
    grid-row: 2;
    background: rgb(44,48,52);
}
.row-13 {
    grid-row: 3;
}
.row-14 {
    grid-row: 4;
    background: rgb(44,48,52);
}
.row-15 {
    grid-row: 5;
}
.row-16 {
    grid-row: 6;
    background: rgb(44,48,52);
}
.row-17 {
    grid-row: 7;
}
.row-18 {
    grid-row: 8;
    background: rgb(44,48,52);
}
.row-19 {
    grid-row: 9;
}
.row-20 {
    grid-row: 10;
    background: rgb(44,48,52);
}

/* END GRID */

/* POSITION */

.position-number {
    padding-top: 5px;
    padding-bottom: 5px;
}

/* END POSITION */

.position-number {
    font-size: larger;
    font-weight: bolder;
    line-height: 1em;
    font-family: 'F1-Bold', sans-serif;
}

.position-driver-status {
    display:flex;
    flex-direction: column;
}

/* PILOT STATUS */

.driver-status-badges {
    display: flex;
    width: 4.5em;
    justify-content: space-evenly;
}

.driver-status-pit {
    width: 3em;
}

.driver-name {
    font-family: 'F1-black';
    text-transform: uppercase;
    font-size: x-large;
    padding-left: .25rem;
    margin-right: 1rem !important;
    border-bottom: 1px solid white;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* TEAM */

.team {
    text-align:center;
}

.team-logo {
    height:2em;
}

.pilot {
    align-items: center;
    padding: 0 0 0 1rem;
}

.ers-battery {
    flex: 0.8;
}

.ers-battery .progress{
    position: relative;
}

.ers-battery .ers-value {
    position: absolute;
    right: 5px;
    bottom: 0;
}

/* TYRE */

.tyresets {
    display: flex;
}

.tyres {
    display: flex;
    justify-content: flex-end;
    flex-direction: row;
}

.tyre { 
    position: relative;
    align-items: center;
    display: flex;
    width: 2rem;
    
    &:not(.fitted) { 
        .tyreset-wear {
            position:absolute;
            bottom: 5px;
            font-size: xx-small;
        }
    }
}


.tyre-img {
    padding-right:3px;
    height: 1.25rem;
}

.fitted {
    padding: .25rem!important;
    display: flex;
    flex:1;
    align-items: center;
}

/* PENALTIES */

.warnings-and-penalties {
    display:flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    justify-content: space-evenly;
}

.warnings-and-penalties .dt, .warnings-and-penalties .penalties, .warnings-and-penalties .warnings {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
}

/* LAP TIME */

td.lap-time .badge {
    font-size: initial;
}

.bw-flag {
    height: 16px;
}

.personal-best-label, .personal-last-label { 
    font-family: 'F1-bold';
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.personal-last-label.with-right-border {
    border-right: 1px solid gray;
}

.personal-best-value, .personal-last-value { 
    margin-left: -5px;
    font-family: 'F1-bold';
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.personal-best-lap {
    font-size: small;
    flex: 1;
    text-align: end;
    padding-right: .6rem;
}

/* CAR */

.no-telemety {
    margin: .5rem;
    padding: .5rem;
    text-decoration: line-through;
    text-decoration-thickness: 0.2rem;
}


:root {
    --car-width: 14rem;
}

.car {
    position: relative;
    width: var(--car-width);
    display: flex;
}

.car-basis {
    width: var(--car-width);
}

.car-damage-img {
    width: 100%;
    position: absolute;
}

.damage-value {
    position: absolute;
    font-size: x-small;
    z-index: 20;
}

.damage-rear_left_tyre {
    top:15px;
    left:26px;
    padding: 2px;
}
.damage-rear_right_tyre {
    bottom: 15px;
    left: 26px;
    padding: 2px;
}
.damage-front_left_tyre {
    top: 15px;
    right: 47px;
    padding: 2px;
}
.damage-front_right_tyre {
    bottom: 15px;
    right: 47px;
    padding: 2px;
}

.damage-front_left_wing {
    right: 3px;
    top: 10px;
}

.damage-front_right_wing {
    right: 3px;
    bottom: 10px;
}

.damage-diffuser {
    left: 68px;
    top: 30px;
    padding: 2px;
}

.damage-rear_wing {
    left: 0;
    top: 28px;
}

.damage-sidepod {
    left: 90px;
    top: 15px;
    padding: 2px;
}

.damage-floor {
    left: 65px;
    bottom: 5px;
    padding: 2px;
}

/* HEADER */

header {
    height: 9vh;
    display:grid;
    align-items: center;
    grid-template-columns: minmax(42vw, 1fr) .5fr 1fr;
    grid-auto-flow: column;
}

header .cell-1 {
    padding-left: 5px;
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: minmax(10rem, .33fr) minmax(10rem, .33fr) minmax(10rem, .33fr);
    justify-content: space-evenly;
    justify-items: center;
    flex-direction: row;
    align-items: center;
}

header .cell-2 {
    display: flex;
    align-items: center;
    justify-content: center;
}

header .cell-3 { 
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding-top: 5px;
    padding-right: 5px;
}

/* TRACK */

.track {
    grid-row: 1 / 3;
    grid-column: 1;
    display: flex;
    flex-direction: row;
    height: 2rem;
    justify-content: space-evenly;
}

.track img {
    margin-right: 15px;
}

.track .track-city {
    text-transform: uppercase;
    font-size: x-large;
    font-family: "F1-black";
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* SESSION NAME */

.session {
    grid-column: 2;
}

.session-name {
    text-transform: capitalize;
    font-size: large;
    font-family: 'F1-bold';
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.generated-at {
    grid-column: 3;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* TIME LEFT */
.time-left {
    font-family: 'F1-black';
    font-size: x-large !important;
}

/* FORECAST */

.forecast {
    display: flex;
    flex-direction: column;
}

.forecast-top {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
}

.forecast-bottom {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
}

.team-logo {
    z-index: 0;
}

.position-number {
    z-index: 1;
}   

/* COMPACTED HEIGHT */

@media screen and (max-height: 1080px) {
    .standing-table-cell.cell-4.qualif-mode {
        font-size: x-small;
    }
}

/* MACBOOK DIM */

@media screen and (max-width: 1440px) {
    :root {
        --car-width: 13rem;
    }
    header {
        height: 7vh;
    }

    header .cell-1 {
        grid-template-columns: minmax(22rem, .66fr) minmax(0rem, 0.33fr)
    }

    .session {
        grid-column: 2;
    }

    .generated-at {
        grid-column: 2;
    }

    .driver-name {
        font-size: large;
    }

    .time-left {
        font-size: larger !important;
    }

    .standing-table {
        grid-template-columns: minmax(5rem,7rem) minmax(13rem, 1fr) minmax(12rem, 13rem) 14rem;
    }

    .standing-table-cell.cell-1 {
        flex-direction: row;
        justify-content: space-evenly;
    }

    .standing-table>.cell-1 {
        grid-column: 1;
    }

    .standing-table>.cell-2 {
        grid-column: 1;
    }

    .standing-table>.cell-3 {
        grid-column: 2;
    }

    .standing-table>.cell-4 {
        grid-column: 3;
    }

    .standing-table>.cell-5 {
        grid-column: 4;
    }

    .badge { 
        font-size: x-small;
    }
    
    .standing-table-cell.cell-4.qualif-mode {
        font-size: xx-small;
    }

    .standing-table-cell.cell-2 {
        grid-template-rows: 0.5fr 0.5fr;
    }

    .standing-table-cell.cell-2 .badge{
        align-self: flex-start;
        margin-top: 0.2rem;
    }

    .standing-table-cell.cell-2 .team{
        align-self: end;
        margin-bottom: 0.2rem;
    }

    .team-logo {
        height: 1.5em;
    }

    .personal-best-lap {
        font-size: x-small;
    }

    .forecast {
        font-size: small;
        img { 
            height: 25px;
        }
    }

    .ers-value {
        font-size: smaller;
        bottom: 1px;
    }

    .row-2.cell-2 {
        background: inherit;
    }
    .row-4.cell-2 {
        background: inherit;
    }
    .row-6.cell-2 {
        background: inherit;
    }
    .row-8.cell-2 {
        background: inherit;
    }
    .row-10.cell-2 {
        background: inherit;
    }
    .row-12.cell-2 {
        background: inherit;
    }
    .row-14.cell-2 {
        background: inherit;
    }
    .row-16.cell-2 {
        background: inherit;
    }
    .row-18.cell-2 {
        background: inherit;
    }
    .row-20.cell-2 {
        background: inherit;
    }
}
