/*
 * Shared styling for login, admin, setup and schedule pages.
 * No framework, no build step, no web font: the system font stack loads instantly and there is
 * no third party left that could be unreachable during the tournament.
 *
 * Everything scales from the root font size, which itself follows the viewport. That is what
 * makes the same markup work one handed on a phone and on a 4K desktop screen.
 *
 * The palette echoes the club's own colours: a deep bottle green as the brand colour, with a
 * muted antique gold as a secondary accent for dividers and highlights.
 */

:root {
    --bg: #f2f6f2;
    --card: #ffffff;
    --ink: #142018;
    --ink-muted: #57685c;
    --border: #d3ddd2;
    /* --accent is overridden inline per request from the tournament's configured accent colour
       (see fragments/layout.html); --accent-dark and --dark (the topbar background) are derived
       from it with color-mix() instead of being separate settings, so one colour choice on the
       Design page consistently darkens/lightens everywhere it is used. */
    --accent: #1f6e42;
    --accent-dark: color-mix(in srgb, var(--accent) 82%, black);
    --accent-ink: #ffffff;
    --gold: #b8912f;
    --gold-dark: #8f7024;
    --ok: #15803d;
    --warn: #b45309;
    --error: #b91c1c;
    --dark: color-mix(in srgb, var(--accent) 55%, black);

    --radius: 0.875rem;
    --touch: 3rem; /* 48 px minimum touch target */
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    /* 16 px on a phone, up to 22 px on a large desktop screen. */
    font-size: clamp(16px, 0.45vw + 14.5px, 22px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.45;
    padding-bottom: 2rem;
}

h1, h2, h3 {
    line-height: 1.2;
    margin: 0 0 0.5rem;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

a { color: var(--accent); }

/* ------------------------------------------------------------------- layout */

.content {
    width: 100%;
    max-width: 62rem;
    margin: 0 auto;
    padding: 1rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.card > h2:first-child {
    margin-top: 0;
}

.muted {
    color: var(--ink-muted);
    font-size: 0.85rem;
}

.grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

/* ------------------------------------------------------------------- topbar */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--dark);
    color: #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    padding: 0.4rem 0.9rem;
}

.topbar .brand {
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-right: auto;
    font-size: 0.95rem;
    white-space: nowrap;
}

.topbar nav {
    display: flex;
    gap: 0.2rem;
    flex-wrap: wrap;
}

.topbar nav a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.5rem 0.7rem;
    border-radius: 0.6rem;
    min-height: var(--touch);
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.topbar nav a:hover { background: rgba(255, 255, 255, 0.08); }
.topbar nav a.current { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* ------------------------------------------------------------ current user */

.current-user {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    white-space: nowrap;
}

.current-user strong {
    color: #fff;
    font-weight: 700;
}

/* -------------------------------------------------------- connection status */

.connection {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.connection::before {
    content: "";
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: #facc15;
}

.connection[data-status="online"] { color: #86efac; }
.connection[data-status="online"]::before { background: #22c55e; }
.connection[data-status="offline"] { color: #fca5a5; }
.connection[data-status="offline"]::before {
    background: #ef4444;
    animation: blink 1.6s ease-in-out infinite;
}

@keyframes blink {
    50% { opacity: 0.25; }
}

/* ------------------------------------------------------------- app version */

.app-version {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    margin-left: auto;
}

/* ---------------------------------------------------------------- test mode */

.test-banner {
    background: repeating-linear-gradient(135deg, #b45309, #b45309 12px, #92400e 12px, #92400e 24px);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-align: center;
    padding: 0.35rem 1rem;
    font-size: 0.78rem;
}

.test-banner[hidden] { display: none; }

/* ------------------------------------------------------------------ buttons */

button,
.button {
    font: inherit;
    font-weight: 600;
    min-height: var(--touch);
    padding: 0.7rem 1.05rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    touch-action: manipulation;
}

/* display: inline-flex above would otherwise defeat the hidden attribute (test-mode-only buttons). */
button[hidden],
.button[hidden] { display: none; }

button:hover,
.button:hover { border-color: #94a3b8; }

button:active { transform: translateY(1px); }

button:disabled {
    opacity: 0.55;
    cursor: progress;
    transform: none;
}

button:focus-visible,
.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.button.primary,
button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

button.primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

button.danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--error);
}

button.big {
    min-height: 4.5rem;
    font-size: 1.2rem;
    width: 100%;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.button-row > * { flex: 1 1 11rem; }

/* -------------------------------------------------------------------- forms */

label {
    display: block;
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
    font: inherit;
    width: 100%;
    min-height: var(--touch);
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    background: #fff;
    color: var(--ink);
}

textarea {
    min-height: 4.5rem;
    resize: vertical;
}

.field { margin-bottom: 0.75rem; }

.password-field { position: relative; }

.password-field input { padding-right: 2.6rem; }

.password-toggle {
    all: unset;
    position: absolute;
    top: 50%;
    right: 0.3rem;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0.4rem;
    border-radius: 0.4rem;
    color: var(--ink-muted);
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--ink);
}

/* --------------------------------------------------------- access tokens */

.access-token-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.access-token-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.8rem;
}

.access-token-name {
    font-weight: 700;
}

.access-token-code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.9rem;
    color: var(--ink-muted);
}

.access-token-range {
    font-weight: 600;
    flex: 1 1 auto;
}

.access-token-status {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.15em 0.6em;
    border-radius: 999px;
}

.access-token-status[data-status="aktiv"] { background: #f0fdf4; color: var(--ok); }
.access-token-status[data-status="bevorstehend"] { background: #fffbeb; color: var(--warn); }
.access-token-status[data-status="abgelaufen"] { background: #f3f4f6; color: var(--ink-muted); }

.access-token-manual-restore {
    margin-top: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.8rem;
}

.access-token-manual-restore summary {
    cursor: pointer;
    font-weight: 600;
}

.access-token-manual-restore .field:first-of-type {
    margin-top: 0.75rem;
}

/* --------------------------------------------------------------- user admin */

.permission-matrix {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.35rem 1rem;
    align-items: center;
    margin: 0.75rem 0;
}

.permission-row {
    display: contents;
}

.permission-row-header span {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
}

.permission-row input[type="checkbox"] {
    justify-self: center;
    width: 1.2rem;
    height: 1.2rem;
}

.permission-row-anzeige {
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
}

.permission-row-group span:first-child {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-top: 0.6rem;
}

.user-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem;
    background: var(--card);
}

.user-card h3 {
    margin: 0;
}

.user-card-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-card-head h3 {
    margin: 0;
}

.session-icons {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex: 0 0 auto;
    color: var(--ink-muted);
}

.session-icons svg {
    width: 1.4rem;
    height: 1.4rem;
    display: block;
}

/* One user's sessions, nested inside their .user-card group (see sitzungen.js) - --bg rather
   than --card so a row reads as "inset" against the group card surrounding it instead of
   looking like a card of its own. */
.session-sublist {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.session-row {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.75rem;
    background: var(--bg);
}

.user-password-row {
    margin-top: 0.5rem;
}

.user-password-row input {
    flex: 1 1 16rem;
}

/* --------------------------------------------------------------- details box */

/* Generic collapsible box for a secondary, rarely-touched control tucked inside a card - used by
   both .layout-help below and the "Obergrenze der Auswahl" setting on the Mannschaften card
   (see setup.html/setup.js). */
.details-box {
    margin: 0.75rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.9rem;
}

.details-box summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.3rem 0;
}

/* ------------------------------------------------------------- layout help */

.layout-help dl {
    margin: 0.5rem 0;
}

.layout-help dt {
    font-weight: 700;
    margin-top: 0.5rem;
}

.layout-help dd {
    margin: 0.15rem 0 0;
    color: var(--ink-muted);
}

.layout-help code {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.3rem;
    padding: 0.05em 0.35em;
    font-size: 0.9em;
}

.layout-help pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 0.6rem 0.8rem;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}

.spaced { margin-top: 1rem; }

.hint {
    margin: 0.35rem 0 0.75rem;
    line-height: 1.35;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: var(--touch);
    font-weight: 600;
    font-size: 0.9rem;
}

.checkbox input {
    width: 1.4rem;
    height: 1.4rem;
    flex: none;
}

/* ----------------------------------------------------------------- messages */

.notice {
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    border: 1px solid;
}

.notice.ok { background: #f0fdf4; border-color: #bbf7d0; color: var(--ok); }
.notice.error { background: #fef2f2; border-color: #fecaca; color: var(--error); }
.notice.warn { background: #fffbeb; border-color: #fde68a; color: var(--warn); }
.notice[hidden] { display: none; }

/* The per-page action-feedback notice (id="message") floats as a popup pinned to the viewport
   instead of sitting inline at the top of <main> - on a long page (Einrichtung, Benutzer) an
   inline banner scrolled out of view the moment an action below it failed, so nobody ever saw
   why. Server-rendered banners (login page, import result) keep the plain inline .notice look,
   only this one id gets the floating treatment. */
#message.notice {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    max-width: min(92vw, 34rem);
    box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.18);
}

/* -------------------------------------------------------------- team colour */

.team-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
}

.team-chip::before {
    content: "";
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 0.25rem;
    background: var(--team-color, #94a3b8);
    flex: none;
}

/* -------------------------------------------------------- admin round panel */

.round-headline {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.round-headline .word {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.round-headline .number {
    font-size: clamp(3rem, 12vw, 5rem);
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.round-headline .total {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink-muted);
}

.pair-card {
    border: 1px solid var(--border);
    border-left: 0.4rem solid var(--team-color, #94a3b8);
    border-radius: var(--radius);
    padding: 0.65rem 0.85rem;
    background: #fbfdff;
}

.pair-card .pair-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.pair-card .lane-row {
    font-size: 0.95rem;
}

.pair-card .lane-row.free {
    color: var(--ink-muted);
    font-style: italic;
}

.free {
    color: var(--ink-muted);
    font-style: italic;
}

.preview-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-top: 1px solid var(--border);
}

.preview-title {
    font-weight: 700;
    margin: 0 0 0.25rem;
}

/* ------------------------------------------------------------------- tables */

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.plan {
    border-collapse: collapse;
    width: 100%;
    min-width: 34rem;
}

table.plan th,
table.plan td {
    border: 1px solid var(--border);
    padding: 0.45rem 0.6rem;
    text-align: left;
    vertical-align: middle;
}

table.plan thead th {
    background: var(--dark);
    color: #fff;
    position: sticky;
    top: 0;
}

table.plan td.pair-start {
    border-left-width: 3px;
    border-left-color: #94a3b8;
}

table.plan tr.current td {
    background: #eaf4ec;
}

table.plan .round-number {
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
}

.player-name {
    display: block;
    font-weight: 600;
}

.player-team {
    display: block;
    font-size: 0.76rem;
    color: var(--team-color, var(--ink-muted));
    filter: brightness(0.65);
}

/* Team on top (Design): the two lines swap places and sizes. */
.lane-text {
    display: flex;
    flex-direction: column;
}

.lane-text.team-first { flex-direction: column-reverse; }

.lane-text.team-first .player-team {
    font-size: 1rem;
    font-weight: 600;
    filter: brightness(0.65);
}

.lane-text.team-first .player-name {
    font-size: 0.76rem;
    font-weight: 400;
    color: var(--ink-muted);
}

.free {
    color: var(--ink-muted);
    font-style: italic;
}

/* -------------------------------------------------------------- setup sheet */

.team-panel {
    border: 1px solid var(--border);
    border-top: 0.35rem solid var(--team-color, #94a3b8);
    border-radius: var(--radius);
    padding: 0.85rem;
    background: var(--card);
}

.team-header-field {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.team-header-field label,
.team-header-field input[type="text"] {
    flex: 1 1 12rem;
}

/* Reorders the whole team, not just its players - moves the entry to a new position in the team
   list and, since letters/default colours and an already-generated schedule are all derived from
   that position, discards an existing schedule the same way changing team count or layout does
   (see TournamentService.moveTeam). Kept as immediate up/down buttons rather than drag-and-drop:
   each team is its own top-level card, so dragging one across the others would need a shared
   container and its own pointer-tracking machinery the per-player reorder above does not need. */
.team-move-buttons {
    display: flex;
    gap: 0.3rem;
    flex: none;
}

.team-move-buttons button {
    all: unset;
    width: var(--touch);
    min-height: var(--touch);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-muted);
    font-size: 1rem;
    cursor: pointer;
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    box-sizing: border-box;
}

.team-move-buttons button:hover,
.team-move-buttons button:focus-visible {
    color: var(--accent);
    background: #eaf4ec;
}

.team-move-buttons button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.player-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.5rem;
    margin: 0.6rem 0;
}

.player-field {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    position: relative;
    /* Set while a drag is in progress, see setup.js. Above sibling fields so the dragged tile
       visibly floats over them while it follows the pointer. */
    z-index: 1;
    background: var(--card);
    border-radius: 0.5rem;
}

.player-field.dragging {
    z-index: 5;
    box-shadow: 0 0.5rem 1.25rem rgba(15, 23, 42, 0.22);
    transition: none;
}

.player-field:not(.dragging) {
    transition: transform 160ms ease;
}

/* A drop target briefly highlighted while something is being dragged over it. */
.player-field.drop-target .number {
    color: var(--accent);
}

.drag-handle {
    all: unset;
    flex: none;
    width: 1.6rem;
    min-height: var(--touch);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-muted);
    font-size: 1.1rem;
    cursor: grab;
    /* Stops the browser from scrolling the page while a touch drag is in progress. */
    touch-action: none;
    border-radius: 0.4rem;
}

.drag-handle:hover,
.drag-handle:focus-visible {
    color: var(--accent);
    background: #eaf4ec;
}

.player-field.dragging .drag-handle {
    cursor: grabbing;
}

.player-field .number {
    flex: none;
    width: 1.5rem;
    text-align: right;
    font-weight: 700;
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
}

.save-state {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-muted);
    min-height: 1.2rem;
}

.save-state.ok { color: var(--ok); }
.save-state.error { color: var(--error); }

/* ------------------------------------------------------------------ dialogs */

dialog {
    border: none;
    border-radius: var(--radius);
    padding: 1.25rem;
    max-width: min(28rem, 92vw);
    box-shadow: 0 1.5rem 3rem rgba(15, 23, 42, 0.3);
}

dialog::backdrop { background: rgba(15, 23, 42, 0.55); }

dialog img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 20rem;
    margin: 0 auto 0.75rem;
    border-radius: 0.5rem;
    background: #fff;
}

.qr-url {
    word-break: break-all;
    text-align: center;
    font-size: 0.85rem;
    color: var(--ink-muted);
    margin-bottom: 1rem;
}

/* --------------------------------------------------------------- login page */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 1rem;
    background:
        radial-gradient(circle at 15% 15%, rgba(184, 145, 47, 0.10), transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(31, 110, 66, 0.12), transparent 45%),
        var(--bg);
}

.login-box {
    width: 100%;
    max-width: 24rem;
}

.login-box .card {
    position: relative;
    overflow: hidden;
    text-align: center;
}

.login-box .card::before {
    /* A quiet green-to-gold band above the form, standing in for a club emblem without trying
       to reproduce anyone's actual artwork. A pseudo-element rather than border-image, which
       would otherwise smear the gradient across the card's plain side borders too. */
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 0.4rem;
    background: linear-gradient(90deg, var(--accent), var(--gold));
}

.login-box h1 {
    color: var(--accent-dark);
    letter-spacing: 0.01em;
}

.login-box form {
    text-align: left;
}

/* -------------------------------------------------------------------- hilfe */

.hilfe-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.75rem;
}

.hilfe-toc a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.hilfe-toc a:hover,
.hilfe-toc a:focus-visible {
    text-decoration: underline;
}

.hilfe .card h2 {
    scroll-margin-top: 1rem;
}

.hilfe-screenshot {
    display: block;
    max-width: 100%;
    height: auto;
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* -------------------------------------------------------------------- print */

@media print {
    .topbar,
    .button-row,
    button,
    .no-print {
        display: none !important;
    }

    body { background: #fff; }

    .card {
        border: none;
        padding: 0;
        margin: 0;
    }

    table.plan thead th {
        background: #e2e8f0;
        color: #000;
        position: static;
    }
}

/* Tournament dropdown in the topbar. */
.tournament-select {
    max-width: 16rem;
    min-height: 2.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
}

.tournament-select[hidden] { display: none; }

/* ---------------------------------------------------------------- Ergebnisse */

.result-team-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.result-team-head h2 { margin: 0; }

.result-swatch {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    flex: none;
}

.result-total {
    margin-left: auto;
    font-weight: 700;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
}

.result-table th,
.result-table td {
    padding: 0.3rem 0.35rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
    vertical-align: middle;
    font-size: 0.9rem;
}

.result-table .result-name-col,
.result-table .result-name {
    text-align: left;
    min-width: 8rem;
}

/* input[type="number"] above is more specific than a bare class, hence the repeated selector.
   No spin buttons: typing is faster, and the row fits without sideways scrolling. */
input.result-input[type="number"] {
    width: 2.6rem;
    min-width: 0;
    min-height: 2.4rem;
    padding: 0.3rem 0.1rem;
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
}

input.result-input[type="number"]::-webkit-outer-spin-button,
input.result-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.result-table th,
.result-table td { padding: 0.3rem 0.2rem; }

.result-table .result-name-col,
.result-table .result-name { min-width: 5.5rem; }

.result-rings input.result-input[type="number"] { width: 3.4rem; font-weight: 700; }
.result-rings input.result-input[readonly] { background: var(--bg); }

.result-struck input { width: 1.4rem; height: 1.4rem; }

/* Lowest results once more than eight shooters of the team have one: the ones that may be struck. */
.result-table tr.candidate { background: #e5e7eb; }
.result-table tr.struck td:not(.result-struck) { color: var(--ink-muted); text-decoration: line-through; }
.result-table tr.not-counted { color: var(--ink-muted); }
.result-status { white-space: nowrap; color: var(--ink-muted); }
