html {
    --navbar-height: 48px;
    scroll-padding-top: var(--navbar-height);
}

body {
    font-size: .875rem;
    --team-a-color: rgba(175, 141, 195, 0.65);
    --team-b-color: rgba(127, 191, 123, 0.65);
    --text-color: #e6e6e6;
    --text-color-hover: #81aad4;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100; /* behind navbar */
    padding: var(--navbar-height) 0 0; /* navbar height */
    box-shadow: inset -1px 0 0 rgba(222, 226, 230, 0.65);

    color: var(--text-color);
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - var(--navbar-height));
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

@supports ((position: -webkit-sticky) or (position: sticky)) {
    .sidebar-sticky {
        position: -webkit-sticky;
        position: sticky;
    }
}

.sidebar .nav-item:hover {
    background-color: rgba(0,0,0,0.3);
}

.sidebar .nav-link {
    font-weight: 500;
    color: var(--text-color);
}

.sidebar .nav-link.active {
    color: var(--text-color-hover);
}

.sidebar .icon {
    margin: 10px 10px 10px 0;
    width: 25px;
    height: 25px;
}

.sidebar h6 {
    /* font-weight: 700; */
    color: #fff;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
}

.sidebar .icon.icon-team-a {
    background-color: var(--team-a-color);
}

.sidebar .icon.icon-team-b {
    background-color: var(--team-b-color);
}

/** main styles */

[role="main"] {
    padding-top: 72px; /* space for navbar */
    background-color: rgb(52, 58, 64);
    color: var(--text-color);
    min-height: calc(100vh);
}

.link {
    color: var(--text-color);
    text-decoration: underline;
}

.link:hover {
    color: var(--text-color-hover);
    text-decoration: none;
}

.fas {
    color: #aaa;
}

.fas.fa-spinner {
    animation: spinner 1.2s linear infinite;
}

@keyframes spinner {
    0% {
        transform: rotate(0deg);
    }
    
    100% {
        transform: rotate(360deg);
    }
}

.team-comp p {
    padding: 0.5rem;
    margin: 0;
}

.team-comp .team-title {
    font-weight: 700;
}

.team-comp > :nth-child(1) {
    background-color: var(--team-a-color);
}

.team-comp > :nth-child(2) {
    background-color: var(--team-b-color);
}

.stats-round {
    display: flex;
}

.score-bucket {
    margin: 1rem 7px 0 0;
    font-size: 3rem;
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    width: 6.5rem;
}

.score-bucket > div {
    padding: 7px;
    font-weight: 700;
    text-align: center;
}

.score-bucket div:nth-child(2) {
    flex-shrink: 0.5;
}

.stats, .summary {
    text-align: right;
    width: auto !important; /* override bootstrap; only size as wide as is needed */
}

.icon:before {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

table thead tr {
    border-bottom: 1px solid #333;
}

table > :not(thead) tr:last-child {
    border-bottom: 2px solid #333;
}

table tr.total {
    border-top: 1px solid #333;
    border-bottom: 2px solid #333;
    text-shadow: 2px 2px 4px #333;
}

.summary tr {
    border-bottom: 1px solid #333;
}

.summary td {
    padding: 0.5rem;
}

.summary > :not(thead) tr:nth-child(1) {
    background-color: var(--team-a-color);
}

.summary tr.comp td.up {
    background-color: rgba(175, 141, 195, 0.5);
}

.summary tr:nth-child(3) {
    background-color: var(--team-b-color);
}

.summary tr.comp td.down {
    background-color: rgba(127, 191, 123, 0.5);
}

.summary tr.comp td.down:before {
    padding-right: 5px;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    content: "\f063";
}

.summary tr.comp td {
    /* opacity: 0.6; */
    color: rgba(0, 0, 0, 0.4);
    background-color: rgba(240, 240, 240, 0.5);
}

.summary tr.comp td.up:before {
    padding-right: 5px;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    content: "\f062";
}

.score-bucket div {
    border: 1px solid #333;
    padding: 0.5rem;
}

.score-bucket .team1 {
    border-bottom: 2px solid #333;
}

.stats, .summary-offense, .summary-defense {
    --padding-between-sections: 15px;
}

.stats span.mvp {
    color: yellow;
}

.stats td:first-child, .stats th:first-child,
.stats td:nth-child(2), .stats th:nth-child(2) {
    text-align: left;
}

/** tks */
.stats td.team-kills, .stats th.team-kills,
.stats td.damage-team, .stats th.damage-team,
.stats td.suicides, .stats th.suicides,
.stats td.team-deaths, .stats th.team-deaths {
    color: rgb(255, 125, 138);
    text-shadow: 2px 2px 4px #333;
}

/** minus sign prepend */
.stats td.team-kills::before, .stats th.team-kills::before,
.stats td.damage-team::before, .stats th.damage-team::before {
    content: "\2212";
}

.stats td.conc-kills {
    font-style: italic;
}

.stats td.sentry-kills, .stats th.sentry-kills {
    color: rgb(18, 194, 221);
    text-shadow: 2px 2px 4px #333;
}

.stats td.sentry-kills:not(.no-kills)::before, .stats th.sentry-kills::before,
.stats td.suicides::before, .stats th.suicides::before,
.stats td.team-deaths::before, .stats th.team-deaths::before {
    content: "+";
}

.stats td.roles, .stats th.roles,
td.sentry-kills, th.sentry-kills,
td.damage-team, th.damage-team,
td.team-deaths, th.team-deaths,
.summary td.team, .summary th.team,
.summary-defense td.conc-kills, .summary-defense th.conc-kills {
    border-right: 1px solid #333;
    padding-right: var(--padding-between-sections);
}

.stats td.objectives, .stats th.objectives,
.summary-offense td.flag-time, .summary-offense th.flag-time,
.summary-defense td.airshots, .summary-defense th.airshots {
    padding-right: var(--padding-between-sections);
}


.summary-offense td:nth-child(6), .summary-offense th:nth-child(6),
.summary-offense td:nth-child(10), .summary-offense th:nth-child(10),
.summary-defense td:nth-child(5), .summary-defense th:nth-child(5),
.summary-defense td:nth-child(9), .summary-defense th:nth-child(9)  {
    padding-left: 10px;
}

/** team styles */

.team1 {
    background-color: rgba(0, 123, 255, 0.5);
}
.total.team1 {
    background-color: rgba(0, 123, 255, 0.7);
}

.team2 {
    background-color: rgba(220, 53, 69, 0.5);
}
.total.team2 {
    background-color: rgba(220, 53, 69, 0.7);
}

.team3 {
    background-color: rgba(255, 193, 7, 0.5);
}

.team4 {
    background-color: rgba(40, 167, 69, 0.5);
}

.team5 {
    background-color: rgba(248, 249, 250, 0.5);
}

.table-hover tbody tr:hover td {
    background: rgba(248, 249, 250, 0.25);
}

.table a {
    color: inherit;
}

.table a:hover {
    color: inherit;
}

/** player stats styles */

#player-details .player-name {
    font-weight: 700;
}

#player-details .player-stats {
    display: grid;
    grid-template-columns: 3rem 1fr 1fr;
    row-gap: 15px;
    column-gap: 40px;
}

#player-details .player-stats.player-stats-num1 {
    grid-template-columns: 3rem 1fr;
}

#player-details .player-stats .emoji {
    font-size: 2rem;
}

#player-details .player-stats .round-title {
    font-size: 1.5rem;
    font-weight: 700;
    align-self: end;
}

#player-details .player-stats .classes > div {
    padding-right: 10px;
    align-items: center;
    justify-content: flex-end;
}

#player-details .stats-facets {
    display: grid;
    grid-template-columns: auto auto auto;
    column-gap: 15px;
    row-gap: 5px;
}

#player-details .stats-faceted {
    padding-top: 10px;
}

#player-details .facet-value {
    font-weight: 700;
    justify-self: end;
}

#player-details .facet-summary {
    grid-column: 1 / span 3;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    border-bottom: 1px solid rgba(200, 200, 200, 0.3);
}

/** weapon styles **/

.weapon-icon {
    background: url('/assets/img/tfc_dmsg_transparent.png');
    display: inline-block;
    width: 60px;
    height: 16px;
}

.weapon-1 { background-position: -150px -224px; width: 24px; height: 16px; }
.weapon-2 { background-position: -84px -2px; width: 24px; height: 16px;}
.weapon-3 { background-position: -84px -74px; width: 24px; height: 16px; }
.weapon-4 { background-position: -84px -122px; width: 24px; height: 16px; }
.weapon-5 { background-position: -112px -64px; width: 48px; }
.weapon-6 { background-position: -112px -42px; width: 48px; }
.weapon-7 { background-position: 0px -208px; }
.weapon-8 { background-position: 0px -48px }
.weapon-9 { background-position: 0px -192px; }
.weapon-10 { background-position: 0px -144px; }
.weapon-11 { background-position: -48px -224px; width: 48px; }
.weapon-12 { background-position: -96px -208px; width: 48px; }
.weapon-13 { background-position: 0px -16px; width: 48px; }
.weapon-14 { background-position: -112px -4px; width: 36px; }
.weapon-15 { background-position: -208px -137px; width: 48px; }
.weapon-16 { background-position: -84px -188px; width: 14px; height: 18px; }
.weapon-17 { background-position: -208px -137px; width: 48px; } /* same as 15 */
.weapon-18 { background-position: 0px -112px; }
.weapon-19 { background-position: 0px -128px; }
.weapon-20 { background-position: -112px -82px; height: 18px; width: 26px; }
.weapon-21 { background-position: -112px -22px; height: 20px; }
.weapon-22 { background-position: -84px -26px; width: 24px; }
.weapon-23 { background-position: -84px -50px; width: 24px; }
.weapon-24 { background-position: -84px -98px; width: 24px; }
.weapon-25 { background-position: 0px -32px; }
.weapon-26 { background-position: -208px -121px; width: 48px; }
.weapon-27 { background-position: 0px -80px; }
.weapon-28 { background-position: 0px -96px; }
.weapon-29 { background-position: -84px -170px; width: 18px; }
.weapon-30, .weapon-31, .weapon-32, .weapon-33 { background-position: -192px -240px; width: 36px; }
.weapon-34 { background-position: 0px -176px; }

.weapon-highlight-good {
    filter: sepia(60%) saturate(7000%) hue-rotate(65deg) brightness(127%) contrast(129%);
}

.weapon-highlight-bad {
    filter: sepia(60%) saturate(8000%) hue-rotate(340deg) brightness(90%);
}

/** navbar styles */

.navbar-brand {
    padding-top: .75rem;
    padding-bottom: .75rem;
    font-size: 1rem;
    background-color: rgba(0, 0, 0, .25);
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25);
}

.navbar .form-control {
    padding: .75rem 1rem;
    border-width: 0;
    border-radius: 0;
}

.form-control-dark {
    color: #fff;
    background-color: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .1);
}

.form-control-dark:focus {
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
}