/*
    The User Portal (/User), on top of site.css and cardpages.css: a
    bar across the top, the key form, and a card per venue holding its
    board links, its name on the board and its launcher.
*/

.up-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: var(--brand-y) var(--brand-x);
    background: var(--bar);
    border-bottom: 1px solid var(--bp-rule);
}

.up-who {
    color: var(--bp-muted);
    font-size: 14px;
}

.bp.up {
    max-width: 920px;
    padding-top: 32px;
}

/* The menu of sections down the left (bp-sided, bp-side, bp-nav, as the
   admin pages'), only where there is room beside the cards. */
@media (max-width: 999px) {
    .up-page {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "live" "main";
    }

    .up-side {
        display: none;
    }
}

/* Below the preview while it is pinned across the top (the script sets
   --up-live-h to its height then, 0 docked), the galleries too, which
   other panels link to. */
.up-venue,
.up-panel,
.up-gallery,
.up-advanced {
    scroll-margin-top: calc(16px + var(--up-live-h, 0px));
}

/* A club in the menu, its panels under it. */
.up-nav a.up-navclub {
    margin-top: 14px;
    color: var(--bp-bright);
    font-weight: 600;
}

.up-nav a.up-navclub:first-child {
    margin-top: 0;
}

.up-nav a:not(.up-navclub) {
    padding-left: 22px;
}

/* No key yet: one card, the form in it. */
.up-open {
    max-width: 560px;
    margin: 48px auto 0;
}

/* A board link: its name and use, then its address with Copy and Open. */
.up-link + .up-link {
    margin-top: 14px;
}

.up-linkhead {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin-bottom: 6px;
}

.up-linkhead strong {
    color: var(--bp-bright);
}

.up-linkrow {
    display: flex;
    align-items: center;
    gap: 8px;
}

.up-url {
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid var(--field-rule);
    border-radius: 8px;
    background: var(--field);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: all;
}

/* The key, for reference: a small label, the key in a pill, a little
   apart from the first venue's card. */
.up-key {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 16px;
}

.up-keyvalue {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 10px;
    border: 1px solid var(--highlight-rule);
    border-radius: 999px;
    background: var(--highlight);
    color: var(--bp-bright);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
}

.up-keyvalue svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
}

.up-linkrow .bp-button {
    flex: none;
}

/* Advanced: its own panels, folded away by its summary (bp-fold). */
.up-advanced > summary {
    padding: 4px 2px;
}

.up-advanced > summary h3 {
    margin: 0;
}

/* A checkbox and its word, as Force 16:9 Ratio has. */
.up-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.up-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--saved);
}

/*
    3D Transitions: the transitions to play, a card each, its tick box
    drawn as a square that fills with a tick, the card lit when ticked
    (as a layout's is). Faded while the switch above is off, still sent.
*/
.up-stings {
    display: grid;
    gap: 8px;
    min-width: 0;
    margin: 16px 0 0;
    padding: 0;
    border: 0;
    transition: opacity .2s;
}

/* The logo a group of transitions is made of, over its cards. */
.up-stinggroup {
    margin-top: 8px;
    color: var(--bp-bright);
}

/* Preview: above the card's tick box, which covers the card. */
.up-stingplay {
    position: relative;
    z-index: 1;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.up-stingplay svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* Greyed while a preview plays. */
.up-stingplay:disabled {
    opacity: .4;
    cursor: default;
}

/* Turned off, nothing to preview. */
.up-transitions:has(.up-check input:not(:checked)) .up-stingplay {
    visibility: hidden;
}

/* Default beside the name, as a layout's. */
.up-stingtext .bp-tag {
    margin-left: 8px;
    vertical-align: 1px;
}

.up-transitions:has(.up-check input:not(:checked)) .up-stings {
    opacity: .4;
}

/* A choice drawn as a card, lit when ticked: a transition, and a layout. */
.up-sting,
.up-layout {
    position: relative;
    border: 1px solid var(--card-rule);
    border-radius: 8px;
    background: var(--card);
    cursor: pointer;
}

/* Not a transition: lit on hover beside its Preview button, it read as playing (the user, 2026-11-02). */
.up-layout:hover {
    background: var(--hover);
}

.up-sting:has(:checked),
.up-layout:has(:checked) {
    border-color: var(--highlight-rule);
    background: var(--highlight);
}

.up-sting:has(:focus-visible),
.up-layout:has(:focus-visible) {
    outline: 2px solid var(--saved);
    outline-offset: 2px;
}

.up-sting {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
}

.up-stingtick {
    flex: none;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-radius: 6px;
}

.up-stingtick svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #10131a;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
}

.up-sting:has(:checked) .up-stingtick {
    border-color: var(--saved);
    background: var(--saved);
}

.up-sting:has(:checked) .up-stingtick svg {
    opacity: 1;
    animation: bp-pop .15s ease-out;
}

.up-stingtext {
    display: grid;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.up-stingtext strong {
    color: var(--bp-bright);
    overflow-wrap: anywhere;
}

/* RCRaceData.com Logo: the wordmark on black, as the sting shows it. */
.up-promo {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 5;
    max-width: 360px;
    margin: 12px 0;
    border-radius: 8px;
    background: #000;
}

.up-promo img {
    width: 55%;
    height: auto;
}

.up-thanks {
    margin-top: 12px;
}

.up-signature {
    display: block;
    width: 78px;
    height: auto;
    margin-top: 2px;
    fill: none;
    stroke: var(--bp-bright);
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* The launcher: Windows only, so its logo; each file and what it does. */
.up-windows {
    display: flex;
    align-items: center;
    gap: 8px;
}

.up-windows svg {
    width: 14px;
    height: 14px;
    fill: #0078d4;
}

/* The OBS Studio logo as it is drawn on dark: a white disc and three dark wheels, each with a white hub. */
.up-obs svg {
    fill: #fff;
}

.up-obs .up-obs-wheel {
    fill: #302e31;
}

.up-files {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px 12px;
    margin: 0;
}

.up-files dt .bp-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-size: 13px;
}

/* A download arrow: the buttons save files. */
.up-files dt svg {
    flex: none;
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.up-files dd {
    margin: 0;
    color: var(--bp-muted);
    font-size: 13px;
}

/* The RCRaceData.com Browser's steps, numbered, in the panel's small text. */
.up-steps {
    margin: 0 0 10px;
    padding-left: 20px;
}

.up-steps li + li {
    margin-top: 4px;
}

/* The values to enter, one to a line under their step. */
.up-steps ul {
    margin: 4px 0 0;
    padding-left: 16px;
}

/* A value to type into OBS: a badge big enough to read, one click selects it to copy. */
.up-copy {
    padding: 1px 8px;
    font-size: 13px;
    letter-spacing: .02em;
    vertical-align: 0;
    user-select: all;
    cursor: text;
}

.up-row {
    margin: 0 0 8px;
}

.up-row input,
.up-image input {
    width: 100%;
    box-sizing: border-box;
}

/*
    Board Themes: a row of split circles per board, grey on the left and the
    colour on the right (grey itself in both halves' greys). Each is a radio
    button drawn as its label; the one chosen has a ring and a tick. The
    board's name is floated beside its circles and patterns, not a grid:
    Chrome and Safari on iOS don't make a fieldset's legend a grid item, so
    the circles fell into the name's 7rem column, two to a row (2026-10-17).
*/
.up-tintrow {
    margin: 0;
    padding: 10px 0 16px;       /* a little more room above the rule to the next board (the user, 2026-10-15) */
    border: 0;
}

.up-tintrow + .up-tintrow {
    border-top: 1px solid var(--card-rule);
}

.up-tintlabel {
    float: left;
    width: 7rem;
    padding: 7px 0 0;           /* level with the middle of the circles */
}

.up-tintsets {
    margin-left: calc(7rem + 14px);
}

.up-tints {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.up-tint {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    background: linear-gradient(135deg, #4a4b52 50%, var(--tint) 50%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
/* Black, the plain plate, is solid: there is no colour to split it with. */
.up-tint.is-plain {
    background: var(--tint);
}
/* A split colour (BRCA): its top over its colour, the line between, as on its logo. */
.up-tint.is-split:not(.up-pattern) {
    background:
        linear-gradient(135deg, #4a4b52 50%, transparent 50%),
        linear-gradient(180deg, var(--tint-top) 45%, var(--tint-line) 45% 55%, var(--tint) 55%);
}

/* A radio button or tick box drawn as the circle or card it is in. */
.up-tint input,
.up-layout input,
.up-sting input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.up-tint:has(:checked) {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.up-tint:has(:focus-visible) {
    outline: 2px solid var(--saved);
    outline-offset: 3px;
}

.up-tint:has(:checked)::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 13px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: translate(-50%, -62%) rotate(45deg);
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, .8));
    pointer-events: none;
}

/*
    Board Themes: the patterns over the colour, under its circles, as
    swatches in the colour picked (the board's --tint): the board's
    wash of it and its dots (clubcolours.css), the dots through the
    board's own drawing of the pattern (patterns.js, --pattern, set by the
    page's script), half as large again as the swatch's height would draw
    it so its shapes show, and cut by the swatch's edges.
*/
.up-patterns {
    margin-top: 20px;
}

.up-pattern {
    width: 52px;
    height: 33px;
    border-radius: 8px;
    background: var(--fill);
}

.up-pattern:not([data-pattern="none"])::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--fill-dot);
    -webkit-mask: var(--pattern, linear-gradient(transparent, transparent)) 0 0 no-repeat;
    mask: var(--pattern, linear-gradient(transparent, transparent)) 0 0 no-repeat;
}

/* A pattern that slowly changes on the board (patterns.js evolveMs): a badge of turning arrows at its corner. */
.up-evolves {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1b1c21;
    box-shadow: 0 0 0 1.5px #fff;
    pointer-events: none;
}

.up-evolves svg {
    display: block;
    width: 100%;
    height: 100%;
    padding: 3px;
    box-sizing: border-box;
    fill: none;
    stroke: #fff;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Black, the plain plate, has no pattern: the swatches are switched off. */
.up-patterns.is-plain .up-pattern {
    opacity: .3;
    cursor: not-allowed;
}

.up-patterns.is-plain .up-pattern input {
    cursor: not-allowed;
}

.up-patterns.is-plain .up-pattern:has(:checked) {
    outline: 0;
}

.up-patterns.is-plain .up-pattern:has(:checked)::after {
    display: none;
}

@media (max-width: 720px) {
    .bp.up {
        padding: 20px 16px 48px;
    }

    /* Still floated: a legend that isn't sits on the fieldset's top rule. */
    .up-tintlabel {
        width: 100%;
        padding: 0 0 14px;
    }

    .up-tintsets {
        clear: left;
        margin-left: 0;
    }

    .up-linkrow {
        flex-wrap: wrap;
    }

    .up-url {
        flex-basis: 100%;
    }
}

.up-problem {
    margin: 0 0 12px;
}

/*
    Images: a club's gallery, a group per kind (its count and Upload beside
    its name), each image a card of its own: the picture on a chequer, so a
    transparent one shows as such, its name (renamed on Save), its size and
    Delete.
*/
.up-gallery + .up-gallery {
    margin-top: 18px;
}

.up-galleryhead {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.up-galleryhead .bp-button {
    margin-left: auto;
}

.up-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.up-image {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--card-rule);
    border-radius: 8px;
    background: var(--card);
}

.up-imagefoot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.up-thumb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    border-radius: 6px;
    background: repeating-conic-gradient(#2a2c35 0% 25%, #1f2128 0% 50%) 0 0 / 16px 16px;
}

.up-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.up-thumb.is-small {
    width: 56px;
    height: 56px;
    flex: none;
}

.up-thumb.is-small:has(img[hidden]) {
    visibility: hidden;
}

/* Club Logo: the drop-down and the chosen logo beside it. */
.up-logopick {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 8px;
}

.up-logopick select {
    flex: 1;
}

/* The logo the club's board shows: In Use (bp-tag is-on), on its picture. */
.up-inuse {
    position: absolute;
    top: 6px;
    left: 6px;
}

/* A board's default layout: Default (is-off), in the middle of its
   diagram, where the parts leave the screen clear (the user, 2026-10-15). */
.up-default {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Download, over the image's top right corner. */
.up-iconbutton.up-download {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-color: var(--field-rule);
    background: var(--card);
}

.up-iconbutton.up-download:hover {
    background: var(--hover);
}

/*
    Overlay Layout: a grid of cards, a row for each arrangement and a column
    for each variation (LiveRaceLayouts), each card a picture drawn from the
    layout's diagram, the race feed dark and each part a colour of its own,
    named in the key under them. Small, so the overlay's twelve fit on a
    screen at once (the user, 2026-10-15).
*/
.up-layouts {
    display: grid;
    grid-template-columns: max-content repeat(var(--columns), minmax(0, 132px));
    justify-content: start;
    align-items: center;
    gap: 8px 10px;
}

/* The grid's headings: each variation over its column, each arrangement beside its row. */
.up-layouthead,
.up-layoutrow {
    color: var(--bp-muted);
    font-size: 13px;
}

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

/* An arrangement's name a part a line: "Tower Left", "Clock Top". */
.up-layoutrow {
    display: flex;
    flex-direction: column;
    padding-right: 4px;
}

.up-layout {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px;
}

.up-layout:has(:checked) {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.up-layout:has(:focus-visible) {
    outline-color: var(--saved);
}

.up-layout svg {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    /* The race feed: a dark, slightly lit screen, its edge drawn in. */
    background: radial-gradient(120% 90% at 50% 35%, #1b1d25, #0d0e12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
    shape-rendering: geometricPrecision;
}

/* Each part: a block with a faint light edge, so it reads as a plate. */
.up-layout rect {
    stroke: rgba(255, 255, 255, .22);
    stroke-width: 1;
}

/*
    The grid and its key side by side, the key a column beside the
    pictures, or under them where the panel is too narrow for both.
*/
.up-layoutpick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 28px;
    margin: 12px 0;
}

/* The key: the six parts in a column. */
.up-legend {
    display: inline-grid;
    gap: 9px;
    padding: 12px 16px;
    border: 1px solid var(--card-rule);
    margin: 0;
    border-radius: 8px;
    list-style: none;
}

.up-legend li {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.up-swatch {
    width: 11px;
    height: 11px;
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}

@media (max-width: 600px) {
    .up-layoutrow {
        max-width: 5em;
    }
}

/* One colour a part, in the pictures and the key. */
.up-part-h { fill: #5b8def; background: #5b8def; }
.up-part-t { fill: #e5202e; background: #e5202e; }
.up-part-c { fill: #8e8e98; background: #8e8e98; }
.up-part-n { fill: #8f3fe0; background: #8f3fe0; }
.up-part-b { fill: #f5c518; background: #f5c518; }
.up-part-s { fill: #1fbf5a; background: #1fbf5a; }

/*
    Sponsor Banner: Random or Fixed Order as two halves of one switch, a
    preview of the band, the banner's sponsors as rows (grip, place,
    picture, name, padlock, remove), and the sponsors still to add as chips.
    The padlocks, the shuffle and the hints follow the switch.
*/
.up-panelhead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

/* A segmented choice (.bp-segment, cardpages.css), spaced here. */
.up-segment {
    margin: 4px 0 8px;
}

.up-bannerpanel:has([value=random]:checked) .up-orderhint.is-order,
.up-bannerpanel:has([value=order]:checked) .up-orderhint.is-random,
.up-bannerpanel:has([value=order]:checked) .up-lock,
.up-bannerpanel:has([value=order]:checked) .up-shuffle {
    display: none;
}

/* The band as the board draws it: the sponsors on the dark of a broadcast, smaller to fit. */
.up-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.up-previewstrip {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 14px;
    height: 46px;
    padding: 0 14px;
    border-radius: 6px;
    background: radial-gradient(120% 140% at 50% 30%, #1b1d25, #0d0e12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
    overflow: hidden;
}

.up-previewstrip img {
    flex: 0 1 auto;
    min-width: 0;
    height: 30px;
    object-fit: contain;
}

/* Small square buttons drawn as an icon: shuffle, grip, padlock, remove. */
.up-iconbutton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--bp-muted);
    cursor: pointer;
}

.up-iconbutton:hover {
    background: var(--hover);
    color: var(--bp-bright);
}

.up-iconbutton:focus-visible {
    outline: 2px solid var(--saved);
    outline-offset: 1px;
}

.up-iconbutton svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.up-shuffle {
    border-color: var(--field-rule);
}

.up-shuffle svg {
    width: 18px;
    height: 18px;
}

.up-bannerlist {
    position: relative;     /* the rows' offsetTop, for dragging */
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.up-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 4px;
    border: 1px solid var(--card-rule);
    border-radius: 8px;
    background: var(--card);
}

.up-slot.is-dragging {
    position: relative;
    z-index: 1;
    border-color: var(--highlight-rule);
    background: var(--highlight);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}

.up-grip {
    cursor: grab;
    touch-action: none;
}

.up-slot.is-dragging .up-grip {
    cursor: grabbing;
}

.up-grip svg {
    fill: currentColor;
    stroke: none;
}

.up-slotnum {
    flex: none;
    width: 1.4em;
    color: var(--bp-muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.up-thumb.is-tiny {
    flex: none;
    width: 64px;
    height: 32px;
    border-radius: 4px;
    background-size: 8px 8px;
}

.up-slotname {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--bp-bright);
}

/* Locked: the padlock lit, the place number in the accent, the row's edge too. */
.up-slot.is-locked .up-lock {
    color: var(--gold);
}

.up-bannerpanel:has([value=random]:checked) .up-slot.is-locked {
    border-color: var(--gold-rule);
}

.up-bannerpanel:has([value=random]:checked) .up-slot.is-locked .up-slotnum {
    color: var(--gold);
}

.up-remove:hover {
    color: var(--danger);
}

.up-bannerempty {
    margin: 0;
    padding: 14px;
    border: 1px dashed var(--field-rule);
    border-radius: 8px;
    text-align: center;
}

.up-addhead {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin: 16px 0 8px;
}

.up-addlist {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.up-addlist:empty {
    display: none;
}

.up-addchip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 4px 8px 4px 4px;
    border: 1px dashed var(--field-rule);
    border-radius: 8px;
    background: transparent;
    color: var(--bp-text);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.up-addchip > span:not([class]) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.up-addchip:hover:not(:disabled) {
    border-style: solid;
    border-color: var(--accent);
    background: var(--hover);
}

.up-addchip:disabled {
    opacity: .4;
    cursor: default;
}

.up-addicon svg {
    display: block;
    width: 14px;
    height: 14px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
}

/* Images: a tip under each kind's heading, its bulb on the text's middle. */
.up-tip {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -4px 0 10px;
}

.up-tip svg {
    flex: none;
    width: 14px;
    height: 14px;
    fill: none;
    stroke: var(--gold);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* A venue's card folds by its name (bp-fold), the venue's number at the far end. */
.up-venue > summary .bp-tag {
    flex: none;
    white-space: nowrap;
    margin-left: auto;
}

.up-venue + .up-venue {
    margin-top: 20px;
}

/* Name on the Board and Club Logo: a row each, their fields no wider than a name needs. */
.up-row input,
.up-logopick {
    max-width: 440px;
}

/* A phone: the Sponsor Banner's rows closer packed, so a sponsor's name has room. */
@media (max-width: 480px) {
    .up-panel {
        padding: 14px 12px;
    }

    .up-slot {
        gap: 4px;
        padding-right: 4px;
    }

    .up-slot .up-iconbutton {
        width: 28px;
    }

    .up-thumb.is-tiny {
        width: 48px;
        margin-right: 4px;
    }

    /* The Image Manager two to a row, not one: twenty sponsors were a long scroll. */
    .up-images {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .up-image {
        padding: 8px;
    }

    .up-image .up-thumb {
        height: 84px;
    }

    .up-imagefoot {
        flex-wrap: wrap;
    }

    /* The launcher's files each over what it does, not squeezed beside it. */
    .up-files {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .up-files dt {
        justify-self: start;
    }

    .up-files dd + dt {
        margin-top: 8px;
    }

    .up-panel .up-monitor {
        margin-bottom: 20px;
    }

    /* The layouts' key in a row under the grid, not a column. */
    .up-legend {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 16px;
        width: 100%;
    }
}

/* The Windows Launcher's monitor: a short box beside its label. */
.up-monitor {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
}

.up-monitor label {
    font-size: 14px;
}

.up-monitor input {
    width: 6em;
}

/*
    The preview (up-live): a demo race on the board being set up, drawn at
    1280 x 720 and scaled to fit (the script sets the scale), over a grey
    fade standing in for the camera feed an overlay goes over. Docked in a
    column of its own beside the cards from 1280px wide, else pinned across
    the top of them, no taller than a third of the window. Bigger (is-live-big on
    the page, from 1000px wide) it is pinned across the top at any width,
    as tall as 55% of the window. It folds away to its heading.
*/
.up-live {
    --live-w: min(100%, 30vh * 16 / 9, 920px);
    --live-pinned: 1;
    grid-area: live;
    position: sticky;
    top: 0;
    z-index: 3;
    align-self: start;
    padding: 10px 16px;
    border-bottom: 1px solid var(--bp-rule);
    background: color-mix(in srgb, var(--bar) 92%, transparent);
    backdrop-filter: blur(8px);
}

/* Where each part goes: the page's template says, for each width (one
   column below 1000px, docked from 1280px, below). */
@media (min-width: 1000px) {
    .up-page {
        grid-template-areas: "side live" "side main";
    }
}

.up-page > .up-side {
    grid-area: side;
}

.up-page > .bp.up {
    grid-area: main;
}

.up-livehead {
    display: flex;
    align-items: center;
    gap: 6px 12px;
    width: var(--live-w);
    margin: 0 auto 8px;
    font-size: 14px;
}

.up-liveclub {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.up-livehead .up-segment {
    margin: 0 0 0 auto;
}

.up-livehead .up-segment span {
    padding: 3px 10px;
    font-size: 13px;
}

.up-livehead .up-iconbutton + .up-iconbutton {
    margin-left: -10px;
}

.up-livefold svg {
    transition: rotate .2s;
}

.up-live.is-folded .up-livehead {
    margin-bottom: 0;
}

.up-live.is-folded .up-livefold svg {
    rotate: 180deg;
}

.up-live.is-folded .up-livescreen,
.up-live.is-folded .up-livesize {
    display: none;
}

/* Bigger and smaller: one button, its picture the way it goes. */
.up-livesize .is-smaller,
.up-page.is-live-big .up-livesize .is-bigger {
    display: none;
}

.up-page.is-live-big .up-livesize .is-smaller {
    display: block;
}

.up-livescreen {
    position: relative;
    width: var(--live-w);
    aspect-ratio: 16 / 9;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(165deg, #5b5e65, #33353b 55%, #202125);
    box-shadow: 0 0 0 1px var(--card-rule);
}

.up-livescreen::before {
    content: "Camera Feed";
    position: absolute;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    color: #ffffff26;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* The board at its own size, scaled down, shown once it has drawn; the
   change from one to the next under a dip to black (up-livecover).  Light, as the board is: an iframe of another scheme than its
   page is painted opaque. */
.up-livescreen iframe {
    position: absolute;
    left: 0;
    top: 0;
    width: 1280px;
    height: 720px;
    border: 0;
    transform-origin: 0 0;
    pointer-events: none;
    color-scheme: light;
    opacity: 0;
}

.up-livescreen iframe.is-on {
    opacity: 1;
}

/* Fades in and out over LIVE_FADE_MS (the script sets the transition's length). */
.up-livecover {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity;
}

.up-livecover.is-on {
    opacity: 1;
}

/* No bigger on a phone: pinned at the top, it is as big as it can be there. */
@media (max-width: 999px) {
    .up-livesize {
        display: none;
    }
}

@media (min-width: 1000px) {
    .up-page.is-live-big .up-live {
        --live-w: min(100%, 55vh * 16 / 9);
        padding: 14px 24px;
    }
}

/* Docked: its own column, held in view. */
@media (min-width: 1280px) {
    .up-page.bp-sided:not(.is-live-big) {
        grid-template-columns: 232px minmax(0, 1fr) clamp(360px, 30vw, 520px);
        grid-template-areas: "side main live";
    }

    .up-page:not(.is-live-big) .up-live {
        --live-w: 100%;
        --live-pinned: 0;
        padding: 32px 20px 20px 4px;
        border: 0;
        background: none;
        backdrop-filter: none;
    }
}
