html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

/* The search boxes have their own (bigger) clear button: the browser's own one would make two. */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

input[type="search"]::-ms-clear {
    display: none;
}

a {
    color: #0071c1;
}

.content {
    padding-top: 1.1rem;
}

#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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA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: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

/* ===================================== */
/*                                       */
/*       Competition Color classes       */
/*                                       */
/* ===================================== */


.yellow {
    background-color: #fffacd !important;
}

.orange {
    background-color: #ffd700 !important;
}

.blue {
    background-color: #87ceeb !important;
}

.white {
    background-color: #ffffff !important;
}

.green {
    background-color: #9acd32 !important;
}

.pink {
    background-color: #ffc0cb !important;
}

.purple {
    background-color: #ee82ee !important;
}

.grey {
    background-color: #595959 !important;
}

.red {
    background-color: #ff8080 !important;
}

.salmon {
    background-color: #fa8072 !important;
}

.coral {
    background-color: #ff7f50 !important;
}

.peach {
    background-color: #ffdab9 !important;
}

.beige {
    background-color: #f5deb3 !important;
}

.brown {
    background-color: #d2a679 !important;
}

.olive {
    background-color: #c5c56a !important;
}

.lime {
    background-color: #ccff66 !important;
}

.mint {
    background-color: #98fb98 !important;
}

.teal {
    background-color: #66cdaa !important;
}

.turquoise {
    background-color: #40e0d0 !important;
}

.lightblue {
    background-color: #cfe8ff !important;
}

.steelblue {
    background-color: #6fa8dc !important;
}

.lavender {
    background-color: #e6e6fa !important;
}

.lilac {
    background-color: #c8a2c8 !important;
}

.silver {
    background-color: #c0c0c0 !important;
}


/* ===================================== */
/*                                       */
/*       CUSTOM Flag Icons               */
/*                                       */
/* ===================================== */

.fi-gb-iow {
    background-image: url(../flags/4x3/gb-iow.svg);
    width: 2.0em !important;
}

.fi-nzsf {
    background-image: url(../flags/4x3/nzsf.svg);
    width: 2.0em !important;
}

.fi-corsica {
    background-image: url(../flags/4x3/corsica.svg);
}

/* ===================================== */
/*                                       */
/*       CUSTOM CSS                      */
/*                                       */
/* ===================================== */

.max-size-logo {
    max-width: 153px;
    max-height: 56px;
    object-fit: contain;
}

/* A dark logo on the dark menu bar gets a light backdrop (see js/logo-contrast.js). */
.max-size-logo.logo-dark {
    padding: 3px 6px;
    border-radius: 6px;
    background: #fff;
}

.tournament-name {
    font-size: 1.1rem;
    white-space: normal;
}

/* The app icon in the menu bar of a phone, for a tournament without a logo. */
.app-icon {
    width: 2.5rem;
    height: 2.5rem;
}

/* ===================================== */
/*                                       */
/*       Menu                            */
/*                                       */
/* ===================================== */

/* The bar is 66px high: the sticky toolbars of the pages sit right under it (top: 66px). */
.fo-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    height: 66px;
    padding: 0 .75rem 0 1rem;
    background: #18212b;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 2px 10px rgba(16, 24, 40, .18);
}

.fo-bar-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    color: #fff;
    text-decoration: none;
}

.fo-bar-brand:hover {
    color: #fff;
}

.fo-bar-brand .tournament-name {
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fo-menu-button {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: .55rem;
    height: 2.75rem;
    padding: 0 .85rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: .8rem;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-weight: 700;
}

.fo-menu-button:active {
    background: rgba(255, 255, 255, .14);
}

.fo-burger {
    display: grid;
    gap: 4px;
    width: 1.15rem;
}

.fo-burger span {
    height: 2px;
    border-radius: 1px;
    background: currentColor;
}

.fo-burger span:nth-child(2) {
    width: 70%;
}

/* The menu: the whole screen on a phone, a panel on the right on a bigger screen. */
.fo-menu {
    --bs-offcanvas-width: 100%;
    --bs-offcanvas-bg: #18212b;
    --bs-offcanvas-color: #fff;
    --bs-offcanvas-border-width: 0;
    background:
        radial-gradient(circle at 100% 0, rgba(63, 179, 127, .16), transparent 45%),
        #18212b;
}

@media (min-width: 576px) {
    .fo-menu {
        --bs-offcanvas-width: 24rem;
    }
}

.fo-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 66px;
    padding: .75rem .75rem .75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.fo-menu-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    font-weight: 700;
}

.fo-menu-close {
    position: relative;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: .8rem;
    background: rgba(255, 255, 255, .06);
}

/* A cross, drawn: no icon to load. */
.fo-menu-close span::before,
.fo-menu-close span::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.1rem;
    height: 2px;
    margin: -1px 0 0 -.55rem;
    border-radius: 1px;
    background: #fff;
    transform: rotate(45deg);
}

.fo-menu-close span::after {
    transform: rotate(-45deg);
}

.fo-menu-list {
    display: grid;
    gap: .35rem;
    margin: 0;
    padding: 1rem .75rem 2rem;
    overflow-y: auto;
    list-style: none;
}

.fo-menu-item {
    display: block;
    border-radius: .9rem;
    color: #fff;
    text-decoration: none;
}

.fo-menu-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, .05);
}

.fo-menu-link {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-height: 3.75rem;
    padding: .55rem .75rem;
}

.fo-menu-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: .75rem;
    background: rgba(255, 255, 255, .08);
    color: #c7d2de;
    font-size: 1.35rem;
}

.fo-menu-label {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.fo-menu-label b {
    font-size: 1.05rem;
}

.fo-menu-label small {
    color: rgba(255, 255, 255, .6);
}

.fo-menu-external {
    color: rgba(255, 255, 255, .5);
    font-size: 1.1rem;
}

/* The page that is open */
.fo-menu-item.active {
    background: rgba(63, 179, 127, .16);
    box-shadow: inset 3px 0 0 #3fb37f;
}

.fo-menu-item.active .fo-menu-icon {
    background: #3fb37f;
    color: #fff;
}

/* ===================================== */
/*                                       */
/*       Loading screen                  */
/*                                       */
/* ===================================== */

/* While the app downloads (App.razor) and while the tournament loads (AppSplash): the same screen. */
.fo-splash {
    position: fixed;
    inset: 0;
    z-index: 900; /* under #blazor-error-ui */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 15% 10%, rgba(63, 179, 127, .18), transparent 40%),
        radial-gradient(circle at 85% 90%, rgba(46, 111, 219, .16), transparent 45%),
        #18212b;
    color: #fff;
    text-align: center;
    transition: opacity .3s;
}

.fo-splash-gone {
    opacity: 0;
    pointer-events: none;
}

.fo-splash-logo {
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 16rem;
    height: 8rem;
}

.fo-splash-logo img {
    max-width: 100%;
    max-height: 8rem;
    object-fit: contain;
    animation: fo-splash-breathe 2.4s ease-in-out infinite;
}

/* A dark logo on the dark screen gets a light tile behind it (see js/logo-contrast.js). */
.fo-splash-logo img.logo-dark {
    padding: .7rem;
    border-radius: 1rem;
    background: #fff;
}

.fo-splash-logo img.fo-splash-icon {
    width: 5rem;
    height: 5rem;
    border-radius: 1.2rem;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 12px 30px rgba(0, 0, 0, .35);
}

/* The download progress of the app (--blazor-load-percentage, set by Blazor), with a light that keeps moving. */
.fo-splash-bar {
    position: relative;
    width: 11rem;
    height: 4px;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(255, 255, 255, .14);
}

.fo-splash-bar span {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--blazor-load-percentage, 100%);
    border-radius: 2px;
    background: #3fb37f;
    transition: width .2s;
}

.fo-splash-bar::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -40%;
    width: 40%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
    animation: fo-splash-light 1.3s ease-in-out infinite;
}

.fo-splash-text {
    margin: 0;
    color: rgba(255, 255, 255, .75);
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .02em;
}

/* Only after a while: a bad connection on the field. */
.fo-splash-slow {
    margin: -.6rem 0 0;
    color: rgba(255, 255, 255, .55);
    font-size: .85rem;
    opacity: 0;
    animation: fo-splash-show .4s ease-out 15s forwards;
}

.fo-splash-slow a {
    color: #fff;
    font-weight: 700;
}

@keyframes fo-splash-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

@keyframes fo-splash-light {
    to { left: 100%; }
}

@keyframes fo-splash-show {
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .fo-splash-logo img,
    .fo-splash-bar::after {
        animation: none;
    }
}
