/**
 * quinielas.css  (Batch 4.2 → Batch 8 Sesión 3)
 *
 * Styles for /quinielas.html (list) and /quiniela.html (detail).
 * Shared: qmodal (modal scaffold), qaction (action buttons).
 */

/* ============================================================================
 * /quinielas.html — list page
 * ============================================================================ */

.quinielas-actions {
    display: flex;
    gap: var(--sp-3, 12px);
    margin-bottom: var(--sp-5, 20px);
    flex-wrap: wrap;
}

.quinielas-actions__btn {
    flex: 1 1 calc(50% - var(--sp-2, 8px));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2, 8px);
    min-width: 0;
}

/* Empty state */

.quinielas-empty {
    text-align: center;
    padding: var(--sp-7, 28px) var(--sp-5, 20px);
    background: var(--bg-card, rgba(20, 30, 50, 0.5));
    border: 1px dashed var(--border, rgba(255, 255, 255, 0.16));
    border-radius: var(--r-md, 12px);
}

.quinielas-empty__icon {
    font-size: 3rem;
    margin-bottom: var(--sp-3, 12px);
    opacity: 0.7;
}

.quinielas-empty__title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 var(--sp-2, 8px);
    color: var(--text-primary, #fff);
}

.quinielas-empty__body {
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    margin: 0;
    line-height: 1.5;
}

/* Group card list */

.quinielas-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-3, 12px);
}

@media (min-width: 720px) {
    .quinielas-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1100px) {
    .quinielas-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.qgroup-card {
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.015) 100%);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: var(--r-lg, 18px);
    padding: var(--sp-4, 16px);
    text-decoration: none;
    color: inherit;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 12px 32px rgba(2, 6, 16, 0.28);
    transition: transform 0.2s cubic-bezier(0.22,1,0.36,1), border-color 0.2s, box-shadow 0.2s;
    display: block;
}

.qgroup-card:hover {
    transform: translateY(-3px);
    border-color: rgba(125, 211, 252, 0.40);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 20px 44px rgba(2, 6, 16, 0.45);
}

.qgroup-card:focus-visible {
    outline: 2px solid rgba(125, 211, 252, 0.65);
    outline-offset: 2px;
}

.qgroup-card__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--sp-2, 8px);
    margin-bottom: var(--sp-3, 12px);
    flex-wrap: wrap;
}

.qgroup-card__name {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary, #fff);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.qgroup-card__owner-badge {
    font-size: 0.9rem;
    line-height: 1;
}

.qgroup-card__members {
    font-size: 0.75rem;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.qgroup-card__board {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qgroup-card__error {
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
    font-size: 0.85rem;
    margin: 0;
}

/* Mini-leaderboard rows (inside a card) */

.mini-row {
    display: grid;
    grid-template-columns: 30px 28px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.85rem;
}

.mini-row--separator {
    height: 8px;
    background: none;
    padding: 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    margin: 4px 8px;
}

.mini-row--me {
    background: rgba(74, 143, 239, 0.10);
    border: 1px solid rgba(74, 143, 239, 0.30);
}

.mini-row__rank {
    text-align: center;
    font-weight: 600;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
}

.mini-row__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    color: var(--text-primary, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
}

.mini-row__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary, #fff);
    font-weight: 500;
    min-width: 0;
}

.mini-row__pts {
    font-weight: 700;
    color: var(--text-primary, #fff);
    font-variant-numeric: tabular-nums;
}

/* ============================================================================
 * /quiniela.html — detail page
 * ============================================================================ */

.quiniela-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.65));
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: var(--sp-4, 16px);
    transition: color 0.15s;
}

.quiniela-back:hover {
    color: var(--text-primary, #fff);
}

.quiniela-header {
    margin-bottom: var(--sp-4, 16px);
}

.quiniela-header__top {
    display: flex;
    align-items: center;
    gap: var(--sp-2, 8px);
    flex-wrap: wrap;
}

.quiniela-header__name {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary, #fff);
}

.quiniela-header__owner-badge {
    font-size: 1.25rem;
    line-height: 1;
}

.quiniela-header__meta {
    margin-top: 4px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.55));
}

/* [Quiniela de Eliminación] Type chip in the group header */
.quiniela-type-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #1a1006;
    background: linear-gradient(90deg, #ff9933, #ffb347);
}

/* Code share card */

.quiniela-code-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3, 12px);
    background: linear-gradient(135deg,
        rgba(74, 143, 239, 0.10) 0%,
        rgba(125, 211, 252, 0.04) 100%);
    border: 1px solid rgba(74, 143, 239, 0.25);
    border-radius: var(--r-md, 12px);
    padding: var(--sp-4, 16px);
    margin-bottom: var(--sp-5, 20px);
    flex-wrap: wrap;
}

.quiniela-code-card__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.quiniela-code-card__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(125, 211, 252, 0.85);
    margin-bottom: 4px;
}

.quiniela-code-card__code {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-primary, #fff);
}

.quiniela-code-card__btn {
    flex-shrink: 0;
}

/* Full leaderboard section */

.quiniela-leaderboard__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--sp-2, 8px);
    margin-bottom: var(--sp-3, 12px);
    flex-wrap: wrap;
}

.quiniela-leaderboard__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary, #fff);
}

.quiniela-leaderboard__hint {
    font-size: 0.75rem;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.55));
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 56px 36px 1fr auto auto;
    align-items: center;
    gap: var(--sp-3, 12px);
    padding: var(--sp-3, 12px);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--r-md, 10px);
    transition: background-color 0.12s;
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.leaderboard-row--first {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.10), rgba(245, 158, 11, 0.06));
    border-color: rgba(251, 191, 36, 0.35);
}
.leaderboard-row--second {
    background: linear-gradient(135deg, rgba(203, 213, 225, 0.08), rgba(148, 163, 184, 0.04));
    border-color: rgba(203, 213, 225, 0.25);
}
.leaderboard-row--third {
    background: linear-gradient(135deg, rgba(217, 119, 87, 0.08), rgba(180, 83, 9, 0.04));
    border-color: rgba(217, 119, 87, 0.25);
}

.leaderboard-row--me {
    background: linear-gradient(135deg, rgba(74, 143, 239, 0.16), rgba(125, 211, 252, 0.10)) !important;
    border-color: rgba(74, 143, 239, 0.45) !important;
    box-shadow: 0 0 0 1px rgba(74, 143, 239, 0.25);
}

.leaderboard-row__rank {
    display: flex;
    align-items: center;
    gap: 4px;
    font-variant-numeric: tabular-nums;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.55));
    font-weight: 600;
    font-size: 0.85rem;
}

.leaderboard-row__medal {
    font-size: 1.15rem;
    line-height: 1;
}

.leaderboard-row__rank-num { white-space: nowrap; }
.leaderboard-row--first .leaderboard-row__rank-num,
.leaderboard-row--second .leaderboard-row__rank-num,
.leaderboard-row--third .leaderboard-row__rank-num {
    color: var(--text-primary, #fff);
}

.leaderboard-row__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    color: var(--text-primary, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.leaderboard-row__name {
    font-weight: 500;
    color: var(--text-primary, #fff);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: var(--sp-2, 8px);
    min-width: 0;
}

.leaderboard-row__pro {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 2px 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.30), rgba(245, 158, 11, 0.30));
    color: rgba(253, 224, 71, 1);
    border: 1px solid rgba(251, 191, 36, 0.45);
    flex-shrink: 0;
}

.leaderboard-row__points {
    font-weight: 700;
    color: var(--text-primary, #fff);
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
    white-space: nowrap;
}

.leaderboard-row__pts-unit {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
    margin-left: 2px;
    letter-spacing: 0.04em;
}

.leaderboard-row__kick-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: rgba(248, 113, 113, 1);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.leaderboard-row__kick-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.50);
}

/* Pre-tournament hint */

.quiniela-note {
    display: flex;
    align-items: center;
    gap: var(--sp-3, 12px);
    padding: var(--sp-3, 12px) var(--sp-4, 16px);
    background: rgba(125, 211, 252, 0.06);
    border: 1px solid rgba(125, 211, 252, 0.20);
    border-radius: var(--r-md, 10px);
    margin: var(--sp-4, 16px) 0;
    color: var(--text-secondary, rgba(255, 255, 255, 0.75));
    font-size: 0.85rem;
    line-height: 1.45;
}

/* Bottom actions section */

.quiniela-actions-section {
    margin-top: var(--sp-5, 20px);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2, 8px);
}

/* Mobile adjustments */

@media (max-width: 480px) {
    .quiniela-header__name { font-size: 1.3rem; }
    .quiniela-code-card { padding: var(--sp-3, 12px); flex-direction: column; align-items: stretch; }
    .quiniela-code-card__btn { width: 100%; }
    .quiniela-code-card__code { font-size: 1.4rem; letter-spacing: 0.10em; }
    .leaderboard-row {
        grid-template-columns: 44px 32px 1fr auto auto;
        gap: var(--sp-2, 8px);
        padding: 10px;
    }
    .leaderboard-row__avatar { width: 32px; height: 32px; font-size: 0.75rem; }
    .leaderboard-row__rank { font-size: 0.8rem; }
    .leaderboard-row__name { font-size: 0.9rem; }
}

@media (max-width: 360px) {
    .leaderboard-row__pts-unit { display: none; }
}

/* ============================================================================
 * Shared modal scaffold (qmodal)
 * ============================================================================ */

.qmodal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-3, 12px);
}

.qmodal[hidden] { display: none !important; }

.qmodal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: qmodal-fade 0.18s ease;
}

@keyframes qmodal-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.qmodal__dialog {
    position: relative;
    background: linear-gradient(170deg, #16284a 0%, #0c1a32 100%);
    border: 1px solid rgba(125, 211, 252, 0.16);
    border-radius: var(--r-xl, 22px);
    padding: var(--sp-5, 20px);
    max-width: 480px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 30px 70px rgba(2, 6, 16, 0.6);
    animation: qmodal-slide 0.2s ease;
}

@keyframes qmodal-slide {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.qmodal__close {
    position: absolute;
    top: var(--sp-3, 12px);
    right: var(--sp-3, 12px);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qmodal__close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.qmodal__header {
    margin-bottom: var(--sp-4, 16px);
    padding-right: var(--sp-7, 36px);
}

.qmodal__big-icon {
    font-size: 3rem;
    margin-bottom: var(--sp-2, 8px);
    text-align: center;
    line-height: 1;
}

.qmodal__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
}

.qmodal__subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    margin: 0;
    line-height: 1.5;
}

.qmodal__form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2, 8px);
    margin-bottom: var(--sp-3, 12px);
}

.qmodal__label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.55));
}

.qmodal__input {
    width: 100%;
    padding: var(--sp-3, 12px) var(--sp-4, 14px);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--r-md, 10px);
    color: var(--text-primary, #fff);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s, background-color 0.15s;
}

.qmodal__input:focus {
    outline: none;
    border-color: rgba(125, 211, 252, 0.55);
    background: rgba(255, 255, 255, 0.07);
}

.qmodal__input:disabled {
    opacity: 0.5;
}

.qmodal__input--code {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.qmodal__counter {
    font-size: 0.75rem;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.45));
    text-align: right;
    margin-top: -4px;
    font-variant-numeric: tabular-nums;
}

/* ===== [Quiniela de Eliminación] Type selector in the create modal ===== */

.qtype {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2, 8px);
}

.qtype__card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: var(--sp-3, 12px);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--r-md, 10px);
    color: var(--text-primary, #fff);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.qtype__card:hover {
    background: rgba(255, 255, 255, 0.07);
}

.qtype__card.is-selected {
    border-color: rgba(255, 179, 71, 0.75);
    background: rgba(255, 153, 51, 0.10);
    box-shadow: 0 0 0 1px rgba(255, 179, 71, 0.35);
}

.qtype__flag {
    position: absolute;
    top: -9px;
    right: 8px;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1a1006;
    background: linear-gradient(90deg, #ff9933, #ffb347);
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.qtype__emoji {
    font-size: 1.4rem;
    line-height: 1;
}

.qtype__name {
    font-size: 0.95rem;
    font-weight: 700;
}

.qtype__desc {
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}

.qtype__note {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary, rgba(255, 255, 255, 0.75));
    background: rgba(125, 211, 252, 0.08);
    border: 1px solid rgba(125, 211, 252, 0.25);
    border-radius: var(--r-md, 10px);
    padding: var(--sp-3, 12px);
}

@media (max-width: 440px) {
    .qtype {
        grid-template-columns: 1fr;
    }
}

.qmodal__status {
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 8px;
    line-height: 1.4;
}

.qmodal__status[data-kind="success"] {
    background: rgba(74, 222, 128, 0.10);
    border: 1px solid rgba(74, 222, 128, 0.30);
    color: rgba(134, 239, 172, 1);
}

.qmodal__status[data-kind="error"] {
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.30);
    color: rgba(248, 113, 113, 1);
}

.qmodal__footer {
    display: flex;
    gap: var(--sp-2, 8px);
    margin-top: var(--sp-3, 12px);
}

.qmodal__footer .qaction {
    flex: 1;
}

/* Action buttons (shared) */

.qaction {
    padding: var(--sp-3, 12px) var(--sp-4, 16px);
    border-radius: var(--r-md, 10px);
    border: 1px solid;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
}

.qaction:disabled { opacity: 0.5; cursor: not-allowed; }

.qaction--neutral {
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text-primary, #fff);
}
.qaction--neutral:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.30);
}

.qaction--primary {
    border-color: rgba(74, 143, 239, 0.45);
    background: rgba(74, 143, 239, 0.18);
    color: #fff;
}
.qaction--primary:hover:not(:disabled) {
    background: rgba(74, 143, 239, 0.30);
    border-color: rgba(74, 143, 239, 0.65);
}

.qaction--danger {
    border-color: rgba(239, 68, 68, 0.40);
    color: rgba(248, 113, 113, 1);
}
.qaction--danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.60);
}

/* Created modal — code display block */

.created-modal__code-display {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-align: center;
    color: rgba(125, 211, 252, 1);
    background: rgba(74, 143, 239, 0.08);
    border: 1px solid rgba(74, 143, 239, 0.30);
    border-radius: var(--r-md, 12px);
    padding: var(--sp-4, 16px);
    margin-bottom: var(--sp-3, 12px);
}

/* [4.3] Row of buttons in the created modal: share + copy side by side */
.created-modal__btn-row {
    display: flex;
    gap: var(--sp-2, 8px);
    flex-wrap: wrap;
}
.created-modal__btn-row .qaction {
    flex: 1 1 calc(50% - var(--sp-2, 8px));
    min-width: 130px;
}

/* ============================================================================
 * Pro upgrade CTAs (Batch 4.4.1)
 * Shown inline next to error messages when the error is "Pro-upgrade-fixable"
 * (e.g. user free trying to create 2nd quiniela, or owner free with full group).
 * ============================================================================ */

/* Inline CTA in modal status messages (create/join modals) */
.qmodal__pro-cta {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: linear-gradient(135deg,
        rgba(251, 191, 36, 1) 0%,
        rgba(245, 158, 11, 1) 100%);
    color: #1a1408;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 999px;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.25);
}

.qmodal__pro-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.40);
}

/* The status message itself needs to become a flex column to stack
   the message text + the CTA button vertically. */
.qmodal__status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.qmodal__status > span:first-child {
    width: 100%;
}

/* List-level error CTA (when groups list itself fails to load) */
.q-pro-upgrade-cta {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: linear-gradient(135deg,
        rgba(251, 191, 36, 1) 0%,
        rgba(245, 158, 11, 1) 100%);
    color: #1a1408;
    font-size: 0.925rem;
    font-weight: 700;
    border-radius: 999px;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.25);
}

.q-pro-upgrade-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.40);
}

/* Wrap the message + CTA in error container — flex column for stacking */
#quinielas-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#quinielas-error > span:first-child {
    text-align: center;
}

/* ============================================================================
 * [Batch 8 Sesión 3] Scoring config section — /quiniela.html
 * Toggle UI for the group owner to customize what counts. Visible to all
 * members in read-only form. 4 states: member, owner-free, owner-pro-pre,
 * owner-pro-post.
 * ============================================================================ */

.quiniela-scoring-config {
    margin-bottom: var(--sp-5, 20px);
    background: rgba(20, 30, 50, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: var(--sp-4, 16px);
}

/* Max-points pill in the header (overrides .quiniela-leaderboard__hint
   styling inside this section so it stands out a bit). */
.scoring-config__max-display {
    font-variant-numeric: tabular-nums;
    color: rgba(253, 224, 71, 1);
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.875rem;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.25);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.scoring-config__body {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2, 8px);
    margin-top: var(--sp-3, 12px);
}

.scoring-config__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3, 12px);
    padding: var(--sp-3, 12px) var(--sp-4, 14px);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    margin: 0;
    transition: background 0.12s, border-color 0.12s;
}

/* Toggleable row (label) gets hover affordance — locked/disabled don't. */
label.scoring-config__row {
    cursor: pointer;
}

label.scoring-config__row:hover:not(.scoring-config__row--disabled):not(.scoring-config__row--saving) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(125, 211, 252, 0.20);
}

/* Locked baseline row (Fase de Grupos — always-on) */
.scoring-config__row--locked {
    cursor: default;
    background: rgba(74, 143, 239, 0.06);
    border-color: rgba(74, 143, 239, 0.18);
}

/* Disabled state — used for non-owner / non-pro / post-tournament views */
.scoring-config__row--disabled {
    cursor: not-allowed;
}

/* Saving state — slight pulse + spinner appears */
.scoring-config__row--saving {
    cursor: progress;
    position: relative;
}

.scoring-config__row--saving::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 60px;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(125, 211, 252, 0.25);
    border-top-color: rgba(125, 211, 252, 0.85);
    animation: scoring-spin 0.8s linear infinite;
}

@keyframes scoring-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.scoring-config__row-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.scoring-config__row-title {
    font-size: 0.925rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.scoring-config__row-detail {
    font-size: 0.75rem;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.55));
}

.scoring-config__lock-icon {
    font-size: 1rem;
    flex-shrink: 0;
    opacity: 0.75;
}

/* iOS-style toggle switch */

.scoring-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.scoring-toggle__input {
    opacity: 0;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}

.scoring-toggle__input:disabled {
    cursor: not-allowed;
}

.scoring-toggle__slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    transition: background 0.18s, border-color 0.18s, opacity 0.18s;
}

.scoring-toggle__slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    transition: transform 0.18s, background 0.18s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.30);
}

.scoring-toggle__input:checked + .scoring-toggle__slider {
    background: linear-gradient(135deg,
        rgba(251, 191, 36, 1) 0%,
        rgba(245, 158, 11, 1) 100%);
    border-color: rgba(251, 191, 36, 0.50);
}

.scoring-toggle__input:checked + .scoring-toggle__slider::before {
    transform: translateX(20px);
    background: #fff;
}

.scoring-toggle__input:disabled + .scoring-toggle__slider {
    opacity: 0.55;
}

.scoring-toggle__input:focus-visible + .scoring-toggle__slider {
    box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.40);
}

/* Footer note + Pro CTA */

.scoring-config__footer {
    margin-top: var(--sp-3, 12px);
    padding-top: var(--sp-3, 12px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.scoring-config__footer:empty {
    display: none;
}

.scoring-config__footer-note {
    margin: 0;
    font-size: 0.825rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.65));
    line-height: 1.5;
}

.scoring-config__pro-cta {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 18px;
    background: linear-gradient(135deg,
        rgba(251, 191, 36, 1) 0%,
        rgba(245, 158, 11, 1) 100%);
    color: #1a1408;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 999px;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.25);
}

.scoring-config__pro-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.40);
}

/* Save status (success / error toast inline) */

.scoring-config__status {
    margin-top: var(--sp-3, 12px);
    font-size: 0.825rem;
    padding: 8px 12px;
    border-radius: 8px;
    line-height: 1.4;
}

.scoring-config__status[data-kind="success"] {
    background: rgba(74, 222, 128, 0.10);
    border: 1px solid rgba(74, 222, 128, 0.30);
    color: rgba(134, 239, 172, 1);
}

.scoring-config__status[data-kind="error"] {
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.30);
    color: rgba(248, 113, 113, 1);
}

/* Mobile adjustments */

@media (max-width: 480px) {
    .quiniela-scoring-config {
        padding: var(--sp-3, 12px);
    }
    .scoring-config__row {
        padding: 10px 12px;
    }
    .scoring-config__row-title {
        font-size: 0.875rem;
    }
    .scoring-config__row-detail {
        font-size: 0.7rem;
    }
    .scoring-config__row--saving::after {
        right: 56px;
    }
    .scoring-config__max-display {
        font-size: 0.8rem;
        padding: 2px 8px;
    }
}
