html,
body {
    min-height: 100%;
    overflow-x: hidden;
    -webkit-user-select: none;
    user-select: none;
}

:root {
    --app-header-height: 48px;
    --standings-head-height: 42px;
}

body {
    padding-top: var(--app-header-height);
}

body.home-route {
    padding-top: 0;
    overflow: hidden;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
}

body.home-route .header {
    position: static;
}

.app-navbar {
    display: grid;
    grid-template-columns: 3.25rem 1fr 3.25rem;
    gap: .25rem;
    align-items: center;
}

.app-navbar span {
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-shell {
    min-height: calc(100vh - var(--app-header-height));
}

body.home-route .app-shell {
    height: calc(95vh - var(--app-header-height));
    height: calc(95svh - var(--app-header-height));
    min-height: 0;
    overflow: hidden;
}

.app-loading {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .32);
    backdrop-filter: blur(2px);
}

.app-loading.hidden {
    display: none;
}

.app-empty {
    display: grid;
    min-height: 50vh;
    place-items: center;
    align-content: center;
    gap: .75rem;
    text-align: center;
}

.app-empty i {
    font-size: 2rem;
}

.home-screen {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows:
        minmax(4.8rem, 1.15fr)
        repeat(4, minmax(4.2rem, 1fr))
        minmax(5.4rem, 1fr)
        auto;
    overflow: hidden;
    text-align: center;
}

.home-title {
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    line-height: 1;
}

.home-selectors {
    display: contents;
}

.home-title-row,
.selector-block,
.home-actions {
    min-height: 0;
}

.home-title-row,
.selector-value-row,
.app-version {
    background-color: rgba(255, 255, 255, .05);
}

.home-title-row {
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 0 .5rem;
}

.selector-block {
    display: grid;
    grid-template-rows: minmax(1.15rem, .36fr) minmax(2.8rem, .64fr);
    align-items: stretch;
}

.selector-label {
    display: grid;
    place-items: center;
    line-height: 1.15;
}

.selector-value-row {
    display: grid;
    place-items: center;
    padding: 0 .5rem;
}

.selector-row {
    display: inline-grid;
    grid-template-columns: auto minmax(0, auto) auto;
    align-items: center;
    gap: .35rem;
    max-width: min(100%, 38rem);
    margin: 0 auto;
    white-space: nowrap;
}

.selector-control {
    display: inline-grid;
    grid-template-columns: auto minmax(0, auto) auto;
    align-items: center;
    gap: .35rem;
    max-width: min(100%, 38rem);
    margin: 0 auto;
}

.selector-value {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-actions .btn {
    min-height: 5rem;
}

.home-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    padding: .35rem .5rem;
    align-items: center;
}

.home-actions h1 {
    margin-bottom: 0;
}

.app-version {
    padding: .45rem 0 .35rem;
    text-align: center;
}

.standings-table {
    table-layout: fixed;
}

.standings-view {
    padding-top: var(--standings-head-height);
}

.standings-head-fixed {
    position: fixed;
    top: var(--app-header-height);
    left: 0;
    right: 0;
    z-index: 1035;
    background-color: var(--bs-dark);
}

.standings-head-fixed .table {
    margin-bottom: 0;
}

.standings-head-fixed th,
.standings-body-table th {
    position: static !important;
    background-color: var(--bs-dark);
}

.standings-body-table {
    margin-top: 0;
}

.standings-col-position {
    width: 10px;
}

.standings-col-shield {
    width: 60px;
}

.standings-col-team {
    width: 120px;
}

.standings-col-stat {
    width: 20px;
}

.standings-group-row td {
    background-color: var(--bs-dark);
    font-weight: 700;
}

.match-view {
    position: fixed;
    top: var(--app-header-height);
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.match-summary-fixed {
    flex: 0 0 auto;
    z-index: 1035;
    background-color: var(--bs-dark);
}

.match-summary-fixed .table {
    margin-bottom: 0;
}

.match-summary-fixed td {
    background-color: var(--bs-dark);
}

.match-scroll-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.event-row > td {
    padding-left: .5rem;
    padding-right: .5rem;
}

.event-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1.7rem 2.1rem 1.7rem minmax(0, 1fr);
    align-items: center;
    column-gap: .15rem;
}

.event-detail {
    min-width: 0;
    overflow: hidden;
    line-height: 1.15;
}

.event-detail-home {
    text-align: right;
}

.event-detail-away {
    text-align: left;
}

.event-icon,
.event-minute {
    text-align: center;
}

.event-person {
    display: inline-flex;
    width: 100%;
    max-width: 100%;
    align-items: center;
    gap: .2rem;
    vertical-align: bottom;
}

.event-detail-home .event-person {
    justify-content: flex-end;
}

.event-person-away {
    justify-content: flex-start;
}

.event-player {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-person i {
    flex: 0 0 auto;
}

.event-goal-icon {
    width: 18px;
    height: auto;
}

.standings-team {
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1.05;
}

.match-row {
    cursor: pointer;
}

.match-row-disabled {
    cursor: default;
}

.team-name-normal {
    color: #fff !important;
}

.team-name-muted {
    color: #6c757d !important;
}

.match-meta {
    display: block;
    margin-bottom: .08rem;
    font-size: calc(3mm + 2px);
}

.match-side {
    position: relative;
    padding-bottom: 2.15rem !important;
    vertical-align: top;
}

.match-team-top {
    display: block;
}

.match-team-name {
    display: block;
    line-height: 1.12;
}

.match-score {
    display: block;
    position: absolute;
    right: .5rem;
    bottom: .28rem;
    left: .5rem;
}

.live-dot {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    margin-right: .35rem;
    border-radius: 50%;
    background: #dc3545;
}

@media (max-width: 576px) {
    :root {
        --standings-head-height: 34px;
    }

    .selector-control {
        grid-template-columns: auto minmax(0, 1fr) auto;
        max-width: 92vw;
    }

    .selector-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
        max-width: 92vw;
    }

    .selector-control .btn {
        padding-left: .35rem;
        padding-right: .35rem;
    }

    .selector-row .btn {
        padding-left: .35rem;
        padding-right: .35rem;
    }

    .event-row > td {
        padding-left: .25rem;
        padding-right: .25rem;
    }

    .event-grid {
        grid-template-columns: minmax(0, 1fr) 1.45rem 1.9rem 1.45rem minmax(0, 1fr);
    }

    .event-detail {
        font-size: calc(1rem - 1px);
    }

    .standings-table {
        width: calc(100% - .45rem);
        margin-left: auto;
        margin-right: auto;
        font-size: .84rem;
    }

    .standings-table th,
    .standings-table td {
        padding-left: .14rem;
        padding-right: .14rem;
    }

    .standings-col-position {
        width: 1.7rem;
    }

    .standings-col-shield {
        width: 2.55rem;
    }

    .standings-col-stat {
        width: 1.48rem;
    }

    .standings-table img {
        width: 32px;
        height: auto;
    }

    .match-row td:first-child,
    .match-row td:last-child,
    .match-summary-fixed td:first-child,
    .match-summary-fixed td:last-child {
        width: 44px !important;
    }

    .match-row td:first-child,
    .match-summary-fixed td:first-child {
        padding-left: .08rem;
        padding-right: .08rem;
    }

    .match-row td:last-child,
    .match-summary-fixed td:last-child {
        padding-left: .08rem;
        padding-right: .08rem;
    }

    .match-row img,
    .match-summary-fixed img {
        width: 44px !important;
        height: auto;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}
