:root {
    /* Paleta extraída do logo SUPER FTV (preto + dourado + branco) — única
       fonte de verdade de cor. Os tons abaixo (bg/border/text) são apenas
       tintas/variações destas mesmas cores, nomeadas para não repetir hex
       espalhado pelo arquivo — os nomes (--coral, --sun...) são só rótulos
       herdados, não descrevem mais a cor literal. */
    --coral: #1a1712;
    --coral-dark: #000000;
    --coral-soft: #fdf1c7;
    --coral-disabled: #cfc9ba;
    --sky: #a9cbd3;
    --sky-dark: #7fb0bb;
    --sky-soft: #e6f0f3;
    --sand: #e5e1d4;
    --sand-soft: #f5f3ec;
    --sun: #f2b705;
    --gold-soft: #fff6da;
    --ink: #201d18;
    --muted: #8a817a;
    --neutral: #d9d4cd;

    --bs-link-color: var(--coral);
    --bs-link-hover-color: var(--coral-dark);
    --ok: #3f9d6d;
    --ok-bg: #e2f5ea;
    --ok-bg-soft: #f3fbf6;
    --ok-border: #cfe6d9;
    --warn-bg: #fdf0db;
    --warn-text: #b07414;
    --danger: #d6533f;

    /* Escala tipográfica: base reduzida (Bootstrap parte de 16px). Mantém
       margem de leitura para o modo TV do bracket, que usa clamp()/vw. */
    --fs-base: 15px;
}

* { box-sizing: border-box; }

html { font-size: var(--fs-base); }

body {
    font-family: "Quicksand", system-ui, -apple-system, sans-serif;
    background: #ffffff;
    color: var(--ink);
    min-height: 100vh;
}

/* faixa de areia/ondas no rodapé da viewport */
body::after {
    content: "";
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--coral), var(--sun), var(--sky));
    z-index: 5;
}

/* Títulos de destaque (Luckiest Guy): preenchimento amarelo da bola + contorno
   preto a 30% opacidade, no padrão definido para o "ENTRAR" do login. */
.brand-font {
    font-family: "Luckiest Guy", "Quicksand", cursive;
    letter-spacing: .5px;
    color: #fdc303;
    text-shadow:
        -1px -1px 0 rgba(0, 0, 0, .3), 0 -1px 0 rgba(0, 0, 0, .3), 1px -1px 0 rgba(0, 0, 0, .3),
        -1px  0   0 rgba(0, 0, 0, .3),                             1px  0   0 rgba(0, 0, 0, .3),
        -1px  1px 0 rgba(0, 0, 0, .3), 0  1px 0 rgba(0, 0, 0, .3), 1px  1px 0 rgba(0, 0, 0, .3);
}

a { color: var(--coral); }
a:hover { color: var(--coral-dark); }

h1, h2, h3, h4, h5 { font-weight: 700; }

/* ---------- Navbar ---------- */
.navbar {
    background: #ffffff !important;
    border-bottom: 2px solid var(--sand);
    box-shadow: 0 2px 12px rgba(52, 48, 46, .06);
}
.navbar .navbar-brand {
    font-family: "Luckiest Guy", cursive;
    color: #fdc303 !important;
    text-shadow:
        -1px -1px 0 rgba(0, 0, 0, .3), 0 -1px 0 rgba(0, 0, 0, .3), 1px -1px 0 rgba(0, 0, 0, .3),
        -1px  0   0 rgba(0, 0, 0, .3),                             1px  0   0 rgba(0, 0, 0, .3),
        -1px  1px 0 rgba(0, 0, 0, .3), 0  1px 0 rgba(0, 0, 0, .3), 1px  1px 0 rgba(0, 0, 0, .3);
    font-size: 1.3rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.navbar .navbar-brand .navbar-logo {
    width: 32px; height: 32px;
    border-radius: 9px;
    display: inline-block;
    flex: none;
}
.navbar .nav-link {
    color: var(--ink) !important;
    font-weight: 600;
    border-radius: 999px;
    padding: .4rem 1rem !important;
    transition: .15s;
}
.navbar .nav-link:hover { background: var(--coral-soft); color: var(--coral-dark) !important; }
.navbar .nav-link.active { background: var(--coral); color: #fff !important; }

/* dropdowns dos módulos (SuperFtv / Torneios) — mesmo pill do nav-link,
   o caret nativo do Bootstrap já indica que abre um submenu */
.navbar .dropdown-toggle::after { margin-left: .45em; vertical-align: .1em; }
.navbar .dropdown-menu {
    border: none;
    border-radius: 14px;
    padding: .4rem;
    margin-top: .4rem;
    box-shadow: 0 10px 28px rgba(52, 48, 46, .14);
}
.navbar .dropdown-item {
    border-radius: 8px;
    padding: .5rem .75rem;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.navbar .dropdown-item:hover, .navbar .dropdown-item:focus { background: var(--coral-soft); color: var(--coral-dark); }
.navbar .dropdown-item.active { background: var(--coral); color: #fff; }

/* ---------- Botões ---------- */
.btn-primary {
    --bs-btn-bg: var(--coral);
    --bs-btn-border-color: var(--coral);
    --bs-btn-hover-bg: var(--coral-dark);
    --bs-btn-hover-border-color: var(--coral-dark);
    --bs-btn-active-bg: var(--coral-dark);
    --bs-btn-disabled-bg: var(--coral-disabled);
    --bs-btn-disabled-border-color: var(--coral-disabled);
    font-weight: 600;
    border-radius: 999px;
}
.btn-outline-primary {
    --bs-btn-color: var(--coral-dark);
    --bs-btn-border-color: var(--coral);
    --bs-btn-hover-bg: var(--coral);
    --bs-btn-hover-border-color: var(--coral);
    border-radius: 999px;
    font-weight: 600;
}
.btn-sky {
    background: var(--sky); border: none; color: var(--ink);
    border-radius: 999px; font-weight: 600;
}
.btn-sky:hover { background: var(--sky-dark); }
.btn-venceu {
    --bs-btn-bg: var(--neutral);
    --bs-btn-border-color: var(--neutral);
    --bs-btn-color: var(--ink);
    --bs-btn-hover-bg: var(--coral);
    --bs-btn-hover-border-color: var(--coral);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--coral-dark);
    --bs-btn-active-border-color: var(--coral-dark);
    --bs-btn-active-color: #fff;
    font-weight: 600;
    border-radius: 999px;
}

/* ---------- Cards ---------- */
.card {
    border: none;
    border-radius: 18px;
    box-shadow: 0 6px 24px rgba(52, 48, 46, .08);
}
.card-title { color: var(--ink); }
.card-clicavel { transition: box-shadow .15s, transform .15s; overflow: hidden; }
.card-clicavel:hover { box-shadow: 0 10px 28px rgba(52, 48, 46, .14); transform: translateY(-2px); }

.side-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    font-weight: 700; font-size: .8rem; color: #fff;
}
.side-E { background: var(--coral); }
.side-D { background: var(--sky-dark); }

/* ---------- Calendário semanal (dashboard do módulo Treinos) ---------- */
.calendario-semana {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .25rem;
}
.calendario-dia {
    background: var(--sand-soft);
    border: 1px solid var(--sand);
    border-radius: 12px;
    padding: .5rem;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.calendario-dia--hoje {
    border-color: var(--coral);
    background: var(--coral-soft);
}
.calendario-dia-cabecalho {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    margin-bottom: .25rem;
}
.calendario-dia-nome {
    font-size: .68rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.calendario-dia-numero {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    width: 1.8rem;
    height: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.calendario-dia--hoje .calendario-dia-numero { background: var(--coral); color: #fff; }
.calendario-dia-aulas {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    max-height: 220px;
    overflow-y: auto;
}
.calendario-aula {
    display: flex;
    flex-direction: column;
    padding: .3rem .4rem;
    border-radius: 8px;
    font-size: .75rem;
    line-height: 1.25;
    text-decoration: none;
}
.calendario-aula--aberta {
    background: var(--sky-soft);
    color: var(--sky-dark);
    border-left: 3px solid var(--sky-dark);
}
.calendario-aula--concluida {
    background: var(--ok-bg);
    color: var(--ok);
    border-left: 3px solid var(--ok);
}
.calendario-aula-hora { font-weight: 700; }
.calendario-aula-prof { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendario-dia-vazio {
    color: var(--neutral);
    font-size: .75rem;
    text-align: center;
    padding: .3rem 0;
}
.calendario-legenda {
    display: inline-block;
    width: .6rem; height: .6rem;
    border-radius: 50%;
    margin-right: .3rem;
}
.calendario-legenda--aberta { background: var(--sky-dark); }
.calendario-legenda--concluida { background: var(--ok); }

/* ---------- Login (definir-senha / esqueci-senha: card simples) ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(1200px 400px at 50% -10%, var(--sand-soft), transparent),
        linear-gradient(180deg, #fff, var(--sand-soft));
    padding: 1rem;
}
.login-card { max-width: 410px; width: 100%; }
.login-logo {
    width: 84px; height: 84px; margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--sky);
    border: 5px solid var(--coral);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
}

/* ---------- Login principal: card dividido (marca + formulário) ----------
   Painel esquerdo escuro de propósito: logo-mark.png (de img/logo_01.png) tem
   canal alpha com um glow amarelo já embutido, então funde bem num fundo
   escuro. O restante da página fica claro para não pesar a tela toda. */
.auth-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(1100px 520px at 20% -10%, var(--gold-soft), transparent),
        linear-gradient(180deg, #fdfcf9, var(--sand-soft));
    padding: 2rem 1rem;
}
.auth-split {
    display: flex;
    width: 100%;
    max-width: 960px;
    min-height: 560px;
    background: #fff;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(20, 18, 14, .18);
}
.auth-brand {
    flex: 0 0 42%;
    background:
        radial-gradient(700px 420px at 30% 15%, #2a2418, transparent),
        linear-gradient(165deg, #000, #16130d);
    padding: 2.75rem 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
}
.auth-brand-logo { width: min(320px, 100%); height: auto; display: block; margin: 0 auto; }
.auth-brand-copy h2 {
    font-family: "Luckiest Guy", "Quicksand", cursive;
    color: #fff;
    font-size: 1.35rem;
    line-height: 1.25;
    letter-spacing: .3px;
    margin-bottom: .6rem;
}
.auth-brand-copy p {
    color: var(--sun);
    font-weight: 600;
    font-size: .85rem;
    line-height: 1.5;
    margin: 0;
}
.auth-form {
    position: relative;
    flex: 1 1 58%;
    padding: 2.75rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-form h1 { font-size: 2rem; }
.auth-sub { color: var(--muted); }
.auth-back {
    position: absolute;
    top: 1.5rem; right: 1.75rem;
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink) !important;
    background: var(--sand-soft);
    font-size: 1.1rem;
    transition: .15s;
}
.auth-back:hover { background: var(--coral-soft); color: var(--coral-dark) !important; }
.auth-password-wrap { position: relative; }
.auth-password-wrap .form-control { padding-right: 3rem; }
.auth-password-toggle {
    position: absolute;
    top: 50%; right: .9rem; transform: translateY(-50%);
    border: none; background: none; padding: .25rem;
    color: var(--muted);
    line-height: 1;
    font-size: 1.05rem;
}
.auth-password-toggle:hover { color: var(--coral-dark); }
.auth-submit {
    --bs-btn-bg: linear-gradient(90deg, #ffdb4d, #fdc303);
    background: linear-gradient(90deg, #ffdb4d, #fdc303);
    border: none;
    color: var(--coral);
    font-weight: 700;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(253, 195, 3, .4);
}
.auth-submit:hover { color: var(--coral); filter: brightness(1.05); }

@media (max-width: 767.98px) {
    .auth-split { flex-direction: column; min-height: 0; border-radius: 20px; }
    .auth-brand { flex: none; padding: 1.75rem 1.5rem; flex-direction: row; align-items: center; gap: 1rem; }
    .auth-brand-logo { width: 76px; flex: none; margin: 0; }
    .auth-brand-copy p { display: none; }
    .auth-brand-copy h2 { font-size: 1.05rem; margin: 0; }
    .auth-form { padding: 2rem 1.5rem 2.25rem; }
    .auth-back { top: 1rem; right: 1rem; }
}

/* ---------- Tabela / jogos ---------- */
.turn-title {
    font-family: "Luckiest Guy", cursive;
    color: var(--coral);
    letter-spacing: 1px;
}
.round-chip {
    background: var(--sand); color: var(--ink);
    border-radius: 999px; padding: .25rem .9rem;
    font-weight: 700; display: inline-block;
}
.court-tag {
    font-size: .75rem; font-weight: 700; text-transform: uppercase;
    color: var(--muted); letter-spacing: .5px;
}

.match-card { border-left: 6px solid var(--sand); transition: .15s; }
.match-card.is-played { border-left-color: var(--ok); background: var(--ok-bg-soft); }
.match-card.is-pending { border-left-color: var(--sun); }

.team {
    display: flex; flex-direction: column; gap: .25rem;
    flex: 1 1 0; min-width: 0;
}
.team .player { display: flex; align-items: center; gap: .4rem; font-weight: 600; }
.team .player span:not(.side-badge) { overflow-wrap: anywhere; }

/* linha do jogo: time A | placar | time B (sempre horizontal) */
.match-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.score-block {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 0 0 auto;
}
.vs {
    font-family: "Luckiest Guy", cursive;
    color: var(--coral); font-size: 1.15rem;
    line-height: 1;
}
.score-input {
    width: 60px; height: 54px;
    text-align: center; font-weight: 700;
    font-size: 1.5rem; border-radius: 14px;
    border: 2px solid var(--sand);
    padding: .2rem;
}
.score-input:focus {
    border-color: var(--coral);
    box-shadow: 0 0 0 .2rem rgba(232, 121, 78, .2);
}
/* esconde as setas do number input para um visual mais limpo */
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.score-input[type=number] { -moz-appearance: textfield; appearance: textfield; }
/* placar somente-leitura (área pública) */
.score-final {
    display: inline-flex; align-items: center; justify-content: center;
    width: 60px; height: 54px;
    text-align: center; font-weight: 700;
    font-size: 1.5rem; line-height: 1;
}

/* ---------- Abas de turno ---------- */
.turn-tabs { gap: .5rem; }
.turn-tabs .nav-link {
    font-family: "Luckiest Guy", cursive;
    letter-spacing: .5px;
    font-size: .95rem;
    color: var(--coral-dark);
    background: var(--coral-soft);
    border-radius: 999px;
    padding: .4rem 1.2rem;
}
.turn-tabs .nav-link.active {
    background: var(--coral);
    color: #fff;
}

.status-pill {
    border-radius: 999px; font-weight: 700; padding: .2rem .7rem; font-size: .75rem;
}
.status-played { background: var(--ok-bg); color: var(--ok); }
.status-pending { background: var(--warn-bg); color: var(--warn-text); }
.status-live { background: var(--sky); color: var(--ink); }
.status-done { background: var(--neutral); color: var(--ink); }

/* ---------- Ranking ---------- */
.rank-table thead th {
    background: var(--coral); color: #fff; border: none;
    font-weight: 700;
}
.rank-table tbody tr.leader {
    background: linear-gradient(90deg, var(--coral-soft), transparent);
    font-weight: 700;
}
.rank-pos {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--sand); font-weight: 700;
}
.rank-table tbody tr.leader .rank-pos { background: var(--sun); color: var(--coral); }

.progress-thin { height: 10px; border-radius: 999px; background: var(--sand); }
.progress-thin .progress-bar { background: var(--coral); }

/* ---------- Torneio por duplas: chave espelhada ----------
   Tamanhos fluidos: escalam da tela de celular ate TV (clamp + vw).
   O wrap "vaza" do .container para usar a largura toda da tela. */
html { overflow-x: hidden; }
.bracket-wrap {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: clamp(.75rem, 2vw, 2.5rem);
    padding-right: clamp(.75rem, 2vw, 2.5rem);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .75rem;
}
.bk {
    /* numa TV Full HD, as 8 colunas de uma chave de 16 duplas cabem inteiras;
       em telas maiores as colunas crescem (flex-grow) ate o teto do clamp */
    --bk-zoom: .7;
    --bk-col-w: calc(clamp(152px, 9.8vw, 268px) * var(--bk-zoom));
    --bk-gap: calc(clamp(1rem, 1.5vw, 2.5rem) * var(--bk-zoom));
    --bk-fonte: calc(8px * var(--bk-zoom));
    --bk-seed: calc(clamp(18px, 14px + .5vw, 26px) * var(--bk-zoom));
    position: relative;
    display: flex;
    align-items: stretch;
    gap: var(--bk-gap);
    width: max-content;
    min-width: 100%;
    padding: 1rem .25rem;
}
.bk-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}
.bk-line { fill: none; stroke: var(--sky-dark); stroke-width: calc(clamp(1.5px, .16vw, 3px) * var(--bk-zoom)); opacity: .55; }
.bk-line--played { stroke: var(--coral); opacity: .9; }
.bk-col {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: calc(clamp(.7rem, 1.2vw, 1.6rem) * var(--bk-zoom));
    /* cresce para preencher telas grandes; nunca fica menor que o minimo legivel */
    flex: 1 1 var(--bk-col-w);
    min-width: var(--bk-col-w);
    position: relative;
    z-index: 1;
}
.bk-col--final {
    justify-content: center;
    align-items: center;
    gap: .35rem;
    flex-basis: calc(var(--bk-col-w) * 1.12);
    min-width: calc(var(--bk-col-w) * 1.12);
}
.bk-trophy {
    font-size: calc(clamp(1.8rem, 1.2rem + 1.6vw, 3.6rem) * var(--bk-zoom));
    line-height: 1;
    color: var(--sun);
    filter: drop-shadow(0 3px 6px rgba(52,48,46,.25));
}
.bk-champion {
    font-family: "Luckiest Guy", "Quicksand", cursive;
    letter-spacing: .5px;
    font-size: calc(clamp(.92rem, .78rem + .5vw, 1.5rem) * var(--bk-zoom));
    color: var(--muted);
    background: var(--sand-soft);
    border: 2px dashed var(--sand);
    border-radius: 999px;
    padding: .4rem 1.1rem .25rem;
    text-align: center;
    min-width: min(170px, 100%);
    max-width: 100%;
    margin-bottom: .6rem;
}
.bk-champion.is-definido {
    color: var(--coral-dark);
    background: var(--gold-soft);
    border: 2px solid var(--sun);
}
.bk-round-label {
    display: block;
    font-size: 5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--muted);
    text-align: center;
    margin-bottom: .2rem;
}
.bk-match {
    background: #fff;
    border: 1px solid var(--sand);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(52, 48, 46, .08);
    padding: calc(clamp(.3rem, .25rem + .25vw, .6rem) * var(--bk-zoom)) calc(clamp(.4rem, .3rem + .3vw, .7rem) * var(--bk-zoom)) calc(clamp(.4rem, .3rem + .3vw, .7rem) * var(--bk-zoom));
    width: 100%;
}
.bk-match.is-played { border-color: var(--ok-border); }
/* jogo-fantasma (bye x bye) some, como no modelo impresso; coluna 100% fantasma tambem */
.bk-match.bk-ghost { display: none; }
.bk-col:not(.bk-col--final):not(:has(.bk-match:not(.bk-ghost))) { display: none; }
.bk-code {
    display: block;
    font-size: calc(clamp(.56rem, .5rem + .1vw, .72rem) * var(--bk-zoom));
    font-weight: 700;
    color: var(--muted);
    margin: 0 0 .15rem .1rem;
}
.bk-team {
    display: flex;
    align-items: center;
    gap: calc(clamp(.35rem, .3rem + .2vw, .6rem) * var(--bk-zoom));
    background: var(--sky-soft);
    border-radius: 6px;
    padding: calc(.18rem * var(--bk-zoom)) calc(clamp(.3rem, .25rem + .2vw, .55rem) * var(--bk-zoom));
    min-height: calc(clamp(27px, 22px + .6vw, 38px) * var(--bk-zoom));
}
.bk-team + .bk-team { margin-top: .25rem; }
.bk-seed {
    flex: 0 0 var(--bk-seed);
    height: var(--bk-seed);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sky-dark);
    color: #fff;
    font-size: calc(var(--bk-fonte) * .88);
    font-weight: 700;
    border-radius: 5px;
}
.bk-name {
    flex: 1;
    font-size: var(--bk-fonte);
    font-weight: 700;
    line-height: 1.15;
    overflow-wrap: anywhere;
}
.bk-name--vazio { color: var(--muted); font-weight: 600; font-style: italic; }
.bk-team.is-winner { background: var(--coral); color: #fff; }
.bk-team.is-winner .bk-seed { background: #fff; color: var(--coral-dark); }
.bk-team.is-loser { opacity: .5; }
.bk-win-form { margin-left: auto; display: flex; }
.btn-venceu-mini {
    width: calc(clamp(24px, 20px + .8vw, 36px) * var(--bk-zoom));
    height: calc(clamp(24px, 20px + .8vw, 36px) * var(--bk-zoom));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--neutral);
    color: var(--ink);
    font-size: calc(var(--bk-fonte) * .95);
    font-weight: 700;
    line-height: 1;
    transition: .15s;
}
.btn-venceu-mini:hover { background: var(--coral); color: #fff; }
.bk-col--rep .bk-team { background: var(--sand-soft); }
.bk-col--rep .bk-seed { background: var(--muted); }

.bk-header, .bk-header .btn-bracket-zoom, .bk-header .bracket-zoom-label { font-size: 7px; }

.bk-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.bk-legend-item { display: inline-flex; align-items: center; gap: .3rem; }
.bk-drop {
    display: flex;
    align-items: center;
    gap: .3rem;
    margin-top: calc(clamp(.25rem, .2rem + .1vw, .4rem) * var(--bk-zoom));
    font-size: calc(clamp(.56rem, .5rem + .1vw, .72rem) * var(--bk-zoom));
    font-weight: 700;
}
.bk-drop--reto { color: var(--sky-dark); }
.bk-drop--cruza { color: var(--coral-dark); }

@media (max-width: 575.98px) {
    .bk { --bk-col-w: calc(144px * var(--bk-zoom)); --bk-gap: calc(.9rem * var(--bk-zoom)); --bk-fonte: calc(7.2px * var(--bk-zoom)); }
}
.bracket-zoom-controls {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: var(--sand-soft);
    border: 1px solid var(--sand);
    border-radius: 999px;
    padding: .2rem .35rem;
}
.btn-bracket-zoom {
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    font-size: .75rem;
    line-height: 1;
    transition: .15s;
}
.btn-bracket-zoom:hover { background: var(--coral); color: #fff; }
.btn-bracket-zoom:disabled { opacity: .4; pointer-events: none; }
.bracket-zoom-label {
    font-size: .72rem;
    font-weight: 700;
    color: var(--muted);
    min-width: 2.6em;
    text-align: center;
}
/* Tela cheia: mostra so a chave (sem cabecalho/legenda), centralizada e com
   o zoom ajustado por JS para caber inteira sem scroll — pensado para TVs
   onde a pagina toda nao cabe bem. */
.bracket-fullscreen-wrap:fullscreen,
.bracket-fullscreen-wrap:-webkit-full-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    padding: 1rem clamp(.75rem, 2vw, 2.5rem);
    background: var(--sand-soft, #fff);
    overflow: auto;
}
.bracket-fullscreen-wrap:fullscreen .bracket-wrap,
.bracket-fullscreen-wrap:-webkit-full-screen .bracket-wrap {
    margin-left: 0;
    margin-right: 0;
}
.bracket-fullscreen-wrap:fullscreen .bk-header,
.bracket-fullscreen-wrap:-webkit-full-screen .bk-header,
.bracket-fullscreen-wrap:fullscreen .bk-legend,
.bracket-fullscreen-wrap:-webkit-full-screen .bk-legend {
    display: none;
}
.jogo-card {
    border-left: 5px solid var(--sun);
    border-radius: 8px;
    background: #fff;
    padding: .75rem;
    margin-top: .65rem;
    box-shadow: 0 4px 14px rgba(52, 48, 46, .08);
}
.jogo-card.is-played { border-left-color: var(--ok); background: var(--ok-bg-soft); }
.dupla-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    min-height: 38px;
    font-weight: 700;
}
.dupla-line span { overflow-wrap: anywhere; }
.dupla-vencedora {
    color: var(--ok);
    background: var(--ok-bg);
    border-radius: 8px;
    padding: .25rem .4rem;
}
.dupla-eliminada { opacity: .55; }
.jogo-bye {
    color: var(--muted);
    font-weight: 700;
}
.dupla-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    border: 1px solid var(--sand);
    border-radius: 8px;
    padding: .35rem .55rem;
    min-height: 36px;
    font-size: 13px;
    line-height: 1.2;
}
.dupla-list-item span { overflow-wrap: anywhere; }
.dupla-list-item .btn { font-size: 12px; white-space: nowrap; }
.colocacoes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}
.colocacao-item {
    border-radius: 8px;
    background: var(--sand-soft);
    padding: .8rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-height: 78px;
}
.colocacao-item.campeao {
    background: var(--gold-soft);
    border: 2px solid var(--sun);
}

/* ---------- Elenco / seleção ---------- */
.roster-list .list-group-item {
    display: flex; align-items: center; gap: .75rem;
    flex-wrap: wrap; padding-left: 0; padding-right: 0;
}
.roster-list .roster-form { flex: 1 1 240px; }
.roster-list .form-control-sm, .roster-list .form-select-sm { border-radius: 10px; }

.pick-list { max-height: 380px; overflow-y: auto; }
.pick-list .list-group-item label:hover { background: var(--coral-soft); }
.pick-list .pick:checked + .side-badge + .fw-semibold { color: var(--coral-dark); }
.pick-list .form-check-input:checked { background-color: var(--coral); border-color: var(--coral); }
.count-badge { background: var(--sand); color: var(--ink); }
.count-badge.bg-success { color: #fff !important; }

/* ---------- Util ---------- */
.section-pad { padding-top: 1.5rem; padding-bottom: 4rem; }
.flash-area { position: sticky; top: 0; z-index: 10; }

/* ---------- Home pública (Portal Público, Fase 1) ---------- */
.home-hero {
    padding: 3rem 1rem 3rem;
    border-radius: 24px;
    background:
        radial-gradient(1100px 420px at 50% -10%, var(--gold-soft), transparent),
        linear-gradient(180deg, #fdfcf9, var(--sand-soft));
}
.home-hero-title {
    font-size: clamp(1.8rem, 1.3rem + 2vw, 3rem);
    line-height: 1.15;
}
.home-hero-sub {
    max-width: 640px;
    margin: 0 auto;
    color: var(--muted);
    font-weight: 600;
}
.home-hero-features {
    margin-top: 2.75rem;
}
.home-feature {
    background: #fff;
    border-radius: 18px;
    height: 100%;
    padding: 1.75rem 1.25rem;
    box-shadow: 0 10px 28px rgba(26, 23, 18, .08);
}
.home-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--coral-dark);
    color: var(--sun);
    font-size: 1.35rem;
    margin-bottom: 1rem;
}
.home-feature-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: .4rem;
}
.home-feature-desc {
    color: var(--muted);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.45;
    margin: 0;
}
.arena-card-img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: 18px 18px 0 0;
}
.arena-card-img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sand-soft);
    color: var(--neutral);
    font-size: 2.5rem;
}
.arena-card { overflow: hidden; }

/* Busca de torneios do atleta — card de evento abre categorias no próprio
   contexto, mantendo a capa e a identidade visual usadas na home pública. */
.jt-filtros-card { background: var(--sand-soft); }
.jt-evento-card { transition: transform .18s ease, box-shadow .18s ease; }
.jt-evento-card:hover { transform: translateY(-2px); }
.jt-evento-abertura {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
}
.jt-evento-abertura:hover { color: inherit; }
.jt-evento-abertura:focus-visible {
    outline: 3px solid rgba(237, 99, 86, .35);
    outline-offset: -3px;
}
.jt-categorias-resumo {
    color: var(--coral-dark);
    font-size: .8rem;
    font-weight: 700;
}
.jt-detalhe-img { width: 100%; height: 100%; min-height: 260px; object-fit: cover; }
.jt-categorias-detalhe .accordion-item { border: 0; }
.jt-categorias-detalhe .accordion-button { font-weight: 700; padding: 1.25rem; }
.jt-categorias-detalhe .accordion-button:not(.collapsed) {
    color: var(--coral-dark);
    background: var(--coral-soft);
    box-shadow: none;
}
.jt-categoria-acao {
    padding: 1rem;
    border-radius: 14px;
    background: var(--sand-soft);
}

/* Meu histórico do atleta — cards clicáveis que filtram a tabela única
   abaixo (torneios/títulos/pódio agregados entre Arenas). */
.jp-card {
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}
.jp-card:hover { transform: translateY(-2px); }
.jp-card.active {
    background: var(--coral-soft);
    box-shadow: inset 0 0 0 2px var(--coral);
}
.jp-card.active .fs-3 { color: var(--coral-dark); }

@media (prefers-reduced-motion: reduce) {
    .jt-evento-card { transition: none; }
    .jp-card { transition: none; }
}

/* ---------- Rodapé ---------- */
.app-footer { border-top: 1px solid var(--sand); padding: 1.1rem 0 2rem; }
.app-footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .2px;
}
.app-footer strong { color: var(--coral-dark); font-weight: 700; }
.app-footer-ball {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--sun);
    border: 2px solid var(--coral);
    display: inline-block;
}

/* Ícones (Bootstrap Icons) usados junto de texto em botões/links —
   alinhamento e espaçamento consistentes em todo o app. */
.btn i.bi, a i.bi { vertical-align: -.125em; }
.btn i.bi + span, .btn i.bi:not(:last-child) { margin-right: .35rem; }

@media (max-width: 575.98px) {
    .navbar .navbar-brand { font-size: 1.2rem; }
    .match-row { gap: .4rem; }
    .score-block { gap: .3rem; }
    .score-input,
    .score-final { width: 56px; height: 56px; font-size: 1.4rem; }
    .vs { font-size: 1.1rem; }
    .team .player { font-size: .92rem; gap: .3rem; }
    .side-badge { width: 22px; height: 22px; font-size: .72rem; }
    .bracket { min-width: 960px; }
    .bracket-col { flex-basis: 230px; }
    .colocacoes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Pódio final (animação) ---------- */
.podium-replay {
    position: fixed;
    right: 1rem; bottom: 1.25rem;
    z-index: 1040;
    border: none;
    background: var(--coral);
    color: #fff;
    font-weight: 700;
    border-radius: 999px;
    padding: .6rem 1.1rem;
    box-shadow: 0 8px 22px rgba(232, 121, 78, .4);
    cursor: pointer;
    transition: transform .15s, background .15s;
}
.podium-replay:hover { background: var(--coral-dark); transform: translateY(-2px); }

.podium-overlay {
    position: fixed; inset: 0;
    z-index: 1050;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 1.5rem 1rem 2.5rem;
    overflow: hidden;
    background: radial-gradient(1200px 600px at 50% 0%, rgba(52,48,46,.55), rgba(52,48,46,.82));
    backdrop-filter: blur(4px);
}
.podium-overlay.is-open { display: flex; animation: podium-fade .35s ease both; }

.podium-stage {
    position: relative;
    width: 100%;
    max-width: 720px;
    text-align: center;
    color: #fff;
}

.podium-close {
    position: absolute;
    top: -.5rem; right: 0;
    width: 42px; height: 42px;
    border: none; border-radius: 50%;
    background: rgba(255,255,255,.15);
    color: #fff; font-size: 1.6rem; line-height: 1;
    cursor: pointer; transition: background .15s;
}
.podium-close:hover { background: rgba(255,255,255,.3); }

.podium-head { margin-bottom: 1.5rem; }
.podium-overlay.is-open .podium-head { animation: podium-drop .6s .1s ease both; }
.podium-kicker {
    text-transform: uppercase; letter-spacing: 2px;
    font-size: .8rem; font-weight: 700;
    color: var(--sun);
}
.podium-title {
    font-family: "Luckiest Guy", cursive;
    font-size: clamp(1.7rem, 6vw, 2.8rem);
    color: #fff;
    margin: .1rem 0 0;
    text-shadow: 0 4px 18px rgba(0,0,0,.35);
}
.podium-sub { color: rgba(255,255,255,.8); margin: 0; font-weight: 600; }

.podium-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: .5rem;
}
.podium-col { flex: 1 1 0; max-width: 200px; display: flex; flex-direction: column; align-items: center; }

.podium-athlete { display: flex; flex-direction: column; align-items: center; margin-bottom: .5rem; }
.podium-overlay.is-open .col-1 .podium-athlete { animation: athlete-pop .5s .85s ease both; }
.podium-overlay.is-open .col-2 .podium-athlete { animation: athlete-pop .5s 1s ease both; }
.podium-overlay.is-open .col-3 .podium-athlete { animation: athlete-pop .5s 1.15s ease both; }

.medal { font-size: 1.5rem; line-height: 1; filter: drop-shadow(0 3px 6px rgba(0,0,0,.3)); }
.avatar {
    width: 58px; height: 58px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: "Luckiest Guy", cursive;
    font-size: 1.6rem; color: #fff;
    border: 3px solid rgba(255,255,255,.85);
    box-shadow: 0 6px 16px rgba(0,0,0,.3);
    margin: .2rem 0 .4rem;
}
.avatar.champ { width: 76px; height: 76px; font-size: 2.1rem; border-color: var(--sun); }
.pname {
    font-weight: 700; font-size: .95rem; line-height: 1.15;
    max-width: 12ch; overflow-wrap: anywhere;
}
.champ-label {
    font-family: "Luckiest Guy", cursive;
    color: var(--sun); letter-spacing: 1px; font-size: 1rem;
}
.pstats { font-size: .8rem; color: rgba(255,255,255,.75); font-weight: 600; }

.crown {
    font-size: 2.2rem; line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,.35));
}
.podium-overlay.is-open .crown { animation: crown-bounce 1.2s 1.3s ease both; }

.podium-block {
    width: 100%;
    border-radius: 14px 14px 0 0;
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: .6rem;
    transform-origin: bottom;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 6px 18px rgba(255,255,255,.25), 0 -4px 14px rgba(0,0,0,.18);
}
.podium-block .place-num {
    font-family: "Luckiest Guy", cursive;
    font-size: 2rem; color: rgba(255,255,255,.95);
    text-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.block-1 { height: 170px; background: linear-gradient(180deg, var(--sun), var(--coral)); }
.block-2 { height: 120px; background: linear-gradient(180deg, #d4dbe2, #9aa7b3); }
.block-3 { height: 90px;  background: linear-gradient(180deg, #d99a6c, #b06a3c); }

.podium-overlay.is-open .block-1 { animation: block-rise .6s .55s cubic-bezier(.2,.8,.2,1.1) both; }
.podium-overlay.is-open .block-2 { animation: block-rise .6s .35s cubic-bezier(.2,.8,.2,1.1) both; }
.podium-overlay.is-open .block-3 { animation: block-rise .6s .45s cubic-bezier(.2,.8,.2,1.1) both; }

/* brilho que cruza o bloco do campeão */
.block-1::after {
    content: ""; position: absolute; top: 0; left: -60%;
    width: 50%; height: 100%;
    background: linear-gradient(110deg, transparent, rgba(255,255,255,.55), transparent);
    transform: skewX(-18deg);
}
.podium-overlay.is-open .block-1::after { animation: shine 2.2s 1.4s ease-in-out infinite; }

.podium-continue {
    margin-top: 1.4rem;
}
.podium-overlay.is-open .podium-continue { animation: podium-fade .5s 1.5s ease both; }

/* confete */
.confetti-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti {
    position: absolute;
    top: -12vh;
    display: block;
    border-radius: 2px;
    will-change: transform, opacity;
    animation-name: confetti-fall;
    animation-timing-function: linear;
    animation-iteration-count: 1;
}

@keyframes podium-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes podium-drop {
    from { opacity: 0; transform: translateY(-30px) scale(.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes block-rise {
    from { transform: scaleY(0); opacity: 0; }
    to   { transform: scaleY(1); opacity: 1; }
}
@keyframes athlete-pop {
    from { opacity: 0; transform: translateY(18px) scale(.85); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes crown-bounce {
    0%   { opacity: 0; transform: translateY(-14px) rotate(-12deg) scale(.6); }
    60%  { opacity: 1; transform: translateY(4px) rotate(6deg) scale(1.15); }
    100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}
@keyframes shine {
    0%   { left: -60%; }
    60%, 100% { left: 130%; }
}
@keyframes confetti-fall {
    0%   { transform: translateY(0) rotateZ(0); opacity: 1; }
    100% { transform: translateY(120vh) rotateZ(720deg); opacity: .9; }
}

@media (max-width: 575.98px) {
    .avatar { width: 52px; height: 52px; font-size: 1.4rem; }
    .avatar.champ { width: 66px; height: 66px; font-size: 1.9rem; }
    .pname { font-size: .9rem; }
    .block-1 { height: 130px; }
    .block-2 { height: 95px; }
    .block-3 { height: 70px; }
    .podium-block .place-num { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .podium-overlay.is-open,
    .podium-overlay.is-open * { animation: none !important; }
    .podium-overlay.is-open .podium-head,
    .podium-overlay.is-open .podium-athlete,
    .podium-overlay.is-open .podium-block,
    .podium-overlay.is-open .crown,
    .podium-overlay.is-open .podium-continue { opacity: 1; transform: none; }
}
