*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
  --purple:    #7c3aed;
  --purple2:   #9333ea;
  --pink:      #ec4899;
  --grad:      linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #ec4899 100%);
  --grad-btn:  linear-gradient(135deg, #7c3aed, #ec4899);
  --white:     #ffffff;
  --gray:      #6b7280;
  --gray-light:#f3f4f6;
  --font:      'Plus Jakarta Sans', sans-serif;
  --radius:    16px;
  --radius-lg: 24px;
}

html,body { height:100%; font-family:var(--font); background:#f9fafb; color:#111827; overflow:hidden; }

/* ── Header ── */
#header {
  position:fixed; top:0; left:0; right:0; z-index:200;
  display:flex; align-items:center; justify-content:space-between;
  padding:24px 6px; height:100px;
  background:#fff;
  border-bottom: 1px solid #e5e7eb;
}
.header-logo { display:flex; align-items:center; gap:10px; margin-left:48px; }
.header-logo img { width:40px; height:40px; border-radius:10px; }
.header-logo span { font-weight:700; font-size:1rem; color:#111; }
.header-right { display:flex; align-items:center; gap:12px; margin-right:48px; }

.header-credits-wrap {
  display:flex; align-items:center; gap:6px;
}
.header-credits-pill {
  display:flex; align-items:center; gap:6px;
  background:#faf5ff; border:1px solid #ede9fe;
  border-radius:10px; padding:6px 10px;
}
.header-credits-label {
  font-size:0.72rem; font-weight:700; color:#7c3aed;
  text-transform:uppercase; letter-spacing:0.04em;
}
.header-credits-count {
  font-size:0.95rem; font-weight:800; color:#2E1065; min-width:1ch;
}
.header-credits-add {
  width:28px; height:28px; border-radius:8px;
  border:none; cursor:pointer;
  background:linear-gradient(135deg, #25D366, #128C7E);
  color:#fff; font-size:1.1rem; font-weight:700; line-height:1;
  display:flex; align-items:center; justify-content:center;
  transition:opacity 0.15s, transform 0.15s;
  flex-shrink:0;
}
.header-credits-add:hover { opacity:0.9; transform:scale(1.05); }

/* Seletor de idioma */
.lang-switch { display:flex; align-items:center; gap:2px; background:#f3f4f6; border-radius:10px; padding:3px; }
.lang-btn {
  border:none; background:none; cursor:pointer;
  padding:5px 9px; border-radius:8px;
  font-weight:600; font-size:0.72rem; color:#6b7280;
  font-family:inherit; line-height:1;
}
.lang-btn:hover { color:#111; }
.lang-btn.active { background:#fff; color:#8a2be2; box-shadow:0 1px 3px rgba(0,0,0,0.1); }

/* Seletor de modo de sorteio */
.draw-mode-wrap { margin-bottom:16px; }
.draw-mode-label { display:block; font-size:0.78rem; font-weight:600; color:#6b7280; margin-bottom:8px; }
.draw-mode-switch { display:inline-flex; align-items:center; gap:2px; background:#f3f4f6; border-radius:12px; padding:4px; }
.draw-mode-btn {
  border:none; background:none; cursor:pointer;
  padding:8px 16px; border-radius:10px;
  font-weight:600; font-size:0.82rem; color:#6b7280;
  font-family:inherit; line-height:1;
}
.draw-mode-btn:hover { color:#111; }
.draw-mode-btn.active { background:#fff; color:#8a2be2; box-shadow:0 1px 3px rgba(0,0,0,0.1); }

.btn-entrar {
  padding:8px 20px; border:none; border-radius:10px;
  background:#8a2be2; color:#fff;
  font-weight:500; font-size:0.85rem; cursor:pointer;
}

#user-badge { display:none; align-items:center; gap:8px; cursor:pointer; position:relative; }
#user-badge img { width:34px; height:34px; border-radius:50%; object-fit:cover; }
#user-badge .chevron { font-size:0.7rem; color:#6b7280; }

#user-dropdown {
  display:none; position:absolute; top:50px; right:0;
  background:#fff; border:1px solid #e5e7eb; border-radius:12px;
  padding:8px; min-width:160px; box-shadow:0 8px 32px rgba(0,0,0,0.1);
  z-index:300;
}
#user-dropdown button {
  width:100%; padding:10px 14px; border:none; background:none;
  font-family:var(--font); font-size:0.85rem; font-weight:600;
  color:#374151; cursor:pointer; border-radius:8px; text-align:left;
}
#user-dropdown button:hover { background:#f3f4f6; }
.dropdown-admin-link {
  display:block; padding:10px 14px;
  font-family:var(--font); font-size:0.85rem; font-weight:600;
  color:#7c3aed; text-decoration:none; border-radius:8px;
  margin-bottom:2px;
}
.dropdown-admin-link:hover { background:#faf5ff; }

/* ── App Shell ── */
#app {
  position:relative; padding-top:100px;
  width:100%; height:100vh; overflow:hidden;
}

/* ── Screens ── */
.screen { display:none; width:100%; height:calc(100vh - 64px); overflow-y:auto; }
.screen.active { display:flex; flex-direction:column; }

/* ── Screen Input ── */
#screen-input {
  background: var(--grad);
  flex-direction:row;
  align-items:stretch;
  overflow:hidden;
}
.hero-left {
  flex: 0 0 50%; 
  display: flex; 
  flex-direction: column;
  justify-content: center; 
  padding: 48px 48px 48px 120px;
  position: relative; /* Necessário para a camada funcionar */
  z-index: 10; /* Garante que os textos e o input fiquem sempre na frente da foto */
}
.hero-title { font-size:3.6rem; font-weight:800; color:#fff; line-height:1.1; margin-bottom:14px; }
.hero-sub { font-size:1rem; color:rgba(255,255,255,0.8); margin-bottom:32px; }
.hero-input-wrap {
  position:relative; margin-bottom:28px; width:100%; max-width:580px;
}
.hero-input-wrap input {
  width:100%; padding:20px 160px 20px 24px;
  border:none; border-radius:14px; outline:none;
  font-family:var(--font); font-size:1rem; color:#111;
  box-shadow:0 8px 32px rgba(0,0,0,0.2);
  background:#fff;
}
.hero-input-wrap input::placeholder { color:#9ca3af; }
.btn-iniciar {
  position:absolute; right:8px; top:50%; transform:translateY(-50%);
  padding:12px 22px; border:none; border-radius:10px;
  background:rgba(124,58,237,0.15);
  color:#7c3aed; font-family:var(--font); font-weight:700; font-size:0.9rem;
  cursor:pointer; white-space:nowrap;
}
.btn-iniciar:hover { background:rgba(124,58,237,0.25); }

.btn-history-link {
  display:inline-flex; align-items:center; gap:10px;
  margin-top:4px; padding:12px 18px;
  border:2px solid rgba(255,255,255,0.45); border-radius:12px;
  background:rgba(255,255,255,0.12); color:#fff;
  font-family:var(--font); font-weight:600; font-size:0.9rem;
  cursor:pointer; transition:all 0.2s;
  backdrop-filter:blur(4px);
}
.btn-history-link:hover {
  background:rgba(255,255,255,0.22);
  border-color:rgba(255,255,255,0.65);
}
.btn-history-link .history-icon {
  width:18px; height:18px; flex-shrink:0;
}

.hero-right {
  flex: 1; 
  position: relative;
}
.hero-right img {
  position: absolute;
  bottom: 0;
  right: 8%; /* ZERO! Isso gruda o braço dela na lateral da tela, escondendo o corte reto */
  height: 90%; /* Garante que ela sempre fique alta, encostando quase no topo */
  width: auto;
  max-width: none; /* Libera ela para não ser espremida e não encolher */
  object-fit: contain;
  object-position: bottom right;
  filter: drop-shadow(-15px 15px 25px rgba(0,0,0,0.2));
  z-index: 1; /* Deixa ela na camada de trás. Se a tela estreitar, ela passa atrás do texto */
}

/* ── Screen Loading ── */
#screen-loading {
  background:#fff;
  align-items:center; justify-content:center;
  flex-direction:column; gap:0;
}
.load-center { text-align:center; width:100%; max-width:500px; }
.load-thumb {
  width:280px; height:280px; object-fit:cover;
  border-radius:20px; margin-bottom:24px;
  box-shadow:0 8px 32px rgba(0,0,0,0.1);
}
.load-bar-wrap {
  height:6px; background:#e5e7eb; border-radius:99px;
  overflow:hidden; margin:16px 0 12px;
  width:300px; margin-left:auto; margin-right:auto;
}
.load-bar { height:100%; border-radius:99px; transition:width 0.5s; }
.load-bar.checking { width:35%; background:var(--grad-btn); animation:pulse-bar 1.2s ease-in-out infinite; }
.load-bar.loading  { width:70%; background:var(--grad-btn); animation:pulse-bar 1.2s ease-in-out infinite; }
.load-bar.done     { width:100%; background:#10b981; }
@keyframes pulse-bar { 0%,100%{opacity:1} 50%{opacity:0.6} }
.load-title { font-size:1.2rem; font-weight:700; color:#111; margin-bottom:4px; transition:opacity 0.4s ease; }
.load-title.fade-out { opacity:0; }
.load-percentage { font-size:1.8rem; font-weight:800; color:#7c3aed; margin-bottom:16px; align-items:center; justify-content:center; }
.load-progress-container {
  width:280px; height:8px; background:#e5e7eb; border-radius:99px; 
  overflow:hidden; margin-bottom:24px; box-shadow:0 2px 8px rgba(0,0,0,0.1);
}
.load-progress-bar { 
  width:0%; height:100%; background:linear-gradient(90deg, #7c3aed, #9333ea); 
  border-radius:99px; transition:width 0.3s ease;
}
.load-sub { font-size:0.9rem; color:#6b7280; transition:opacity 0.4s ease; }
.load-sub.fade-out { opacity:0; }
.success-text { color:#7c3aed; font-weight:600; }

/* ── Screen Check ── */
#screen-check {
  background: var(--grad);
  align-items:center; justify-content:center; padding:32px;
}
.check-card {
  background:#fff; border-radius:var(--radius-lg);
  padding:32px; max-width:680px; width:100%;
  box-shadow:0 20px 60px rgba(0,0,0,0.2);
  position:relative;
}
.check-ig-badge {
  position:absolute; top:-20px; right:24px;
  width:72px; height:72px; border-radius:14px;
  background:transparent;
  display:flex; align-items:center; justify-content:center;
  font-size:1.6rem; box-shadow:none;
}
.ig-badge-icon { width:48px; height:48px; object-fit:contain; transform:rotate(-15deg); }
.check-inner { display:flex; gap:24px; align-items:center; margin-bottom:28px; }
.check-thumb { width:240px; height:240px; object-fit:cover; border-radius:12px; flex-shrink:0; }
.check-info { flex:1; }
.check-eyebrow { font-size:0.8rem; font-weight:700; color:var(--purple); text-transform:uppercase; letter-spacing:0.06em; margin-bottom:8px; }
.check-title { font-size:1.6rem; font-weight:800; color:#2E1065; margin-bottom:8px; line-height:1.2; }
.check-caption { font-size:0.875rem; color:#6b7280; line-height:1.5; margin-bottom:24px; }
.check-stats { display:flex; gap:20px; }
.check-stat { display:flex; align-items:center; gap:6px; font-size:0.9rem; font-weight:600; color:#374151; }
.icon-stat { width:20px; height:20px; object-fit:contain; }
.check-actions { display:flex; gap:16px; width:100%; margin-top:24px; max-width:680px; }
.btn-outline {
  flex:1; padding:14px; border:2px solid #d8b4ff; border-radius:12px;
  background:transparent; font-family:var(--font); font-weight:600;
  font-size:0.9rem; color:#fff; cursor:pointer;
}
.btn-outline:hover { background:#f3e8ff; }
.btn-confirm {
  flex:1; padding:14px; border:none; border-radius:12px;
  background:#fff; color:#2E1065;
  font-family:var(--font); font-weight:700; font-size:0.9rem; cursor:pointer;
}
.btn-confirm:hover { background:#f3e8ff; }

/* ── Screen Config ── */
#screen-config {
  background: var(--grad);
  align-items:center; justify-content:center; padding:24px;
}
.config-wrap { max-width:680px; width:100%; display:flex; flex-direction:column; gap:24px; }
.config-page-title { font-size:1.6rem; font-weight:800; color:#fcfcfc; text-align:center; margin-bottom:16px; }
.config-card {
  background:#fff; border-radius:var(--radius-lg);
  padding:32px; box-shadow:0 20px 60px rgba(0,0,0,0.2);
}
.config-post-row { 
  display:flex; gap:20px; align-items:flex-start; 
  background:#ede9fe; padding:24px; border-radius:12px; margin-bottom:24px;
}
.config-thumb { width:120px; height:120px; border-radius:12px; object-fit:cover; flex-shrink:0; }
.config-post-info { flex:1; }
.config-uname { font-weight:800; font-size:1.1rem; color:#2E1065; margin-bottom:8px; }
.config-caption { font-size:0.9rem; color:#6b7280; margin-bottom:14px; line-height:1.5; }
.config-stats { display:flex; gap:20px; }
.config-stat { display:flex; align-items:center; gap:6px; font-size:0.9rem; font-weight:600; color:#374151; }
.config-icon { width:20px; height:20px; object-fit:contain; }
.config-divider { height:1px; background:#f3f4f6; margin:24px 0; }
.config-choices { display:grid; grid-template-columns:1fr 1fr; gap:24px; margin-bottom:28px; }
.config-choice label { display:block; font-size:0.8rem; font-weight:700; color:#2E1065; text-transform:uppercase; letter-spacing:0.05em; margin-bottom:12px; }
.num-ctrl {
  display:flex; align-items:center; justify-content:space-between;
  background:#ede9fe; padding:12px 8px; border-radius:16px;
}
.num-ctrl button {
  width:40px; height:40px; border:none; background:#fff;
  font-size:1rem; font-weight:500; color:#7c3aed; cursor:pointer;
  border-radius:50%; display:flex; align-items:center; justify-content:center;
  box-shadow:0 1px 4px rgba(0,0,0,0.08);
}
.num-ctrl button:hover { background:#f3e8ff; box-shadow:0 4px 12px rgba(0,0,0,0.15); }
.num-ctrl span { flex:1; text-align:center; font-weight:800; font-size:1.4rem; color:#2E1065; }
.btn-sortear {
  width:100%; padding:18px; border:none; border-radius:12px;
  background:#7C3AED; color:#fff;
  font-family:var(--font); font-weight:700; font-size:1rem; cursor:pointer;
  transition: all 0.3s ease;
}
.btn-sortear:hover { opacity:0.9; }
.btn-sortear.preload-ready {
  background: linear-gradient(135deg, #7C3AED 0%, #5b21b6 100%);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}
.btn-sortear.preload-ready::after {
  content: " ✓";
  margin-left: 4px;
}

/* ── Countdown ── */
#screen-countdown {
  background: #fff;
  align-items:center; justify-content:center; flex-direction:column; gap:24px;
}
#countdown-num {
  font-size:8rem; font-weight:800; color:#7C3AED;
  line-height:1;
  display:inline-flex; align-items:center; justify-content:center;
  width:200px; height:200px;
  border:6px solid transparent;
  border-radius:50%;
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, #E90375, #5C20CB) border-box;
  background-clip: padding-box, border-box;
  animation:pop-in 1s ease;
}
#countdown-num.pop { animation:pop-in 0.4s ease; }
@keyframes pop-in {
  0% { transform:scale(1.4); opacity:0.3; }
  60% { transform:scale(0.95); }
  100% { transform:scale(1); opacity:1; }
}
.countdown-label { font-size:1.1rem; font-weight:600; color:#2E1065; letter-spacing:0.08em; text-transform:uppercase; }

/* ── Spinning ── */
#screen-spinning {
  background: var(--grad);
  align-items:center; justify-content:center; flex-direction:column; gap:32px;
}
.spin-label { font-size:1.2rem; font-weight:700; color:#fff; }
.carousel-wrap {
  width:100vw; overflow:hidden; position:relative; padding:20px 0;
}
.carousel-wrap::before,
.carousel-wrap::after {
  content:''; position:absolute; top:0; bottom:0; width:120px; z-index:2; pointer-events:none;
}
.carousel-wrap::before { left:0; background:linear-gradient(to right, rgba(124,58,237,0.97), transparent); }
.carousel-wrap::after  { right:0; background:linear-gradient(to left, rgba(236,72,153,0.97), transparent); }
.carousel-track { display:flex; gap:32px; will-change:transform; padding:0 32px; }

.spin-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 4px solid transparent; /* ← importante */
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.spin-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.spin-photo.center {
  opacity:1; transform:scale(1.1);
  border-color:rgba(255,255,255,0.9);
  box-shadow:0 0 0 6px rgba(255,255,255,0.3), 0 20px 50px rgba(0,0,0,0.3);
}
.spin-photo.winner-spin {
  border: 4px solid #22c55e;
  box-shadow: 0 0 0 4px #22c55e;
  animation: winner-pulse 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes winner-pulse {
  0%   { 
    border-color: #22c55e;
    box-shadow: 0 0 0 0px rgba(34, 197, 94, 0.8);
    transform: scale(1);
  }
  40%  { 
    border-color: #22c55e;
    box-shadow: 0 0 0 12px rgba(34, 197, 94, 0.4);
    transform: scale(1.12);
  }
  70%  { 
    box-shadow: 0 0 0 20px rgba(34, 197, 94, 0.1);
    transform: scale(1.08);
  }
  100% { 
    border-color: #22c55e;
    box-shadow: 0 0 0 24px rgba(34, 197, 94, 0);
    transform: scale(1.1);
  }
}

/* ── Result ── */
#screen-result {
  background: var(--grad);
  align-items:center; justify-content:center; padding:24px;
}
.result-wrap {
  background:#fff; border-radius:var(--radius-lg);
  padding:48px; max-width:500px; width:100%;
  box-shadow:0 20px 60px rgba(0,0,0,0.2);
}
.result-title-h {
  font-size: 1.8rem; font-weight: 800; text-align: center;
  margin-bottom: 20px;
  color: #fff
}
.tabs {
  display:flex; background:#f3f4f6; border-radius:12px; padding:4px; margin-bottom:20px;
}
.tab-btn {
  flex:1; padding:10px; border:none; border-radius:9px; background:none;
  font-family:var(--font); font-weight:700; font-size:0.88rem;
  color:#6b7280; cursor:pointer; transition:all 0.2s;
}
.tab-btn.active { background:#fff; color:var(--purple); box-shadow:0 2px 8px rgba(0,0,0,0.08); }

/* Single winner */
.single-winner-card { text-align:center; padding:8px 0 16px; }
.single-avatar {
  width:140px; height:140px; border-radius:50%; object-fit:cover;
  border:4px solid #ede9fe; margin:0 auto 16px; display:block;
  box-shadow:0 4px 20px rgba(124,58,237,0.2);
}
.single-username { font-size:1.3rem; font-weight:800; color:#7c3aed; margin-bottom:16px; }
.single-comment-box {
  background:#ede9fe; border-radius:12px; padding:20px; text-align:center; border:2px solid #7c3aed;
}
.single-comment-label { font-size:0.8rem; font-weight:700; color:#7c3aed; text-transform:uppercase; letter-spacing:0.05em; margin-bottom:8px; }
.single-comment-text { font-size:1rem; color:#2E1065; }

/* Multi winner rows */
.result-row {
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; border-radius:12px;
  margin-bottom:8px; background:#f9fafb;
  cursor:default; transition:background 0.15s;
}
.result-row:hover { background:#f3f4f6; }
.result-rank { font-size:0.85rem; font-weight:700; color:#9ca3af; min-width:28px; }
.result-avatar-sm { width:42px; height:42px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.result-info { flex:1; min-width:0; }
.result-uname { font-weight:700; font-size:0.9rem; color:#111; }
.result-comment-sm { font-size:0.75rem; color:#6b7280; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.result-chevron { color:#d1d5db; font-size:1.2rem; }

.btn-download {
  width:100%; margin-top:20px; padding:15px;
  border:none; border-radius:12px;
  background:#7c3aed; color:#fff;
  font-family:var(--font); font-weight:700; font-size:0.95rem;
  cursor:pointer;
}
.btn-download:hover { opacity:0.9; background:#6d28d9; }
.btn-novo {
  width:100%; margin-top:10px; padding:13px;
  border:2px solid #e5e7eb; border-radius:12px;
  background:#fff; color:#374151;
  font-family:var(--font); font-weight:700; font-size:0.9rem;
  cursor:pointer;
}

/* ── Screen History ── */
#screen-history {
  background: var(--grad);
  align-items:center; justify-content:flex-start;
  padding:32px 24px 48px;
}
.history-wrap {
  width:100%; max-width:720px;
}
.history-header {
  display:flex; align-items:center; gap:12px;
  margin-bottom:24px;
}
.history-back {
  width:40px; height:40px; border-radius:12px;
  border:2px solid rgba(255,255,255,0.4);
  background:rgba(255,255,255,0.15); color:#fff;
  font-size:1.4rem; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.history-back:hover { background:rgba(255,255,255,0.25); }
.history-page-title {
  font-size:1.6rem; font-weight:800; color:#fff;
}
.history-loading {
  display:flex; flex-direction:column; align-items:center;
  padding:48px 0; gap:8px;
}
.history-loading .load-ring { margin-bottom:8px; }
.history-loading .load-sub { color:rgba(255,255,255,0.85); }
.history-empty {
  background:#fff; border-radius:var(--radius-lg);
  padding:48px 32px; text-align:center;
  box-shadow:0 20px 60px rgba(0,0,0,0.2);
}
.history-empty-icon { font-size:2.5rem; margin-bottom:12px; }
.history-empty-title {
  font-size:1.2rem; font-weight:800; color:#2E1065; margin-bottom:8px;
}
.history-empty-sub { font-size:0.9rem; color:#6b7280; margin-bottom:24px; }
.btn-history-cta {
  padding:14px 28px; border:none; border-radius:12px;
  background:var(--grad-btn); color:#fff;
  font-family:var(--font); font-weight:700; font-size:0.9rem;
  cursor:pointer;
}
.btn-history-cta:hover { opacity:0.9; }
.history-list {
  display:flex; flex-direction:column; gap:14px;
}
.history-card {
  background:#fff; border-radius:var(--radius-lg);
  padding:20px; box-shadow:0 12px 40px rgba(0,0,0,0.15);
  cursor:pointer; transition:transform 0.15s, box-shadow 0.15s;
  border:none; width:100%; text-align:left; font-family:var(--font);
}
.history-card:hover {
  transform:translateY(-2px);
  box-shadow:0 16px 48px rgba(0,0,0,0.2);
}
.history-card-inner {
  display:flex; gap:16px; align-items:center;
}
.history-card-thumb {
  width:72px; height:72px; border-radius:12px;
  object-fit:cover; flex-shrink:0; background:#ede9fe;
}
.history-card-info { flex:1; min-width:0; }
.history-card-title {
  font-size:1rem; font-weight:800; color:#2E1065;
  margin-bottom:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.history-card-date { font-size:0.8rem; color:#9ca3af; margin-bottom:8px; }
.history-card-meta {
  display:flex; flex-wrap:wrap; gap:8px;
}
.history-card-badge {
  font-size:0.75rem; font-weight:600; color:#7c3aed;
  background:#ede9fe; padding:4px 10px; border-radius:99px;
}
.history-card-chevron {
  color:#d1d5db; font-size:1.4rem; flex-shrink:0;
}
.history-detail { width:100%; }
.history-detail-back {
  display:inline-flex; align-items:center; gap:6px;
  border:none; background:none; color:#fff;
  font-family:var(--font); font-weight:600; font-size:0.9rem;
  cursor:pointer; margin-bottom:16px; padding:8px 0;
}
.history-detail-back:hover { opacity:0.85; }
.history-detail-card {
  background:#fff; border-radius:var(--radius-lg);
  padding:28px; box-shadow:0 20px 60px rgba(0,0,0,0.2);
}
.history-detail-post {
  display:flex; gap:16px; align-items:center;
  margin-bottom:20px; padding-bottom:20px;
  border-bottom:1px solid #f3f4f6;
}
.history-detail-thumb {
  width:80px; height:80px; border-radius:12px;
  object-fit:cover; flex-shrink:0; background:#ede9fe;
}
.history-detail-post-info { flex:1; min-width:0; }
.history-detail-post-title {
  font-size:1.1rem; font-weight:800; color:#2E1065; margin-bottom:4px;
}
.history-detail-post-date { font-size:0.8rem; color:#9ca3af; margin-bottom:6px; }
.history-detail-post-caption {
  font-size:0.85rem; color:#6b7280; line-height:1.4;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.history-detail-stats {
  display:flex; gap:12px; flex-wrap:wrap; margin-bottom:20px;
}
.history-detail-stat {
  font-size:0.8rem; font-weight:600; color:#374151;
  background:#f9fafb; padding:6px 12px; border-radius:8px;
}
.history-detail-section-title {
  font-size:0.8rem; font-weight:700; color:#7c3aed;
  text-transform:uppercase; letter-spacing:0.06em;
  margin-bottom:12px;
}
.history-detail-section { margin-bottom:20px; }
.history-detail-section:last-child { margin-bottom:0; }
.btn-history-post-link {
  display:inline-flex; align-items:center; gap:6px;
  margin-top:16px; padding:10px 16px;
  border:2px solid #ede9fe; border-radius:10px;
  background:#faf5ff; color:#7c3aed;
  font-family:var(--font); font-weight:600; font-size:0.85rem;
  text-decoration:none; transition:background 0.15s;
}
.history-detail-card .btn-download {
  margin-top: 8px;
}

/* ── Login Modal ── */
#login-modal {
  display:none; position:fixed; inset:0; z-index:500;
  background:rgba(0,0,0,0.5); backdrop-filter:blur(4px);
  align-items:center; justify-content:center; padding:24px;
}
.modal-box {
  background:#fff; border-radius:24px;
  padding:40px 36px; max-width:400px; width:100%;
  text-align:center; position:relative;
  box-shadow:0 24px 80px rgba(0,0,0,0.2);
}
.modal-close {
  position:absolute; top:16px; right:16px;
  width:32px; height:32px; border-radius:50%;
  border:none; background:#f3f4f6;
  font-size:1rem; cursor:pointer; color:#6b7280;
  display:flex; align-items:center; justify-content:center;
}
.modal-illus { font-size:3rem; margin-bottom:16px; }
.modal-title { font-size:1.1rem; font-weight:700; color:#2E1065; margin-bottom:24px; }
.btn-google-modal {
  display:flex; align-items:center; justify-content:center; gap:10px;
  width:100%; padding:14px 20px;
  background:#fff; border:2px solid #e5e7eb; border-radius:12px;
  font-family:var(--font); font-weight:700; font-size:0.9rem;
  color:#374151; cursor:pointer; transition:all 0.2s;
}
.btn-google-modal:hover { background:#f9fafb; border-color:#d1d5db; }
.btn-google-modal img { width:20px; }

/* ── Credits Modal ── */
#credits-modal {
  display:none; position:fixed; inset:0; z-index:500;
  background:rgba(0,0,0,0.5); backdrop-filter:blur(4px);
  align-items:center; justify-content:center; padding:24px;
}
.credits-modal-box { max-width:420px; }
.credits-modal-icon { font-size:2.5rem; margin-bottom:12px; }
.credits-modal-desc {
  font-size:0.9rem; color:#6b7280; line-height:1.55;
  margin-bottom:20px; text-align:center;
}
.credits-wa-error {
  font-size:0.85rem; color:#dc2626; margin-bottom:16px; text-align:center;
}
.btn-support-wa {
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  width:100%; padding:14px 20px; margin-bottom:12px;
  background:linear-gradient(135deg, #25D366, #128C7E);
  border:none; border-radius:12px;
  font-family:var(--font); font-weight:700; font-size:0.95rem;
  color:#fff; cursor:pointer; transition:opacity 0.2s;
}
.btn-support-wa:hover { opacity:0.92; }
.btn-outline-dark {
  width:100%; padding:12px 20px;
  background:transparent; border:2px solid #e5e7eb; border-radius:12px;
  font-family:var(--font); font-weight:600; font-size:0.9rem;
  color:#374151; cursor:pointer; transition:background 0.15s;
}
.btn-outline-dark:hover { background:#f9fafb; }

/* ── Admin Panel ── */
#screen-admin {
  background: var(--grad);
  align-items:center; justify-content:flex-start;
  padding:32px 24px 48px; overflow-y:auto;
}
.admin-wrap {
  width:100%; max-width:480px; margin:0 auto;
}
.admin-back {
  display:inline-flex; align-items:center; gap:4px;
  background:transparent; border:none; color:#fff;
  font-family:var(--font); font-weight:600; font-size:0.9rem;
  cursor:pointer; margin-bottom:16px; padding:8px 0;
}
.admin-page-title {
  font-size:1.5rem; font-weight:800; color:#fff;
  margin-bottom:20px; line-height:1.25;
}
.admin-hint, .admin-denied {
  background:#fff; border-radius:var(--radius-lg);
  padding:28px 24px; text-align:center;
  box-shadow:0 20px 60px rgba(0,0,0,0.15);
  color:#374151; line-height:1.6;
}
.admin-login-btn { margin-top:16px; min-width:140px; }
.admin-card {
  background:#fff; border-radius:var(--radius-lg);
  padding:24px; box-shadow:0 20px 60px rgba(0,0,0,0.15);
  overflow:hidden;
}
.admin-field { margin-bottom:18px; }
.admin-field:last-child { margin-bottom:0; }
.admin-field-hint {
  margin-top:8px; font-size:0.78rem; color:#9ca3af; line-height:1.4;
}
.admin-divider {
  height:1px; background:#f3f4f6; margin:20px 0;
}
.admin-support-field { margin-bottom:0; }
.admin-field label {
  display:block; font-size:0.8rem; font-weight:700;
  color:#374151; margin-bottom:8px;
  text-transform:uppercase; letter-spacing:0.04em;
}
.admin-search-row {
  display:flex; align-items:stretch; gap:8px;
  width:100%; min-width:0;
}
.admin-search-row input,
.admin-amount-input {
  flex:1; min-width:0; width:100%;
  padding:11px 14px; border:2px solid #e5e7eb;
  border-radius:10px; font-family:var(--font); font-size:0.9rem;
  background:#fff; color:#111;
}
.admin-amount-input { max-width:120px; flex:0 0 88px; text-align:center; }
.admin-search-row input:focus,
.admin-amount-input:focus {
  outline:none; border-color:#c4b5fd;
}
.admin-btn {
  flex-shrink:0; border:none; border-radius:10px;
  font-family:var(--font); font-weight:700; font-size:0.88rem;
  cursor:pointer; padding:11px 18px; white-space:nowrap;
  transition:opacity 0.15s, background 0.15s;
}
.admin-btn-primary {
  background:#7c3aed; color:#fff;
}
.admin-btn-primary:hover { opacity:0.92; }
.admin-btn-secondary {
  background:#ede9fe; color:#5b21b6;
}
.admin-btn-secondary:hover { background:#ddd6fe; }
.admin-btn-danger {
  background:#fff; color:#dc2626; border:2px solid #fecaca;
}
.admin-btn-danger:hover { background:#fef2f2; border-color:#fca5a5; }
.admin-credits-actions { flex-wrap:wrap; }
@media (max-width:480px) {
  .admin-credits-actions .admin-btn { flex:1; min-width:calc(50% - 4px); }
  .admin-credits-actions .admin-amount-input { flex:1 1 100%; max-width:none; }
}
.admin-user-result {
  border-top:1px solid #f3f4f6; padding-top:20px; margin-top:20px;
}
.admin-user-meta {
  font-size:0.85rem; color:#6b7280; line-height:1.55;
  margin-bottom:16px; padding:14px 16px;
  background:#f9fafb; border-radius:10px; border:1px solid #f3f4f6;
  white-space:pre-line; word-break:break-word;
}
.admin-credits-display {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:20px; padding:14px 16px;
  background:#faf5ff; border-radius:12px; border:1px solid #ede9fe;
}
.admin-credits-label {
  font-size:0.85rem; font-weight:600; color:#6b7280;
}
.admin-credits-value {
  font-size:1.75rem; font-weight:800; color:#7c3aed; line-height:1;
}

/* ── Toast ── */
.toast {
  position:fixed; bottom:80px; left:50%; transform:translateX(-50%) translateY(20px);
  background:#1f2937; color:#fff; padding:12px 24px; border-radius:99px;
  font-size:0.85rem; font-weight:600; opacity:0; transition:all 0.3s;
  pointer-events:none; z-index:999; white-space:nowrap; max-width:90vw;
}
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

#confetti-canvas { position:fixed; inset:0; z-index:50; pointer-events:none; }

.load-spinner {
  display:flex; gap:8px; align-items:center; justify-content:center;
  margin-bottom:24px; height:60px;
}
.load-spinner::before,
.load-spinner::after,
.load-spinner span {
  width:12px; height:12px; background:#7c3aed; border-radius:50%;
  animation:pulse 1.4s infinite;
}
.load-spinner::before { content:''; animation-delay:0s; }
.load-spinner span { animation-delay:0.2s; }
.load-spinner::after { content:''; animation-delay:0.4s; }
@keyframes pulse {
  0%, 100% { opacity:0.3; }
  50% { opacity:1; }
}

/* Loading ring animado */
.load-ring {
  position: relative;
  width: 80px; height: 80px;
  margin: 0 auto 24px;
}
.load-ring svg {
  width: 80px; height: 80px;
  animation: spin-ring 1.4s linear infinite;
}
@keyframes spin-ring {
  to { transform: rotate(360deg); }
}
.load-ring-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 32px; height: 32px;
  object-fit: contain;
}
.load-spinner-wrap {
  text-align: center;
}
/* Texto rotativo com fade */
#load-rotating-text {
  animation: none;
  transition: opacity 0.4s ease;
}
#load-rotating-text.fade-out { opacity: 0; }
#load-rotating-text.fade-in  { opacity: 1; }

@media(max-width:768px) {
  #screen-input { flex-direction:column; }
  .hero-left { padding:32px 24px 32px 16px; flex:none; }
  .hero-title { font-size:2rem; }
  .hero-right { display:none; }
  .btn-history-link { font-size:0.85rem; padding:10px 14px; }
  .history-page-title { font-size:1.3rem; }
  .history-card-inner { gap:12px; }
  .history-card-thumb { width:60px; height:60px; }
  .check-inner { flex-direction:column; }
  .check-thumb { width:100%; height:200px; }

}

@keyframes fadeIn {
  from { opacity:0; }
  to   { opacity:1; }
}
@keyframes popUp {
  from { transform:scale(0.8); opacity:0; }
  to   { transform:scale(1);   opacity:1; }
}
