/* Sorteio-Online.com — estilos globais */
:root {
  --verde: #087a42;
  --verde-escuro: #05582f;
  --verde-claro: #e3f3ea;
  --amarelo: #ffc93c;
  --amarelo-escuro: #f2b705;
  --azul: #1e4fa8;
  --fundo: #f6f8f5;
  --superficie: #ffffff;
  --superficie-2: #eef2ee;
  --texto: #1b1f1d;
  --texto-suave: #5a635e;
  --borda: #dde3de;
  --erro: #c92a2a;
  --sombra: 0 1px 2px rgba(16, 40, 26, .06), 0 8px 24px rgba(16, 40, 26, .08);
  --raio: 16px;
  --raio-btn: 12px;
  --fonte: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --verde: #3dd68c; --verde-escuro: #2bb673; --verde-claro: #16301f;
    --amarelo: #ffd25e; --amarelo-escuro: #ffc93c; --azul: #7fa6ff;
    --fundo: #0f1512; --superficie: #18211c; --superficie-2: #1f2a24;
    --texto: #e8eeea; --texto-suave: #a3aea8; --borda: #2a352f; --erro: #ff8787;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --verde: #3dd68c; --verde-escuro: #2bb673; --verde-claro: #16301f;
  --amarelo: #ffd25e; --amarelo-escuro: #ffc93c; --azul: #7fa6ff;
  --fundo: #0f1512; --superficie: #18211c; --superficie-2: #1f2a24;
  --texto: #e8eeea; --texto-suave: #a3aea8; --borda: #2a352f; --erro: #ff8787;
  --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fundo); color: var(--texto); font: 17px/1.65 var(--fonte); overflow-x: hidden; }
a { color: var(--verde); text-underline-offset: 2px; }
a:hover { color: var(--verde-escuro); }
img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--superficie); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip-link:focus { left: 8px; }

/* ---------- cabeçalho ---------- */
.site-header { background: var(--superficie); border-bottom: 1px solid var(--borda); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--texto); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.logo b { color: var(--verde); font-weight: 700; }
.logo small { color: var(--texto-suave); font-weight: 500; font-size: .85em; }
.btn-theme { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--borda); background: transparent; cursor: pointer; font-size: 1.1rem; }
.site-nav { border-top: 1px solid var(--borda); }
.site-nav ul { display: flex; gap: 4px; margin: 0; padding: 6px 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav a { display: block; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--texto-suave); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.site-nav a:hover { background: var(--superficie-2); color: var(--texto); }
.site-nav a[aria-current="page"] { background: var(--verde-claro); color: var(--verde); }

/* ---------- títulos da página ---------- */
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; font-size: .9rem; color: var(--texto-suave); }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; }
.page-head { max-width: 760px; margin: 0 auto; padding: 24px 0 8px; text-align: center; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.15; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--texto-suave); }

/* ---------- ferramenta ---------- */
.tool { max-width: 760px; margin: 16px auto 0; background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); padding: 16px; }
.tool-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tool-label { font-size: .85rem; font-weight: 700; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .06em; }
.tool-body { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.field-head label { font-weight: 700; }
.count { font-size: .9rem; color: var(--texto-suave); font-variant-numeric: tabular-nums; }
textarea, input[type="text"], input[type="number"] { width: 100%; background: var(--fundo); border: 1px solid var(--borda); border-radius: 12px; padding: 10px 12px; }
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
textarea:focus, input:focus { border-color: var(--verde); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--verde) 25%, transparent); }
.mini-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--verde); font-weight: 600; font-size: .95rem; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.notice { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--verde-claro); font-size: .95rem; }
.notice.is-error { background: color-mix(in srgb, var(--erro) 14%, transparent); color: var(--erro); }
.notice button { margin-left: 6px; }

.options { border: 1px solid var(--borda); border-radius: 12px; background: var(--fundo); }
.options summary { cursor: pointer; padding: 10px 12px; font-weight: 700; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.options summary::-webkit-details-marker { display: none; }
.options summary::before { content: "⚙"; color: var(--texto-suave); }
.options summary span { font-weight: 500; font-size: .9rem; color: var(--texto-suave); }
.options[open] summary { border-bottom: 1px solid var(--borda); }
.options-grid { display: grid; gap: 12px; padding: 12px; }
.num-field, .text-field { display: grid; gap: 4px; font-weight: 600; font-size: .95rem; }
.check, .radio { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input, .radio input { width: 20px; height: 20px; accent-color: var(--verde); }
.stepper { display: inline-flex; align-items: stretch; max-width: 180px; }
.stepper input { text-align: center; border-radius: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper button { width: 44px; border: 1px solid var(--borda); background: var(--superficie-2); cursor: pointer; font-size: 1.2rem; }
.stepper button:first-child { border-radius: 12px 0 0 12px; }
.stepper button:last-child { border-radius: 0 12px 12px 0; }
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.range-row .num-field:last-child { grid-column: 1 / -1; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { border: 1px solid var(--borda); background: var(--fundo); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.pill:hover, .pill[aria-pressed="true"] { border-color: var(--verde); color: var(--verde); }
.split-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.fill-numbers { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.fill-numbers .num-field { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.fill-numbers input { width: 84px; }

.btn-sortear { display: block; width: 100%; margin: 16px 0 0; min-height: 60px; border: 0; border-radius: var(--raio-btn); background: var(--amarelo); color: #1b1f1d; font-size: 1.35rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; box-shadow: 0 3px 0 var(--amarelo-escuro); transition: transform .08s, box-shadow .08s; }
.btn-sortear:hover { filter: brightness(1.03); }
.btn-sortear:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--amarelo-escuro); }
.btn-sortear:disabled { opacity: .6; cursor: wait; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--borda); border-radius: var(--raio-btn); background: var(--superficie); font-weight: 700; cursor: pointer; text-decoration: none; color: var(--texto); }
.btn:hover { border-color: var(--verde); }
.btn-primary { background: var(--verde); border-color: var(--verde); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #0f1512; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0f1512; } }
.btn-primary:hover { background: var(--verde-escuro); color: #fff; }
.btn-ghost { background: transparent; }
.btn-small { min-height: 36px; padding: 4px 12px; font-size: .9rem; }

.stage { margin-top: 16px; min-height: 120px; display: grid; place-items: center; text-align: center; border-radius: 12px; background: var(--fundo); border: 1px dashed var(--borda); padding: 16px; }
.stage-idle { margin: 0; color: var(--texto-suave); }
.rolling { font-size: clamp(1.8rem, 7vw, 3rem); font-weight: 800; color: var(--texto-suave); word-break: break-word; }
.winners { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; }
.winners li { display: flex; align-items: baseline; justify-content: center; gap: 10px; animation: pop .35s ease-out both; }
.winners .pos { font-weight: 700; color: var(--verde); font-size: 1rem; min-width: 2.2em; text-align: right; }
.winners .name { font-weight: 800; font-size: clamp(1.6rem, 6vw, 2.6rem); line-height: 1.2; word-break: break-word; }
.winners.many .name { font-size: 1.25rem; }
.result-title { margin: 0 0 8px; font-weight: 700; color: var(--texto-suave); }
.result-meta { margin: 10px 0 0; font-size: .9rem; color: var(--texto-suave); }
.num-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.num-grid span { min-width: 56px; padding: 8px 10px; border-radius: 12px; background: var(--superficie); border: 2px solid var(--verde); font-weight: 800; font-size: 1.4rem; font-variant-numeric: tabular-nums; animation: pop .3s ease-out both; }
.num-grid.single span { font-size: clamp(3rem, 14vw, 5rem); padding: 8px 28px; border-width: 3px; }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.countdown { font-size: 4rem; font-weight: 800; color: var(--verde); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.history { margin-top: 16px; border-top: 1px solid var(--borda); padding-top: 8px; }
.history-title { margin: 0 0 6px; font-size: .95rem; font-weight: 700; color: var(--texto-suave); }
.history ol { margin: 0; padding-left: 20px; font-size: .95rem; }
.history li { margin: 2px 0; }
.history time { color: var(--texto-suave); font-size: .85rem; }
.status { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--texto); color: var(--fundo); padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: .95rem; z-index: 20; }

/* times */
.stage-teams { place-items: stretch; }
.teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; width: 100%; text-align: left; }
.team { border-radius: 12px; background: var(--superficie); border: 1px solid var(--borda); border-top: 6px solid var(--cor, var(--verde)); padding: 10px 14px; animation: pop .35s ease-out both; }
.team-title { margin: 0 0 6px; font-size: 1.05rem; font-weight: 800; display: flex; justify-content: space-between; gap: 8px; }
.team-title small { color: var(--texto-suave); font-weight: 600; }
.team ol { margin: 0; padding-left: 22px; }
.team .gk { margin: 0 0 2px; font-weight: 700; }

/* roleta */
.wheel-layout { display: grid; gap: 16px; }
.wheel-wrap { position: relative; width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 1; }
.wheel { width: 100%; height: 100%; display: block; cursor: pointer; touch-action: manipulation; }
.wheel-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 30px solid var(--texto); z-index: 2; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.wheel-hub { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 22%; aspect-ratio: 1; border-radius: 50%; border: 4px solid var(--superficie); background: var(--amarelo); color: #1b1f1d; font-weight: 800; font-size: clamp(.8rem, 3vw, 1.05rem); text-transform: uppercase; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
@media (min-width: 760px) {
  .wheel-layout { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .range-row { grid-template-columns: 1fr 1fr 1.2fr; }
  .range-row .num-field:last-child { grid-column: auto; }
}

/* tela cheia */
.tool:fullscreen, .tool.is-full { max-width: none; width: 100%; height: 100%; margin: 0; border-radius: 0; border: 0; overflow: auto; display: flex; flex-direction: column; justify-content: safe center; padding: 16px max(24px, 5vw) 40px; background: #0f1512; color: #e8eeea; --fundo: #18211c; --superficie: #1f2a24; --borda: #2a352f; --texto: #e8eeea; --texto-suave: #a3aea8; --verde: #3dd68c; }
.tool.is-full { position: fixed; inset: 0; z-index: 30; }
.tool:fullscreen .tool-bar, .tool.is-full .tool-bar { position: absolute; top: 16px; left: max(24px, 5vw); right: max(24px, 5vw); }
.tool:fullscreen:not([data-tool="roleta"]) .stage, .tool.is-full:not([data-tool="roleta"]) .stage { order: 1; }
.tool:fullscreen:not([data-tool="roleta"]) .btn-sortear, .tool.is-full:not([data-tool="roleta"]) .btn-sortear { order: 2; }
.tool:fullscreen .result-actions, .tool.is-full .result-actions { order: 3; }
.tool:fullscreen .tool-body, .tool.is-full .tool-body, .tool:fullscreen .history, .tool.is-full .history, .tool:fullscreen .fill-numbers, .tool.is-full .fill-numbers { display: none; }
.tool:fullscreen .wheel-layout .field, .tool.is-full .wheel-layout .field { display: none; }
.tool:fullscreen .wheel-layout, .tool.is-full .wheel-layout { grid-template-columns: 1fr; }
.tool:fullscreen .wheel-wrap, .tool.is-full .wheel-wrap { max-width: min(58vh, 640px); margin-top: 40px; }
.tool:fullscreen[data-tool="roleta"] .stage, .tool.is-full[data-tool="roleta"] .stage { min-height: 14vh; margin-top: 8px; }
.tool:fullscreen[data-tool="roleta"] .btn-sortear, .tool.is-full[data-tool="roleta"] .btn-sortear { margin-top: 14px; }
.tool:fullscreen .stage, .tool.is-full .stage { min-height: 38vh; border: 0; background: transparent; }
.tool:fullscreen .winners .name, .tool.is-full .winners .name { font-size: clamp(3rem, 9vw, 6rem); }
.tool:fullscreen .winners.many .name, .tool.is-full .winners.many .name { font-size: clamp(1.6rem, 4vw, 2.6rem); }
.tool:fullscreen .rolling, .tool.is-full .rolling { font-size: clamp(3rem, 9vw, 6rem); }
.tool:fullscreen .btn-sortear, .tool.is-full .btn-sortear { max-width: 520px; margin: 24px auto 0; }
.tool:fullscreen::after, .tool.is-full::after { content: "sorteio-online.com"; position: fixed; right: 20px; bottom: 14px; font-weight: 700; opacity: .55; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; width: 100vw; height: 100vh; }

/* ---------- conteúdo ---------- */
.content { max-width: 760px; margin: 40px auto 0; }
.prose h2 { font-size: 1.5rem; line-height: 1.25; margin: 2.2em 0 .6em; letter-spacing: -.01em; }
.prose h3 { font-size: 1.15rem; margin: 1.6em 0 .4em; }
.prose p, .prose li { color: var(--texto); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--borda); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--superficie-2); }
.prose .steps { counter-reset: passo; list-style: none; padding: 0; display: grid; gap: 12px; }
.prose .steps li { counter-increment: passo; position: relative; padding: 12px 14px 12px 56px; background: var(--superficie); border: 1px solid var(--borda); border-radius: 12px; margin: 0; }
.prose .steps li::before { content: counter(passo); position: absolute; left: 14px; top: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--amarelo); color: #1b1f1d; font-weight: 800; display: grid; place-items: center; }
.callout { background: var(--verde-claro); border-left: 4px solid var(--verde); padding: 12px 16px; border-radius: 0 12px 12px 0; margin: 1.2em 0; }
.faq details { border-bottom: 1px solid var(--borda); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
.faq p { margin: 0 0 12px; }
.related { max-width: 760px; margin: 40px auto 0; }
.related h2 { font-size: 1.5rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.link-card { display: grid; gap: 4px; padding: 16px; background: var(--superficie); border: 1px solid var(--borda); border-radius: 14px; text-decoration: none; color: var(--texto); }
.link-card b { color: var(--verde); font-size: 1.05rem; }
.link-card span { color: var(--texto-suave); font-size: .95rem; }
.link-card:hover { border-color: var(--verde); color: var(--texto); }

/* ---------- rodapé ---------- */
.site-footer { margin-top: 64px; background: var(--superficie); border-top: 1px solid var(--borda); padding: 32px 0 24px; font-size: .95rem; }
.footer-brand p { color: var(--texto-suave); max-width: 520px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-top: 16px; }
.footer-cols h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-suave); margin: 0 0 8px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin: 6px 0; }
.footer-cols a { color: var(--texto); text-decoration: none; }
.footer-cols a:hover { color: var(--verde); text-decoration: underline; }
.footer-note { margin: 24px 0 0; color: var(--texto-suave); font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* celular: botão Sortear visível na primeira tela */
@media (max-width: 600px) {
  .page-head { padding: 14px 0 4px; }
  .page-head p { font-size: .95rem; line-height: 1.5; }
  .tool { padding: 12px; margin-top: 12px; }
  .tool-bar { margin-bottom: 4px; }
  textarea[data-list] { height: 132px; min-height: 96px; }
  .btn-sortear { margin-top: 12px; min-height: 56px; }
}
