/* ==========================================================================
   Pagina da campanha (todos os tipos de sorteio)
   Usa o mesmo bilhete (.r-ticket) da home; repetido aqui para a pagina
   nao depender do home.css.
   ========================================================================== */

/* ---------- bilhete (copia do home.css) ---------- */
.r-ticket {
    --notch: 9px;
    --stub: 104px;
    position: relative;
    display: grid;
    grid-template-columns: 1fr var(--stub);
    background: #fff;
    border: 1px solid var(--r-line);
    border-radius: var(--r-radius);
    color: var(--r-ink);
}
.r-ticket__body { min-width: 0; padding: 12px 14px; }
.r-ticket__stub {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    border-left: 2px dashed var(--r-line-strong);
    text-align: center;
}
.r-ticket__stub::before,
.r-ticket__stub::after {
    content: "";
    position: absolute;
    left: calc(var(--notch) * -1 - 1px);
    width: calc(var(--notch) * 2);
    height: var(--notch);
    background: var(--r-bg);
    border: 1px solid var(--r-line);
}
.r-ticket__stub::before { top: -1px; border-top: 0; border-radius: 0 0 var(--notch) var(--notch); }
.r-ticket__stub::after { bottom: -1px; border-bottom: 0; border-radius: var(--notch) var(--notch) 0 0; }
.r-ticket__stub small { font-size: 11px; color: var(--r-ink-2); }
.r-ticket__stub strong {
    font-size: 20px;
    font-weight: 800;
    font-stretch: 85%;
    color: var(--r-red);
    line-height: 1.1;
    white-space: nowrap;
}

.r-meter {
    height: 6px;
    border-radius: 999px;
    background: var(--r-panel);
    overflow: hidden;
}
.r-meter span { display: block; height: 100%; border-radius: inherit; background: var(--r-red); }

/* ---------- cabecalho ---------- */
.r-camp { padding-left: 14px !important; padding-right: 14px !important; }

.r-camp-head__media {
    overflow: hidden;
    border: 1px solid var(--r-line);
    border-bottom: 0;
    border-radius: var(--r-radius) var(--r-radius) 0 0;
    background: var(--r-panel);
}
.r-camp-head__media img { width: 100%; height: auto; display: block; }
.r-camp-ticket { border-radius: 0 0 var(--r-radius) var(--r-radius); }

.r-camp-title {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
    font-stretch: 88%;
    line-height: 1.1;
    letter-spacing: -.02em;
    text-transform: uppercase;
    word-break: break-word;
}
.r-camp-sub { margin: 4px 0 0; font-size: 14px; color: var(--r-ink-2); }
.r-camp-date {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--r-ink);
}
.r-camp-date i { color: var(--r-red); }

.r-camp-mine {
    width: 100%;
    height: 44px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--r-line-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--r-ink);
    font-family: var(--r-font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .15s;
}
.r-camp-mine:hover { border-color: var(--r-ink); }
.r-camp-mine i { color: var(--r-red); }

.r-camp-state {
    margin-top: 10px;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-weight: 800;
    font-size: 14px;
}
.r-camp-state--closed { background: var(--r-panel); color: var(--r-ink-2); }

.r-camp-blocked {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3500;
    width: min(420px, calc(100vw - 24px));
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--r-line);
    border-left: 4px solid var(--r-red);
    box-shadow: 0 14px 32px rgba(0, 0, 0, .14);
}
.r-camp-blocked i { color: var(--r-red); font-size: 20px; }
.r-camp-blocked strong { display: block; font-size: 14px; }
.r-camp-blocked span { font-size: 13px; color: var(--r-ink-2); }

/* ---------- descricao ---------- */
.r-camp-desc {
    margin-top: 14px;
    border: 1px solid var(--r-line);
    border-radius: var(--r-radius);
}
.r-camp-desc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}
.r-camp-desc summary::-webkit-details-marker { display: none; }
.r-camp-desc summary::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--r-ink-2);
    border-bottom: 2px solid var(--r-ink-2);
    transform: rotate(45deg) translateY(-3px);
    transition: transform .2s;
}
.r-camp-desc[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.r-camp-desc__body {
    padding: 0 14px 14px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--r-ink);
}
.r-camp-desc__body * { color: inherit !important; background: transparent !important; }
.r-camp-desc__body img { max-width: 100%; height: auto; border-radius: 8px; }
.r-camp-desc__body p:last-child { margin-bottom: 0; }
.r-camp-box {
    padding: 12px 14px;
    border: 1px solid var(--r-line);
    border-radius: var(--r-radius);
}

/* ---------- ganhadores ---------- */
.r-camp-winners {
    border: 1px solid #bfe6cc;
    border-radius: var(--r-radius);
    background: var(--r-green-soft);
    overflow: hidden;
}
.r-camp-winner { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.r-camp-winner + .r-camp-winner { border-top: 1px solid #bfe6cc; }
.r-camp-winner img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #fff; }
.r-camp-winner div { flex: 1; min-width: 0; }
.r-camp-winner strong { display: block; font-size: 14px; font-weight: 800; text-transform: uppercase; }
.r-camp-winner span { font-size: 12px; color: var(--r-ink-2); }
.r-camp-winner > b { font-size: 18px; font-weight: 800; color: var(--r-green); font-variant-numeric: tabular-nums; }

/* ---------- pacotes ---------- */
.r-deals {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 8px;
}
.r-deal {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--r-line-strong);
    border-radius: 10px;
    background: #fff;
    font-family: var(--r-font);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.r-deal:hover { border-color: var(--r-red); background: var(--r-red-soft); }
.r-deal__qty { font-size: 13px; font-weight: 700; color: var(--r-ink); }
.r-deal__price { font-size: 17px; font-weight: 800; color: var(--r-red); }
.r-deal--wide { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }

/* ---------- ranking da campanha ---------- */
.r-camp-rank {
    list-style: none;
    counter-reset: rk;
    margin: 0;
    padding: 0;
    border: 1px solid var(--r-line);
    border-radius: var(--r-radius);
    overflow: hidden;
}
.r-camp-rank li {
    counter-increment: rk;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    font-size: 14px;
}
.r-camp-rank li + li { border-top: 1px solid var(--r-line); }
.r-camp-rank li::before {
    content: counter(rk);
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: var(--r-panel);
    font-size: 12px;
    font-weight: 800;
}
.r-camp-rank li:first-child::before { background: var(--r-red); color: #fff; }
.r-camp-rank .ganhador-name { flex: 1; font-weight: 700; text-transform: capitalize; }
.r-camp-rank small { color: var(--r-ink-2); font-weight: 600; }
.r-camp-rank__empty { color: var(--r-ink-2); }
.r-camp-rank__empty::before { display: none !important; }

/* ---------- filtro livres / reservados / pagos ---------- */
.r-seg {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: var(--r-panel);
}
.r-seg .seletor-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 7px 4px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-family: var(--r-font);
    color: var(--r-ink-2);
    cursor: pointer;
    transition: background-color .15s, color .15s, box-shadow .15s;
}
.r-seg .sel-num { font-size: 17px; font-weight: 800; line-height: 1.15; color: var(--r-ink); font-variant-numeric: tabular-nums; }
.r-seg .sel-label { font-size: 12px; font-weight: 600; }
.r-seg .ativo-livres,
.r-seg .ativo-reserv,
.r-seg .ativo-pagos {
    background: #fff;
    color: var(--r-ink);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}
.r-seg .ativo-livres .sel-num { color: var(--r-red); }

.r-camp-progress { margin-top: 12px; }
.r-camp-progress small { display: block; margin-top: 5px; font-size: 12px; color: var(--r-ink-2); }

/* ---------- grade de numeros (bilhetes) ---------- */
.r-grid-hint { margin: 14px 0 8px; font-size: 13px; color: var(--r-ink-2); }

.numeros-list.r-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 6px;
    margin: 0;
    padding: 0;
}
.r-grid .cota { margin: 0 !important; padding: 0 !important; width: auto !important; }

.r-grid .numero-template, .r-cart .numero-template {
    --n: 5px;
    position: relative;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    font-family: var(--r-font);
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
    cursor: pointer;
    user-select: none;
    transition: background-color .12s, color .12s, border-color .12s, transform .12s;
    /* recortes laterais do bilhete */
    -webkit-mask: radial-gradient(circle var(--n) at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                  radial-gradient(circle var(--n) at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
            mask: radial-gradient(circle var(--n) at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                  radial-gradient(circle var(--n) at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}
.r-grid .numero-template.bg-cota, .r-cart .numero-template.bg-cota {
    background: #fff !important;
    color: var(--r-ink) !important;
    box-shadow: inset 0 0 0 1.5px var(--r-line-strong);
}
.r-grid .numero-template.bg-cota:hover { box-shadow: inset 0 0 0 1.5px var(--r-ink); }
.r-grid .numero-template.numero-template-selected, .r-cart .numero-template.numero-template-selected {
    background: var(--r-red) !important;
    color: #fff !important;
    box-shadow: none;
    animation: rPick .22s var(--r-ease);
}
.r-grid .numero-template.bg-info, .r-cart .numero-template.bg-info {
    background: var(--r-amber-soft) !important;
    color: var(--r-amber) !important;
    cursor: default;
}
.r-grid .numero-template.bg-success, .r-cart .numero-template.bg-success {
    background: var(--r-panel) !important;
    color: var(--r-ink-3) !important;
    text-decoration: line-through;
    cursor: default;
}
@keyframes rPick { 50% { transform: scale(1.12); } }

/* carregando */
.r-grid-loading {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 6px;
}
.r-grid-loading span {
    height: 40px;
    border-radius: 7px;
    background: linear-gradient(90deg, var(--r-panel) 0%, #ececee 50%, var(--r-panel) 100%);
    background-size: 200% 100%;
    animation: rShimmer 1.1s linear infinite;
}
@keyframes rShimmer { to { background-position: -200% 0; } }

/* ---------- barra de compra ---------- */
.sorteio-numeros-selecionados.r-cart {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    z-index: 1040 !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    transform: translateY(110%);
    visibility: hidden;
    transition: transform .3s var(--r-ease), visibility 0s linear .3s;
    pointer-events: none;
}
.sorteio-numeros-selecionados.r-cart.sorteio-numeros-selecionados-open {
    transform: translateY(0);
    visibility: visible;
    transition: transform .3s var(--r-ease), visibility 0s;
    pointer-events: auto;
}
.r-cart__inner {
    max-width: var(--r-max);
    margin: 0 auto;
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border: 1px solid var(--r-line);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 32px rgba(0, 0, 0, .12);
}
.r-cart__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.r-cart__count { font-size: 13px; color: var(--r-ink-2); }
.r-cart__count b { color: var(--r-ink); font-size: 15px; }
.r-cart__clear {
    border: 0;
    background: transparent;
    color: var(--r-red);
    font-family: var(--r-font);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.cotas-checkout.r-cart__chips {
    display: flex !important;
    gap: 5px;
    overflow-x: auto;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 0 4px !important;
    margin: 0 !important;
    background: transparent !important;
    scrollbar-width: none;
}
.cotas-checkout.r-cart__chips::-webkit-scrollbar { display: none; }
.r-cart .cotas-checkout .cota { flex: 0 0 auto; margin: 0 !important; }
.r-cart .cotas-checkout .numero-template {
    height: 30px;
    min-width: 44px;
    padding: 0 8px;
    font-size: 13px;
    --n: 4px;
}
.r-cart .cotas-checkout .numero-template::after {
    content: "×";
    margin-left: 4px;
    font-weight: 600;
    opacity: .75;
}
.r-cart .cotas-checkout .numero-template { display: flex; align-items: center; justify-content: center; }

.r-cart__btn {
    width: 100%;
    height: 50px;
    margin-top: 8px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    border-radius: 12px;
    background: var(--r-red);
    color: #fff;
    font-family: var(--r-font);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: background-color .15s;
}
.r-cart__btn:hover { background: var(--r-red-dark); }
.r-cart__total { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.r-cart__total strike { opacity: .7; font-weight: 600; font-size: 13px; margin-right: 4px; }

body.has-cart .r-footer { padding-bottom: 150px; }

/* ---------- checkout ---------- */
.r-checkout-sum {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px;
    border-radius: 12px;
    background: var(--r-red-soft);
    font-size: 13px;
    color: var(--r-ink-2);
}
.r-checkout-sum strong { font-size: 24px; font-weight: 800; color: var(--r-red); line-height: 1.1; }
.r-checkout-sum b { color: var(--r-ink); }
.r-checkout-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 14px;
    padding: 10px 12px;
    border: 1px solid var(--r-line);
    border-radius: 12px;
}
.r-checkout-user img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--r-panel); }
.r-checkout-user strong { display: block; font-size: 14px; }
.r-checkout-user small { font-size: 12px; color: var(--r-ink-2); }

/* ---------- compartilhar ---------- */
.r-share {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--r-line);
}
.r-share__label { font-size: 13px; font-weight: 700; color: var(--r-ink-2); }
.r-share__icons { display: flex; gap: 8px; margin-top: 8px; }
.r-share__icons a {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--r-line);
    border-radius: 10px;
    color: var(--r-ink);
    font-size: 17px;
    text-decoration: none;
}
.r-share__icons a:hover { border-color: var(--r-red); color: var(--r-red); }
.r-share__groups { display: grid; gap: 8px; margin-top: 12px; }
.r-share__groups a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    border-radius: 10px;
    background: var(--r-panel);
    color: var(--r-ink);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.r-share__groups a:hover { background: var(--r-line); }

/* ---------- ranking/ganhadores usados nos outros tipos de sorteio ---------- */
.ranking-card {
    background: #fff;
    border: 1px solid var(--r-line);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    position: relative;
}
.ranking-card.rank-1 { border-left: 4px solid var(--r-red); }
.ranking-card.rank-2,
.ranking-card.rank-3 { border-left: 4px solid var(--r-ink); }
.ranking-number { font-size: 24px; font-weight: 800; margin-right: 12px; color: var(--r-ink); }
.ranking-number.gold { color: var(--r-red); }
.ranking-name { font-size: 15px; font-weight: 800; color: var(--r-ink); }
.ranking-meta { font-size: 12px; color: var(--r-ink-2); }
.ranking-medal { display: none; }
.gradient-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    background: var(--r-panel);
    color: var(--r-ink);
}
.gradient-badge.ouro,
.gradient-badge.maior { background: var(--r-red); color: #fff; }
.placed-bid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--r-line);
    border-radius: 10px;
    margin-bottom: 6px;
}
.bid-placer { display: flex; align-items: center; gap: 10px; flex: 1; }
.avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: var(--r-panel); flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.bid-title { font-size: 14px; font-weight: 700; color: var(--r-ink); }
.bid-date { font-size: 11px; color: var(--r-ink-2); }
.crypto-value { font-size: 15px; font-weight: 800; color: var(--r-red); }
.currency-value { font-size: 12px; color: var(--r-ink-2); }
.congrats-title { font-size: 22px; font-weight: 800; color: var(--r-ink); }
.congrats-message,
.congrats-content { color: var(--r-ink-2); }
.share-input {
    width: 100%;
    height: 52px;
    padding: 0 56px 0 16px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--r-line-strong);
    font-weight: 700;
    color: var(--r-ink);
}
.share-copy svg { fill: var(--r-ink-2); }
.share-copy:hover svg { fill: var(--r-red); }

@media (max-width: 360px) {
    .numeros-list.r-grid,
    .r-grid-loading { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
    .r-camp-title { font-size: 18px; }
}

body.modal-open .sorteio-numeros-selecionados.r-cart { visibility: hidden; }
.r-deals > span { display: none; }
