/* ============================================
   Single RR + Upper/Lower KO — ArenaGo dark UI
   Overrides .group-stage-wrapper grid that breaks this mode
   ============================================ */

#groupStageSection.single-rr-active {
    overflow-x: hidden;
    overflow-y: visible;
    pointer-events: auto;
    padding: 12px 8px 32px;
}

#groupStageSection.single-rr-active input,
#groupStageSection.single-rr-active select {
    pointer-events: auto !important;
}

/* Kill inherited group-stage horizontal grid */
.group-stage-wrapper.single-rr-layout {
    display: block !important;
    grid: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 8px 24px;
    box-sizing: border-box;
}

.srr-root {
    width: 100%;
    color: #eaf6ff;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.srr-header {
    margin-bottom: 16px;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(114, 218, 255, 0.35);
}

.srr-header h2 {
    margin: 0 0 6px;
    font-size: 1.25rem;
    font-weight: 800;
    color: #eaf6ff;
    text-shadow: 0 0 12px rgba(84, 208, 255, 0.45);
}

.srr-header p {
    margin: 0;
    font-size: 0.85rem;
    color: #90caf9;
    line-height: 1.45;
}

.srr-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.15fr);
    gap: 16px;
    align-items: start;
}

@media (max-width: 980px) {
    .srr-layout {
        grid-template-columns: 1fr;
    }
}

.srr-panel {
    background: linear-gradient(165deg, rgba(6, 26, 94, 0.96), rgba(2, 12, 52, 0.98));
    border: 2px solid rgba(70, 195, 255, 0.55);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 0 18px rgba(0, 184, 255, 0.18), inset 0 0 24px rgba(21, 52, 165, 0.35);
    box-sizing: border-box;
}

.srr-col-left,
.srr-col-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.srr-section-title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #eaf6ff;
    letter-spacing: 0.02em;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(114, 218, 255, 0.35);
}

.srr-sub {
    font-size: 0.72rem;
    font-weight: 500;
    color: #7dd3fc;
    margin-left: 6px;
}

.srr-hint {
    margin: 0 0 12px;
    font-size: 0.78rem;
    color: #90caf9;
    line-height: 1.4;
}

/* —— Teams —— */
.srr-teams-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 560px) {
    .srr-teams-grid {
        grid-template-columns: 1fr;
    }
}

.srr-team-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(114, 218, 255, 0.28);
    border-radius: 12px;
    padding: 10px 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.srr-team-card:focus-within {
    border-color: rgba(103, 215, 255, 0.85);
    box-shadow: 0 0 12px rgba(99, 226, 255, 0.25);
}

.srr-team-label {
    font-size: 0.68rem;
    font-weight: 800;
    color: #67d7ff;
    margin-bottom: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.srr-team-inputs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.srr-player-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(181, 239, 255, 0.35);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0b1a4a;
    background: #fff;
    outline: none;
}

.srr-player-input:focus {
    border-color: #24c2ff;
    box-shadow: 0 0 0 2px rgba(36, 194, 255, 0.25);
}

.srr-player-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #f3f8ff;
    line-height: 1.35;
}

/* —— Leaderboard —— */
.srr-table-scroll {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(114, 218, 255, 0.3);
    background: rgba(0, 0, 0, 0.22);
}

.srr-standings {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    color: #eaf6ff;
}

.srr-standings th,
.srr-standings td {
    padding: 9px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(114, 218, 255, 0.12);
}

.srr-standings th {
    background: rgba(36, 194, 255, 0.12);
    font-weight: 800;
    color: #b8dff7;
    white-space: nowrap;
}

.srr-standings td.srr-name-cell,
.srr-standings th:nth-child(2) {
    text-align: left;
}

.srr-standings .srr-pts {
    font-weight: 800;
    color: #67d7ff;
}

.srr-upper-zone {
    background: rgba(16, 185, 129, 0.14);
}

.srr-lower-zone {
    background: rgba(59, 130, 246, 0.14);
}

.srr-standings tbody tr:hover {
    background: rgba(103, 215, 255, 0.1);
}

.srr-legend {
    margin: 10px 0 0;
    font-size: 0.72rem;
    color: #90caf9;
}

.srr-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.srr-dot.upper { background: #34d399; }
.srr-dot.lower { background: #60a5fa; }

/* —— Add match form —— */
.srr-add-match {
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(114, 218, 255, 0.3);
}

.srr-add-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #67d7ff;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.srr-add-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    margin-bottom: 10px;
}

.srr-add-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #90caf9;
}

.srr-select,
.srr-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(181, 239, 255, 0.35);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0b1a4a;
    background: #fff;
}

.srr-add-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.srr-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.srr-btn-primary {
    background: linear-gradient(180deg, #24c2ff, #0d8fd3);
    color: #fff;
    border: 1px solid rgba(181, 239, 255, 0.8);
}

.srr-btn-primary:hover {
    filter: brightness(1.08);
}

.srr-add-error {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fca5a5;
}

.srr-empty {
    padding: 28px 16px;
    text-align: center;
    color: #90caf9;
    font-size: 0.85rem;
    border: 1px dashed rgba(114, 218, 255, 0.35);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.15);
}

.srr-fixture-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.srr-btn-icon {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 6px;
    width: 26px;
    height: 26px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
}

.srr-btn-icon:hover {
    background: #fee2e2;
}

.srr-team-select {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 7px 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
    background: #f8fafc;
    max-width: 100%;
}

.srr-team-select:focus {
    outline: none;
    border-color: #24c2ff;
    box-shadow: 0 0 0 2px rgba(36, 194, 255, 0.2);
}

.srr-side-b .srr-team-select {
    text-align: right;
}

.srr-fixture-card.srr-pair-ready {
    border-color: #93c5fd;
}

.srr-score-input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* —— Fixtures —— */
.srr-fixtures-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(72vh, 820px);
    overflow-y: auto;
    padding-right: 4px;
}

.srr-fixtures-list::-webkit-scrollbar {
    width: 8px;
}

.srr-fixtures-list::-webkit-scrollbar-thumb {
    background: rgba(103, 215, 255, 0.55);
    border-radius: 999px;
}

.srr-time-slot {
    margin-top: 6px;
    padding: 6px 10px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #67d7ff;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    border: 1px solid rgba(114, 218, 255, 0.25);
}

.srr-fixture-card {
    background: #ffffff;
    border: 1px solid #dbe7f3;
    border-left: 5px solid #94a3b8;
    border-radius: 12px;
    padding: 11px 13px;
    color: #0f172a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.srr-fixture-card.completed {
    border-color: #86efac;
    background: linear-gradient(180deg, #f0fdf4, #ffffff);
}

.srr-fixture-card.srr-draw-invalid {
    border-color: #fca5a5;
    background: #fef2f2;
}

.srr-court-green { border-left-color: #22c55e; }
.srr-court-yellow { border-left-color: #eab308; }
.srr-court-purple { border-left-color: #a855f7; }
.srr-court-blue { border-left-color: #3b82f6; }

.srr-fixture-meta {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.srr-fixture-sides {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
}

.srr-side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.srr-side-b {
    align-items: flex-end;
    text-align: right;
}

.srr-side-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    word-break: break-word;
}

.srr-vs {
    font-size: 0.7rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.04em;
}

.srr-score-input {
    width: 58px;
    padding: 7px 8px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
    color: #0e2a81;
    background: #f8fafc;
}

.srr-score-input:focus {
    outline: none;
    border-color: #24c2ff;
    box-shadow: 0 0 0 2px rgba(36, 194, 255, 0.2);
}

.srr-side-b .srr-score-input {
    align-self: flex-end;
}

.srr-score-ro {
    display: inline-block;
    min-width: 28px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0e2a81;
}

/* —— Share / view page —— */
.srr-view-section {
    padding: 16px 20px 8px;
    max-width: 1400px;
    margin: 0 auto;
}

.srr-view-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 0 0 14px;
    flex-wrap: wrap;
}

.srr-view-tab {
    border: 1px solid rgba(181, 239, 255, 0.55);
    background: rgba(255, 255, 255, 0.12);
    color: #eaf6ff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 18px;
    border-radius: 999px;
    cursor: pointer;
}

.srr-view-tab.active {
    background: linear-gradient(180deg, #24c2ff, #0d8fd3);
    border-color: rgba(181, 239, 255, 0.9);
    color: #fff;
}

.srr-view-panel[hidden] {
    display: none !important;
}

#v-srr-rr .srr-root {
    background: transparent;
    padding: 0;
}

#v-bracket-srr {
    background: transparent;
    padding: 20px 12px 40px;
    overflow: visible;
    width: 100%;
    min-width: max-content;
}
