/* ============================================================
   UsaBet — design tokens
   Mezcla colores institucionales Sergio Arboleda (azul + dorado)
   con un acento rojo del Mundial 2026.
   ============================================================ */
:root {
    /* Brand */
    --usa-blue: #004aad;
    --usa-blue-dark: #00347a;
    --usa-blue-soft: #e7eef8;
    --usa-gold: #ffcc00;
    --usa-gold-dark: #d4a800;

    /* World Cup accent */
    --wc-red: #c8102e;
    --wc-red-soft: #fde7eb;

    /* Neutrals */
    --bg: #ffffff;
    --bg-soft: #f5f5f7;
    --bg-card: #ffffff;
    --text: #1a1a1a;
    --text-soft: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-strong: #d1d5db;

    /* States */
    --ok: #16a34a;
    --warn: #d97706;
    --err: var(--wc-red);

    /* Shape */
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
    --shadow-md: 0 4px 12px rgba(0, 74, 173, .08);

    /* Type */
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

[x-cloak] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg-soft);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.layout { min-height: 100vh; display: flex; flex-direction: column; }

/* ============================================================ Topbar */
.topbar {
    background: var(--usa-blue);
    color: white;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--usa-gold);
    color: var(--usa-blue-dark);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .5px;
    display: grid;
    place-items: center;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .08);
}

.brand-title { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title strong { font-size: 17px; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: rgba(255, 255, 255, .75); margin-top: 2px; }

.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .user-name { color: #fff; font-weight: 600; font-size: 14px; }
.user-chip .user-role {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--usa-gold);
    color: var(--usa-blue-dark);
    padding: 2px 6px;
    border-radius: 999px;
    font-weight: 700;
}
.logout-btn {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .25);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
.logout-btn:hover { background: rgba(255, 255, 255, .24); }

/* ============================================================ Auth screen */
.auth-wrap {
    display: flex;
    justify-content: center;
    padding: 48px 16px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 32px;
}
.auth-card h1 { color: var(--usa-blue-dark); margin: 0 0 4px; font-size: 24px; }
.auth-sub { margin: 0 0 24px; color: var(--text-soft); font-size: 14px; }
.auth-field { display: block; margin-bottom: 16px; }
.auth-field > span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.auth-field > span em { color: var(--text-muted); font-weight: 400; font-style: normal; }
.auth-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
}
.auth-field input:focus { outline: 2px solid var(--usa-blue); outline-offset: 0; border-color: var(--usa-blue); }
.auth-error {
    background: var(--wc-red-soft);
    color: var(--wc-red);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    margin: 0 0 16px;
    font-size: 13px;
}
.auth-submit {
    width: 100%;
    background: var(--usa-blue);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.auth-submit:hover:not(:disabled) { background: var(--usa-blue-dark); }
.auth-submit:disabled { opacity: .6; cursor: progress; }
.auth-switch { margin: 20px 0 0; text-align: center; font-size: 14px; color: var(--text-soft); }
.auth-switch a { color: var(--usa-blue); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* ============================================================ Sub-nav */
.subnav {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
}
.subnav button {
    background: transparent;
    border: 0;
    padding: 14px 18px;
    font: inherit;
    font-size: 14px;
    color: var(--text-soft);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color .15s, border-color .15s;
}
.subnav button:hover:not(:disabled) { color: var(--text); }
.subnav button.active {
    color: var(--usa-blue);
    border-bottom-color: var(--usa-blue);
    font-weight: 600;
}
.subnav button:disabled { color: var(--text-muted); cursor: not-allowed; }

/* ============================================================ Layout */
.container {
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px 64px;
    flex: 1;
}

.section-header { margin-bottom: 28px; }
.section-header h1 {
    margin: 0 0 4px;
    font-size: 26px;
    color: var(--usa-blue-dark);
    letter-spacing: -.5px;
}
.section-sub { margin: 0; color: var(--text-soft); font-size: 14px; }

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-soft);
}
.empty-state h1 { color: var(--usa-blue-dark); margin: 0 0 8px; }

/* ============================================================ Group card */
.group-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.group-header {
    background: var(--usa-blue-soft);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}
.group-tag {
    background: var(--usa-blue);
    color: white;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 4px 10px;
    border-radius: 999px;
}
.group-teams { font-size: 13px; color: var(--text-soft); }

/* ============================================================ Match row */
.match-list { list-style: none; margin: 0; padding: 0; }

.match-row {
    display: grid;
    grid-template-columns: 92px 1fr 88px;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.match-row:last-child { border-bottom: 0; }
.match-row:hover { background: var(--bg-soft); }
.match-row[data-saved="true"] { background: linear-gradient(to right, transparent, rgba(255, 204, 0, .04)); }

.match-date {
    font-size: 12px;
    color: var(--text-soft);
    text-align: left;
    white-space: nowrap;
}

.match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
}

.team { display: flex; align-items: center; gap: 10px; }
.team.home { justify-content: flex-end; text-align: right; }
.team.away { justify-content: flex-start; text-align: left; }
.team-name { font-size: 14px; font-weight: 500; }
.team .fi {
    width: 28px;
    height: 21px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
    background-size: cover;
    background-position: 50%;
    flex-shrink: 0;
}

.score-input { display: flex; align-items: center; gap: 6px; }
.score-input input {
    width: 44px;
    height: 36px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    text-align: center;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    background: white;
    transition: border-color .15s, box-shadow .15s;
}
.score-input input:focus {
    outline: 0;
    border-color: var(--usa-blue);
    box-shadow: 0 0 0 3px rgba(0, 74, 173, .15);
}
.score-input .dash { color: var(--text-muted); font-weight: 500; }

.save-indicator {
    font-size: 11px;
    text-align: right;
    color: var(--text-muted);
    min-height: 16px;
}
.save-indicator.saving { color: var(--warn); }
.save-indicator.saved { color: var(--ok); }
.save-indicator.error { color: var(--err); }

/* ============================================================ Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--usa-blue-dark);
    color: white;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-size: 14px;
    z-index: 100;
}

/* ============================================================ Rank list (groups + thirds) */
.group-save {
    margin-left: auto;
    text-align: right;
    min-width: 90px;
}

.rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: rank;
}

.rank-row {
    display: grid;
    grid-template-columns: 48px 32px 1fr auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.rank-row:last-child { border-bottom: 0; }
.rank-row:hover { background: var(--bg-soft); }

.rank-row[data-status="qualified"]   { background: linear-gradient(to right, rgba(255, 204, 0, .08), transparent); }
.rank-row[data-status="third"]       { background: linear-gradient(to right, rgba(0, 74, 173, .06), transparent); }
.rank-row[data-status="eliminated"]  { color: var(--text-soft); }

.rank-pos {
    font-weight: 700;
    color: var(--usa-blue-dark);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}
.rank-row[data-status="eliminated"] .rank-pos { color: var(--text-muted); }

.rank-row .fi {
    width: 28px;
    height: 21px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
    background-size: cover;
    background-position: 50%;
    flex-shrink: 0;
}

.rank-team {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.rank-team-sub {
    font-size: 11px;
    color: var(--text-soft);
    font-weight: 400;
    margin-top: 2px;
}

.rank-badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    padding: 3px 9px;
    border-radius: 999px;
    text-transform: uppercase;
    white-space: nowrap;
}
.rank-badge[data-status="qualified"]  { background: var(--usa-gold); color: var(--usa-blue-dark); }
.rank-badge[data-status="third"]      { background: var(--usa-blue-soft); color: var(--usa-blue-dark); }
.rank-badge[data-status="eliminated"] { background: var(--bg-soft); color: var(--text-soft); }

.rank-controls {
    display: flex;
    gap: 4px;
}
.rank-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-strong);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--usa-blue);
    font-size: 12px;
    line-height: 1;
    display: grid;
    place-items: center;
    transition: background .15s, border-color .15s, color .15s;
}
.rank-btn:hover:not(:disabled) {
    background: var(--usa-blue-soft);
    border-color: var(--usa-blue);
}
.rank-btn:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: .5;
}

/* ============================================================ Bracket */
.bracket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.primary-btn {
    background: var(--usa-blue);
    color: white;
    border: 0;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.primary-btn:hover:not(:disabled) { background: var(--usa-blue-dark); }
.primary-btn:disabled {
    background: var(--border-strong);
    color: var(--text-soft);
    cursor: not-allowed;
}

.bracket-stage {
    margin-bottom: 28px;
}

.bracket-stage-title {
    font-size: 18px;
    color: var(--usa-blue-dark);
    margin: 0 0 12px;
    letter-spacing: -.2px;
}

.bracket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.bracket-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.bracket-card[data-pending="true"] { opacity: .55; }

.bracket-slot {
    background: var(--usa-blue);
    color: white;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.bracket-save {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .2px;
    text-transform: none;
    color: rgba(255, 255, 255, .85);
}
.bracket-save.saving { color: var(--usa-gold); }
.bracket-save.saved  { color: var(--usa-gold); }
.bracket-save.error  { color: var(--wc-red-soft); }

.bracket-pending {
    padding: 18px 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

.bracket-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bracket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.bracket-team {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.bracket-team .fi {
    width: 28px;
    height: 21px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
    background-size: cover;
    background-position: 50%;
    flex-shrink: 0;
}
.bracket-team-name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bracket-score {
    width: 44px;
    height: 32px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    text-align: center;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    background: white;
    transition: border-color .15s, box-shadow .15s;
}
.bracket-score:focus {
    outline: 0;
    border-color: var(--usa-blue);
    box-shadow: 0 0 0 3px rgba(0, 74, 173, .15);
}

.bracket-winner {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bracket-winner-label {
    font-size: 11px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
}

.bracket-winner-options {
    display: flex;
    gap: 6px;
}

.winner-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid var(--border-strong);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    transition: background .15s, border-color .15s, color .15s;
}
.winner-btn:hover { border-color: var(--usa-blue); }
.winner-btn.active {
    background: var(--usa-gold);
    border-color: var(--usa-gold-dark);
    color: var(--usa-blue-dark);
}
.winner-btn .fi {
    width: 18px;
    height: 13px;
    border-radius: 1px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
    background-size: cover;
    background-position: 50%;
    flex-shrink: 0;
}

.bracket-winner-summary {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-soft);
}
.bracket-winner-team {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--usa-blue-dark);
    font-weight: 600;
}
.bracket-winner-team .fi {
    width: 18px;
    height: 13px;
    border-radius: 1px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
    background-size: cover;
    background-position: 50%;
}

/* ============================================================ Points */
.points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.points-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.points-card.total {
    background: linear-gradient(135deg, var(--usa-blue), var(--usa-blue-dark));
    color: white;
    border-color: var(--usa-blue-dark);
}
.points-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-soft);
    font-weight: 600;
}
.points-card.total .points-label { color: rgba(255, 255, 255, .8); }
.points-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--usa-blue-dark);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.points-card.total .points-value { color: var(--usa-gold); }
.points-hint {
    font-size: 12px;
    color: var(--text-soft);
}
.points-card.total .points-hint { color: rgba(255, 255, 255, .75); }

/* ============================================================ Misc */
.form-error {
    color: var(--err);
    font-size: 13px;
    background: var(--wc-red-soft);
    border: 1px solid rgba(200, 16, 46, .2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin: 0 0 16px;
}

.empty-state.soft {
    padding: 40px 20px;
    background: var(--bg-card);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}
.empty-state.soft p { margin: 0; }

.save-indicator.pending { color: var(--text-muted); }

/* ============================================================ Warning banner */
.warning-banner {
    background: linear-gradient(to right, rgba(255, 204, 0, .15), rgba(255, 204, 0, .04));
    border: 1px solid var(--usa-gold);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    color: var(--usa-blue-dark);
    padding: 12px 14px;
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
}
.warning-banner strong { color: var(--wc-red); }
.warning-banner em { font-style: normal; font-weight: 600; }

/* ============================================================ Hint */
.hint {
    background: var(--usa-blue-soft);
    border-left: 3px solid var(--usa-blue);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin: 0 0 20px;
    font-size: 13px;
    color: var(--usa-blue-dark);
}
.hint strong { color: var(--wc-red); }
.hint em { font-style: normal; font-weight: 600; }

/* ============================================================ Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    display: grid;
    place-items: center;
    z-index: 200;
    padding: 20px;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    max-width: 480px;
    width: 100%;
    padding: 24px 26px;
}
.modal h2 {
    margin: 0 0 12px;
    color: var(--usa-blue-dark);
    font-size: 20px;
}
.modal p {
    margin: 0 0 10px;
    color: var(--text);
    line-height: 1.55;
}
.modal-warning {
    color: var(--wc-red);
    font-weight: 600;
    font-size: 13px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}
.btn-secondary,
.btn-danger {
    border: 0;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.btn-secondary {
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--border); }
.btn-danger {
    background: var(--wc-red);
    color: white;
}
.btn-danger:hover { background: #a40d24; }
.btn-primary {
    background: var(--usa-blue);
    color: white;
}
.btn-primary:hover { background: var(--usa-blue-dark); }

/* ============================================================ Lock banner */
.lock-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin: 0 0 20px;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.lock-banner[data-state="locked"] {
    background: var(--bg-soft);
    border-left: 4px solid var(--text-soft);
}
.lock-banner[data-state="unlocked"] {
    background: rgba(255, 204, 0, .08);
    border-left: 4px solid var(--usa-gold);
}
.lock-info {
    flex: 1;
    color: var(--text);
}
.lock-info strong {
    display: block;
    margin-bottom: 2px;
    color: var(--usa-blue-dark);
    font-size: 14px;
}
.lock-info em { font-style: normal; font-weight: 600; }
.lock-banner[data-state="unlocked"] .lock-info strong { color: var(--usa-gold-dark); }

.lock-btn {
    border: 0;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    background: var(--usa-blue);
    color: white;
    transition: background .15s;
}
.lock-btn:hover { background: var(--usa-blue-dark); }
.lock-btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border-strong);
}
.lock-btn-secondary:hover {
    background: var(--bg-soft);
    border-color: var(--usa-blue);
}

/* Locked rank rows look slightly muted so it's clear you can't edit */
.rank-btn:disabled[disabled] { /* already styled — kept for specificity */ }

/* ============================================================ Responsive */
@media (max-width: 720px) {
    .match-row { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
    .match-date { text-align: left; }
    .team-name { font-size: 13px; }
    .save-indicator { text-align: left; }
    .topbar { padding: 12px 16px; }
    .container { padding: 20px 12px 40px; }

    .rank-row {
        grid-template-columns: 40px 28px 1fr auto;
        gap: 10px;
        padding: 10px 12px;
    }
    .rank-badge { display: none; }
    .bracket-header { flex-direction: column; align-items: stretch; }
    .points-value { font-size: 28px; }
}

/* ============================================================ Admin module */
.subnav-admin {
    margin-left: auto;
    color: var(--wc-red) !important;
    font-weight: 700;
}
.subnav-admin.active { border-bottom-color: var(--wc-red) !important; }
.admin-subnav {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    background: transparent;
    padding: 0;
}

/* ============================================================ Instrucciones y Reglamento */
.rules { color: var(--text); }

/* Hero */
.rules-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--usa-blue), var(--usa-blue-dark));
    color: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    margin-bottom: 36px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--usa-blue-dark);
}
.rules-hero::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255, 204, 0, .25), transparent 70%);
    pointer-events: none;
}
.rules-hero-ball {
    position: absolute;
    right: 18px;
    bottom: -28px;
    font-size: 150px;
    line-height: 1;
    opacity: .12;
    transform: rotate(-12deg);
    pointer-events: none;
}
.rules-kicker {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--usa-gold);
    margin-bottom: 12px;
}
.rules-hero h1 {
    margin: 0 0 10px;
    font-size: 32px;
    letter-spacing: -.6px;
    color: #fff;
}
.rules-hero > p {
    margin: 0 0 22px;
    max-width: 640px;
    font-size: 15px;
    color: rgba(255, 255, 255, .9);
    line-height: 1.6;
}
.rules-hero > p strong { color: var(--usa-gold); }
.rules-stats { display: flex; flex-wrap: wrap; gap: 10px; position: relative; }
.rules-stat {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, .92);
    backdrop-filter: blur(2px);
}
.rules-stat b { color: var(--usa-gold); font-weight: 800; }

/* Section headings */
.rules-h2 {
    font-size: 21px;
    color: var(--usa-blue-dark);
    margin: 40px 0 18px;
    display: flex;
    align-items: center;
}
.rules-h2 span { position: relative; padding-left: 14px; }
.rules-h2 span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 5px;
    border-radius: 3px;
    background: linear-gradient(var(--usa-gold), var(--usa-gold-dark));
}

.rules-note {
    font-size: 13.5px;
    color: var(--text-soft);
    background: var(--usa-blue-soft);
    border-left: 3px solid var(--usa-blue);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin: 14px 0 0;
    line-height: 1.55;
}
.rules-note b, .rules-note strong { color: var(--usa-blue-dark); }

/* Timeline */
.rules-timeline {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 8px;
}
.rules-tl-step {
    flex: 1 0 130px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px 12px;
    text-align: center;
    position: relative;
}
.rules-tl-step:not(:last-child)::after {
    content: "→";
    position: absolute;
    right: -11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--usa-gold-dark);
    font-weight: 700;
    z-index: 1;
}
.rules-tl-dot {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background: var(--usa-blue);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
}
.rules-tl-step b { display: block; font-size: 13.5px; color: var(--usa-blue-dark); }
.rules-tl-step em { font-style: normal; font-size: 11.5px; color: var(--text-soft); }

/* Steps */
.rules-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.rules-step {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px 18px 18px;
    overflow: hidden;
}
.rules-step::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(var(--usa-gold), var(--usa-gold-dark));
}
.rules-step-num {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--usa-blue-soft);
    color: var(--usa-blue-dark);
    font-weight: 800;
    font-size: 17px;
    margin-bottom: 12px;
}
.rules-step h3 { margin: 0 0 6px; font-size: 15.5px; color: var(--usa-blue-dark); }
.rules-step p { margin: 0; font-size: 13.5px; color: var(--text-soft); line-height: 1.55; }
.rules-step b { color: var(--text); }

/* Score cards */
.rules-score-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 16px;
}
.rules-score-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.rules-score-icon {
    font-size: 22px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    background: var(--usa-blue-soft);
    border-radius: 12px;
    flex-shrink: 0;
}
.rules-score-head h3 { margin: 0; font-size: 18px; color: var(--usa-blue-dark); }
.rules-score-head p { margin: 2px 0 0; font-size: 13px; color: var(--text-soft); }

.rules-pts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rules-pts li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}
.pts-chip {
    flex-shrink: 0;
    display: inline-block;
    min-width: 52px;
    text-align: center;
    background: var(--usa-blue);
    color: #fff;
    font-weight: 700;
    font-size: 12.5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}
.pts-chip.gold { background: var(--usa-gold); color: var(--usa-blue-dark); }
.pts-chip.big { font-size: 14px; padding: 5px 12px; }

/* Two-column explainer */
.rules-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.rules-two-col {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.rules-two-col h4 { margin: 0 0 8px; font-size: 14px; color: var(--usa-blue); }
.rules-two-col p { margin: 0; font-size: 13.5px; color: var(--text-soft); line-height: 1.6; }
.rules-two-col b { color: var(--text); }

/* Score table */
.rules-table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.rules-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 480px; }
.rules-table thead th {
    background: var(--usa-blue);
    color: #fff;
    font-weight: 600;
    text-align: center;
    padding: 10px 12px;
    white-space: nowrap;
}
.rules-table thead th:first-child { text-align: left; }
.rules-table tbody td {
    padding: 10px 12px;
    text-align: center;
    border-top: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.rules-table tbody td:first-child { text-align: left; font-weight: 600; color: var(--usa-blue-dark); }
.rules-table tbody tr:nth-child(even) { background: var(--bg-soft); }
.rules-table tbody tr:last-child {
    background: linear-gradient(to right, rgba(255, 204, 0, .14), rgba(255, 204, 0, .03));
    font-weight: 700;
}

/* Example callout */
.rules-example {
    margin-top: 16px;
    background: linear-gradient(to right, rgba(255, 204, 0, .1), transparent);
    border: 1px solid var(--usa-gold);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.rules-example-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--usa-blue-dark);
    background: var(--usa-gold);
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.rules-example p { margin: 0 0 6px; font-size: 13.5px; }
.rules-example ul { margin: 0; padding-left: 18px; }
.rules-example li { font-size: 13.5px; color: var(--text-soft); line-height: 1.7; }
.rules-example b { color: var(--text); }

/* Champion */
.rules-champion {
    display: flex;
    align-items: center;
    gap: 18px;
    background: linear-gradient(135deg, var(--usa-gold), var(--usa-gold-dark));
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-md);
    margin-top: 8px;
}
.rules-champion-icon { font-size: 42px; line-height: 1; flex-shrink: 0; }
.rules-champion h3 { margin: 0 0 4px; font-size: 19px; color: var(--usa-blue-dark); }
.rules-champion p { margin: 0; font-size: 14px; color: #4a3c00; line-height: 1.55; }
.rules-champion .pts-chip.gold { background: var(--usa-blue-dark); color: var(--usa-gold); }

/* Tips */
.rules-tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}
.rules-tip {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}
.rules-tip > span { font-size: 22px; line-height: 1.2; flex-shrink: 0; }
.rules-tip p { margin: 0; font-size: 13.5px; color: var(--text-soft); line-height: 1.55; }
.rules-tip b { color: var(--text); }

.rules-foot {
    text-align: center;
    color: var(--text-soft);
    font-size: 14px;
    margin: 32px 0 0;
}

@media (max-width: 720px) {
    .rules-hero { padding: 28px 22px; }
    .rules-hero h1 { font-size: 26px; }
    .rules-two { grid-template-columns: 1fr; }
    .rules-champion { flex-direction: column; text-align: center; }
}
