.slpsr-root {
    --slpsr-white: #fff;
    --slpsr-text: #1f2937;
    --slpsr-muted: #6b7280;
    --slpsr-border: #d1d5db;
    --slpsr-surface: #fff;
    --slpsr-surface-soft: #f3f4f6;
    --slpsr-header: #666;
    --slpsr-red: #dc2626;
    --slpsr-red-soft: #fbe8e8;
    --slpsr-blue: #1d4ed8;
    --slpsr-blue-soft: #e8eefc;
    --slpsr-yellow: #ffd700;
    color: var(--slpsr-text);
}

.slpsr-root,
.slpsr-root * {
    box-sizing: border-box;
}

.slpsr-root .slpsr-admin-actions {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 6px;
    text-align: right;
}

.slpsr-root .slpsr-content {
    width: 100%;
}

.slpsr-root .slpsr-partial-art-container,
.slpsr-root .slpsr-partial-container {
    margin: 0 10px;
}

/* Date navigation */
.slpsr-root .slpsr-date-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 6px;
    touch-action: pan-x;
}

.slpsr-root .slpsr-date-track {
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
    will-change: transform;
    padding: 10px 3px;
    cursor: grab;
}

.slpsr-root .slpsr-date-track:active {
    cursor: grabbing;
}

.slpsr-root .slpsr-date-track .btn {
    flex: 0 0 auto;
    min-width: 102px;
    margin: 0 4px;
    user-select: none;
    white-space: nowrap;
}

/* Group heading */
.slpsr-root .slpsr-time-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: 600px;
    margin: 18px auto 8px;
    padding: 8px 12px;
    border: 1px solid #e2c3b2;
    border-radius: 8px;
    background: #f0d6c7;
    color: #4b3428;
}

.slpsr-root .slpsr-time-value {
    font-weight: 700;
    font-size: 1.2rem;
}

.slpsr-root .slpsr-time-value::before {
    content: "⏰ ";
}

.slpsr-root .slpsr-time-count {
    color: #4b3428;
    font-size: 1.2rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Match card */
.slpsr-root .slpsr-match-card {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 18px;
    overflow: hidden;
    border: 1px solid #bcc2c9;
    border-radius: 10px;
    background: var(--slpsr-surface);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
}

.slpsr-root .slpsr-match-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 18px;
    background: var(--slpsr-header);
    color: var(--slpsr-white);
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.18);
}

.slpsr-root .slpsr-match-header-main {
    min-width: 0;
    line-height: 1.35;
}

.slpsr-root .text-match {
    color: var(--slpsr-yellow);
    font-size: 1.15em;
}

.slpsr-root .sep {
    color: rgba(255, 255, 255, 0.42);
    font-weight: 400;
    padding: 0 2px;
}

.slpsr-root .slpsr-arena {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    min-width: 26px;
    border: 1px solid #ccc;
    border-radius: 50%;
    background: var(--slpsr-yellow);
    color: var(--slpsr-red);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.slpsr-root .slpsr-match-body {
    display: flex;
    min-height: 100px;
}

.slpsr-root .slpsr-fighters {
    flex: 1 1 auto;
    min-width: 0;
    padding: 7px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.slpsr-root .fighter-row {
    display: flex;
    align-items: stretch;
    min-width: 0;
    border-radius: 8px;
    overflow: hidden;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

.slpsr-root .fighter-row + .fighter-row {
    border-top: 1px solid #e5e7eb;
}

.slpsr-root .fighter-row.is-winner-row.winner-red-row {
    background: rgba(220, 38, 38, 0.100);
}

.slpsr-root .fighter-row.is-winner-row.winner-blue-row {
    background: rgba(29, 78, 216, 0.100);
}

.slpsr-root .fighter-row.is-muted {
    opacity: 0.30;
}

.slpsr-root .corner-bar {
    width: 8px;
    min-height: 38px;
    flex: 0 0 8px;
    margin-right: 9px;
    border-radius: 2px;
}

.slpsr-root .corner-bar.red {
    background: var(--slpsr-red);
}

.slpsr-root .corner-bar.blue {
    background: var(--slpsr-blue);
}

.slpsr-root .corner-bar.neutral {
    background: #9ca3af;
}

.slpsr-root .slpsr-fighter-info {
    min-width: 0;
    padding: 4px 0;
}

.slpsr-root .match-name {
    overflow-wrap: anywhere;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.slpsr-root .match-name-red {
    color: var(--slpsr-red);
}

.slpsr-root .match-name-blue {
    color: var(--slpsr-blue);
}

.slpsr-root .match-team {
    margin-top: 2px;
    color: var(--slpsr-muted);
    font-size: 12px;
    line-height: 1.2;
}

.slpsr-root .weight-x {
    color: #ef4444;
    font-weight: 800;
}

/* Completed card emphasis */
.slpsr-root .slpsr-match-card.winner-red-card {
    border-color: rgba(220, 38, 38, 0.42);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.10), 0 4px 12px rgba(15, 23, 42, 0.08);
}

.slpsr-root .slpsr-match-card.winner-blue-card {
    border-color: rgba(29, 78, 216, 0.42);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.10), 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* Result column */
.slpsr-root .slpsr-result-column {
    flex: 0 0 82px;
    width: 82px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e5e7eb;
}

.slpsr-root .slpsr-result-box {
    flex: 1 1 50%;
    min-height: 49px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
    text-align: center;
}

.slpsr-root .slpsr-result-box + .slpsr-result-box {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.slpsr-root .slpsr-result-box.is-red.is-winner {
    background: var(--slpsr-red);
    color: var(--slpsr-white);
}

.slpsr-root .slpsr-result-box.is-blue.is-winner {
    background: var(--slpsr-blue);
    color: var(--slpsr-white);
}

.slpsr-root .slpsr-result-box.is-red.is-dim {
    background: var(--slpsr-red-soft);
}

.slpsr-root .slpsr-result-box.is-blue.is-dim {
    background: var(--slpsr-blue-soft);
}

.slpsr-root .slpsr-result-box.is-empty {
    background: var(--slpsr-surface-soft);
}

.slpsr-root .slpsr-result-box.is-lose {
    background: #777;
    color: var(--slpsr-white);
}

.slpsr-root .match-win {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
}

.slpsr-root .match-win-type {
    display: block;
    margin-top: 3px;
    font-size: 0.72rem;
    line-height: 1.1;
}

/* Performance */
.slpsr-root .slpsr-performance-card .slpsr-match-body {
    min-height: 86px;
}

.slpsr-root .slpsr-performance-name {
    color: var(--slpsr-text);
    text-transform: uppercase;
}

.slpsr-root .slpsr-performance-score-column {
    min-height: 86px;
}

.slpsr-root .match-score {
    color: var(--slpsr-white);
    font-size: 1.35rem;
    font-weight: 800;
}

/* Loading / errors */
.slpsr-root .slpsr-loading,
.slpsr-root .slpsr-load-error {
    width: 100%;
    max-width: 600px;
    margin: 12px auto;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.slpsr-root .slpsr-loading {
    color: var(--slpsr-muted);
    background: #f9fafb;
}

.slpsr-root .slpsr-load-error {
    border: 1px solid #fecaca;
    color: #991b1b;
    background: #fef2f2;
}

@media (max-width: 575px) {
    .slpsr-root .slpsr-partial-art-container,
    .slpsr-root .slpsr-partial-container {
        margin-left: 4px;
        margin-right: 4px;
    }

    .slpsr-root .slpsr-date-track .btn {
        min-width: 92px;
        margin-left: 3px;
        margin-right: 3px;
        padding-left: 8px;
        padding-right: 8px;
    }

    .slpsr-root .slpsr-fighters {
        padding-left: 6px;
        padding-right: 6px;
    }

    .slpsr-root .slpsr-result-column {
        flex-basis: 70px;
        width: 70px;
    }

    .slpsr-root .match-name {
        font-size: 0.94rem;
    }

    .slpsr-root .slpsr-time-heading {
        margin-top: 14px;
        padding: 7px 9px;
    }
}

/* Result entry - mobile first */
.slpsr-results-root {
    --slpsr-results-text: #1f2937;
    --slpsr-results-muted: #6b7280;
    --slpsr-results-border: #d7dbe0;
    --slpsr-results-surface: #ffffff;
    --slpsr-results-soft: #f4f5f7;
    --slpsr-results-red: #d9362b;
    --slpsr-results-blue: #2854d7;
    width: 100%;
    color: var(--slpsr-results-text);
}

.slpsr-results-root,
.slpsr-results-root * {
    box-sizing: border-box;
}

.slpsr-results-root .slpsr-results-panel {
    width: calc(100% - 16px);
    max-width: 480px;
    margin: 8px auto 18px;
    padding: 12px;
    border: 1px solid #e0e3e7;
    border-radius: 14px;
    background: #f7f8fa;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.10);
}

.slpsr-results-root label {
    display: block;
    margin: 0 0 5px;
    color: #4b5563;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
}

.slpsr-results-root select,
.slpsr-results-root input {
    width: 100%;
    min-height: 46px;
    margin: 0;
    border: 1px solid #cbd1d8;
    border-radius: 9px;
    background: #fff;
    color: var(--slpsr-results-text);
    font-size: 16px;
    outline: none;
}

.slpsr-results-root select:focus,
.slpsr-results-root input:focus {
    border-color: #6b84d9;
    box-shadow: 0 0 0 3px rgba(40, 84, 215, 0.12);
}

.slpsr-results-root .slpsr-results-date-field {
    margin-bottom: 10px;
}

.slpsr-results-root .slpsr-results-date {
    padding: 0 12px;
    font-weight: 700;
}

.slpsr-results-root .slpsr-results-match-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 9px;
    align-items: end;
    margin-bottom: 10px;
}

.slpsr-results-root .slpsr-results-match-number {
    padding: 0 8px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
}

.slpsr-results-root .slpsr-results-match-meta {
    min-width: 0;
    height: 46px;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    text-align: center;
    border-radius: 9px;
    background: #626262;
    color: #fff;
}

.slpsr-results-root .slpsr-results-match-title {
    width: 100%;
    overflow-wrap: anywhere;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}


.slpsr-results-root .slpsr-results-athletes {
    overflow: hidden;
    border: 1px solid var(--slpsr-results-border);
    border-radius: 11px;
    background: var(--slpsr-results-surface);
}

.slpsr-results-root .slpsr-results-athlete {
    position: relative;
    display: grid;
    grid-template-columns: 5px minmax(0, 1fr) 106px;
    align-items: stretch;
    min-height: 82px;
}

.slpsr-results-root .slpsr-results-athlete + .slpsr-results-athlete {
    border-top: 1px solid #e6e8eb;
}

.slpsr-results-root .slpsr-results-corner-bar {
    display: block;
    width: 5px;
    height: 100%;
}

.slpsr-results-root .slpsr-results-athlete.is-red .slpsr-results-corner-bar {
    background: var(--slpsr-results-red);
}

.slpsr-results-root .slpsr-results-athlete.is-blue .slpsr-results-corner-bar {
    background: var(--slpsr-results-blue);
}

.slpsr-results-root .slpsr-results-athlete-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 10px 9px 11px;
}

.slpsr-results-root .slpsr-results-athlete-name {
    overflow-wrap: anywhere;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.18;
}

.slpsr-results-root .slpsr-results-athlete.is-red .slpsr-results-athlete-name {
    color: var(--slpsr-results-red);
}

.slpsr-results-root .slpsr-results-athlete.is-blue .slpsr-results-athlete-name {
    color: var(--slpsr-results-blue);
}

.slpsr-results-root .slpsr-results-athlete-team {
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: var(--slpsr-results-muted);
    font-size: 13px;
    line-height: 1.2;
}

.slpsr-results-root .slpsr-results-win-field {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-left: 1px solid #e6e8eb;
    background: #fafafa;
}


.slpsr-results-root .slpsr-results-win-type {
    min-height: 42px;
    padding: 0 7px;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
}

.slpsr-results-root .slpsr-results-win-type:disabled {
    color: #9ca3af;
    background: #f1f2f4;
}

.slpsr-results-root .slpsr-results-message {
    min-height: 22px;
    padding: 7px 2px 1px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
}

.slpsr-results-root .slpsr-results-message.is-error {
    color: #b42318;
}

.slpsr-results-root .slpsr-results-message.is-success {
    color: #147a3d;
}

.slpsr-results-root .slpsr-results-message.is-info {
    color: #4b5563;
}

.slpsr-results-root .slpsr-results-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
}

.slpsr-results-root .slpsr-results-actions button {
    min-height: 50px;
    border: 0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.slpsr-results-root .slpsr-results-get {
    background: #555f6c;
    color: #fff;
}

.slpsr-results-root .slpsr-results-submit {
    background: #147a3d;
    color: #fff;
}

.slpsr-results-root .slpsr-results-actions button:disabled {
    cursor: default;
    opacity: 0.45;
}


.slpsr-results-root .slpsr-results-performance {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 106px;
    min-height: 82px;
    overflow: hidden;
    border: 1px solid var(--slpsr-results-border);
    border-radius: 11px;
    background: var(--slpsr-results-surface);
}

.slpsr-results-root .slpsr-results-performance[hidden] {
    display: none;
}

.slpsr-results-root .slpsr-results-performance-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 11px;
}

.slpsr-results-root .slpsr-results-performance-name {
    overflow-wrap: anywhere;
    color: var(--slpsr-results-text);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.18;
}

.slpsr-results-root .slpsr-results-performance-team {
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: var(--slpsr-results-muted);
    font-size: 13px;
    line-height: 1.2;
}

.slpsr-results-root .slpsr-results-score-field {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-left: 1px solid #e6e8eb;
    background: #fafafa;
}

.slpsr-results-root .slpsr-results-score {
    min-height: 42px;
    padding: 0 7px;
    text-align: center;
    font-size: 18px;
    font-weight: 800;
}

.slpsr-results-root .slpsr-results-score:disabled {
    color: #9ca3af;
    background: #f1f2f4;
}

@media (max-width: 380px) {
    .slpsr-results-root .slpsr-results-panel {
        width: calc(100% - 8px);
        padding: 9px;
    }

    .slpsr-results-root .slpsr-results-match-row {
        grid-template-columns: 80px minmax(0, 1fr);
        gap: 7px;
    }

    .slpsr-results-root .slpsr-results-athlete {
        grid-template-columns: 5px minmax(0, 1fr) 94px;
    }

    .slpsr-results-root .slpsr-results-performance {
        grid-template-columns: minmax(0, 1fr) 94px;
    }

    .slpsr-results-root .slpsr-results-athlete-info {
        padding-left: 8px;
        padding-right: 7px;
    }

    .slpsr-results-root .slpsr-results-athlete-name {
        font-size: 15px;
    }

    .slpsr-results-root .slpsr-results-win-field {
        padding: 6px;
    }
}
