/* Shared public and learning footer, independent of the page's visual shell. */
.site-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px 32px;
    width: 100%;
    max-width: 1180px;
    margin: 16px auto 0;
    padding: 24px 32px calc(24px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #34415b;
    color: #b6bfd4;
    line-height: 1.5;
}

.site-footer-brand {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 6px 10px;
    min-width: 0;
    font-size: .875rem;
    font-weight: 600;
}

.site-footer .site-flag {
    width: 24px;
    height: 17px;
    border-radius: 2px;
    background: linear-gradient(#080b12 0 33.333%, #e34842 33.333% 66.666%, #f3c62c 66.666%);
    box-shadow: 0 0 0 1px #ffffff25;
}

.site-footer-brand small {
    grid-column: 2;
    color: inherit;
    font-size: .8125rem;
    font-weight: 400;
}

.site-footer-links {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.site-footer-link-group {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0 24px;
}

.site-footer .site-footer-links a {
    display: flex;
    align-items: center;
    min-height: 36px;
    min-width: 0;
    padding: 6px 0;
    border: 0;
    background: none;
    color: #b6bfd4;
    font-size: .8125rem;
    line-height: 1.5;
    text-decoration: none;
    text-underline-offset: 4px;
    overflow-wrap: normal;
}

.site-footer .site-footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.site-footer .site-footer-links a:focus-visible {
    border-radius: 3px;
    outline: 3px solid #bcc3ff;
    outline-offset: 4px;
}

.site-footer-compact {
    display: block;
    margin-top: 24px;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}

.site-footer-compact .site-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 24px;
}

.site-footer-compact .site-footer-link-group {
    justify-content: flex-start;
}

/* Empty feedback and the retired fixed footer must not leave blank bands. */
.game-page .game-feedback:empty {
    min-height: 0;
    margin-top: 0;
}

.game-page > .container {
    padding-bottom: 16px;
}

@media (max-width: 700px) {
    .site-footer {
        flex-direction: column;
        gap: 16px;
        margin-top: 0;
        padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    }

    .site-footer .site-footer-links {
        display: grid;
        justify-content: stretch;
        gap: 0;
        width: 100%;
    }

    .site-footer-link-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 16px;
    }

    .site-footer .site-footer-links a {
        min-height: 44px;
    }

    .site-footer-compact {
        margin-top: 24px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    }
}
