/* ============================================================
   Sacá tu número — sistema de diseño compartido
   ============================================================ */

:root{
  --bg: #14161c;
  --bg-2: #1c1f28;
  --bg-3: #23273233;
  --paper: #f4ede1;
  --ink: #14161c;
  --gold: #d9a441;
  --gold-dim: #8a6c2f;
  --red: #c0392b;
  --green: #4c9a6a;
  --line: rgba(244,237,225,0.14);
  --muted: #9a9a9a;
  --muted-2: #6f6f6f;
  --card-bg: var(--bg-2);
  --input-bg: #0f1116;
  --overlay: rgba(8,9,12,0.6);
  --shadow: 0 20px 60px rgba(0,0,0,0.45);
  --radius: 10px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Helvetica Neue', Arial, sans-serif;
}

html[data-theme="light"]{
  --bg: #f7f3ea;
  --bg-2: #ffffff;
  --paper: #ffffff;
  --ink: #14161c;
  --gold: #b9852b;
  --gold-dim: #8a6c2f;
  --red: #b3392a;
  --green: #2f7a4d;
  --line: rgba(20,22,28,0.12);
  --muted: #55575e;
  --muted-2: #7a7c82;
  --card-bg: #ffffff;
  --input-bg: #ffffff;
  --overlay: rgba(20,20,25,0.35);
  --shadow: 0 16px 40px rgba(20,22,28,0.12);
}

*{ box-sizing:border-box; }
html{ color-scheme: dark; }
html[data-theme="light"]{ color-scheme: light; }

body{
  margin:0;
  background:var(--bg);
  color:var(--paper);
  font-family:var(--sans);
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  transition:background .2s ease, color .2s ease;
}

html[data-theme="light"] body{ color:var(--ink); }

a{ color:var(--gold); }
img{ max-width:100%; }

/* ---------- Top bar ---------- */
.topbar{
  position:sticky; top:0; z-index:40;
  width:100%; max-width:680px;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  background:linear-gradient(to bottom, var(--bg) 70%, transparent);
}
.icon-btn{
  background:transparent; border:1px solid var(--line); color:inherit;
  width:40px; height:40px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; font-size:18px; flex-shrink:0;
}
.icon-btn:hover{ border-color:var(--gold); }
.brandmark{
  font-family:var(--serif); font-size:15px; letter-spacing:.02em; color:var(--muted);
}

/* ---------- Sidebar / perfil ---------- */
.sidebar-overlay{
  position:fixed; inset:0; background:var(--overlay); z-index:60;
  opacity:0; pointer-events:none; transition:opacity .25s ease;
}
.sidebar-overlay.open{ opacity:1; pointer-events:auto; }

.sidebar{
  position:fixed; top:0; left:0; height:100%; width:min(340px, 88vw);
  background:var(--bg-2); color:var(--paper); z-index:61;
  transform:translateX(-105%); transition:transform .28s ease;
  display:flex; flex-direction:column;
  box-shadow:var(--shadow);
}
html[data-theme="light"] .sidebar{ color:var(--ink); }
.sidebar.open{ transform:translateX(0); }

.sidebar-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px; border-bottom:1px solid var(--line);
}
.sidebar-head h2{ font-family:var(--serif); font-size:18px; margin:0; }
.sidebar-body{ padding:6px 0 24px; overflow-y:auto; flex:1; }

.side-section{ padding:16px 18px; border-bottom:1px solid var(--line); }
.side-section h3{
  font-size:12px; text-transform:uppercase; letter-spacing:.08em;
  color:var(--gold); margin:0 0 12px;
}
.side-field{ margin-bottom:10px; }
.side-field label{ display:block; font-size:12px; color:var(--muted); margin-bottom:4px; }
.side-field input{
  width:100%; padding:9px 10px; border-radius:6px; border:1px solid var(--line);
  background:var(--input-bg); color:inherit; font-size:14px;
}
.btn-mini{
  background:var(--gold); color:#14161c; border:none; padding:9px 14px;
  font-size:13px; font-weight:700; border-radius:6px; cursor:pointer;
}
.btn-mini.secondary{
  background:transparent; color:inherit; border:1px solid var(--line);
  font-weight:500;
}
.btn-mini.danger{ background:var(--red); color:#fff; }
.btn-row{ display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; }

.theme-toggle{ display:flex; gap:8px; }
.theme-opt{
  flex:1; text-align:center; padding:10px; border-radius:8px; border:1px solid var(--line);
  cursor:pointer; font-size:13px; background:transparent; color:inherit;
}
.theme-opt.active{ border-color:var(--gold); color:var(--gold); }

.mis-sorteos-list{ display:flex; flex-direction:column; gap:8px; margin-top:4px; }
.mis-sorteo-item{
  display:flex; justify-content:space-between; align-items:center;
  background:var(--input-bg); border:1px solid var(--line); border-radius:8px;
  padding:9px 11px; font-size:13px;
}
.mis-sorteo-item .num{ font-family:var(--serif); color:var(--red); font-weight:700; }
.empty-note{ font-size:13px; color:var(--muted); line-height:1.5; }

.side-foot{ padding:16px 18px; font-size:12px; color:var(--muted-2); }

/* ---------- Video gate ---------- */
.video-gate{
  position:fixed; inset:0; background:#000; z-index:70;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  opacity:1; transition:opacity .25s ease;
}
.video-gate[hidden]{ display:none; }
.video-gate.closing{ opacity:0; pointer-events:none; }
.video-gate-label{
  color:#8a8a8a; font-size:11px; letter-spacing:.1em; text-transform:uppercase;
  margin-bottom:10px; font-family:var(--sans);
}
.video-gate-frame{
  width:100%; max-width:520px; min-height:280px; background:#0a0a0a;
  display:flex; align-items:center; justify-content:center; border-radius:6px; overflow:hidden;
}
.video-gate video{ width:100%; max-width:520px; }
.video-gate-status{ color:#8a8a8a; font-size:13px; margin-top:14px; font-family:var(--sans); min-height:18px; }
.skip-wrap{ margin-top:14px; font-family:var(--serif); }
.skip-btn{
  background:var(--gold); color:#14161c; border:none; padding:10px 22px;
  font-size:15px; border-radius:6px; cursor:pointer; font-weight:600;
  opacity:0.35; pointer-events:none; transition:opacity .2s;
}
.skip-btn.ready{ opacity:1; pointer-events:auto; }
.timer-note{ color:#9a9a9a; font-size:13px; margin-top:10px; text-align:center; }

/* ---------- Banners (Adsterra) ---------- */
.promo-slot{ display:flex; flex-direction:column; align-items:center; gap:6px; }
.promo-slot .promo-label{ display:block; }
.promo-box{ display:flex; align-items:center; justify-content:center; overflow:hidden; }

/* ---------- Cuenta regresiva de edición ---------- */
.countdown-box{
  display:flex; flex-direction:column; align-items:center; gap:8px;
  max-width:640px; margin:0 auto; padding:0 20px; text-align:center;
}
.countdown-box .cd-label{ font-size:12px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.countdown-timer{ display:flex; gap:8px; }
.countdown-timer .cd-unit{
  background:var(--bg-2); border:1px solid var(--line); border-radius:8px;
  padding:8px 12px; min-width:56px; text-align:center;
}
html[data-theme="light"] .countdown-timer .cd-unit{ background:#fff; }
.countdown-timer .cd-num{ font-family:var(--serif); font-size:22px; font-weight:700; color:var(--gold); line-height:1; }
.countdown-timer .cd-unit-label{ font-size:10px; color:var(--muted-2); text-transform:uppercase; margin-top:2px; }
.countdown-box.closed .cd-num{ color:var(--red); }

/* ---------- Premios (lista plana, sorteo por fecha) ---------- */
.prize-flat{ display:flex; flex-direction:column; gap:10px; }
.prize-flat .tier{ display:flex; justify-content:space-between; align-items:center; padding:14px; }
.prize-flat .tier .name{ font-weight:600; }
.prize-flat .tier .amount{ font-family:var(--serif); color:var(--red); font-size:18px; font-weight:700; }

.winners-list{ display:flex; flex-direction:column; gap:8px; }
.winners-list .winner-item{
  display:flex; justify-content:space-between; background:var(--input-bg); border:1px solid var(--line);
  border-radius:8px; padding:10px 14px; font-size:14px;
}
.winners-list .winner-item .num{ font-family:var(--serif); color:var(--red); font-weight:700; }

/* ---------- Header / hero ---------- */
header.hero{
  padding:16px 20px 10px; text-align:center; max-width:640px; position:relative;
  background:radial-gradient(ellipse 60% 100% at 50% 0%, rgba(217,164,65,0.14), transparent 70%);
}
header.hero .eyebrow{ font-family:var(--serif); font-style:italic; color:var(--gold); font-size:15px; }
header.hero h1{ font-family:var(--serif); font-size:32px; margin:6px 0 4px; line-height:1.15; }
header.hero p{ color:var(--muted); font-size:15px; line-height:1.5; margin:0; }

.hero-ticket-visual{ display:flex; justify-content:center; margin-top:22px; filter:drop-shadow(0 12px 24px rgba(0,0,0,0.25)); }
.hero-ticket-visual svg{ max-width:100%; height:auto; }

/* ---------- Trust bar ---------- */
.trust-bar{
  display:flex; flex-wrap:wrap; gap:8px; justify-content:center;
  max-width:640px; padding:0 20px;
}
.trust-chip{
  display:flex; align-items:center; gap:6px;
  background:var(--bg-2); border:1px solid var(--line); border-radius:999px;
  padding:6px 12px; font-size:12px; color:var(--muted);
}
html[data-theme="light"] .trust-chip{ background:#fff; }

.live-counter{
  text-align:center; font-size:13px; color:var(--muted); max-width:640px; padding:0 20px;
}
.live-counter strong{ color:var(--gold); }

/* ---------- Main ---------- */
main{ width:100%; max-width:640px; padding:20px; display:flex; flex-direction:column; gap:22px; }

.promo-slot-legacy{ min-height:0; }
.promo-label{
  font-size:10px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted-2);
  text-align:center; margin-bottom:4px; display:none;
}
.promo-slot-legacy:not(:empty){ border:1px solid var(--line); border-radius:8px; padding:10px; background:rgba(244,237,225,0.03); }
.promo-slot-legacy:not(:empty) + .promo-label, .promo-label.force-show{ display:block; }

.ticket-card{
  background:var(--paper); color:#14161c; border-radius:var(--radius); position:relative;
  padding:26px 24px 30px; display:none; box-shadow:var(--shadow);
}
.ticket-card.shown{ display:block; }
.ticket-card::before, .ticket-card::after{
  content:""; position:absolute; width:20px; height:20px; background:var(--bg);
  border-radius:50%; top:50%; transform:translateY(-50%);
}
.ticket-card::before{ left:-10px; }
.ticket-card::after{ right:-10px; }
.ticket-number-label{ font-size:13px; letter-spacing:.05em; color:#6b6b6b; }
.ticket-number{ font-family:var(--serif); font-size:64px; font-weight:700; line-height:1; margin:6px 0 10px; color:var(--red); }
.ticket-sub{ font-size:14px; color:#4a4a4a; border-top:1px dashed #b9ad97; padding-top:12px; margin-top:8px; }
.ticket-actions{ margin-top:14px; display:flex; gap:8px; flex-wrap:wrap; }

.chances-box{
  margin-top:14px; padding-top:14px; border-top:1px dashed #b9ad97;
  font-size:13px; color:#4a4a4a;
}
.chances-box .chances-count{ font-weight:700; color:var(--red); }
.chances-box .btn-mini{ margin-top:8px; }
.chances-box .chances-cooldown{ color:#6b6b6b; font-size:12px; margin-top:4px; }

form{ display:flex; flex-direction:column; gap:12px; background:var(--bg-2); padding:22px; border-radius:var(--radius); }
form.hidden{ display:none; }
label{ font-size:13px; color:var(--muted); }
input[type=text], input[type=email], input[type=tel]{
  width:100%; padding:11px 12px; border-radius:6px; border:1px solid var(--line);
  background:var(--input-bg); color:inherit; font-size:15px; margin-top:4px;
}
.checkbox-row{ display:flex; gap:10px; align-items:flex-start; font-size:13px; color:var(--muted); margin-top:6px; }
.checkbox-row input{ margin-top:3px; }
.checkbox-row a{ color:var(--gold); }
.submit-btn{
  margin-top:8px; background:var(--gold); color:#14161c; border:none; padding:14px;
  font-size:16px; font-weight:700; border-radius:8px; cursor:pointer;
}
.submit-btn:disabled{ opacity:.5; cursor:not-allowed; }
.submit-btn .spinner{ display:none; }
.submit-btn.loading .spinner{ display:inline-block; }
.error-msg{ color:#e18b7d; font-size:13px; display:none; }
.error-msg.show{ display:block; }

/* ---------- Prize tiers ---------- */
.prize-tiers{ display:flex; flex-direction:column; gap:12px; }
.prize-tiers h2{ font-family:var(--serif); font-size:20px; margin:0 0 2px; }
.tier{
  border:1px solid var(--line); border-radius:8px; padding:14px;
  background:var(--bg-2);
}
html[data-theme="light"] .tier{ background:#fff; }
.tier-top{ display:flex; justify-content:space-between; align-items:center; font-size:14px; margin-bottom:8px; }
.tier .name{ color:inherit; font-weight:600; }
.tier .status{ font-size:11px; padding:3px 9px; border-radius:999px; text-transform:uppercase; letter-spacing:.04em; }
.tier .status.en-curso{ background:rgba(217,164,65,0.16); color:var(--gold); }
.tier .status.bloqueado{ background:rgba(255,255,255,0.06); color:var(--muted); }
.tier .status.entregado{ background:rgba(76,154,106,0.18); color:var(--green); }
.tier-bar{ height:6px; border-radius:999px; background:rgba(255,255,255,0.08); overflow:hidden; }
.tier-bar-fill{ height:100%; background:var(--gold); border-radius:999px; }
.tier-note{ font-size:12px; color:var(--muted-2); margin-top:4px; }

/* ---------- Transparency / FAQ ---------- */
.section-card{
  background:var(--bg-2); border:1px solid var(--line); border-radius:var(--radius); padding:20px;
}
html[data-theme="light"] .section-card{ background:#fff; }
.section-card h2{ font-family:var(--serif); font-size:20px; margin:0 0 10px; }
.section-card p{ font-size:14px; line-height:1.6; color:var(--muted); margin:0 0 10px; }
.section-card p:last-child{ margin-bottom:0; }

.faq-item{ border-bottom:1px solid var(--line); }
.faq-item:last-child{ border-bottom:none; }
.faq-q{
  width:100%; text-align:left; background:none; border:none; color:inherit;
  padding:14px 0; font-size:14px; font-weight:600; cursor:pointer;
  display:flex; justify-content:space-between; align-items:center; gap:10px;
}
.faq-q .chevron{ transition:transform .2s ease; color:var(--gold); flex-shrink:0; }
.faq-item.open .faq-q .chevron{ transform:rotate(180deg); }
.faq-a{ max-height:0; overflow:hidden; transition:max-height .25s ease; }
.faq-item.open .faq-a{ max-height:240px; }
.faq-a p{ padding:0 0 14px; font-size:13px; color:var(--muted); line-height:1.6; margin:0; }

.winners-empty{
  text-align:center; padding:22px 16px; color:var(--muted); font-size:13px; line-height:1.6;
}

/* ---------- Home: pasos y tarjeta de sorteo ---------- */
.steps-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:18px; position:relative; }
.steps-list::before{
  content:""; position:absolute; left:12px; top:26px; bottom:26px; width:1px;
  background:linear-gradient(to bottom, var(--gold), transparent 95%); opacity:.35;
}
.steps-list li{ display:flex; gap:12px; align-items:flex-start; position:relative; }
.step-num{
  flex-shrink:0; width:26px; height:26px; border-radius:50%; background:var(--gold);
  color:#14161c; font-weight:700; font-size:13px; display:flex; align-items:center; justify-content:center;
  position:relative; z-index:1; box-shadow:0 0 0 4px var(--bg-2);
}
html[data-theme="light"] .step-num{ box-shadow:0 0 0 4px #fff; }
.steps-list p{ margin:0; font-size:14px; color:var(--muted); line-height:1.55; padding-top:3px; }

.sorteo-card{
  border:1px solid var(--line); border-left:4px solid var(--gold); border-radius:var(--radius); padding:20px;
  background:linear-gradient(135deg, rgba(217,164,65,0.08), transparent 60%), var(--bg-2);
  display:flex; flex-direction:column; gap:10px;
}
html[data-theme="light"] .sorteo-card{ background:linear-gradient(135deg, rgba(217,164,65,0.08), transparent 60%), #fff; }
.sorteo-card-top{ display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.sorteo-card h3{ font-family:var(--serif); font-size:19px; margin:0; }
.sorteo-card p{ font-size:14px; color:var(--muted); margin:0; line-height:1.55; }
.sorteo-card .cta{
  display:inline-block; align-self:flex-start; margin-top:4px; text-decoration:none;
  background:var(--gold); color:#14161c; font-weight:700; font-size:14px;
  padding:11px 20px; border-radius:8px; transition:transform .15s ease, box-shadow .15s ease;
}
.sorteo-card .cta:hover{ transform:translateY(-1px); box-shadow:0 6px 16px rgba(217,164,65,0.35); }

/* ---------- Footer ---------- */
footer.site-footer{ color:var(--muted-2); font-size:12px; text-align:center; padding:26px 20px 40px; max-width:560px; }
footer.site-footer a{ color:var(--muted); }
footer.site-footer .org-line{ color:var(--muted); margin-bottom:6px; }

/* ---------- Legal pages ---------- */
.legal-page{ background:var(--bg); color:var(--paper); font-family:var(--serif); max-width:680px; margin:0 auto; padding:0 20px 60px; line-height:1.6; width:100%; }
html[data-theme="light"] .legal-page{ color:var(--ink); }
.legal-page h1{ font-size:26px; }
.legal-page h2{ font-size:19px; margin-top:32px; color:var(--gold); }
.legal-page .note{ background:var(--bg-2); border:1px dashed var(--line); padding:14px; font-size:14px; color:var(--muted); border-radius:8px; }
.back-link{ display:inline-block; margin:20px; font-family:var(--sans); font-size:13px; }

@media (max-width:480px){
  header.hero h1{ font-size:26px; }
  .ticket-number{ font-size:48px; }
}
