:root {
  --fondo: #0b0d10;
  --panel: #14181d;
  --panel-2: #1c2128;
  --linea: #2a313a;
  --texto: #f3f5f7;
  --suave: #9aa4b0;
  --acento: #ffd166;
  --rojo: #ff3b30;
  --tam: 34px;
  --alto: 34vh;
  --margen: 20px;
  --opacidad: 0.55;
  --seguro-arriba: env(safe-area-inset-top, 0px);
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--fondo); color: var(--texto); overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }

#camara { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
#camara.espejo { transform: scaleX(-1); }

#franja { position: fixed; left: 0; right: 0; top: 0; height: calc(var(--alto) + var(--seguro-arriba));
  padding-top: var(--seguro-arriba); background: rgba(0,0,0,var(--opacidad)); overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; z-index: 5;
  -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); }
#franja.espejo #rollo { transform-origin: center; }
#rollo { position: absolute; left: var(--margen); right: var(--margen); top: var(--seguro-arriba);
  padding: 0.35em 0 60vh; font-size: var(--tam); line-height: 1.32; font-weight: 600; letter-spacing: 0.005em;
  will-change: transform; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
#rollo p { margin: 0 0 0.6em; }
#rollo .w { transition: opacity .25s, color .25s; }
#rollo .w.dicha { opacity: 0.38; }
#rollo .w.actual { color: var(--acento); }
#pausa-aviso { position: absolute; right: 12px; bottom: 10px; font-size: 14px; background: rgba(0,0,0,.7);
  padding: 6px 10px; border-radius: 999px; color: var(--acento); }

#estado { position: fixed; left: 12px; right: 12px; bottom: calc(150px + var(--seguro-abajo)); z-index: 6;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; pointer-events: none; font-size: 13px; }
#estado > span { background: rgba(0,0,0,.55); padding: 5px 10px; border-radius: 999px; color: #dfe4ea; }
#modo-etiqueta:empty { display: none; }
#grabando { display: inline-flex; align-items: center; gap: 6px; color: #fff !important; background: rgba(255,59,48,.85) !important; }
#grabando i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: latido 1s infinite; }
@keyframes latido { 50% { opacity: .2; } }

#aviso { position: fixed; left: 16px; right: 16px; top: calc(var(--alto) + var(--seguro-arriba) + 12px); z-index: 20;
  background: rgba(20,24,29,.95); border: 1px solid var(--linea); border-radius: 14px; padding: 12px 14px;
  font-size: 15px; line-height: 1.35; text-align: center; }

.grabar { position: fixed; left: 50%; bottom: calc(80px + var(--seguro-abajo)); transform: translateX(-50%);
  width: 64px; height: 64px; border-radius: 50%; border: 4px solid #fff; background: transparent; z-index: 7;
  display: grid; place-items: center; padding: 0; }
.grabar span { width: 48px; height: 48px; border-radius: 50%; background: var(--rojo); transition: all .2s; }
.grabar.activo span { width: 26px; height: 26px; border-radius: 6px; }

#barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + var(--seguro-abajo)); background: linear-gradient(transparent, rgba(0,0,0,.75) 35%); }
.boton { flex: 1 1 0; min-width: 0; min-height: 60px; background: none; border: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; color: #e9edf1; border-radius: 12px; }
.boton:active { background: rgba(255,255,255,.1); }
.boton svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.boton.activo { color: var(--acento); }
.boton:disabled { opacity: .35; }

#cuenta { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(0,0,0,.25); pointer-events: none; }
#cuenta span { font-size: 160px; font-weight: 800; color: #fff; text-shadow: 0 4px 30px rgba(0,0,0,.6); animation: golpe 1s ease-out infinite; }
@keyframes golpe { from { transform: scale(1.25); opacity: 1; } to { transform: scale(.9); opacity: .6; } }

.capa { position: fixed; inset: 0; z-index: 40; background: rgba(5,6,8,.72); display: flex; align-items: flex-end; justify-content: center;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.capa[hidden], [hidden] { display: none !important; }
#bienvenida { align-items: center; background: var(--fondo); }
.hoja { width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--panel);
  border-radius: 20px 20px 0 0; padding: 8px 16px calc(24px + var(--seguro-abajo)); border-top: 1px solid var(--linea); }
.hoja header { position: sticky; top: -8px; display: flex; align-items: center; justify-content: space-between; background: var(--panel);
  padding: 12px 0 10px; z-index: 1; }
.hoja h2 { margin: 0; font-size: 22px; }
.hoja h3 { margin: 22px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); font-weight: 600; }
.tarjeta.centrada { text-align: center; padding: 24px 22px; max-width: 420px; }
.tarjeta h1 { margin: 14px 0 6px; font-size: 28px; }
.tarjeta p { color: var(--suave); line-height: 1.45; }
.tarjeta img { border-radius: 18px; }

.principal, .secundario, .cerrar, .boton-enlace { min-height: 50px; padding: 0 18px; border-radius: 14px; border: 0; font-weight: 600; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.principal { background: var(--acento); color: #1a1405; }
.secundario, .boton-enlace { background: var(--panel-2); color: var(--texto); border: 1px solid var(--linea); }
.cerrar { background: var(--panel-2); color: var(--texto); min-height: 44px; }
#btn-empezar { width: 100%; margin-top: 8px; }
.fila { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.fila > * { flex: 1 1 auto; }
.archivo { position: relative; overflow: hidden; }
.archivo input { position: absolute; inset: 0; opacity: 0; }

.campo { display: block; margin: 10px 0; font-size: 14px; color: var(--suave); }
.campo input, .campo textarea, .campo select { display: block; width: 100%; margin-top: 6px; background: var(--fondo); border: 1px solid var(--linea);
  border-radius: 12px; padding: 12px; font-size: 16px; color: var(--texto); }
.campo textarea { resize: vertical; min-height: 140px; line-height: 1.4; }
.deslizador { display: block; margin: 14px 0; font-size: 15px; }
.deslizador output { float: right; color: var(--acento); font-variant-numeric: tabular-nums; }
.deslizador input { display: block; width: 100%; margin-top: 10px; height: 32px; accent-color: var(--acento); }
.interruptor { display: flex; gap: 12px; align-items: center; margin: 14px 0; font-size: 15px; line-height: 1.35; }
.interruptor input { width: 26px; height: 26px; flex: none; accent-color: var(--acento); }
.nota { font-size: 13.5px; color: var(--suave); line-height: 1.45; }
.etiqueta { font-style: normal; font-size: 11px; background: #3a2f10; color: var(--acento); padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }

#g-lista { list-style: none; margin: 0; padding: 0; }
#g-lista li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--linea); }
#g-lista li.vacia { color: var(--suave); }
#g-lista .info { flex: 1; min-width: 0; }
#g-lista .info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#g-lista .info small { color: var(--suave); }
#g-lista li.actual b { color: var(--acento); }
#g-lista button { min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--linea); background: var(--panel-2); font-size: 14px; }

#toma-video { width: 100%; max-height: 52vh; background: #000; border-radius: 12px; margin-top: 4px; }
