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

a, .btn-link {
    color: #006bb7;
}

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

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

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

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.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."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Floating fields show just their label, which moves up once there is something typed. */
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: transparent;
}

.form-floating > label::after {
    background-color: transparent !important;
}
/* Full screen play areas. A canvas keeps its shape, given by --ratio on its stage, and grows to fill the screen. */
.game-stage > .fullscreen-button {
    margin-top: .5rem;
}

[data-fullscreen].is-fullscreen {
    overflow: auto;
}

/* A full-screen game on a touch screen (fullscreen.js): fingers can pan but not zoom, and pressing and holding
   doesn't select text or bring up the browser's menu. Text boxes still select, for typing and pasting. */
html.game-locked,
html.game-locked body,
html.game-locked [data-fullscreen].is-fullscreen {
    touch-action: pan-x pan-y;
}

html.game-locked [data-fullscreen].is-fullscreen {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Nothing of the page sits over a game being played full screen or with touch controls: the chat button comes back
   when play ends. Rooms keep their own chat inside the game. */
html.game-locked .friends-dock,
body.faux-fullscreen .friends-dock {
    display: none;
}

html.game-locked [data-fullscreen].is-fullscreen :is(input, textarea, [contenteditable]) {
    -webkit-touch-callout: default;
    -webkit-user-select: text;
    user-select: text;
}

/* Where the browser refuses real full screen, the play area covers the page instead, above the friends button. */
.faux-fullscreen[data-fullscreen] {
    position: fixed !important;
    inset: 0;
    z-index: 1016;
    width: auto !important;
    max-width: none !important;
    height: 100dvh;
    margin: 0 !important;
    border-radius: 0 !important;
}

body.faux-fullscreen {
    overflow: hidden;
}

.game-stage.is-fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.game-stage.is-fullscreen > canvas {
    width: min(100vw, calc(100dvh * var(--ratio))) !important;
    border-radius: 0 !important;
}

.game-stage.is-fullscreen > .fullscreen-button {
    position: fixed;
    right: 12px;
    bottom: 12px;
    margin: 0;
    z-index: 1003;
    opacity: .5;
    color: #fff;
    background: rgba(0, 0, 0, .6);
    border-color: rgba(255, 255, 255, .5);
}

.game-stage.is-fullscreen > .fullscreen-button:hover,
.game-stage.is-fullscreen > .fullscreen-button:focus-visible {
    opacity: 1;
}

/* Game-over buttons. Canvas games pin them inside their popup from script (games/endactions.js), so they stay
   hidden until the popup has made room for them. */
.game-stage > .end-actions {
    width: max-content;
    position: fixed;
    z-index: 1004;
    transform: translateX(-50%);
    visibility: hidden;
}

.end-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .5rem;
}

.end-actions > span {
    color: #d8def0;
    flex-basis: 100%;
    text-align: center;
}

/* Pause menu (Games/PauseMenu.razor). Fixed to the window, so it also covers a full-screen game. */
.game-stage > .pause-button {
    margin-top: .5rem;
    margin-right: .5rem;
}

.game-stage.is-fullscreen > .pause-button {
    position: fixed;
    right: 12px;
    top: 12px;
    margin: 0;
    z-index: 1003;
    opacity: .5;
    color: #fff;
    background: rgba(0, 0, 0, .6);
    border-color: rgba(255, 255, 255, .5);
}

.game-stage.is-fullscreen > .pause-button:hover,
.game-stage.is-fullscreen > .pause-button:focus-visible {
    opacity: 1;
}

.pause-overlay {
    position: fixed;
    inset: 0;
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, .6);
}

.pause-card {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: min(100%, 20rem);
    padding: 1.25rem;
    border-radius: 14px;
    background: #141824;
    color: #f2f4fa;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
    text-align: center;
}

.pause-card h2 {
    margin: 0 0 .25rem;
    font-size: 1.6rem;
    font-weight: 800;
}

.pause-card p {
    margin: 0 0 .25rem;
    color: #c4cad8;
    font-size: .9rem;
}

/* "Save score" inside a game-over popup (Games/ScoreSaver.razor). */
.score-saver {
    display: flex;
    flex-wrap: wrap;
    flex-basis: 100%;
    justify-content: center;
    align-items: center;
    gap: .4rem;
}

.score-saver .form-control {
    width: 10rem;
}

.score-saver span {
    color: inherit;
}

/* Achievement toasts (games/achievements.js) and the achievements page. */
.achievement-toasts {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1020;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: min(calc(100% - 32px), 22rem);
}

.achievement-toast {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .9rem;
    border-radius: 12px;
    border: 2px solid #f5c542;
    background: #1d1a10;
    color: #fff6dc;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
    animation: achievement-in .35s ease-out;
    transition: opacity .4s, transform .4s;
}

.achievement-toast:hover {
    color: #fff6dc;
}

.achievement-toast.leaving {
    opacity: 0;
    transform: translateY(-8px);
}

.achievement-toast > span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.achievement-toast small {
    color: #f5c542;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.achievement-toast span span {
    font-size: .85rem;
    color: #d9d0b4;
}

.achievement-badge {
    font-size: 1.8rem;
}

@keyframes achievement-in {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .achievement-toast {
        animation: none;
        transition: none;
    }
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: .6rem;
    margin-bottom: 1.5rem;
}

.achievement-card {
    display: flex;
    gap: .7rem;
    align-items: center;
    padding: .7rem .8rem;
    border-radius: 10px;
    border: 1px solid var(--bs-border-color, #dee2e6);
}

.achievement-card.unlocked {
    border-color: #d9a917;
    background: #fff8e1;
}

.achievement-card:not(.unlocked) .achievement-badge {
    filter: grayscale(1);
    opacity: .35;
}

.achievement-card p {
    margin: 0;
    font-size: .85rem;
}

.achievement-card small {
    color: #6c757d;
}

/* Daily challenges page (Pages/DailyPage.razor) and the line on each game's page. */
.daily-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: .6rem;
    max-width: 40rem;
    margin-bottom: 1rem;
}

.daily-stats > div {
    display: flex;
    flex-direction: column;
    padding: .6rem .8rem;
    border-radius: 10px;
    border: 1px solid var(--bs-border-color, #dee2e6);
}

.daily-stats strong {
    font-size: 1.3rem;
}

.daily-stats span {
    color: #6c757d;
    font-size: .85rem;
}

.daily-list {
    list-style: none;
    padding: 0;
    max-width: 40rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.daily-list li {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .7rem .9rem;
    border-radius: 10px;
    border: 1px solid var(--bs-border-color, #dee2e6);
}

.daily-list li.done {
    border-color: #d9a917;
    background: #fff8e1;
}

.daily-list li > div {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.daily-list small {
    color: #6c757d;
}

.daily-mark {
    font-size: 1.5rem;
    color: #d9a917;
}

.daily-status {
    font-weight: 600;
    color: #8a6a00;
}

.daily-today {
    padding: .5rem .8rem;
    border-left: 4px solid #d9a917;
    background: #fff8e1;
    border-radius: 6px;
    max-width: 40rem;
}

/* Player profile (Pages/ProfilePage.razor). */
.profile-head {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    margin-bottom: 1.2rem;
}

.profile-avatar {
    display: grid;
    place-items: center;
    width: 5.5rem;
    height: 5.5rem;
    flex: none;
    border-radius: 50%;
    background: #fff8e1;
    border: 3px solid #d9a917;
    font-size: 3rem;
}

.profile-identity {
    flex: 1;
    max-width: 28rem;
}

.profile-identity h1 {
    margin: 0;
}

.profile-identity p {
    margin: .2rem 0 .5rem;
    color: #6c757d;
}

.avatar-choices {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

.avatar-choice {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.4rem;
    border-radius: 8px;
    border: 2px solid var(--bs-border-color, #dee2e6);
    background: none;
}

.avatar-choice.chosen {
    border-color: #d9a917;
    background: #fff8e1;
}

.profile-totals {
    max-width: none;
}

.profile-games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: .8rem;
}

.profile-game {
    padding: .8rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--bs-border-color, #dee2e6);
}

.profile-game header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .4rem;
}

.profile-game h3 {
    margin: 0;
}

.profile-game dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .2rem .8rem;
    margin: 0 0 .3rem;
    font-size: .9rem;
}

.profile-game dt {
    font-weight: 500;
    color: #6c757d;
}

.profile-game dd {
    margin: 0;
}

@media (max-width: 480px) {
    .profile-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Friends and messages (Games/FriendsDock.razor), in the corner of every page. */
.friends-dock {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1015;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
    pointer-events: none;
}

.friends-dock > * {
    pointer-events: auto;
}

.friends-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .9rem;
    border: none;
    border-radius: 999px;
    background: #3a0647;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

.friends-toggle:hover {
    background: #52135f;
}

.friends-badge {
    display: inline-grid;
    place-items: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
}

/* A new message pops up as a speech bubble above the Chat button, pointing down at it. */
.friends-preview {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    max-width: min(20rem, calc(100vw - 32px));
    padding: .6rem .85rem;
    border: 1px solid #d9a917;
    border-radius: 16px 16px 4px 16px;
    background: #fff8e1;
    color: #212529;
    text-align: left;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
    transform-origin: bottom right;
    animation: friends-pop .4s cubic-bezier(.2, 1.5, .4, 1);
}

.friends-preview::after {
    content: "";
    position: absolute;
    right: 18px;
    bottom: -7px;
    width: 12px;
    height: 12px;
    border-right: inherit;
    border-bottom: inherit;
    background: inherit;
    transform: rotate(45deg);
}

.friends-preview-avatar {
    font-size: 1.6rem;
    line-height: 1;
}

.friends-preview-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.friends-preview-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

@keyframes friends-pop {
    from { opacity: 0; transform: translateY(10px) scale(.8); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .friends-preview {
        animation: none;
    }
}

.friends-panel {
    display: flex;
    flex-direction: column;
    width: 21rem;
    max-height: min(32rem, calc(100vh - 6rem));
    border-radius: 12px;
    background: #fff;
    color: #212529;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
    overflow: hidden;
}

.friends-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .7rem;
    background: #3a0647;
    color: #fff;
}

.friends-title {
    flex: 1;
}

.friends-tabs {
    display: flex;
    flex: 1;
    gap: .25rem;
}

.friends-tabs button {
    padding: .3rem .65rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, .75);
    font-weight: 600;
}

.friends-tabs button:hover {
    background: rgba(255, 255, 255, .15);
}

.friends-tabs button.active {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.friends-section {
    margin: .8rem 0 .2rem;
    color: #6c757d;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.friends-online-count {
    opacity: .8;
    font-weight: normal;
}

.friends-online-count::before {
    content: "· ";
}

.friends-head .friends-who small {
    color: rgba(255, 255, 255, .75);
}

.friends-icon-button {
    width: 2rem;
    height: 2rem;
    flex: none;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font-size: 1.3rem;
    line-height: 1;
}

.friends-icon-button:hover {
    background: rgba(255, 255, 255, .15);
}

.friends-body {
    padding: .7rem;
    overflow-y: auto;
}

.friends-body p {
    margin-bottom: .6rem;
}

.friends-small,
.friends-empty {
    color: #6c757d;
    font-size: .875rem;
}

.friends-code {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .6rem;
    font-size: .875rem;
}

.friends-code strong {
    flex: 1;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 1.1rem;
    letter-spacing: .08em;
}

.friends-add,
.friends-compose {
    display: flex;
    gap: .4rem;
}

.friends-add {
    margin-bottom: .6rem;
}

.friends-note {
    margin: .3rem 0 .6rem;
    font-size: .875rem;
}

.friends-compose + .friends-note {
    margin: 0 .7rem .5rem;
}

.friends-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .4rem .3rem;
    border: none;
    border-bottom: 1px solid #eee;
    background: none;
    color: inherit;
    text-align: left;
}

.friends-row.friend:hover {
    background: #f6f0f8;
}

.friends-row.request {
    background: #fff8e1;
}

.friends-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    flex: none;
    border-radius: 50%;
    background: #f1ecf3;
    font-size: 1.2rem;
}

.friends-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: .7rem;
    height: .7rem;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #adb5bd;
}

.friends-dot.on {
    background: #2fb344;
}

.friends-who {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.friends-who strong,
.friends-who small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friends-who small {
    color: #6c757d;
}

.friends-blocked {
    margin-top: .6rem;
    font-size: .875rem;
}

.friends-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    padding: .5rem .7rem;
    background: #f8f9fa;
    font-size: .875rem;
}

.friends-chat {
    display: flex;
    flex: 1;
    flex-direction: column-reverse;
    gap: .35rem;
    min-height: 12rem;
    padding: .7rem;
    overflow-y: auto;
    background: #faf8fb;
}

.friends-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    padding: .4rem .65rem;
    border-radius: 12px;
    overflow-wrap: anywhere;
}

.friends-message.mine {
    align-self: flex-end;
    background: #3a0647;
    color: #fff;
}

.friends-message.theirs {
    align-self: flex-start;
    background: #ece6ef;
}

.friends-message time {
    align-self: flex-end;
    font-size: .7rem;
    opacity: .7;
}

/* A room invite in chat: join, the code to copy, and a QR code (on white, so phones can read it on a dark theme). */
.chat-invite {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;
    margin-top: .35rem;
}

.chat-invite-code {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.chat-invite-code span {
    font: 700 1.05rem/1 ui-monospace, Consolas, monospace;
    letter-spacing: .15em;
    user-select: all;
}

.chat-invite-code .btn {
    padding: .05rem .45rem;
    font-size: .75rem;
}

.chat-invite img {
    padding: 4px;
    background: #fff;
    border-radius: 8px;
}

.friends-invite {
    margin: .5rem .7rem 0;
}

.room-invite {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    max-width: 32rem;
}

.room-invite-email {
    display: flex;
    flex: 1 1 16rem;
    gap: .5rem;
}

.friends-compose {
    padding: .5rem .7rem;
}

@media (max-width: 640px) {
    .friends-dock {
        right: 8px;
        bottom: 8px;
        left: 8px;
    }

    /* On a phone the closed button tucks behind the games, so it never covers play. */
    .friends-dock:not(.open) {
        z-index: 1;
    }

    [data-fullscreen] {
        position: relative;
        z-index: 2;
    }

    /* While a game is being played with touch controls (fullscreen.js) the chat button is hidden anyway, and the lift
       above would trap the game's canvas under the controls' backdrop. */
    html.game-locked [data-fullscreen]:not(.faux-fullscreen) {
        z-index: auto;
    }

    .friends-panel {
        width: 100%;
    }
}

/* Room chat (Components/RoomChatBox.razor). The overlay floats over canvas games, inside the stage so it goes full screen
   with it; the panel sits in lobbies and beside turn-based boards. */
.game-stage {
    position: relative;
}

.room-chat-line {
    margin: 0;
    overflow-wrap: anywhere;
}

.room-chat-line strong {
    color: hsl(var(--hue) 60% 35%);
}

.room-chat-line time {
    margin-left: .3rem;
    font-size: .7rem;
    opacity: .6;
}

.room-chat-compose {
    display: flex;
    gap: .4rem;
}

.room-chat-problem {
    margin: .3rem 0 0;
    color: #dc3545;
    font-size: .8rem;
}

.room-chat-empty {
    margin: 0;
    color: #6c757d;
    font-size: .875rem;
}

.room-chat.panel {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: 32rem;
    padding: .7rem .8rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 10px;
}

.room-chat.panel h2 {
    margin: 0;
    font-size: 1rem;
}

.room-chat.panel .room-chat-lines {
    display: flex;
    flex-direction: column-reverse;
    gap: .2rem;
    height: 10rem;
    overflow-y: auto;
    font-size: .9rem;
}

.room-chat.panel.dark {
    max-width: none;
    margin-top: .8rem;
    border-color: rgba(255, 255, 255, .15);
    background: rgba(0, 0, 0, .2);
    color: inherit;
}

.room-chat.dark .room-chat-line strong {
    color: hsl(var(--hue) 70% 72%);
}

.room-chat.dark .room-chat-empty {
    color: rgba(255, 255, 255, .6);
}

.room-chat.dark .form-control {
    border-color: rgba(255, 255, 255, .2);
    background: rgba(0, 0, 0, .3);
    color: #fff;
}

.room-chat.dark .form-control::placeholder {
    color: rgba(255, 255, 255, .5);
}

.room-chat.overlay {
    position: absolute;
    left: 10px;
    bottom: calc(2.5rem + 12px);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .3rem;
    width: min(22rem, calc(100% - 20px));
    pointer-events: none;
    font-size: .85rem;
}

.room-chat.overlay > * {
    pointer-events: auto;
}

.game-stage.is-fullscreen > .room-chat.overlay {
    position: fixed;
    bottom: 12px;
    left: 12px;
}

.room-chat.overlay .room-chat-lines {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    max-width: 100%;
    pointer-events: none;
}

.room-chat.overlay .room-chat-line {
    padding: .15rem .5rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
}

.room-chat.overlay .room-chat-line strong {
    color: hsl(var(--hue) 75% 72%);
}

.room-chat.overlay .room-chat-line.fading {
    animation: room-chat-fade 9s forwards;
}

.room-chat.overlay.open .room-chat-lines {
    max-height: 12rem;
    overflow-y: auto;
    pointer-events: auto;
}

.room-chat.overlay .room-chat-compose {
    width: 100%;
}

.room-chat.overlay .form-control {
    border-color: rgba(255, 255, 255, .35);
    background: rgba(0, 0, 0, .7);
    color: #fff;
}

.room-chat.overlay .form-control::placeholder {
    color: rgba(255, 255, 255, .55);
}

.room-chat.overlay .room-chat-problem {
    padding: 0 .4rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, .7);
    color: #ff8a95;
}

.room-chat-open {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .15rem .5rem;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 6px;
    background: rgba(0, 0, 0, .45);
    color: rgba(255, 255, 255, .85);
    font-size: .8rem;
}

.room-chat-open:hover,
.room-chat-open:focus-visible {
    background: rgba(0, 0, 0, .75);
    color: #fff;
}

.room-chat-open kbd {
    padding: 0 .25rem;
    font-size: .7rem;
    background: rgba(255, 255, 255, .2);
}

.room-chat-unread {
    display: inline-grid;
    place-items: center;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 .25rem;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
}

@keyframes room-chat-fade {
    0%, 75% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
    .room-chat.overlay .room-chat-line.fading {
        animation-timing-function: steps(1, end);
    }
}

/* The overlay's message box stays in the page while closed, out of sight, so Enter can focus it at once. */
.room-chat.overlay:not(.open):not(:focus-within) .room-chat-compose {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.room-chat.overlay:focus-within .room-chat-open {
    display: none;
}

/* Room for the floating Friends button, so it never covers the last thing on a page. */
main {
    padding-bottom: 4rem;
}

/* Spectators (Components/SpectatorBar.razor). */
.spectator-bar p {
    margin: .3rem 0;
}

.spectator-list {
    color: #6c757d;
    font-size: .9rem;
}

.spectator-watch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    margin: .3rem 0;
    font-size: .9rem;
}

.spectator-watch .form-control {
    width: 12rem;
}

.room-chat-tag {
    margin-left: .25rem;
    padding: 0 .3rem;
    border-radius: 4px;
    background: rgba(127, 127, 127, .25);
    font-size: .7rem;
    font-weight: 500;
}

/* Replay controls (Games/ReplayControls.razor), under the canvas, or along the bottom of a full-screen game. */
.replay-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: .5rem;
    padding: .4rem .6rem;
    border-radius: 8px;
    background: #141824;
    color: #d8def0;
}

.game-stage.is-fullscreen > .replay-bar {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1004;
    opacity: .92;
}

.replay-badge {
    font-weight: 600;
    color: #ffd166;
}

.replay-scrubber {
    flex: 1 1 10rem;
    min-width: 8rem;
}

.replay-time {
    font-variant-numeric: tabular-nums;
}

.replay-speed {
    width: auto;
}

.replay-saved {
    color: #9fe3b0;
}

.replay-error {
    color: #ff9b9b;
}

/* Replays page (Pages/ReplaysPage.razor). */
.replay-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: .5rem;
    max-width: 48rem;
}

.replay-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    padding: .6rem .8rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.replay-icon {
    font-size: 1.6rem;
}

.replay-info {
    display: flex;
    flex-direction: column;
    flex: 1 1 14rem;
    min-width: 0;
}

.replay-title {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.replay-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

/* Tournaments (Pages/TournamentsPage.razor, Pages/TournamentPage.razor, Games/TournamentEnd.razor). */
.cup-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: .5rem;
    max-width: 48rem;
}

.cup-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    padding: .6rem .8rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
}

.cup-icon {
    font-size: 1.6rem;
}

.cup-info {
    display: flex;
    flex-direction: column;
    flex: 1 1 14rem;
    min-width: 0;
}

.cup-title {
    font-weight: 600;
}

.cup-trophies {
    font-size: .9rem;
    color: var(--bs-secondary-color);
}

.cup-start {
    max-width: 28rem;
}

.cup-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    max-width: 56rem;
    margin-bottom: 1rem;
    padding: .8rem 1rem;
    border-radius: 10px;
    background: #eef4ff;
    border: 1px solid #b9cdf5;
}

.cup-banner.champion {
    background: linear-gradient(135deg, #fff6d6, #ffe7a3);
    border-color: #e0b84a;
}

.cup-banner.out {
    background: #f6f6f6;
    border-color: #d6d6d6;
}

.cup-skill {
    margin-left: .5rem;
    color: #b8860b;
    white-space: nowrap;
}

.bracket {
    display: flex;
    contain: inline-size;
    gap: 1.25rem;
    overflow-x: auto;
    padding-bottom: .75rem;
    margin-bottom: 1rem;
}

.bracket-round {
    flex: 1 0 11rem;
    max-width: 15rem;
    display: flex;
    flex-direction: column;
}

.bracket-round h2 {
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--bs-secondary-color);
}

.bracket-matches {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: .75rem;
}

.bracket-match {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.bracket-match.mine {
    border-color: #6f9cf0;
}

.bracket-match.champion-slot {
    border-color: #e0b84a;
    background: #fffaf0;
}

.bracket-slot {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    padding: .35rem .6rem;
    font-size: .92rem;
}

.bracket-slot + .bracket-slot {
    border-top: 1px solid var(--bs-border-color, #dee2e6);
}

.bracket-slot.tbd {
    color: var(--bs-secondary-color);
    font-style: italic;
}

.bracket-slot.won {
    font-weight: 700;
    background: #eefaf0;
}

.bracket-slot.lost {
    color: var(--bs-secondary-color);
    text-decoration: line-through;
}

.bracket-slot.you .bracket-name {
    color: #1b5ed8;
}

.bracket-name {
    overflow-wrap: anywhere;
}

.bracket-stars {
    color: #b8860b;
    font-size: .8rem;
    white-space: nowrap;
}

.tournament-result {
    align-self: center;
    padding: .3rem .8rem;
    border-radius: 999px;
    font-weight: 700;
    color: #fff;
    background: rgba(15, 20, 35, .8);
}

/* Room tournaments (Components/RoomTournamentSetup.razor, Components/RoomTournamentStandings.razor). */
.room-cup-setup {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    max-width: 32rem;
}

.room-cup-live {
    font-size: .9rem;
    font-weight: 600;
    color: #8a6300;
}

.room-cup {
    flex-basis: 100%;
    max-width: 26rem;
    margin: 0 auto;
    padding: .6rem .8rem;
    border-radius: 10px;
    background: rgba(15, 20, 35, .88);
    border: 1px solid #e0b84a;
    color: #fff;
    text-align: left;
}

.room-cup-title {
    margin-bottom: .4rem;
    color: #ffd76a;
}

.room-cup-table {
    width: 100%;
    font-size: .9rem;
    border-collapse: collapse;
}

.room-cup-table th {
    font-weight: 600;
    color: #c8cde0;
    border-bottom: 1px solid rgba(255, 255, 255, .25);
}

.room-cup-table th,
.room-cup-table td {
    padding: .15rem .4rem;
}

.room-cup-table td:first-child,
.room-cup-table td:nth-child(n + 3) {
    text-align: center;
    width: 3.5rem;
}

.room-cup-table tr.me td {
    color: #ffd76a;
    font-weight: 700;
}

.room-cup-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: .5rem;
}

.room-cup-leaders {
    font-size: .9rem;
}

p.room-cup-live + .room-cup,
.game-stage + .room-cup {
    margin-left: 0;
}

/* Room brackets (Components/RoomBracketSignup.razor, Components/RoomBracketView.razor). */
.room-bracket-signup {
    max-width: 36rem;
    padding: .75rem 1rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 10px;
}

.room-bracket-field {
    margin-bottom: .6rem;
    padding-left: 1.4rem;
}

.room-bracket:not(.room-cup) .room-cup-title {
    margin-bottom: .5rem;
    color: #8a6300;
}

.room-bracket .bracket-round h3 {
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--bs-secondary-color);
}

/* Tournament history */
.history-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.history-stats { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-bottom: .75rem; }
.history-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.history-item { display: flex; align-items: flex-start; gap: .75rem; padding: .65rem .85rem; border: 1px solid rgba(127,127,127,.25); border-radius: .6rem; }
.history-item.history-won { border-color: #d4a72c; background: rgba(212,167,44,.08); }
.history-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.history-title { display: flex; flex-wrap: wrap; gap: .3rem; }
.history-path { display: flex; flex-wrap: wrap; gap: .2rem .75rem; }
.history-beat { color: #2e8b57; }
.history-lost { color: #c0392b; }
.history-date { white-space: nowrap; font-size: .8rem; opacity: .7; }
.history-finishes { list-style: none; padding: 0; margin: .3rem 0; }
.history-place { display: inline-block; min-width: 2.2rem; font-weight: 600; }
@media (max-width: 480px) { .history-item { flex-wrap: wrap; } .history-date { width: 100%; padding-left: 2.25rem; } }
.history-watch { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin: .25rem 0; }
.history-watch .btn { padding: .1rem .5rem; font-size: .8rem; }
.watch-matches { display: flex; flex-wrap: wrap; gap: .3rem; }

/* Live commentary for players and spectators */
.live-commentary { display: flex; flex-direction: column; gap: .4rem; max-width: 40rem; margin-top: .75rem; padding: .6rem .8rem; border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 10px; }
.live-commentary header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.live-commentary h2 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: .4rem; }
.live-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #e0393e; box-shadow: 0 0 0 0 rgba(224, 57, 62, .6); animation: live-pulse 1.6s infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 .4rem rgba(224, 57, 62, 0); } 100% { box-shadow: 0 0 0 0 rgba(224, 57, 62, 0); } }
.live-commentary-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; max-height: 11rem; overflow-y: auto; font-size: .9rem; }
.live-commentary-lines li { display: flex; gap: .45rem; align-items: baseline; padding: .1rem .25rem; border-radius: 6px; }
.live-commentary-lines li.tone-highlight { font-weight: 600; }
.live-commentary-lines li.tone-result { font-weight: 700; background: rgba(212, 167, 44, .15); }
.live-commentary-lines li.fresh { animation: live-fresh 1.2s ease-out; }
@keyframes live-fresh { from { background: rgba(13, 110, 253, .18); } }
.live-commentary-icon { flex: none; width: 1.2rem; text-align: center; }
.live-commentary-empty { opacity: .65; font-style: italic; }
.live-commentary.dark { max-width: none; border-color: rgba(255, 255, 255, .15); background: rgba(0, 0, 0, .2); color: inherit; }
.live-commentary.dark .btn-link { color: #9ec5fe; }
@media (prefers-reduced-motion: reduce) { .live-dot, .live-commentary-lines li.fresh { animation: none; } }

/* The page an emailed room invite's "Copy code" button opens (Components/Pages/RoomInvitePage.razor). */
.room-invite-page { max-width: 28rem; margin: 1rem auto; text-align: center; }
.room-invite-code { display: inline-block; padding: .5rem 1.4rem; border: 2px dashed rgba(167, 139, 250, .7); border-radius: 12px; font: 700 2.4rem/1 ui-monospace, Consolas, monospace; letter-spacing: .25em; user-select: all; }
.room-invite-qr { display: inline-block; padding: 10px; background: #fff; border-radius: 12px; }
.room-invite-qr svg { display: block; max-width: 100%; height: auto; }

/* The newest commentary line over a canvas game (CommentaryCaption.razor): below the games' top-centre clocks and scores, and clear of the chat at the bottom left. */
.commentary-caption { position: absolute; top: max(3rem, 11%); left: 50%; transform: translateX(-50%); z-index: 1001; max-width: min(36rem, calc(100% - 7rem)); padding: .2rem .7rem; border-radius: 999px; background: rgba(0, 0, 0, .62); color: #fff; font-size: .9rem; text-align: center; pointer-events: none; animation: commentary-caption 4.5s forwards; }
.commentary-caption.tone-highlight { font-weight: 600; }
.commentary-caption.tone-result { font-weight: 700; background: rgba(120, 88, 8, .85); animation-duration: 7s; }
.game-stage.is-fullscreen > .commentary-caption { position: fixed; top: max(3.5rem, 11vh); }
@keyframes commentary-caption { 0% { opacity: 0; } 6%, 80% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .commentary-caption { animation-timing-function: steps(1, end); } }
@media (max-width: 480px) { .commentary-caption { font-size: .78rem; max-width: calc(100% - 5rem); } }

/* The "Install app" button on the home page (wwwroot/pwa.js), hidden inside the installed app. */
.install-app {
    display: none;
    border-radius: 999px;
}

html.can-install .install-app {
    display: inline-block;
}

.install-tip {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 1020;
    width: min(calc(100% - 32px), 22rem);
    padding: .9rem 1rem;
    border-radius: 12px;
    background: #fff;
    color: #212529;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .3);
}

.install-tip p {
    margin: .35rem 0 .6rem;
}

/* First visit: register, log in or play as a guest (WelcomeChoice). */
.welcome-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(5, 10, 30, 0.6);
}

.welcome-card {
    width: min(100%, 30rem);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 1.5rem;
    border-radius: 12px;
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.welcome-card ul {
    padding-left: 0;
    list-style: none;
}

.welcome-card li {
    margin-bottom: 0.25rem;
}

.guest-note {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    margin-left: 1rem;
}
/* ---- Log in (and the sign-in service buttons used on Register too) ---- */

.auth-shell {
    position: relative;
    overflow: hidden;
    margin: 0 0 1.5rem;
    padding: clamp(1.25rem, 4vw, 3rem);
    border-radius: 22px;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 64, 196, .28), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(0, 200, 255, .25), transparent 45%),
        linear-gradient(135deg, #12021d 0%, #2a0640 45%, #071a4a 100%);
    color: #f2ecff;
    isolation: isolate;
}

/* A faint neon grid, like an arcade floor. */
.auth-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(140, 90, 255, .12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(140, 90, 255, .12) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

.auth-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    z-index: -1;
    width: 520px;
    height: 260px;
    transform: translateX(-50%);
    background: radial-gradient(closest-side, rgba(168, 85, 247, .55), transparent);
    filter: blur(20px);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 27rem) minmax(0, 20rem);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
    justify-content: center;
}

.auth-card {
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid rgba(190, 150, 255, .28);
    border-radius: 18px;
    background: rgba(17, 6, 33, .72);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .03) inset, 0 20px 60px rgba(0, 0, 0, .45), 0 0 40px rgba(168, 85, 247, .18);
    backdrop-filter: blur(10px);
}

.auth-badge {
    display: grid;
    place-items: center;
    width: 3.4rem;
    height: 3.4rem;
    margin: 0 auto .75rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #ff3fb4, #7c3aed 55%, #00c8ff);
    box-shadow: 0 8px 24px rgba(124, 58, 237, .55);
    font-size: 1.7rem;
}

.auth-title {
    margin: 0;
    text-align: center;
    font-size: clamp(1.5rem, 3.5vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -.01em;
    background: linear-gradient(90deg, #fff, #d9c6ff 60%, #8be9ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-subtitle {
    margin: .4rem 0 1.4rem;
    text-align: center;
    color: rgba(230, 220, 255, .72);
    font-size: .95rem;
}

.auth-shell .form-control {
    border-color: rgba(190, 150, 255, .25);
    background-color: rgba(255, 255, 255, .05);
}

.auth-shell .form-control:focus {
    border-color: #a855f7;
    background-color: rgba(255, 255, 255, .08);
    box-shadow: 0 0 0 .2rem rgba(168, 85, 247, .3);
}

.auth-shell .form-check-input:checked {
    border-color: #a855f7;
    background-color: #a855f7;
}

.auth-shell a {
    color: #8be9ff;
    text-decoration: none;
}

.auth-shell a:hover {
    color: #c4f4ff;
    text-decoration: underline;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: .9rem;
}

.auth-play {
    border: none;
    background: linear-gradient(90deg, #ff3fb4, #a855f7 50%, #3b82f6);
    background-size: 200% 100%;
    color: #fff;
    font-weight: 700;
    letter-spacing: .02em;
    box-shadow: 0 8px 22px rgba(168, 85, 247, .45);
    transition: background-position .4s ease, transform .15s ease, box-shadow .2s ease;
}

.auth-play:hover,
.auth-play:focus-visible {
    background-position: 100% 0;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(168, 85, 247, .6);
}

.auth-play:active {
    transform: translateY(1px);
}

.auth-passkey {
    margin-top: .5rem;
    color: rgba(230, 220, 255, .8) !important;
    font-size: .9rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.25rem 0;
    color: rgba(230, 220, 255, .55);
    font-size: .8rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(190, 150, 255, .4), transparent);
}

.auth-footer {
    margin: 1.25rem 0 0;
    text-align: center;
    color: rgba(230, 220, 255, .75);
    font-size: .9rem;
    line-height: 1.9;
}

.auth-footer .auth-quiet {
    color: rgba(230, 220, 255, .55);
    font-size: .8rem;
}

.auth-perks h2 {
    margin-bottom: 1rem;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.auth-perks ul {
    display: grid;
    gap: .8rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-perks li {
    display: flex;
    gap: .85rem;
    align-items: center;
    padding: .7rem .9rem;
    border: 1px solid rgba(190, 150, 255, .18);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    color: rgba(230, 220, 255, .72);
    font-size: .88rem;
}

.auth-perks li > span {
    flex: none;
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, .6));
}

.auth-perks li strong {
    display: block;
    color: #fff;
    font-size: .95rem;
}

@media (max-width: 860px) {
    .auth-layout {
        grid-template-columns: minmax(0, 27rem);
    }

    .auth-perks {
        display: none;
    }
}

/* Sign-in service buttons, in each service's own colours. */
.auth-providers {
    display: grid;
    gap: .6rem;
    margin-bottom: 1rem;
}

.auth-provider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    width: 100%;
    min-height: 2.9rem;
    padding: .55rem 1rem;
    border: 1px solid #dadce0;
    border-radius: 10px;
    background: #fff;
    color: #1f1f1f;
    font-family: Roboto, 'Segoe UI', Arial, sans-serif;
    font-weight: 600;
    font-size: .95rem;
    transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
}

.auth-provider:hover,
.auth-provider:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

.auth-provider-google:hover {
    background: #f8f9fa;
}

.auth-provider-facebook {
    border-color: #1877f2;
    background: #1877f2;
    color: #fff;
}

.auth-provider-facebook:hover {
    background: #166fe5;
}

.auth-provider-microsoft {
    border-color: #8c8c8c;
    background: #2f2f2f;
    color: #fff;
}

.auth-provider-logo {
    display: inline-flex;
    flex: none;
}
.auth-hint {
    margin: -.25rem 0 1rem;
    color: rgba(230, 220, 255, .6);
    font-size: .8rem;
}

/* The log-in and register pages' own full-window layout (AuthLayout). */
.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 64, 196, .28), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(0, 200, 255, .25), transparent 45%),
        linear-gradient(135deg, #12021d 0%, #2a0640 45%, #071a4a 100%);
}

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 2.5rem);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: .01em;
    text-decoration: none;
}

.auth-brand:hover {
    color: #fff;
}

.auth-brand-mark {
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff3fb4, #7c3aed 55%, #00c8ff);
    box-shadow: 0 4px 14px rgba(124, 58, 237, .5);
    font-size: 1.15rem;
}

.auth-back {
    color: rgba(230, 220, 255, .75);
    font-size: .9rem;
    text-decoration: none;
}

.auth-back:hover {
    color: #fff;
}

.auth-main {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(.75rem, 3vw, 2rem) 2rem;
}

/* On its own page the panel is the background, so it drops its frame. */
.auth-main > .auth-shell {
    width: 100%;
    max-width: 62rem;
    margin: 0;
    padding: clamp(.5rem, 2vw, 1.5rem);
    border-radius: 0;
    background: none;
}

@media (max-width: 480px) {
    .auth-back {
        display: none;
    }
}
/* Floating labels say what each box is for, so the template's example text beside them is hidden. */
.auth-shell .form-floating > .form-control::placeholder,
.auth-shell .form-floating > .form-control:focus::placeholder {
    color: transparent;
}

/* On its own page the glow spreads freely instead of being cut off at the panel's edge. */
.auth-main > .auth-shell {
    overflow: visible;
}

.auth-main > .auth-shell::before {
    display: none;
}
/* =====================================================================================================
   GameCentral's look: a dark arcade theme over Bootstrap's dark mode (data-bs-theme="dark" in App.razor).
   The colours below are shared by every page; the sections after give the site's own pieces dark versions.
   ===================================================================================================== */

:root,
[data-bs-theme="dark"] {
    --gc-bg: #0d0518;
    --gc-surface: rgba(24, 10, 44, .78);
    --gc-surface-2: rgba(255, 255, 255, .05);
    --gc-border: rgba(190, 150, 255, .22);
    --gc-text: #ece6ff;
    --gc-muted: rgba(230, 220, 255, .64);
    --gc-purple: #a855f7;
    --gc-pink: #ff3fb4;
    --gc-blue: #3b82f6;
    --gc-cyan: #22d3ee;
    --gc-gold: #fbbf24;
    --gc-gold-bg: rgba(251, 191, 36, .12);

    --bs-body-bg: var(--gc-bg);
    --bs-body-color: var(--gc-text);
    --bs-secondary-color: var(--gc-muted);
    --bs-tertiary-bg: rgba(255, 255, 255, .06);
    --bs-border-color: var(--gc-border);
    --bs-link-color: #8be9ff;
    --bs-link-color-rgb: 139, 233, 255;
    --bs-link-hover-color: #c4f4ff;
    --bs-link-hover-color-rgb: 196, 244, 255;
    --bs-heading-color: #fff;
    --bs-emphasis-color: #fff;
}

html,
body {
    font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 85% -10%, rgba(168, 85, 247, .22), transparent 60%),
        radial-gradient(900px 500px at 10% 110%, rgba(34, 211, 238, .14), transparent 60%),
        linear-gradient(160deg, #0d0518 0%, #120726 50%, #071233 100%) fixed;
    color: var(--gc-text);
}

a,
.btn-link {
    color: #8be9ff;
}

a:hover,
.btn-link:hover {
    color: #c4f4ff;
}

/* Page titles glow from white to violet to cyan. */
.content h1 {
    font-weight: 800;
    letter-spacing: -.01em;
    background: linear-gradient(90deg, #fff, #d9c6ff 55%, #8be9ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.content h2,
.content h3 {
    color: #fff;
    font-weight: 700;
}

.text-muted,
.text-secondary {
    color: var(--gc-muted) !important;
}

.btn:focus-visible,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 .2rem rgba(168, 85, 247, .45);
}

/* Buttons: the main action glows; the rest are outlined in neon. */
.btn-primary,
.btn-success {
    border: none;
    background: linear-gradient(90deg, var(--gc-pink), var(--gc-purple) 55%, var(--gc-blue));
    background-size: 180% 100%;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(168, 85, 247, .35);
    transition: background-position .35s ease, transform .15s ease, box-shadow .2s ease;
}

.btn-success {
    background: linear-gradient(90deg, #10b981, #22d3ee);
    box-shadow: 0 6px 18px rgba(16, 185, 129, .3);
}

.btn-primary:hover,
.btn-primary:focus-visible,
.btn-success:hover,
.btn-success:focus-visible {
    background-position: 100% 0;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(168, 85, 247, .5);
}

.btn-primary:disabled,
.btn-primary.disabled,
.btn-success:disabled {
    background: rgba(168, 85, 247, .3);
    box-shadow: none;
    color: rgba(255, 255, 255, .6);
}

.btn-outline-primary {
    --bs-btn-color: #d8b4fe;
    --bs-btn-border-color: rgba(168, 85, 247, .6);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(168, 85, 247, .25);
    --bs-btn-hover-border-color: var(--gc-purple);
    --bs-btn-active-bg: rgba(168, 85, 247, .4);
    --bs-btn-active-border-color: var(--gc-purple);
    --bs-btn-disabled-color: rgba(216, 180, 254, .5);
    --bs-btn-disabled-border-color: rgba(168, 85, 247, .3);
}

.btn-outline-success {
    --bs-btn-color: #6ee7b7;
    --bs-btn-border-color: rgba(16, 185, 129, .6);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(16, 185, 129, .25);
    --bs-btn-hover-border-color: #10b981;
}

.btn-outline-secondary {
    --bs-btn-color: rgba(230, 220, 255, .8);
    --bs-btn-border-color: rgba(190, 150, 255, .3);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(255, 255, 255, .08);
    --bs-btn-hover-border-color: rgba(190, 150, 255, .55);
}

/* Fields: dark glass with a violet focus ring. */
.form-control,
.form-select {
    border-color: var(--gc-border);
    background-color: rgba(255, 255, 255, .05);
    color: var(--gc-text);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gc-purple);
    background-color: rgba(255, 255, 255, .08);
    color: #fff;
}

.form-control::placeholder {
    color: rgba(230, 220, 255, .4);
}

/* A dropdown's open list is drawn by the browser on a solid background, white unless told otherwise, so the field's
   see-through background and light text would leave the options invisible. Dark controls, with a solid dark list. */
select,
.form-select {
    color-scheme: dark;
}

select option,
select optgroup {
    background-color: #1a0d2e;
    color: var(--gc-text);
}

select option:disabled {
    color: var(--gc-muted);
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    background-color: rgba(0, 0, 0, .25);
    color: var(--gc-muted);
}

.form-floating > :disabled ~ label::after,
.form-floating > .form-control:disabled ~ label::after {
    background-color: transparent;
}

.form-check-input:checked {
    border-color: var(--gc-purple);
    background-color: var(--gc-purple);
}

.input-group-text {
    border-color: var(--gc-border);
    background: rgba(255, 255, 255, .06);
    color: var(--gc-muted);
}

/* Tabs and pills, as on the leaderboard. */
.nav-pills .nav-link {
    border-radius: 999px;
    color: rgba(230, 220, 255, .75);
}

.nav-pills .nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background: linear-gradient(90deg, var(--gc-pink), var(--gc-purple));
    color: #fff;
    box-shadow: 0 4px 14px rgba(168, 85, 247, .35);
}

.nav-tabs {
    --bs-nav-tabs-border-color: var(--gc-border);
    --bs-nav-tabs-link-active-bg: var(--gc-surface);
    --bs-nav-tabs-link-active-border-color: var(--gc-border) var(--gc-border) transparent;
    --bs-nav-tabs-link-active-color: #fff;
}

/* Tables, cards, lists and alerts sit on dark glass. */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--gc-text);
    --bs-table-border-color: var(--gc-border);
    --bs-table-striped-bg: rgba(255, 255, 255, .035);
    --bs-table-hover-bg: rgba(168, 85, 247, .1);
}

.table thead th {
    color: var(--gc-muted);
    font-size: .8rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.card,
.list-group-item,
.modal-content,
.dropdown-menu,
.offcanvas {
    --bs-card-bg: var(--gc-surface);
    --bs-card-border-color: var(--gc-border);
    border-color: var(--gc-border);
    background-color: var(--gc-surface);
    color: var(--gc-text);
}

.alert-info {
    --bs-alert-bg: rgba(34, 211, 238, .1);
    --bs-alert-border-color: rgba(34, 211, 238, .35);
    --bs-alert-color: #a5f3fc;
}

.alert-warning {
    --bs-alert-bg: var(--gc-gold-bg);
    --bs-alert-border-color: rgba(251, 191, 36, .4);
    --bs-alert-color: #fde68a;
}

.badge.bg-secondary,
.badge.text-bg-secondary {
    background: rgba(168, 85, 247, .25) !important;
    color: #e9d5ff !important;
}

hr {
    border-color: var(--gc-border);
    opacity: 1;
}

kbd {
    border: 1px solid var(--gc-border);
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

/* The sidebar's icons light up in their own colour (Layout/NavIcon.razor). */
.nav-icon {
    flex: none;
    color: rgba(230, 220, 255, .55);
    transition: color .15s ease, filter .15s ease, transform .15s ease;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    color: var(--accent);
    filter: drop-shadow(0 0 6px var(--accent));
}

.nav-link:hover .nav-icon {
    transform: scale(1.08);
}

.nav-link .nav-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Achievements, daily challenges and the profile: unlocked and done things shine gold. */
.achievement-card,
.daily-stats > div,
.daily-list li,
.profile-game {
    border-color: var(--gc-border);
    background: var(--gc-surface);
}

.achievement-card.unlocked,
.daily-list li.done {
    border-color: rgba(251, 191, 36, .6);
    background: linear-gradient(135deg, rgba(251, 191, 36, .16), rgba(168, 85, 247, .08));
    box-shadow: 0 0 18px rgba(251, 191, 36, .12);
}

.achievement-card small,
.daily-stats span,
.daily-list small,
.profile-identity p,
.profile-game dt {
    color: var(--gc-muted);
}

.daily-stats strong {
    color: #fff;
}

.daily-mark {
    color: var(--gc-gold);
}

.daily-status {
    color: var(--gc-gold);
}

.daily-today {
    border-left-color: var(--gc-gold);
    background: var(--gc-gold-bg);
}

.profile-avatar {
    border-color: var(--gc-gold);
    background: radial-gradient(circle, rgba(251, 191, 36, .2), rgba(168, 85, 247, .15));
    box-shadow: 0 0 24px rgba(251, 191, 36, .25);
}

.avatar-choice {
    border-color: var(--gc-border);
}

.avatar-choice.chosen {
    border-color: var(--gc-gold);
    background: var(--gc-gold-bg);
}

/* The chat panel in the corner. */
.friends-toggle {
    background: linear-gradient(90deg, #7c3aed, #c026d3);
    box-shadow: 0 6px 20px rgba(124, 58, 237, .45);
}

.friends-toggle:hover {
    background: linear-gradient(90deg, #8b5cf6, #d946ef);
}

.friends-preview {
    border-color: rgba(251, 191, 36, .6);
    background: #1d0f33;
    color: var(--gc-text);
}

.friends-panel {
    border: 1px solid var(--gc-border);
    background: #140a26;
    color: var(--gc-text);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .55), 0 0 30px rgba(168, 85, 247, .18);
}

.friends-head {
    background: linear-gradient(90deg, #3b0764, #1e1b4b);
    border-bottom: 1px solid var(--gc-border);
}

.friends-section,
.friends-small,
.friends-empty,
.friends-who small {
    color: var(--gc-muted);
}

.friends-row {
    border-bottom-color: rgba(190, 150, 255, .12);
}

.friends-row.friend:hover {
    background: rgba(168, 85, 247, .12);
}

.friends-row.request {
    background: var(--gc-gold-bg);
}

.friends-avatar {
    background: rgba(168, 85, 247, .18);
}

.friends-dot {
    border-color: #140a26;
    background: #6b7280;
}

.friends-dot.on {
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
}

.friends-options {
    background: rgba(255, 255, 255, .04);
}

.friends-chat {
    background: rgba(0, 0, 0, .25);
}

.friends-message.mine {
    background: linear-gradient(135deg, #7c3aed, #c026d3);
}

.friends-message.theirs {
    background: rgba(255, 255, 255, .09);
    color: var(--gc-text);
}

/* Tournaments. */
.cup-banner {
    border-color: rgba(59, 130, 246, .45);
    background: rgba(59, 130, 246, .1);
}

.cup-banner.champion {
    border-color: rgba(251, 191, 36, .7);
    background: linear-gradient(135deg, rgba(251, 191, 36, .22), rgba(255, 63, 180, .12));
    box-shadow: 0 0 24px rgba(251, 191, 36, .2);
}

.cup-banner.out {
    border-color: var(--gc-border);
    background: rgba(255, 255, 255, .04);
}

.cup-skill,
.bracket-stars {
    color: var(--gc-gold);
}

.bracket-match {
    border-color: var(--gc-border);
    background: var(--gc-surface);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}

.bracket-match.mine {
    border-color: rgba(34, 211, 238, .7);
}

.bracket-match.champion-slot {
    border-color: rgba(251, 191, 36, .7);
    background: linear-gradient(135deg, rgba(251, 191, 36, .15), var(--gc-surface));
}

.bracket-slot.won {
    background: rgba(34, 197, 94, .14);
}

.bracket-slot.you .bracket-name {
    color: var(--gc-cyan);
}

/* Room chat, spectators and the rest of a room's lobby. */
.room-chat-empty,
.spectator-list {
    color: var(--gc-muted);
}

/* Pop-ups: installing the app, and the first-visit welcome. */
.install-tip,
.welcome-card {
    border: 1px solid var(--gc-border);
    background: #160a2b;
    color: var(--gc-text);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .6), 0 0 34px rgba(168, 85, 247, .25);
}

.welcome-backdrop {
    background: rgba(5, 2, 15, .7);
    backdrop-filter: blur(4px);
}

.guest-note {
    color: var(--gc-muted);
}

/* Scrollbars to match. */
* {
    scrollbar-color: rgba(168, 85, 247, .45) transparent;
}
/* Blazor's error bar, shown only when something goes wrong. It lives here rather than in a layout's scoped styles
   because both layouts (MainLayout, and AuthLayout for logging in and registering) have one. */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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;
    }
