@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700;800;900&display=swap');

:root {
  --azul-profundo: #030723;
  --azul-noite: #061044;
  --azul-marinho: #0b1b7a;
  --azul-royal: #123bdb;
  --azul-vivo: #1972e9;
  --amarelo: #ffd400;
  --vermelho: #e30613;
  --verde: #00b050;
  --branco: #ffffff;
  --fonte-principal: 'Open Sans', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--fonte-principal);
}

body {
  color: #fff;
  background:
    radial-gradient(circle at 72% 44%, rgba(25,114,233,.24), rgba(3,7,35,.45) 38%, rgba(3,7,35,.90) 78%),
    linear-gradient(90deg, rgba(3,7,35,.90), rgba(3,7,35,.50), rgba(3,7,35,.80)),
    url('https://drive.google.com/thumbnail?id=1WUrRQvaco0pEvsP_1zHooa3_f_YvSKQL&sz=w2400');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.page-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.container {
  width: min(1320px, 100%);
  display: grid;
  grid-template-columns: minmax(420px, 720px) minmax(360px, 500px);
  align-items: center;
  justify-content: center;
  gap: 64px;
}

.wheel-area {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 660px;
}

.wheel-glow {
  position: absolute;
  width: min(70vw, 740px);
  height: min(70vw, 740px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(25,114,233,.23), rgba(25,114,233,.08) 42%, transparent 72%);
  filter: blur(4px);
  transition: transform .4s ease, opacity .4s ease;
}

.wheel-area.spinning .wheel-glow {
  animation: stadiumPulse 1s ease-in-out infinite alternate;
}

.ponteiro {
  position: absolute;
  top: 2px;
  z-index: 12;
  width: 72px;
  height: 62px;
  filter: drop-shadow(0 8px 8px rgba(0,0,0,.58));
}

.ponteiro::before,
.ponteiro::after {
  content: "";
  position: absolute;
  clip-path: polygon(50% 100%, 5% 10%, 95% 10%);
  border-radius: 10px;
}

.ponteiro::before {
  inset: 0;
  background: var(--vermelho);
}

.ponteiro::after {
  inset: 5px;
  background: linear-gradient(180deg, #ff3340, #b90009);
}

.wheel-area.spinning .ponteiro {
  animation: pointerTension .11s linear infinite;
}

.canvas-wrap {
  position: relative;
  z-index: 5;
  width: min(670px, 44vw);
  height: min(670px, 44vw);
  min-width: 500px;
  min-height: 500px;
  max-width: 690px;
  max-height: 690px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#roletaCanvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 10px solid rgba(255,255,255,.97);
  box-shadow: 0 22px 45px rgba(0,0,0,.55), 0 0 0 2px rgba(255,255,255,.22), 0 0 40px rgba(25,114,233,.40);
  transform: rotate(0deg);
  will-change: transform;
  background: #061044;
}

.wheel-area.spinning #roletaCanvas {
  box-shadow:
    0 22px 45px rgba(0,0,0,.55),
    0 0 0 2px rgba(255,255,255,.22),
    0 0 54px rgba(25,114,233,.70),
    0 0 20px rgba(255,212,0,.18);
}

.logo-centro {
  position: absolute;
  z-index: 10;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background-color: rgba(3,7,35,.92);
  background-image: url('https://drive.google.com/thumbnail?id=1xT_7X-itA1Ru7UECh2OjC8wI6zCFwo7t&sz=w900');
  background-size: 128%;
  background-position: center;
  background-repeat: no-repeat;
  border: 5px solid rgba(255,255,255,.96);
  box-shadow: 0 8px 22px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.08);
}

.form-area {
  min-height: 650px;
  padding: 38px 40px 34px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(6,16,68,.54), rgba(18,59,219,.16));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 20px 60px rgba(0,0,0,.26);
  backdrop-filter: blur(5px);
  overflow: hidden;
}

.brand-logo-area {
  width: 100%;
  min-height: 245px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -18px 0 18px;
}

.brand-logo {
  width: 100%;
  max-width: 430px;
  max-height: 245px;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.30));
  transform: scale(1.28);
}

.loja-titulo {
  margin: 0 0 12px 0;
  font-size: clamp(42px, 3.7vw, 62px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -.04em;
  text-shadow: 0 4px 12px rgba(0,0,0,.42);
}

.texto-instrucao {
  margin: 0 0 24px 0;
  color: rgba(255,255,255,.94);
  font-size: 17px;
  line-height: 1.45;
  font-weight: 700;
}

.sorteio-form { width: 100%; }

.campo {
  width: 100%;
  height: 54px;
  margin-bottom: 15px;
  padding: 0 16px;
  border: 0;
  border-radius: 13px;
  outline: none;
  background: rgba(255,255,255,.97);
  color: #111827;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 7px 18px rgba(0,0,0,.18);
}

.mensagem-form {
  display: none;
  margin: -4px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(254,226,226,.96);
  color: #7f1d1d;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.btn-girar {
  width: 100%;
  height: 58px;
  margin-top: 10px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--amarelo), #ffb800);
  color: #061044;
  font-weight: 900;
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: .04em;
  box-shadow: 0 14px 26px rgba(0,0,0,.28), 0 0 22px rgba(255,212,0,.20);
  transition: transform .16s ease, filter .16s ease;
}

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

.btn-girar:disabled {
  cursor: not-allowed;
  opacity: .75;
  transform: none;
}

.hint {
  margin-top: 14px;
  font-size: 12px;
  color: rgba(255,255,255,.72);
  line-height: 1.4;
}

.modal-resultado {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(255,212,0,.14), transparent 28%),
    radial-gradient(circle at center, rgba(25,114,233,.22), transparent 42%),
    rgba(0,0,0,.86);
}

.modal-resultado.show {
  animation: fadeIn .28s ease-in-out;
}

.modal-card {
  width: min(590px, 100%);
  min-height: 720px;
  padding: 30px 32px 34px;
  border-radius: 28px;
  text-align: center;
  background: linear-gradient(145deg, rgba(6,16,68,.96), rgba(11,27,122,.92));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 28px 90px rgba(0,0,0,.62);
  transform-origin: center;
}

.modal-card.victory {
  animation: goalPop .72s cubic-bezier(.17,.9,.24,1.4);
  box-shadow:
    0 28px 90px rgba(0,0,0,.62),
    0 0 45px rgba(255,212,0,.25),
    0 0 90px rgba(25,114,233,.22);
}

.modal-card.loss {
  animation: almostPop .55s ease;
  filter: saturate(.86);
}

.modal-logo-area {
  width: 100%;
  min-height: 315px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -10px 0 8px;
}

.modal-logo {
  width: 100%;
  max-width: 560px;
  max-height: 330px;
  object-fit: contain;
  transform: scale(1.22);
}

.modal-resultado h2 {
  margin: 0 0 8px 0;
  color: #fff;
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.02;
  font-weight: 900;
}

.modal-resultado h3 {
  margin: 0 0 24px 0;
  color: rgba(255,255,255,.88);
  font-size: 17px;
  font-weight: 600;
}

.premio-destaque {
  margin: 0 auto 22px auto;
  padding: 20px 22px;
  border-radius: 18px;
  background: #fff;
  color: #061044;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
  font-weight: 900;
}

.modal-card.victory .premio-destaque {
  animation: prizePulse 1.2s ease-in-out 2;
  box-shadow: 0 0 34px rgba(255,212,0,.35);
}

.protocolo {
  margin-bottom: 22px;
  color: rgba(255,255,255,.72);
  font-size: 13px;
  font-weight: 700;
}

.btn-fechar {
  min-width: 190px;
  height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--vermelho), #b90009);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
}

.goal-flash {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,.45), transparent 15%),
    radial-gradient(circle at 50% 55%, rgba(255,212,0,.24), transparent 35%);
}

.goal-flash.active {
  animation: goalFlash .75s ease-out;
}

.confetti-canvas {
  pointer-events: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
}

.dashboard-page {
  align-items: flex-start;
  padding: 12px;
}

.dashboard-shell {
  width: min(1600px, 100%);
  margin: 0 auto;
}

.dashboard-header {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 34px;
  align-items: center;
  margin-bottom: 12px;
  padding: 18px 30px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(6,16,68,.56), rgba(18,59,219,.18));
  border: 1px solid rgba(255,255,255,.14);
}

.dashboard-logo-area {
  width: 170px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-logo {
  width: 230px;
  max-width: none;
  max-height: 150px;
  object-fit: contain;
}

.dashboard-title {
  margin: 0;
  font-size: clamp(40px, 4vw, 62px);
  line-height: 1;
  font-weight: 900;
}

.dashboard-subtitle {
  margin: 6px 0 0 0;
  color: rgba(255,255,255,.82);
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(360px, 1fr));
  gap: 12px;
}

.loja-card {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(6,16,68,.58), rgba(18,59,219,.14));
  border: 1px solid rgba(255,255,255,.14);
}

.loja-card h2 {
  margin: 0 0 10px 0;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

.dashboard-table,
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 7px;
  font-size: 13px;
}

.dashboard-table th,
.admin-table th {
  text-align: left;
  color: rgba(255,255,255,.72);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 0 8px 2px;
}

.dashboard-table td,
.admin-table td {
  background: rgba(255,255,255,.94);
  color: #061044;
  padding: 8px;
  font-weight: 800;
}

.dashboard-table td:first-child,
.admin-table td:first-child { border-radius: 10px 0 0 10px; }
.dashboard-table td:last-child,
.admin-table td:last-child { border-radius: 0 10px 10px 0; }

.tag-status {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #061044;
  font-size: 11px;
  font-weight: 900;
}

.tag-status.habilitado { background: #dcfce7; color: #14532d; }
.tag-status.desabilitado { background: #fee2e2; color: #7f1d1d; }

/* Admin */
.admin-body {
  min-height: 100vh;
  background: #f3f5f9;
  color: #111827;
}

.login-card,
.install-card {
  width: min(560px, calc(100% - 32px));
  margin: 40px auto;
  padding: 28px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.12);
}

.login-card img {
  display: block;
  width: 210px;
  margin: 0 auto 20px;
}

.install-card h1,
.login-card h1 {
  margin-top: 0;
}

.install-form label,
.login-card label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 800;
}

.install-form input,
.login-card input,
.admin-main input,
.admin-main select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font: inherit;
}

.install-form button,
.login-card button,
.button,
.admin-save,
.admin-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: #123bdb;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: #e5e7eb;
  color: #111827;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 12px 0;
  font-weight: 800;
}

.alert.ok {
  background: #dcfce7;
  color: #14532d;
}

.alert.error {
  background: #fee2e2;
  color: #7f1d1d;
}

.muted {
  color: #6b7280;
}

.admin-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 56px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #061044;
  color: #fff;
}

.admin-nav a {
  color: rgba(255,255,255,.82);
  text-decoration: none;
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 8px;
}

.admin-nav a.active,
.admin-nav a:hover {
  background: rgba(255,255,255,.13);
  color: #fff;
}

.admin-main {
  width: min(1280px, calc(100% - 32px));
  margin: 24px auto 60px;
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.admin-card {
  display: block;
  background: #fff;
  padding: 22px;
  border-radius: 18px;
  text-decoration: none;
  color: #061044;
  box-shadow: 0 14px 40px rgba(0,0,0,.08);
}

.admin-panel {
  background: #fff;
  padding: 18px;
  border-radius: 18px;
  margin-bottom: 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,.06);
}

.admin-table th {
  color: #374151;
}

.admin-table td {
  background: #f9fafb;
}

.admin-table input,
.admin-table select {
  max-width: 160px;
}

.admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-actions form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.small {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.danger {
  background: #dc2626;
  color: #fff;
}

.not-found {
  width: min(640px, calc(100% - 32px));
  margin: 80px auto;
  padding: 28px;
  border-radius: 20px;
  background: #fff;
  color: #111827;
}

@keyframes stadiumPulse {
  from { transform: scale(1); opacity: .86; }
  to { transform: scale(1.045); opacity: 1; }
}

@keyframes pointerTension {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-2px) rotate(-1deg); }
  50% { transform: translateX(2px) rotate(1deg); }
  75% { transform: translateX(-1px) rotate(-.6deg); }
}

@keyframes goalPop {
  0% { transform: scale(.72); opacity: 0; }
  52% { transform: scale(1.045); opacity: 1; }
  72% { transform: scale(.985); }
  100% { transform: scale(1); }
}

@keyframes almostPop {
  0% { transform: scale(.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes prizePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

@keyframes goalFlash {
  0% { opacity: 0; }
  18% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1200px) {
  .container { grid-template-columns: 1fr; gap: 22px; }
  .wheel-area { min-height: auto; padding-top: 20px; }
  .canvas-wrap {
    width: min(88vw, 560px);
    height: min(88vw, 560px);
    min-width: 320px;
    min-height: 320px;
  }
  .form-area { min-height: auto; }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(340px, 1fr)); }
  .admin-cards { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-header { grid-template-columns: 1fr; }
  .admin-nav { overflow-x: auto; }
}


/* v3 admin additions */
.title-row{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.status-pill{display:inline-flex;align-items:center;min-height:34px;padding:0 14px;border-radius:10px;font-weight:900;font-size:13px}
.status-pill.success{background:#dcfce7;color:#14532d}
.admin-settings-panel{border:1px solid #e5e7eb}
.toggle-line{display:flex;align-items:center;gap:10px;font-weight:900}
.toggle-line input{width:20px;height:20px}
.actions-right{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.danger-btn{background:#dc2626!important;color:#fff!important}
.admin-actions{align-items:flex-start}
.dashboard-table.sem-disponivel th,
.dashboard-table.sem-disponivel td{width:auto}
@media (max-width:760px){.title-row,.actions-right{align-items:flex-start}.admin-actions{flex-direction:column}}
