:root {
    --app-primary: #1d4e89;
    --app-primary-dark: #12355b;
    --app-accent: #f4b400;
    --app-surface: rgba(255, 255, 255, 0.88);
    --app-border: rgba(18, 53, 91, 0.1);
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(circle at top, rgba(244, 180, 0, 0.14), transparent 26%), linear-gradient(180deg, #f4f8fb 0%, #eaf0f7 100%);
    color: #16324a;
}

a, .btn-link {
    color: var(--app-primary);
}

a:hover, .btn-link:hover {
    color: var(--app-primary-dark);
}

.btn-primary {
    color: #fff;
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--app-primary-dark) !important;
    border-color: var(--app-primary-dark) !important;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(29, 78, 137, 0.25);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.card,
.form-control,
.form-select {
    border-color: var(--app-border);
}

.card {
    background: var(--app-surface);
    border-radius: 1.25rem;
}

.auth-shell {
    min-height: calc(100vh - 10rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 3vw, 2.2rem) 0;
}

.auth-panel {
    width: min(100%, 44rem);
    margin-inline: auto;
}

.auth-panel--wide {
    width: min(100%, 50rem);
}

.auth-panel--compact {
    width: min(100%, 38rem);
}

.auth-card {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(18, 53, 91, 0.08);
    box-shadow: 0 1rem 2rem rgba(18, 53, 91, 0.08);
}

.auth-card-body {
    padding: clamp(1.25rem, 3vw, 2.1rem);
}

.auth-card-body--form {
    display: grid;
    gap: 1rem;
}

.auth-copy-block {
    display: grid;
    gap: 0.35rem;
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.auth-form-fields {
    display: grid;
    gap: 0.85rem;
}

.auth-validation-summary {
    margin: 0;
}

.auth-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem 1rem;
}

.auth-submit-button {
    width: 100%;
    min-height: 2.85rem;
    padding-inline: 1.35rem;
    border-radius: 999px;
    font-weight: 700;
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.25rem;
    align-items: center;
}

@media (min-width: 768px) {
    .auth-submit-button {
        width: auto;
        min-width: 10.5rem;
    }
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.tournament-date {
    width: 4.75rem;
    min-width: 4.75rem;
    border-radius: 1rem;
    padding: 0.65rem 0.5rem;
    background: linear-gradient(180deg, rgba(29, 78, 137, 0.12), rgba(244, 180, 0, 0.16));
}

.tournament-date-month {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--app-primary);
}

.tournament-date-day {
    display: block;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--app-primary-dark);
}

.tournament-add-button {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0;
}

.tournament-add-button-sm {
    width: 2.35rem;
    height: 2.35rem;
    font-size: 1.2rem;
}

.dashboard-shell {
    display: grid;
    gap: 0.85rem;
}

.dashboard-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.dashboard-title {
    font-size: clamp(2.1rem, 3.8vw, 2.9rem);
    line-height: 1;
    letter-spacing: -0.03em;
}

.dashboard-subtitle {
    max-width: 50rem;
    color: var(--bs-secondary-color);
    font-size: 1rem;
}

.dashboard-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.dashboard-welcome-row,
.dashboard-state-row,
.dashboard-tournament-row {
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 0.45rem 1rem rgba(18, 53, 91, 0.04);
}

.dashboard-welcome-row,
.dashboard-state-row {
    padding: 0.85rem 1rem;
}

.dashboard-welcome-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.9rem 1.2rem;
}

.dashboard-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.dashboard-state-row {
    text-align: left;
}

.dashboard-list {
    display: grid;
    gap: 0.8rem;
}

.dashboard-tournament-row {
    padding: 0.85rem 1rem;
    display: grid;
    gap: 0.7rem;
}

.dashboard-tournament-row-action {
    width: 100%;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.dashboard-tournament-row-action:hover {
    border-color: rgba(29, 78, 137, 0.22);
    box-shadow: 0 0.9rem 1.8rem rgba(18, 53, 91, 0.08);
}

.dashboard-tournament-row-action:focus-visible {
    outline: none;
    border-color: rgba(29, 78, 137, 0.3);
    box-shadow: 0 0 0 0.2rem rgba(29, 78, 137, 0.12);
}

.dashboard-tournament-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.7rem 1rem;
    align-items: center;
}

.dashboard-tournament-heading {
    min-width: 0;
}

.dashboard-tournament-name {
    margin: 0;
    font-size: clamp(1.2rem, 1.9vw, 1.55rem);
    line-height: 1.05;
}

.dashboard-tournament-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.dashboard-meta-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(18, 53, 91, 0.08);
    background: rgba(244, 248, 251, 0.78);
    font-weight: 600;
    white-space: nowrap;
    color: #27425b;
}

.dashboard-placeholder-list {
    display: grid;
    gap: 0.35rem;
}

.dashboard-placeholder-line {
    display: grid;
    grid-template-columns: 1.85rem minmax(0, 1fr);
    gap: 0.7rem;
    align-items: center;
    padding: 0.45rem 0.6rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(18, 53, 91, 0.08);
    background: rgba(255, 255, 255, 0.84);
}

.dashboard-placeholder-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(29, 78, 137, 0.12), rgba(244, 180, 0, 0.2));
    color: var(--app-primary-dark);
    font-weight: 700;
    font-size: 0.82rem;
}

.dashboard-placeholder-text {
    min-width: 0;
    color: #28445f;
    font-size: 0.96rem;
}

.editor-list {
    display: grid;
    gap: 0.75rem;
}

.editor-list-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    margin-bottom: 0.2rem;
}

.editor-list-item {
    border-radius: 0.9rem !important;
    border: 1px solid var(--app-border) !important;
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.editor-list-item:hover {
    box-shadow: 0 0.9rem 1.8rem rgba(18, 53, 91, 0.08);
    transform: translateY(-1px);
}

.editor-list-item-expanded {
    border-color: rgba(29, 78, 137, 0.28) !important;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 1rem 2rem rgba(18, 53, 91, 0.1);
}

.editor-list-item-expanded:hover {
    transform: none;
}

.editor-list-toggle {
    width: 100%;
    padding: 1.25rem;
    border: 0;
    text-align: left;
    background: transparent;
    color: inherit;
}

.editor-list-panel {
    padding: 1.25rem;
    border-top: 1px solid var(--app-border);
    background: rgba(244, 248, 251, 0.6);
}

.compact-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.45rem;
    padding-right: 0.35rem;
}

.compact-list-toggle {
    width: 100%;
    min-width: 0;
    padding: 0.8rem 0.95rem;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.compact-list-grid {
    display: grid;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.compact-list-grid--tournament {
    grid-template-columns: minmax(12rem, 2fr) auto auto auto;
}

.compact-list-grid--participant {
    grid-template-columns: minmax(12rem, 2.2fr) auto;
}

.compact-list-grid--group {
    grid-template-columns: minmax(9rem, 1.8fr) auto auto;
}

.compact-list-grid--rule-set {
    grid-template-columns: minmax(12rem, 2.2fr) auto auto auto;
}

.compact-list-grid--ballot {
    grid-template-columns: minmax(12rem, 2.2fr) auto auto;
}

.compact-list-grid--leaderboard {
    grid-template-columns: 2.2rem 3rem minmax(12rem, 1.8fr) minmax(10rem, 1.35fr) minmax(13rem, 1.7fr) minmax(5rem, auto) minmax(4.5rem, auto);
}

.compact-list-grid--admin-ballots {
    grid-template-columns: 2.2rem minmax(12rem, 1.7fr) minmax(10rem, 1.3fr) minmax(6.5rem, auto) minmax(6.5rem, auto) minmax(4.5rem, auto);
}

.compact-list-grid--event-view {
    grid-template-columns: minmax(14rem, 2.2fr) auto auto minmax(9rem, 1.2fr);
}

.compact-list-grid--condition {
    grid-template-columns: minmax(0, 1fr) auto;
}

.compact-list-primary,
.compact-list-secondary {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-list-primary {
    font-weight: 600;
}

.compact-list-secondary {
    color: var(--bs-secondary-color);
}

.compact-list-icon-pill {
    min-width: 2.2rem;
    padding-inline: 0.6rem;
    border-radius: 999px;
    line-height: 1;
}

.min-w-0 {
    min-width: 0;
}

.tournament-list-item {
    margin-bottom: 0;
}

.event-list-item {
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.72);
}

.event-outcome-panel {
    background: rgba(244, 248, 251, 0.42);
}

.tournament-user-type-list {
    display: grid;
    gap: 0.9rem;
}

.tournament-user-summary-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 0.55rem;
    align-items: center;
}

.tournament-user-summary-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2.35rem;
    padding: 0.45rem 0.7rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(18, 53, 91, 0.08);
    background: rgba(255, 255, 255, 0.84);
    font-weight: 600;
    color: #27425b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tournament-user-summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
}

.tournament-user-summary-button,
.tournament-user-enrol-button {
    min-width: 8rem;
}

.tournament-leaderboard-list {
    display: grid;
    gap: 0.4rem;
}

.tournament-leaderboard-item {
    margin-bottom: 0;
}

.tournament-leaderboard-item--selected {
    border-color: rgba(29, 78, 137, 0.22);
    box-shadow: 0 0 0 1px rgba(29, 78, 137, 0.08);
}

.leaderboard-select-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    min-width: 2rem;
}

.leaderboard-select-checkbox {
    cursor: pointer;
}

.leaderboard-place-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    min-width: 2.35rem;
    min-height: 2.1rem;
    border-radius: 999px;
    border: 1px solid rgba(18, 53, 91, 0.08);
    background: rgba(244, 248, 251, 0.9);
    color: #27425b;
    font-weight: 700;
}

.leaderboard-place-badge--leader {
    border-color: rgba(244, 180, 0, 0.28);
    background: linear-gradient(180deg, rgba(244, 180, 0, 0.18), rgba(255, 255, 255, 0.96));
    color: #7a4c00;
}

.leaderboard-special-pills {
    display: flex;
    align-items: center;
    gap: clamp(0.6rem, 1.6vw, 1rem);
    min-width: 0;
}

.leaderboard-special-pill {
    min-width: 0;
    max-width: 100%;
    font-size: 0.82rem;
    color: var(--bs-secondary-color);
    background: rgba(255, 255, 255, 0.88);
}

.leaderboard-compare-pill {
    max-width: min(22rem, 100%);
}

.leaderboard-compare-delta {
    justify-self: end;
    min-width: 4.75rem;
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.leaderboard-compare-delta--ahead {
    color: #0d6b42;
}

.leaderboard-compare-delta--behind {
    color: #8a3d17;
}

.leaderboard-compare-delta--level {
    color: var(--app-primary-dark);
}

.leaderboard-total-points {
    justify-self: end;
    white-space: nowrap;
    font-weight: 700;
    color: var(--app-primary-dark);
}

.leaderboard-compare-panel {
    margin-bottom: 1rem;
    padding: 0.4rem 0;
}

.leaderboard-compare-table-wrapper {
    overflow-x: auto;
}

.leaderboard-compare-table {
    width: 100%;
    min-width: 58rem;
    border-collapse: separate;
    border-spacing: 0.35rem;
    table-layout: fixed;
}

.leaderboard-compare-table th,
.leaderboard-compare-table td {
    vertical-align: middle;
}

.leaderboard-compare-label-cell,
.leaderboard-compare-points-cell,
.leaderboard-compare-header-cell,
.leaderboard-compare-value-cell {
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(18, 53, 91, 0.08);
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.88);
}

.leaderboard-compare-label-cell {
    width: 11.5rem;
    min-width: 11.5rem;
    text-align: left;
    font-weight: 700;
    color: var(--app-primary-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-compare-label-cell--header,
.leaderboard-compare-points-cell--header,
.leaderboard-compare-header-cell--placeholder {
    border-style: dashed;
    background: rgba(244, 248, 251, 0.48);
}

.leaderboard-compare-label-cell--header,
.leaderboard-compare-points-cell--header {
    border-color: transparent;
    background: transparent;
}

.leaderboard-compare-label-cell--actual,
.leaderboard-compare-row--actual .leaderboard-compare-value-cell,
.leaderboard-compare-row--actual .leaderboard-compare-points-cell {
    background: linear-gradient(180deg, rgba(29, 78, 137, 0.1), rgba(255, 255, 255, 0.92));
    border-color: rgba(29, 78, 137, 0.16);
}

.leaderboard-compare-header-cell,
.leaderboard-compare-value-cell {
    width: 7.4rem;
    min-width: 7.4rem;
    text-align: center;
}

.leaderboard-compare-header-stack {
    display: grid;
    gap: 0.18rem;
    justify-items: center;
    align-items: center;
    min-width: 0;
}

.leaderboard-compare-header-stack--match {
    gap: 0.35rem;
}

.leaderboard-compare-header-text,
.leaderboard-compare-header-participant,
.leaderboard-compare-cell-text {
    display: block;
    min-width: 0;
}

.leaderboard-compare-header-text,
.leaderboard-compare-header-participant {
    font-weight: 700;
    color: var(--app-primary-dark);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.12;
    text-align: center;
}

.leaderboard-compare-header-participant + .leaderboard-compare-header-participant {
    padding-top: 0.22rem;
    border-top: 1px dashed rgba(18, 53, 91, 0.08);
}

.leaderboard-compare-cell-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-compare-value-cell {
    color: #28445f;
    font-weight: 600;
}

.leaderboard-compare-value-cell--placeholder {
    color: var(--bs-secondary-color);
    border-style: dashed;
    background: rgba(244, 248, 251, 0.5);
}

.leaderboard-compare-points-cell {
    width: 5.25rem;
    min-width: 5.25rem;
    text-align: right;
    white-space: nowrap;
    font-weight: 700;
    color: var(--app-primary-dark);
}

.leaderboard-compare-points-cell--actual {
    color: transparent;
}

.tournament-user-event-list {
    display: grid;
    gap: 0.4rem;
}

.tournament-user-ballot-list {
    display: grid;
    gap: 0.4rem;
}

.tournament-user-ballot-empty {
    padding: 0.65rem 0.8rem;
    border-radius: 0.75rem;
    border: 1px dashed rgba(18, 53, 91, 0.14);
    background: rgba(255, 255, 255, 0.72);
    color: var(--bs-secondary-color);
}

.tournament-user-event-row {
    padding: 0.6rem 0.8rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(18, 53, 91, 0.08);
    background: rgba(255, 255, 255, 0.84);
}

.tournament-user-event-grid {
    display: grid;
    grid-template-columns: minmax(12rem, 1.8fr) minmax(7rem, 0.8fr) minmax(14rem, 2fr) minmax(8.25rem, 9.5rem);
    gap: 0.6rem;
    align-items: center;
}

.tournament-user-event-grid .compact-list-primary,
.tournament-user-event-grid .compact-list-secondary {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tournament-user-event-value {
    min-width: 0;
    justify-self: end;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tournament-user-event-value--awaiting,
.tournament-user-event-value--resolved,
.tournament-user-event-value--cancelled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.2rem 0.55rem;
    border-radius: 0.45rem;
    border: 1px solid rgba(18, 53, 91, 0.08);
    background: rgba(255, 255, 255, 0.86);
    font-weight: 600;
}

.tournament-user-event-value--awaiting {
    color: #8a4d00;
    border-color: rgba(180, 102, 0, 0.14);
    background: rgba(255, 248, 235, 0.92);
}

.tournament-user-event-value--resolved {
    color: #146c43;
    border-color: rgba(25, 135, 84, 0.18);
    background: rgba(240, 253, 244, 0.9);
}

.tournament-user-event-value--cancelled {
    color: #b02a37;
    border-color: rgba(220, 53, 69, 0.16);
    background: rgba(255, 241, 242, 0.92);
}

.tournament-user-type-item {
    display: grid;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(18, 53, 91, 0.08);
    background: rgba(255, 255, 255, 0.78);
}

.tournament-user-rule-list {
    display: grid;
    gap: 0.6rem;
}

.tournament-user-rule-item {
    display: grid;
    gap: 0.2rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(18, 53, 91, 0.08);
    background: rgba(244, 248, 251, 0.78);
}

.tournament-user-rule-item span,
.tournament-user-rule-text {
    color: #34516a;
}

.ballot-guess-list {
    display: grid;
    gap: 0.9rem;
}

.ballot-guess-item {
    display: grid;
    gap: 0.9rem;
    padding: 1rem 1.05rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(18, 53, 91, 0.08);
    background: rgba(255, 255, 255, 0.86);
}

.ballot-guess-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.8rem 1rem;
    align-items: flex-start;
}

.ballot-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.ballot-status-pill--open {
    background: rgba(29, 78, 137, 0.12);
    color: var(--app-primary-dark);
}

.ballot-status-pill--draft {
    background: rgba(108, 117, 125, 0.12);
    color: #495057;
}

.ballot-status-pill--locked {
    background: rgba(180, 102, 0, 0.14);
    color: #8a4d00;
}

.ballot-status-pill--resolved {
    background: rgba(13, 110, 253, 0.12);
    color: #0a58ca;
}

.ballot-status-pill--scored {
    background: rgba(25, 135, 84, 0.14);
    color: #146c43;
}

.ballot-status-pill--cancelled {
    background: rgba(220, 53, 69, 0.12);
    color: #b02a37;
}

.ballot-status-pill--inactive {
    background: rgba(108, 117, 125, 0.12);
    color: #495057;
}

.ballot-guess-description {
    margin: 0;
    color: #34516a;
}

.ballot-rule-note {
    display: grid;
    gap: 0.2rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(18, 53, 91, 0.08);
    background: rgba(244, 248, 251, 0.72);
    color: #34516a;
}

.ballot-guess-input-block {
    display: grid;
    gap: 0.8rem;
}

.ballot-match-inputs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: end;
}

.ballot-match-side {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
    color: #27425b;
}

.ballot-match-separator {
    align-self: end;
    padding-bottom: 0.55rem;
    font-weight: 700;
    color: var(--bs-secondary-color);
}

.ballot-generic-input {
    max-width: 24rem;
}

.ballot-name-editor {
    display: grid;
    gap: 0.55rem;
    max-width: min(100%, 28rem);
}

.ballot-name-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.ballot-name-input {
    flex: 1 1 16rem;
    min-width: 0;
}

.ballot-name-help {
    color: var(--bs-secondary-color);
    font-size: 0.92rem;
}

.ballot-header-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
}

.ballot-header-pill {
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    padding-inline: 0.6rem;
}

.ballot-header-pill--score {
    font-weight: 700;
    color: var(--app-primary-dark);
}

.ballot-header-pill--points,
.ballot-header-pill--place {
    font-weight: 700;
}

.ballot-header-pill--neutral,
.ballot-header-pill--unranked {
    color: #495057;
    background: rgba(255, 255, 255, 0.9);
}

.ballot-header-pill--gap {
    color: #7a4c00;
    border-color: rgba(244, 180, 0, 0.2);
    background: rgba(255, 248, 235, 0.92);
}

.ballot-header-pill--ranked {
    color: #27425b;
    background: rgba(244, 248, 251, 0.9);
}

.ballot-header-pill--first {
    color: #7a4c00;
    border-color: rgba(244, 180, 0, 0.28);
    background: linear-gradient(180deg, rgba(244, 180, 0, 0.18), rgba(255, 255, 255, 0.96));
    font-weight: 800;
    letter-spacing: 0.03em;
}

.ballot-rule-summary-section {
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(18, 53, 91, 0.08);
    background: rgba(255, 255, 255, 0.78);
}

.ballot-rule-summary-list {
    display: grid;
    gap: 0.4rem;
}

.ballot-rule-summary-item {
    color: #34516a;
    line-height: 1.45;
}

.ballot-answer-header-row,
.ballot-answer-row {
    display: grid;
    grid-template-columns: minmax(12rem, 1.5fr) minmax(12rem, 1.9fr) minmax(10rem, 1.15fr) minmax(10rem, 1.15fr) minmax(14rem, 1.6fr);
    gap: 0.7rem;
    align-items: center;
}

.ballot-answer-header-row {
    padding: 0 0.35rem;
}

.ballot-answer-list {
    display: grid;
    gap: 0.35rem;
}

.ballot-answer-item {
    border-radius: 0.8rem;
}

.ballot-answer-meta {
    margin-top: 0.12rem;
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
}

.ballot-row-grid {
    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(7.25rem, 0.9fr) minmax(11rem, 1fr) 2.2rem;
    gap: 0.4rem 0.9rem;
    align-items: center;
    padding: 0.75rem 0.95rem;
}

.ballot-row-leading-placeholder,
.ballot-row-leading-indicator,
.ballot-row-action,
.ballot-row-action-score,
.ballot-row-action-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    min-width: 2.2rem;
    min-height: 2.2rem;
}

.ballot-row-leading-indicator {
    color: #198754;
    font-size: 0.95rem;
}

.ballot-row-title,
.ballot-row-context,
.ballot-row-time,
.ballot-row-answer {
    min-width: 0;
}

.ballot-row-title {
    justify-self: stretch;
    text-align: left;
}

.ballot-row-context,
.ballot-row-time {
    justify-self: stretch;
    text-align: center;
}

.ballot-row-context {
    max-width: min(100%, 50ch);
    margin-inline: auto;
}

.ballot-row-time--outcome {
    color: #28445f;
    font-weight: 600;
}

.ballot-row-answer {
    justify-self: stretch;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.ballot-row-answer .compact-list-secondary,
.ballot-answer-readonly {
    width: 100%;
    text-align: right;
}

.ballot-row-action {
    justify-self: end;
}

.ballot-row-action-placeholder {
    justify-self: end;
}

.ballot-row-action-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    min-width: 2.2rem;
    min-height: 2rem;
    padding: 0.2rem 0.3rem;
    border-radius: 999px;
    border: 1px solid rgba(25, 135, 84, 0.18);
    background: rgba(25, 135, 84, 0.12);
    color: #146c43;
    font-weight: 700;
    justify-self: end;
    font-size: 0.78rem;
}

.ballot-saved-answer-display,
.ballot-saved-match-display,
.condensed-match-outcome-editor,
.condensed-generic-outcome-editor {
    max-width: 100%;
}

.ballot-compact-answer-cell .condensed-match-outcome-editor,
.ballot-compact-answer-cell .condensed-generic-outcome-editor {
    justify-content: flex-start;
}

.ballot-saved-match-display {
    display: grid;
    grid-template-columns: 4.4rem auto 4.4rem;
    gap: 0.4rem;
    align-items: center;
}

.ballot-saved-answer-display {
    display: block;
    width: 100%;
}

.ballot-saved-answer-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.4rem;
    min-height: 2rem;
    padding: 0.2rem 0.55rem;
    border-radius: 0.45rem;
    border: 1px solid rgba(18, 53, 91, 0.08);
    background: rgba(255, 255, 255, 0.86);
    font-weight: 600;
    color: #28445f;
}

.ballot-saved-answer-display .condensed-event-outcome-value {
    display: inline-flex;
    align-items: center;
    width: 100%;
    min-width: 8rem;
    min-height: 2rem;
    padding: 0.2rem 0.55rem;
    border-radius: 0.45rem;
    border: 1px solid rgba(18, 53, 91, 0.08);
    background: rgba(255, 255, 255, 0.86);
    color: #28445f;
}

.ballot-answer-cell {
    min-width: 0;
    display: grid;
    gap: 0.3rem;
}

.ballot-answer-input-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
}

.ballot-answer-score-input {
    width: 4.4rem;
    min-width: 4.4rem;
    text-align: center;
}

.ballot-answer-input,
.ballot-answer-select {
    min-width: 0;
    max-width: 100%;
}

.ballot-answer-separator {
    color: var(--bs-secondary-color);
    font-weight: 700;
}

.ballot-answer-note {
    font-size: 0.82rem;
    color: var(--bs-secondary-color);
}

.ballot-row-note {
    grid-column: 5 / 7;
    text-align: right;
}

.ballot-answer-readonly {
    font-weight: 600;
    color: #28445f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ballot-guess-footer {
    color: var(--bs-secondary-color);
    font-size: 0.94rem;
}

.ballot-guess-readonly {
    display: grid;
    gap: 0.2rem;
    padding: 0.8rem 0.9rem;
    border-radius: 0.8rem;
    border: 1px dashed rgba(18, 53, 91, 0.12);
    background: rgba(255, 255, 255, 0.5);
}

.ballot-guess-readonly-label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.ballot-guess-item--open {
    background: rgba(255, 255, 255, 0.9);
}

.ballot-guess-item--draft {
    background: rgba(248, 249, 250, 0.92);
}

.ballot-guess-item--locked {
    background: rgba(255, 248, 235, 0.92);
}

.ballot-guess-item--resolved {
    background: rgba(239, 246, 255, 0.92);
}

.ballot-guess-item--scored {
    background: rgba(240, 253, 244, 0.92);
}

.ballot-guess-item--cancelled {
    background: rgba(255, 241, 242, 0.92);
}

.ballot-guess-item--inactive {
    background: rgba(248, 249, 250, 0.92);
}

.ballot-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

.event-schedule {
    min-width: 14rem;
}

.condensed-event-list {
    display: grid;
    gap: 0.45rem;
}

.condensed-event-item {
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(18, 53, 91, 0.08);
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.9);
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow-x: auto;
}

.condensed-event-item:hover {
    border-color: rgba(29, 78, 137, 0.24);
    box-shadow: 0 0.4rem 1rem rgba(18, 53, 91, 0.05);
}

.condensed-event-row {
    display: grid;
    grid-template-columns: minmax(14rem, 2.2fr) minmax(6rem, auto) auto minmax(10rem, 1.2fr) auto;
    align-items: center;
    gap: 0.75rem;
    min-width: 52rem;
}

.condensed-event-cell {
    min-width: 0;
}

.condensed-event-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.condensed-event-type {
    white-space: nowrap;
    color: var(--bs-secondary-color);
}

.condensed-event-state {
    justify-self: start;
}

.condensed-event-outcome-cell {
    min-width: 0;
}

.condensed-event-outcome-value {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.condensed-match-outcome-editor,
.condensed-generic-outcome-editor {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
}

.condensed-outcome-input {
    width: 3.8rem;
    min-width: 3.8rem;
    text-align: center;
}

.condensed-outcome-text-input,
.condensed-outcome-select {
    min-width: 8rem;
    max-width: 14rem;
}

.condensed-outcome-separator {
    font-weight: 700;
    color: var(--bs-secondary-color);
}

.condensed-outcome-save-button {
    min-width: 2.5rem;
    padding-inline: 0.55rem;
}

.condensed-event-edit-pill {
    min-width: 2.2rem;
    padding-inline: 0.6rem;
    border-radius: 999px;
    line-height: 1;
}

.compact-event-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 1.1fr) auto;
    align-items: center;
    gap: 0.45rem;
    padding-right: 0.35rem;
}

.compact-event-row--selectable {
    grid-template-columns: auto minmax(0, 1fr) minmax(10rem, 1.1fr);
    padding-left: 0.35rem;
}

.compact-event-select-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    min-width: 2.1rem;
}

.compact-event-select-checkbox {
    cursor: pointer;
}

.compact-event-toggle {
    width: 100%;
    min-width: 0;
    padding: 0.8rem 0.95rem;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.compact-event-grid {
    display: grid;
    grid-template-columns: minmax(14rem, 2.2fr) auto auto;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.compact-event-outcome-cell {
    min-width: 0;
}

.compact-event-outcome-cell .condensed-match-outcome-editor,
.compact-event-outcome-cell .condensed-generic-outcome-editor {
    justify-content: flex-start;
}

.compact-event-outcome-change {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.event-bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.9rem;
}

.event-bulk-selection-label {
    margin-left: 0.15rem;
    margin-right: 0.15rem;
}

.event-bulk-status-select {
    min-width: 11.5rem;
    max-width: 14rem;
}

.event-bulk-rule-set-select {
    min-width: 13.5rem;
    max-width: 17rem;
}

.condensed-event-empty {
    padding: 0.9rem 1rem;
    border: 1px dashed rgba(18, 53, 91, 0.14);
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.72);
    color: var(--bs-secondary-color);
}

.rule-set-list-item,
.rule-list-item {
    margin-bottom: 0;
}

.rule-preset-chip {
    border-radius: 999px;
}

.rule-points-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 5rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(29, 78, 137, 0.12), rgba(244, 180, 0, 0.22));
    color: var(--app-primary-dark);
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .dashboard-tournament-header {
        grid-template-columns: 1fr;
    }

    .compact-list-grid--tournament,
    .compact-list-grid--ballot,
    .compact-list-grid--leaderboard,
    .compact-list-grid--admin-ballots,
    .tournament-user-summary-bar,
    .tournament-user-event-grid,
    .ballot-answer-row,
    .ballot-match-inputs {
        grid-template-columns: 1fr;
    }

    .tournament-user-summary-actions {
        justify-content: stretch;
    }

    .tournament-user-summary-button,
    .tournament-user-enrol-button {
        width: 100%;
    }

    .leaderboard-place-badge,
    .leaderboard-compare-delta,
    .leaderboard-total-points {
        justify-self: start;
        text-align: left;
    }

    .leaderboard-special-pills {
        flex-wrap: wrap;
    }

    .ballot-row-grid {
        grid-template-columns: 2.2rem minmax(0, 1fr) 2.2rem;
        gap: 0.3rem 0.7rem;
    }

    .ballot-header-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
    }

    .ballot-header-pill {
        font-size: 0.82rem;
        padding-inline: 0.45rem;
    }

    .ballot-row-leading-placeholder {
        display: none;
    }

    .ballot-row-title,
    .ballot-row-context,
    .ballot-row-time,
    .ballot-row-answer {
        grid-column: 2;
        justify-self: stretch;
        text-align: left;
    }

    .ballot-row-context,
    .ballot-row-time {
        margin-inline: 0;
    }

    .ballot-row-answer {
        justify-content: flex-start;
    }

    .ballot-row-answer .compact-list-secondary,
    .ballot-answer-readonly {
        text-align: left;
    }

    .ballot-row-action,
    .ballot-row-action-score,
    .ballot-row-action-placeholder {
        grid-column: 3;
        grid-row: 1 / span 4;
        align-self: start;
    }

    .ballot-row-note {
        grid-column: 2 / 4;
        text-align: left;
    }

    .ballot-answer-header-row {
        display: none;
    }

    .ballot-match-separator {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .ballot-header-meta {
        grid-template-columns: 1fr;
    }
}
