/* Sorteos Revo — estética Casa Revo
   Tipografías: Valve Bold / Valve Bold Italic (títulos) y Groste (texto).
   Coloca los archivos en /public/fonts con estos nombres (ver fonts/LEEME.txt). */

@font-face { font-family: 'Valve'; src: url('/fonts/Valve-Bold.woff2') format('woff2'), url('/fonts/Valve-Bold.otf') format('opentype'), url('/fonts/Valve-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Valve'; src: url('/fonts/Valve-BoldItalic.woff2') format('woff2'), url('/fonts/Valve-BoldItalic.otf') format('opentype'), url('/fonts/Valve-BoldItalic.ttf') format('truetype'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Groste'; src: url('/fonts/Groste.woff2') format('woff2'), url('/fonts/Groste.otf') format('opentype'), url('/fonts/Groste.ttf') format('truetype'); font-weight: 400; font-display: swap; }

:root {
  --negro: #0A0A0A;
  --negro-2: #121212;
  --negro-3: #1A1A1A;
  --linea: #2A2A28;
  --hueso: #EDE8DC;
  --hueso-2: #B9B4A8;
  --hueso-3: #7D796F;
  --verde: #08EE4F;
  --verde-2: #06C241;
  --uv: #9D4DFF;
  --rojo: #FF5A4E;
  --display: 'Valve', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --texto: 'Groste', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radio: 14px;
  --sombra: 0 20px 60px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--negro); color: var(--hueso); }
body { font-family: var(--texto); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; min-height: 100dvh; }
a { color: var(--verde); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--verde); color: var(--negro); }
:focus-visible { outline: 3px solid var(--verde); outline-offset: 2px; }

.display, h1, h2, h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: -.01em; line-height: .95; margin: 0; }
.italic { font-style: italic; }
h1 { font-size: clamp(32px, 6vw, 56px); font-style: italic; }
h2 { font-size: clamp(22px, 3.4vw, 30px); }
h3 { font-size: 18px; }
.muted { color: var(--hueso-2); }
.dim { color: var(--hueso-3); }
.verde { color: var(--verde); }
.uv { color: var(--uv); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 14px; }
.stack-lg > * + * { margin-top: 28px; }

/* ---------- layout ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px clamp(14px, 3vw, 28px); background: rgba(10,10,10,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--linea); }
.logo { display: flex; align-items: baseline; gap: 8px; color: var(--hueso); text-decoration: none !important; }
.logo b { font-family: var(--display); font-style: italic; font-size: 22px; letter-spacing: -.02em; text-transform: uppercase; }
.logo span { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--verde); }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--hueso-2); padding: 8px 12px; border-radius: 999px; font-size: 14px; white-space: nowrap; text-decoration: none; }
.nav a:hover, .nav a.on { color: var(--negro); background: var(--hueso); }
.who { font-size: 13px; color: var(--hueso-3); white-space: nowrap; }
main { max-width: 1180px; margin: 0 auto; padding: clamp(18px, 4vw, 40px) clamp(14px, 3vw, 28px) 80px; }
.eyebrow { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--verde); margin-bottom: 10px; display: block; }

/* ---------- botones ---------- */
.btn { --bg: var(--negro-3); --fg: var(--hueso); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 1px solid var(--linea); border-radius: 999px; background: var(--bg); color: var(--fg); font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; font-size: 15px; cursor: pointer; transition: transform .12s ease, background .15s, border-color .15s; text-decoration: none !important; white-space: nowrap; }
.btn:hover { border-color: var(--hueso-3); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary { --bg: var(--verde); --fg: var(--negro); border-color: var(--verde); }
.btn.primary:hover { --bg: #3BFF74; }
.btn.ghost { --bg: transparent; }
.btn.danger { --bg: transparent; --fg: var(--rojo); border-color: rgba(255,90,78,.4); }
.btn.big { min-height: 64px; font-size: 22px; padding: 14px 30px; }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.iconbtn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 999px; border: 1px solid var(--linea); background: transparent; cursor: pointer; color: var(--hueso-2); }
.iconbtn:hover { color: var(--hueso); border-color: var(--hueso-3); }

/* ---------- tarjetas ---------- */
.card { background: var(--negro-2); border: 1px solid var(--linea); border-radius: var(--radio); padding: clamp(16px, 2.4vw, 24px); }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.sorteo-card { display: block; color: inherit; text-decoration: none !important; transition: border-color .15s, transform .15s; position: relative; overflow: hidden; }
.sorteo-card:hover { border-color: var(--verde); transform: translateY(-2px); }
.sorteo-card h3 { font-size: 22px; font-style: italic; margin: 10px 0 14px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--linea); color: var(--hueso-2); }
.tag.on { color: var(--negro); background: var(--verde); border-color: var(--verde); }
.tag.done { color: var(--hueso); border-color: var(--hueso-3); }
.tag.uv { color: #fff; background: var(--uv); border-color: var(--uv); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.statline { display: flex; gap: 22px; flex-wrap: wrap; }
.stat b { display: block; font-family: var(--display); font-size: 30px; line-height: 1; }
.stat span { font-size: 12px; color: var(--hueso-3); text-transform: uppercase; letter-spacing: .12em; }

.new-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.new-action { text-align: left; padding: 20px; border-radius: var(--radio); border: 1px solid var(--linea); background: var(--negro-2); cursor: pointer; transition: border-color .15s, background .15s; }
.new-action:hover { border-color: var(--verde); }
.new-action.main { background: var(--verde); color: var(--negro); border-color: var(--verde); }
.new-action b { display: block; font-family: var(--display); font-style: italic; text-transform: uppercase; font-size: 24px; line-height: 1; margin-bottom: 8px; }
.new-action span { font-size: 14px; opacity: .8; }

/* ---------- formularios ---------- */
label.f { display: block; }
label.f > span { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--hueso-2); margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--linea); background: var(--negro); color: var(--hueso); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { min-height: 120px; resize: vertical; }
.input:focus { border-color: var(--verde); box-shadow: 0 0 0 3px rgba(8,238,79,.18); }
.input.huge { min-height: 72px; font-size: 28px; padding: 14px 18px; border-radius: 16px; font-family: var(--display); letter-spacing: .01em; }
.hint { font-size: 13px; color: var(--hueso-3); margin-top: 6px; }
.warn { color: #FFC24D; }
.err { color: var(--rojo); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--verde); margin-top: 1px; flex: none; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--linea); margin: 22px 0 22px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 12px 16px; color: var(--hueso-2); font-family: var(--display); text-transform: uppercase; font-size: 15px; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; }
.tabs a.on { color: var(--hueso); border-color: var(--verde); }

/* ---------- registro staff ---------- */
.staff-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 22px; align-items: start; }
@media (max-width: 900px) { .staff-wrap { grid-template-columns: 1fr; } }
.counter { display: flex; align-items: baseline; gap: 10px; }
.counter b { font-family: var(--display); font-style: italic; font-size: 64px; line-height: .9; color: var(--verde); }
.folio-flash { border-radius: 18px; padding: 26px; background: var(--verde); color: var(--negro); animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.folio-flash .lbl { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; font-weight: 700; }
.folio-flash .folio { font-family: var(--display); font-style: italic; white-space: nowrap; font-size: clamp(44px, 7.4vw, 84px); line-height: .9; letter-spacing: -.02em; margin: 6px 0 4px; }
.folio-flash .nm { font-size: 20px; font-weight: 600; }
.folio-flash .legend { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; margin-top: 10px; }
.folio-flash .btn { --bg: var(--negro); --fg: var(--hueso); border-color: var(--negro); }
.folio-flash .btn.ghost { --bg: transparent; --fg: var(--negro); border-color: rgba(0,0,0,.35); }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.dup-box { border: 1px solid #FFC24D; background: rgba(255,194,77,.08); border-radius: 12px; padding: 12px 14px; font-size: 15px; }

/* ---------- listas / tablas ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linea); }
.list li:last-child { border-bottom: 0; }
.folio-chip { font-family: var(--display); font-style: italic; font-size: 18px; color: var(--verde); min-width: 98px; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--linea); border-radius: var(--radio); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--hueso-3); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--linea); background: var(--negro-2); position: sticky; top: 0; }
td { padding: 12px 14px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.invalid td { color: var(--hueso-3); }
tr.invalid td.user a { color: var(--hueso-3); }
td.user a { color: var(--hueso); font-weight: 600; }
.comment-sample { font-size: 13px; color: var(--hueso-3); max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--linea); background: transparent; cursor: pointer; font-size: 14px; color: var(--hueso-2); }
.chip.on { background: var(--hueso); color: var(--negro); border-color: var(--hueso); }

/* participación doble */
.dbl { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px dashed var(--hueso-3); background: transparent; color: var(--hueso-2); cursor: pointer; font-size: 13px; line-height: 1.15; text-align: left; transition: all .15s; }
.dbl:hover { border-color: var(--uv); color: var(--hueso); }
.dbl .x2 { font-family: var(--display); font-style: italic; font-size: 18px; }
.dbl.on { background: var(--uv); border: 1px solid var(--uv); color: #fff; }
.dbl[disabled] { opacity: .35; pointer-events: none; }

/* ---------- pantalla de sorteo ---------- */
.screen { position: fixed; inset: 0; background: var(--negro); display: grid; grid-template-rows: auto 1fr auto; padding: clamp(18px, 3vw, 44px); overflow: hidden; }
.screen::before { content: ''; position: absolute; inset: -20%; background: radial-gradient(circle at 50% 55%, rgba(8,238,79,.13), transparent 55%); pointer-events: none; transition: opacity .6s; opacity: .4; }
.screen.lit::before { opacity: 1; }
.screen-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; position: relative; z-index: 1; }
.screen-head .brand { font-family: var(--display); font-style: italic; text-transform: uppercase; font-size: clamp(22px, 2.6vw, 38px); }
.screen-head .brand small { display: block; font-family: var(--texto); font-style: normal; font-size: 12px; letter-spacing: .3em; color: var(--verde); margin-top: 6px; }
.screen-center { display: grid; place-items: center; text-align: center; position: relative; z-index: 1; }
.screen .prize-lbl { font-size: clamp(14px, 1.6vw, 22px); letter-spacing: .32em; text-transform: uppercase; color: var(--verde); }
.screen .prize-name { font-family: var(--display); text-transform: uppercase; font-size: clamp(28px, 4.4vw, 70px); line-height: .95; margin: 10px 0 0; }
.reel { font-family: var(--display); font-style: italic; text-transform: uppercase; font-size: clamp(56px, 13vw, 220px); line-height: .9; letter-spacing: -.03em; margin: clamp(18px, 3vw, 40px) 0 10px; min-height: 1em; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
.reel.spin { color: var(--hueso-3); filter: blur(.6px); }
.reel.land { color: var(--verde); animation: land .7s cubic-bezier(.2,1.5,.35,1); text-shadow: 0 0 60px rgba(8,238,79,.45); }
@keyframes land { 0% { transform: scale(.7); } 100% { transform: none; } }
.winner-name { font-size: clamp(22px, 3vw, 46px); font-weight: 600; min-height: 1.3em; }
.screen-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; position: relative; z-index: 1; flex-wrap: wrap; }
.screen .tally { display: flex; gap: 30px; }
.screen .tally b { font-family: var(--display); font-size: clamp(28px, 3vw, 48px); display: block; line-height: 1; }
.screen .tally span { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--hueso-3); }
.screen .done-list { display: grid; gap: 8px; margin-top: 26px; text-align: left; min-width: min(560px, 90vw); }
.screen .done-list div { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--linea); padding: 10px 0; font-size: clamp(16px, 1.8vw, 24px); }
.screen .done-list .p { color: var(--hueso-3); }
.screen .done-list .w { font-family: var(--display); font-style: italic; color: var(--verde); }
.screen-ctrl { opacity: .25; transition: opacity .2s; }
.screen:hover .screen-ctrl { opacity: 1; }
.marquee { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; border-top: 1px solid var(--linea); overflow: hidden; white-space: nowrap; font-family: var(--display); font-style: italic; text-transform: uppercase; color: var(--hueso-3); font-size: 15px; line-height: 34px; z-index: 0; }
.marquee span { display: inline-block; padding-left: 100%; animation: mq 40s linear infinite; }
@keyframes mq { to { transform: translateX(-100%); } }

/* ---------- público ---------- */
.public { max-width: 560px; margin: 0 auto; padding: 28px 18px 60px; }
.public .head { text-align: center; margin-bottom: 26px; }
.bases h3 { margin: 22px 0 8px; color: var(--verde); font-size: 16px; }
.bases p, .bases li { color: var(--hueso-2); }
.qr-box { background: var(--hueso); border-radius: 18px; padding: 18px; display: inline-block; }
.qr-box img, .qr-box canvas { display: block; width: 240px; height: 240px; image-rendering: pixelated; }

/* ---------- modal / toasts ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid; place-items: center; z-index: 100; padding: 18px; animation: fade .15s; }
.modal { width: min(520px, 100%); max-height: 90dvh; overflow: auto; background: var(--negro-2); border: 1px solid var(--linea); border-radius: 18px; padding: 24px; box-shadow: var(--sombra); }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 200; width: min(460px, calc(100% - 28px)); }
.toast { background: var(--hueso); color: var(--negro); padding: 12px 16px; border-radius: 12px; box-shadow: var(--sombra); font-weight: 600; animation: pop .25s; }
.toast.err { background: var(--rojo); color: #fff; }
.empty { text-align: center; padding: 50px 20px; color: var(--hueso-3); border: 1px dashed var(--linea); border-radius: var(--radio); }
.loader { width: 28px; height: 28px; border: 3px solid var(--linea); border-top-color: var(--verde); border-radius: 50%; animation: rot .8s linear infinite; margin: 60px auto; }
@keyframes rot { to { transform: rotate(360deg); } }
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: min(420px, 100%); }
.bigword { font-family: var(--display); font-style: italic; text-transform: uppercase; font-size: clamp(54px, 12vw, 96px); line-height: .85; letter-spacing: -.03em; }
.bigword em { color: var(--verde); font-style: italic; }

@media (max-width: 640px) {
  .who { display: none; }
  .topbar { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; margin-left: 0; }
  #logout { margin-left: auto; }
  .reg-tab .statline { display: none; }
  .hide-sm { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.nocase, .nocase * { text-transform: none !important; }
.screen.ig .reel { text-transform: none; }

/* preguntas extra */
.qfield { border: 0; padding: 0; margin: 0; min-width: 0; }
.qfield legend { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--hueso-2); margin-bottom: 8px; padding: 0; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt span { display: grid; place-items: center; min-height: 64px; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--linea); background: var(--negro); font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 24px; letter-spacing: .01em; transition: all .12s; text-align: center; }
.opt:hover span { border-color: var(--hueso-3); }
.opt input:checked + span { background: var(--uv); border-color: var(--uv); color: #fff; }
.opt input:focus-visible + span { outline: 3px solid var(--verde); outline-offset: 2px; }
.qedit { border: 1px solid var(--linea); border-radius: 12px; padding: 14px; display: grid; gap: 10px; background: var(--negro); }
.tally-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tally-pill { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--linea); font-size: 14px; }
.tally-pill b { color: var(--uv); font-size: 16px; }
.screen-ans { font-family: var(--display); font-style: italic; text-transform: uppercase; color: var(--uv); font-size: clamp(22px, 2.6vw, 40px); margin-top: 8px; }
