:root {
  color-scheme: light;
  --ink: #01030c;
  --orange: #ff6700;
  --terracotta: #bb6f58;
  --slate: #252830;
  --gray: #e8eaef;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #fafafb;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; }
.container, .header-inner { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.header { border-bottom: 1px solid var(--gray); background: white; }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; }
.logo { width: 108px; height: auto; display: block; }
.header-label, .stage-top { font-size: .83rem; font-weight: 750; letter-spacing: .11em; }
.header-label span { color: #b94a00; margin-inline: .3em; }
.logo-parceiro { height: 34px; width: auto; display: block; }
.rodape { margin-top: 40px; }
.rodape-inner {
  width: min(1120px, calc(100% - 64px)); margin-inline: auto; border-top: 1px solid var(--gray);
  padding-block: 22px 28px; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between;
  color: #52555e; font-size: .88rem;
}
.rodape-aviso strong { color: #01030c; }
.rodape-nome { font-weight: 750; letter-spacing: .04em; }
.intro { padding-block: 37px 27px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(3rem, 7.2vw, 6.5rem); line-height: .99; letter-spacing: -.085em; font-weight: 900; }
h1 em { color: #bb4900; font-style: normal; }
.intro p { margin-top: 15px; color: #52555e; font-size: 1.05rem; }
.stage {
  background: radial-gradient(ellipse at 50% 42%, #34303a 0%, var(--slate) 35%, var(--ink) 84%);
  color: white;
  border-radius: 22px;
  padding: 24px 28px 17px;
  text-align: center;
  box-shadow: 0 15px 34px #01030c20;
}
.stage-top { display: flex; justify-content: space-between; color: var(--gray); }
#counter { color: #ffc49e; letter-spacing: .03em; }
.wheel-area {
  width: min(100%, clamp(350px, 58svh, 550px));
  aspect-ratio: 1;
  container-type: inline-size;
  margin: 23px auto 19px;
  position: relative;
  display: grid;
  place-items: center;
}
.wheel-area::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid #ff670068;
}
.wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 8px solid #11131b;
  overflow: hidden;
  background: conic-gradient(from -60deg, var(--orange) 0 120deg, var(--terracotta) 120deg 240deg, #383c48 240deg);
  box-shadow: 0 0 0 1px #ffffff31, 0 12px 26px #0009;
}
.wheel::before {
  position: absolute;
  content: "";
  inset: 4px;
  border-radius: 50%;
  border: 1px dashed #ffffff63;
}
.wheel-label { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--angle)); }
.wheel-prize {
  position: absolute;
  top: -40cqw;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 1.6cqw;
  white-space: nowrap;
}
.wheel-prize img {
  display: block;
  width: var(--prize-size, 19cqw);
  height: var(--prize-size, 19cqw);
  object-fit: contain;
  padding: 2px;
  border-radius: 8px;
  background: white;
}
.wheel-prize b {
  max-width: var(--prize-label-width, 26cqw);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(.46rem, var(--prize-text-size, 4.1cqw), 1.15rem);
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.wheel-label.on-orange { color: var(--ink); }
.pointer {
  position: absolute;
  top: -14px;
  z-index: 2;
  width: 34px;
  height: 38px;
  background: #fff;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.hub {
  display: grid;
  place-items: center;
  position: relative;
  width: 21%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid #ffffff27;
  box-shadow: 0 5px 14px #0007;
  color: var(--orange);
  font-size: clamp(1.4rem, 4vw, 2.1rem);
}
.spin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  width: min(100%, 270px);
  border-radius: 9px;
  border: 0;
  color: var(--ink);
  background: var(--orange);
  cursor: pointer;
}
.spin span { font-size: 1.5rem; line-height: 1; }
.spin:hover:not(:disabled) { background: #ff8533; }
.spin:disabled { cursor: default; opacity: .72; }
.spin:focus-visible { outline: 3px solid white; outline-offset: 4px; }
.status { color: var(--gray); min-height: 2.7em; padding-top: 9px; font-size: .9rem; line-height: 1.3; }
h2 { font-size: 1.85rem; letter-spacing: -.055em; margin-bottom: 17px; }
.wheel.empty { background: var(--slate); }
.wheel-area:has(.wheel.empty) .pointer { visibility: hidden; }
@media (max-width: 840px) {
  .container, .header-inner, .rodape-inner { width: calc(100% - 36px); }
  .logo-parceiro { height: 28px; }
}
@media (max-width: 390px) {
  .stage { padding-inline: 19px; }
}

.inventory {
  color-scheme: dark;
  color: var(--gray);
  background: var(--ink);
  min-height: 100dvh;
  display: grid;
  grid-template-columns: clamp(210px, 21vw, 280px) minmax(0, 1fr);
  --inventory-border: #ffffff24;
  --inventory-muted: #bfc2cc;
}
.inventory-sidebar {
  background: #161820;
  border-right: 1px solid var(--inventory-border);
}
.inventory-brand {
  min-height: 104px;
  background: var(--orange);
  color: var(--ink);
  padding: 18px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 15px;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
}
.inventory-brand .logo { width: 78px; }
.hub-tabs { display: grid; gap: 7px; padding: 18px 12px; }
.inventory a, .inventory button {
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--inventory-border);
  background: #161820;
  color: var(--gray);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.inventory :is(a, button, input):focus-visible { outline: 2px solid #ff9c59; outline-offset: 3px; }
.inventory button:disabled { opacity: .55; cursor: default; }
.hub-tabs button { text-align: left; background: transparent; border-color: transparent; padding: 12px 14px; }
.hub-tabs button:hover { background: var(--slate); }
.hub-tabs [aria-pressed="true"],
.inventory .inventory-primary,
.inventory .form-actions [type="submit"] {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
}
.inventory-main { width: min(100%, 1440px); margin-inline: auto; padding: clamp(20px, 4vw, 54px); }
.inventory-heading, .stock-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.inventory-heading { margin-bottom: 22px; }
.inventory-heading h1 { font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -.055em; }
.hub-panel {
  background: var(--slate);
  border: 1px solid var(--inventory-border);
  border-radius: 15px;
  padding: clamp(16px, 3vw, 27px);
}
.hub-panel h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); letter-spacing: -.035em; }
.stock-heading h2 { margin: 0; }
.hub-form { display: grid; gap: 18px; max-width: 570px; }
.hub-form label, .stock-search { display: grid; gap: 6px; font-weight: 700; }
.hub-form input, .stock-search input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--inventory-border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #161820;
  color: var(--gray);
  font: inherit;
  font-weight: 400;
}
.hub-form small, .hub-status { color: var(--inventory-muted); font-weight: 400; }
.hub-status { margin-top: 16px; }
.stock-search { margin: 19px 0; }
.stock-scroll { overflow-x: auto; }
.stock-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.stock-table :is(th, td) { padding: 11px 9px; text-align: left; border-bottom: 1px solid var(--inventory-border); }
.stock-table th { color: var(--inventory-muted); font-size: .875rem; font-weight: 650; }
.stock-table th:first-child { width: 70px; }
.stock-table th:last-child { text-align: right; }
.stock-table td:nth-child(2) { font-weight: 700; overflow-wrap: anywhere; }
.stock-table small { display: block; margin-top: 3px; color: var(--inventory-muted); font-weight: 400; }
.stock-table img { display: block; width: 48px; height: 48px; object-fit: contain; background: white; border-radius: 6px; }
.stock-table [data-sold-out] img { filter: grayscale(1); }
.stock { white-space: nowrap; color: #ffb686; font-weight: 750; }
[data-sold-out] .stock { color: var(--inventory-muted); }
.hub-actions, .form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-actions { justify-content: flex-end; }
.inventory [data-delete] { color: #ffc1ac; border-color: #bb6f58; }
@media (max-width: 720px) {
  .inventory { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .inventory-sidebar { border-right: 0; border-bottom: 1px solid var(--inventory-border); }
  .inventory-brand { min-height: 64px; justify-content: flex-start; padding-block: 12px; }
  .hub-tabs { display: flex; flex-wrap: wrap; padding: 9px 12px; }
}
.result {
  width: min(620px, calc(100% - 32px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--gray);
  border-top: 6px solid var(--orange);
  border-radius: 22px;
  color: var(--ink);
  background: white;
  box-shadow: 0 24px 70px #01030c55;
}
.result::backdrop { background: #01030cb3; }
.result-content {
  position: relative;
  text-align: center;
  padding: clamp(24px, 6vh, 48px) clamp(18px, 6vw, 55px) clamp(26px, 6vh, 44px);
}
.result h2 { font-size: clamp(2.45rem, 8vw, 4.5rem); margin-bottom: 16px; }
.result img { width: min(220px, 52vw, 34dvh); aspect-ratio: 1; object-fit: contain; }
.result p { margin: 14px 0 20px; font-size: 1.15rem; font-weight: 750; overflow-wrap: anywhere; }
.result .result-pickup { margin-top: -8px; font-size: 1rem; font-weight: 400; line-height: 1.5; }
.result .spin { font-weight: 750; }
.result .spin:focus-visible { outline-color: var(--ink); }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti span {
  position: absolute;
  left: var(--left);
  top: 0;
  width: 7px;
  height: 13px;
  border-radius: 2px;
  background: var(--color);
  opacity: 0;
  animation: confetti-fall 1.75s var(--delay) ease-out infinite both;
}
@keyframes confetti-fall {
  0% { opacity: 0; transform: translateY(-25px) rotate(0); }
  15% { opacity: 1; }
  75% { opacity: .8; }
  100% { opacity: 0; transform: translate(var(--drift), 400px) rotate(440deg); }
}
.fireworks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.firework {
  position: absolute;
  left: 14%;
  top: 28%;
  color: var(--orange);
}
.firework:nth-child(2) { left: 86%; top: 35%; color: #bb6f58; }
.firework:nth-child(3) { left: 19%; top: 62%; color: #d18a00; }
.firework:nth-child(4) { left: 81%; top: 65%; color: var(--orange); }
.firework i {
  position: absolute;
  width: 5px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  animation: firework-burst 1.15s var(--delay) ease-out both;
}
@keyframes firework-burst {
  0% { opacity: 0; transform: rotate(var(--angle)) scale(.3); }
  13% { opacity: 1; }
  60% { opacity: .85; }
  100% {
    opacity: 0;
    transform: rotate(var(--angle)) translateY(clamp(-75px, -12vw, -36px)) scale(.2);
  }
}
@media (prefers-reduced-motion: reduce) {
  .confetti, .fireworks { display: none; }
}

.spin-form {
  display: grid;
  justify-items: stretch;
  gap: 8px;
  width: min(100%, 270px);
  margin: 0 auto;
  text-align: left;
}
.spin-form label { color: var(--gray); font-size: .9rem; font-weight: 700; }
.spin-form :is(input, select) {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #bfc2cc;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
}
.spin-form input[aria-invalid="true"] { border-color: var(--orange); }
.spin-form .spin { width: 100%; margin-top: 3px; }

.cpf-dialog { width: min(440px, calc(100% - 32px)); }
.cpf-dialog h2 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
.cpf-dialog .spin-form { width: 100%; }
.cpf-dialog label { color: var(--ink); }
.cpf-dialog #cpf-status { min-height: 1.3em; margin: 0; color: #9e2f18; font-size: .9rem; }
#cpf-cancel, #cpf-test {
  border: 0;
  background: transparent;
  color: var(--slate);
  cursor: pointer;
  padding: 8px;
}
#cpf-test { color: #9e3900; text-decoration: underline; }

.cpf-dialog #unit-status { margin: 0; color: var(--slate); font-size: .9rem; }
.cpf-dialog #unit-status:empty, .cpf-dialog #cpf-status:empty { display: none; }
#unit-retry { border: 0; padding: 8px; background: transparent; color: #9e3900; cursor: pointer; text-decoration: underline; }

.winners-table { min-width: 590px; }
.winners-table th:first-child { width: auto; }
.winners-table th:last-child { text-align: left; }
.winners-table td:nth-child(2) { white-space: nowrap; font-weight: 400; }

.selection-list { display: grid; gap: 8px; margin-top: 16px; }
.selection-list label {
  display: grid;
  grid-template-columns: auto 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--inventory-border);
  border-radius: 8px;
}
.selection-list img { width: 42px; height: 42px; object-fit: contain; background: white; border-radius: 5px; }
.selection-list input { accent-color: var(--orange); width: 18px; height: 18px; }
.selection-list small { display: block; color: var(--inventory-muted); }
#selection-form button { margin-top: 12px; }
.prize-dialog { width: min(540px, calc(100% - 32px)); color: inherit; }
.prize-dialog::backdrop { background: #01030cb3; }

.winners-pagination, .winners-pagination label, .winners-pagination nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.winners-pagination { margin-top: 16px; }
.winners-pagination .hub-status { margin: 0 auto 0 0; }
.winners-pagination select {
  border: 1px solid var(--inventory-border);
  border-radius: 8px;
  padding: 8px;
  background: #161820;
  color: inherit;
  font: inherit;
}
.winners-pagination button:disabled { cursor: default; }

.inventory .hub-toast {
  position: fixed;
  z-index: 5;
  inset: 16px 16px auto auto;
  width: max-content;
  max-width: min(400px, calc(100vw - 32px));
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #5ba983;
  border-left-width: 4px;
  border-radius: 9px;
  background: #172c24;
  color: #eef9f2;
  box-shadow: 0 8px 26px #01030c66;
}
.inventory .hub-toast[data-error="true"] {
  border-color: #e68b75;
  background: #39201f;
  color: #fff0ec;
}

/* Hub: modo claro/escuro, quem entrou e Sair no canto inferior esquerdo do menu
   (a barra lateral ocupa a altura da tela e fica parada ao rolar). */
.inventory-sidebar { display: flex; flex-direction: column; }
.hub-tema { margin-top: auto; padding: 14px 12px 18px; border-top: 1px solid var(--inventory-border); }
.hub-tema button { width: 100%; text-align: left; }
@media (min-width: 721px) {
  .inventory-sidebar { position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
}
@media (max-width: 720px) { .hub-tema { margin-top: 0; padding: 10px 12px 12px; } }

/* Hub, modo claro: as cores da página da roleta. */
[data-tema="claro"] .inventory {
  color-scheme: light;
  color: var(--ink);
  background: #fafafb;
  --inventory-border: #d9dce3;
  --inventory-muted: #52555e;
}
[data-tema="claro"] .inventory-sidebar { background: white; }
[data-tema="claro"] .inventory a,
[data-tema="claro"] .inventory button,
[data-tema="claro"] .hub-form input,
[data-tema="claro"] .stock-search input,
[data-tema="claro"] .winners-pagination select { background: white; color: var(--ink); }
[data-tema="claro"] .hub-tabs button { background: transparent; }
[data-tema="claro"] .hub-tabs button:hover { background: var(--gray); }
[data-tema="claro"] .hub-tabs [aria-pressed="true"],
[data-tema="claro"] .inventory .inventory-primary,
[data-tema="claro"] .inventory .form-actions [type="submit"] { background: var(--orange); border-color: var(--orange); color: var(--ink); }
[data-tema="claro"] .hub-panel { background: white; box-shadow: 0 1px 3px #01030c14; }
[data-tema="claro"] .stock { color: #b94a00; }
[data-tema="claro"] .inventory [data-delete] { color: #9e2f18; border-color: #bb6f58; }
[data-tema="claro"] .stock-table img,
[data-tema="claro"] .selection-list img { border: 1px solid var(--inventory-border); }
[data-tema="claro"] .inventory :is(a, button, input):focus-visible { outline-color: #b94a00; }
[data-tema="claro"] .inventory .hub-toast { background: #eef9f2; color: #173d2b; }
[data-tema="claro"] .inventory .hub-toast[data-error="true"] { background: #fff0ec; color: #6b1f12; }

/* Tela de login do Hub e aba Login. */
.hub-form[hidden] { display: none; }
.hub-login-page { display: grid; place-items: center; grid-template-columns: minmax(0, 1fr); padding: 24px 16px; }
.hub-quem { margin: 10px 2px 8px; font-size: .85rem; }
.hub-tema #hub-sair { width: 100%; text-align: left; }
.hub-user-form { margin: 18px 0 26px; padding-bottom: 22px; border-bottom: 1px solid var(--inventory-border); }
.hub-user-form h3 { margin: 0; font-size: 1.1rem; }
.users-table th:first-child { width: auto; }
.users-table td:nth-child(2) { font-weight: 400; }

.hub-login-page {
  min-height: 100dvh;
  background: #fff;
  color: var(--ink);
}
.hub-login {
  width: min(100%, 460px);
  margin: 0 auto;
}
.hub-login-brand {
  display: grid;
  justify-items: center;
  gap: 18px;
  margin-bottom: 26px;
}
.hub-login-brand .logo { width: 135px; }
.hub-login-brand span {
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid #ffd3b4;
  background: #fff4eb;
  color: #a63d00;
  font-weight: 750;
}
.hub-login h1 { text-align: center; font-size: clamp(2rem, 7vw, 2.65rem); letter-spacing: -.045em; }
.hub-login .login-intro { text-align: center; color: #515565; margin-top: -6px; }
.hub-login .hub-form { margin-inline: auto; max-width: 380px; }
.hub-login .hub-form input { min-height: 46px; background: #fff; color: var(--ink); border-color: #bfc2cc; }
.hub-login .hub-form input:focus-visible { outline: 2px solid #b84900; outline-offset: 2px; }
.hub-login .hub-form button {
  padding: 12px 18px;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--orange);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}
.hub-login .hub-form button:disabled { opacity: .6; cursor: default; }
.hub-login .hub-status { margin: 0; color: #87321b; }
.hub-login .hub-status:empty { display: none; }

.wheel-symbol {
  display: grid;
  place-items: center;
  height: var(--prize-size, 19cqw);
  font-size: clamp(.9rem, var(--prize-size, 18cqw) * .58, 2.9rem);
  line-height: 1;
}
.wheel-special .wheel-prize b {
  white-space: normal;
  width: var(--prize-label-width, 26cqw);
  text-align: center;
  font-size: clamp(.44rem, var(--prize-text-size, 4.1cqw) * .77, .95rem);
}
