/* Sorteo El Arranque · sistema visual compartido
   Idea: la pantalla del surtidor. Dígitos de siete segmentos en ámbar sobre asfalto azulado,
   recibos de venta como comprobantes, y la ruleta dibujada como un medidor de tablero. */

:root {
  --asfalto: #0d1520;
  --asfalto-2: #101c2a;
  --panel: #162331;
  --panel-2: #1b2b3c;
  --borde: #27394d;
  --hielo: #e8f2f9;
  --apagado: #93a7ba;
  --ambar: #ffb41f;
  --ambar-2: #ff8a1f;
  --verde: #46d39a;
  --rojo: #ff5147;
  --lcd: #ffb41f;
  --papel: #eef1f4;
  --tinta: #111a24;
  --f-ui: 'Chakra Petch', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-dato: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; background: var(--asfalto); }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--hielo);
  font: 500 16px/1.55 var(--f-ui);
  -webkit-font-smoothing: antialiased;
}

/* Luz de marquesina desde arriba + retícula tenue de asfalto */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70% 42% at 50% -10%, rgba(255, 180, 31, 0.17), transparent 72%),
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.3px) 0 0 / 22px 22px;
}

h1, h2, h3, p { margin: 0; }
h1 { font-weight: 700; line-height: 1.08; letter-spacing: -0.01em; }
a { color: inherit; }
button, input { font: inherit; }

:focus-visible { outline: 3px solid #7cc4ff; outline-offset: 3px; border-radius: 6px; }

.solo-lectores {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 54px; padding: 0 26px; border: 0; border-radius: 12px;
  font-weight: 700; font-size: 1.05rem; letter-spacing: 0.01em; text-decoration: none; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.65; cursor: progress; }
.btn-primario {
  color: #1a1205;
  background: linear-gradient(180deg, #ffc94d, #ffa51a);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 12px 32px -12px rgba(255, 165, 26, 0.75);
}
.btn-primario:hover { filter: brightness(1.07); }
.btn-fantasma { color: var(--hielo); background: transparent; border: 1.5px solid var(--borde); }
.btn-fantasma:hover { border-color: var(--ambar); }
.btn-chico { min-height: 40px; padding: 0 16px; font-size: 0.92rem; border-radius: 10px; }
.btn-peligro { color: #ffd9d5; background: transparent; border: 1.5px solid #6b2b2b; }
.btn-peligro:hover { border-color: var(--rojo); }

/* ---------- Campos ---------- */
.campo { display: grid; gap: 8px; }
.campo > label { font-weight: 600; font-size: 0.95rem; }
.entrada {
  display: flex; align-items: stretch; background: #0a121b;
  border: 1.5px solid var(--borde); border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.entrada:focus-within { border-color: var(--ambar); box-shadow: 0 0 0 4px rgba(255, 180, 31, 0.16); }
.entrada input {
  flex: 1 1 0; width: 0; min-width: 0; padding: 15px 16px; border: 0; outline: none; background: transparent;
  color: var(--hielo); font-weight: 500; font-size: 1.1rem;
}
.entrada input::placeholder { color: #5d7186; }
.entrada .pref {
  display: flex; align-items: center; padding: 0 14px; border-right: 1.5px solid var(--borde);
  color: var(--apagado); font-family: var(--f-dato); font-size: 1rem;
}
.campo.err .entrada { border-color: var(--rojo); }
.msg-err { min-height: 1.25em; color: #ff9a92; font-size: 0.9rem; }

.casilla { display: flex; gap: 12px; align-items: flex-start; font-size: 0.93rem; color: var(--apagado); line-height: 1.45; }
.casilla input { appearance: none; flex: none; width: 24px; height: 24px; margin: 1px 0 0; border: 1.5px solid var(--borde); border-radius: 7px; background: #0a121b; display: grid; place-content: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.casilla input:checked { background: var(--ambar); border-color: var(--ambar); }
.casilla input:checked::after { content: ''; width: 6px; height: 12px; margin-top: -2px; border: solid #1a1205; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.casilla a { color: var(--hielo); text-underline-offset: 3px; }

/* ---------- Pantalla de surtidor ---------- */
.surtidor {
  position: relative; overflow: hidden; padding: 18px 20px 20px; border-radius: 18px;
  background: linear-gradient(180deg, #080d14, #0c141e);
  border: 1px solid #2b3f55;
  box-shadow: inset 0 0 0 3px #0f1824, inset 0 3px 16px rgba(0, 0, 0, 0.65), 0 24px 50px -24px rgba(0, 0, 0, 0.8);
}
.surtidor::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.07), transparent 34%);
}
.surtidor-fila { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.surtidor-fila + .surtidor-fila { margin-top: 16px; padding-top: 16px; border-top: 1px dashed #22344a; }
.surtidor-et { color: var(--apagado); font-size: 0.92rem; line-height: 1.25; padding-bottom: 4px; }
.surtidor-et b { display: block; color: var(--hielo); font-weight: 600; font-size: 1rem; }

/* Dígitos de siete segmentos (los dibuja common.js) */
.lcd { display: block; height: var(--h, 56px); width: auto; max-width: 100%; filter: drop-shadow(0 0 7px rgba(255, 180, 31, 0.5)); }
.lcd .on { fill: var(--lcd); }
.lcd .off { fill: var(--lcd); opacity: 0.08; }
.lcd text { fill: var(--lcd); font-family: var(--f-ui); font-weight: 700; }

/* ---------- Recibo (comprobante tipo surtidor) ---------- */
.recibo {
  position: relative; padding: 22px 22px 26px; color: var(--tinta); background: var(--papel);
  font-family: var(--f-dato); font-size: 0.92rem; line-height: 1.5;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.45));
}
.recibo::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 9px;
  background: linear-gradient(135deg, var(--papel) 4.5px, transparent 0) 0 0 / 12px 9px,
              linear-gradient(225deg, var(--papel) 4.5px, transparent 0) 0 0 / 12px 9px;
}
.recibo h2 { font-family: var(--f-ui); font-size: 1.15rem; font-weight: 700; text-align: center; }
.recibo .sub { text-align: center; color: #4d5c6c; font-size: 0.82rem; }
.recibo hr { border: 0; border-top: 1.5px dashed #9aa8b6; margin: 14px 0; }
.recibo dl { margin: 0; display: grid; gap: 4px; }
.recibo dl > div { display: flex; justify-content: space-between; gap: 14px; }
.recibo dt { color: #4d5c6c; }
.recibo dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.recibo .boleto { font-family: var(--f-ui); font-weight: 700; font-size: 3.2rem; line-height: 1; text-align: center; letter-spacing: 0.02em; margin: 6px 0 2px; }
.recibo .nota { text-align: center; font-family: var(--f-ui); font-weight: 600; font-size: 0.95rem; }

/* ---------- Estados ---------- */
.punto-vivo { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 0 rgba(70, 211, 154, 0.6); animation: pulso 2s infinite; }
.punto-vivo.rojo { background: var(--rojo); box-shadow: 0 0 0 0 rgba(255, 81, 71, 0.6); animation-name: pulso-rojo; }
@keyframes pulso { 70% { box-shadow: 0 0 0 9px rgba(70, 211, 154, 0); } 100% { box-shadow: 0 0 0 0 rgba(70, 211, 154, 0); } }
@keyframes pulso-rojo { 70% { box-shadow: 0 0 0 9px rgba(255, 81, 71, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 81, 71, 0); } }

.marca { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.02rem; letter-spacing: 0.01em; text-decoration: none; }
.marca svg { width: 26px; height: 26px; flex: none; }

.pie { padding: 28px 20px 40px; text-align: center; color: var(--apagado); font-size: 0.9rem; display: flex; gap: 8px 22px; justify-content: center; flex-wrap: wrap; }
.pie a { text-underline-offset: 3px; }

.aviso { padding: 14px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--borde); color: var(--hielo); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
