/* ===========================================================
   Roleta de Giro — Estilos Globais
   =========================================================== */
:root {
  --bg-1: #0f0c29;
  --bg-2: #302b63;
  --bg-3: #24243e;
  --accent: #ff4dd6;
  --accent-2: #7b5cff;
  --accent-3: #00e0ff;
  --gold: #ffd152;
  --text: #f5f6ff;
  --text-dim: #b9bbe0;
  --card: rgba(255, 255, 255, 0.07);
  --card-border: rgba(255, 255, 255, 0.14);
  --radius: 20px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2), var(--bg-3));
  background-size: 400% 400%;
  animation: bgShift 18s ease infinite;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

@keyframes bgShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Decorative blurred blobs */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  z-index: 0;
  pointer-events: none;
}
body::before {
  width: 420px;
  height: 420px;
  background: var(--accent-2);
  top: -120px;
  left: -120px;
}
body::after {
  width: 480px;
  height: 480px;
  background: var(--accent);
  bottom: -160px;
  right: -140px;
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---------- Stepper / topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  letter-spacing: 0.5px;
}
.brand .logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(123, 92, 255, 0.5);
}

.steps {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.steps .dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  font-weight: 600;
}
.steps .dot.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 34px);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

h1.title {
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 6px;
  background: linear-gradient(120deg, #fff, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle {
  color: var(--text-dim);
  font-size: 0.98rem;
  margin-bottom: 26px;
}

.section-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--accent-3);
  font-weight: 600;
  margin: 26px 0 12px;
}
.section-label:first-of-type {
  margin-top: 0;
}

/* ---------- Option grid (radio cards) ---------- */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.opt {
  position: relative;
  cursor: pointer;
}
.opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.opt .opt-body {
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  padding: 18px 18px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: 0.2s ease;
  height: 100%;
  background: rgba(255, 255, 255, 0.03);
}
.opt .opt-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.opt .opt-title {
  font-weight: 600;
  margin-bottom: 4px;
}
.opt .opt-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.35;
}
.opt input:checked + .opt-body {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(255, 77, 214, 0.18), rgba(123, 92, 255, 0.18));
  box-shadow: 0 0 0 3px rgba(255, 77, 214, 0.18);
}
.opt input:focus-visible + .opt-body {
  outline: 2px solid var(--accent-3);
}

/* ---------- Inputs ---------- */
.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 500;
}
input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--card-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: 0.2s;
}
input[type="text"]::placeholder {
  color: rgba(185, 187, 224, 0.6);
}
input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 77, 214, 0.2);
}
select option {
  background: var(--bg-2);
  color: var(--text);
}

/* ---------- Participant rows ---------- */
.participants {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.p-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.p-row .p-num {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}
.p-row input[type="text"] {
  flex: 1;
}
.p-row .toggle-ban,
.p-row .toggle-win {
  flex: 0 0 auto;
}
.p-row .icon-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--card-border);
  background: rgba(255, 0, 0, 0.08);
  color: #ff8a8a;
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.18s;
}
.p-row .icon-btn:hover {
  background: rgba(255, 0, 0, 0.2);
}

/* mini chip toggles */
.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1.5px solid var(--card-border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: 0.18s;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
}
.chip-toggle input {
  display: none;
}
.chip-toggle.ban.on {
  background: rgba(255, 90, 90, 0.22);
  border-color: #ff6a6a;
  color: #ffd0d0;
}
.chip-toggle.win.on {
  background: rgba(255, 209, 82, 0.22);
  border-color: var(--gold);
  color: var(--gold);
}

/* ---------- Buttons ---------- */
.actions {
  display: flex;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 15px 26px;
  border-radius: 14px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(255, 77, 214, 0.4);
}
.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 16px 40px rgba(255, 77, 214, 0.55);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid var(--card-border);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
}
.btn-add {
  background: rgba(0, 224, 255, 0.14);
  border: 1.5px dashed rgba(0, 224, 255, 0.5);
  color: var(--accent-3);
  width: 100%;
  justify-content: center;
}
.btn-add:hover {
  background: rgba(0, 224, 255, 0.24);
}
.btn-lg {
  font-size: 1.15rem;
  padding: 18px 38px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.4);
}
.spacer {
  flex: 1;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 6px;
}
.error-msg {
  color: #ff9b9b;
  font-size: 0.85rem;
  margin-top: 10px;
  min-height: 1em;
}

.footer-note {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
  padding: 18px 0 8px;
  z-index: 1;
}

/* hidden helper */
.hidden {
  display: none !important;
}

/* ===========================================================
   PÁGINA INICIAL (LANDING)
   =========================================================== */
.landing-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.landing-badge {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-3);
  background: rgba(0, 224, 255, 0.1);
  border: 1px solid rgba(0, 224, 255, 0.3);
  padding: 7px 16px;
  border-radius: 50px;
  margin-bottom: 18px;
}
.landing-icon {
  font-size: clamp(4rem, 16vw, 7rem);
  line-height: 1;
  filter: drop-shadow(0 14px 30px rgba(123, 92, 255, 0.5));
  animation: floatY 4s ease-in-out infinite;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
.landing-title {
  font-size: clamp(2.6rem, 11vw, 5rem);
  font-weight: 900;
  line-height: 1.05;
  margin-top: 8px;
  background: linear-gradient(120deg, #fff, var(--accent-3), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.landing-tagline {
  color: var(--text-dim);
  font-size: clamp(1rem, 3.5vw, 1.3rem);
  font-weight: 500;
}

/* ===========================================================
   LOGIN / ACESSO AO PAINEL
   =========================================================== */
.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.login-card .lock-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(123, 92, 255, 0.5);
}
.login-card .field {
  text-align: left;
}
.login-card .btn {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}
.logout-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  transition: 0.18s;
}
.logout-link:hover {
  background: rgba(255, 90, 90, 0.16);
  color: #ffd0d0;
}

/* ===========================================================
   PÁGINA DO SORTEIO
   =========================================================== */
.sorteio-body {
  align-items: center;
  justify-content: flex-start;
}
.sorteio-wrap {
  max-width: 760px;
  text-align: center;
  align-items: center;
}
.theme-title {
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
  background: linear-gradient(120deg, var(--gold), #fff, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(255, 209, 82, 0.2);
}
.theme-sub {
  color: var(--text-dim);
  margin-bottom: 26px;
  font-size: 0.95rem;
}

/* ---- Pizza wheel ---- */
.wheel-stage {
  position: relative;
  width: min(86vw, 460px);
  aspect-ratio: 1 / 1;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
}
.wheel-ring {
  position: absolute;
  inset: -3.5%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 60%, rgba(0,0,0,0.4) 100%),
    conic-gradient(from 0deg, #ffd152, #ff4dd6, #7b5cff, #00e0ff, #ffd152);
  box-shadow: 0 0 0 8px rgba(255,255,255,0.06), var(--shadow), inset 0 0 30px rgba(0,0,0,0.4);
  z-index: 0;
}
/* light bulbs around ring */
.wheel-canvas {
  position: relative;
  z-index: 1;
  width: 92%;
  height: 92%;
  border-radius: 50%;
  transform: rotate(0deg);
  transition: transform 6s cubic-bezier(0.12, 0.78, 0.16, 1);
  background: #1a1730;
}
.wheel-hub {
  position: absolute;
  z-index: 3;
  width: 17%;
  height: 17%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #d7d9ff 40%, #8c8ff0 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), inset 0 0 8px rgba(0,0,0,0.2);
  display: grid;
  place-items: center;
  font-size: clamp(1rem, 4vw, 1.6rem);
}
.wheel-pointer {
  position: absolute;
  z-index: 4;
  top: -4%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 34px solid var(--gold);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

/* ---- Buttons / light mode ---- */
.names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  width: min(94vw, 720px);
  margin: 0 auto 10px;
}
.name-cell {
  position: relative;
  padding: 18px 14px;
  border-radius: 16px;
  font-weight: 700;
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--card-border);
  transition: transform 0.08s ease;
  overflow: hidden;
  word-break: break-word;
}
.name-cell.lit {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: #fff;
  color: #fff;
  box-shadow: 0 0 28px rgba(255, 77, 214, 0.9), 0 0 60px rgba(123, 92, 255, 0.6);
  transform: scale(1.06);
}
.name-cell.banned {
  opacity: 0.4;
}
.name-cell.banned::after {
  content: "🚫";
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.85rem;
}
.name-cell.winner-final {
  background: linear-gradient(135deg, var(--gold), #ff9d00);
  color: #2a1500;
  border-color: #fff;
  box-shadow: 0 0 40px var(--gold), 0 0 80px rgba(255, 157, 0, 0.7);
}

/* ---- Spin controls ---- */
.spin-controls {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.btn-spin {
  background: linear-gradient(135deg, #ffd152, #ff9d00);
  color: #2a1500;
  font-size: 1.25rem;
  padding: 18px 46px;
  border-radius: 50px;
  box-shadow: 0 14px 36px rgba(255, 157, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-spin:hover:not(:disabled) {
  filter: brightness(1.07);
  box-shadow: 0 18px 46px rgba(255, 157, 0, 0.7);
}
.eligible-note {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ---- Countdown overlay ---- */
.countdown {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(10, 8, 30, 0.78);
  backdrop-filter: blur(6px);
}
.countdown .count-num {
  font-size: clamp(7rem, 35vw, 18rem);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: countPop 1s ease forwards;
}
@keyframes countPop {
  0% { transform: scale(0.2); opacity: 0; }
  25% { transform: scale(1.1); opacity: 1; }
  70% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ---- Winner modal ---- */
.winner-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 8, 30, 0.85);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.winner-box {
  position: relative;
  text-align: center;
  max-width: 560px;
  width: 100%;
  padding: clamp(28px, 6vw, 56px);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(123, 92, 255, 0.35), rgba(255, 77, 214, 0.25));
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  animation: winnerPop 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) forwards;
}
@keyframes winnerPop {
  from { transform: scale(0.6) translateY(30px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.winner-box .trophy {
  font-size: clamp(3rem, 12vw, 5rem);
  animation: trophyBounce 1.4s ease-in-out infinite;
}
@keyframes trophyBounce {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-12px) rotate(4deg); }
}
.winner-box .winner-label {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.85rem;
  color: var(--gold);
  margin: 10px 0 6px;
  font-weight: 600;
}
.winner-box .winner-name {
  font-size: clamp(2rem, 9vw, 3.6rem);
  font-weight: 900;
  line-height: 1.1;
  word-break: break-word;
  background: linear-gradient(120deg, #fff, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.winner-box .winner-theme {
  color: var(--text-dim);
  margin-top: 10px;
  font-size: 0.95rem;
}
.winner-box .winner-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* empty / error state on sorteio */
.state-msg {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 10px;
}
.state-msg h2 {
  color: var(--text);
  margin-bottom: 10px;
}

@media (max-width: 520px) {
  .actions {
    flex-direction: column;
  }
  .actions .btn {
    width: 100%;
    justify-content: center;
  }
  .spacer {
    display: none;
  }
}
