/* =====================================================
   Roleta da Sorte — Apostador Online
   Tema por loteria via CSS variables (apostador.css)
   ===================================================== */

.roleta-page {
    --rl-color: var(--mega);
    --rl-text: #ffffff;
    --rl-accent: #ffd83d;
}

.roleta-page.rl-megasena   { --rl-color: var(--mega); }
.roleta-page.rl-lotofacil  { --rl-color: var(--lotofacil); }
.roleta-page.rl-lotomania  { --rl-color: var(--lotomania); }
.roleta-page.rl-quina      { --rl-color: var(--quina); }
.roleta-page.rl-duplasena  { --rl-color: var(--dupla); }
.roleta-page.rl-diadesorte { --rl-color: var(--dia); }
.roleta-page.rl-timemania  { --rl-color: var(--time-green); --rl-accent: var(--time); }

/* ---------- Palco (globo + faixa) ---------- */
.rl-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
}

.rl-canvas-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#rl-canvas {
    /* tamanho de exibição do globo: ajuste só esta linha */
    width: min(352px, 74vw);
    height: auto;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#rl-canvas:active {
    cursor: grabbing;
}

.rl-hint {
    font-size: 0.78rem;
    color: #8a8f98;
    margin-top: -0.4rem;
    transition: opacity 0.6s ease;
}

.rl-hint.hidden {
    opacity: 0;
}

/* ---------- Faixa das dezenas sorteadas ---------- */
.rl-strip {
    width: min(760px, 100%);
    display: flex;
    align-items: stretch;
    gap: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 38%, rgba(0, 0, 0, 0.22) 100%),
        var(--rl-color);
    color: var(--rl-text);
}

.rl-strip-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.9rem 1.25rem;
    background: rgba(0, 0, 0, 0.18);
    min-width: 138px;
}

.rl-strip-logo {
    font-size: 1.7rem;
    line-height: 1;
    color: var(--rl-accent);
}

.rl-strip-name {
    font-weight: 800;
    font-size: 1.02rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.rl-strip-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.75rem 1rem;
    min-height: 92px;
    min-width: 0; /* permite quebra de linha dos chips no flex */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.rl-strip-status {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.92;
    overflow-wrap: anywhere;
}

.rl-strip-balls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 44px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.rl-chip {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    font-family: 'Roboto', Arial, sans-serif;
    color: var(--rl-color);
    background: radial-gradient(circle at 32% 28%, #ffffff 0%, #f4f4f4 55%, #d9d9d9 100%);
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.35), inset 0 -2px 4px rgba(0, 0, 0, 0.08);
    animation: rl-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

@keyframes rl-pop {
    0%   { transform: scale(0) translateY(-16px); opacity: 0; }
    60%  { transform: scale(1.18) translateY(2px); opacity: 1; }
    100% { transform: scale(1) translateY(0); }
}

.rl-strip.rl-flash {
    animation: rl-flash 0.55s ease;
}

@keyframes rl-flash {
    0%, 100% { filter: brightness(1); }
    45%      { filter: brightness(1.45); }
}

/* ---------- Controles ---------- */
.rl-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1rem;
    margin-top: 1.6rem;
}

.rl-fields {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.rl-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.14) 0%, rgba(0, 0, 0, 0.16) 100%),
        var(--rl-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    min-width: 320px;
}

.rl-field label {
    color: var(--rl-text);
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    margin: 0;
    white-space: nowrap;
}

.rl-field input {
    width: 82px;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 0.3rem;
    background: #ffffff;
    color: #222;
    outline: none;
}

.rl-field input:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
}

.rl-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 240px;
}

.rl-btn {
    border: none;
    border-radius: 12px;
    padding: 0.68rem 1.2rem;
    font-weight: 800;
    font-size: 0.95rem;
    color: #fff;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.rl-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.rl-btn:active {
    transform: translateY(1px) scale(0.99);
}

.rl-btn-generate {
    background: linear-gradient(180deg, #34c159 0%, #1f9e43 100%);
}

.rl-btn-generate.rl-running {
    background: linear-gradient(180deg, #e5533d 0%, #c53727 100%);
}

.rl-btn-default {
    background: linear-gradient(180deg, #5aa7f7 0%, #3a7fd9 100%);
    opacity: 0.62;
}

.rl-btn-default.rl-on {
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(90, 167, 247, 0.35), 0 4px 12px rgba(0, 0, 0, 0.14);
}

.rl-btn-fast {
    background: linear-gradient(180deg, #6c757d 0%, #545b62 100%);
    opacity: 0.72;
}

.rl-btn-fast.rl-on {
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.18) 0%, rgba(0, 0, 0, 0.18) 100%),
        var(--rl-color);
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12), 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* ---------- Jogo gerado (badge do cabeçalho) ---------- */
.rl-game-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #fff;
    background: var(--rl-color);
    margin-bottom: 0.35rem;
}

.rl-game-extra {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--rl-color);
    margin-top: 0.15rem;
}

/* Dezenas do jogo gerado (string "01,02,...") — quebra no mobile */
#rl-results .border {
    max-width: 100%;
    overflow: hidden;
}

#rl-results .border .text-center.mb-1 {
    max-width: 100%;
    padding-inline: 0.35rem;
    box-sizing: border-box;
}

#rl-results .border .text-center.mb-1 > div {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

/* ---------- Mobile ---------- */
@media (max-width: 767.98px) {
    .rl-strip {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
    }

    .rl-strip-brand {
        flex-direction: row;
        gap: 0.6rem;
        padding: 0.55rem 1rem;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .rl-strip-right {
        padding: 0.7rem 0.85rem 0.9rem;
        align-items: stretch;
        width: 100%;
        min-width: 0;
    }

    .rl-strip-status {
        text-align: center;
    }

    .rl-strip-balls {
        justify-content: center;
        width: 100%;
    }

    .rl-chip {
        width: 34px;
        height: 34px;
        font-size: 0.82rem;
    }

    /* sobrescreve o font-size: 30px inline do card */
    #rl-results .border .text-center.mb-1 {
        font-size: clamp(1rem, 4.8vw, 1.45rem) !important;
    }

    .rl-field {
        min-width: 0;
        width: 100%;
    }

    .rl-fields,
    .rl-buttons {
        width: 100%;
    }

    .rl-controls {
        flex-direction: column;
    }

    .rl-stage {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
}
