/* ==============================================================
   Sorteios Aleatórios — estilos da página e do "palco" do sorteio.
   Abas, cards, campos e seletores seguem os mesmos valores da
   Calculadora da Normal; o botão de sortear usa o degradê azul do
   .graduation-hero (esse degradê como fundo fica para blocos de destaque).
   Na página só entram os azuis do DEST; laranja e dourado ficam no palco.
   ============================================================== */

/* ---------- Abas ---------- */
.sorteio-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
    border-bottom: 1px solid var(--line);
}

.sorteio-tab {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 10px 16px 12px;
    font: inherit;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.sorteio-tab i { margin-right: 6px; font-size: 0.85em; }
.sorteio-tab:hover { color: var(--primary-dark); background: var(--surface-muted); }

.sorteio-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--primary-soft);
}

.sorteio-panel { display: none; animation: sorteioFadeIn .2s ease; }
.sorteio-panel.active { display: grid; gap: 18px; }
@keyframes sorteioFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Cards ---------- */
.sorteio-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 22px rgba(17, 44, 74, 0.06);
    min-width: 0;
}

.sorteio-card h3 {
    margin: 0 0 4px;
    font-size: 1.15rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sorteio-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.sorteio-card-head h3 { margin: 0; }

.sorteio-muted { color: var(--text-muted); font-size: 0.86rem; margin: 0 0 16px; }

.sorteio-count {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
}

.sorteio-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.sorteio-split-nomes {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: start;
}

.sorteio-side { display: grid; gap: 18px; min-width: 0; }

@media (max-width: 980px) {
    .sorteio-split,
    .sorteio-split-nomes { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Barra do espetáculo ---------- */
.sorteio-show-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 26px;
    padding: 14px 18px;
}

.sorteio-show-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sorteio-show-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
}

.sorteio-show-label i { color: var(--primary); margin-right: 5px; }

.sorteio-sound-toggle {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--primary-dark);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}

.sorteio-sound-toggle:hover { background: var(--primary-soft); }
.sorteio-sound-toggle[aria-pressed="false"] { color: var(--text-muted); }

/* ---------- Seletor segmentado (igual ao da calculadora) ---------- */
.sorteio-seg {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    background: var(--surface-muted);
    border-radius: 12px;
    border: 1px solid var(--line);
}

.sorteio-seg button {
    appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 0.84rem;
    padding: 6px 11px;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
    transition: background .12s ease, color .12s ease, box-shadow .12s ease;
}

.sorteio-seg button:hover { color: var(--text-main); }

.sorteio-seg button.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* ---------- Campos ---------- */
.sorteio-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.sorteio-form-row label,
.sorteio-launch-opts label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sorteio-optional { font-weight: 400; opacity: .8; }

.sorteio-page input[type="number"],
.sorteio-page input[type="text"] {
    font: inherit;
    font-size: 0.95rem;
    padding: 9px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-main);
    outline: none;
    min-width: 0;
    transition: border-color .12s ease, box-shadow .12s ease;
}

.sorteio-page input[type="number"] { font-variant-numeric: tabular-nums; }

.sorteio-page input[type="number"]:focus,
.sorteio-page input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.sorteio-check {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 14px;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
}

.sorteio-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.sorteio-feedback {
    margin: 0;
    min-height: 1.2em;
    font-size: 0.86rem;
    color: var(--primary-dark);
    font-weight: 600;
}

.sorteio-feedback:empty { display: none; }

/* ---------- Bloco do botão de sortear ---------- */
.sorteio-launch {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px 24px;
    border: 1px solid #c3d6ec;
    border-radius: 20px;
    color: var(--text-main);
    text-align: center;
    background: linear-gradient(165deg, #e4eefa 0%, #cddff3 100%);
    box-shadow: 0 14px 28px rgba(17, 44, 74, 0.08);
    min-width: 0;
}

.sorteio-launch-kicker {
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--primary);
}

.sorteio-launch-result {
    font-family: 'Source Serif 4', serif;
    font-weight: 700;
    font-size: clamp(2.6rem, 6vw, 4rem);
    line-height: 1.05;
    color: var(--primary-dark);
    font-variant-numeric: tabular-nums;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.sorteio-launch-result.is-name { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
.sorteio-launch-result.is-empty { color: rgba(20, 42, 92, .28); }
.sorteio-launch-result.is-fresh { animation: sorteioFresh .7s cubic-bezier(.2, 1.4, .3, 1); }

@keyframes sorteioFresh {
    from { transform: scale(.6); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.sorteio-go {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
    padding: 15px 30px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(120deg, #142a5c 0%, #1b5cab 62%, #2e86d1 100%);
    color: #fff;
    font: inherit;
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(20, 42, 92, .28);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.sorteio-go:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 16px 30px rgba(20, 42, 92, .34); }
.sorteio-go:active { transform: translateY(1px) scale(.99); }
.sorteio-go:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

.sorteio-go:disabled {
    cursor: not-allowed;
    filter: grayscale(.8);
    opacity: .6;
    transform: none;
}

.sorteio-go i { font-size: 1.1em; }
.sorteio-go:not(:disabled):hover i { animation: sorteioDiceWiggle .5s ease; }

@keyframes sorteioDiceWiggle {
    0%, 100% { transform: rotate(0); }
    30% { transform: rotate(-18deg); }
    60% { transform: rotate(14deg); }
}

.sorteio-launch-info {
    font-size: .88rem;
    color: var(--text-muted);
}

.sorteio-launch-opts {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    gap: 10px 18px;
}

.sorteio-launch-opts input[type="number"] {
    width: 86px;
    text-align: center;
}

.sorteio-launch-opts .sorteio-check {
    flex-direction: row;
    margin: 0 0 9px;
    color: var(--text-main);
    font-size: 0.88rem;
}

/* ---------- Botões pequenos ---------- */
.sorteio-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s ease;
}

.sorteio-btn:hover { background: var(--primary-dark); }

.sorteio-link-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--primary-dark);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.sorteio-link-btn:hover { background: var(--primary-soft); border-color: var(--line-strong); }
.sorteio-link-btn:disabled { opacity: .45; cursor: default; background: var(--surface); }

.sorteio-empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ---------- Histórico de números ---------- */
.sorteio-num-history {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sorteio-num-history li {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 52px;
    height: 52px;
    padding: 0 10px;
    border-radius: 14px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    color: var(--primary-dark);
    font-family: 'Source Serif 4', serif;
    font-weight: 700;
    font-size: 1.3rem;
    font-variant-numeric: tabular-nums;
}

.sorteio-num-history li small {
    position: absolute;
    top: -7px;
    right: -6px;
    min-width: 22px;
    height: 18px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.66rem;
    font-weight: 700;
}

.sorteio-num-history li.is-new {
    background: var(--primary-soft);
    border-color: var(--primary);
    animation: sorteioFresh .6s cubic-bezier(.2, 1.4, .3, 1);
}

/* ---------- Lista de nomes ---------- */
.sorteio-list-stats { font-size: 0.84rem; color: var(--text-muted); }
.sorteio-list-stats b { color: var(--text-main); }

.sorteio-add {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.sorteio-add input { flex: 1; }

.sorteio-names {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
    max-height: 560px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.sorteio-name {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 4px 2px 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}

.sorteio-name:hover { border-color: var(--line-strong); background: #fbfdff; }

.sorteio-name-badge {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    min-width: 28px;
    height: 22px;
    padding: 0 5px;
    border-radius: 7px;
    background: var(--surface-muted);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sorteio-name-text {
    flex: 1;
    min-width: 0;
    font-size: 0.94rem;
    line-height: 1.3;
    color: var(--text-main);
    overflow-wrap: anywhere;
    cursor: text;
}

.sorteio-name-tag {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.sorteio-name-tag.is-count { background: var(--primary-soft); color: var(--primary-dark); }

.sorteio-name-edit {
    flex: 1;
    padding: 3px 8px !important;
}

.sorteio-name-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 2px;
}

.sorteio-icon-btn {
    appearance: none;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}

.sorteio-icon-btn:hover { background: var(--primary-soft); color: var(--primary-dark); }

.sorteio-name.is-drawn { background: var(--surface-muted); }
.sorteio-name.is-drawn .sorteio-name-text {
    text-decoration: line-through;
    text-decoration-color: var(--primary);
    text-decoration-thickness: 2px;
    color: var(--text-muted);
}
.sorteio-name.is-drawn .sorteio-name-badge { background: var(--primary); color: #fff; }

.sorteio-name.is-absent .sorteio-name-text { color: var(--text-muted); font-style: italic; }
.sorteio-name.is-absent { border-style: dashed; }

.sorteio-name.is-new { animation: sorteioNameIn .35s ease; }
@keyframes sorteioNameIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

.sorteio-empty-state {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 30px 16px;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sorteio-empty-state i { font-size: 1.6rem; color: var(--primary); opacity: .6; }
.sorteio-empty-state strong { color: var(--text-main); font-size: 1rem; }

.sorteio-list-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.sorteio-list-foot > div { display: flex; gap: 8px; flex-wrap: wrap; }
.sorteio-muted-sm { font-size: 0.8rem; color: var(--text-muted); }

/* ---------- Ordem sorteada ---------- */
.sorteio-order {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.sorteio-order li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    font-size: 0.95rem;
    color: var(--text-main);
}

.sorteio-order li b {
    min-width: 30px;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.sorteio-order li.is-new {
    background: var(--primary-soft);
    border-color: var(--primary);
    animation: sorteioNameIn .45s ease;
}

/* ---------- Aviso flutuante ---------- */
.sorteio-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: calc(100% - 32px);
    padding: 11px 12px 11px 18px;
    border-radius: 14px;
    background: var(--accent-dark);
    color: #fff;
    font-size: 0.92rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .3);
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    transition: transform .2s ease, opacity .2s ease;
}

.sorteio-toast.is-visible { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }

.sorteio-toast button {
    appearance: none;
    border: 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    color: var(--accent-dark);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 640px) {
    .sorteio-card { padding: 14px; }
    .sorteio-tab { font-size: 0.85rem; padding: 9px 10px; }
    .sorteio-show-bar { gap: 10px 14px; }
    .sorteio-add { flex-direction: column; }
    .sorteio-add .sorteio-btn { justify-content: center; }
}

.sorteio-page [hidden],
.sorteio-stage [hidden] { display: none !important; }

/* ==============================================================
   PALCO — tela cheia do sorteio (contagem, suspense e revelação)
   ============================================================== */
body.sorteio-stage-open { overflow: hidden; }

.sorteio-stage {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    color: #fff;
    background: radial-gradient(ellipse at 50% 42%, #1f4f99 0%, #142a5c 48%, #081330 100%);
    overflow: hidden;
    font-family: 'Source Sans 3', sans-serif;
    opacity: 0;
    transition: opacity .3s ease;
}

.sorteio-stage[hidden] { display: none; }
.sorteio-stage.is-open { opacity: 1; }
.sorteio-stage:focus { outline: none; }

.stage-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.stage-rays {
    position: absolute;
    left: 50%;
    top: 46%;
    width: 240vmax;
    height: 240vmax;
    margin: -120vmax 0 0 -120vmax;
    background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .075) 0deg 6deg, rgba(255, 255, 255, 0) 6deg 18deg);
    -webkit-mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .55) 16%, transparent 40%);
    mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .55) 16%, transparent 40%);
    will-change: transform;
}

.stage-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 46%, rgba(231, 200, 116, .3), transparent 38%);
    opacity: .4;
    transition: opacity .6s ease;
}

.sorteio-stage.is-tense .stage-glow { opacity: 1; animation: stageGlow .9s ease-in-out infinite; }
.sorteio-stage.is-won .stage-glow { opacity: 1; background: radial-gradient(circle at 50% 46%, rgba(231, 200, 116, .5), transparent 52%); }
@keyframes stageGlow { 50% { opacity: .55; } }

.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }

.stage-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 4; }

.stage-top,
.stage-center,
.stage-bottom { position: relative; z-index: 2; }

.stage-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
}

.stage-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #cbdfff;
}

.stage-brand i { color: #e7c874; font-size: 1.1rem; }
.stage-tools { display: flex; gap: 8px; }

.stage-icon-btn {
    appearance: none;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background .15s ease;
}

.stage-icon-btn:hover { background: rgba(255, 255, 255, .18); }
.stage-icon-btn:focus-visible,
.stage-btn:focus-visible { outline: 3px solid #e7c874; outline-offset: 2px; }

.stage-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 3.4vh, 34px);
    padding: 0 4vw;
    min-height: 0;
    text-align: center;
}

.stage-center.is-shake { animation: stageShake .5s cubic-bezier(.36, .07, .19, .97); }

@keyframes stageShake {
    10%, 90% { transform: translate(-2px, 0); }
    20%, 80% { transform: translate(4px, 1px); }
    30%, 50%, 70% { transform: translate(-7px, -1px); }
    40%, 60% { transform: translate(7px, 1px); }
}

.stage-message {
    margin: 0;
    min-height: 1.3em;
    font-size: clamp(1.15rem, 2.8vw, 2.1rem);
    font-weight: 700;
    color: #dfe9fb;
    letter-spacing: .02em;
}

.stage-message.is-swap { animation: stageMsg .45s ease; }
.stage-message.is-reveal {
    color: #e7c874;
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: clamp(1.05rem, 2.5vw, 1.8rem);
}

@keyframes stageMsg { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Contagem regressiva ---------- */
.stage-countdown { display: grid; justify-items: center; gap: 2vh; }

.stage-countdown-label {
    font-size: clamp(1.2rem, 3vw, 2.3rem);
    font-weight: 700;
    color: #cbdfff;
    letter-spacing: .06em;
}

.stage-countdown-ring {
    position: relative;
    width: min(54vh, 72vw);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.stage-countdown-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 8; }

.ring-bar {
    fill: none;
    stroke: #e7c874;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 553;
    stroke-dashoffset: 0;
}

/* O número fica visível por padrão; o "pulo" de entrada é feito pelo script. */
.stage-countdown-num {
    position: relative;
    z-index: 1;
    font-family: 'Source Serif 4', serif;
    font-weight: 700;
    font-size: min(32vh, 42vw);
    line-height: 1;
    color: #fff;
    text-shadow: 0 .04em .2em rgba(0, 0, 0, .35);
    font-variant-numeric: tabular-nums;
}

.stage-countdown-num.is-go { font-size: min(17vh, 15vw); color: #e7c874; }

/* ---------- Máquina de números ---------- */
.stage-machine {
    position: relative;
    padding: .16em .2em;
    border-radius: .22em;
    font-size: var(--reel-size, 20vh);
    background: linear-gradient(180deg, #fff1c2 0%, #e7c874 40%, #b8862f 100%);
    box-shadow: 0 .05em 0 #8a6220, 0 .25em .6em rgba(0, 0, 0, .45), inset 0 .02em 0 rgba(255, 255, 255, .7);
}

.stage-machine::before,
.stage-machine::after {
    content: '';
    position: absolute;
    top: 50%;
    margin-top: -.11em;
    border: .11em solid transparent;
}

.stage-machine::before { left: -.26em; border-left-color: #d66c49; }
.stage-machine::after { right: -.26em; border-right-color: #d66c49; }

.stage-machine-inner {
    position: relative;
    z-index: 1;
    display: flex;
    gap: .07em;
    padding: .05em;
    border-radius: .13em;
    background: #0a1633;
    box-shadow: inset 0 .04em .12em rgba(0, 0, 0, .7);
}

.reel {
    position: relative;
    width: .74em;
    height: 1.46em;
    overflow: hidden;
    border-radius: .09em;
    background: linear-gradient(180deg, #9fb0c9 0%, #f4f7fb 20%, #ffffff 50%, #f4f7fb 80%, #9fb0c9 100%);
}

.reel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 22, 51, .5) 0%, rgba(10, 22, 51, 0) 28%, rgba(10, 22, 51, 0) 72%, rgba(10, 22, 51, .5) 100%);
    pointer-events: none;
}

.reel-strip { position: absolute; inset: 0; }

.reel-cell {
    position: absolute;
    left: 0;
    right: 0;
    top: .23em;
    height: 1em;
    line-height: 1em;
    text-align: center;
    font-weight: 700;
    color: #142a5c;
    font-variant-numeric: tabular-nums;
    will-change: transform;
}

.reel.is-fast .reel-cell { filter: blur(.03em); }
.reel.is-landed .reel-strip { animation: reelBounce .4s ease-out; }

@keyframes reelBounce {
    0% { transform: translateY(0); }
    35% { transform: translateY(.06em); }
    70% { transform: translateY(-.02em); }
    100% { transform: none; }
}

.stage-machine.is-won {
    box-shadow: 0 .05em 0 #8a6220, 0 0 .35em rgba(231, 200, 116, .75), 0 .25em .6em rgba(0, 0, 0, .45);
    animation: machineWin 1.1s ease-in-out infinite;
}
.stage-machine.is-won .reel { background: linear-gradient(180deg, #d9c38a 0%, #fff6d6 20%, #ffffff 50%, #fff6d6 80%, #d9c38a 100%); }

@keyframes machineWin {
    50% { box-shadow: 0 .05em 0 #8a6220, 0 0 .45em rgba(231, 200, 116, .95), 0 .25em .6em rgba(0, 0, 0, .45); }
}

.stage-bulbs { position: absolute; inset: 0; pointer-events: none; z-index: 2; }

.stage-bulb {
    position: absolute;
    width: .07em;
    height: .07em;
    margin: -.035em 0 0 -.035em;
    border-radius: 50%;
    background: #fff7d1;
    box-shadow: 0 0 .06em .02em rgba(255, 240, 190, .9);
}

/* O script alterna .is-alt: metade das lâmpadas acesa de cada vez. */
.stage-bulbs .stage-bulb:nth-child(odd),
.stage-bulbs.is-alt .stage-bulb:nth-child(even) { background: #b8862f; box-shadow: none; opacity: .45; }
.stage-bulbs.is-alt .stage-bulb:nth-child(odd) { background: #fff7d1; box-shadow: 0 0 .06em .02em rgba(255, 240, 190, .9); opacity: 1; }

/* ---------- Tambor de nomes (mesma moldura da máquina de números) ---------- */
.stage-machine.is-names .stage-machine-inner { padding: .04em; }

.drum {
    position: relative;
    overflow: hidden;
    border-radius: .14em;
    background: linear-gradient(180deg, #8fa2bf 0%, #eef2f8 16%, #ffffff 50%, #eef2f8 84%, #8fa2bf 100%);
}

.drum::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 22, 51, .55) 0%, rgba(10, 22, 51, 0) 30%, rgba(10, 22, 51, 0) 70%, rgba(10, 22, 51, .55) 100%);
    pointer-events: none;
}

.drum-band {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1.5em;
    margin-top: -.75em;
    background: linear-gradient(90deg, rgba(231, 200, 116, .06), rgba(231, 200, 116, .24) 18%, rgba(231, 200, 116, .24) 82%, rgba(231, 200, 116, .06));
    border-top: 2px solid rgba(201, 154, 58, .6);
    border-bottom: 2px solid rgba(201, 154, 58, .6);
}

.drum.is-won .drum-band { background: rgba(231, 200, 116, .42); border-color: #c99a3a; }

.drum-rows { position: absolute; inset: 0; }
.drum.is-landed .drum-rows { animation: reelBounce .4s ease-out; }

.drum-row {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1.5em;
    margin-top: -.75em;
    padding: 0 .5em;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-family: 'Source Serif 4', serif;
    font-weight: 700;
    color: #142a5c;
    will-change: transform, opacity;
}

.drum-name {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Linha abaixo da máquina ("Restam 7 nomes") */
.stage-sub {
    margin: 0;
    font-size: clamp(1rem, 2.2vw, 1.5rem);
    color: #cbdfff;
    font-weight: 600;
}

.stage-sub.is-swap { animation: stageMsg .5s .3s ease both; }

/* ---------- Rodapé do palco ---------- */
.stage-bottom {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 10px 22px 22px;
}

.stage-tray {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 94vw;
    max-height: 22vh;
    overflow-y: auto;
}

.stage-tray:empty { display: none; }

.stage-tray li {
    display: inline-flex;
    align-items: baseline;
    gap: .45em;
    padding: .38em .9em;
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(231, 200, 116, .45);
    font-size: clamp(.95rem, 1.8vw, 1.35rem);
    font-weight: 700;
    animation: trayIn .5s cubic-bezier(.2, 1.3, .4, 1) both;
}

.stage-tray li b { color: #e7c874; font-size: .8em; }
@keyframes trayIn { from { opacity: 0; transform: translateY(-30px) scale(.6); } }

.stage-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; animation: stageMsg .4s ease both; }

.stage-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, filter .15s ease, transform .15s ease;
}

.stage-btn:hover { background: rgba(255, 255, 255, .16); }

.stage-btn.is-primary {
    border: 0;
    background: linear-gradient(180deg, #ffe9a8 0%, #e7c874 55%, #d6ae55 100%);
    color: #142a5c;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
}

.stage-btn.is-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.stage-btn:disabled { opacity: .45; cursor: default; transform: none; }

.stage-btn kbd {
    font: inherit;
    font-size: .72em;
    padding: 1px 7px;
    border-radius: 6px;
    background: rgba(20, 42, 92, .15);
}

.stage-btn:not(.is-primary) kbd { background: rgba(255, 255, 255, .14); }

@media (max-width: 640px) {
    .stage-top { padding: 10px 12px; }
    .stage-brand span { display: none; }
    .stage-btn { padding: 12px 18px; font-size: .95rem; }
    .stage-btn kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .stage-center.is-shake,
    .sorteio-stage.is-tense .stage-glow { animation: none; }
}
