/* ── Reset & variáveis ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:      #16a34a;
    --primary-dark: #15803d;
    --primary-light:#dcfce7;
    --accent:       #f59e0b;
    --accent-light: #fef3c7;
    --danger:       #dc2626;
    --danger-light: #fee2e2;
    --success:      #16a34a;
    --success-light:#dcfce7;
    --bg:           #f0fdf4;
    --surface:      #ffffff;
    --border:       #d1fae5;
    --border-dark:  #a7f3d0;
    --text:         #1c1917;
    --text-muted:   #6b7280;
    --text-light:   #9ca3af;
    --radius:       10px;
    --radius-sm:    6px;
    --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg:    0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
    --font:         'Segoe UI', system-ui, -apple-system, sans-serif;
    --transition:   0.18s ease;
}

/* ── Dark mode ───────────────────────────────────────────────────────────────── */
[data-theme="escuro"] {
    --bg:           #0f172a;
    --surface:      #162032;
    --border:       #1e3a5f;
    --border-dark:  #2d4a7a;
    --text:         #f1f5f9;
    --text-muted:   #94a3b8;
    --text-light:   #64748b;
    --primary:      #22c55e;
    --primary-dark: #16a34a;
    --primary-light:#052e16;
    --accent-light: #1c1407;
    --danger-light: #1c0a0a;
    --success:      #22c55e;
    --success-light:#052e16;
    --shadow:       0 1px 4px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
    --shadow-md:    0 4px 8px rgba(0,0,0,.5), 0 2px 4px rgba(0,0,0,.4);
    --shadow-lg:    0 10px 20px rgba(0,0,0,.6), 0 4px 8px rgba(0,0,0,.4);
}

.logo-dark  { display: none; }
[data-theme="escuro"] .logo-light { display: none; }
[data-theme="escuro"] .logo-dark  { display: block; }

[data-theme="escuro"] .onboarding-banner { background: linear-gradient(135deg, #0d2a1f 0%, #052e16 100%); }
[data-theme="escuro"] .alert-success { color: #86efac; border-color: #166534; }
[data-theme="escuro"] .alert-error   { color: #fca5a5; border-color: #7f1d1d; }
[data-theme="escuro"] .alert-info    { background: #0f2040; color: #7dd3fc; border-color: #1e3a5f; }
[data-theme="escuro"] .info-box      { background: #0f2040; border-color: #1e3a5f; color: #7dd3fc; }
[data-theme="escuro"] .info-box-neutral { background: #162032; border-color: #1e3a5f; color: var(--text-muted); }
[data-theme="escuro"] tr.empate-pendente td { background: #1c1407; }
[data-theme="escuro"] .eg-card.pendente { background: #1c1407 !important; color: #fde68a; }
[data-theme="escuro"] .empate-box    { background: #0f2040; border-color: #1e3a5f; color: #7dd3fc; }
[data-theme="escuro"] .jogo-fase-badge { background: #2d4a7a; color: #cbd5e1; }

html { font-size: 16px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    flex: 1;
    padding: 1.5rem 1rem 3rem;
    user-select: none;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
    background: var(--surface);
    border-bottom: 2px solid var(--border-dark);
    padding: .75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
    overflow: visible;
}
.header-inner { overflow: visible; }

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo { display: flex; align-items: center; text-decoration: none; }
.logo:hover { opacity: .85; }
.logo-img { height: 48px; width: auto; display: block; }

.header-nav { display: flex; gap: .5rem; align-items: center; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .25rem;
    z-index: 101;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 600px) {
    .nav-toggle { display: flex; }

    .header-nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        border-bottom: 2px solid var(--border-dark);
        padding: .75rem 1rem;
        gap: .5rem;
        box-shadow: var(--shadow-md);
        z-index: 100;
    }
    .header-nav.is-open { display: flex; }
    .site-header { position: relative; }
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem;
    margin-top: auto;
}

/* ── Botões ─────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .55rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--font);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }

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

.btn-success {
    background: #059669;
    color: #fff;
    border-color: #059669;
}
.btn-success:hover { background: #047857; }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border-dark);
}
.btn-ghost:hover { background: var(--border); color: var(--text); }

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger-light); }

.btn-sm  { padding: .35rem .85rem; font-size: .8rem; }
.btn-lg  { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-full { width: 100%; }

/* ── Alertas ─────────────────────────────────────────────────────────────────── */
.alert {
    padding: .85rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: .9rem;
    border: 1px solid transparent;
}
.alert-success { background: var(--success-light); color: #166534; border-color: #bbf7d0; }
.alert-error   { background: var(--danger-light);  color: #991b1b; border-color: #fca5a5; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.4;
}
.badge-success { background: var(--success-light); color: #166534; }
.badge-warning { background: var(--accent-light);  color: #92400e; }
.badge-neutral { background: #f3f4f6;              color: #374151; }
.badge-danger  { background: var(--danger-light);  color: #991b1b; }

/* ── Formulários ─────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: .4rem;
    font-size: .9rem;
    color: var(--text);
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="tel"],
select {
    width: 100%;
    padding: .6rem .85rem;
    border: 1.5px solid var(--border-dark);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22,163,74,.15);
}
.required { color: var(--danger); }
.hint { color: var(--text-muted); font-size: .85rem; margin-top: .35rem; }
.mt-1 { margin-top: 1rem; }

.form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}
.form-inline label { font-weight: 600; white-space: nowrap; }
.form-inline select { width: auto; }

/* ── Login ───────────────────────────────────────────────────────────────────── */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}
.brand-icon { font-size: 3rem; display: block; margin-bottom: .5rem; }
.login-brand h1 { font-size: 1.75rem; color: var(--primary); }
.login-brand p  { color: var(--text-muted); margin-top: .5rem; }
.login-logo { width: 260px; height: auto; display: block; margin: 0 auto; }

.login-form .btn { margin-top: .5rem; }

.login-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: .875rem;
    color: var(--text-muted);
}
.login-footer a { color: var(--primary); text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }

.login-hint {
    margin-top: 1.25rem;
    text-align: center;
    font-size: .82rem;
    color: var(--text-muted);
}
.login-hint code {
    background: #f3f4f6;
    padding: .1rem .35rem;
    border-radius: 4px;
    font-size: .82rem;
}

/* ── Dashboard ───────────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}
.page-header h1 { font-size: 1.75rem; }

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}
.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h2 { font-size: 1.4rem; color: var(--text); margin-bottom: .5rem; }
.empty-state p  { margin-bottom: 1.5rem; }

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

.torneio-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}
.torneio-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-top {
    padding: 1.25rem 1.25rem .75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .5rem;
}
.card-title { font-size: 1.1rem; font-weight: 700; line-height: 1.3; flex: 1; }
.card-body { padding: 0 1.25rem .75rem; }
.card-meta {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    font-size: .85rem;
    color: var(--text-muted);
}
.campeao-destaque {
    margin-top: .75rem;
    padding: .5rem .75rem;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    color: #78350f;
}

.card-footer { padding: .75rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .5rem; margin-top: auto; }
.card-footer form { margin: 0; width: 100%; }
.card-actions { display: flex; gap: .35rem; justify-content: flex-end; align-items: center; }

/* ── Wizard ──────────────────────────────────────────────────────────────────── */
.wizard-container {
    max-width: 680px;
    margin: 0 auto;
}

.wizard-header { margin-bottom: 1.5rem; }
.wizard-header h1 { font-size: 1.6rem; margin-top: .5rem; }
.back-link { font-size: .9rem; color: var(--text-muted); }
.back-link:hover { color: var(--primary); }

.wizard-steps-bar {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: .25rem;
}

.wizard-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    opacity: .45;
    transition: opacity var(--transition);
    min-width: 60px;
}
.wizard-step-item.active { opacity: 1; }
.wizard-step-item.done   { opacity: .7; }

.step-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--border-dark);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    transition: background var(--transition), color var(--transition);
}
.wizard-step-item.active .step-circle { background: var(--primary); color: #fff; }
.wizard-step-item.done   .step-circle { background: var(--primary); color: #fff; }
.wizard-step-item span { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }

.step-connector {
    flex: 1;
    height: 2px;
    background: var(--border-dark);
    min-width: 16px;
    margin-bottom: 1.1rem;
}

.wizard-pane { display: none; }
.wizard-pane.active { display: block; }
.wizard-pane h2 { margin-bottom: 1.25rem; font-size: 1.3rem; }

.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* Radio cards */
.radio-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.radio-cards.vertical {
    grid-template-columns: 1fr;
}

.radio-card {
    cursor: pointer;
    display: block;
}
.radio-card input[type="radio"] { display: none; }

.radio-card-content {
    border: 2px solid var(--border-dark);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    transition: border-color var(--transition), background var(--transition);
    background: var(--surface);
}
.radio-card-content:hover { border-color: var(--primary); }
.radio-card input:checked + .radio-card-content {
    border-color: var(--primary);
    background: var(--primary-light);
}

.radio-card-icon { font-size: 1.75rem; margin-bottom: .4rem; }
.radio-card-content strong { display: block; font-size: 1rem; margin-bottom: .25rem; }
.radio-card-content p { font-size: .82rem; color: var(--text-muted); line-height: 1.4; margin: 0; }

/* Jogadores / duplas dinâmicas */
.jogador-row, .dupla-row {
    display: flex;
    gap: .5rem;
    align-items: flex-end;
    margin-bottom: .6rem;
}
.jogador-row input, .dupla-row input { flex: 1; }
.jogador-row select { width: 130px; flex-shrink: 0; }
.btn-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--danger);
    font-size: 1.25rem;
    padding: .4rem .5rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    flex-shrink: 0;
}
.btn-remove:hover { background: var(--danger-light); }

/* Loading */
.loading-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-dark);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Preview sorteio */
.sorteio-preview h3     { font-size: 1.1rem; margin-bottom: .75rem; }
.duplas-preview-list    { list-style: none; display: grid; gap: .45rem; }
.duplas-preview-list li {
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: .55rem 1rem;
    font-size: .9rem;
    border-left: 3px solid var(--primary);
}
.e-slash { color: var(--text-muted); margin: 0 .25rem; }
.preview-legend { margin-top: .5rem; font-size: .8rem; color: var(--text-muted); }
.preview-legend .leg { margin-right: .75rem; }

.grupos-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75rem;
    margin-bottom: .75rem;
}
.grupo-preview-card {
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    border: 1px solid var(--border-dark);
}
.grupo-preview-card h4 { font-size: .95rem; margin-bottom: .5rem; color: var(--primary-dark); }
.grupo-preview-card ul { list-style: none; font-size: .85rem; }
.grupo-preview-card li { padding: .2rem 0; border-bottom: 1px solid var(--border); }
.grupo-preview-card li:last-child { border-bottom: none; }

.preview-info { color: var(--text-muted); font-size: .85rem; margin-top: .5rem; }

.bracket-preview { font-size: .9rem; }

/* ── Dev: preencher jogadores (super-usuário) ───────────────────────────────── */
.dev-fill-wrap {
    margin-top: .9rem;
    padding: .45rem .75rem;
    border: 1px dashed var(--border-dark);
    border-radius: var(--radius-sm);
    background: var(--bg);
    opacity: .75;
    transition: opacity var(--transition);
}
.dev-fill-wrap:hover { opacity: 1; }

.dev-fill-btn {
    font-size: .8rem;
    color: var(--text-muted);
    border-style: dashed !important;
    padding: .2rem .6rem;
}

.dev-fill-form-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .83rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.dev-fill-count-input {
    width: 4rem;
    padding: .2rem .4rem;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    font-size: .85rem;
    text-align: center;
    background: var(--surface);
}

/* ── Animação de sorteio ─────────────────────────────────────────────────────── */
#sorteio-animacao {
    position: relative;
    min-height: 120px;
}

.sa-skip-btn {
    position: absolute;
    top: 0;
    right: 0;
    font-size: .8rem;
    padding: .3rem .75rem;
    z-index: 2;
    opacity: .85;
}
.sa-skip-btn:hover { opacity: 1; }

.sa-stage {
    padding-top: .25rem;
}

.sa-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: .85rem;
    text-align: center;
}
.sa-cat-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--accent);
    margin: 1rem 0 .5rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Pool de jogadores (fase de embaralhamento) */
.sa-pool {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.sa-chip {
    padding: .35rem .75rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 500;
    border: 1.5px solid transparent;
    transition: transform .25s ease;
    user-select: none;
}
.sa-chip--direita  { background: #fef9c3; border-color: #f59e0b; color: #78350f; }
.sa-chip--esquerda { background: #dbeafe; border-color: #3b82f6; color: #1e3a8a; }

.sa-chip.sa-shuffling {
    animation: sa-shake .28s ease infinite;
}

@keyframes sa-shake {
    0%,100% { transform: translateX(0) rotate(0deg); }
    25%      { transform: translateX(-4px) rotate(-3deg); }
    75%      { transform: translateX(4px)  rotate(3deg); }
}

/* Pares revelados */
.sa-pairs {
    display: grid;
    gap: .4rem;
}

.sa-pair {
    display: flex;
    align-items: center;
    gap: .35rem;
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: .5rem .9rem;
    font-size: .9rem;
    transition: opacity .25s ease, transform .3s cubic-bezier(.34,1.56,.64,1);
}
.sa-pair--hidden  { opacity: 0; transform: scale(.85) translateY(6px); }
.sa-pair--visible { opacity: 1; transform: scale(1)   translateY(0); }

.sa-pair-num {
    font-weight: 700;
    color: var(--primary-dark);
    min-width: 1.25rem;
    font-size: .8rem;
}
.sa-pair-sep { color: var(--text-muted); margin: 0 .15rem; }

/* Grupos animados */
.sa-grupos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: .75rem;
}

.sa-grupo {
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.sa-grupo-header {
    background: var(--primary);
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    padding: .4rem .75rem;
    text-align: center;
}

.sa-grupo-body {
    background: var(--primary-light);
    min-height: 2rem;
    padding: .35rem .5rem;
    display: grid;
    gap: .3rem;
}

.sa-grupo-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .35rem .65rem;
    font-size: .82rem;
    transition: opacity .2s ease, transform .3s cubic-bezier(.34,1.56,.64,1);
}
.sa-grupo-item--entering { opacity: 0; transform: translateY(-14px) scale(.9); }
.sa-grupo-item--visible  { opacity: 1; transform: translateY(0)      scale(1); }

/* Chaveamento animado */
.sa-bracket {
    display: grid;
    gap: .45rem;
}

.sa-bracket-match {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    padding: .5rem .9rem;
    font-size: .88rem;
    transition: opacity .2s ease, transform .3s cubic-bezier(.34,1.56,.64,1);
}
.sa-bracket-match--hidden  { opacity: 0; transform: translateX(-12px); }

.sa-bracket-vs  { color: var(--text-muted); font-size: .75rem; margin: 0 .25rem; }
.sa-bracket-bye { color: var(--text-muted); font-style: italic; font-size: .8rem; margin-left: .5rem; }
.sa-bracket-team { font-weight: 500; }
.preview-match {
    padding: .4rem .75rem;
    background: var(--surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    margin-bottom: .4rem;
}
.preview-match.bye { color: var(--text-muted); font-style: italic; }

/* ── Página de Torneio ───────────────────────────────────────────────────────── */
.torneio-header {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.torneio-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}
.torneio-title { font-size: 1.75rem; font-weight: 800; margin-bottom: .5rem; }
.torneio-title-wrapper {
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: text;
    margin-bottom: .5rem;
}
.torneio-title-wrapper .torneio-title { margin-bottom: 0; }
.torneio-title-edit-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: .2rem;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color .15s;
}
.torneio-title-edit-btn:hover { color: var(--text); }
.torneio-title-wrapper:hover .torneio-title-edit-btn { display: flex; align-items: center; }
.torneio-title-input {
    font-size: 1.75rem;
    font-weight: 800;
    border: none;
    border-bottom: 2px solid var(--accent);
    background: transparent;
    color: var(--text);
    outline: none;
    width: 100%;
    padding: 0;
    font-family: inherit;
}
.torneio-title-action-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    padding: .2rem .5rem;
    font-size: 1rem;
    flex-shrink: 0;
    align-self: flex-start;
    transition: background .15s;
}
.torneio-title-confirm-btn { color: #16a34a; }
.torneio-title-cancel-btn  { color: var(--text-muted); }
.torneio-title-action-btn:hover { background: var(--surface-hover, #f3f4f6); }
@media (max-width: 640px) {
    .torneio-title-edit-btn { display: flex; align-items: center; }
}
.torneio-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: .85rem;
    color: var(--text-muted);
}

/* Campeão */
.campeao-banner {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
}
.campeao-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.campeao-trophy  { font-size: 3.5rem; }
.campeao-label   { font-size: .85rem; color: #92400e; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.campeao-nome    { font-size: 2rem; font-weight: 800; color: #78350f; }

/* Accordion duplas */
.duplas-accordion {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
    display: none;
}
.duplas-accordion summary {
    padding: .75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    color: var(--text-muted);
    user-select: none;
    list-style: none;
}
.duplas-accordion summary::-webkit-details-marker { display: none; }
.duplas-accordion summary::before {
    content: '▶';
    display: inline-block;
    font-size: .75rem;
    margin-right: .35rem;
    transition: transform .25s ease;
}
.duplas-accordion[open] summary::before { transform: rotate(90deg); }

.duplas-list-full {
    list-style: none;
    padding: .5rem 1rem 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .35rem;
    border-top: 1px solid var(--border);
    transform-origin: top;
    transition: opacity .3s ease, transform .3s ease;
}

@starting-style {
    .duplas-accordion[open] .duplas-list-full {
        opacity: 0;
        transform: scaleY(.96) translateY(-4px);
    }
}
.duplas-list-full li { font-size: .85rem; }
.dupla-lados { color: var(--text-muted); font-size: .8rem; }

/* Seções */
.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--border-dark);
    color: var(--primary-dark);
}
.section-grupos, .section-chaveamento { margin-bottom: 2.5rem; }

/* Grupos */
.grupos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.grupo-section {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.grupo-title {
    background: var(--primary);
    color: #fff;
    padding: .65rem 1rem;
    font-size: 1rem;
    font-weight: 700;
}

/* Tabela de classificação */
.table-wrapper { overflow-x: auto; }
.classificacao-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}
.classificacao-table th,
.classificacao-table td {
    padding: .5rem .6rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.classificacao-table th { background: var(--primary-light); font-weight: 700; color: var(--primary-dark); }
.classificacao-table td.dupla-nome { text-align: left; font-weight: 600; min-width: 130px; }
.classificacao-table tr:last-child td { border-bottom: none; }
.classificacao-table tr:hover td { background: var(--bg); }

/* Jogos do grupo */
.grupo-jogos { padding: .75rem 1rem; }
.grupo-jogos h4 { font-size: .85rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .6rem; }

.jogo-row {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: .5rem;
    overflow: hidden;
    font-size: .875rem;
}
.jogo-row.finalizado { opacity: .8; }

.jogo-teams {
    /*display: flex;*/
    align-items: center;
/*    gap: .5rem;*/
    padding: .55rem .75rem;
/*    flex-wrap: wrap;*/
}
.jogo-teams .team { flex: 1; min-width: 80px; }
.jogo-teams .team.winner { font-weight: 700; color: var(--primary-dark); }
.vs { color: var(--text-light); font-size: .75rem; font-weight: 600; flex-shrink: 0; padding: 5px; }

.jogo-placar {
 /*   display: flex;*/
    align-items: center;
/*    justify-content: center;*/
/*    gap: .4rem;*/
    padding: .3rem .75rem .55rem;
    font-size: .95rem;
}
.score { font-weight: 700; font-size: 1.1rem; width: 1.8rem; text-align: center; color: var(--text-muted); }
.score.score-win { color: var(--primary); }
.score-sep { color: var(--text-light); margin: 0px 7px; }
.btn-edit-score { font-size: .7rem; padding: .15rem .45rem; opacity: 0; transition: opacity .15s; }
.jogo-row:hover .btn-edit-score { opacity: 1; }

.jogo-form-toggle { padding: .35rem .75rem .55rem; }

/* Formulário inline de placar */
.inline-score-form {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: .75rem;
}
.score-input-row {
 /*   display: flex;*/
    align-items: center;
/*    gap: .5rem;*/
/*    flex-wrap: wrap;*/
    margin-bottom: .5rem;
}
.score-input-row label { font-size: .8rem; flex: 1; min-width: 60px; font-weight: 600; margin: 0px 10px; }
.score-input {
    width: 60px !important;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
}
.form-actions { display: flex; gap: .4rem; }

/* Placar com múltiplos sets */
.sets-detail { font-size: .78rem; color: var(--text-muted); font-weight: 400; }
.sets-input-container { margin-bottom: .5rem; }
.set-row { display: flex; align-items: center; gap: .4rem; margin-bottom: .3rem; }
.set-label { font-size: .75rem; font-weight: 700; color: var(--text-muted); width: 1.5rem; flex-shrink: 0; }
.sets-form-header { display: flex; gap: .4rem; margin-bottom: .2rem; padding-left: 1.9rem; }
.sets-team-label { font-size: .75rem; font-weight: 600; width: 60px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sets-team-label-right { margin-left: 1.15rem; }
.bracket-sets-detail { font-size: .7rem; color: var(--text-muted); padding: .1rem .5rem .3rem; }

/* Lista de torneios no ranking */
.ranking-torneios-section {
    margin-top: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.ranking-torneios-section > summary {
    padding: .75rem 1rem;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.ranking-torneios-section > summary::-webkit-details-marker { display: none; }
.ranking-torneios-section > summary::after {
    content: '▾';
    margin-left: auto;
    font-size: .8rem;
    color: var(--text-muted);
    transition: transform .15s;
}
.ranking-torneios-section[open] > summary::after { transform: rotate(-180deg); }
.ranking-torneios-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 .5rem .5rem;
}
.ranking-torneio-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .6rem .75rem;
    border-radius: calc(var(--radius) - 2px);
    text-decoration: none;
    color: inherit;
    transition: background .12s;
}
a.ranking-torneio-card:hover { background: var(--hover-bg, rgba(0,0,0,.05)); }
.ranking-torneio-card--no-link { cursor: default; color: var(--text-muted); }
.ranking-torneio-nome {
    font-weight: 600;
    font-size: .9rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ranking-torneio-data {
    font-size: .8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Feedback AJAX de placar */
.inline-score-form.saving { opacity: .6; pointer-events: none; }
.score-ajax-error {
    color: var(--danger, #e53e3e);
    font-size: .8rem;
    margin-top: .4rem;
    display: none;
}
@keyframes scoreSavedFlash {
    0%   { background: hsl(140 60% 90%); }
    100% { background: transparent; }
}
.jogo-row.score-saved { animation: scoreSavedFlash .9s ease-out forwards; }

/* ── Bracket (Chaveamento) ───────────────────────────────────────────────────── */
.bracket-wrapper { overflow-x: auto; padding-bottom: .5rem; }
.bracket-hint { font-size: .8rem; color: var(--text-muted); margin-top: .75rem; }

.bracket {
    display: flex;
    gap: 0;
    min-width: max-content;
    padding: .5rem 0 1rem;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.bracket-round-title {
    text-align: center;
    font-size: .78rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .4rem 1rem;
    margin-bottom: .5rem;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    margin: 0 .5rem .75rem;
}

.bracket-games {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
    gap: 12px;
    padding: 0 .5rem;
}

.bracket-game {
    background: var(--surface);
    border: 1.5px solid var(--border-dark);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: box-shadow var(--transition), border-color var(--transition);
    position: relative;
}
.bracket-game.editable { cursor: pointer; }
.bracket-game.editable:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.bracket-game.done { border-color: var(--border); opacity: .9; }

.bracket-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
    min-height: 36px;
}
.bracket-team:last-of-type { border-bottom: none; }
.bracket-team.winner {
    background: var(--primary-light);
    font-weight: 700;
}
.bracket-team.bye { color: var(--text-light); font-style: italic; }
.team-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: .35rem; }
.team-score {
    font-weight: 800;
    font-size: 1rem;
    color: var(--primary);
    min-width: 22px;
    text-align: right;
}
.bracket-team.winner .team-score { color: var(--primary-dark); }

.bracket-form { border-top: 1px solid var(--border); }

.edit-hint {
    text-align: center;
    font-size: .7rem;
    color: var(--primary);
    padding: .25rem .5rem .35rem;
    background: rgba(22,163,74,.05);
    display: none;
}
.bracket-game.editable:hover .edit-hint { display: block; }

/* ── Tabs ────────────────────────────────────────────────────────────────────── */
.tabs {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.tab-bar {
    display: flex;
    background: var(--bg);
    border-bottom: 2px solid var(--border-dark);
}

.tab-btn {
    padding: .7rem 1.4rem;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.tab-btn:hover  { color: var(--primary); background: var(--primary-light); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--surface); }

.tab-pane          { display: none; padding: 1.25rem; }
.tab-pane.active   { display: block; }

/* Sub-abas "Por Rodada / Por Quadra" dentro do pane Jogos */
.jogos-subtab-bar {
    display: flex;
    gap: .25rem;
    padding: .6rem .6rem .2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .5rem;
}
.jogos-subtab-btn {
    padding: .35rem .9rem;
    font-size: .82rem;
    font-weight: 600;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.jogos-subtab-btn:hover  { color: var(--primary); background: var(--primary-light); }
.jogos-subtab-btn.active {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

/* Seção de cada quadra na visão "Por Quadra" */
.jogos-por-quadra { display: flex; flex-direction: column; gap: .75rem; padding: .75rem; }

/* Filtro por dia dentro de "Por Quadra" */
.quadra-day-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .5rem 0 .25rem;
}
.day-filter-btn {
    padding: .2rem .75rem;
    border-radius: 999px;
    border: 1.5px solid var(--border-dark);
    background: var(--surface);
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
    line-height: 1.6;
}
.day-filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.day-filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Accordion de rodada / quadra na aba Jogos */
.jogos-accordion {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.jogos-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem 1rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    cursor: pointer;
    list-style: none;
    user-select: none;
    gap: .5rem;
}
.jogos-accordion-summary::-webkit-details-marker { display: none; }
.jogos-accordion-summary::before {
    content: '▶';
    font-size: .65rem;
    transition: transform .2s ease;
    flex-shrink: 0;
}
.jogos-accordion[open] > .jogos-accordion-summary::before { transform: rotate(90deg); }
.jogos-accordion-progresso {
    font-size: .75rem;
    font-weight: 600;
    opacity: .75;
    margin-left: auto;
    text-transform: none;
    letter-spacing: 0;
}
.jogos-accordion-body {
    padding: .5rem .75rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

/* Quadra accordion — usa cor de destaque no header */
.jogos-por-quadra .jogos-accordion-summary {
    background: var(--accent);
    color: #fff;
}
.jogos-por-quadra .jogos-accordion[open] > .jogos-accordion-summary::before { transform: rotate(90deg); }

/* Controle de quadras — wizard step 1 */
.quadras-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem 1rem;
    padding: .85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: .25rem;
}
.quadras-config-grid .form-group { margin: 0; }
.quadras-config-grid input[type="number"] { width: 100%; }

/* Configuração de dias — wizard step 1 */
.dias-config-section {
    margin-top: .6rem;
    padding: .85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.dias-config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .65rem;
}
.dias-config-header > label {
    font-weight: 600;
    font-size: .9rem;
}
.dia-config-row {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem .5rem;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border);
    margin-bottom: .4rem;
    flex-wrap: wrap;
}
.dia-config-row:last-child { margin-bottom: 0; }
.dia-config-num {
    font-weight: 700;
    font-size: .8rem;
    color: var(--primary-dark);
    min-width: 2.8rem;
    flex-shrink: 0;
}
.dia-label-input {
    flex: 1 1 7rem;
    min-width: 5rem;
    font-size: .85rem;
    padding: .3rem .5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
}
.dia-horarios {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .85rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.dia-horarios input[type="time"] {
    width: 6.2rem;
    font-size: .85rem;
    padding: .3rem .4rem;
}
.btn-remove-dia {
    background: none;
    border: none;
    color: var(--danger, #e53e3e);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: .15rem .35rem;
    border-radius: 4px;
    flex-shrink: 0;
    opacity: .5;
    transition: opacity var(--transition);
}
.btn-remove-dia:hover { opacity: 1; }

/* Badge de quadra e horário nos jogos */
.jogo-schedule {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-right: .5rem;
    flex-shrink: 0;
}
.jogo-quadra {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    border-radius: 4px;
    padding: .1rem .38rem;
    white-space: nowrap;
}
.jogo-horario {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Badge no bracket */
.bracket-schedule {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .6rem .1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .3rem;
}

/* Badge de grupo na aba Jogos (multi-grupo) */
.jogo-grupo-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
    padding: .1rem .45rem;
    margin-right: .4rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Programação por Quadra: outer tab wrapper ───────────────────────────────── */
.prog-outer-tabs { margin-top: .5rem; }
.prog-outer-bar {
    display: flex;
    gap: .25rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0;
}
.prog-outer-btn {
    padding: .55rem 1.1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: .875rem;
    transition: color .15s, background .15s;
}
.prog-outer-btn:hover  { color: var(--primary); background: var(--primary-light, #eef); }
.prog-outer-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.prog-outer-pane          { display: none; }
.prog-outer-pane.active   { display: block; }

/* Category badge shown inside jogo-row in the programação global view */
.jogo-cat-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    background: var(--accent, #6c63ff);
    color: #fff;
    border-radius: 4px;
    padding: .1rem .45rem;
    margin-right: .4rem;
    white-space: nowrap;
    flex-shrink: 0;
}
/* Phase badge for bracket games in programação view */
.jogo-fase-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    background: var(--bg-muted, #f0f0f2);
    color: var(--text-secondary);
    border-radius: 4px;
    padding: .1rem .45rem;
    margin-right: .4rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.jogo-placar--pendente {
    color: var(--text-muted, #aaa);
    font-size: .85rem;
}

/* ── Preview bracket ─────────────────────────────────────────────────────────── */
.bracket-team.ph .team-name {
    font-style: italic;
    color: var(--text-muted, #aaa);
}
.bracket-preview-notice {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--accent-light, #eef4ff);
    border: 1px solid var(--accent, #4f80e1);
    border-radius: var(--radius, 8px);
    color: var(--accent, #4f80e1);
    font-size: .85rem;
    padding: .6rem .9rem;
    margin-bottom: .75rem;
}
.bracket-preview-hint {
    font-size: .8rem;
    color: var(--text-muted);
    margin: -.4rem 0 .75rem;
    padding: 0 .2rem;
}

/* ── Action / Info boxes ─────────────────────────────────────────────────────── */
.action-box {
    background: var(--accent-light);
    border: 1.5px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-top: 1rem;
}
.action-box h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.action-box p  { font-size: .9rem; color: var(--text-muted); margin-bottom: .85rem; }

/* Cartões de avanço (1 grupo) */
.advancement-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: .85rem;
    margin-top: .75rem;
}

.advancement-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: 1.1rem 1rem;
    background: var(--surface);
    border: 2px solid var(--border-dark);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    font-family: var(--font);
    width: 100%;
}
.advancement-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow-md);
}
.adv-icon  { font-size: 2rem; }
.adv-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.adv-desc  { font-size: .8rem; color: var(--text-muted); line-height: 1.4; }

.info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: .85rem 1.25rem;
    color: #1e40af;
    font-size: .9rem;
    margin-top: 1rem;
}

/* ── Jogadores ───────────────────────────────────────────────────────────────── */
.jogadores-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.jogador-form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}
.jogador-form-card h2 { font-size: 1.15rem; margin-bottom: 1.25rem; }

.jogadores-list-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.jogadores-table td,
.jogadores-table th { padding: .6rem .75rem; }
.jogadores-table td:last-child { width: 72px; }

.jogadores-actions { display: flex; gap: .35rem; justify-content: flex-end; align-items: center; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-dark);
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    padding: 0;
}
.btn-icon:hover { background: var(--border); color: var(--text); }
.btn-icon-edit:hover  { border-color: var(--primary); color: var(--primary); background: var(--primary-light, #eff6ff); }
.btn-icon-danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }
.btn-icon-redo:hover  { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

.edit-row td { padding: .5rem .75rem; background: var(--bg); }
.edit-inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.edit-inline-form input[type="tel"] { flex: 1; min-width: 160px; }

/* Jogador selector no wizard */
.jogador-add-row {
    display: flex;
    gap: .5rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.jogador-add-row .typeahead-wrap-outer { flex: 1; min-width: 160px; }
.jogador-add-row select { flex: 0 0 140px; }

.jogadores-selecionados-list { margin-top: .75rem; }

/* Linha de empate na classificação */
tr.empate-pendente td { background: #fffbeb; }
tr.empate-pendente td:first-child::after { content: ' 🎲'; }

/* Caixa de ação de sorteio de empate */
.empate-box {
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-top: .75rem;
}
.empate-box h3 { font-size: 1rem; margin-bottom: .35rem; color: #1e40af; }
.empate-box p  { font-size: .88rem; color: #374151; margin-bottom: .75rem; }

@media (max-width: 720px) {
    .jogadores-layout { grid-template-columns: 1fr; }
}

/* ── Responsividade ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .wizard-steps-bar span { display: none; }
    .step-circle { width: 1.75rem; height: 1.75rem; font-size: .8rem; }
    .radio-cards { grid-template-columns: 1fr; }
    .grupos-grid { grid-template-columns: 1fr; }
    .cards-grid  { grid-template-columns: 1fr; }
    .campeao-nome { font-size: 1.5rem; }
    .score-input-row label { display: none; }
    .torneio-title { font-size: 1.4rem; }
    .bracket-round { min-width: 160px; }
    .login-card { padding: 1.75rem 1.25rem; }
    .torneio-header-top { flex-wrap: wrap; gap: .4rem; }
    .torneio-header-top .badge { order: 2; margin-left: auto; }
    .torneio-header-top .btn-outline { order: 3; width: 100%; text-align: center; }
}

@media (max-width: 400px) {
    .campeao-content { flex-direction: column; }
}

/* ── Rankings ────────────────────────────────────────────────────────────────── */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: .6rem;
    cursor: pointer;
    font-weight: 500;
}
.checkbox-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

/* ── Rankings: responsividade ────────────────────────────────────────────────── */

/* Lista: metadados inline visíveis só no mobile */
.ranking-meta-mobile {
    display: none;
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: .15rem;
}

/* Tabela de lista: ações */
.ranking-col-actions {
    text-align: right;
    white-space: nowrap;
}

/* Tabela de detalhe: rótulos completos/curtos */
.col-label-short { display: none; }
.col-label-full  { display: inline; }

@media (max-width: 640px) {
    /* Formulário: título menor e padding compacto */
    .jogador-form-card { padding: 1rem; }
    .jogador-form-card h2 { font-size: 1rem; margin-bottom: .85rem; }

    /* Lista: esconde colunas secundárias, mostra metadados inline */
    .ranking-list-table .ranking-col-count,
    .ranking-list-table .ranking-col-date { display: none; }
    .ranking-meta-mobile { display: block; }

    /* Lista: botões de ação empilhados */
    .ranking-col-actions {
        white-space: normal;
        text-align: right;
    }
    .ranking-col-actions .btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: .25rem;
    }
    .ranking-col-actions .btn:last-child { margin-bottom: 0; }
    .ranking-col-actions form { display: block !important; }

    /* Detalhe: header empilhado */
    .ranking-detail-header {
        flex-direction: column;
        gap: .75rem;
    }
    .ranking-detail-header .btn { align-self: flex-start; }

    /* Detalhe: células da tabela mais compactas, rótulos abreviados */
    .ranking-detail-table td,
    .ranking-detail-table th { padding: .45rem .3rem; font-size: .82rem; }
    .col-label-full  { display: none; }
    .col-label-short { display: inline; }

    /* Share box: padding reduzido */
    .share-box { padding: .75rem 1rem; }
}

.ranking-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.ranking-detail-header h2 { margin: 0; }
.ranking-detail { width: 100%; }

/* ── Link público ────────────────────────────────────────────────────────────── */
.share-box {
    background: var(--surface, #f8f9fa);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: var(--radius, 8px);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.share-label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: .5rem;
    color: var(--text, #333);
}
.share-row {
    display: flex;
    gap: .5rem;
    align-items: center;
}
.share-input {
    flex: 1;
    font-size: .8rem;
    padding: .4rem .6rem;
    border: 1px solid var(--border, #e0e0e0);
    border-radius: var(--radius-sm, 4px);
    background: var(--bg, #fff);
    color: var(--text, #333);
    min-width: 0;
    cursor: text;
}
.share-hint {
    margin: .5rem 0 0;
    font-size: .78rem;
    color: var(--text-muted, #888);
}
@media (max-width: 500px) {
    .share-row { flex-direction: column; align-items: stretch; }
}

/* ── Paginação ───────────────────────────────────────────────────────────────── */
.paginacao {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: 1rem;
    align-items: center;
}
.paginacao-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: .3rem .6rem;
    font-size: .8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
    transition: background .15s, border-color .15s;
    cursor: pointer;
}
.paginacao-btn:hover:not(.disabled):not(.active) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.paginacao-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    cursor: default;
}
.paginacao-btn.disabled {
    opacity: .4;
    cursor: default;
}

/* ── Toast de desfazer ───────────────────────────────────────────────────────── */
.undo-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #1e1e2e;
    color: #f0f0f0;
    padding: .75rem 1.1rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.35);
    font-size: .9rem;
    z-index: 9999;
    white-space: nowrap;
    animation: undo-in .25s ease;
}
.undo-toast-out {
    animation: undo-out .3s ease forwards;
}
@keyframes undo-in {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes undo-out {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to   { opacity: 0; transform: translateX(-50%) translateY(16px); }
}
.undo-toast-msg {
    font-weight: 500;
}
.undo-toast-btn {
    background: #6c63ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: .35rem .8rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.undo-toast-btn:hover {
    background: #574fd6;
}
.undo-toast-timer {
    font-size: .8rem;
    color: #aaa;
    min-width: 28px;
}
.undo-toast-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.undo-toast-close:hover { color: #fff; }
@media (max-width: 480px) {
    .undo-toast { font-size: .8rem; padding: .65rem .9rem; gap: .5rem; }
}

/* ── Regras de pontuação do ranking ────────────────────────────────────────── */
.scoring-rules {
    background: var(--surface);
    border: 1.5px solid var(--border-dark);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.scoring-rules summary {
    padding: .85rem 1.25rem;
    font-weight: 600;
    font-size: .95rem;
    color: var(--primary-dark);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    transition: background var(--transition);
}
.scoring-rules summary::-webkit-details-marker { display: none; }
.scoring-rules summary::after {
    content: '▸';
    margin-left: auto;
    font-size: .8rem;
    color: var(--text-muted);
    transition: transform var(--transition);
}
.scoring-rules[open] summary::after { transform: rotate(90deg); }
.scoring-rules summary:hover { background: var(--primary-light); }

.scoring-rules-body {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem 2rem;
}

.scoring-section h3 {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .5rem;
}

.scoring-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.scoring-section li {
    font-size: .9rem;
    color: var(--text);
    padding: .2rem 0;
    border-bottom: 1px solid var(--border);
}
.scoring-section li:last-child { border-bottom: none; }

.scoring-section li strong {
    color: var(--primary-dark);
    min-width: 4rem;
    display: inline-block;
}

.scoring-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    background: var(--accent-light);
    color: #92400e;
    border-radius: 99px;
    padding: .1rem .5rem;
    vertical-align: middle;
    text-transform: none;
    letter-spacing: 0;
}

.scoring-note {
    grid-column: 1 / -1;
    font-size: .84rem;
    color: var(--text-muted);
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: .6rem .85rem;
    margin-top: .25rem;
}

/* ── Typeahead (autocomplete de jogadores) ──────────────────────────────────── */
.typeahead-wrap-outer { flex: 1; min-width: 160px; }

.typeahead {
    position: relative;
    width: 100%;
}

.typeahead-input {
    width: 100%;
    padding: .6rem .85rem;
    border: 1.5px solid var(--border-dark);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.typeahead-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22,163,74,.15);
}
.typeahead-input::placeholder { color: var(--text-light); }

.typeahead-list {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1.5px solid var(--border-dark);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
    z-index: 200;
    overscroll-behavior: contain;
}

.typeahead-item {
    padding: .65rem .85rem;
    font-size: .93rem;
    cursor: pointer;
    color: var(--text);
    transition: background var(--transition);
    /* Touch target mínimo */
    min-height: 44px;
    display: flex;
    align-items: center;
}
.typeahead-item:hover,
.typeahead-item:focus {
    background: var(--primary-light);
    outline: none;
}
.typeahead-item + .typeahead-item {
    border-top: 1px solid var(--border);
}

/* Dentro da .dupla-row, os dois typeaheads ficam lado a lado */
.dupla-row .typeahead-wrap-outer {
    flex: 1;
    min-width: 130px;
}

/* Hint abaixo do campo quando lista está vazia */
.typeahead-empty {
    padding: .65rem .85rem;
    font-size: .88rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Opção de cadastrar novo jogador */
.typeahead-create {
    padding: .65rem .85rem;
    font-size: .88rem;
    cursor: pointer;
    color: var(--primary-dark);
    font-weight: 600;
    border-top: 1px dashed var(--border-dark);
    transition: background var(--transition);
    min-height: 44px;
    display: flex;
    align-items: center;
}
.typeahead-create:hover,
.typeahead-create:focus { background: var(--primary-light); outline: none; }

@media (max-width: 600px) {
    .typeahead-list { max-height: 180px; }
    .typeahead-item { font-size: .9rem; }
}

/* ── Barra de progresso global ─────────────────────────────────────────────── */
#global-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
#global-loader.is-loading {
    opacity: 1;
    pointer-events: all;
}
#global-loader .loader {
    width: 48px;
    height: 48px;
    border: 5px solid #fff;
    border-bottom-color: #16a34a;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}
@keyframes rotation {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ── Multi-categoria: abas de categoria ──────────────────────────────────── */

.cat-tabs-section {
    margin-top: 1.5rem;
}

.cat-tabs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.cat-tab-btn {
    padding: .45rem 1.1rem;
    border-radius: 20px;
    border: 2px solid var(--border);
    background: transparent;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    font-family: var(--font);
}

.cat-tab-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.cat-tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.cat-pane { display: none; }
.cat-pane.active { display: block; }

.campeao-categoria { margin-bottom: 1.25rem; }
.campeao-categoria .campeao-nome { font-size: 1.2rem; }

/* ── Multi-categoria: config no wizard ─────────────────────────────────────── */

.categorias-config-section {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.1rem .8rem;
    margin-top: .75rem;
}

.categorias-config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
    gap: .5rem;
}

.categorias-config-header > label {
    font-weight: 600;
    font-size: .93rem;
}

.categoria-config-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
}

.cat-nome-input {
    flex: 3;
    min-width: 0;
    padding: .45rem .7rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: .9rem;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
}

.cat-nome-input:focus {
    outline: none;
    border-color: var(--accent);
}

.cat-ranking-select {
    flex: 2;
    min-width: 0;
    padding: .45rem .6rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: .85rem;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
}

.btn-remove-cat {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    color: var(--text-muted);
    border-radius: 6px;
}

/* Step-2 category bar (wizard) */
#cat-selector-bar {
    margin-bottom: 1rem;
}

#cat-selector-bar .cat-tabs-bar {
    margin-bottom: 0;
}

/* ── Grupos por categoria (step 3 multi-cat) ─────────────────────────────── */
.grupos-cat-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .6rem;
}
.grupos-cat-label {
    flex: 1;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
}
.grupos-cat-select {
    padding: .4rem .6rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: .9rem;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-width: 110px;
}
.grupos-cat-select:focus { outline: none; border-color: var(--accent); }
.grupos-cat-hint {
    font-size: .8rem;
    color: var(--text-muted);
    min-width: 120px;
}

/* ── Pré-visualização do torneio ──────────────────────────────────────────── */
.preview-accordion {
    margin: 1rem 0;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.preview-accordion > summary {
    cursor: pointer;
    padding: .75rem 1rem;
    font-weight: 600;
    font-size: .93rem;
    color: var(--text);
    background: var(--bg-card);
    list-style: none;
    display: flex;
    align-items: center;
    gap: .4rem;
    user-select: none;
}
.preview-accordion > summary::-webkit-details-marker { display: none; }
.preview-accordion > summary::after {
    content: '›';
    margin-left: auto;
    font-size: 1.1rem;
    transition: transform .2s;
}
.preview-accordion[open] > summary::after { transform: rotate(90deg); }
.preview-content {
    padding: 1rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

/* Estatísticas resumo */
.preview-summary {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.preview-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
    min-width: 70px;
}
.preview-stat-val {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}
.preview-stat-lbl {
    font-size: .75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Timeline de fases */
.preview-timeline {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-bottom: .9rem;
}
.preview-tl-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .45rem .75rem;
    background: var(--bg-card);
    border-radius: 7px;
    font-size: .88rem;
    flex-wrap: wrap;
}
.preview-tl-fase {
    font-weight: 600;
    flex: 1;
    min-width: 120px;
}
.preview-tl-time {
    font-family: monospace;
    color: var(--accent);
    font-size: .9rem;
}
.preview-tl-jogos {
    color: var(--text-muted);
    font-size: .82rem;
    white-space: nowrap;
}

/* Detalhe por categoria */
.preview-cats {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin-top: .2rem;
}
.preview-cat-row {
    font-size: .85rem;
    color: var(--text-muted);
    padding: .2rem 0;
    border-top: 1px solid var(--border);
}
.preview-cat-row:first-child { border-top: none; }
.preview-note {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: .6rem;
    font-style: italic;
}
.preview-stat-wide { min-width: 120px; }
.preview-stat-val-sm { font-size: 1rem; font-weight: 700; color: var(--accent); }
.preview-overflow-warn {
    margin-top: .75rem;
    padding: .6rem .85rem;
    background: color-mix(in srgb, var(--warn, #f59e0b) 12%, transparent);
    border: 1.5px solid var(--warn, #f59e0b);
    border-radius: 8px;
    font-size: .85rem;
    color: var(--text);
    line-height: 1.4;
}

/* ── Botão flutuante WhatsApp ──────────────────────────────────────────────── */
.whatsapp-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: .55rem;
    background: #25d366;
    color: #fff;
    border-radius: 50px;
    padding: .65rem 1rem .65rem .75rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    max-width: 52px;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width .35s ease, padding .35s ease, box-shadow .2s;
}
.whatsapp-fab:hover {
    max-width: 220px;
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
    color: #fff;
}
.whatsapp-fab svg { flex-shrink: 0; }
.whatsapp-fab-label { opacity: 0; transition: opacity .25s .1s; }
.whatsapp-fab:hover .whatsapp-fab-label { opacity: 1; }

@media (max-width: 600px) {
    .whatsapp-fab { bottom: 1rem; right: 1rem; }
}

/* ── Nomes de quadras ──────────────────────────────────────────────────────── */
.nomes-quadras-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; }
.nome-quadra-row { display: flex; align-items: center; gap: .65rem; }
.nome-quadra-label { min-width: 80px; font-size: .88rem; color: var(--text-muted); white-space: nowrap; }
.nome-quadra-input { flex: 1; }

/* ── Modal Refazer Torneio ─────────────────────────────────────────────────── */
.refazer-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: refazer-fade-in .2s ease;
}
@keyframes refazer-fade-in {
    from { opacity: 0; } to { opacity: 1; }
}
.refazer-modal {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0,0,0,.22), 0 8px 16px rgba(0,0,0,.12);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    animation: refazer-slide-up .24s cubic-bezier(.34,1.56,.64,1);
}
@keyframes refazer-slide-up {
    from { opacity: 0; transform: translateY(24px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}
.refazer-modal-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 1.4rem 1.5rem 1.2rem;
    color: #fff;
}
.refazer-modal-header .refazer-icon {
    width: 44px; height: 44px;
    background: rgba(255,255,255,.18);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; margin-bottom: .7rem;
}
.refazer-modal-header h3 {
    font-size: 1.1rem; font-weight: 700; margin: 0 0 .2rem;
}
.refazer-modal-header p {
    font-size: .85rem; opacity: .85; margin: 0;
}
.refazer-modal-body { padding: 1.25rem 1.5rem; }
@media (max-width: 440px) {
    .refazer-modal-header { padding: 1.2rem 1.1rem 1rem; }
    .refazer-modal-body   { padding: 1rem 1.1rem; }
    .refazer-modal-footer { padding: 0 1.1rem 1.2rem; }
}
.refazer-config-list {
    list-style: none; margin: 0 0 1.1rem; padding: 0;
    display: flex; flex-direction: column; gap: .45rem;
}
.refazer-config-list li {
    display: flex; align-items: baseline; gap: .5rem;
    font-size: .875rem; color: var(--text);
}
.refazer-config-list li .rcl-label {
    color: var(--text-muted); min-width: 110px; flex-shrink: 0;
}
.refazer-pergunta {
    background: var(--primary-light);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 1.25rem;
    text-align: center;
}
.refazer-modal-footer {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: .6rem;
    padding: 0 1.5rem 1.4rem;
}
.refazer-modal-footer .btn {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 440px) {
    .refazer-modal-footer {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }
    .refazer-modal-footer .btn:first-child {
        grid-column: 1 / -1;
    }
}

/* ── Banner modo suporte admin ─────────────────────────────────────────────── */
.suporte-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #1e3a5f;
    color: #e0eeff;
    padding: .65rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    margin-bottom: 1.25rem;
}
.suporte-banner strong { color: #7dd3fc; }
.suporte-banner-sair {
    color: #fca5a5;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}
.suporte-banner-sair:hover { color: #f87171; text-decoration: none; }
.suporte-sair-nav { color: #f87171 !important; }

/* ── Banner de onboarding ──────────────────────────────────────────────────── */
.onboarding-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid var(--border-dark);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    animation: ob-slide-in .3s ease;
}
@keyframes ob-slide-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.onboarding-banner--saindo {
    animation: ob-slide-out .25s ease forwards;
}
@keyframes ob-slide-out {
    to { opacity: 0; transform: translateY(-8px); max-height: 0; margin: 0; padding: 0; }
}
.onboarding-banner__icon {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
}
.onboarding-banner__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    font-size: .9rem;
}
.onboarding-banner__body strong {
    font-size: 1rem;
    color: var(--primary-dark);
}
.onboarding-banner__body span {
    color: var(--text-muted);
}
.onboarding-banner__actions {
    display: flex;
    gap: .6rem;
    flex-shrink: 0;
    align-items: center;
}
@media (max-width: 600px) {
    .onboarding-banner {
        flex-wrap: wrap;
    }
    .onboarding-banner__actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
}

/* ── Modal "Colar Lista de Participantes" ────────────────────────────────── */
.cl-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: pix-fade-in .2s ease;
}

.cl-modal {
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 24px 48px rgba(0,0,0,.2), 0 8px 16px rgba(0,0,0,.1);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: pix-slide-up .24s cubic-bezier(.34,1.56,.64,1);
}

.cl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.cl-title { margin: 0; font-size: 1rem; font-weight: 700; }
.cl-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: .1rem .4rem;
    border-radius: 4px;
}
.cl-close:hover { background: var(--border); color: var(--text); }

#cl-stage-input,
#cl-stage-processing,
#cl-stage-review {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Stage de revisão: lista scrolla, footer fica sempre visível */
#cl-stage-review {
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}

.cl-textarea {
    display: block;
    width: 100%;
    min-height: 180px;
    padding: .6rem .75rem;
    font-family: monospace;
    font-size: .88rem;
    line-height: 1.5;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    resize: vertical;
    box-sizing: border-box;
    margin-top: .4rem;
}
.cl-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }

.cl-body {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.cl-footer {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: .75rem 1.25rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.cl-duplas-btn-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

/* Review list */
.cl-review-list {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin-top: .35rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.cl-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .55rem .75rem;
    font-size: .875rem;
}
.cl-item.cl-item-erro { border-color: #fca5a5; background: var(--danger-light); }

.cl-item-top {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}
.cl-item-name { font-weight: 600; flex: 1; min-width: 0; }
.cl-lado-label { font-size: .8rem; color: var(--text-muted); }
.cl-lado-select { font-size: .8rem; padding: .15rem .3rem; border-radius: 4px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); cursor: pointer; }
.cl-item-errmsg { font-size: .8rem; color: #991b1b; margin-top: .2rem; }

.cl-sub-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .35rem;
    padding-top: .35rem;
    border-top: 1px solid var(--border);
    font-size: .83rem;
}
.cl-sub-name { flex: 1; min-width: 0; }

.cl-badge {
    font-size: .7rem;
    font-weight: 700;
    padding: .12rem .5rem;
    border-radius: 99px;
    letter-spacing: .02em;
    white-space: nowrap;
}
.cl-badge-novo      { background: #dcfce7; color: #166534; }
.cl-badge-existente { background: #dbeafe; color: #1e40af; }
.cl-badge-erro      { background: #fee2e2; color: #991b1b; }

.cl-conflict {
    width: 100%;
    display: flex;
    gap: .85rem;
    flex-wrap: wrap;
    margin-top: .35rem;
    padding-top: .3rem;
    border-top: 1px dashed var(--border-dark);
    font-size: .82rem;
}
.cl-conflict label {
    display: flex;
    align-items: center;
    gap: .3rem;
    cursor: pointer;
}
.cl-conflict input[type="radio"] { cursor: pointer; }

@media (max-width: 540px) {
    .cl-overlay { align-items: flex-start; padding: 0; }
    .cl-modal { max-height: 100vh; border-radius: 0 0 14px 14px; width: 100%; }
}

/* ── Wizard: opções de sorteio (Step 4) ─────────────────────────────────── */
.sorteio-opcoes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.sorteio-opcao-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.25rem;
    cursor: pointer;
    text-align: center;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.sorteio-opcao-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}
.sorteio-opcao-icon { font-size: 2rem; margin-bottom: .5rem; }
.sorteio-opcao-card h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.sorteio-opcao-card p  { font-size: .85rem; color: var(--text-muted); margin: 0; }
.info-box-neutral {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: .9rem 1rem;
}
@media (max-width: 540px) {
    .sorteio-opcoes { grid-template-columns: 1fr; }
}

/* ── Torneio rascunho ────────────────────────────────────────────────────── */
.rascunho-section {
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.rascunho-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.rascunho-banner-text h2 { font-size: 1.1rem; margin-bottom: .25rem; }
.rascunho-banner-text p  { font-size: .875rem; color: var(--text-muted); margin: 0; }

.participantes-rascunho {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--accent);
}
.participantes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.participantes-header h3 { font-size: .95rem; }
.participantes-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.participante-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .45rem .75rem;
    font-size: .875rem;
}
.participante-nome { display: flex; align-items: center; gap: .4rem; }
.participante-lado { color: var(--text-muted); font-size: .8rem; }
.form-inline-remove { display: flex; }
.btn-xs {
    padding: .15rem .45rem;
    font-size: .75rem;
    border-radius: var(--radius-sm);
    line-height: 1.4;
}
.btn-danger-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--danger);
    cursor: pointer;
}
.btn-danger-ghost:hover { background: var(--danger-light); border-color: var(--danger); }

.add-participante-form {
    background: var(--surface);
    border: 1px dashed var(--border-dark);
    border-radius: var(--radius-sm);
    padding: .75rem;
    margin-bottom: .75rem;
}
.add-participante-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.add-dupla-row .add-dupla-slash { font-weight: 700; color: var(--text-muted); }
.add-jogador-th-wrap { flex: 1; min-width: 160px; }
.form-select-sm {
    padding: .35rem .5rem;
    font-size: .85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
}

/* ── Modal Gerar Chaves — corpo com scroll ─────────────────────── */
.gc-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 1rem 1.25rem;
}
#gc-result { padding: 0; }
#gc-error  { margin: 0; }

/* ── Multi-categoria rascunho ──────────────────────────────────── */
.rascunho-cat-section {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.rascunho-cat-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}
.rascunho-cat-header h3 { margin: 0; font-size: .95rem; font-weight: 700; }
.rascunho-cat-count {
    font-size: .8rem;
    color: var(--text-muted);
    background: var(--border);
    padding: .15rem .5rem;
    border-radius: 99px;
}

/* ── Configurações do sorteio (rascunho) ───────────────────────── */
.rascunho-config {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.rascunho-config h3 {
    font-size: .95rem;
    font-weight: 600;
    margin: 0 0 .75rem;
    color: var(--text);
}
.config-rascunho-form { margin: 0; }
.config-rascunho-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}
.config-rascunho-label {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    font-size: .85rem;
    color: var(--text-muted);
    font-weight: 500;
}
/* ── Configurações de Quadras no Rascunho (CQR) ─────────────────────────── */
.form-input-sm {
    padding: .35rem .5rem;
    font-size: .85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    width: 100%;
    box-sizing: border-box;
}
.cqr-dia-row {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem .5rem;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border);
    margin-bottom: .4rem;
    flex-wrap: wrap;
}
.cqr-dia-row:last-child { margin-bottom: 0; }
.cqr-dia-num {
    font-weight: 700;
    font-size: .8rem;
    color: var(--primary-dark);
    min-width: 2.8rem;
    flex-shrink: 0;
}
.cqr-dia-label {
    flex: 1 1 7rem;
    min-width: 5rem;
    font-size: .85rem;
    padding: .3rem .5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
}
.cqr-dia-horarios {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .85rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.cqr-dia-horarios input[type="time"] {
    width: 6.2rem;
    font-size: .85rem;
    padding: .3rem .4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
}
.cqr-btn-remove-dia {
    background: none;
    border: none;
    color: var(--danger, #e53e3e);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: .15rem .35rem;
    border-radius: 4px;
    flex-shrink: 0;
    opacity: .5;
    transition: opacity var(--transition);
    margin-left: auto;
}
.cqr-btn-remove-dia:hover { opacity: 1; }
.cqr-nome-row { display: flex; align-items: center; gap: .65rem; margin-bottom: .4rem; }
.cqr-nome-label { min-width: 80px; font-size: .88rem; color: var(--text-muted); white-space: nowrap; }
.cqr-nome-input { flex: 1; }
.cqr-feedback { font-size: .85rem; }
.cqr-feedback-success { color: var(--success, #38a169); }
.cqr-feedback-error   { color: var(--danger,  #e53e3e); }

/* ── Editar Programação ──────────────────────────────────────────────────── */
.ep-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    animation: pix-fade-in .18s ease;
}
.ep-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
    gap: 1rem;
}
.ep-header-info h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.ep-header-info p  { margin: .1rem 0 0; font-size: .8rem; color: var(--text-muted); }
.ep-header-actions { display: flex; gap: .5rem; align-items: center; flex-shrink: 0; }
.ep-error {
    padding: .4rem .75rem;
    background: #fee2e2;
    color: #991b1b;
    border-radius: var(--radius-sm);
    font-size: .82rem;
    display: none;
    max-width: 320px;
}
.ep-error.visible { display: block; }
.ep-day-bar {
    display: flex;
    gap: .5rem;
    padding: .6rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-wrap: wrap;
    align-items: center;
}
.ep-day-btn {
    padding: .25rem .7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-dark);
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
    font-size: .8rem;
}
.ep-day-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.ep-legend { display: flex; gap: .75rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.ep-legend-item { display: flex; align-items: center; gap: .3rem; font-size: .72rem; color: var(--text-muted); }
.ep-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ep-body { flex: 1; overflow: auto; padding: 1rem 1.5rem; }
.ep-footer {
    padding: .6rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: .78rem;
    color: var(--text-muted);
    align-items: center;
}
.ep-footer-item { display: flex; align-items: center; gap: .4rem; }
.ep-grid { border-collapse: separate; border-spacing: 4px; }
.ep-grid th {
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 600;
    padding: .4rem .75rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    text-align: center;
    white-space: nowrap;
}
.ep-time-col { text-align: right; padding-right: .75rem; color: var(--text-muted); font-size: .78rem; white-space: nowrap; vertical-align: middle; }
.ep-cell { min-width: 150px; height: 84px; vertical-align: top; }
.ep-card {
    border-radius: var(--radius-sm);
    padding: .45rem .55rem;
    cursor: grab;
    height: 100%;
    box-sizing: border-box;
    position: relative;
    user-select: none;
    border: 1.5px solid transparent;
    transition: box-shadow .12s;
}
.ep-card:hover  { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.ep-card:active { cursor: grabbing; }
.ep-card.dragging { opacity: .35; }
.ep-card.pendente { border-style: dashed; border-color: #d97706 !important; }
.ep-card-cat   { font-size: .68rem; margin-bottom: .15rem; }
.ep-card-teams { font-size: .8rem; font-weight: 600; line-height: 1.25; }
.ep-card-vs    { font-size: .72rem; color: var(--text-muted); }
.ep-card-badge { position: absolute; top: .3rem; right: .35rem; font-size: .62rem; }
.ep-card-badge.finalizado { color: var(--primary); }
.ep-dot-pendente { position: absolute; top: .35rem; right: .35rem; width: 7px; height: 7px; background: #d97706; border-radius: 50%; }
.ep-empty {
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--border-dark);
    font-size: 1.3rem;
    border-radius: var(--radius-sm);
    border: 1.5px dashed var(--border-dark);
    box-sizing: border-box;
    transition: border-color .12s, color .12s;
}
.ep-cell.drag-over .ep-empty,
.ep-cell.drag-over .ep-card { outline: 2px solid var(--primary); outline-offset: -2px; }
.ep-cell.drag-over .ep-empty { border-color: var(--primary); color: var(--primary); }
.ep-card.preview { opacity: .72; border-style: dashed !important; }
.ep-card.touch-selected { outline: 2px solid var(--primary); outline-offset: -2px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent); }
.ep-cell.touch-target .ep-empty,
.ep-cell.touch-target .ep-card { outline: 2px dashed var(--primary); outline-offset: -2px; }
.ep-cell.touch-target .ep-empty { border-color: var(--primary); color: var(--primary); }

@media (max-width: 600px) {
    .ep-header {
        padding: .65rem 1rem;
        flex-wrap: wrap;
        gap: .5rem;
    }
    .ep-header-info p { display: none; }
    .ep-header-actions { gap: .4rem; width: 100%; justify-content: flex-end; }
    .ep-header-actions button { font-size: .78rem; padding: .35rem .65rem; }
    .ep-day-bar { padding: .5rem .75rem; gap: .35rem; }
    .ep-body { padding: .5rem .5rem; }
    .ep-cell { min-width: 110px; height: 76px; }
    .ep-empty { height: 76px; }
    .ep-card-teams { font-size: .74rem; }
    .ep-footer { padding: .5rem .75rem; gap: .6rem; font-size: .72rem; }
}

/* ── editar-programacao: barra de horários ── */
.ep-horarios-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1.5rem;
    padding: .5rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    font-size: .85rem;
}
.ep-horarios-row {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.ep-horarios-label {
    color: var(--text-muted);
    font-weight: 500;
}
.ep-horarios-field {
    display: flex;
    align-items: center;
    gap: .3rem;
}
.ep-time-input {
    font-size: .85rem;
    padding: .15rem .3rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    width: 6rem;
}
.ep-horarios-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: .5rem;
}
.ep-reagendar-aviso {
    font-size: .82rem;
    color: var(--text-muted);
}

/* ── Theme switch ────────────────────────────────────────────────────────────── */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}
.theme-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-track {
    position: absolute;
    inset: 0;
    background: var(--border-dark);
    border-radius: 12px;
    transition: background var(--transition);
}
.switch-track::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform var(--transition);
}
.theme-switch input:checked + .switch-track { background: var(--primary); }
.theme-switch input:checked + .switch-track::after { transform: translateX(20px); }
.theme-switch input:focus-visible + .switch-track {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.pref-row strong {
    display: block;
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .15rem;
}
.pref-row p { font-size: .82rem; color: var(--text-muted); margin: 0; }

/* ── Editar Grupos ─────────────────────────────────────────── */
.eg-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    animation: pix-fade-in .18s ease;
}
.eg-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
    gap: 1rem;
}
.eg-header-info h2  { margin: 0; font-size: 1rem; font-weight: 700; }
.eg-header-hint     { margin: .1rem 0 0; font-size: .8rem; color: var(--text-muted); }
.eg-header-actions  { display: flex; gap: .5rem; align-items: center; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.eg-error {
    padding: .4rem .75rem;
    background: #fee2e2;
    color: #991b1b;
    border-radius: var(--radius-sm);
    font-size: .82rem;
    display: none;
    margin: .5rem 1.5rem;
}
.eg-body {
    flex: 1;
    overflow: auto;
    padding: 1rem 1.5rem;
}
.eg-groups-grid {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}
.eg-group-col {
    flex: 1;
    min-width: 160px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem;
}
.eg-group-title {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .6rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--border);
}
.eg-group-cards { display: flex; flex-direction: column; gap: .45rem; }
.eg-card {
    border-radius: var(--radius-sm);
    padding: .55rem .65rem;
    cursor: grab;
    position: relative;
    user-select: none;
    border: 1.5px solid var(--border);
    background: var(--bg);
    transition: box-shadow .12s, border-color .12s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.eg-card:hover   { box-shadow: 0 2px 8px rgba(0,0,0,.12); border-color: var(--border-dark); }
.eg-card:active  { cursor: grabbing; }
.eg-card.dragging { opacity: .35; }
.eg-card.drag-over { outline: 2px solid var(--primary); outline-offset: -2px; border-color: var(--primary); }
.eg-card.pendente  { border-style: dashed; border-color: #d97706 !important; background: #fffbeb; }
.eg-card.touch-selected {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent);
}
.eg-card.touch-target { outline: 2px dashed var(--primary); outline-offset: -2px; }
.eg-card-name   { font-size: .85rem; font-weight: 600; line-height: 1.3; }
.eg-dot-pendente { width: 7px; height: 7px; background: #d97706; border-radius: 50%; flex-shrink: 0; }

/* ── Editar Duplas ──────────────────────────────────────────────────────── */
.ed-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: .25rem 0;
}

.ed-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .25rem;
    border-radius: 6px;
}

.ed-separator {
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
}

.ed-slot {
    flex: 1;
    padding: .45rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
    display: flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
}

.ed-slot:hover { border-color: var(--border-dark); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.ed-slot.pendente {
    border-style: dashed;
    border-color: #d97706 !important;
    background: #fffbeb;
}

[data-theme="escuro"] .ed-slot.pendente { background: #1c1407; color: #fde68a; }

.ed-slot.ed-slot-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb, 59,130,246),.15);
    cursor: default;
    padding: .3rem .5rem;
}

.ed-jogador-nome {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ed-badge-pend {
    font-size: .7rem;
    font-weight: 500;
    color: #d97706;
    background: #fef3c7;
    border-radius: 4px;
    padding: .1rem .35rem;
    flex-shrink: 0;
}

[data-theme="escuro"] .ed-badge-pend { background: #292110; color: #fbbf24; }

.ed-delete-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: .3rem .45rem;
    cursor: pointer;
    font-size: .95rem;
    line-height: 1;
    color: var(--text-muted);
    transition: color .15s, border-color .15s, background .15s;
}
.ed-delete-btn:hover {
    color: #dc2626;
    border-color: #fca5a5;
    background: #fef2f2;
}
[data-theme="escuro"] .ed-delete-btn:hover {
    background: #2d1515;
    border-color: #7f1d1d;
    color: #f87171;
}
.ed-delete-btn:disabled { opacity: .4; cursor: not-allowed; }

.ed-slot--locked {
    cursor: not-allowed;
    opacity: .55;
}

.ed-slot--locked:hover { border-color: var(--border); box-shadow: none; }

.ed-badge-locked {
    font-size: .7rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--border);
    border-radius: 4px;
    padding: .1rem .35rem;
    flex-shrink: 0;
}

.ed-typeahead-wrap {
    flex: 1;
    min-width: 0;
}

.ed-typeahead-wrap .typeahead { width: 100%; }
.ed-typeahead-wrap .typeahead-input { width: 100%; font-size: .82rem; }

/* ── Adicionar Dupla em Andamento ──────────────────────────────────── */
.ada-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,.1);
}

.ada-suggestion {
    padding: .5rem .75rem;
    cursor: pointer;
    font-size: .85rem;
    transition: background-color .15s;
}

.ada-suggestion:hover {
    background: var(--border);
}

.ada-suggestion-create {
    padding: .5rem .75rem;
    cursor: pointer;
    font-size: .85rem;
    color: var(--primary);
    font-weight: 600;
    transition: background-color .15s;
}

.ada-suggestion-create:hover {
    background: color-mix(in srgb, var(--primary) 10%, transparent);
}

@media (max-width: 600px) {
    .eg-header { padding: .65rem 1rem; flex-wrap: wrap; gap: .5rem; }
    .eg-header-info p { display: none; }
    .eg-header-actions { gap: .4rem; width: 100%; justify-content: flex-end; }
    .eg-header-actions button { font-size: .78rem; padding: .35rem .65rem; }
    .eg-body { padding: .5rem; }
    .eg-groups-grid { gap: .5rem; }
    .eg-group-col { min-width: 140px; padding: .5rem; }
    .eg-card-name { font-size: .78rem; }
}

/* ── Drawer de Configurações ──────────────────────────────────────────────── */
.cfg-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1200;
}
.cfg-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 360px;
    max-width: 95vw;
    background: var(--surface);
    border-left: 1px solid var(--border);
    z-index: 1201;
    display: none;
    flex-direction: column;
    box-shadow: -6px 0 24px rgba(0,0,0,.18);
    animation: cfg-slide-in .22s cubic-bezier(.25,.46,.45,.94);
}
@keyframes cfg-slide-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}
.cfg-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.cfg-drawer-header h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}
.cfg-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem 2rem;
}
.cfg-group {
    margin-bottom: 1.5rem;
}
.cfg-group-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: .5rem;
}
.cfg-card {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    width: 100%;
    text-align: left;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .8rem 1rem;
    margin-bottom: .5rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    font-family: inherit;
    color: var(--text);
}
.cfg-card:hover {
    background: var(--primary-light);
    border-color: var(--border-dark);
}
.cfg-card-title {
    font-size: .88rem;
    font-weight: 600;
}
.cfg-card-desc {
    font-size: .76rem;
    color: var(--text-muted);
}
.cfg-visibility {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .9rem 1rem;
}
.cfg-vis-link-row {
    display: flex;
    gap: .5rem;
    margin-bottom: .75rem;
}
.cfg-vis-input {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .35rem .6rem;
    font-size: .75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cfg-vis-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .82rem;
    cursor: pointer;
    margin-bottom: .4rem;
}
.cfg-vis-check input { accent-color: var(--primary); }
.cfg-vis-actions {
    margin-top: .6rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}
/* Mini-modal de seleção de categoria */
.cfg-cat-overlay {
    position: fixed;
    inset: 0;
    z-index: 1210;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.5);
    padding: 1rem;
}
.cfg-cat-modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 16px 40px rgba(0,0,0,.25);
    padding: 1.25rem;
    width: 100%;
    max-width: 320px;
    animation: pix-slide-up .2s cubic-bezier(.34,1.56,.64,1);
}
.cfg-cat-title {
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: .75rem;
}
.cfg-cat-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    max-height: 60vh;
    overflow-y: auto;
}
.cfg-cat-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .55rem .85rem;
    text-align: left;
    font-size: .88rem;
    cursor: pointer;
    font-family: inherit;
    color: var(--text);
    transition: background .13s, border-color .13s;
}
.cfg-cat-item:hover {
    background: var(--primary-light);
    border-color: var(--border-dark);
}
@media (max-width: 600px) {
    .cfg-drawer { width: 100%; max-width: 100%; }
}

/* ── Plano banners ─────────────────────────────────────────────────── */
.plano-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.plano-banner--verde   { background: #f0fdf4; border: 1px solid #bbf7d0; }
.plano-banner--amarelo { background: #fffbeb; border: 1px solid #fde68a; }
.plano-banner--vermelho { background: #fff7f7; border: 1px solid #fecaca; }
.plano-banner--roxo    { background: #f5f3ff; border: 1px solid #c4b5fd; }

.plano-banner__icon { font-size: 20px; flex-shrink: 0; }
.plano-banner__body { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.plano-banner__body strong { color: #111827; }
.plano-banner__body span   { color: #6b7280; }
.plano-banner__actions { display: flex; gap: 8px; align-items: center; }
.plano-banner__link {
    font-size: 12px;
    font-weight: 600;
    color: #4f46e5;
    text-decoration: underline;
    white-space: nowrap;
    cursor: pointer;
}

/* ── Pane 5 — Pagamento ────────────────────────────────────────────── */
.pane5-opcao {
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 12px;
}
.pane5-opcao--principal {
    border: 2px solid #4f46e5;
    background: #f5f3ff;
}
.pane5-opcao--secundaria {
    border: 1px solid #e5e7eb;
    background: #fff;
}
.pane5-opcao__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.pane5-opcao__titulo { font-size: 14px; font-weight: 700; color: #1e1b4b; }
.pane5-opcao__sub    { font-size: 12px; color: #6b7280; margin-top: 3px; }
.pane5-opcao__preco  { font-size: 22px; font-weight: 800; color: #4f46e5; white-space: nowrap; }
.pane5-opcao__preco span { font-size: 12px; font-weight: 400; color: #6b7280; }

/* ── Conta Tabs ─────────────────────────────────────────────────────────── */
.conta-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.conta-tab {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: color 0.15s;
}

.conta-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.conta-tab:hover:not(.active) { color: var(--text); }

.conta-tab-content { display: none; }
.conta-tab-content.active { display: block; }

.conta-readonly-fields { display: flex; flex-direction: column; }

.conta-readonly-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.conta-readonly-field:last-child { border-bottom: none; }
.conta-readonly-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.125rem; }
.conta-readonly-value { font-size: 0.9rem; color: var(--text); }

.conta-plano-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--primary-light);
    border: 1px solid #bbf7d0;
    border-radius: 0.625rem;
    margin-bottom: 1.25rem;
}

.conta-plano-nome { font-size: 1.125rem; font-weight: 700; color: var(--primary-dark); }
.conta-plano-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.125rem; }

.badge-ativo,
.badge-avulso,
.badge-inativo {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-ativo   { background: #dcfce7; color: #15803d; }
.badge-avulso  { background: #fef9c3; color: #b45309; }
.badge-inativo { background: #fee2e2; color: var(--danger); }
