*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:    #2563EB;
  --blue2:   #1D4ED8;
  --red:     #DC2626;
  --red2:    #B91C1C;
  --gold:    #FFD700;
  --bg:      #060a1a;
  --surf:    #0d1428;
  --surf2:   #131c38;
  --txt:     #eef2ff;
  --muted:   #6b7fa8;
  --err:     #ff4f5e;
}

html, body { height: 100%; font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--txt); overflow-x: hidden; }

body {
  background:
    radial-gradient(ellipse at 18%  8%,  rgba(37,99,235,.20) 0%, transparent 50%),
    radial-gradient(ellipse at 82% 92%,  rgba(220,38,38,.17) 0%, transparent 50%),
    radial-gradient(ellipse at 80%  5%,  rgba(220,38,38,.08) 0%, transparent 38%),
    radial-gradient(ellipse at 20% 96%,  rgba(37,99,235,.08) 0%, transparent 38%),
    var(--bg);
}

/* ── LAYOUT ── */
.app { min-height: 100vh; display: flex; flex-direction: column; align-items: center; }

.header { padding: 28px 20px 8px; text-align: center; position: relative; }

.logo {
  max-width: 220px; max-height: 110px; object-fit: contain;
  filter: drop-shadow(0 0 26px rgba(37,99,235,.55));
}

.page-title {
  margin-top: 10px;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
  background: linear-gradient(120deg, #60A5FA 0%, #F87171 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.main { display: flex; flex-direction: column; align-items: center; gap: 32px; padding: 20px 20px 60px; width: 100%; }

/* ── WHEEL ── */
.wheel-wrapper { position: relative; display: flex; align-items: center; justify-content: center; }

.glow-ring {
  position: absolute;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(37,99,235,.18) 0%,
    rgba(220,38,38,.08) 55%,
    transparent 75%
  );
  animation: glowPulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glowPulse {
  0%,100% { transform: scale(1);    opacity: .65; }
  50%      { transform: scale(1.07); opacity: 1;   }
}

.pointer {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 44px; z-index: 10;
  filter: drop-shadow(0 2px 10px rgba(255,215,0,.9));
}

#wheel {
  width: min(480px, calc(100vw - 40px));
  height: min(480px, calc(100vw - 40px));
  border-radius: 50%;
  box-shadow:
    0 0 0 7px var(--surf2),
    0 0 0 11px rgba(37,99,235,.35),
    0 0 0 13px rgba(220,38,38,.10),
    0 14px 55px rgba(0,0,0,.7);
}

/* ── CODE INPUT ── */
.code-section { width: 100%; max-width: 480px; text-align: center; }

.code-label {
  font-size: .85rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}

.input-row { display: flex; gap: 10px; width: 100%; }

.code-input {
  flex: 1; background: var(--surf2);
  border: 2px solid rgba(255,255,255,.09);
  border-radius: 12px; padding: 15px 18px;
  font-size: 1.6rem; font-weight: 700; letter-spacing: .3em;
  text-align: center; text-transform: uppercase; color: var(--txt);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.code-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.22); }
.code-input::placeholder { color: var(--muted); letter-spacing: .2em; }

.spin-btn {
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  border: none; border-radius: 12px; padding: 15px 26px;
  font-size: 1rem; font-weight: 800; letter-spacing: .06em;
  color: #fff; cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 22px rgba(37,99,235,.45);
  transition: transform .15s, box-shadow .15s;
}
.spin-btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(37,99,235,.65); }
.spin-btn:active { transform: translateY(0); }
.spin-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.error-msg { margin-top: 9px; min-height: 20px; color: var(--err); font-size: .88rem; }

/* ── HAMBURGER ── */
.hamburger-btn {
  position: absolute; top: 50%; right: 16px; transform: translateY(-50%);
  width: 40px; height: 40px; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; padding: 8px; border-radius: 8px; transition: background .2s; z-index: 110;
}
.hamburger-btn:hover { background: rgba(255,255,255,.08); }
.hamburger-btn span {
  display: block; width: 20px; height: 2px;
  background: var(--txt); border-radius: 2px;
  transition: transform .25s, opacity .25s, width .25s;
}
.hamburger-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; width: 0; }
.hamburger-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── SLIDE MENU ── */
.slide-menu {
  position: absolute; top: calc(100% - 8px); right: 12px;
  background: var(--surf); border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; padding: 6px; min-width: 210px;
  box-shadow: 0 8px 32px rgba(0,0,0,.55);
  opacity: 0; transform: translateY(-6px) scale(.97);
  pointer-events: none; transition: opacity .18s, transform .18s;
  z-index: 105;
}
.slide-menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 14px; background: none; border: none; color: var(--txt);
  font-size: .93rem; border-radius: 8px; cursor: pointer; text-align: left;
  transition: background .15s; text-decoration: none;
}
.menu-item:hover { background: rgba(255,255,255,.07); }

/* ── COLLAB MODAIS ── */
.collab-card { max-width: 500px; }

.collab-modal-title {
  font-size: 1.25rem; font-weight: 700; margin-bottom: 8px;
}

.dash-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.dash-header strong { color: var(--blue); }

.dash-logout {
  background: none; border: 1px solid rgba(255,255,255,.15);
  color: var(--muted); padding: 5px 12px; border-radius: 7px;
  font-size: .82rem; cursor: pointer; transition: color .2s, border-color .2s;
}
.dash-logout:hover { color: var(--err); border-color: var(--err); }

.gen-section {
  display: flex; gap: 10px; margin-bottom: 4px;
}
.gen-section .admin-input { flex: 1; }
.gen-section .btn-generate { margin-bottom: 0; white-space: nowrap; }

/* ── OVERLAY ── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.78); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
}
.hidden { display: none !important; }
.overlay.hidden { display: none !important; }

.modal {
  background: var(--surf); border-radius: 20px;
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  padding: 36px 30px; width: 100%; max-width: 500px;
  max-height: 90vh; overflow-y: auto; position: relative;
}

/* ── WINNER CARD ── */
.winner-card {
  text-align: center;
  border-color: rgba(255,215,0,.25);
  box-shadow: 0 24px 70px rgba(0,0,0,.55), 0 0 55px rgba(255,215,0,.18);
}

.confetti-wrap {
  position: absolute; inset: 0; overflow: hidden;
  border-radius: 20px; pointer-events: none;
}

.winner-top { margin-bottom: 24px; }

.winner-label {
  font-size: 1.7rem; font-weight: 900;
  background: linear-gradient(120deg, var(--gold), #ff9900);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 18px;
}

.winner-emoji {
  font-size: 5rem; line-height: 1; margin-bottom: 12px;
  animation: popIn .5s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.winner-name { font-size: 1.9rem; font-weight: 800; color: var(--gold); margin-bottom: 6px; }
.winner-sub  { color: var(--muted); font-size: .95rem; }

.share-area { margin-bottom: 20px; }
.share-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 14px; }

.share-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.sh-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 18px; border: none; border-radius: 10px;
  font-size: .88rem; font-weight: 600; color: #fff; cursor: pointer;
  transition: transform .15s, filter .15s;
}
.sh-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.sh-btn:hover { transform: translateY(-2px); filter: brightness(1.15); }
.sh-btn.wpp  { background: #25D366; }
.sh-btn.fb   { background: #1877F2; }
.sh-btn.save { background: var(--surf2); border: 1px solid rgba(255,255,255,.18); color: var(--txt); }
.sh-btn.save:hover { background: rgba(255,255,255,.07); }

.share-hint { font-size: .75rem; color: var(--muted); margin-top: 10px; }

.btn-close {
  display: block; width: 100%; padding: 12px;
  background: var(--surf2); border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px; color: var(--muted); font-size: .9rem;
  cursor: pointer; transition: background .2s;
}
.btn-close:hover { background: rgba(255,255,255,.05); color: var(--txt); }

/* ── ADMIN CARD ── */
.admin-card { max-width: 540px; }
.admin-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 22px; }
.admin-hint  { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }

.admin-input-row { display: flex; gap: 10px; margin-bottom: 8px; }
.admin-input {
  flex: 1; background: var(--surf2); border: 2px solid rgba(255,255,255,.1);
  border-radius: 10px; padding: 12px 14px; font-size: 1rem;
  color: var(--txt); outline: none;
}
.admin-input:focus { border-color: var(--blue); }

.btn-primary {
  background: var(--blue); border: none; border-radius: 10px;
  padding: 12px 20px; font-size: .95rem; font-weight: 700;
  color: #fff; cursor: pointer; white-space: nowrap;
  transition: filter .2s;
}
.btn-primary:hover { filter: brightness(1.12); }

.stats-row { display: flex; gap: 12px; margin-bottom: 18px; }
.stat-box  {
  flex: 1; background: var(--surf2); border-radius: 12px;
  padding: 14px 10px; text-align: center;
}
.stat-num { display: block; font-size: 1.9rem; font-weight: 800; color: var(--blue); }
.stat-lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.btn-generate {
  width: 100%;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  border: none; border-radius: 10px; padding: 14px;
  font-size: .98rem; font-weight: 700; color: #fff; cursor: pointer;
  margin-bottom: 18px; letter-spacing: .04em; transition: filter .2s;
}
.btn-generate:hover { filter: brightness(1.1); }

.list-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin-bottom: 7px;
}

.btn-copy-all {
  background: var(--surf2); border: 1px solid rgba(255,255,255,.1);
  color: var(--muted); padding: 4px 10px; border-radius: 6px;
  font-size: .73rem; cursor: pointer;
}
.btn-copy-all:hover { color: var(--txt); }

.codes-box {
  background: var(--surf2); border-radius: 10px;
  padding: 6px; max-height: 190px; overflow-y: auto;
  font-family: 'Courier New', monospace;
}

.code-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 6px;
  transition: background .15s;
}
.code-row:hover { background: rgba(255,255,255,.04); }

.code-val   { flex: 0 0 auto; font-size: .98rem; font-weight: 700; letter-spacing: .15em; color: var(--gold); }
.code-date  { flex: 1; font-size: .72rem; color: var(--muted); letter-spacing: 0; font-family: inherit; text-align: right; }
.code-prize { flex: 1; font-size: .72rem; color: var(--muted); letter-spacing: 0; font-family: inherit; }

.code-row.used .code-val { color: var(--muted); text-decoration: line-through; }

.delivery-badge {
  display: inline-flex; align-items: center; flex-shrink: 0;
  padding: 2px 9px; border-radius: 20px; font-size: .7rem; font-weight: 700;
  white-space: nowrap; border: 1px solid transparent;
}
.delivery-badge.pending {
  background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.35);
  color: #FCD34D; cursor: pointer; transition: background .15s;
}
.delivery-badge.pending:hover  { background: rgba(251,191,36,.24); }
.delivery-badge.pending:active { background: rgba(251,191,36,.36); }
.delivery-badge.delivered {
  background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.28);
  color: #4ADE80;
}
.delivery-badge.expired {
  background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.22);
  color: #F87171;
}

.btn-copy-code {
  background: none; border: 1px solid rgba(255,255,255,.12);
  color: var(--muted); padding: 3px 9px; border-radius: 5px;
  font-size: .72rem; cursor: pointer; flex-shrink: 0;
}
.btn-copy-code:hover { color: var(--txt); border-color: rgba(255,255,255,.25); }

.empty-msg { padding: 14px; text-align: center; color: var(--muted); font-size: .88rem; font-family: inherit; }

/* ── ADMIN DASHBOARD ── */
.section-divider {
  border: none; border-top: 1px solid rgba(255,255,255,.08);
  margin: 16px 0 0;
}

.collab-select {
  width: 100%; background: var(--surf2);
  border: 1px solid rgba(255,255,255,.1); color: var(--txt);
  border-radius: 8px; padding: 10px 12px; font-size: .9rem;
  cursor: pointer; outline: none;
}
.collab-select:focus { border-color: var(--blue); }

.code-collab {
  color: var(--blue); font-size: .68rem; font-family: inherit;
}

/* ── HIST CONTROLS ── */
.hist-controls {
  display: flex; align-items: center; gap: 6px;
}

.month-select {
  background: var(--surf2); border: 1px solid rgba(255,255,255,.1);
  color: var(--txt); border-radius: 6px; padding: 4px 8px;
  font-size: .72rem; cursor: pointer; outline: none; max-width: 140px;
}
.month-select:focus { border-color: var(--blue); }

.btn-download-hist {
  display: flex; align-items: center; gap: 4px;
  background: none; border: 1px solid rgba(255,255,255,.12);
  color: var(--muted); padding: 4px 9px; border-radius: 6px;
  font-size: .72rem; cursor: pointer; white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.btn-download-hist:hover { color: var(--txt); border-color: rgba(255,255,255,.28); }

/* ── UPDATE BANNER ── */
.update-banner {
  position: fixed; bottom: 28px; left: 50%; z-index: 400;
  transform: translateX(-50%) translateY(calc(100% + 40px));
  opacity: 0;
  transition: transform .45s cubic-bezier(.175,.885,.32,1.275), opacity .35s;

  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px 14px 16px;
  min-width: 270px; max-width: calc(100vw - 40px);

  background: linear-gradient(135deg, #0f1830 0%, #161f3a 100%);
  border: 1px solid rgba(37,99,235,.45);
  border-left: 3px solid var(--blue);
  border-radius: 14px;
  box-shadow:
    0 12px 40px rgba(0,0,0,.65),
    0 0 0 1px rgba(37,99,235,.08),
    0 0 32px rgba(37,99,235,.14);

  cursor: pointer; user-select: none;
}
.update-banner.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.update-banner:hover {
  border-color: rgba(37,99,235,.8);
  box-shadow:
    0 12px 40px rgba(0,0,0,.65),
    0 0 0 1px rgba(37,99,235,.18),
    0 0 44px rgba(37,99,235,.22);
}
.update-banner:active { filter: brightness(1.12); }

.update-icon {
  color: #60A5FA; flex-shrink: 0;
  animation: updatePulse 2.2s ease-in-out infinite;
}
@keyframes updatePulse {
  0%, 100% { opacity: 1;  transform: rotate(0deg);  }
  50%       { opacity: .6; transform: rotate(180deg); }
}

.update-text { flex: 1; }
.update-text strong { display: block; color: #fff; font-size: .93rem; margin-bottom: 2px; }
.update-text span   { color: var(--muted); font-size: .76rem; }

.update-arrow { color: var(--muted); flex-shrink: 0; transition: transform .2s; }
.update-banner:hover .update-arrow { transform: translateX(3px); color: var(--txt); }

/* ── iOS INSTALL ── */
.ios-install-card { max-width: 400px; }

.ios-install-text {
  color: var(--muted); font-size: .92rem;
  line-height: 1.55; margin-bottom: 20px;
}

.ios-steps {
  list-style: none; display: flex; flex-direction: column;
  gap: 14px; margin-bottom: 26px;
}

.ios-steps li {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: .93rem; line-height: 1.5;
}

.ios-step-icon {
  flex-shrink: 0; width: 36px; height: 36px;
  background: var(--surf2); border-radius: 9px;
  border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--blue);
}

/* ── CONFETTI ── */
.conf-piece {
  position: absolute; border-radius: 2px;
  animation: confFall linear forwards;
}
@keyframes confFall {
  0%   { transform: translateY(-10px) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(420px) rotate(720deg); opacity: 0; }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .header { padding: 12px 16px 4px; }
  .logo   { max-height: 72px; }
  .page-title { font-size: 1.25rem; }

  .main { gap: 16px; padding: 10px 16px 36px; }

  .glow-ring { width: 310px; height: 310px; }

  .code-input  { font-size: 1.25rem; padding: 13px 12px; }
  .spin-btn    { padding: 13px 18px; font-size: .9rem; }

  .share-btns  { gap: 8px; }
  .sh-btn      { padding: 10px 13px; font-size: .8rem; }
  .winner-name { font-size: 1.5rem; }
  .modal       { padding: 22px 16px; }
  .stats-row   { gap: 8px; }
}

/* Telas muito pequenas (altura <= 680px, ex: iPhone SE) */
@media (max-height: 680px) {
  .header { padding: 8px 16px 2px; }
  .logo   { max-height: 56px; }
  .page-title { font-size: 1.1rem; }
  .main { gap: 12px; padding: 8px 16px 28px; }
}

/* Mobile — empilha input + botão verticalmente */
@media (max-width: 480px) {
  .input-row { flex-direction: column; }
  .spin-btn  { width: 100%; }
}

/* ── DESKTOP: reduz roleta para caber wheel + campo de código sem scroll ── */
@media (min-width: 481px) {
  #wheel     { width: 360px; height: 360px; }
  .glow-ring { width: 395px; height: 395px; }
  .main      { gap: 20px; }
}

/* ── RECENT WINNERS WIDGET ── */
.winners-widget {
  /* Mobile default: static block below spin section */
  width: 100%; max-width: 480px;
  background: var(--surf);
  border: 1px solid rgba(255,215,0,.18);
  border-radius: 14px;
  overflow: hidden;
}

.winners-widget-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 14px;
  background: rgba(255,215,0,.06);
  border-bottom: 1px solid rgba(255,215,0,.12);
}
.winners-widget-title {
  font-size: .78rem; font-weight: 700;
  color: var(--gold); letter-spacing: .04em;
}
.winners-widget-viewall {
  font-size: .72rem; color: var(--muted);
  text-decoration: none; transition: color .2s;
}
.winners-widget-viewall:hover { color: var(--txt); }

.winners-widget-list { overflow-y: auto; max-height: 220px; }

.winners-widget-loading,
.winners-widget-empty {
  padding: 16px 14px; color: var(--muted);
  font-size: .82rem; text-align: center;
}

.winners-widget-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background .15s;
}
.winners-widget-row:last-child { border-bottom: none; }
.winners-widget-row:hover { background: rgba(255,255,255,.04); }

.winners-widget-emoji { font-size: 1.1rem; flex-shrink: 0; }
.winners-widget-info  { flex: 1; min-width: 0; }
.winners-widget-prize {
  display: block; font-size: .78rem; font-weight: 700;
  color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.winners-widget-client {
  display: block; font-size: .78rem; font-weight: 700; color: #60A5FA;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.winners-widget-date { font-size: .65rem; color: var(--muted); flex-shrink: 0; }

/* Desktop: fixed top-right corner */
@media (min-width: 1100px) {
  .winners-widget {
    position: fixed;
    right: 20px;
    top: 120px;
    width: 270px;
    max-width: none;
    max-height: 480px;
    background: rgba(13,20,40,.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-color: rgba(255,215,0,.22);
    box-shadow: 0 8px 36px rgba(0,0,0,.55), 0 0 0 1px rgba(255,215,0,.06);
    z-index: 90;
    animation: widgetSlideIn .4s cubic-bezier(.175,.885,.32,1.275) both;
  }
  .winners-widget-list { max-height: 400px; }
}

@keyframes widgetSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── FEATURED WINNERS WIDGET ── */
.featured-widget {
  width: 100%; max-width: 480px;
  background: var(--surf);
  border: 1px solid rgba(255,215,0,.18);
  border-radius: 14px;
  overflow: hidden;
}

.featured-widget-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 15px;
  background: rgba(255,215,0,.06);
  border-bottom: 1px solid rgba(255,215,0,.12);
}
.featured-widget-title {
  font-size: .86rem; font-weight: 800;
  color: var(--gold); letter-spacing: .05em;
  text-shadow: 0 0 14px rgba(255,215,0,.35);
}
.featured-widget-list { overflow-y: auto; max-height: 240px; }

@media (min-width: 1100px) {
  .featured-widget {
    position: fixed;
    left: 20px;
    top: 120px;
    width: 290px;
    max-width: none;
    max-height: 500px;
    background: rgba(13,20,40,.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-color: rgba(255,215,0,.22);
    box-shadow: 0 8px 36px rgba(0,0,0,.55), 0 0 0 1px rgba(255,215,0,.06);
    z-index: 90;
    animation: widgetSlideInLeft .4s cubic-bezier(.175,.885,.32,1.275) both;
  }
  .featured-widget-list { max-height: 420px; }
}

@keyframes widgetSlideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.featured-widget .winners-widget-row    { padding: 9px 15px; }
.featured-widget .winners-widget-emoji  { font-size: 1.2rem; }
.featured-widget .winners-widget-prize  { font-size: .84rem; }
.featured-widget .winners-widget-client { font-size: .84rem; }
.featured-widget .winners-widget-date   { font-size: .7rem; }

/* ── LOADING ANIMATION ── */
@keyframes wheelPulse {
  0%,100% { box-shadow: 0 0 0 7px var(--surf2), 0 0 0 11px rgba(37,99,235,.35), 0 0 0 13px rgba(220,38,38,.10), 0 14px 55px rgba(0,0,0,.7); }
  50%     { box-shadow: 0 0 0 7px var(--surf2), 0 0 0 12px rgba(37,99,235,.75), 0 0 0 16px rgba(220,38,38,.30), 0 14px 55px rgba(0,0,0,.7), 0 0 44px rgba(37,99,235,.45); }
}
#wheel.validating { animation: wheelPulse .7s ease-in-out infinite; }

/* ── WINNERS PAGE ── */
.winner-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--surf2); margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,.06);
}
.winner-row-prize {
  font-size: 1rem; font-weight: 700; color: var(--gold);
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.winner-row-info { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.winner-row-client { font-size: .9rem; color: var(--txt); font-weight: 600; }
.winner-row-date   { font-size: .72rem; color: var(--muted); margin-top: 2px; }

/* ── DASHBOARD PAGE ── */
.dash-body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 18%  8%,  rgba(37,99,235,.18) 0%, transparent 50%),
    radial-gradient(ellipse at 82% 92%,  rgba(220,38,38,.15) 0%, transparent 50%),
    var(--bg);
}

/* Login */
.login-screen {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--surf); border: 1px solid rgba(255,255,255,.09);
  border-radius: 20px; padding: 36px 28px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
  display: flex; flex-direction: column; align-items: center;
}
.login-logo  { max-width: 160px; max-height: 80px; object-fit: contain; margin-bottom: 16px; filter: drop-shadow(0 0 20px rgba(37,99,235,.5)); }
.login-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 22px; text-align: center; }
.login-card .admin-input { width: 100%; }
.login-back  { display: block; margin-top: 16px; text-align: center; color: var(--muted); font-size: .85rem; text-decoration: none; }
.login-back:hover { color: var(--txt); }

/* Header */
.dash-header-pg {
  position: sticky; top: 0; z-index: 100;
  background: rgba(6,10,26,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px; height: 60px;
}
.dash-logo-pg { max-height: 36px; object-fit: contain; filter: drop-shadow(0 0 12px rgba(37,99,235,.4)); }

.dash-tabs-nav {
  display: flex; gap: 4px; flex: 1; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.dash-tabs-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  flex-shrink: 0;
  padding: 7px 14px; background: none; border: none;
  color: var(--muted); font-size: .85rem; font-weight: 600;
  border-radius: 8px; cursor: pointer; transition: color .15s, background .15s;
  white-space: nowrap;
}
.tab-btn:hover  { color: var(--txt); background: rgba(255,255,255,.05); }
.tab-btn.active { color: #fff; background: var(--blue); }

.dash-user-pg {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; font-size: .82rem; color: var(--muted);
}
.btn-back-pg {
  background: none; border: 1px solid rgba(255,255,255,.15);
  color: var(--muted); padding: 5px 12px; border-radius: 7px;
  font-size: .78rem; white-space: nowrap; text-decoration: none;
  transition: color .2s, border-color .2s;
}
.btn-back-pg:hover { color: #60A5FA; border-color: #60A5FA; }
.btn-logout-pg {
  background: none; border: 1px solid rgba(255,255,255,.15);
  color: var(--muted); padding: 5px 12px; border-radius: 7px;
  font-size: .78rem; cursor: pointer; white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.btn-logout-pg:hover { color: var(--err); border-color: var(--err); }

/* Content */
.dash-content { max-width: 720px; margin: 0 auto; padding: 24px 20px 60px; }

.tab-pane { display: flex; flex-direction: column; gap: 16px; }

.section-card {
  background: var(--surf); border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px; padding: 20px;
}
.section-title { font-size: .95rem; font-weight: 700; margin-bottom: 14px; }
.section-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: block; margin-bottom: 8px; }

.gen-row { display: flex; gap: 10px; }
.gen-row .admin-input { flex: 1; }

/* Search */
.search-input {
  background: var(--surf2); border: 1px solid rgba(255,255,255,.1);
  color: var(--txt); border-radius: 6px; padding: 4px 9px;
  font-size: .78rem; outline: none; width: 120px;
}
.search-input:focus { border-color: var(--blue); }
.search-input::placeholder { color: var(--muted); }

/* Pagination */
.pagination-row { display: flex; gap: 4px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.pg-btn {
  min-width: 32px; height: 32px; padding: 0 8px;
  background: var(--surf2); border: 1px solid rgba(255,255,255,.1);
  color: var(--muted); border-radius: 7px; font-size: .82rem;
  cursor: pointer; transition: background .15s, color .15s;
}
.pg-btn:hover:not(:disabled) { background: rgba(255,255,255,.07); color: var(--txt); }
.pg-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.pg-btn:disabled { opacity: .35; cursor: not-allowed; }
.pg-ellipsis { display: flex; align-items: center; padding: 0 4px; color: var(--muted); font-size: .82rem; }

/* Collab list */
.collab-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.06);
}
.collab-list-item:last-child { border-bottom: none; }
.collab-info { display: flex; align-items: center; gap: 10px; }
.collab-name { font-size: .92rem; font-weight: 600; }
.collab-badge-active   { font-size: .7rem; padding: 2px 8px; border-radius: 20px; background: rgba(34,197,94,.15); color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.collab-badge-inactive { font-size: .7rem; padding: 2px 8px; border-radius: 20px; background: rgba(239,68,68,.12); color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.collab-actions { display: flex; gap: 6px; }
.btn-icon {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid rgba(255,255,255,.12); color: var(--muted);
  border-radius: 7px; cursor: pointer; transition: color .2s, border-color .2s, background .2s;
}
.btn-icon:hover { color: var(--txt); border-color: rgba(255,255,255,.28); }
.btn-icon.danger:hover { color: #f87171; border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.08); }

/* Weight inputs */
.weight-bar-track {
  height: 8px; background: rgba(255,255,255,.08);
  border-radius: 4px; margin-bottom: 6px; overflow: hidden;
}
.weight-bar-fill {
  height: 100%; border-radius: 4px; background: var(--blue);
  transition: width .2s, background .2s;
}
.weight-remaining-row { font-size: .82rem; color: var(--muted); margin-bottom: 14px; }

.weight-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.05);
}
.weight-row:last-child { border-bottom: none; }
.weight-emoji { font-size: 1.2rem; flex-shrink: 0; width: 24px; text-align: center; }
.weight-label { flex: 1; font-size: .85rem; color: var(--txt); }
.weight-input {
  width: 72px; background: var(--surf2); border: 1px solid rgba(255,255,255,.1);
  color: var(--txt); border-radius: 7px; padding: 6px 8px;
  font-size: .88rem; text-align: center; outline: none;
}
.weight-input:focus { border-color: var(--blue); }
.weight-pct { font-size: .82rem; color: var(--muted); flex-shrink: 0; }

/* Stats grid */
.stats-grid-pg {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.stat-card-pg {
  background: var(--surf); border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px; padding: 18px 14px; text-align: center;
}
.stat-big-pg { display: block; font-size: 2rem; font-weight: 800; color: var(--blue); margin-bottom: 4px; }

/* Ranking */
.ranking-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06);
}
.ranking-item:last-child { border-bottom: none; }
.ranking-pos  { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: var(--surf2); border-radius: 50%; font-size: .78rem; font-weight: 700; flex-shrink: 0; }
.ranking-name { flex: 1; font-size: .9rem; }
.ranking-count { font-size: .8rem; color: var(--muted); flex-shrink: 0; }

/* Prize distribution */
.prize-dist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.05);
}
.prize-dist-item:last-child { border-bottom: none; }
.prize-dist-name  { width: 160px; font-size: .82rem; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prize-dist-bar-track { flex: 1; height: 6px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.prize-dist-bar   { height: 100%; background: var(--blue); border-radius: 3px; transition: width .3s; }
.prize-dist-count { width: 28px; text-align: right; font-size: .8rem; color: var(--muted); flex-shrink: 0; }

/* ── CUSTOM RANKING ── */
.ranking-metric-btns {
  display: flex; gap: 8px; margin-bottom: 6px;
}
.metric-btn {
  padding: 7px 16px; background: var(--surf2);
  border: 1px solid rgba(255,255,255,.12); color: var(--muted);
  border-radius: 8px; font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.metric-btn:hover  { color: var(--txt); border-color: rgba(255,255,255,.28); }
.metric-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.ranking-collab-btns,
.ranking-chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.ranking-collab-chip,
.ranking-chip {
  padding: 6px 14px; background: var(--surf2);
  border: 1px solid rgba(255,255,255,.12); color: var(--muted);
  border-radius: 20px; font-size: .83rem; font-weight: 600;
  cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.ranking-collab-chip:hover,
.ranking-chip:hover  { color: var(--txt); border-color: rgba(255,255,255,.28); }
.ranking-collab-chip.active,
.ranking-chip.active { background: rgba(37,99,235,.22); border-color: var(--blue); color: #93c5fd; }

.ranking-select-all-row {
  display: flex; gap: 8px; margin-bottom: 4px;
}

.custom-ranking-preview {
  margin-top: 16px;
  background: var(--surf2); border-radius: 10px;
  padding: 4px 0; overflow: hidden;
}
.custom-ranking-list { width: 100%; }
.custom-ranking-header {
  display: grid; grid-template-columns: 44px 1fr 60px;
  padding: 8px 14px; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.custom-ranking-row {
  display: grid; grid-template-columns: 44px 1fr 60px;
  align-items: center; padding: 11px 14px;
  border-top: 1px solid rgba(255,255,255,.05);
  transition: background .15s;
}
.custom-ranking-row:hover { background: rgba(255,255,255,.03); }
.custom-ranking-row.top-1 { background: rgba(255,215,0,.07); }
.custom-ranking-row.top-2 { background: rgba(148,163,184,.05); }
.custom-ranking-row.top-3 { background: rgba(180,110,40,.06); }
.custom-ranking-pos   { font-size: 1.25rem; line-height: 1; }
.custom-ranking-name  { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.custom-ranking-row.top-1 .custom-ranking-name { color: var(--gold); }
.custom-ranking-score { font-size: .95rem; font-weight: 800; color: var(--blue); text-align: right; }
.custom-ranking-row.top-1 .custom-ranking-score { color: var(--gold); }

.btn-download-ranking {
  width: 100%; margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 4px 18px rgba(22,163,74,.35);
}
.btn-download-ranking:hover { filter: brightness(1.1); }

/* Responsive dashboard */
@media (max-width: 600px) {
  .dash-header-pg { padding: 0 12px; gap: 8px; }
  .dash-logo-pg   { max-height: 28px; }
  .tab-btn        { padding: 6px 10px; font-size: .78rem; }
  .dash-user-pg span { display: none; }
  .dash-content   { padding: 16px 12px 48px; }
  .gen-row        { flex-direction: column; }
  .search-input   { width: 90px; }
  .hist-controls  { flex-wrap: wrap; gap: 4px; }
  .stats-grid-pg  { grid-template-columns: repeat(2, 1fr); }
  .prize-dist-name { width: 110px; }
}
