/* === Typografia dla zalogowanych userów === */
html {
    font-family: "Inter", "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
}

/* === Admin layout overrides (uzupełnia base.css) === */

/* Pełna szerokość dla ekranów edycji/zarządzania/podglądu turniejów: */
main.admin-content.admin-content--wide {
    width: calc(100vw - 4rem);
    max-width: none;
    margin-left: calc(50% - 50vw + 2rem);
    margin-right: 0;
}

main.admin-content.admin-content--wide > .card {
    min-width: 80%;
}

/* Tabele indywidualne (tm-cup / tm-start) — admin-specific */

.tm-cup-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.tm-cup-table {
    width: 100%;
}

.tm-cup-match-cell {
    white-space: nowrap;
}

.tm-cup-status-icon {
    display: inline-block;
    font-size: 1.3em;
    line-height: 1;
    margin-right: 0.36rem;
    vertical-align: -0.06em;
}

.tm-cup-row.tm-cup-row-live td {
    color: var(--tm-cup-live-color, var(--theme-accent-strong));
    font-weight: 400;
}

.tm-cup-row.tm-cup-row-suggested td {
    color: var(--tm-cup-suggested-color, var(--theme-text));
    font-weight: 400;
}

.tm-cup-row.tm-cup-row-finished td {
    color: var(--tm-cup-finished-color, var(--theme-muted));
    font-weight: 400;
    opacity: 0.9;
}

.tm-cup-row.tm-cup-row-live td:first-child {
    border-left: 3px solid var(--tm-cup-live-color, var(--theme-accent-strong));
}

.tm-cup-row.tm-cup-row-suggested td:first-child {
    border-left: 3px solid var(--tm-cup-suggested-color, var(--theme-text));
}

.tm-cup-row.tm-cup-row-finished td:first-child {
    border-left: 3px solid var(--tm-cup-finished-color, var(--theme-muted));
}

.tm-cup-legend {
    margin-top: 0.45rem;
    font-size: 0.86rem;
}

.tm-cup-legend-live {
    color: var(--tm-cup-live-color, var(--theme-accent-strong));
    font-weight: 400;
}

.tm-cup-legend-suggested {
    color: var(--tm-cup-suggested-color, var(--theme-text));
    font-weight: 400;
}

.tm-cup-legend-finished {
    color: var(--tm-cup-finished-color, var(--theme-muted));
    font-weight: 400;
}

.tm-cup-error {
    color: var(--theme-danger);
    font-weight: 700;
}

.tm-cup-empty {
    color: var(--theme-muted);
}

.tm-cup-toolbar {
    margin-bottom: 0.65rem;
}

.tm-cup-pagination-summary {
    margin-bottom: 0.65rem;
}

.tm-start-list-note {
    margin-top: 0.4rem;
    margin-bottom: 0.75rem;
    color: var(--theme-text-dim);
    font-size: 0.92rem;
}

.tm-start-list-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.tm-start-list-table {
    width: 100%;
    min-width: 920px;
}

.tm-start-list-table th,
.tm-start-list-table td {
    white-space: nowrap;
}

.player-profile-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.16s ease, border-color 0.16s ease;
}

.player-profile-link:hover {
    color: var(--theme-accent);
    border-bottom-color: currentColor;
}

.player-profile-link:focus-visible {
    outline: 2px solid var(--theme-focus-ring);
    outline-offset: 2px;
    border-bottom-color: currentColor;
}

.tm-start-list-table .tm-start-cell-center {
    text-align: center;
}

.tm-start-list-table tbody tr:nth-child(odd) {
    background: var(--tm-start-row-odd, var(--theme-surface));
}

.tm-start-list-table tbody tr:nth-child(even) {
    background: var(--tm-start-row-even, var(--theme-surface-alt));
}

.tm-start-list-table tbody tr:nth-child(odd) td:first-child {
    border-left: 4px solid var(--tm-start-row-odd-accent, var(--theme-accent));
}

.tm-start-list-table tbody tr:nth-child(even) td:first-child {
    border-left: 4px solid var(--tm-start-row-even-accent, var(--theme-border-strong));
}

.tm-start-list-table tbody tr.tm-start-top-1 td {
    background: var(--tm-start-top1, var(--theme-warning-bg));
}

.tm-start-list-table tbody tr.tm-start-top-2 td {
    background: var(--tm-start-top2, var(--theme-surface-soft));
}

.tm-start-list-table tbody tr.tm-start-top-3 td {
    background: var(--tm-start-top3, var(--theme-surface-muted));
}

.tm-start-rank-points {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
}

.tm-start-rank-pos {
    font-size: 0.78rem;
    color: var(--theme-text-subtle);
    font-weight: 600;
}

.tm-start-list-error {
    color: var(--theme-danger);
    font-weight: 700;
}

.tm-start-list-empty {
    color: var(--theme-muted);
}

/* === Kolory - admin overrides (różnią się od base.css) === */
/* header: ciemniejsze tło + mocniejsza ramka zamiast base.css --theme-surface/--theme-border */
header {
    background: var(--theme-surface-alt);
    border-bottom: 1px solid var(--theme-border-strong);
}

/* card/modal: 2px border zamiast 1px z base.css + inna zmienna obramowania */
.card, .group-box, .modal-content {
    background: var(--theme-surface-glass);
    border: 2px solid var(--theme-border);
}

/* Animacja kart (admin-specific - base.css nie animuje .card) */
.card, .group-box {
    animation: fadeIn 0.5s ease-out;
}

/* Płynniejszy transition przycisków (admin override vs base.css transition: 0.2s) */
button, .btn {
    transition: transform 0.15s ease, background 0.2s ease;
}

/* Kontener logowania */
.login-container {
    max-width: 380px;
    margin: 5rem auto;
    padding: 2rem;
    border-radius: 14px;
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

.login-container.login-container-register {
    max-width: 980px;
    text-align: left;
    padding: 2.1rem;
}

/* Formularz */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-form.login-form-register {
    gap: 1.2rem;
}

.login-form.login-form-reset-request,
.login-form.login-form-reset-password {
    gap: 0.9rem;
}

.login-form input {
    width: 100%;
    padding: 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--theme-input-border);
    font-size: 1rem;
}

.register-layout-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
    align-items: stretch;
}

.register-subbox {
    display: grid;
    gap: 0.8rem;
    align-content: start;
    min-height: 100%;
    padding: 1.1rem 1.15rem;
    border: 2px solid var(--theme-border-strong);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--theme-surface-alt) 0%, var(--theme-surface) 100%);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.12);
}

.register-subbox-title {
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--theme-text-dim);
    margin-bottom: 0.15rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--theme-border);
}

.register-two-column-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.register-two-column-row label,
.register-subbox label,
.login-form > label {
    display: grid;
    gap: 0.38rem;
    font-weight: 700;
    color: var(--theme-text);
}

.register-subbox .password-wrapper {
    margin-top: -0.15rem;
}

.register-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.register-form-actions .btn {
    min-width: 220px;
}

@media (max-width: 700px) {
    .login-container.login-container-register {
        max-width: 100%;
        padding: 1.2rem;
    }

    .register-layout-grid {
        grid-template-columns: 1fr;
    }

    .register-two-column-row {
        grid-template-columns: 1fr;
    }

    .register-form-actions {
        justify-content: stretch;
    }

    .register-form-actions .btn {
        width: 100%;
        min-width: 0;
    }
}

.admin-public-share-section {
    margin-bottom: 1.5rem;
}

.admin-public-share-field {
    width: 100%;
    margin-bottom: 1rem;
}

.admin-public-share-field--wide {
    margin-bottom: 1.25rem;
}

.admin-public-share-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.92rem;
    color: var(--theme-text-dim);
}

.admin-public-share-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.75rem;
    align-items: center;
}

.admin-public-share-input {
    width: 100%;
    min-width: 0;
    min-height: 2.85rem;
    padding: 0.8rem 0.95rem;
    font-family: Consolas, 'Courier New', monospace;
}

.package-activation-wrap {
    display: grid;
    gap: 1rem;
}

.package-activation-page {
    display: grid;
    gap: 1rem;
}

.package-activation-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.package-activation-chip {
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--theme-border-strong);
    background: var(--theme-surface-alt);
    color: var(--theme-text);
    font-size: 0.78rem;
    font-weight: 800;
}

.package-activation-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.package-activation-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: separate;
    border-spacing: 0;
}

.package-activation-table th,
.package-activation-table td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--theme-border);
    text-align: left;
    vertical-align: top;
}

.package-activation-table thead th {
    background: var(--theme-surface-alt);
    color: var(--theme-text);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.package-activation-table tbody tr:nth-child(odd) td {
    background: var(--theme-list-item-odd-bg-from, var(--theme-surface));
}

.package-activation-table tbody tr:nth-child(even) td {
    background: var(--theme-list-item-even-bg-from, var(--theme-surface-alt));
}

.package-activation-table tbody tr td:first-child {
    border-left: 5px solid #e0a132;
}

.package-active-wrap {
    display: grid;
    gap: 1rem;
}

.package-active-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.package-active-header h2 {
    margin-bottom: 0.35rem;
}

.package-active-header p {
    margin: 0;
    color: var(--theme-text-dim);
}

.package-active-summary-chips {
    justify-content: flex-end;
}

.package-active-toolbar {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.package-active-list {
    display: grid;
    gap: 0.9rem;
}

.package-active-item {
    position: relative;
    display: grid;
    gap: 1rem;
    padding: 1rem 1rem 1rem 1.2rem;
    border: 1px solid var(--theme-border-strong);
    border-radius: 14px;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--theme-shadow-color, #000) 8%, transparent 92%);
    overflow: hidden;
}

.package-active-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
}

.package-active-item:nth-child(odd) {
    background: linear-gradient(135deg, color-mix(in srgb, var(--theme-list-item-odd-bg-from, var(--theme-surface)) 82%, var(--theme-accent) 18%), color-mix(in srgb, var(--theme-list-item-odd-bg-to, var(--theme-surface-alt)) 90%, white 10%));
}

.package-active-item:nth-child(odd)::before {
    background: linear-gradient(180deg, var(--theme-accent), color-mix(in srgb, var(--theme-accent) 40%, var(--theme-border-strong) 60%));
}

.package-active-item:nth-child(even) {
    background: linear-gradient(135deg, color-mix(in srgb, var(--theme-list-item-even-bg-from, var(--theme-surface-alt)) 78%, var(--theme-success) 22%), color-mix(in srgb, var(--theme-list-item-even-bg-to, var(--theme-surface)) 88%, white 12%));
}

.package-active-item:nth-child(even)::before {
    background: linear-gradient(180deg, var(--theme-success), color-mix(in srgb, var(--theme-success) 42%, var(--theme-border-strong) 58%));
}

.package-active-item-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.package-active-user-block {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.package-active-user-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.package-active-user-title-row h3 {
    margin: 0;
    font-size: 1.06rem;
}

.package-active-package-name {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--theme-surface) 78%, white 22%);
    border: 1px solid var(--theme-border-strong);
    font-size: 0.8rem;
    font-weight: 800;
}

.package-active-user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.9rem;
    color: var(--theme-text-dim);
    font-size: 0.88rem;
}

.package-active-item-aside {
    display: grid;
    gap: 0.5rem;
    justify-items: end;
}

.package-active-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 124px;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--theme-border-strong);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.package-active-type-badge.is-free {
    background: color-mix(in srgb, var(--theme-accent) 12%, var(--theme-surface) 88%);
    color: var(--theme-accent-strong, var(--theme-accent));
}

.package-active-type-badge.is-one-time {
    background: color-mix(in srgb, #e0a132 18%, var(--theme-surface) 82%);
    color: #7a4a00;
}

.package-active-type-badge.is-subscription {
    background: color-mix(in srgb, var(--theme-success) 18%, var(--theme-surface) 82%);
    color: var(--theme-success);
}

.package-active-type-badge.is-generic {
    background: var(--theme-surface);
    color: var(--theme-text);
}

.package-active-date {
    color: var(--theme-text-dim);
    font-size: 0.86rem;
}

.package-active-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
}

.package-active-stat-card {
    display: grid;
    gap: 0.42rem;
    min-width: 0;
    padding: 0.9rem 0.95rem;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--theme-border-strong) 82%, white 18%);
    background: color-mix(in srgb, var(--theme-surface) 84%, white 16%);
}

.package-active-stat-card strong {
    color: var(--theme-text);
}

.package-active-stat-card span {
    color: var(--theme-text-dim);
}

.package-active-stat-label {
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--theme-text-subtle);
}

.package-active-progress {
    position: relative;
    height: 0.72rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--theme-border-strong) 28%, transparent 72%);
    overflow: hidden;
}

.package-active-progress.is-unlimited {
    background: color-mix(in srgb, var(--theme-success) 18%, transparent 82%);
}

.package-active-progress-bar {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.package-active-progress-bar.is-low {
    background: linear-gradient(90deg, #3d8bfd, #74b0ff);
}

.package-active-progress-bar.is-medium {
    background: linear-gradient(90deg, #f08c00, #ffbf57);
}

.package-active-progress-bar.is-high {
    background: linear-gradient(90deg, #e8590c, #ff922b);
}

.package-active-progress-bar.is-full {
    background: linear-gradient(90deg, #c92a2a, #ff6b6b);
}

.package-active-progress-bar.is-unlimited {
    background: linear-gradient(90deg, var(--theme-success), color-mix(in srgb, var(--theme-success) 55%, white 45%));
}

.package-active-empty {
    margin: 0;
    padding: 1rem;
    border-radius: 12px;
    border: 1px dashed var(--theme-border-strong);
    background: color-mix(in srgb, var(--theme-surface-alt) 75%, var(--theme-surface) 25%);
    color: var(--theme-text-dim);
}

.package-activation-user {
    display: grid;
    gap: 0.18rem;
}

.package-activation-user strong {
    color: var(--theme-text);
}

.package-activation-user span,
.package-activation-muted {
    color: var(--theme-text-dim);
    font-size: 0.88rem;
}

.package-activation-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    padding: 0.36rem 0.7rem;
    border-radius: 999px;
    border: 1px solid #bf7b0f;
    background: linear-gradient(180deg, #ffe9b5, #efb244);
    color: #5e3200;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.package-activation-button {
    min-width: 170px;
    color: #fff;
    font-weight: 900;
}

.package-activation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.package-activation-button-approve {
    border: 1px solid color-mix(in srgb, var(--theme-success, #159654) 78%, #000 22%);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--theme-success, #159654) 74%, #fff 26%),
        var(--theme-success, #159654)
    );
    color: #f7fff9;
}

.package-activation-button-approve:hover {
    filter: brightness(1.04);
}

.package-activation-button-cancel {
    border: 1px solid color-mix(in srgb, var(--theme-danger, #b42323) 80%, #000 20%);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--theme-danger, #b42323) 72%, #fff 28%),
        var(--theme-danger, #b42323)
    );
    color: var(--theme-on-danger, #fff);
}

.package-activation-button-cancel:hover {
    filter: brightness(1.05);
}

.package-activation-empty {
    margin: 0;
    color: var(--theme-text-dim);
    font-weight: 700;
}

.admin-public-share-hint {
    margin-top: 0.5rem;
    color: var(--theme-text-dim);
    font-size: 0.92rem;
}

@media (max-width: 700px) {
    .admin-public-share-row {
        grid-template-columns: 1fr;
    }
}

/* Błąd logowania */
.error {
    color: var(--theme-danger);
    margin-bottom: 1rem;
    font-weight: 600;
}

.login-notice {
    color: var(--theme-success);
    margin-bottom: 1rem;
    font-weight: 700;
}

.login-divider {
    position: relative;
    margin: 1.35rem 0 1rem;
    text-align: center;
}

.login-reset-summary {
    display: block;
    cursor: pointer;
    list-style: none;
}

.login-reset-summary::-webkit-details-marker {
    display: none;
}

.login-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid var(--theme-border);
}

.login-divider span {
    position: relative;
    display: inline-block;
    padding: 0 0.8rem;
    background: var(--theme-surface-glass);
    color: var(--theme-muted);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.login-reset-summary span {
    transition:
        color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.login-reset-summary:hover span,
.login-reset-summary:focus-visible span {
    color: var(--theme-text);
    background: var(--theme-surface-alt);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-accent) 16%, transparent 84%);
}

.login-reset-summary:focus-visible {
    outline: none;
}

.login-reset-disclosure {
    margin-top: 0.2rem;
}

.login-reset-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.22s ease;
}

.login-reset-disclosure[open] .login-reset-panel {
    grid-template-rows: 1fr;
}

.login-reset-panel > * {
    min-height: 0;
    overflow: hidden;
}

.login-reset-box {
    margin-top: 0.35rem;
    padding: 1rem 1rem 1.1rem;
    border-radius: 12px;
    border: 2px solid var(--theme-border);
    background: var(--theme-surface-alt);
    text-align: left;
}

.login-reset-box h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.login-reset-copy {
    margin: 0 0 0.9rem;
    color: var(--theme-text-dim);
    line-height: 1.5;
    text-align: left;
}

/* Stylowy wybór motywu */
.theme-combo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.9rem;
    padding: 0.3rem 0.42rem;
    border-radius: 999px;
    border: 1px solid var(--theme-border);
    background: var(--theme-surface-glass);
    backdrop-filter: blur(8px);
}

.theme-combo-label {
    margin-left: 0.3rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--theme-muted);
    white-space: nowrap;
}

.theme-combo-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.theme-combo-wrap::after {
    content: 'v';
    position: absolute;
    right: 0.66rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.66rem;
    color: var(--theme-muted);
    pointer-events: none;
}

.theme-combo-select {
    appearance: none;
    border: 1px solid var(--theme-border-strong);
    border-radius: 999px;
    background: var(--theme-surface);
    color: var(--theme-text);
    padding: 0.36rem 1.55rem 0.36rem 0.78rem;
    line-height: 1.1;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.theme-combo-select:hover {
    transform: translateY(-1px);
}

.theme-combo-select:focus {
    outline: none;
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px var(--theme-focus-ring);
}

.tm-matches-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.tm-matches-toolbar-main {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
}

.tm-matches-toolbar-main .admin-public-share-hint {
    margin: 0;
}

.tournament-summary-side {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    margin-left: auto;
}

.tournament-summary-status {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
}

.tournament-refresh-panel {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    padding: 0.72rem 0.82rem;
    border: 1px solid var(--theme-border);
    border-radius: 16px;
    background: linear-gradient(135deg, var(--theme-surface), var(--theme-surface-alt));
}

.tournament-refresh-label {
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--theme-muted);
    font-weight: 700;
}

.tournament-refresh-note {
    margin: 0;
    font-size: 0.72rem;
    color: var(--theme-muted);
}

.tournament-refresh-controls {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.tournament-refresh-combo .theme-combo-select {
    min-width: 96px;
}

.tournament-refresh-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.82rem 0.3rem 0.42rem;
    border-radius: 999px;
    border: 1px solid var(--theme-border-strong);
    background: var(--theme-surface);
    color: var(--theme-text);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tournament-refresh-toggle:hover {
    background: var(--theme-surface-alt);
}

.tournament-refresh-toggle:focus-visible {
    outline: none;
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px var(--theme-focus-ring);
}

.tournament-refresh-toggle:disabled,
.tournament-refresh-combo .theme-combo-select:disabled {
    cursor: not-allowed;
    opacity: 0.68;
    transform: none;
}

.tournament-refresh-toggle:disabled:hover,
.tournament-refresh-combo .theme-combo-select:disabled:hover {
    transform: none;
}

.tournament-refresh-toggle-track {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 42px;
    height: 24px;
    padding: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--theme-border) 76%, var(--theme-surface) 24%);
    transition: background 0.2s ease;
}

.tournament-refresh-toggle-thumb {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--theme-surface-glass);
    box-shadow: 0 2px 6px -3px var(--theme-overlay);
    transition: transform 0.2s ease;
}

.tournament-refresh-toggle.is-enabled {
    border-color: color-mix(in srgb, var(--theme-accent) 42%, var(--theme-border-strong) 58%);
    background: color-mix(in srgb, var(--theme-accent) 12%, var(--theme-surface) 88%);
    color: var(--theme-accent-hover);
}

.tournament-refresh-toggle.is-enabled .tournament-refresh-toggle-track {
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-hover));
}

.tournament-refresh-toggle.is-enabled .tournament-refresh-toggle-thumb {
    transform: translateX(18px);
}

.tournament-refresh-toggle.is-disabled {
    color: var(--theme-muted);
}

@media (max-width: 720px) {
    .tournament-summary-side,
    .tournament-summary-status,
    .tournament-refresh-panel {
        align-items: flex-start;
    }

    .tournament-summary-side {
        width: 100%;
        margin-left: 0;
    }

    .tournament-refresh-panel {
        width: 100%;
    }

    .tournament-refresh-controls {
        width: 100%;
        justify-content: flex-start;
    }

    .tournament-refresh-combo {
        flex: 1 1 140px;
    }

    .tournament-refresh-combo .theme-combo-select {
        width: 100%;
    }

    .tournament-summary-status {
        align-items: flex-start;
    }
}

/* Powrót */
.back-link {
    margin-top: 1rem;
}

.back-link a {
    opacity: 0.8;
}

.back-link a:hover {
    opacity: 1;
}

.auth-link-actions {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-items: center;
}

.back-link--button {
    margin-top: 0;
    display: flex;
    justify-content: center;
}

.login-container.login-container-register .back-link--button {
    justify-content: flex-start;
}

.back-link--button a,
.auth-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: min(100%, 20rem);
    min-height: 2.9rem;
    padding: 0.72rem 1rem;
    border: 2px solid color-mix(in srgb, var(--theme-accent) 42%, var(--theme-border-strong) 58%);
    border-radius: 12px;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--theme-surface-alt) 68%, var(--theme-accent) 32%) 0%,
        color-mix(in srgb, var(--theme-surface) 62%, var(--theme-accent) 38%) 100%
    );
    color: var(--theme-text);
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    opacity: 1;
    box-shadow:
        0 12px 24px -18px var(--theme-overlay),
        inset 0 1px 0 color-mix(in srgb, var(--theme-surface) 65%, transparent 35%);
    transition:
        transform 0.16s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease,
        color 0.18s ease;
}

.back-link--button a:hover,
.auth-link-button:hover {
    transform: translateY(-1px);
    border-color: var(--theme-accent);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--theme-surface-soft) 42%, var(--theme-accent) 58%) 0%,
        color-mix(in srgb, var(--theme-surface-alt) 28%, var(--theme-accent) 72%) 100%
    );
    color: var(--theme-on-accent, #fff);
    box-shadow: 0 16px 28px -18px var(--theme-focus-glow, var(--theme-overlay));
}

.back-link--button a:focus-visible,
.auth-link-button:focus-visible {
    outline: 2px solid var(--theme-focus-glow, var(--theme-accent));
    outline-offset: 2px;
}

.back-link--button a.auth-link-button--subtle,
.auth-link-button--subtle {
    border-color: var(--theme-border-strong);
    background: linear-gradient(180deg, var(--theme-surface-alt) 0%, var(--theme-surface) 100%);
    color: var(--theme-text-dim);
    box-shadow: 0 10px 22px -18px var(--theme-overlay);
}

.back-link--button a.auth-link-button--subtle:hover,
.auth-link-button--subtle:hover {
    border-color: var(--theme-accent);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--theme-surface-alt) 82%, var(--theme-accent) 18%) 0%,
        color-mix(in srgb, var(--theme-surface) 76%, var(--theme-accent) 24%) 100%
    );
    color: var(--theme-text);
}

@media (max-width: 700px) {
    .auth-link-actions {
        justify-items: stretch;
    }

    .back-link--button,
    .login-container.login-container-register .back-link--button {
        justify-content: stretch;
    }

    .back-link--button a,
    .auth-link-button {
        width: 100%;
    }
}

/* Animacje */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.link-box {
    padding: 1rem 1.2rem;
    border-radius: 10px;
    margin-top: 1rem;
    background: var(--theme-surface-glass);
    border: 2px solid var(--theme-border);
    transition: 0.2s ease;
}

.link-box a {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
}

.admin-header {
    padding: 1.5rem;
    background: var(--theme-surface-alt);
    border-bottom: 2px solid var(--theme-border-strong);
}

.admin-menu {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.menu-tile {
    padding: 0.8rem 1.2rem;
    background: var(--theme-surface-muted);
    border: 2px solid var(--theme-border-strong);
    border-radius: 10px;
    text-decoration: none;
    color: var(--theme-text);
    transition: 0.2s ease;
}

.menu-tile:hover {
    transform: scale(1.05);
    background: var(--theme-tile-hover);
}

.menu-tile.danger {
    background: var(--theme-warning-bg);
    border-color: var(--theme-warning-border);
    color: var(--theme-warning-text);
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    cursor: pointer;
    font-size: 20px;
    user-select: none;
    opacity: 0.6;
    transition: 0.2s;
}

.toggle-password:hover {
    opacity: 1;
}

/* dodawanie turnieju*/
/* --- FORMULARZE ADMINA --- */

.form-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 30px;
    margin-top: 20px;
}

.form-card > fieldset {
    grid-column: 1 / -1;
    min-width: 0;
    min-inline-size: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.form-card label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    color: var(--theme-text);
    gap: 6px;
}

.form-card input,
.form-card select,
.form-card textarea {
    padding: 10px 12px;
    border-radius: 6px;
    border: 2px solid var(--theme-border);
    background: var(--theme-surface);
    color: var(--theme-text);
    font-size: 15px;
}

.form-card textarea {
    min-height: 80px;
    resize: vertical;
}

.tournament-name-description-field,
.tournament-date-range-row {
    grid-column: 1 / -1;
}

.tournament-date-range-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px 30px;
    align-items: start;
}

.tournament-date-range-field {
    min-width: 0;
}

.tournament-date-range-field input {
    width: 100%;
}

.form-card > button.btn {
    grid-column: 1 / -1;
    padding: 12px 20px;
    font-size: 16px;
    margin-top: 10px;
}

.form-buttons {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
}

.form-buttons .btn {
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cycle-edit-main,
.cycle-edit-dates {
    grid-column: 1 / -1;
}

.cycle-edit-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 30px;
    align-items: stretch;
}

.cycle-edit-left-stack {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
}

.cycle-edit-description-label {
    height: 100%;
}

.cycle-edit-description {
    min-height: 0;
    flex: 1;
}

.cycle-edit-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 30px;
    align-items: start;
}

.cycle-edit-dates h3 {
    grid-column: 1 / -1;
    margin: 0;
}

.value-missing {
    color: var(--theme-value-missing);
    font-weight: 600;
}

.btn,
.btn-small {
    --admin-btn-bg-from: var(--theme-accent);
    --admin-btn-bg-to: var(--theme-accent-strong);
    --admin-btn-hover-from: var(--theme-accent-hover);
    --admin-btn-hover-to: var(--theme-accent);
    --admin-btn-border: var(--theme-border-strong);
    --admin-btn-color: var(--theme-on-accent, #fff);
    --admin-btn-shadow: color-mix(in srgb, var(--theme-focus-ring) 68%, transparent 32%);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.52rem 0.95rem;
    border: 1px solid var(--admin-btn-border);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--admin-btn-bg-from) 0%, var(--admin-btn-bg-to) 100%);
    color: var(--admin-btn-color);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.15;
    text-decoration: none;
    box-shadow: 0 4px 12px var(--admin-btn-shadow);
}

.btn:hover {
    background: linear-gradient(180deg, var(--admin-btn-hover-from) 0%, var(--admin-btn-hover-to) 100%);
    color: var(--admin-btn-color);
    transform: translateY(-1px);
}

.btn:focus-visible {
    outline: 2px solid var(--theme-focus);
    outline-offset: 2px;
}

.btn:disabled,
.btn[aria-disabled="true"],
.btn-small:disabled,
.btn-small[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.62;
    transform: none;
    box-shadow: none;
}

.btn:disabled:hover,
.btn[aria-disabled="true"]:hover,
.btn-small:disabled:hover,
.btn-small[aria-disabled="true"]:hover {
    background: linear-gradient(180deg, var(--admin-btn-bg-from) 0%, var(--admin-btn-bg-to) 100%);
    color: var(--admin-btn-color);
    transform: none;
}

.btn-secondary,
.btn-admin-create {
    --admin-btn-bg-from: var(--theme-accent);
    --admin-btn-bg-to: var(--theme-accent-strong);
    --admin-btn-hover-from: var(--theme-accent-hover);
    --admin-btn-hover-to: var(--theme-accent);
    --admin-btn-border: var(--theme-border-strong);
    --admin-btn-color: var(--theme-on-accent, #fff);
    --admin-btn-shadow: color-mix(in srgb, var(--theme-focus-ring) 68%, transparent 32%);
}

.btn-warning {
    --admin-btn-bg-from: color-mix(in srgb, var(--theme-warning-bg) 72%, #fff 28%);
    --admin-btn-bg-to: color-mix(in srgb, var(--theme-warning-border) 78%, var(--theme-warning-bg) 22%);
    --admin-btn-hover-from: color-mix(in srgb, var(--theme-warning-border) 86%, #fff 14%);
    --admin-btn-hover-to: color-mix(in srgb, var(--theme-warning-border) 92%, var(--theme-warning-bg) 8%);
    --admin-btn-border: var(--theme-warning-border);
    --admin-btn-color: var(--theme-warning-text);
    --admin-btn-shadow: color-mix(in srgb, var(--theme-warning-border) 34%, transparent 66%);
}

.btn-danger,
.btn-small-danger {
    --admin-btn-bg-from: color-mix(in srgb, var(--theme-danger) 76%, #fff 24%);
    --admin-btn-bg-to: var(--theme-danger);
    --admin-btn-hover-from: color-mix(in srgb, var(--theme-danger) 88%, #fff 12%);
    --admin-btn-hover-to: color-mix(in srgb, var(--theme-danger) 90%, #000 10%);
    --admin-btn-border: color-mix(in srgb, var(--theme-danger) 82%, #000 18%);
    --admin-btn-color: var(--theme-on-danger, #fff);
    --admin-btn-shadow: color-mix(in srgb, var(--theme-danger) 34%, transparent 66%);
}

.btn-danger-soft {
    --admin-btn-bg-from: color-mix(in srgb, var(--theme-surface-soft) 74%, var(--theme-danger) 26%);
    --admin-btn-bg-to: color-mix(in srgb, var(--theme-surface) 82%, var(--theme-danger) 18%);
    --admin-btn-hover-from: color-mix(in srgb, var(--theme-surface) 72%, var(--theme-danger) 28%);
    --admin-btn-hover-to: color-mix(in srgb, var(--theme-surface-alt) 78%, var(--theme-danger) 22%);
    --admin-btn-border: color-mix(in srgb, var(--theme-danger) 72%, var(--theme-border) 28%);
    --admin-btn-color: var(--theme-danger);
    --admin-btn-shadow: color-mix(in srgb, var(--theme-danger) 18%, transparent 82%);
}

.admin-form-notice {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--theme-border-strong);
    background: var(--theme-surface-alt);
    color: var(--theme-text);
    font-weight: 600;
}

.admin-form-notice-warning {
    border-color: var(--theme-warning-border);
    background: color-mix(in srgb, var(--theme-warning-bg) 70%, var(--theme-surface) 30%);
    color: var(--theme-warning-text);
}

.admin-form-notice-error {
    border-color: var(--theme-danger);
    background: color-mix(in srgb, var(--theme-danger) 10%, var(--theme-surface) 90%);
    color: var(--theme-danger);
}

.btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.38rem 0.72rem;
    border-radius: 7px;
    border: 1px solid var(--admin-btn-border);
    background: linear-gradient(180deg, var(--admin-btn-bg-from) 0%, var(--admin-btn-bg-to) 100%);
    color: var(--admin-btn-color);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 3px 10px var(--admin-btn-shadow);
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.btn-small:hover {
    background: linear-gradient(180deg, var(--admin-btn-hover-from) 0%, var(--admin-btn-hover-to) 100%);
    color: var(--admin-btn-color);
    transform: translateY(-1px);
}

.btn-small:focus-visible {
    outline: 2px solid var(--theme-focus);
    outline-offset: 2px;
}

.btn-small-link-danger {
    --admin-btn-bg-from: color-mix(in srgb, var(--theme-surface) 80%, var(--theme-danger) 20%);
    --admin-btn-bg-to: color-mix(in srgb, var(--theme-surface-soft) 68%, var(--theme-danger) 32%);
    --admin-btn-hover-from: color-mix(in srgb, var(--theme-danger) 76%, #fff 24%);
    --admin-btn-hover-to: var(--theme-danger);
    --admin-btn-border: color-mix(in srgb, var(--theme-danger) 74%, var(--theme-border) 26%);
    --admin-btn-color: var(--theme-danger);
    --admin-btn-shadow: color-mix(in srgb, var(--theme-danger) 16%, transparent 84%);
}

.btn-small-link-danger:hover {
    color: var(--theme-on-danger, #fff);
}

.admin-action-separator {
    opacity: 0.4;
    margin: 0 6px;
}

.modal-delete-text {
    margin-bottom: 20px;
}

.modal-actions-inline {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Tabela turniejow */
.tournaments-col-date,
.tournaments-cell-date,
.tournaments-col-status,
.tournaments-cell-status,
.tournaments-col-actions,
.tournaments-cell-actions {
    white-space: nowrap;
}

.tournaments-col-date,
.tournaments-cell-date {
    width: 1%;
}

.tournaments-col-status,
.tournaments-cell-status {
    width: 1%;
}

.tournaments-col-name,
.tournaments-cell-name {
    width: 24%;
}

.tournaments-cell-name {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tournaments-cell-name b {
    display: block;
}

.tournaments-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.29rem;
}

.tournaments-actions .btn-small {
    min-width: 4.5rem;
    padding: 0.27rem 0.45rem;
    font-size: 0.74rem;
}

.tournaments-actions .btn-small:not(.btn-small-link-danger):not(.btn-small-danger) {
    --admin-btn-bg-from: var(--theme-surface-alt);
    --admin-btn-bg-to: color-mix(in srgb, var(--theme-surface-soft) 78%, var(--theme-surface) 22%);
    --admin-btn-hover-from: color-mix(in srgb, var(--theme-surface-soft) 72%, var(--theme-accent) 28%);
    --admin-btn-hover-to: color-mix(in srgb, var(--theme-surface) 74%, var(--theme-accent) 26%);
    --admin-btn-border: color-mix(in srgb, var(--theme-border-strong) 78%, var(--theme-border) 22%);
    --admin-btn-color: var(--theme-text);
    --admin-btn-shadow: color-mix(in srgb, var(--theme-border-strong) 16%, transparent 84%);
}

.tournaments-table th.table-sort-header {
    cursor: pointer;
    user-select: none;
    transition: color 0.18s ease;
}

.tournaments-table th.table-sort-header:hover,
.tournaments-table th.table-sort-header.is-active {
    color: var(--theme-accent, var(--theme-text));
}

.tournaments-table th.table-sort-header:focus-visible {
    outline: 2px solid var(--theme-focus-ring);
    outline-offset: -2px;
}

.manual-tests-page {
    display: grid;
    gap: 16px;
}

.manual-tests-intro-card,
.manual-tests-content-card {
    display: grid;
    gap: 14px;
}

.manual-tests-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.manual-tests-toolbar h1 {
    margin: 0;
}

.manual-tests-lead {
    margin: 8px 0 0;
    color: var(--theme-text-muted);
}

.manual-tests-toolbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.manual-tests-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0;
    color: var(--theme-text-muted);
    font-size: 0.92rem;
}

.manual-tests-pre {
    margin: 0;
    padding: 18px;
    border: 1px solid var(--theme-border-strong);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--theme-surface) 0%, var(--theme-surface-alt) 100%);
    color: var(--theme-text);
    font: 500 0.92rem/1.55 Consolas, "Courier New", monospace;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--theme-focus-ring) 34%, transparent 66%);
}

@media (max-width: 760px) {
    .manual-tests-pre {
        padding: 14px;
        font-size: 0.84rem;
        line-height: 1.5;
    }
}

.tournaments-table .sort-arrow {
    display: inline-block;
    min-width: 1rem;
    margin-left: 0.2rem;
}

.tournament-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    padding: 0.2rem 0.52rem;
    border-radius: 999px;
    border: 1px solid var(--theme-border);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.tournament-status-badge.is-open {
    background: var(--theme-status-blue-bg);
    border-color: var(--theme-accent-strong);
    color: var(--theme-accent-strong);
}

.tournament-status-badge.is-closed {
    background: var(--theme-status-green-bg);
    border-color: var(--theme-success);
    color: var(--theme-success);
}

.tournament-status-time {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.7rem;
    color: var(--theme-muted);
}

/* Sekcja 4 - generowanie drabinki */
.tm-bracket-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    margin-top: 0.35rem;
}

.tm-bracket-container {
    margin-top: 20px;
}

.tm-bracket-status {
    font-weight: 600;
}

.tm-bracket-status-muted {
    color: var(--theme-muted);
}

.tm-bracket-status-error {
    color: var(--theme-value-missing);
}

.tm-bracket-status-spaced {
    margin-top: 16px;
}

.tm-manage-settings-summary {
    font-family: Consolas, 'Courier New', monospace;
    text-transform: uppercase;
}

/* Mobile */
@media (max-width: 700px) {
    main.admin-content.admin-content--wide {
        width: 100%;
        min-width: 100%;
    }

    main.admin-content.admin-content--wide > .card {
        min-width: 100%;
    }

    .form-card {
        grid-template-columns: 1fr;
    }

    .cycle-edit-top-grid,
    .cycle-edit-dates {
        grid-template-columns: 1fr;
    }

    .tournament-date-range-row {
        grid-template-columns: 1fr;
    }

    .tournament-edit-layout,
    .tournament-package-summary-grid--compact {
        grid-template-columns: 1fr;
    }
}

/* dodawanie zawodników w turnieju */
.players-box {
    border: 2px solid var(--theme-border-strong);
    padding: 15px;
    border-radius: 8px;
    margin-top: 25px;
    background: var(--theme-players-box-bg);
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 15px;
}

.player-item {
    padding: 6px 10px;
    border: 2px solid var(--theme-border);
    border-radius: 4px;
    cursor: pointer;

    /* animacja */
    opacity: 1;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.player-item.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.input-filter {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
}

.players-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 10px;
}

.players-toolbar-field {
    display: grid;
    gap: 6px;
}

.players-toolbar-field label {
    font-size: 0.82rem;
    font-weight: 700;
}

.players-toolbar-field--search .input-filter {
    margin-bottom: 0;
}

.players-toolbar-field--per-page {
    min-width: 110px;
}

.players-toolbar-actions {
    display: flex;
    align-items: end;
}

.players-pagination-summary {
    margin: 0 0 12px;
    color: var(--theme-muted);
    font-size: 0.92rem;
}

.players-focus-note {
    margin: 0 0 12px;
    color: var(--theme-accent, var(--theme-text));
    font-size: 0.92rem;
    font-weight: 700;
}

.players-table th.players-table-sort {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.18s ease;
}

.players-table th.players-table-sort:hover,
.players-table th.players-table-sort.is-active {
    color: var(--theme-accent, var(--theme-text));
}

.players-table th.players-table-sort:focus-visible {
    outline: 2px solid var(--theme-focus-ring);
    outline-offset: -2px;
}

.players-table .sort-arrow {
    display: inline-block;
    min-width: 1rem;
    margin-left: 0.2rem;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--theme-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal.hidden {
    display: none;
}

.modal-content {
    padding: 20px 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;

    /* LIGHT MODE */
    background: var(--theme-surface-glass);
    border: 2px solid var(--theme-border);
    color: var(--theme-text);
}

/* przyciski akcji – DODAJ */
.player-action-btn.add {
    margin-left: 6px;
    padding: 4px 8px;
    font-size: 0.8em;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    color: var(--theme-on-success, #fff);
    background: var(--theme-success);
}
.player-action-btn.add:hover {
    filter: brightness(1.08);
}

/* przyciski akcji – USUŃ */
.player-action-btn.remove {
    margin-left: 6px;
    padding: 4px 8px;
    font-size: 0.8em;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    color: var(--theme-on-danger, #fff);
    background: var(--theme-danger);
}
.player-action-btn.remove:hover {
    filter: brightness(1.08);
}

.player-action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    filter: none;
}


#playersTableBody tr {
    opacity: 1;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#playersTableBody tr.hidden {
    opacity: 0;
    transform: scale(0.97);
    pointer-events: none;
}

.player-row.is-recently-added {
    animation: player-row-added-flash 2.2s ease;
}

@keyframes player-row-added-flash {
    0% {
        background: rgba(62, 166, 89, 0.26);
    }

    100% {
        background: transparent;
    }
}

.players-empty-state {
    padding: 14px 12px;
    text-align: center;
    color: var(--theme-muted);
}

.tm-player-create-modal {
    z-index: 1200;
}

.tm-player-create-modal__content {
    width: min(92vw, 560px);
    max-width: 560px;
    max-height: min(88vh, 760px);
    overflow-y: auto;
    padding: 22px 24px 24px;
    text-align: left;
}

.tm-player-create-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.tm-player-create-modal__header h3 {
    margin: 0;
}

.tm-player-create-modal__close {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--theme-text);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.tm-player-create-form {
    gap: 0.9rem;
}

.tm-player-create-form .form-buttons {
    margin-top: 0.35rem;
}


.modal-sub {
    color: var(--theme-muted);
    font-size: 0.95em;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 2px solid var(--theme-border);
    border-radius: 8px;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.tournament-edit-layout {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.92fr);
    gap: 20px 24px;
    align-items: start;
}

.tournament-edit-column {
    display: grid;
    min-width: 0;
    gap: 18px;
    align-content: start;
}

.tournament-edit-column .form-section {
    margin-bottom: 0;
}

.tournament-package-summary--compact {
    padding: 12px 16px;
}

.tournament-package-summary--compact h3 {
    margin-bottom: 10px;
    font-size: 0.88rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tournament-package-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem 1rem;
}

.tournament-package-summary-grid--compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem 0.7rem;
}

.tournament-package-summary-grid span {
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    background: var(--theme-surface);
}

.tournament-package-summary-grid--compact span {
    padding: 0.55rem 0.7rem;
    font-size: 0.88rem;
}

.tournament-parameters-section {
    height: 100%;
}

.tournament-player-limit-note {
    margin-bottom: 0.85rem;
    padding: 0.8rem 0.95rem;
    border-radius: 8px;
    border: 1px solid var(--theme-border-strong);
    background: var(--theme-surface);
}

.tournament-player-limit-note.is-limit-reached {
    border-color: var(--theme-danger);
    background: color-mix(in srgb, var(--theme-danger) 10%, var(--theme-surface) 90%);
}

.tournament-player-limit-warning {
    display: block;
    margin-top: 0.45rem;
    color: var(--theme-danger);
    font-weight: 700;
}

.tournament-player-limit-warning.is-hidden {
    display: none;
}

.players-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.players-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--theme-border-strong);
    border-radius: 8px;
    background: var(--theme-surface);
    color: var(--theme-text);
    text-decoration: none;
    font-weight: 700;
}

.players-pagination-link.is-active {
    border-color: var(--theme-accent, var(--theme-border-strong));
    background: color-mix(in srgb, var(--theme-accent, #1f6feb) 14%, var(--theme-surface) 86%);
}

@media (max-width: 900px) {
    .players-toolbar {
        grid-template-columns: 1fr;
    }

    .players-toolbar-actions {
        align-items: stretch;
    }

    .package-active-item-aside {
        justify-items: start;
    }

    .package-active-stats-grid {
        grid-template-columns: 1fr;
    }
}

.tm-edit-param-group {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    background: linear-gradient(145deg, var(--theme-surface-soft), var(--theme-surface));
    transition: border-color 0.2s ease, filter 0.2s ease;
}

.tm-edit-param-group:last-of-type {
    margin-bottom: 20px;
}

.tm-edit-param-group-title {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--theme-text-subtle);
}

.tm-edit-param-group label + label {
    margin-top: 10px;
}

.tm-edit-param-group--groups {
    border-color: var(--theme-border);
    background: linear-gradient(145deg, var(--theme-surface-soft), var(--theme-surface));
}

.tm-edit-param-group--main {
    border-color: var(--theme-border-strong);
    background: linear-gradient(145deg, var(--theme-surface-muted), var(--theme-surface-soft));
}

.tm-edit-param-group--consolation {
    border-color: var(--theme-border);
    background: linear-gradient(145deg, var(--theme-surface-alt), var(--theme-surface-soft));
}

.tm-edit-param-group label.is-disabled {
    opacity: 0.68;
}

.tm-edit-param-group--disabled {
    filter: saturate(0.86);
}

.tm-edit-param-group select:disabled,
.tm-edit-param-group input:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.groups-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
	 
}

@media (max-width: 980px) {
    .groups-container {
        grid-template-columns: 1fr;
    }
}

.group-box {
    border: 2px solid var(--theme-border-strong);
    padding: 15px;
    border-radius: 8px;
    background: var(--theme-surface);
    color: var(--theme-text);
}
 
.group-box h3 {
    margin-top: 0;
    color: var(--theme-accent);
}

.group-box ul li {
    color: var(--theme-text);
	list-style: none;
	margin: 4px 0;

}

#group-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--theme-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#group-modal-box {
    background: var(--theme-modal-bg);
    color: var(--theme-text);
    padding: 30px 40px;
    border-radius: 10px;
    text-align: center;
    width: 350px;
    box-shadow: 0 0 20px var(--theme-overlay-strong);
}

#group-modal-box h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

#group-modal-box .btn {
    padding: 10px 20px;
    font-size: 16px;
}



.group-table {
    width: 100%;
	border: 2px solid var(--theme-border-strong);
	border-collapse: collapse;
    border-radius: 10px;
	overflow: hidden;
    margin-top: 10px;
}
.group-table th, .group-table td {
    border: 2px solid var(--theme-border);
    padding: 6px 8px;
    text-align: center;
}
/* wyniki meczów */
.groups-container-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.group-matches-box {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}
.group-matches-box.visible {
    opacity: 1;
}
.match-box {
    margin: 8px 0;
    padding: 8px;
    background: var(--theme-surface);
    border: 2px solid var(--theme-border);
    border-radius: 6px;
}
.match-box input[type="text"] {
    width: 40px;
    text-align: center;
}
.match-box input[type="number"] {
    width: 50px;
}

.open-matches-modal {
    margin-left: 8px;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 999px;
    border: 1px solid var(--theme-border-strong);
    background: var(--theme-surface-muted);
    color: var(--theme-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    font-weight: 700;
    transition: transform 0.18s ease, filter 0.18s ease, background-color 0.18s ease;
}

.open-matches-modal:hover {
    transform: translateY(-1px);
}

.open-matches-modal-count,
.open-matches-modal-state {
    font-weight: 700;
}

.open-matches-modal.is-open {
    background: var(--theme-accent);
    color: var(--theme-on-accent, #fff);
    border-color: var(--theme-accent);
}

.open-matches-modal.is-closed {
    background: var(--theme-success);
    color: var(--theme-on-success, #fff);
    border-color: var(--theme-success);
}

.admin-message-modal {
    z-index: 1000000;
}

.admin-message-modal__content {
    width: min(560px, calc(100vw - 2rem));
    padding: 1.35rem 1.35rem 1.1rem;
    border-width: 2px;
}

.admin-message-modal__header {
    margin-bottom: 0.8rem;
}

.admin-message-modal__title {
    display: block;
    font-size: 1.08rem;
    line-height: 1.35;
}

.admin-message-modal__message {
    line-height: 1.6;
    color: var(--theme-text);
    white-space: pre-line;
}

.admin-message-modal__actions {
    margin-top: 1rem;
    justify-content: flex-end;
}

.admin-message-modal__actions[hidden] {
    display: none;
}

.admin-message-modal.is-warning .admin-message-modal__content {
    border-color: var(--theme-warning-border);
    box-shadow: 0 10px 28px color-mix(in srgb, var(--theme-warning-border) 25%, transparent 75%);
}

.admin-message-modal.is-warning .admin-message-modal__title {
    color: var(--theme-warning-text);
}

.admin-message-modal.is-error .admin-message-modal__content {
    border-color: var(--theme-danger);
    box-shadow: 0 10px 28px color-mix(in srgb, var(--theme-danger) 20%, transparent 80%);
}

.admin-message-modal.is-error .admin-message-modal__title {
    color: var(--theme-danger);
}

.admin-message-modal.is-danger .admin-message-modal__content {
    border-color: var(--theme-danger);
    box-shadow: 0 10px 28px color-mix(in srgb, var(--theme-danger) 24%, transparent 76%);
}

.admin-message-modal.is-danger .admin-message-modal__title {
    color: var(--theme-danger);
}

.admin-message-modal.is-success .admin-message-modal__content {
    border-color: var(--theme-success);
}

.admin-message-modal.is-success .admin-message-modal__title {
    color: var(--theme-success);
}

.admin-message-modal.is-question .admin-message-modal__content {
    border-color: var(--theme-accent-strong);
}

.admin-message-modal.is-question .admin-message-modal__title,
.admin-message-modal.is-info .admin-message-modal__title {
    color: var(--theme-accent-strong);
}

.admin-message-modal.is-progress .admin-message-modal__content {
    border-color: var(--theme-accent-strong);
    box-shadow: 0 12px 30px color-mix(in srgb, var(--theme-accent-strong) 20%, transparent 80%);
}

.admin-message-modal.is-progress .admin-message-modal__title {
    color: var(--theme-accent-strong);
}

.admin-message-modal.is-progress .admin-message-modal__message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    text-align: center;
}

.admin-message-modal.is-progress .admin-message-modal__message::before {
    content: '';
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    border: 3px solid color-mix(in srgb, var(--theme-accent-strong) 22%, transparent 78%);
    border-top-color: var(--theme-accent-strong);
    animation: admin-message-modal-spin 0.85s linear infinite;
}

@keyframes admin-message-modal-spin {
    to {
        transform: rotate(360deg);
    }
}

.gm20260303-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--theme-overlay-strong);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    padding: 1rem;
    transition: opacity .25s ease-in-out;
}

.gm20260303-overlay.visible {
    display: flex;
    opacity: 1;
}

.gm20260303-window {
    background: var(--theme-modal-bg);
    padding: 1.35rem 1.35rem 1.1rem;
    width: min(560px, calc(100vw - 2rem));
    max-height: min(82vh, 920px);
    overflow-y: auto;
    border-radius: 14px;
    position: relative;
    border: 2px solid var(--theme-accent-strong);
    box-shadow: 0 10px 28px color-mix(in srgb, var(--theme-accent-strong) 18%, transparent 82%);
    color: var(--theme-text);
    font-size: 14px;
}

.gm20260303-window h2 {
    color: var(--theme-accent-strong);
}

.gm20260303-window-title {
    margin-top: 0;
    margin-bottom: 0.9rem;
    padding-right: 2.5rem;
    font-size: 1.08rem;
    line-height: 1.35;
}

.gm20260303-close {
    position: absolute;
    right: 0.95rem;
    top: 0.95rem;
    background: var(--theme-surface-muted);
    border: 2px solid var(--theme-border);
    font-size: 18px;
    cursor: pointer;
    border-radius: 999px;
    width: 2rem;
    height: 2rem;
    line-height: 1;
    text-align: center;
    color: var(--theme-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gm20260303-match {
    border: 2px solid var(--theme-border);
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 8px;
    background: var(--theme-surface-soft);
}

.gm20260303-match-finished {
    opacity: 1;
    border-color: var(--theme-warning-border);
    background: var(--theme-warning-bg);
}

.gm20260303-match-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

.gm20260303-match strong {
    color: var(--theme-accent);
}

.gm20260303-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.gm20260303-match input[type="text"],
.gm20260303-match input[type="number"] {
    width: 36px;
    text-align: center;
    color: var(--theme-text);
    border: 2px solid var(--theme-border);
    background: var(--theme-surface);
    border-radius: 4px;
}

.gm20260303-btn-start {
    background: var(--theme-success);
    color: var(--theme-on-success, #fff);
    border: none;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.gm20260303-btn-save {
    background: var(--theme-accent);
    color: var(--theme-on-accent, #fff);
    border: none;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.gm20260303-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    border: 2px solid var(--theme-border);
    font-size: 14px;
}

/*SEKCJA 3 AKTUALNE MECZE */
.gm20260303-live-header {
    display: grid;
    grid-template-columns: 0.2fr 1.4fr 2fr 2fr 0.6fr 2.6fr 1.5fr;
    gap: 8px;
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 13px;
}

.gm20260303-live-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.gm20260303-section3-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.gm20260303-live-matches-wrap {
    transition: max-height 0.22s ease, opacity 0.22s ease;
}

#gm20260303-section3-card.is-collapsed .gm20260303-live-matches-wrap {
    max-height: 240px;
    overflow: auto;
}

.gm20260303-row {
    display: grid;
    grid-template-columns: 0.2fr 1.4fr 2fr 2fr 0.6fr 2.6fr 1.5fr;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 2px solid var(--theme-border);
    font-size: 13px;
    text-align: right;
}

.gm20260303-row > div:first-child {
    text-align: left;
}

.gm20260303-group-label {
    font-weight: 700;
    color: var(--theme-warning-text);
    display: block;
    text-align: left;
    font-size: 0.9em;
}

.gm20260303-player-cell {
    font-weight: 700;
    display: block;
    text-align: center;
    font-size: 1.15em;
}

.gm20260303-player-cell-busy {
    background: #fff1c2;
    color: #7a2e00;
    border: 2px solid #f08c00;
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    box-shadow: 0 1px 0 rgba(122, 46, 0, 0.08);
}

.gm20260303-player-busy-note {
    display: block;
    margin-top: 0.28rem;
    font-size: 0.7em;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #9a3412;
}

.gm20260303-finished-label {
    font-weight: 700;
    color: var(--theme-muted);
    display: block;
    text-align: center;
    font-size: 0.9em;
}

.gm20260303-table-label {
    font-weight: 700;
    color: var(--theme-warning-text);
    display: block;
    text-align: center;
    font-size: 0.9em;
}

.gm20260303-table-stack {
    display: grid;
    gap: 6px;
    justify-items: center;
}

.gm20260303-table-caption {
    font-size: 0.82em;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--theme-warning-text);
}

.gm20260303-table-select {
    min-width: 124px;
    max-width: 148px;
    border: 2px solid var(--theme-border);
    border-radius: 8px;
    background: var(--theme-surface);
    color: var(--theme-text);
    padding: 6px 10px;
    font-weight: 700;
    text-align: center;
}

.gm20260303-table-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--theme-focus-ring);
}

.gm20260303-row.gm20260303-row-modal {
    grid-template-columns: minmax(120px, 148px) minmax(140px, 1fr) auto;
    align-items: center;
}

.gm20260303-row-side {
    display: flex;
    justify-content: center;
}

.gm20260303-row-center {
    display: flex;
    justify-content: center;
}

.gm20260303-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.gm20260303-active-match-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.gm20260303-active-match-icon {
    width: 40px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.gm20260303-score-slot {
    display: flex;
    justify-content: center;
}

.gm20260303-hidden-form {
    display: none;
}

.gm20260303-green {
    background: var(--theme-status-green-bg);
    border-color: var(--theme-success);
}

.gm20260303-blue {
    background: var(--theme-status-blue-bg);
    border-color: var(--theme-accent);
}

.gm20260303-black {
    background: var(--theme-warning-bg);
    color: var(--theme-warning-text);
    border-color: var(--theme-warning-border);
}
/* PRZYCISKI W JEDNEJ KOLUMNIE, ALE NIE ROZPYCHAJĄ GRIDU */
.gm20260303-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    align-items: center;

}


.gm20260303-btn {
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    font-size: 12px;
    display: inline-block;


}

.gm20260303-btn-start {
    background: var(--theme-success);
    color: var(--theme-on-success, #fff);
}

.gm20260303-btn-save {
    background: var(--theme-accent);
    color: var(--theme-on-accent, #fff);
}

.gm20260303-btn-edit {
    background: var(--theme-warning-border);
    color: var(--theme-on-warning, #fff);
}

.gm20260303-btn-cancel {
    background: var(--theme-surface-muted);
    color: var(--theme-text);
    border: 1px solid var(--theme-border);
}

.gm20260303-edit-overlay {
    z-index: 1000000;
}

.gm20260303-edit-window {
    width: min(520px, calc(100vw - 32px));
}

.gm20260303-edit-body {
    display: grid;
    gap: 14px;
}

.gm20260303-edit-note {
    margin: 0;
    color: var(--theme-text-muted);
}

.gm20260303-edit-players {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.gm20260303-edit-player {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 2px solid var(--theme-border);
    border-radius: 10px;
    background: var(--theme-surface-soft);
}

.gm20260303-edit-player-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--theme-accent-strong);
}

.gm20260303-edit-player-score {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--theme-text-muted);
}

.gm20260303-edit-player-score-label {
    font-weight: 600;
}

.gm20260303-edit-player-score-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 2px 8px;
    border: 1px solid color-mix(in srgb, var(--theme-border-strong) 68%, var(--theme-accent) 32%);
    border-radius: 999px;
    background: color-mix(in srgb, var(--theme-surface) 76%, var(--theme-accent) 24%);
    color: var(--theme-text);
    font-weight: 800;
    line-height: 1.1;
}

.gm20260303-edit-form {
    display: grid;
    gap: 14px;
}

.gm20260303-edit-score-row {
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

.gm20260303-edit-table-row {
    display: flex;
    justify-content: center;
}

.gm20260303-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.gm20260303-score-editor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 144px;
}

.gm20260303-score-separator {
    font-weight: 800;
    color: var(--theme-text-muted);
    font-size: 1.26em;
}

.gm20260303-score-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gm20260303-score-trigger {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.14em;
    line-height: 1;
    padding: 0 2px;
    color: var(--theme-text-dim);
}

.gm20260303-score-trigger-a {
    font-weight: 800;
    color: var(--theme-accent-strong);
}

.gm20260303-score-trigger-b {
    font-weight: 700;
    color: var(--theme-text-subtle);
}

.gm20260303-score-trigger:focus {
    outline: none;
    text-shadow: 0 0 4px var(--theme-focus-glow);
}

.gm20260303-score-hint {
    position: absolute;
    top: calc(100% + 4px);
    right: -6px;
    display: none;
    align-items: center;
    gap: 5px;
    padding: 6px 7px;
    border-radius: 999px;
    border: 1px solid var(--theme-border);
    background: var(--theme-popover-bg);
    box-shadow: 0 6px 14px var(--theme-popover-shadow);
    z-index: 40;
}

.gm20260303-score-picker:hover .gm20260303-score-hint,
.gm20260303-score-picker:focus-within .gm20260303-score-hint {
    display: inline-flex;
}

.gm20260303-score-option {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--theme-popover-border);
    background: var(--theme-score-option-bg);
    color: var(--theme-score-option-text);
    font-size: 0.86em;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.gm20260303-score-option:hover {
    background: var(--theme-popover-hover-bg);
    border-color: var(--theme-popover-hover-border);
}

.gm20260303-score-option.is-active {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: var(--theme-score-option-active-text, #fff);
}

.gm20260303-score-option:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--theme-focus-ring);
}

.gm20260303-move-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

.gm20260303-move-picker.is-loading {
    opacity: 0.65;
}

.gm20260303-move-label {
    cursor: pointer;
    transition: color 0.16s ease, text-shadow 0.16s ease;
}

.gm20260303-move-label small {
    transition: color 0.16s ease, text-shadow 0.16s ease, font-weight 0.16s ease;
}

.gm20260303-move-hint {
    position: absolute;
    top: 50%;
    left: calc(100% + 6px);
    transform: translateY(-50%);
    display: none;
    align-items: center;
    gap: 5px;
    padding: 6px 7px;
    border-radius: 999px;
    border: 1px solid var(--theme-border);
    background: var(--theme-popover-bg);
    box-shadow: 0 6px 14px var(--theme-popover-shadow);
    z-index: 45;
}

.gm20260303-move-picker.is-held .gm20260303-move-hint,
.gm20260303-move-picker:focus-within .gm20260303-move-hint {
    display: inline-flex;
}

.gm20260303-move-picker.is-held .gm20260303-move-label,
.gm20260303-move-picker.is-held .gm20260303-move-label small {
    color: var(--theme-accent);
    font-weight: 800;
    text-shadow: 0 0 8px var(--theme-focus-glow);
}

.gm20260303-move-option {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--theme-popover-border);
    background: var(--theme-score-option-bg);
    color: var(--theme-score-option-text);
    font-size: 0.95em;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.gm20260303-move-option:hover {
    background: var(--theme-popover-hover-bg);
    border-color: var(--theme-popover-hover-border);
}

.gm20260303-move-option:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--theme-focus-ring);
}

.gm20260303-move-option:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.group-rank-badge {
    color: var(--theme-warning-text);
    font-weight: 700;
    font-size: 1.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4em;
    height: 1.4em;
    line-height: 1;
    text-align: center;
    background: var(--theme-warning-bg);
    border: 1px solid var(--theme-warning-border);
    border-radius: 50%;
}

/* Team League admin (LIGA DRUZYN) */
.team-league-notice {
    margin-bottom: 1rem;
    font-weight: 700;
}

.team-league-notice-ok {
    border-color: var(--theme-success);
}

.team-league-notice-error {
    border-color: var(--theme-danger);
}

.team-league-hint {
    margin: 0.45rem 0 1rem;
    color: var(--theme-muted);
}

.team-league-system-guide {
    border: 2px solid var(--theme-border);
    border-radius: 10px;
    background: var(--theme-surface-soft);
    padding: 0.8rem;
}

.team-league-system-guide-title {
    font-weight: 800;
    margin-bottom: 0.65rem;
}

.team-league-system-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.65rem;
}

.team-league-system-card {
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    background: var(--theme-surface);
    padding: 0.65rem;
}

.team-league-system-card h4 {
    margin: 0;
    color: var(--theme-accent);
}

.team-league-system-values {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.team-league-system-protocol,
.team-league-system-time {
    margin: 0.42rem 0 0;
    font-size: 0.88rem;
}

.team-league-form-grid {
    display: grid;
    gap: 0.95rem;
}

.team-league-form-grid > label {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-weight: 700;
}

.team-league-form-grid input,
.team-league-form-grid select,
.team-league-context-form input,
.team-league-context-form select,
.team-league-inline-form input {
    padding: 0.62rem 0.7rem;
    border-radius: 8px;
    border: 2px solid var(--theme-border);
    background: var(--theme-surface);
    color: var(--theme-text);
}

.team-league-config-stack {
    display: grid;
    gap: 0.85rem;
}

.team-league-league-box {
    border: 2px solid var(--theme-border);
    border-radius: 10px;
    padding: 0.8rem;
    background: var(--theme-surface-soft);
}

.team-league-league-box legend {
    padding: 0 0.35rem;
    font-weight: 800;
    color: var(--theme-accent);
}

.team-league-league-head {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.team-league-league-head label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-weight: 700;
}

.team-league-group-grid {
    margin-top: 0.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.65rem;
}

.team-league-group-cell {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.65rem;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    background: var(--theme-surface);
    font-weight: 700;
    font-size: 0.92rem;
}

.team-league-context-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
    gap: 0.8rem;
    align-items: end;
}

.team-league-context-form label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-weight: 700;
}

.team-league-context-current {
    margin: 1rem 0;
    padding: 0.75rem;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    background: var(--theme-surface-soft);
}

.team-league-context-system {
    margin: -0.35rem 0 1rem;
    color: var(--theme-muted);
}

.team-league-lock-note {
    margin: -0.15rem 0 1rem;
    padding: 0.72rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--theme-warning-border);
    background: var(--theme-warning-bg);
    color: var(--theme-warning-text);
    font-weight: 700;
}

.team-league-subtitle {
    margin-top: 1.2rem;
}

.team-league-subcard {
    margin-top: 1.1rem;
    border: 2px solid var(--theme-border);
    border-radius: 10px;
    padding: 0.9rem;
    background: var(--theme-surface-soft);
}

.team-league-s2-split-box {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    border: 2px solid var(--theme-border);
    border-radius: 10px;
    padding: 0.85rem;
    background: var(--theme-surface-soft);
    align-items: stretch;
}

.team-league-s2-split-col {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 0.65rem;
}

.team-league-s2-split-col label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-weight: 700;
}

.team-league-s2-split-col textarea {
    width: 100%;
    min-height: 96px;
}

.team-league-s2-split-col-right {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.team-league-s2-split-col-right .team-league-captain-inputs {
    flex: 1;
    display: grid;
    grid-auto-rows: minmax(0, auto);
    gap: 0.55rem;
}

.team-league-s2-split-col-right .team-league-captain-inputs input {
    width: 100%;
}

.team-league-captain-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
    gap: 0.75rem;
    align-items: start;
}

.team-league-captain-row .team-league-name-field {
    min-width: 0;
}

.team-league-captain-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.team-league-captain-title {
    font-weight: 700;
}

.team-league-captain-inputs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
}

.team-league-captain-inputs input {
    width: 100%;
}

.team-league-captain-inputs .team-league-logo-hint {
    margin: 0;
}

.event-name-manager-page {
    display: grid;
    gap: 1rem;
}

.event-name-manager-lead {
    margin: 0;
    max-width: 78ch;
    color: var(--theme-text-dim);
}

.event-name-alert {
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 2px solid var(--theme-border-strong);
    font-weight: 700;
}

.event-name-alert--success {
    background: color-mix(in srgb, var(--theme-success) 16%, var(--theme-surface) 84%);
    border-color: var(--theme-success);
    color: var(--theme-success);
}

.event-name-alert--error {
    background: color-mix(in srgb, var(--theme-danger) 14%, var(--theme-surface) 86%);
    border-color: var(--theme-danger);
    color: var(--theme-danger);
}

.event-name-toolbar {
    margin-top: 0.15rem;
}

.event-name-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.event-name-table {
    width: 100%;
    min-width: 880px;
}

.event-name-table th,
.event-name-table td {
    vertical-align: top;
}

.event-name-table th.event-name-sort {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.18s ease;
}

.event-name-table th.event-name-sort:hover,
.event-name-table th.event-name-sort.is-active {
    color: var(--theme-accent, var(--theme-text));
}

.event-name-table th.event-name-sort:focus-visible {
    outline: 2px solid var(--theme-focus-ring);
    outline-offset: -2px;
}

.event-name-table .sort-arrow {
    display: inline-block;
    min-width: 1rem;
    margin-left: 0.2rem;
}

.event-name-sort-hint {
    display: block;
    margin-top: 0.18rem;
    font-size: 0.74rem;
    font-weight: 400;
    color: var(--theme-text-dim);
    white-space: normal;
}

.event-name-col-lp,
.event-name-lp-cell {
    width: 4.25rem;
    text-align: center;
    white-space: nowrap;
}

.event-name-owner-cell {
    min-width: 220px;
}

.event-name-owner-cell small {
    display: block;
    margin-top: 0.28rem;
    color: var(--theme-text-dim);
}

.event-name-name-cell {
    min-width: 280px;
}

.event-name-value-stack {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
}

.event-name-text-stack {
    display: grid;
    gap: 0.28rem;
    min-width: 0;
}

.event-name-value {
    line-height: 1.45;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.event-name-meta {
    color: var(--theme-text-dim);
    font-size: 0.85rem;
}

.event-name-edit-btn {
    min-width: 4.4rem;
    font-weight: 700;
    align-self: start;
}

.event-name-empty {
    display: inline-block;
    padding: 0.45rem 0.65rem;
    border-radius: 999px;
    border: 1px dashed var(--theme-border-strong);
    color: var(--theme-text-dim);
    background: var(--theme-surface-alt);
}

.event-name-row--cycle_tournament td {
    background: var(--theme-surface);
}

.event-name-row--cycle_tournament td:first-child {
    border-left: 5px solid var(--theme-accent-strong);
}

.event-name-row--cycle_only td {
    background: var(--theme-warning-bg);
}

.event-name-row--cycle_only td:first-child {
    border-left: 5px solid var(--theme-warning-border);
}

.event-name-row--tournament_only td {
    background: var(--theme-surface-muted);
}

.event-name-row--tournament_only td:first-child {
    border-left: 5px solid var(--theme-border-strong);
}

.event-name-modal-content {
    width: min(560px, calc(100vw - 32px));
    text-align: left;
}

body.event-name-modal-open {
    overflow: hidden;
}

.event-name-modal-form {
    display: grid;
    gap: 0.95rem;
}

.event-name-modal-sub {
    margin-bottom: 0.3rem;
}

.event-name-modal-current {
    display: grid;
    gap: 0.25rem;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--theme-border-strong);
    background: var(--theme-surface-alt);
}

.event-name-modal-current span {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--theme-text-dim);
}

.event-name-modal-current strong {
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.event-name-modal-label {
    font-weight: 700;
}

.event-name-modal-input {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border-radius: 10px;
    border: 2px solid var(--theme-border-strong);
    background: var(--theme-surface);
    color: var(--theme-text);
}

.event-name-modal-input:focus-visible {
    outline: 2px solid var(--theme-focus-ring);
    outline-offset: 2px;
}

.event-name-modal-actions {
    justify-content: flex-end;
    margin-top: 0.25rem;
}

@media (max-width: 780px) {
    .event-name-manager-page {
        gap: 0.85rem;
    }

    .event-name-table {
        min-width: 720px;
    }

    .event-name-value-stack {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .event-name-edit-btn {
        justify-self: start;
    }

    .event-name-modal-content {
        padding: 18px 18px 20px;
    }

    .event-name-modal-actions {
        justify-content: stretch;
        flex-direction: column-reverse;
    }

    .event-name-modal-actions .btn {
        width: 100%;
    }
}

.team-league-logo-hint {
    margin: 0.2rem 0 0;
    color: var(--theme-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.team-league-team-identity {
    display: inline-flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    min-width: 0;
    white-space: nowrap;
}

.team-league-team-name {
    white-space: nowrap;
    overflow-wrap: normal;
}

.team-league-logo-anchor {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.team-league-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.team-league-logo-thumb {
    display: block;
    width: auto;
    height: auto;
    max-width: 30px;
    max-height: 30px;
    border-radius: 8px;
    border: 1px solid var(--theme-border);
    background: var(--theme-surface);
    object-fit: contain;
    padding: 2px;
    flex-shrink: 0;
}

.team-league-logo-preview {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.25rem;
}

.team-league-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    margin: 0.65rem 0;
}

.team-league-inline-form input {
    min-width: 180px;
}

.team-league-player-table {
    margin-top: 0.4rem;
}

.team-league-player-row-active td {
    background: var(--theme-highlight-bg, rgba(59,130,246,.08));
}

.team-league-player-edit-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.6rem;
    border: 1px solid var(--theme-border-strong);
    border-radius: 8px;
    background: var(--theme-highlight-bg, rgba(59,130,246,.06));
}

.team-league-player-edit-label {
    flex: 0 0 100%;
    font-size: 0.82rem;
}

.team-league-remove-player-form {
    display: inline;
    margin: 0;
}

.team-league-row-lock {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--theme-warning-border);
    background: var(--theme-warning-bg);
    color: var(--theme-warning-text);
    font-size: 0.78rem;
    font-weight: 800;
}

.team-league-empty {
    text-align: center;
    color: var(--theme-muted);
}

.team-league-placeholder {
    margin-top: 0.45rem;
    padding: 0.72rem;
    border-radius: 8px;
    border: 1px dashed var(--theme-border-strong);
    background: var(--theme-surface-soft);
    color: var(--theme-muted);
}

.team-league-inline-meta {
    margin-top: 0.8rem;
}

.team-league-rank-note {
    margin-top: 0.7rem;
    padding: 0.62rem 0.72rem;
    border-radius: 8px;
    border: 1px solid var(--theme-border);
    background: var(--theme-surface-soft);
}

.team-league-stats-grid {
    margin-top: 0.85rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.6rem;
}

.team-league-stat-item {
    padding: 0.62rem;
    border-radius: 8px;
    border: 1px solid var(--theme-border);
    background: var(--theme-surface-soft);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.team-league-stat-item span {
    color: var(--theme-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.team-league-stat-item strong {
    font-size: 1.05rem;
}

.team-league-schedule-layout {
    margin-top: 0.85rem;
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.4fr);
    gap: 0.85rem;
    align-items: start;
}

.team-league-schedule-panel {
    min-width: 0;
    border: 2px solid var(--theme-border);
    border-radius: 10px;
    background: var(--theme-surface-soft);
    padding: 0.85rem;
}

.team-league-schedule-panel h4 {
    margin-top: 0;
    margin-bottom: 0.7rem;
}

.team-league-standings-table,
.team-league-matches-table {
    margin-top: 0.25rem;
}

.team-league-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 0.22rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--theme-border);
    font-size: 0.78rem;
    font-weight: 800;
}

.team-league-tag-ready {
    background: var(--theme-success);
    color: var(--theme-on-success, #fff);
    border-color: var(--theme-success);
}

.team-league-tag-active {
    background: var(--theme-accent);
    color: var(--theme-on-accent, #fff);
    border-color: var(--theme-accent);
}

.team-league-tag-archived {
    background: #1f2937;
    color: #f9fafb;
    border-color: #111827;
}

.team-league-tag-missing {
    background: var(--theme-warning-bg);
    color: var(--theme-warning-text);
    border-color: var(--theme-warning-border);
}

.team-league-tag-pending {
    background: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border-strong);
}

.team-league-actions-cell {
    min-width: 190px;
}

.team-league-action-form {
    margin: 0;
}

.team-league-action-form + .team-league-action-form {
    margin-top: 0.4rem;
}

.team-league-action-form button {
    width: 100%;
}

.team-league-action-meta {
    margin-top: 0.45rem;
    color: var(--theme-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.team-league-action-disabled {
    color: var(--theme-muted);
    font-weight: 700;
}

@media (max-width: 980px) {
    .team-league-context-form {
        grid-template-columns: 1fr;
    }

    .team-league-inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .team-league-inline-form input {
        min-width: 0;
    }

    .team-league-league-head {
        grid-template-columns: 1fr;
    }

    .team-league-s2-split-box {
        grid-template-columns: 1fr;
    }

    .team-league-s2-split-col {
        grid-template-rows: auto;
    }

    .team-league-captain-row {
        grid-template-columns: 1fr;
    }

    .team-league-schedule-layout {
        grid-template-columns: 1fr;
    }
}


