@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

:root {
    --primary-background-color: white;
    --secondary-background-color: #039be5;
    --secondary-background-hover: #038bce;
    --page-background-color: #f4f9fc;
    --border-color: #d7e8f1;
    --text-muted-color: #5e6b73;
    --shadow-color: rgba(3, 155, 229, 0.12);
}

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


html, body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: var(--page-background-color);
    color: #111820;
    max-width: 100vw;
    overflow-x: hidden;
}

main {
    position: relative;
    margin-bottom: 2rem;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

p {
    margin-bottom: 1rem;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

th[data-column="date"] {
    min-width: 125px;
}

td[data-column="flag"], th[data-column="flag"] {
    width: 10%;
}

th[data-column="team"] {
    width: 25%;
}

th[data-column="score"] {
    width: 30%;
}

@media (max-width: 374px) {
    th[data-column="flag"], td[data-column="flag"] {
        display: none;
    }
}

.text-center {
    text-align: center;
}

.app-shell {
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

.app-header {
    color: white;
    background-color: var(--secondary-background-color);
    box-shadow: 0 8px 24px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 20;
    max-width: 100vw;
    overflow: hidden;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: min(100%, 1440px);
    max-width: 100%;
    margin-inline: auto;
    padding: .65rem clamp(.75rem, 2vw, 1.5rem);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.brand-link img {
    display: block;
    height: 32px;
    width: auto;
    object-fit: contain;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: white;
    text-decoration: none;
    padding: .55rem .65rem;
    border-radius: 6px;
    white-space: nowrap;
    font-size: .94rem;
    transition: background-color .2s, color .2s;
}

.main-nav a:hover,
.main-nav a.active {
    background-color: rgba(255, 255, 255, .18);
}

.app-main {
    padding-top: 1.5rem;
    max-width: 100vw;
    overflow-x: hidden;
}

.app-footer {
    color: var(--text-muted-color);
    font-size: .85rem;
    text-align: center;
    padding: 1rem;
}

.login-display {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .45rem;
    flex: 0 1 260px;
    min-width: 0;
    margin-left: .25rem;
    white-space: nowrap;
    font-size: .9rem;
}

    .login-greeting {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .login-display a {
        color: white;
    }

    .login-display form {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .login-display button {
        color: white;
        background-color: transparent;
        border: none;
        cursor: pointer;
        font-size: 1rem;
    }

        .login-display button:hover {
            opacity: 0.7;
        }

@media (max-width: 1180px) {
    .header-inner {
        flex-wrap: wrap;
        gap: .55rem .75rem;
    }

    .brand-link img {
        height: 30px;
    }

    .main-nav {
        order: 3;
        flex: 1 0 100%;
        width: 100%;
    }

    .main-nav a {
        flex: 0 0 auto;
        padding: .5rem .6rem;
    }

    .login-display {
        flex: 1 1 auto;
        max-width: calc(100% - 9rem);
        margin-left: auto;
    }
}

.page-container {
    width: min(100%, 1200px);
    margin-inline: auto;
    padding: 0 clamp(.75rem, 2vw, 1rem) 2rem;
}

.page-title {
    text-align: center;
    margin: 1rem 0 1.5rem;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1.1;
}

.player-select-container {
    display: flex;
    flex-direction: column;
    text-align: center;
    width: clamp(200px, 100%, 500px);
    margin: 0 auto;
    padding: 1rem;
}

    .player-select-container * {
        margin: .5rem 0;
    }

    .player-select-container select {
        padding: .5rem;
    }

    .player-select-container a {
        cursor: pointer;
    }

.player-heading {
    padding: 1rem;
    margin: 0 auto;
    text-align: center;
    position: sticky;
    background-color: var(--secondary-background-color);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    color: white;
    top: -1px;
    left: 0;
}

.fa-star {
    margin-left: 2px;
    color: #039be5;
}

.fa-spoon {
    margin-left: 2px;
    color: #039be5;
}

.winners-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    text-align: center;
    width: 100%;
    margin: 0 auto;
}

.winners-competition {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background-color: white;
}

.winners-names {
    padding-top: 1rem;    
}

.winners-names h4 {
    padding-bottom: 0.5rem;
}

.knockout-leaderboard-container {
    width: clamp(300px, 100vw, 1600px);
    scroll-behavior: smooth;
    overflow-x: auto;
    margin: 0 auto;
}

.knockout-leaderboard {
    display: flex;
    flex-direction: row;
}

.knockout-column {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex-basis: 25%;
    max-width: 500px;
    font-size: .8rem;
    padding: 0 .5rem;
    width: clamp(300px, 100vw, 1500px);
    margin: 1rem auto 3rem auto;
}

    .knockout-column > div {
        display: grid;
        grid-template-columns: 80% 20%;
        padding: .5rem;
    }

        .knockout-column > div:nth-last-of-type(2n + 1) {
            margin-bottom: 1rem;
        }

        .knockout-column > div p {
            display: flex;
            padding: 0rem;
            border: 1px solid black;
            border-bottom: 0;
            align-items: center;
        }

            .knockout-column > div p:nth-last-of-type(1), .knockout-column > div p:nth-last-of-type(2) {
                border-bottom: 1px solid black;
            }

            .knockout-column > div p:nth-child(2n+1) {
                border-right: 0;
            }

            .knockout-column > div p:nth-child(2n) {
                padding: 0 .25rem;
            }

            .knockout-column > div p img {
                max-height: 24px;
                margin-right: 5px;
            }

.knockout-leaderboard-nav {
    display: none;
}

@media (max-width: 768px) {
    .knockout-leaderboard {
        width: 400vw;
    }

    .knockout-leaderboard-nav {
        position: fixed;
        display: flex;
        justify-content: space-around;
        width: 100%;
        bottom: 4rem;
    }

        .knockout-leaderboard-nav a {
            padding: .5rem 1rem;
            color: white;
            background-color: var(--secondary-background-color);
            border-radius: 50px;
            cursor: pointer;
        }

            .knockout-leaderboard-nav a.active {
                background-color: #016798;
            }
}

input[type=text] {
    font-size: 16px;
}

.prediction-select {
    width: min(100%, 14rem);
    min-width: 10rem;
    border: 1px solid #c9cace;
    border-radius: 4px;
    background: white;
    color: #1f2933;
    font: inherit;
    padding: .7rem;
}

.form-message {
    margin: .75rem 0 1rem;
    color: #8a4b00;
    font-weight: 600;
}

.final-winner-panel {
    margin: 1rem 0 1.5rem;
    padding: 1rem;
    border: 1px solid #d7eaf5;
    border-left: 4px solid var(--secondary-background-color);
    border-radius: 6px;
    background: #f7fbfd;
    text-align: center;
}

.final-winner-panel h3 {
    margin: 0 0 .75rem;
}

.final-winner-panel .prediction-select {
    margin-top: .75rem;
}

.final-winner-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2rem;
    font-weight: 700;
}

.mui-input {
    position: relative;
    border: 1px solid #c9cace;
    border-radius: 4px;
    color: #65676e;
    background-color: white;
    padding: 1rem;
    cursor: text;
    display: block;
    margin-bottom: 1rem;
    outline: none;
    position: relative;
}

    .mui-input > span {
        position: absolute;
        background-color: inherit;
        pointer-events: none;
        transition: top .25s, font-size .25s, color .25s;
        transition-timing-function: cubic-bezier(0,.59,.35,.99);
        left: .75rem;
        top: 1rem;
        padding-inline: .25rem;
    }

    .mui-input > input {
        border: none;
        font-size: 1rem;
        width: 100%;
        outline: none;
    }

        .mui-input > input:focus {
            outline: none;
        }

    .mui-input:hover {
        border-color: black;
    }

    .mui-input.focussed {
        border-color: #635dff;
    }

        .mui-input.focussed span,
        .mui-input.populated span {
            top: -.4rem;
            font-size: .8rem;
        }

        .mui-input.focussed span {
            color: #635dff;
        }

.select {
    position: relative;
    cursor: default;
}

    .select.focussed {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-bottom: 0;
    }

    .select > p {
        margin: 0;
        min-height: 1rem;
        color: black;
    }

    .select .options {
        position: absolute;
        background-color: inherit;
        left: -1px;
        top: 100%;
        width: calc(100% + 2px);
        border: 1px solid #635dff;
        border-top: 0;
        border-bottom-left-radius: 3px;
        border-bottom-right-radius: 3px;
        z-index: 1;
    }

    .select .options .option {
        padding: 1rem;
        margin: 0;
        cursor: pointer;
    }

        .select .options .option:hover {
            background-color: #635dff;
            color: white;
        }

a.btn {
    text-align: center;
    text-decoration: none;
}

.btn {
    display: block;
    font-size: 1rem;
    font-family: inherit;
    width: 100%;
    border: none;
    border-radius: 6px;
    padding: 1rem;
    cursor: pointer;
    transition: background-color .5s;
}

.btn-blue {
    background-color: #039be5;
    color: white;
}

    .btn-blue:hover {
        background-color: var(--secondary-background-hover);
    }

.form-page {
    display: grid;
    place-items: center;
    min-width: 100vw;
    min-height: 100vh;
    background-color: black;
}

.form-container {
    background-color: white;
    border-radius: 5px;
    padding: 2rem;
    width: min(400px, 100%);
    text-align: center;
}

table {
    background-color: white;
    text-align: left;
    padding: 0;
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .04);
    overflow: hidden;
}

table .mui-input {
    margin-bottom: 0;
}

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

.competition-table th:first-child,
.competition-table td:first-child {
    width: 52%;
}

.competition-table th:nth-child(2),
.competition-table td:nth-child(2),
.competition-table th:nth-child(3),
.competition-table td:nth-child(3) {
    width: 16%;
}

.competition-action-column {
    width: 16%;
    text-align: right;
}

.competition-table td.competition-action-column {
    padding: 0;
}

.competition-table.league-competition-table th:first-child,
.competition-table.league-competition-table td:first-child {
    width: 40%;
}

.competition-table.league-competition-table th:nth-child(2),
.competition-table.league-competition-table td:nth-child(2) {
    width: 18%;
}

.competition-table.league-competition-table th:nth-child(3),
.competition-table.league-competition-table td:nth-child(3),
.competition-table.league-competition-table th:nth-child(4),
.competition-table.league-competition-table td:nth-child(4) {
    width: 13%;
    white-space: nowrap;
    overflow-wrap: normal;
}

.competition-table.league-competition-table .competition-action-column {
    width: 16%;
}

.btn-table-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 3rem;
    padding: .75rem;
    border-radius: 0;
    box-sizing: border-box;
}

th, td {
    padding: .75rem .65rem;
    border-bottom: 1px solid #e6eef2;
    overflow-wrap: break-word;
}

tr > th {
    color: white;
    background-color: var(--secondary-background-color);
    font-weight: 700;
}

    td > img:not(.team-flag):not(.team-badge) {
        width: 100%;
    }

tr:nth-child(2n + 1) td {
    background-color: #f1f6f9;
}

tr:last-child td {
    border-bottom: 0;
}

.full-width {
    width: 100%;
}

.info-panel {
    margin-bottom: 2rem;
    background-color: var(--primary-background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .04);
    padding: clamp(1rem, 2vw, 1.5rem);
}

    .info-panel h2 {
        margin-bottom: 1rem;
        font-size: 1.25rem;
    }

.checkbox-cell {
    text-align: center;
}

.checkbox-cell input,
.checkbox-label input {
    width: 1.1rem;
    height: 1.1rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 1rem;
}

.admin-competitions-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.admin-competition-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .9rem;
    align-items: start;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .035);
}

.admin-competition-title h3 {
    margin: 0 0 .25rem;
    font-size: 1.15rem;
    line-height: 1.25;
}

.admin-competition-title span,
.admin-competition-meta span {
    color: var(--text-muted-color);
}

.admin-competition-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.admin-competition-meta div {
    display: grid;
    gap: .15rem;
}

.admin-date-field {
    display: grid;
    gap: .25rem;
    margin: 0;
}

.admin-date-field input {
    width: 100%;
    min-height: 2.5rem;
    padding: .45rem .55rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font: inherit;
    font-weight: 700;
    background-color: white;
}

.admin-hidden-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: .45rem;
    margin: 0;
}

.admin-hidden-toggle input {
    width: 1.25rem;
    height: 1.25rem;
}

.competition-admin-user-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 12rem);
    gap: .75rem;
    align-items: center;
    padding: .75rem 0;
    border-bottom: 1px solid #e6eef2;
}

.competition-admin-user-row:last-child {
    border-bottom: 0;
}

.competition-admin-user-row div {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

.competition-admin-user-row strong {
    overflow-wrap: anywhere;
}

.competition-admin-user-row span {
    color: var(--text-muted-color);
}

.admin-row-actions {
    display: flex;
    align-items: stretch;
    gap: .5rem;
}

.admin-row-actions .btn-table-action {
    flex: 1 1 auto;
    min-height: 2.75rem;
    border-radius: 6px;
}

.invite-link-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.invite-link-row a {
    min-width: 0;
    overflow-wrap: anywhere;
}

.invite-copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: auto;
    min-height: 2.35rem;
    padding: .55rem .8rem;
}

.league-admin-card {
    display: grid;
    gap: 1rem;
}

.league-admin-card h3 {
    margin: .5rem 0 .75rem;
}

.league-admin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #e6eef2;
    padding-bottom: 1rem;
}

.league-admin-header h2,
.league-list-card h3 {
    margin: 0 0 .45rem;
}

.league-member-count {
    color: var(--text-muted-color);
    white-space: nowrap;
}

.league-status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    padding: .25rem .55rem;
    font-size: .82rem;
    font-weight: 700;
}

.league-status-pill.is-public {
    color: #075985;
    background-color: #e0f2fe;
    border: 1px solid #bae6fd;
}

.league-status-pill.is-private {
    color: #374151;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
}

.league-status-pill.is-pending {
    color: #854d0e;
    background-color: #fef3c7;
    border: 1px solid #fde68a;
}

.league-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
    align-items: end;
}

.league-public-toggle {
    min-height: 2.75rem;
    align-items: center;
}

.league-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.league-list-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .035);
}

.league-card-action {
    width: auto;
    min-width: 10rem;
    padding: .75rem 1rem;
}

.league-request-list {
    display: grid;
    gap: .65rem;
}

.league-request-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
    padding: .8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #f8fbfd;
}

.league-request-row div:first-child {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

.league-request-row strong {
    overflow-wrap: anywhere;
}

.league-request-row span {
    color: var(--text-muted-color);
}

.league-request-actions {
    display: flex;
    align-items: stretch;
    gap: .5rem;
}

.icon-delete-button {
    flex: 0 0 2.75rem;
    width: 2.75rem;
    min-height: 2.75rem;
    border: 1px solid #f1b4b4;
    border-radius: 6px;
    color: #b32121;
    background-color: white;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.icon-delete-button:hover {
    color: white;
    background-color: #b32121;
    border-color: #b32121;
}

.leaderboard-decoration {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: .2rem;
    min-width: 1.45rem;
    min-height: 1.45rem;
    border-radius: 999px;
    cursor: help;
    vertical-align: middle;
}

.leaderboard-decoration::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + .45rem);
    z-index: 40;
    width: max-content;
    max-width: min(15rem, 80vw);
    padding: .4rem .55rem;
    border-radius: 6px;
    color: white;
    background-color: #111820;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
    font-size: .8rem;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, .2rem);
    transition: opacity .15s, transform .15s;
}

.leaderboard-decoration::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + .15rem);
    z-index: 41;
    border: .3rem solid transparent;
    border-top-color: #111820;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity .15s;
}

.leaderboard-decoration:hover::after,
.leaderboard-decoration:focus::after,
.leaderboard-decoration:hover::before,
.leaderboard-decoration:focus::before {
    opacity: 1;
}

.leaderboard-decoration:hover::after,
.leaderboard-decoration:focus::after {
    transform: translate(-50%, 0);
}

.leaderboard-decoration:focus {
    outline: 2px solid var(--secondary-background-color);
    outline-offset: 2px;
}

.admin-message {
    color: var(--text-muted-color);
    background-color: #eef8fd;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: .75rem;
}

.admin-page-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    margin-bottom: 1rem;
}

.admin-users-list {
    display: grid;
    gap: .9rem;
}

.admin-user-card {
    display: grid;
    grid-template-columns: minmax(13rem, 1fr) minmax(16rem, 1.35fr) minmax(18rem, 1.45fr);
    gap: 1rem;
    align-items: start;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .035);
}

.admin-user-summary h2,
.admin-user-decorations h3,
.admin-user-actions h3 {
    margin: 0 0 .35rem;
    font-size: 1rem;
    line-height: 1.25;
}

.admin-user-summary p {
    margin: 0;
    color: var(--text-muted-color);
    overflow-wrap: anywhere;
}

.admin-user-decorations h3,
.admin-user-actions h3 {
    color: var(--text-muted-color);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.decoration-list {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.decoration-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 2rem;
    padding: .25rem .45rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: white;
    max-width: 100%;
}

.decoration-pill button {
    width: 1.4rem;
    height: 1.4rem;
    border: 0;
    border-radius: 50%;
    color: #b32121;
    background-color: #f7dddd;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.admin-decoration-form {
    display: grid;
    grid-template-columns: minmax(9rem, 1fr) minmax(10rem, 1.2fr) minmax(5rem, .6fr);
    gap: .5rem;
    align-items: center;
}

.admin-decoration-form select,
.admin-decoration-form input {
    min-height: 2.5rem;
    border: 1px solid #cbd5dc;
    border-radius: 6px;
    padding: .45rem .55rem;
}

.admin-decoration-form .btn {
    min-height: 2.5rem;
    padding: .65rem .9rem;
}

.muted-text {
    color: var(--text-muted-color);
}

.fixture-date-heading {
    margin: 1.5rem 0 .5rem;
}

.fixture-table {
    margin-bottom: 1rem;
}

.fixture-table th {
    white-space: nowrap;
}

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

.prediction-table th {
    white-space: nowrap;
}

.prediction-table th:nth-child(2),
.prediction-table td:nth-child(2),
.prediction-table th:nth-child(3),
.prediction-table td:nth-child(3) {
    width: 6.5rem;
    text-align: center;
}

.prediction-table th:first-child,
.prediction-table td:first-child,
.prediction-table th:nth-child(4),
.prediction-table td:nth-child(4) {
    width: 22%;
}

.prediction-table th:last-child,
.prediction-table td:last-child {
    text-align: center;
}

.create-prediction-table td:first-child,
.create-prediction-table td:nth-child(4) {
    text-align: left;
}

.create-prediction-table td:first-child .team-with-flag,
.create-prediction-table td:nth-child(4) .team-with-flag {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    column-gap: .45rem;
    width: 100%;
}

.prediction-team-name {
    min-width: 0;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.user-prediction-table th:first-child,
.user-prediction-table td:first-child {
    width: 16%;
}

.user-prediction-table th:nth-child(2),
.user-prediction-table td:nth-child(2),
.user-prediction-table th:nth-child(4),
.user-prediction-table td:nth-child(4) {
    width: 15%;
}

.user-prediction-table th:nth-child(3),
.user-prediction-table td:nth-child(3),
.user-prediction-table th:nth-child(5),
.user-prediction-table td:nth-child(5),
.user-prediction-table th:nth-child(7),
.user-prediction-table td:nth-child(7) {
    width: 5rem;
    text-align: center;
}

.user-prediction-table th:nth-child(6),
.user-prediction-table td:nth-child(6) {
    width: 16%;
}

.team-with-flag {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
    max-width: 100%;
}

.team-name {
    display: inline-block;
    max-width: 100%;
    line-height: 1.2;
    overflow-wrap: break-word;
}

.team-flag {
    width: 24px;
    height: 18px;
    object-fit: cover;
}

.team-badge {
    width: 24px;
    height: 18px;
    object-fit: contain;
}

.team-flag-placeholder {
    display: inline-block;
    width: 24px;
    height: 18px;
}

@media (max-width: 700px) {
    body {
        font-size: 15px;
    }

    .header-inner {
        align-items: center;
        flex-wrap: wrap;
        gap: .5rem;
        padding: .65rem .75rem;
    }

    .brand-link img {
        height: 30px;
    }

    .main-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        padding-bottom: .15rem;
        scrollbar-width: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav a {
        flex: 0 0 auto;
        gap: .35rem;
        padding: .5rem .55rem;
        font-size: .9rem;
    }

    .login-display {
        flex: 1 1 auto;
        max-width: calc(100% - 9rem);
        font-size: .8rem;
    }

    .app-main {
        padding-top: 1rem;
    }

    .page-container {
        width: 100%;
        padding-inline: .55rem;
    }

    .page-title {
        margin: .75rem 0 1rem;
        font-size: clamp(1.55rem, 8vw, 2rem);
    }

    .info-panel {
        padding: .8rem;
        margin-bottom: 1rem;
        border-radius: 6px;
    }

    .info-panel h2 {
        font-size: 1.1rem;
    }

    table {
        font-size: .92rem;
        table-layout: fixed;
    }

    th,
    td {
        padding: .55rem .35rem;
    }

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

    .competition-table th:first-child,
    .competition-table td:first-child {
        width: 44%;
    }

    .competition-table th:nth-child(2),
    .competition-table td:nth-child(2),
    .competition-table th:nth-child(3),
    .competition-table td:nth-child(3) {
        width: 18%;
    }

    .competition-action-column {
        width: 20%;
    }

    .competition-table.league-competition-table th:first-child,
    .competition-table.league-competition-table td:first-child {
        width: 36%;
    }

    .competition-table.league-competition-table th:nth-child(2),
    .competition-table.league-competition-table td:nth-child(2) {
        width: 18%;
    }

    .competition-table.league-competition-table th:nth-child(3),
    .competition-table.league-competition-table td:nth-child(3),
    .competition-table.league-competition-table th:nth-child(4),
    .competition-table.league-competition-table td:nth-child(4) {
        width: 14%;
        white-space: nowrap;
        overflow-wrap: normal;
    }

    .competition-table.league-competition-table .competition-action-column {
        width: 14%;
    }

    .btn-table-action {
        min-width: 0;
        min-height: 2.5rem;
        padding: .55rem .45rem;
        font-size: .9rem;
    }

    .fixture-date-heading {
        font-size: 1.2rem;
        line-height: 1.2;
    }

    .fixture-table {
        font-size: .9rem;
    }

    .fixture-table th,
    .fixture-table td {
        padding: .5rem .25rem;
        text-align: center;
    }

    .fixture-table th:nth-child(2),
    .fixture-table td:nth-child(2),
    .fixture-table th:nth-child(5),
    .fixture-table td:nth-child(5) {
        width: 2rem !important;
    }

    .fixture-table th:nth-child(3),
    .fixture-table td:nth-child(3),
    .fixture-table th:nth-child(4),
    .fixture-table td:nth-child(4) {
        width: 2.4rem !important;
    }

    .fixture-table th:nth-child(7),
    .fixture-table td:nth-child(7) {
        width: 3.4rem !important;
    }

    .prediction-table {
        font-size: .88rem;
    }

    .prediction-table th,
    .prediction-table td {
        padding: .5rem .25rem;
    }

    .prediction-table th:nth-child(2),
    .prediction-table td:nth-child(2),
    .prediction-table th:nth-child(3),
    .prediction-table td:nth-child(3) {
        width: 3rem;
        min-width: 3rem;
    }

    .create-prediction-table th:first-child,
    .create-prediction-table td:first-child,
    .create-prediction-table th:nth-child(4),
    .create-prediction-table td:nth-child(4) {
        width: calc((100% - 6rem) / 2);
    }

    .user-prediction-table th:first-child,
    .user-prediction-table td:first-child {
        width: 18%;
    }

    .user-prediction-table th:nth-child(2),
    .user-prediction-table td:nth-child(2),
    .user-prediction-table th:nth-child(4),
    .user-prediction-table td:nth-child(4) {
        width: 17%;
    }

    .user-prediction-table th:nth-child(3),
    .user-prediction-table td:nth-child(3),
    .user-prediction-table th:nth-child(5),
    .user-prediction-table td:nth-child(5),
    .user-prediction-table th:nth-child(7),
    .user-prediction-table td:nth-child(7) {
        width: 2.8rem;
    }

    .user-prediction-table th:nth-child(6),
    .user-prediction-table td:nth-child(6) {
        width: 17%;
    }

    .team-flag,
    .team-badge,
    .team-flag-placeholder {
        width: 20px;
        height: 15px;
    }

    .team-with-flag {
        align-items: center;
        flex-direction: column;
        gap: .2rem;
        font-size: .86rem;
        line-height: 1.15;
        text-align: center;
    }

    .create-prediction-table td:first-child {
        text-align: left;
    }

    .create-prediction-table td:nth-child(4) {
        text-align: right;
    }

    .create-prediction-table td:first-child .team-with-flag {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: 15px auto;
        justify-items: start;
        align-items: start;
        text-align: left;
    }

    .create-prediction-table td:nth-child(4) .team-with-flag {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: 15px auto;
        justify-items: end;
        align-items: end;
        text-align: right;
    }

    .create-prediction-table .prediction-team-name {
        display: block;
        width: 100%;
    }

    .team-name {
        font-size: .86rem;
        line-height: 1.15;
        text-align: center;
    }

    .mui-input {
        padding: .55rem .35rem;
    }

    .mui-input > input {
        text-align: center;
    }

    .prediction-select {
        min-width: 0;
        width: 100%;
        padding: .55rem .35rem;
        font-size: .9rem;
    }

    .final-winner-panel {
        padding: .8rem;
    }

    .admin-competition-card {
        grid-template-columns: 1fr;
        gap: .8rem;
        padding: .85rem;
    }

    .admin-competition-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-hidden-toggle {
        justify-content: flex-start;
    }

    .admin-row-actions {
        width: 100%;
    }

    .admin-row-actions .btn-table-action {
        min-height: 2.75rem;
        white-space: normal;
    }

    .league-admin-header,
    .league-list-card {
        grid-template-columns: 1fr;
    }

    .league-admin-header {
        display: grid;
    }

    .league-settings-grid {
        grid-template-columns: 1fr;
    }

    .league-card-action {
        width: 100%;
    }

    .league-request-row {
        grid-template-columns: 1fr;
    }

    .league-request-actions .invite-copy-button {
        flex: 1 1 auto;
    }

    .competition-admin-user-row {
        grid-template-columns: 1fr;
    }

    .icon-delete-button {
        flex: 0 0 2.75rem;
    }

    .admin-user-card {
        grid-template-columns: 1fr;
        gap: .85rem;
        padding: .85rem;
    }

    .admin-decoration-form {
        grid-template-columns: 1fr;
    }

    .admin-page-actions {
        justify-content: stretch;
    }

    .admin-user-summary h2 {
        font-size: 1.05rem;
    }

    .decoration-pill {
        max-width: 100%;
        align-items: flex-start;
    }
}

@media (max-width: 430px) {
    .header-inner {
        align-items: flex-start;
    }

    .brand-link {
        flex: 0 0 auto;
    }

    .main-nav {
        justify-content: flex-start;
        margin-inline: -.55rem;
        padding-inline: .55rem;
    }

    .main-nav a {
        font-size: .84rem;
    }

    .main-nav a span {
        max-width: 7.2rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    table {
        font-size: .86rem;
    }

    .competition-table.league-competition-table {
        display: block;
        width: 100%;
        min-width: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .competition-table.league-competition-table tr:first-child {
        display: none;
    }

    .competition-table.league-competition-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 4.7rem;
        grid-template-areas:
            "title action"
            "league action"
            "start action"
            "end action";
        gap: .18rem .7rem;
        align-items: start;
        margin-bottom: .75rem;
        padding: .75rem;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        background: var(--primary-background-color);
        box-shadow: 0 8px 18px rgba(0, 0, 0, .04);
    }

    .competition-table.league-competition-table tr:last-child {
        margin-bottom: 0;
    }

    .competition-table.league-competition-table td {
        display: block;
        width: auto !important;
        padding: 0;
        border: 0;
        background: transparent !important;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .competition-table.league-competition-table td:first-child {
        grid-area: title;
        font-weight: 700;
    }

    .competition-table.league-competition-table td:nth-child(2) {
        grid-area: league;
        color: #5f6d76;
        font-size: .8rem;
    }

    .competition-table.league-competition-table td:nth-child(3) {
        grid-area: start;
        font-size: .8rem;
    }

    .competition-table.league-competition-table td:nth-child(4) {
        grid-area: end;
        font-size: .8rem;
    }

    .competition-table.league-competition-table td:nth-child(3)::before {
        content: "Start ";
        color: #5f6d76;
        font-weight: 600;
    }

    .competition-table.league-competition-table td:nth-child(4)::before {
        content: "End ";
        color: #5f6d76;
        font-weight: 600;
    }

    .competition-table.league-competition-table .competition-action-column {
        grid-area: action;
        align-self: start;
        justify-self: end;
        width: 4.7rem !important;
    }

    .competition-table.league-competition-table .btn-table-action {
        width: 100%;
        min-height: 2.5rem;
        padding: .55rem .45rem;
        font-size: .9rem;
        border-radius: 0;
    }

    .fixture-table {
        font-size: .82rem;
    }

    .fixture-table th,
    .fixture-table td {
        padding: .45rem .2rem;
    }

    .fixture-table th:nth-child(3),
    .fixture-table td:nth-child(3),
    .fixture-table th:nth-child(4),
    .fixture-table td:nth-child(4) {
        width: 2rem !important;
    }

    .fixture-table th:nth-child(3),
    .fixture-table th:nth-child(4) {
        font-size: 0;
    }

    .fixture-table th:nth-child(3)::after,
    .fixture-table th:nth-child(4)::after {
        font-size: .72rem;
    }

    .fixture-table th:nth-child(3)::after {
        content: "H";
    }

    .fixture-table th:nth-child(4)::after {
        content: "A";
    }

    .fixture-table th:nth-child(7),
    .fixture-table td:nth-child(7) {
        width: 3rem !important;
    }

    .prediction-table {
        font-size: .8rem;
    }

    .prediction-table th:nth-child(2),
    .prediction-table td:nth-child(2),
    .prediction-table th:nth-child(3),
    .prediction-table td:nth-child(3) {
        width: 2.75rem;
        min-width: 2.75rem;
    }

    .prediction-table th:nth-child(2),
    .prediction-table th:nth-child(3) {
        font-size: 0;
    }

    .prediction-table th:nth-child(2)::after,
    .prediction-table th:nth-child(3)::after {
        font-size: .68rem;
    }

    .prediction-table th:nth-child(2)::after {
        content: "H";
    }

    .prediction-table th:nth-child(3)::after {
        content: "A";
    }

    .user-prediction-table th:nth-child(3)::after,
    .user-prediction-table th:nth-child(5)::after {
        font-size: .68rem;
    }

    .user-prediction-table th:nth-child(3)::after {
        content: "A";
    }

    .user-prediction-table th:nth-child(5)::after {
        content: "B";
    }

    .user-prediction-table th:nth-child(2),
    .user-prediction-table th:nth-child(4),
    .user-prediction-table th:nth-child(6) {
        font-size: .8rem;
    }

    .user-prediction-table th:nth-child(2)::after,
    .user-prediction-table th:nth-child(4)::after,
    .user-prediction-table th:nth-child(6)::after {
        content: none;
    }

    .user-prediction-table th:nth-child(3),
    .user-prediction-table th:nth-child(5) {
        font-size: 0;
    }

    .user-prediction-table th:nth-child(3),
    .user-prediction-table td:nth-child(3),
    .user-prediction-table th:nth-child(5),
    .user-prediction-table td:nth-child(5),
    .user-prediction-table th:nth-child(7),
    .user-prediction-table td:nth-child(7) {
        width: 2.4rem;
    }

    .team-flag,
    .team-badge,
    .team-flag-placeholder {
        width: 18px;
        height: 14px;
    }
}

.loading-screen {
    position: fixed;
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    align-items: center;
    justify-content: center;
    color: white;
}

@keyframes spin {
    from {
        transform: rotate(0);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading-screen .fa-spinner {
    padding: 1rem;
    animation: spin 2s linear;
    animation-iteration-count: infinite;
}

.loading-screen h3 {
    margin-bottom: .5rem;
}

.loading {
    text-align: center;
    margin: 1rem auto 0 auto;
}
