h1:focus {
    outline: none;
}

/* The tokens of docs/design/DESIGN.md that MudBlazor's palette has no place for. */
:root {
    --app-ink: #1F1A2E;
    --app-muted: #565C68;
    --app-border: #D9DDE5;
    --app-outline: #B9BFCA;
    --app-outline-ink: #3A3F48;
    --app-tile: #FFE38A;
    --app-tile-inner: #FFF4CC;
    --app-tile-ink: #8A6500;
    --app-stamp-tint: rgba(29, 185, 84, 0.18);
    --app-accent-soft: #E6DCFA;
    --app-track: #D8D8E0;
    --app-card-shadow: 0 1px 0 #D9DDE5, 0 8px 24px rgba(21, 23, 28, 0.06);
}

/* Mobile first: on a wider screen the app stays a column in the middle. */
.app-column {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 20px 24px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding-top: 12px;
    margin-bottom: 16px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--app-ink);
    text-decoration: none;
    font-family: "Andika", sans-serif;
    font-weight: 700;
    font-size: 24px;
}

.mud-button-root.account-avatar {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background-color: var(--app-ink);
    color: #FFFFFF;
    font-size: 15px;
}

    .mud-button-root.account-avatar:hover {
        background-color: var(--app-outline-ink);
    }

/* Primary buttons are white with a purple border, never filled purple. */
.mud-button-filled.mud-button-filled-primary {
    background-color: #FFFFFF;
    color: var(--mud-palette-primary);
    border: 2px solid var(--mud-palette-primary);
    box-shadow: none;
    min-height: 44px;
}

    .mud-button-filled.mud-button-filled-primary:hover,
    .mud-button-filled.mud-button-filled-primary:focus-visible {
        background-color: #FFFFFF;
        color: var(--mud-palette-primary-darken);
        border-color: var(--mud-palette-primary-darken);
        box-shadow: none;
    }

.mud-button-filled.mud-button-filled-primary.mud-button-filled-size-large {
    min-height: 54px;
}

/* Every outlined button is the quiet secondary one, whatever its colour. */
.mud-button-outlined {
    background-color: transparent;
    color: var(--app-outline-ink);
    border: 1.5px solid var(--app-outline);
    font-weight: 600;
    font-size: 15px;
    min-height: 44px;
}

    .mud-button-outlined:hover {
        background-color: rgba(31, 26, 46, 0.04);
        border-color: var(--app-outline-ink);
    }

.mud-button-outlined.mud-button-outlined-size-large {
    min-height: 48px;
}

.mud-button-root.mud-disabled {
    border-color: var(--mud-palette-action-disabled-background);
}

.mud-card {
    box-shadow: var(--app-card-shadow);
}

.mud-chip {
    border-radius: 6px;
}

/* Text that says less: dates, counts, hints. */
.meta {
    color: var(--app-muted);
}

.app-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 48px;
    font-size: 0.875rem;
}

    .app-footer a {
        color: var(--app-muted);
    }

.section-heading {
    font-size: 18px;
    font-weight: 700;
}

/* A white card on the grey background: a running outing on the homepage. */
.outing-card {
    box-shadow: var(--app-card-shadow);
}

.outing-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
}

.outing-card-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.status-badge {
    display: inline-block;
    background-color: var(--app-accent-soft);
    color: var(--mud-palette-primary-darken);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
}

.status-badge--done {
    background-color: var(--app-stamp-tint);
    color: #15803D;
}

/* A whole row that leads to another page, such as to the cards from the homepage. */
.link-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 6px;
    background-color: var(--mud-palette-surface);
    color: var(--app-ink);
    box-shadow: 0 1px 0 var(--app-border);
}

    .link-row:hover {
        box-shadow: var(--app-card-shadow);
    }

/* One thing Vingó does, in the dialog that says what it is. */
.about-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.about-feature-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 6px;
    background-color: var(--app-accent-soft);
    color: var(--mud-palette-primary-darken);
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-feature-heading {
    font-weight: 700;
}

/* The same row as a button, when it opens something rather than leading away. */
.link-row--button {
    width: 100%;
    border: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.link-row-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 6px;
    background-color: var(--app-ink);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.link-row-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
    min-width: 0;
    font-size: 14px;
}

.link-row-title {
    font-size: 17px;
    font-weight: 700;
}

/* A group outing as its organizer runs it: how others join, who is in it, and what they found. */
.join-panel,
.participant-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    box-shadow: var(--app-card-shadow);
}

.join-qr {
    width: 100%;
    max-width: 260px;
    align-self: center;
    image-rendering: pixelated;
}

.join-link {
    overflow-wrap: anywhere;
    color: var(--app-muted);
}

.join-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.participant-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--app-border);
}

.participant-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* The top of a page under the homepage. */
.back-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.back-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mud-icon-button.back-button {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background-color: var(--mud-palette-surface);
    color: var(--app-ink);
    box-shadow: 0 1px 0 var(--app-border);
}

    .mud-icon-button.back-button:hover {
        background-color: var(--mud-palette-surface);
        box-shadow: var(--app-card-shadow);
    }

/* A card to choose, as a link row: one of its pictures in a yellow frame, like a tile, then what it is. */
.card-row-picture {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    box-sizing: border-box;
    border: 3px solid var(--app-tile);
    border-radius: 6px;
    background-color: var(--app-tile-inner);
    color: var(--app-tile-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-row-image {
    display: block;
    width: 100%;
    height: 100%;
}

/* Each line stays one line, so every row is the same short height. */
.card-row-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-row-lock {
    vertical-align: text-bottom;
    margin-right: 4px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--app-outline-ink);
    background-color: var(--mud-palette-background);
    padding: 6px 12px;
    border-radius: 6px;
}

/* The two ways to play a card, side by side above the card: alone on this phone or as a group outing. */
.play-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.play-mode {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px;
    text-align: left;
    font: inherit;
    color: var(--app-ink);
    background-color: #FFFFFF;
    border: 1.5px solid var(--app-border);
    border-radius: 6px;
    cursor: pointer;
}

    .play-mode:hover {
        border-color: var(--app-outline-ink);
    }

    .play-mode:focus-visible {
        outline: 2px solid var(--mud-palette-primary);
        outline-offset: 2px;
    }

.play-mode--chosen,
.play-mode--chosen:hover {
    border: 2px solid var(--mud-palette-primary);
    background-color: var(--app-accent-soft);
}

    .play-mode--chosen .mud-icon-root {
        color: var(--mud-palette-primary);
    }

.play-mode-title {
    font-weight: 700;
    font-size: 16px;
}

.play-mode-text {
    font-size: 13px;
    color: var(--app-muted);
}

/* How far an outing is: a label, then a segment per item. */
.progress-segments {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-segments-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.progress-segments-bar {
    display: grid;
    gap: 6px;
}

.progress-segment {
    height: 8px;
    border-radius: 6px;
    background-color: var(--app-track);
}

.progress-segment--found {
    background-color: var(--mud-palette-success);
}

/* A small picture of a card, a cell per item. The number of columns is set inline, from the card. */
.mini-grid {
    display: grid;
    gap: 6px;
}

.mini-grid-cell {
    height: 32px;
    border-radius: 6px;
    box-sizing: border-box;
    background-color: var(--mud-palette-background);
    border: 1.5px dashed var(--app-outline);
}

.mini-grid-cell--found {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--mud-palette-success);
    border: none;
    color: #FFFFFF;
}

/* The bingo card. The number of columns is set inline, from the card. */
.card-grid {
    display: grid;
    gap: 12px;
}

/*
 * An item on a card: a yellow frame, like a ticket, around its picture, with its name on the strip below.
 * An item without a picture has its name inside the frame instead.
 */
.item-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    box-sizing: border-box;
    padding: 5px 5px 8px;
    border: 3px solid var(--app-tile);
    border-radius: 6px;
    background-color: var(--app-tile);
    color: var(--app-ink);
}

.item-tile-picture {
    position: relative;
    aspect-ratio: 1;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    background-color: var(--app-tile-inner);
}

.item-tile-image {
    display: block;
    width: 100%;
    height: 100%;
}

.item-tile-picture--text {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-sizing: border-box;
}

.item-tile-text {
    color: var(--app-tile-ink);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    text-align: center;
    overflow-wrap: anywhere;
}

.item-tile-name {
    padding-left: 3px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.item-tile--found {
    border-color: var(--mud-palette-success);
}

/* The whole tile is the button that marks an item found, or not found again. */
.card-tile-button {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease;
}

    .card-tile-button:active {
        transform: scale(0.96);
    }

    .card-tile-button:focus-visible {
        outline: 3px solid var(--app-ink);
        outline-offset: 3px;
    }

.found-stamp {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--app-stamp-tint);
}

.found-stamp-mark {
    width: 58%;
    aspect-ratio: 1;
    border-radius: 50%;
    background-color: var(--mud-palette-success);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-10deg);
    box-shadow: 0 6px 16px rgba(29, 185, 84, 0.4);
}

.found-stamp-check.mud-icon-root {
    width: 60%;
    height: 60%;
    color: #FFFFFF;
}

/* "Kalla vingó!", a little bigger than other buttons. */
.mud-button-root.call-bingo {
    min-height: 58px;
    font-family: "Andika", sans-serif;
    font-weight: 700;
    font-size: 19px;
}

/* An outing finished with everything found: the whole screen, dark, with a big stamp. */
.bingo-screen {
    position: fixed;
    inset: 0;
    z-index: 1200;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 20px 20px 28px;
    box-sizing: border-box;
    background-color: var(--app-ink);
    color: #FFFFFF;
}

    .bingo-screen > * {
        width: 100%;
        max-width: 520px;
        margin-left: auto;
        margin-right: auto;
    }

.bingo-confetti {
    position: relative;
    height: 0;
}

.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.confetti--round {
    border-radius: 50%;
    width: 9px;
    height: 9px;
}

.confetti--big {
    width: 14px;
    height: 14px;
}

.confetti--small {
    width: 7px;
    height: 7px;
}

.confetti--green {
    background-color: var(--mud-palette-success);
}

.confetti--yellow {
    background-color: var(--app-tile);
}

.confetti--white {
    background-color: #FFFFFF;
    opacity: 0.5;
}

.bingo-screen-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 24px 0;
    text-align: center;
}

    .bingo-screen-main .mini-grid {
        width: 100%;
    }

.bingo-screen-meta {
    color: var(--app-outline);
}

.bingo-stamp {
    width: 220px;
    height: 220px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 6px solid var(--mud-palette-success);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-8deg);
}

.bingo-stamp-inner {
    width: 184px;
    height: 184px;
    border-radius: 50%;
    background-color: var(--mud-palette-success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Andika", sans-serif;
    font-weight: 700;
    font-size: 52px;
}

.bingo-screen-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mud-button-root.bingo-screen-primary,
.mud-button-root.bingo-screen-primary:hover {
    background-color: #FFFFFF;
    color: var(--app-ink);
    box-shadow: none;
}

.mud-button-root.bingo-screen-secondary {
    color: #FFFFFF;
    border-color: var(--app-outline-ink);
}

    .mud-button-root.bingo-screen-secondary:hover {
        background-color: rgba(255, 255, 255, 0.06);
        border-color: var(--app-outline);
    }

/* The cells of the card editor and the item picker, each a tappable cell around an ItemTile. */
.card-tile {
    position: relative;
}

    .card-tile.mud-paper {
        background-color: transparent;
        box-shadow: none;
    }

.card-tile--tappable {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* The mark on an item in the picker that is already on the card. */
.card-tile-check {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    background-color: var(--mud-palette-surface);
    border-radius: 6px;
}

/* Stands in for the picture of a cell that has no item yet, so the cell keeps its size. */
.card-tile-text {
    aspect-ratio: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* A cell of the card editor that has no item yet. */
.card-tile.card-tile--empty {
    background-color: var(--mud-palette-background);
    border: 1.5px dashed var(--app-outline);
}

/* The button on a filled cell of the card editor that empties it again. */
.card-tile-clear {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
    background-color: var(--mud-palette-surface);
    border-radius: 50%;
}

/* The items to choose from when filling a cell. */
.item-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
    max-height: 40vh;
    overflow-y: auto;
    padding: 2px;
}

#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;
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #6D28D9;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }
