.signin-container {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.signin-brand {
    margin-bottom: 2rem;
}

.signin-title {
    margin-bottom: 1.5rem;
}

/* Tournament page: the settings as label / value pairs in cards */
.tournament-details dt {
    font-weight: normal;
    color: var(--bs-secondary-fg);
}

/* Both columns keep the gap, so a label that wraps does not touch the next row */
.tournament-details dt,
.tournament-details dd {
    margin-bottom: 0.5rem;
}

.tournament-details dt:last-of-type,
.tournament-details dd:last-of-type {
    margin-bottom: 0;
}

/* Cross-table and team roster: the rounds or the stats scroll sideways on a phone while the name stays in view */
.crosstable th,
.crosstable td {
    white-space: nowrap;
}

.crosstable .crosstable-name,
.roster .roster-name {
    position: sticky;
    left: 0;
    background-color: var(--bs-bg-body);
}

/* Tournament pages: the list of tabs scrolls sideways when it does not fit, instead of widening the page. overflow-y
   is hidden because the tabs overlap the bottom border by a pixel, which would otherwise add a vertical scrollbar.
   The bar around the list must not scroll: on the organizer page it holds the "More" menu, which it would clip */
.tournament-tabs-list {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

/* Once Bootstrap's NavOverflow runs, the tabs that do not fit are in the "More" menu: nothing is left to scroll, and
   a scroll container would clip the focus ring of the tabs */
.nav-overflow-initialized > .tournament-tabs-list {
    overflow: visible;
}

/* Bootstrap draws an open "More" like the selected tab, which would show two tabs selected: an open "More" is
   tinted as on hover and its chevron turns up instead */
.nav-overflow-item.show > .nav-overflow-toggle {
    color: var(--bs-nav-link-hover-color);
    background-color: var(--bs-nav-link-hover-bg);
    border-color: transparent;
    border-bottom-color: var(--bs-nav-tabs-border-color);
}

.nav-overflow-item.show > .nav-overflow-toggle svg {
    transform: rotate(180deg);
}

/* Bootstrap marks a focused menu item with a pale tint only: the items of "More" get the focus ring of the tabs,
   drawn inside the item so the menu's edge does not cut it */
.nav-overflow-menu .menu-item:focus-visible {
    outline: var(--bs-focus-ring);
    outline-offset: calc(-1 * var(--bs-focus-ring-width));
}

/* A finger needs taller items than a mouse pointer, as for the reorder handles below */
@media (pointer: coarse) {
    .nav-overflow-menu .menu-item {
        min-height: 44px;
    }
}

/* The sections placed in a tab keep their own spacing, but the first one need not clear a whole page header.
   Bootstrap is in cascade layers, so this rule, outside them, beats the utility class on the heading row */
.tournament-tabs + .tab-content > .tab-pane > section > :first-child {
    margin-top: 1rem;
}

/* Reordered lists (tie-breaks, the players of a team): the handle a row is dragged by. touch-action lets a finger
   drag the row instead of scrolling the page */
.reorder-handle {
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.reorder-handle:active {
    cursor: grabbing;
}

/* A finger needs a larger target than a mouse */
@media (pointer: coarse) {
    .reorder-handle {
        min-width: 44px;
        min-height: 44px;
    }
}

/* The rows of a reordered list are never the browser's scroll anchor: when the dragged row passed the first row on
   screen, the browser scrolled to keep that row still and the dragged row left the screen */
[data-controller~="reorder"] {
    overflow-anchor: none;
}

/* The row being dragged */
.reorder-dragging {
    outline: 2px solid var(--bs-primary-base);
    outline-offset: -2px;
}

/* The row just moved, when the page comes back: outlined, fading out, so its new place is found at a glance */
.reorder-moved {
    outline: 2px solid transparent;
    outline-offset: -2px;
    animation: reorder-moved 2.5s ease-out;
}

@keyframes reorder-moved {
    from {
        outline-color: var(--bs-primary-base);
    }
}

/* Without motion the outline stays until the page changes */
@media (prefers-reduced-motion: reduce) {
    .reorder-moved {
        outline-color: var(--bs-primary-base);
        animation: none;
    }
}

/* A move is being saved: the list takes no other until the page comes back */
.reorder-busy {
    cursor: progress;
    opacity: 0.6;
}

/* Rounds tab: the Edit button of a game is the summary of the details that holds its form, without the marker */
.game-edit > summary {
    list-style: none;
}

.game-edit > summary::-webkit-details-marker {
    display: none;
}
