/* ═══════════════════════════════════════════════════════════════════════
   bichosplay — "Noite de Sorteio"
   Tema dark verde-feltro + dourado. Tipografia: Bricolage Grotesque
   (display) · Archivo (texto) · Spline Sans Mono (números/dados).
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    /* feltro & ouro */
    --bg: #0a0e0b;
    --bg-elev: #0e1410;
    --panel: #111813;
    --panel-2: #18231b;
    --border: #27392c;
    --border-soft: #1e2c22;
    --text: #eaf2e8;
    --muted: #93a795;

    /* acento principal = ouro (nome --accent preservado p/ usos inline) */
    --accent: #e3b04b;
    --accent-2: #34d27b;
    --gold-hi: #f6d27c;
    --gold-deep: #b8862f;
    --ink: #181208;            /* texto sobre ouro */

    /* semânticas de dados */
    --ok: #36d97f;
    --warn: #f4c43d;
    --hot: #ff8a5c;
    --danger: #ff5d5d;

    /* forma & tipo */
    --radius: 14px;
    --radius-sm: 8px;
    --ctl-h: 39px;             /* altura única de inputs, selects e botões */
    --font-display: "Bricolage Grotesque", "Archivo", system-ui, sans-serif;
    --font-body: "Archivo", "Segoe UI", system-ui, sans-serif;
    --font-mono: "Spline Sans Mono", "Cascadia Mono", ui-monospace, monospace;

    --bottombar-h: 62px;
    --shadow-1: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html { scrollbar-color: #2b3d30 var(--bg); }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
}

/* atmosfera: brilho dourado no alto + vinheta esmeralda */
body {
    background:
        radial-gradient(1100px 640px at 88% -12%, rgba(227, 176, 75, .075), transparent 62%),
        radial-gradient(900px 560px at -8% -4%, rgba(52, 210, 123, .055), transparent 58%),
        var(--bg);
    background-attachment: fixed;
}
/* grão de feltro sutil por cima de tudo */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

::selection { background: rgba(227, 176, 75, .35); color: var(--text); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--gold-hi); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* link de pular para conteúdo (a11y) */
.skip-link {
    position: absolute;
    left: 12px; top: -48px;
    background: var(--accent); color: var(--ink);
    font-weight: 700; padding: 8px 14px; border-radius: 8px;
    z-index: 2000; transition: top 150ms ease;
}
.skip-link:focus { top: 12px; color: var(--ink); }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 24px;
}

/* ═══ Topbar ════════════════════════════════════════════════════════════ */
header.topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(10, 14, 11, .82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(227, 176, 75, .14);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
}
.topbar .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    min-width: 0;
}
.topbar .brand:hover { color: var(--text); }
.topbar .brand .logo {
    width: 34px; height: 34px;
    flex: 0 0 auto;
    display: grid; place-items: center;
    font-size: 19px;
    background:
        radial-gradient(120% 120% at 30% 20%, rgba(246, 210, 124, .22), transparent 55%),
        linear-gradient(160deg, #16231a, #0d1410);
    border: 1px solid rgba(227, 176, 75, .45);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}
.topbar .brand .nome {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 19px;
    letter-spacing: .2px;
    background: linear-gradient(92deg, var(--gold-hi), var(--accent) 55%, var(--gold-deep));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}
.topbar .brand small {
    color: var(--muted);
    font-weight: 400;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 1280px) { .topbar .brand small { display: none; } }

.topbar nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.topbar nav a {
    color: var(--text);
    padding: 7px 10px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    transition: background 140ms ease, border-color 140ms ease;
}
.topbar nav a .ico { font-size: 14px; line-height: 1; }
.topbar nav a:hover {
    background: var(--panel-2);
    border-color: var(--border-soft);
    color: var(--text);
}
.topbar nav a.active {
    background: linear-gradient(135deg, var(--gold-hi), var(--accent));
    border-color: var(--gold-deep);
    color: var(--ink);
    font-weight: 700;
    box-shadow: 0 2px 12px rgba(227, 176, 75, .25);
}
.only-mobile { display: none !important; }

/* ═══ Navegação mobile: sheet + bottom bar ══════════════════════════════ */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

.menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 940;
    background: rgba(4, 7, 5, .6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.bottom-bar { display: none; }

@media (max-width: 800px) {
    .only-desktop { display: none !important; }
    .only-mobile { display: flex !important; }

    /* backdrop-filter criaria containing block pro nav fixed (sheet) —
       no mobile o header usa fundo quase opaco, sem blur */
    header.topbar {
        padding: 10px 16px;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(10, 14, 11, .96);
    }

    /* menu vira "sheet" ancorada acima da bottom bar */
    .topbar nav {
        display: flex;
        position: fixed;
        left: 10px; right: 10px;
        bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom, 0px) + 10px);
        z-index: 950;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        background: linear-gradient(180deg, #131c15, #0e1511);
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: 10px;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, .55);
        opacity: 0;
        transform: translateY(12px) scale(.98);
        pointer-events: none;
        transition: opacity 160ms ease, transform 160ms ease;
        max-height: calc(100vh - var(--bottombar-h) - 90px);
        overflow-y: auto;
    }
    .nav-toggle:checked ~ header nav,
    .nav-toggle:checked ~ .topbar nav {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }
    /* o header (sticky) cria stacking context — eleva acima do backdrop
       enquanto o menu estiver aberto, senão a sheet fica escondida */
    .nav-toggle:checked ~ header.topbar { z-index: 955; }
    .nav-toggle:checked ~ .menu-backdrop { display: block; }

    .topbar nav a {
        padding: 13px 14px;
        font-size: 15px;
        border-radius: 10px;
        min-height: 48px;
    }

    /* bottom tab bar */
    .bottom-bar {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 960;
        height: calc(var(--bottombar-h) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: rgba(12, 17, 13, .94);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid rgba(227, 176, 75, .16);
    }
    .bottom-bar a,
    .bottom-bar label {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--muted);
        font-size: 10.5px;
        font-weight: 600;
        letter-spacing: .2px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }
    .bottom-bar .ico { font-size: 19px; line-height: 1; }
    .bottom-bar a.active {
        color: var(--accent);
    }
    .bottom-bar a.active .ico { filter: drop-shadow(0 0 8px rgba(227, 176, 75, .55)); }
    .nav-toggle:checked ~ .bottom-bar label { color: var(--accent); }

    body { padding-bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom, 0px)); }

    .container { padding: 18px 14px; }
}

/* ═══ Tipografia ════════════════════════════════════════════════════════ */
h1, h2, h3 { margin: 0 0 12px 0; line-height: 1.22; }
h1 {
    font-family: var(--font-display);
    font-size: 27px;
    font-weight: 800;
    letter-spacing: .2px;
}
h2 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
}
h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .8px;
}

.section { margin-bottom: 30px; }

/* reveal suave das seções no load */
@media (prefers-reduced-motion: no-preference) {
    .container > .section {
        animation: rise 420ms cubic-bezier(.2, .7, .3, 1) both;
    }
    .container > .section:nth-child(2) { animation-delay: 60ms; }
    .container > .section:nth-child(3) { animation-delay: 120ms; }
    .container > .section:nth-child(4) { animation-delay: 180ms; }
    .container > .section:nth-child(5) { animation-delay: 240ms; }
    .container > .section:nth-child(n+6) { animation-delay: 280ms; }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 38%),
        var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-1);
}

.grid { display: grid; gap: 16px; }
/* Permite que os itens encolham abaixo do conteúdo (senão um conteúdo
   não-quebrável, como um IPv6, estoura a track e gera scroll horizontal). */
.grid > * { min-width: 0; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) {
    .grid.cols-3, .grid.cols-4, .grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
    /* KPIs e grids de 4/5 ficam 2×2 no celular — menos rolagem */
    .grid.cols-4, .grid.cols-5 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

.kv { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.kv .k { color: var(--muted); font-size: 12.5px; }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }

.muted { color: var(--muted); }

/* ═══ Tabelas ═══════════════════════════════════════════════════════════ */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
table th, table td {
    padding: 9px 11px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
}
table td { font-variant-numeric: tabular-nums; }
table th {
    background: var(--panel-2);
    font-weight: 600;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    position: sticky;
    top: 0;
    z-index: 1;
}
table tr:hover td { background: rgba(227, 176, 75, .05); }
.center { text-align: center; }
.right  { text-align: right; }

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
}
.badge.ok     { background: rgba(54, 217, 127, .12); color: var(--ok);   border-color: rgba(54, 217, 127, .35); }
.badge.warn   { background: rgba(244, 196, 61, .12); color: var(--warn); border-color: rgba(244, 196, 61, .35); }
.badge.hot    { background: rgba(255, 138, 92, .13); color: var(--hot);  border-color: rgba(255, 138, 92, .38); }
.badge.danger { background: rgba(255, 93, 93, .13);  color: var(--danger); border-color: rgba(255, 93, 93, .38); }

.bar {
    position: relative;
    height: 6px;
    background: var(--panel-2);
    border-radius: 3px;
    overflow: hidden;
    min-width: 80px;
}
.bar > span {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: linear-gradient(90deg, var(--ok), var(--warn), var(--hot), var(--danger));
    background-size: 200% 100%;
}

.bicho {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.bicho .emoji { font-size: 18px; }
.bicho .grupo { color: var(--muted); font-size: 11px; font-family: var(--font-mono); }

.bicho-card {
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
    transition: transform 140ms ease, border-color 140ms ease;
}
.bicho-card:hover { transform: translateY(-2px); border-color: var(--border); }
.bicho-card .emoji { font-size: 36px; }
.bicho-card .nome  { font-weight: 600; }
.bicho-card .dorm  { font-size: 22px; font-weight: 700; font-family: var(--font-mono); }

/* ═══ Formulários ═══════════════════════════════════════════════════════ */
.controls {
    display: flex; gap: 12px; flex-wrap: wrap;
    margin-bottom: 16px; align-items: center;
}
.controls label {
    color: var(--muted);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.controls input[type=text],
.controls input[type=number],
.controls input[type=date],
.controls input[type=email],
.controls input[type=search],
.controls select,
.controls textarea {
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font: inherit;
    font-size: 14px;
    color-scheme: dark;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}
/* campos de uma linha na altura padrão; textarea só respeita o mínimo */
.controls input[type=text],
.controls input[type=number],
.controls input[type=date],
.controls input[type=email],
.controls input[type=search],
.controls select { height: var(--ctl-h); }
.controls textarea { min-height: var(--ctl-h); }
.controls input[type=number] { width: 100px; font-family: var(--font-mono); }
.controls input:focus,
.controls select:focus,
.controls textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(227, 176, 75, .16);
}
.controls input[type=checkbox] {
    accent-color: var(--accent);
    width: 17px; height: 17px;
}
/* select com seta própria (chevron duplo) e respiro da borda direita */
.controls select {
    width: auto;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a795' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 32px;
}

/* Botão padrão — funciona dentro e fora de .controls */
.btn {
    background: linear-gradient(135deg, var(--gold-hi), var(--accent) 60%, var(--gold-deep));
    color: var(--ink);
    border: 1px solid var(--gold-deep);
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13.5px;
    font-family: inherit;
    /* <a> herda line-height 1.55 do body e <button> usa ~1.2 do UA —
       sem normalizar, botões na mesma linha ficam com alturas diferentes */
    line-height: 1.2;
    min-height: var(--ctl-h); /* mesma altura dos inputs/selects */
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(227, 176, 75, .18);
    transition: filter 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.btn:hover {
    filter: brightness(1.08);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(227, 176, 75, .3);
}
.btn:active { transform: translateY(1px); }
.btn.ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
    box-shadow: none;
}
.btn.ghost:hover { background: var(--panel-2); border-color: var(--accent); filter: none; }
.btn.danger {
    background: transparent;
    border-color: rgba(255, 93, 93, .4);
    color: var(--danger);
    box-shadow: none;
}
.btn.danger:hover { background: rgba(255, 93, 93, .12); filter: none; }
.btn.sm { padding: 4px 9px; font-size: 11.5px; border-radius: 8px; min-height: 0; }
.btn.icon { padding: 4px 8px; min-height: 0; }
.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; }

/* ═══ Grids de formulário responsivos ═══════════════════════════════════ */
/* Substituem grids inline repeat(N,1fr) que esmagavam campos no celular. */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
    margin-bottom: 0;
}
.form-grid .full { grid-column: 1 / -1; }
.form-grid input:not([type=checkbox]),
.form-grid select,
.form-grid textarea { width: 100%; }

/* Linha "campo + botão" que empilha no celular */
.form-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 0;
}
.form-row input:not([type=checkbox]),
.form-row select { width: 100%; }

@media (max-width: 700px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .form-row .btn { width: 100%; justify-content: center; }
}

/* ═══ Toque confortável no mobile ═══════════════════════════════════════ */
@media (max-width: 800px) {
    /* 16px+ evita o auto-zoom do iOS ao focar o campo */
    .controls input[type=text],
    .controls input[type=number],
    .controls input[type=date],
    .controls input[type=email],
    .controls input[type=search],
    .controls select,
    .controls textarea {
        font-size: 16px;
        padding: 11px 12px;
        min-height: 46px;
    }
    .controls select { padding-right: 34px; }
    .controls input[type=checkbox] { width: 22px; height: 22px; }
    .btn { min-height: 46px; padding: 11px 16px; }
    .btn.sm { min-height: 38px; padding: 8px 12px; font-size: 12px; }
    .btn.icon { min-height: 38px; min-width: 38px; justify-content: center; }
}

/* ═══ Tabela → cards no mobile (opt-in: <table class="responsive-cards">,
       células com data-label="...") ═══════════════════════════════════════ */
@media (max-width: 800px) {
    table.responsive-cards { font-size: 14px; }
    table.responsive-cards thead { display: none; }
    table.responsive-cards,
    table.responsive-cards tbody,
    table.responsive-cards tr,
    table.responsive-cards td { display: block; width: 100%; }
    table.responsive-cards tr {
        background: linear-gradient(180deg, rgba(255, 255, 255, .02), transparent 40%), var(--panel-2);
        border: 1px solid var(--border-soft);
        border-radius: 12px;
        margin: 10px;
        width: auto;
        overflow: hidden;
    }
    table.responsive-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        text-align: right;
        border-bottom: 1px dashed var(--border-soft);
        padding: 9px 14px;
    }
    table.responsive-cards td:last-child { border-bottom: none; }
    table.responsive-cards td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: .5px;
        font-weight: 600;
        text-align: left;
        flex: 0 0 auto;
    }
    table.responsive-cards td:not([data-label]) { justify-content: flex-end; }
    table.responsive-cards td:not([data-label])::before { content: none; }
    table.responsive-cards td.acoes { justify-content: stretch; }
    table.responsive-cards td.acoes > * { flex: 1; }
    table.responsive-cards tr:hover td { background: transparent; }
}

/* ═══ Perseguição: CTA da próxima aposta ════════════════════════════════ */
.cta-aposta {
    border-color: rgba(227, 176, 75, .4);
    background:
        radial-gradient(420px 200px at 0% 0%, rgba(227, 176, 75, .12), transparent 70%),
        var(--panel);
    box-shadow: 0 0 0 1px rgba(227, 176, 75, .08), 0 10px 36px rgba(0, 0, 0, .4);
}
.cta-aposta .valor-grande {
    font-family: var(--font-mono);
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(92deg, var(--gold-hi), var(--accent) 60%, var(--gold-deep));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.outcomes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}
.outcome {
    background: var(--panel-2);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 10px 12px;
}
.outcome .t {
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 2px;
}
.outcome .v { font-weight: 700; font-family: var(--font-mono); font-size: 15px; }
.outcome.ganha { border-color: rgba(54, 217, 127, .35); }
.outcome.ganha .v { color: var(--ok); }
@media (max-width: 700px) {
    .outcomes { grid-template-columns: 1fr; }
    .cta-aposta .valor-grande { font-size: 34px; }
}

/* checkbox em linha dentro de .controls (ex.: "Ganhou?") */
.controls label.check-inline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    align-self: end;
    min-height: 38px;
    font-size: 14px;
    color: var(--text);
}
@media (max-width: 800px) {
    .controls label.check-inline { min-height: 46px; }
}

/* barra de ações (rodapé da perseguição) */
.acoes-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.acoes-bar .sep { flex: 1; }
@media (max-width: 700px) {
    .acoes-bar { flex-direction: column; align-items: stretch; }
    .acoes-bar .sep { display: none; }
    .acoes-bar form { width: 100%; display: flex; }
    .acoes-bar .btn { width: 100%; justify-content: center; }
}

/* célula vazia não vira "linha fantasma" nos cards mobile */
@media (max-width: 800px) {
    table.responsive-cards td:empty { display: none; }
    table.responsive-cards .so-desktop { display: none; }
}

/* texto inline que só aparece no mobile (ex.: rótulo de botão-ícone) */
.only-mobile-inline { display: none; }
@media (max-width: 800px) {
    .only-mobile-inline { display: inline; }
}

/* ═══ Barra de progresso ════════════════════════════════════════════════ */
.progress-bar {
    width: 100%; height: 10px;
    background: var(--panel-2);
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}
.progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--gold-deep), var(--accent), var(--gold-hi));
    transition: width 300ms ease-out;
    box-shadow: 0 0 8px rgba(227, 176, 75, .4);
}
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, .18) 50%,
        transparent 100%);
    background-size: 200% 100%;
    animation: progress-shine 1.6s linear infinite;
    pointer-events: none;
}
@keyframes progress-shine {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ═══ Mosaico de repetições ═════════════════════════════════════════════ */
.mosaico { display: flex; flex-direction: column; gap: 3px; min-width: 760px; }
.mosaico-head, .mosaico-linha {
    display: grid;
    grid-template-columns: 70px repeat(6, 1fr);
    gap: 3px;
    align-items: stretch;
}
.mosaico-head .cab {
    background: var(--panel-2); border: 1px solid var(--border-soft);
    padding: 6px 4px; text-align: center; border-radius: 5px;
    font-weight: 600; font-size: 12px;
}
.mosaico-linha .data {
    background: var(--panel-2); border: 1px solid var(--border-soft);
    padding: 8px 4px; text-align: center; border-radius: 5px;
    font-weight: 600; font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.mosaico-linha.eh-hoje .data {
    background: linear-gradient(135deg, rgba(227, 176, 75, .18), rgba(227, 176, 75, .05));
    border-color: rgba(227, 176, 75, .5);
    color: var(--accent);
}
.mosaico-linha .cel {
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    padding: 6px 4px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2px;
    text-align: center;
    min-height: 56px;
    transition: transform 100ms ease;
    cursor: default;
    position: relative;
}
.mosaico-linha .cel:hover { transform: scale(1.05); z-index: 2; }
.mosaico-linha .cel .emj { font-size: 20px; line-height: 1; }
.mosaico-linha .cel .nm { font-size: 10px; font-weight: 600; opacity: 0.95; }
.mosaico-linha .cel .cnt {
    position: absolute; top: 2px; right: 4px;
    font-size: 9px; font-weight: 800; color: var(--warn);
}
.mosaico-linha .cel.vazia {
    background: var(--panel-2); border-style: dashed; opacity: 0.4;
    color: var(--muted); font-size: 14px;
}
.mosaico-linha .cel.cel-rep {
    box-shadow: 0 0 0 2px rgba(52, 210, 123, .55) inset;
}
.mosaico-linha .cel.cel-trio {
    box-shadow: 0 0 0 2px var(--accent) inset, 0 0 12px rgba(227, 176, 75, .4);
}

/* Hoje — grid grande */
.hoje-grid {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
}
.hoje-cel {
    background: var(--panel-2); border: 1px solid var(--border-soft);
    border-radius: 6px; padding: 8px 4px; text-align: center; min-height: 80px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.hoje-cel .hor { font-size: 11px; font-weight: 600; color: var(--muted); font-family: var(--font-mono); }
.hoje-cel.cel-rep {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(227, 176, 75, .13), var(--panel-2));
}
.hoje-cel.vazia { opacity: 0.7; }

/* Candidato a repetir */
.cand-linha {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; margin: 3px 0;
    background: rgba(255, 255, 255, .02);
    border-radius: 8px; text-decoration: none; color: inherit;
    border: 1px solid transparent;
}
.cand-linha:hover {
    background: rgba(227, 176, 75, .07);
    border-color: rgba(227, 176, 75, .3);
    text-decoration: none;
    color: inherit;
}

/* Matriz from-to */
.matriz-from-to {
    border-collapse: separate; border-spacing: 2px; width: 100%; font-size: 12px;
}
.matriz-from-to th, .matriz-from-to td {
    padding: 6px 8px; text-align: center; border-radius: 4px;
    background: var(--panel-2); border: none;
}
.matriz-from-to th { color: var(--muted); font-size: 11px; }

/* cel-bicho usado em pillBicho() */
.cel-bicho {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 5px;
    border: 1px solid var(--border); font-size: 12px;
}
.cel-bicho .emj { font-size: 14px; }

@media (max-width: 700px) {
    .mosaico { min-width: 580px; }
    .mosaico-linha .cel .nm { display: none; }
    .hoje-grid { gap: 4px; }
    .hoje-cel { min-height: 64px; padding: 4px 2px; }
}

/* Em grids de formulário (.controls com display:grid), botões sem label em cima
   precisam alinhar com a base do input — não com o topo da célula. */
.controls > .btn,
.controls > button.btn,
.controls > div > button.btn,
.controls > div > .btn { align-self: end; }

.banca-pill {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
    margin-right: 4px;
    margin-bottom: 4px;
}

.matriz {
    display: grid;
    grid-template-columns: 130px repeat(auto-fit, minmax(70px, 1fr));
    gap: 4px;
    font-size: 12px;
}
.matriz .h, .matriz .b {
    background: var(--panel-2);
    padding: 6px 8px; border-radius: 6px;
    text-align: center;
}
.matriz .h { font-weight: 600; color: var(--muted); }
.matriz .cell {
    padding: 6px 4px;
    border-radius: 6px;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    font-size: 11.5px;
}

/* heat re-tunado pro feltro */
.heat-0 { background: rgba(54, 217, 127, .10);  color: #b9f2d1; }
.heat-1 { background: rgba(54, 217, 127, .19);  color: #d5f8e4; }
.heat-2 { background: rgba(244, 196, 61, .18);  color: #f8e6ad; }
.heat-3 { background: rgba(255, 138, 92, .22);  color: #ffcdb5; }
.heat-4 { background: rgba(255, 93, 93, .30);   color: #ffd4d4; }

/* ═══ Footer ════════════════════════════════════════════════════════════ */
footer.foot {
    border-top: 1px solid rgba(227, 176, 75, .14);
    margin-top: 28px;
    padding: 30px 24px calc(22px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, transparent, rgba(13, 19, 14, .8));
    color: var(--muted);
    font-size: 13px;
}
.foot-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 28px;
}
.foot h4 {
    margin: 0 0 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text);
    font-weight: 700;
}
.foot .foot-brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 17px;
    background: linear-gradient(92deg, var(--gold-hi), var(--accent) 55%, var(--gold-deep));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
}
.foot nav.foot-links { display: grid; gap: 6px; }
.foot nav.foot-links a { color: var(--muted); }
.foot nav.foot-links a:hover { color: var(--accent); }
.foot a.mail {
    color: var(--accent);
    font-weight: 600;
    word-break: break-all;
}
.foot .foot-base {
    max-width: 1400px;
    margin: 22px auto 0;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
    font-size: 12px;
    text-align: center;
}
@media (max-width: 800px) {
    .foot-grid { grid-template-columns: 1fr; gap: 20px; }
    footer.foot { padding-bottom: calc(var(--bottombar-h) + 24px); }
}

.spark { width: 100%; height: 60px; }

.kpi {
    display: flex; flex-direction: column; gap: 4px;
    padding: 14px 16px;
}
.kpi .lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.kpi .val {
    font-size: 25px;
    font-weight: 700;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.5px;
}
@media (max-width: 700px) {
    .kpi { padding: 11px 12px; }
    .kpi .val { font-size: 20px; }
}

/* Texto longo não-quebrável (ex.: IPv6) truncado com reticências;
   o valor completo fica no title (hover). */
.cell-ellipsis {
    display: inline-block;
    max-width: min(58vw, 240px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.tablebox {
    overflow-x: auto;
    max-height: 70vh;
    overflow-y: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    -webkit-overflow-scrolling: touch;
}

/* ═══ Tooltip (renderizado por assets/tooltip.js em portal) ═════════════ */
.tip {
    border-bottom: 1px dotted var(--muted);
    cursor: help;
}
td.tip, .cell.tip { border-bottom-style: solid; cursor: help; }

.help-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px;
    border-radius: 50%;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
    cursor: help;
}
.help-ico:hover { color: var(--accent); border-color: var(--accent); }

details.glossario { margin-top: 16px; }
details.glossario > summary {
    cursor: pointer; padding: 9px 13px;
    background: var(--panel-2); border: 1px solid var(--border-soft);
    border-radius: 10px; font-weight: 600; color: var(--muted);
    list-style: none;
}
details.glossario > summary::-webkit-details-marker { display: none; }
details.glossario > summary::before { content: '▸ '; transition: transform 200ms ease; display: inline-block; }
details.glossario[open] > summary::before { content: '▾ '; }
details.glossario .card { margin-top: 8px; }
details.glossario dl { margin: 0; display: grid; grid-template-columns: 140px 1fr; gap: 6px 16px; }
details.glossario dt { font-weight: 600; color: var(--accent); }
details.glossario dd { margin: 0; color: var(--text); }
@media (max-width: 700px) {
    details.glossario dl { grid-template-columns: 1fr; gap: 2px; }
    details.glossario dd { margin-bottom: 10px; color: var(--muted); }
}

/* ═══ Linhas/células de valor positivo/negativo ═════════════════════════ */
tr.inv-pos td { background: rgba(54, 217, 127, .06); }
tr.inv-neg td { background: rgba(255, 93, 93, .06); }
td.inv-pos    { color: var(--ok); }
td.inv-neg    { color: var(--danger); }

/* ═══ Painel PT-Rio ═════════════════════════════════════════════════════ */
.painel-topo {
    display: flex; justify-content: space-between; align-items: center;
    gap: 24px; flex-wrap: wrap;
    background:
        linear-gradient(135deg, rgba(227, 176, 75, .10), rgba(52, 210, 123, .06)),
        var(--panel);
}
.painel-agora .hora-grande {
    font-size: 48px; font-weight: 700; line-height: 1;
    font-family: var(--font-mono);
    background: linear-gradient(92deg, var(--gold-hi), var(--accent) 60%, var(--gold-deep));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.painel-prox { text-align: right; }
.painel-prox .prox-grande {
    font-size: 28px; font-weight: 700; margin-top: 4px;
    font-family: var(--font-mono);
}
.painel-prox .prox-sigla {
    color: var(--accent);
    margin-right: 8px;
}
.painel-prox .prox-hora { color: var(--text); }

.sorteio-card { transition: border-color 150ms ease, transform 150ms ease; }
.sorteio-card.painel-saiu { opacity: 0.85; }
.sorteio-card.painel-agora-sorteio {
    border-color: var(--warn);
    box-shadow: 0 0 0 2px rgba(244, 196, 61, .18);
}
.sorteio-card.painel-atrasado { border-color: rgba(255, 93, 93, .4); }
.sorteio-card.painel-proximo {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(227, 176, 75, .25);
}
.sorteio-card.painel-futuro { opacity: 0.75; }
.sorteio-card.painel-pulado {
    opacity: 0.55;
    border-style: dashed;
}

@media (max-width: 700px) {
    .painel-topo { flex-direction: column; align-items: flex-start; }
    .painel-prox { text-align: left; }
    .painel-agora .hora-grande { font-size: 38px; }
}

/* ═══ Perfil + login ════════════════════════════════════════════════════ */
.perfil-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.perfil-foto {
    width: 72px; height: 72px; border-radius: 50%;
    object-fit: cover; border: 2px solid var(--border); flex-shrink: 0;
}
.perfil-foto-ph {
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; background: var(--panel-2);
}

/* Heatmap de atividade (estilo GitHub) */
.heatmap-wrap { position: relative; }
.heatmap-scroll { overflow-x: auto; }
/* Dica de que há histórico rolado à esquerda (o heatmap abre no dia mais recente) */
.heatmap-wrap::before {
    content: "";
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 32px;
    background: linear-gradient(to right, var(--panel), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
    z-index: 2;
}
.heatmap-wrap.scrolled::before { opacity: 1; }
.heatmap {
    display: grid;
    grid-template-rows: repeat(7, 12px);
    grid-auto-flow: column;
    grid-auto-columns: 12px;
    gap: 3px;
    width: max-content;
}
.hm { width: 12px; height: 12px; border-radius: 2px; background: var(--panel-2); }
.hm.tip { border-bottom: 0; }
.hm-0 { background: var(--panel-2); }
.hm-1 { background: rgba(227, 176, 75, .30); }
.hm-2 { background: rgba(227, 176, 75, .55); }
.hm-3 { background: rgba(227, 176, 75, .80); }
.hm-4 { background: var(--accent); }
/* dia com ganho: verde (--ok) na mesma tonalidade do nível */
.hm-g1 { background: rgba(54, 217, 127, .30); }
.hm-g2 { background: rgba(54, 217, 127, .55); }
.hm-g3 { background: rgba(54, 217, 127, .80); }
.hm-g4 { background: var(--ok); }
.heatmap-leg { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 11px; }
.heatmap-leg .hm { width: 11px; height: 11px; }

/* Login no header */
.nav-auth { display: inline-flex; align-items: center; gap: 8px; margin-left: 6px; }
.btn-google {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 8px;
    background: #fff; color: #1f1f1f; font-weight: 600; font-size: 13px;
    text-decoration: none; white-space: nowrap;
}
.btn-google:hover { filter: brightness(.96); }
.btn-google .g-ic { font-weight: 700; color: #4285f4; }
/* No header o seletor de item de nav venceria o padding — reafirma o botão. */
.topbar nav a.btn-google { padding: 7px 13px; border: 1px solid transparent; background: #fff; color: #1f1f1f; }
.topbar nav a.btn-google:hover { background: #f1f3f4; color: #1f1f1f; }
.nav-user { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.nav-user img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); }
.nav-user .nav-user-nome { font-size: 13px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Conta no desktop: avatar compacto que abre dropdown com Perfil e Sair */
.nav-user-menu { position: relative; display: flex; align-items: center; }
.nav-user-menu > summary {
    list-style: none;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 5px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease;
}
.nav-user-menu > summary::-webkit-details-marker { display: none; }
.nav-user-menu > summary:hover { background: var(--panel-2); border-color: var(--border-soft); }
.nav-user-menu > summary img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); display: block; }
.nav-user-menu > summary.active img { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(227, 176, 75, .5); }
.nav-user-menu > summary .chev { color: var(--muted); transition: transform 140ms ease; }
.nav-user-menu[open] > summary .chev { transform: rotate(180deg); }
.nav-user-drop {
    position: absolute; right: 0; top: calc(100% + 10px);
    min-width: 210px; max-width: 280px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, .55);
    padding: 6px;
    z-index: 960;
}
.nav-user-drop .nav-user-info { padding: 6px 10px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; }
.nav-user-info b, .nav-user-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-info b { font-size: 13px; }
.nav-user-info small { color: var(--muted); font-size: 11.5px; }
.topbar nav .nav-user-drop a { display: flex; width: 100%; border-radius: 8px; }

/* ═══ Modal de confirmação ══════════════════════════════════════════════ */
body.modal-open { overflow: hidden; }
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(2px);
    animation: modal-fade 120ms ease;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
    width: 100%; max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
    animation: modal-pop 140ms ease;
}
.modal-title { margin: 0 0 8px; font-size: 18px; }
.modal-msg { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.modal-actions {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 20px; flex-wrap: wrap;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .modal-overlay, .modal-box { animation: none; }
}

/* ═══ Loading overlay & spinner ═════════════════════════════════════════ */
.loading-card {
    text-align: center;
    padding: 48px 24px;
    max-width: 520px;
    margin: 40px auto;
}
.loading-card h2 { font-size: 18px; }
.loading-card .muted { font-size: 13px; }

.spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto;
    border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-right-color: var(--accent-2);
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.dash-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 9, 0.8);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 180ms ease-out;
}
.dash-overlay[hidden] { display: none; }
.dash-overlay .loading-card { margin: 0; }
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ═══ Scrollbar (webkit) ════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #243528;
    border-radius: 5px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #2f4636; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
