/* ══════════════════════════════════════════════════════════════════════════
   NOKTOP — Sistema de diseño 3.0
   Tokens, animaciones y componentes compartidos por todas las pantallas.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Acento (lo pisa el diseño/branding en runtime) */
  --ac: #9ef01a;
  --ac-rgb: 158, 240, 26;
  --acglow: rgba(var(--ac-rgb), .5);
  --acsoft: rgba(var(--ac-rgb), .1);
  --on-ac: #0b0c0f;

  /* Base oscura */
  --bg: #050609;
  --bg2: #08090c;
  --panel: #0e0f12;
  --panel2: #0c0d10;
  --panel3: #0e0f12;
  --line: #202124;
  --line2: #1b1c1f;
  --line3: #191a1d;

  /* Texto */
  --tx: #f1f2f5;
  --tx2: #f5f6f9;
  --dim: #c7c8cb;
  --mut: #bebfc2;
  --fnt: #a7a8ab;

  /* Medallas */
  --gold: #ffd23f;
  --silver: #d8dee0;
  --bronze: #e0954a;

  /* Semánticos */
  --ok: #34d36b;
  --warn: #ffb020;
  --danger: #ff5a5a;

  /* Tipografía */
  --font: 'Outfit', system-ui, sans-serif;
  --num-font: 'Oswald', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Radios */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* Movimiento */
  --ease: cubic-bezier(.16, .84, .34, 1);
  --ease-pop: cubic-bezier(.16, 1.3, .4, 1);

  color-scheme: dark;
}

/* Tema claro — solo lo usa la Caja POS (se elige por dispositivo).
   El acento se oscurece desde JS: el lima sobre fondo blanco no se lee. */
[data-theme="light"] {
  --bg: #eff0f3;
  --bg2: #e7e8eb;
  --panel: #feffff;
  --panel2: #f6f7fa;
  --panel3: #fafbfe;
  --line: #d4d5d8;
  --line2: #e0e1e4;
  --line3: #e6e7ea;
  --tx: #1a1b1e;
  --tx2: #101114;
  --dim: #3e3f42;
  --mut: #4d4e51;
  --fnt: #656669;
  --ok: #257a38;
  --warn: #a86a05;
  --danger: #c02626;
  --on-ac: #feffff;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body.jg-fixed { overflow: hidden; height: 100%; }
body.jg-scroll { overflow-x: hidden; overflow-y: auto; }

/* Táctil: sin demora de 300ms, sin zoom por doble toque, sin resaltado azul */
button, a, input, select, textarea, label, [role="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }

/* ── Scrollbars ──────────────────────────────────────────────────────────── */
.jg-noscroll::-webkit-scrollbar { width: 0; height: 0; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: var(--r-pill); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ac); background-clip: padding-box; }

/* ══════════════════════════════════════════════════════════════════════════
   ANIMACIONES
   ══════════════════════════════════════════════════════════════════════════ */

@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dropIn   { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn    { 0% { opacity: 0; transform: scale(.94); } 100% { opacity: 1; transform: scale(1); } }
@keyframes popBig   { 0% { opacity: 0; transform: scale(.7); } 60% { opacity: 1; transform: scale(1.04); } 100% { opacity: 1; transform: scale(1); } }
@keyframes viewIn   { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rowIn    { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: translateX(0); } }
@keyframes sheetUp  { from { transform: translateY(100%); } to { transform: translateY(0); } }

@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes twinkle { 0%,100% { opacity: .10; } 50% { opacity: .34; } }
@keyframes confettiFall { 0% { transform: translateY(-60px) rotate(0); opacity: 0; } 9% { opacity: 1; } 100% { transform: translateY(1180px) rotate(680deg); opacity: 0; } }
@keyframes crownBob     { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-12px) rotate(3deg); } }
@keyframes winPop       { 0% { opacity: 0; transform: scale(.7); } 60% { opacity: 1; transform: scale(1.04); } 100% { opacity: 1; transform: scale(1); } }
@keyframes nameUp       { 0% { opacity: 0; transform: translateY(34px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes readerPulse { 0%,100% { border-color: var(--line); box-shadow: 0 0 0 0 var(--acglow); } 50% { border-color: var(--ac); box-shadow: 0 0 26px -6px var(--acglow); } }
@keyframes scanX       { 0% { transform: translateX(-110%); } 100% { transform: translateX(110%); } }
@keyframes waitDot     { 0%,100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes glowPulse   { 0%,100% { text-shadow: 0 0 18px var(--acglow); } 50% { text-shadow: 0 0 42px var(--acglow); } }
@keyframes sheen       { 0% { transform: translateX(-120%) skewX(-18deg); } 100% { transform: translateX(220%) skewX(-18deg); } }
@keyframes ringOut     { 0% { transform: scale(.2); opacity: .85; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes spin        { to { transform: rotate(360deg); } }
@keyframes shake       { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }
@keyframes shimmer     { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes tourPulse   { 0%,100% { box-shadow: 0 0 0 9999px rgba(2,4,3,.74), 0 0 0 2px var(--ac), 0 0 24px 2px var(--acglow); } 50% { box-shadow: 0 0 0 9999px rgba(2,4,3,.74), 0 0 0 3px var(--ac), 0 0 40px 6px var(--acglow); } }

/* ══════════════════════════════════════════════════════════════════════════
   COMPONENTES
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Escenario de TV (lo estira fitStage a toda la pantalla) ─────────────── */
.jg-stage {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
  width: 1920px; height: 1080px;
  background: var(--bg);
  color: var(--tx2);
  overflow: hidden;
}

/* ── Botones ─────────────────────────────────────────────────────────────── */
.jg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px;
  padding: 11px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--dim);
  font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: .3px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, box-shadow .15s, transform .08s, filter .15s;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  text-decoration: none;
}
/* El ícono no se achica cuando el botón se angosta (si no, queda un puntito) */
.jg-btn > svg { flex: none; }
.jg-btn:hover:not(:disabled) { border-color: var(--ac); color: var(--ac); }
.jg-btn:active:not(:disabled) { transform: scale(.97); }
.jg-btn:disabled { opacity: .42; cursor: not-allowed; }

.jg-btn-primary {
  background: var(--ac);
  border-color: var(--ac);
  color: var(--on-ac);
  font-weight: 700;
}
.jg-btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 0 22px -4px var(--acglow);
  color: var(--on-ac);
}
.jg-btn-danger { color: var(--danger); border-color: rgba(255, 90, 90, .35); }
.jg-btn-danger:hover:not(:disabled) { border-color: var(--danger); background: rgba(255, 90, 90, .1); color: var(--danger); }
.jg-btn-solid-danger { background: #b83232; border-color: #b83232; color: #fff; font-weight: 700; }
.jg-btn-solid-danger:hover:not(:disabled) { background: #cf3b3b; border-color: #cf3b3b; color: #fff; box-shadow: 0 0 22px -4px rgba(255,90,90,.5); }
.jg-btn-ghost { background: transparent; }
.jg-btn-icon { width: 42px; padding: 0; flex: none; }

/* Estado "cargando" de un botón */
.jg-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.jg-btn.is-loading::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--dim) var(--dim) var(--dim) transparent;
  animation: spin .7s linear infinite;
}
.jg-btn-primary.is-loading::after { border-color: var(--on-ac) var(--on-ac) var(--on-ac) transparent; }

/* ── Chips / pills ───────────────────────────────────────────────────────── */
.jg-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mut);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s; white-space: nowrap;
  user-select: none; -webkit-user-select: none;
}
.jg-chip:hover { border-color: var(--ac); color: var(--ac); }
.jg-chip:active { transform: scale(.97); }
.jg-chip.on { background: var(--ac); border-color: var(--ac); color: var(--on-ac); }

/* Badge "EN VIVO" */
.jg-live {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 16px;
  border: 1px solid var(--ac);
  border-radius: var(--r-pill);
  background: var(--acsoft);
}
.jg-live i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ac); box-shadow: 0 0 10px var(--ac);
  animation: dotPulse 1.4s infinite;
}
.jg-live span {
  font-family: var(--num-font); font-size: 12px; font-weight: 700;
  letter-spacing: 3px; color: var(--ac);
}
.jg-live.off { border-color: rgba(255,176,32,.6); background: rgba(255,176,32,.08); }
.jg-live.off i { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.jg-live.off span { color: var(--warn); }

/* ── Paneles ─────────────────────────────────────────────────────────────── */
.jg-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.jg-label {
  font-family: var(--num-font);
  font-size: 12px; font-weight: 700; letter-spacing: 2px;
  color: var(--fnt); text-transform: uppercase;
}

/* ── Inputs ──────────────────────────────────────────────────────────────── */
.jg-input {
  width: 100%;
  min-height: 46px;
  padding: 12px 15px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--tx);
  font-family: inherit; font-size: 15px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.jg-input:focus { border-color: var(--ac); box-shadow: 0 0 0 3px var(--acsoft); }
.jg-input::placeholder { color: var(--fnt); opacity: .7; }
.jg-input.is-error { border-color: var(--danger); animation: shake .35s ease; }

select.jg-input { cursor: pointer; }
textarea.jg-input { resize: vertical; min-height: 100px; font-family: inherit; }
input[type=number].jg-input { -moz-appearance: textfield; }
input[type=number].jg-input::-webkit-outer-spin-button,
input[type=number].jg-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.jg-num { font-family: var(--num-font); font-variant-numeric: tabular-nums; }

/* ── Switch ──────────────────────────────────────────────────────────────── */
.jg-switch {
  position: relative; width: 48px; height: 28px; flex: none;
  border-radius: var(--r-pill);
  background: var(--line);
  border: none; cursor: pointer; transition: background .18s; padding: 0;
}
.jg-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--mut); transition: all .2s var(--ease);
}
.jg-switch.on { background: var(--ac); }
.jg-switch.on::after { left: 23px; background: var(--on-ac); }

/* ── Modales ─────────────────────────────────────────────────────────────── */
.jg-modal-bg {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 3, 3, .78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .18s ease;
  padding: 20px;
}
.jg-modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px;
  max-width: 560px; width: 100%;
  max-height: calc(100vh - 40px); overflow-y: auto;
  animation: popIn .22s var(--ease);
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, .8);
}
.jg-modal h3 { margin: 0 0 6px; font-size: 22px; font-weight: 700; color: var(--tx2); }
.jg-modal-actions { display: flex; gap: 12px; margin-top: 24px; }
.jg-modal-actions .jg-btn { flex: 1; min-height: 50px; font-size: 15px; }
.jg-modal-icon {
  width: 54px; height: 54px; border-radius: 15px; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--acsoft); border: 1px solid var(--line); color: var(--ac);
}
.jg-modal-icon.danger { background: rgba(255,90,90,.1); border-color: rgba(255,90,90,.3); color: var(--danger); }
.jg-modal-icon.warn { background: rgba(255,176,32,.1); border-color: rgba(255,176,32,.3); color: var(--warn); }

/* ── Toasts ──────────────────────────────────────────────────────────────── */
#jg-toasts {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  z-index: 900; display: flex; flex-direction: column; gap: 10px;
  align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 24px);
}
.jg-toast {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px 12px 20px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--ac);
  color: var(--tx2);
  font-size: 15px; font-weight: 600;
  box-shadow: 0 14px 40px -10px rgba(0, 0, 0, .7), 0 0 24px -8px var(--acglow);
  animation: fadeUp .25s ease;
  pointer-events: auto;
}
.jg-toast.err { border-color: var(--danger); box-shadow: 0 14px 40px -10px rgba(0, 0, 0, .7); }
.jg-toast .ic { flex: none; display: flex; color: var(--ac); }
.jg-toast.err .ic { color: var(--danger); }
.jg-toast button {
  flex: none; padding: 7px 13px; border-radius: 9px; border: 1px solid var(--ac);
  background: var(--acsoft); color: var(--ac); font-weight: 700; font-size: 13px; cursor: pointer;
}

/* ── Aviso de conexión ───────────────────────────────────────────────────── */
#jg-red {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -140%);
  z-index: 950; display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: var(--r-pill);
  background: #2a1a05; border: 1px solid #6b4a10; color: #ffcf73;
  font-size: 14px; font-weight: 600; letter-spacing: .3px;
  box-shadow: 0 12px 30px -8px rgba(0,0,0,.7);
  transition: transform .35s var(--ease);
  pointer-events: none;
}
#jg-red.show { transform: translate(-50%, 0); }
#jg-red i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #ffcf73; border-top-color: transparent; animation: spin .8s linear infinite; }

/* ── Tabla ───────────────────────────────────────────────────────────────── */
.jg-th {
  font-family: var(--num-font);
  font-size: 12px; font-weight: 700; letter-spacing: 2.5px;
  color: var(--fnt); text-transform: uppercase;
}

/* ── Estados vacíos ──────────────────────────────────────────────────────── */
.jg-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 48px 20px; text-align: center; color: var(--fnt);
}
.jg-empty svg { opacity: .7; }
.jg-empty b { font-size: 16px; color: var(--mut); font-weight: 600; }
.jg-empty span { font-size: 13.5px; max-width: 360px; line-height: 1.5; }

/* ── Skeleton de carga ───────────────────────────────────────────────────── */
.jg-skel {
  border-radius: 12px;
  background: linear-gradient(90deg, var(--panel) 0%, var(--line2) 50%, var(--panel) 100%);
  background-size: 800px 100%;
  animation: shimmer 1.3s linear infinite;
}

/* ══════════════════════════════════════════════════════════════════════════
   TUTORIAL GUIADO
   ══════════════════════════════════════════════════════════════════════════ */
.jg-tour { position: fixed; inset: 0; z-index: 1000; }
.jg-tour-block { position: fixed; inset: 0; background: transparent; }
.jg-tour-hole {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(2,4,3,.74), 0 0 0 2px var(--ac), 0 0 24px 2px var(--acglow);
  transition: top .35s var(--ease), left .35s var(--ease), width .35s var(--ease), height .35s var(--ease);
  animation: tourPulse 2.2s ease-in-out infinite;
}
.jg-tour-hole.center { width: 0 !important; height: 0 !important; top: 50% !important; left: 50% !important; box-shadow: 0 0 0 9999px rgba(2,4,3,.8); animation: none; }
.jg-tour-card {
  position: fixed; width: 380px; max-width: calc(100vw - 24px);
  background: var(--panel); border: 1px solid var(--ac); border-radius: 18px;
  padding: 20px 22px 18px;
  box-shadow: 0 24px 70px -12px rgba(0,0,0,.85), 0 0 34px -10px var(--acglow);
  transition: top .35s var(--ease), left .35s var(--ease);
  animation: popIn .25s var(--ease);
  color: var(--tx);
}
.jg-tour-step { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--ac); font-weight: 700; }
.jg-tour-card h4 { margin: 8px 0 8px; font-size: 20px; font-weight: 700; color: var(--tx2); line-height: 1.2; }
.jg-tour-card p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--dim); }
.jg-tour-card p b { color: var(--tx2); }
.jg-tour-dots { display: flex; gap: 6px; margin-top: 16px; }
.jg-tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: all .2s; }
.jg-tour-dots span.on { width: 20px; border-radius: 4px; background: var(--ac); }
.jg-tour-nav { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.jg-tour-nav .jg-btn { min-height: 40px; padding: 9px 15px; }
.jg-tour-skip { margin-right: auto; background: none; border: none; color: var(--fnt); font-size: 13px; cursor: pointer; padding: 8px 4px; }
.jg-tour-skip:hover { color: var(--tx); }
@media (max-width: 600px) {
  .jg-tour-card { left: 12px !important; right: 12px; width: auto; }
}

/* Botón flotante de ayuda */
.jg-help-fab {
  position: fixed; right: calc(18px + env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 300;
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--line); color: var(--dim);
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.7); cursor: pointer; transition: all .15s;
}
.jg-help-fab:hover { border-color: var(--ac); color: var(--ac); }

/* ── Utilidades ──────────────────────────────────────────────────────────── */
.jg-scrolly { overflow-y: auto; }
.jg-ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jg-hidden { display: none !important; }
.jg-spin { animation: spin .8s linear infinite; }
.jg-shake { animation: shake .35s ease; }

/* ── Pantallas táctiles: todo un poco más grande y fácil de tocar ────────── */
@media (pointer: coarse) {
  .jg-btn { min-height: 48px; }
  .jg-chip { min-height: 44px; padding: 10px 18px; }
  .jg-input { min-height: 50px; font-size: 16px; }
  .jg-btn:hover:not(:disabled):not(.jg-btn-primary) { border-color: var(--line); color: var(--dim); }
  .jg-btn-danger:hover:not(:disabled) { color: var(--danger); background: transparent; }
  .jg-chip:hover:not(.on) { border-color: var(--line); color: var(--mut); }
}

/* Celulares: los inputs a 16px evitan que el navegador haga zoom al tocarlos */
@media (max-width: 640px) {
  .jg-input { font-size: 16px; }
  .jg-modal { padding: 22px 20px; border-radius: 20px; }
  .jg-modal-actions { flex-direction: column-reverse; }
}

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

/* ── Modo liviano (html.lite, lo pone _base.html) ─────────────────────────
   Las animaciones terminan al instante (lo que entra con un fundido aparece
   directo en su lugar), sin desenfoques detrás de los paneles ni sombras de
   texto, y el scroll sin suavizado. Los indicadores de "cargando" siguen
   girando: son baratos y sin ellos parece que se colgó. */
html.lite *, html.lite *::before, html.lite *::after {
  animation-duration: .01ms !important; animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0s !important; transition-delay: 0s !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  text-shadow: none !important;
}
html.lite { scroll-behavior: auto !important; }
html.lite .jg-spin, html.lite .jg-btn.is-loading::after, html.lite #jg-red i {
  animation-duration: .8s !important; animation-iteration-count: infinite !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   MARCA: [logo] Ranking VIP | Boliche [logo del boliche]
   ══════════════════════════════════════════════════════════════════════════ */
/* La marca siempre en Oswald: es el logotipo, no cambia con la fuente de la app */
.jg-marca, .jg-marca * { font-family: 'Oswald', system-ui, sans-serif; }
.jg-marca { display: flex; align-items: center; gap: 14px; min-width: 0; }
.jg-marca-nk { height: var(--marca-h, 42px); width: auto; flex: none; object-fit: contain; display: block; }
.jg-marca-logo { height: calc(var(--marca-h, 42px) * .95); max-width: 190px; width: auto; flex: none; object-fit: contain; display: block; }
.jg-marca-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.jg-marca-nom { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; font-size: calc(var(--marca-h, 42px) * .55); font-weight: 700; letter-spacing: 3px; color: var(--tx2); line-height: 1; white-space: nowrap; }
.jg-marca-nom i { font-style: normal; font-weight: 400; color: var(--line); letter-spacing: 0; }
.jg-marca-venue { color: var(--ac); letter-spacing: 2px; }
.jg-marca-sub { font-family: var(--mono); font-size: 11px; letter-spacing: 3px; color: var(--fnt); white-space: nowrap; }

@media (max-width: 700px) {
  .jg-marca { gap: 9px; }
  .jg-marca-nom { font-size: 19px; letter-spacing: 2px; gap: 6px; }
  .jg-marca-sub { display: none; }
  .jg-marca-logo { max-width: 90px; }
  .jg-hide-sm { display: none !important; }
}
@media (max-width: 460px) {
  /* En el teléfono el nombre del boliche no entra al lado de "Ranking VIP":
     se corta la palabra y la barrita queda colgando sola. */
  .jg-marca-nom { flex-wrap: nowrap; font-size: 17px; letter-spacing: 1px; }
  .jg-marca-nom i { display: none; }
  .jg-marca-venue { overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
}

/* ── Entrada suave de cada pantalla ──────────────────────────────────────
   Al entrar a una estación la página aparece con un fundido corto. El cambio
   de pestaña ya lo animan las vistas con viewIn. */
@keyframes jgEntra { from { opacity: 0 } to { opacity: 1 } }
.jg-entra { animation: jgEntra .3s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .jg-entra { animation: none !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   CHAT INTERNO
   ══════════════════════════════════════════════════════════════════════════ */
.jg-chat-fab {
  position: fixed; right: calc(18px + env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 320;
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--line); color: var(--dim);
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.7); cursor: pointer; transition: all .15s;
}
.jg-chat-fab:hover, .jg-chat-fab.on { border-color: var(--ac); color: var(--ac); }
.jg-chat-fab.hay { border-color: var(--ac); color: var(--ac); box-shadow: 0 0 22px -4px var(--acglow); }
.jg-chat-badge {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center; border-radius: 999px;
  background: var(--danger); color: #fff; font-family: var(--mono); font-size: 12px; font-weight: 700;
}
.jg-chat-panel[hidden] { display: none !important; }
.jg-chat-panel {
  position: fixed; right: calc(18px + env(safe-area-inset-right)); bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 321;
  width: 360px; max-width: calc(100vw - 32px); height: min(460px, calc(100vh - 140px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 24px 70px -14px rgba(0,0,0,.8); animation: popIn .2s var(--ease);
}
.jg-chat-panel header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line2); }
.jg-chat-panel header b { display: block; font-size: 15px; color: var(--tx2); }
.jg-chat-yo { display: block; font-size: 12px; color: var(--fnt); margin-top: 2px; }
.jg-chat-x { width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--mut); cursor: pointer; }
.jg-chat-msgs { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.jg-chat-msg { align-self: flex-start; max-width: 85%; background: var(--panel2); border: 1px solid var(--line2); border-radius: 14px 14px 14px 5px; padding: 9px 12px; }
.jg-chat-msg.mio { align-self: flex-end; background: var(--acsoft); border-color: var(--ac); border-radius: 14px 14px 5px 14px; }
.jg-chat-quien { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 1px; color: var(--ac); margin-bottom: 3px; }
.jg-chat-texto { display: block; font-size: 14.5px; color: var(--tx); line-height: 1.4; word-break: break-word; }
.jg-chat-hora { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--fnt); margin-top: 4px; text-align: right; }
.jg-chat-form { display: flex; gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line2); }
.jg-chat-input { flex: 1; min-width: 0; min-height: 44px; padding: 10px 13px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel2); color: var(--tx); font-family: inherit; font-size: 15px; outline: none; }
.jg-chat-input:focus { border-color: var(--ac); }
.jg-chat-send { flex: none; width: 46px; padding: 0; }

@media (max-width: 600px) {
  .jg-chat-panel { right: 12px; left: 12px; width: auto; bottom: calc(78px + env(safe-area-inset-bottom)); }
}

/* Si la caja muestra la barra de cobro abajo, el chat se corre para arriba */
body.con-barra .jg-chat-fab { bottom: calc(92px + env(safe-area-inset-bottom)); }
body.con-barra .jg-chat-panel { bottom: calc(156px + env(safe-area-inset-bottom)); }

/* ══════════════════════════════════════════════════════════════════════════
   CELULAR Y TABLET
   Pensado para usar la app con los dedos en la barra: nada chico, nada que
   se corte, y sin sustos (no se recarga sola al arrastrar).
   ══════════════════════════════════════════════════════════════════════════ */
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: contain; }

/* Instalada como app: respeta las zonas seguras del teléfono */
body.jg-app { padding-bottom: env(safe-area-inset-bottom); }

@media (pointer: coarse) {
  .jg-btn { min-height: 50px; padding: 12px 20px; font-size: 15px; }
  .jg-btn-icon { width: 50px; }
  .jg-chip { min-height: 46px; font-size: 14px; }
  .jg-input, select.jg-input { min-height: 52px; font-size: 16px; }
  input[type="color"] { min-height: 46px; min-width: 52px; }
  input[type="range"] { height: 26px; }
  .jg-switch { width: 56px; height: 32px; }
  .jg-switch::after { width: 26px; height: 26px; }
  .jg-switch.on::after { left: 27px; }
  .jg-modal-actions .jg-btn { min-height: 54px; }
}

@media (max-width: 760px) {
  /* Los modales se abren como una hoja desde abajo: se alcanzan con el pulgar */
  .jg-modal-bg { align-items: flex-end; padding: 0; }
  .jg-modal {
    max-width: 100%; width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
    animation: sheetUp .26s var(--ease);
  }
  .jg-modal h3 { font-size: 20px; }
  .jg-modal-actions { position: sticky; bottom: 0; background: var(--panel); padding-top: 10px; }
  #jg-toasts { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .jg-toast { font-size: 14.5px; }
  /* Las tablas anchas se deslizan en vez de romper la pantalla */
  .jg-tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ══════════════════════════════════════════════════════════════════════════
   MODO TELÉFONO (html.tel)
   Lo prende _base.html cuando la pantalla es de teléfono. Las pestañas de
   cada pantalla bajan a una barra fija abajo, al alcance del pulgar; los
   encabezados se achican y los números van en tiras compactas. En la PC
   (html.pc) no cambia nada.
   ══════════════════════════════════════════════════════════════════════════ */

/* Sin el destello gris al tocar (cada botón tiene su propio :active) y sin la
   espera de 300 ms del doble toque */
html { -webkit-tap-highlight-color: transparent; }
button, a, [role="button"], [role="switch"], .jg-btn, .jg-chip { touch-action: manipulation; }
[role="switch"], .jg-chip, .jg-switch { user-select: none; -webkit-user-select: none; }
/* En el teléfono no se recarga la página al tirar para abajo en medio de la noche */
html.tel { overscroll-behavior-y: none; }

/* ── Barra de pestañas abajo ──
   Cada pantalla le pone .jg-tabbar a su fila de pestañas: en la PC se ve como
   siempre y en el teléfono baja acá, con el ícono arriba del nombre. */
html.tel .jg-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 400;
  display: flex; align-items: stretch; gap: 4px;
  width: auto; margin: 0; order: 0;
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  border: 0; border-top: 1px solid var(--line); border-radius: 0;
  background: var(--bg); background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 -12px 30px -14px rgba(0, 0, 0, .75);
}
html.tel .jg-tabbar > button, html.tel .jg-tabbar > a {
  position: relative; flex: 1 1 0; min-width: 0; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 54px; padding: 6px 2px; border: 0; border-radius: 12px;
  background: transparent; color: var(--fnt); box-shadow: none;
  font-family: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: .2px; line-height: 1.1;
  white-space: nowrap; text-decoration: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: color .15s, background .15s, transform .1s;
}
html.tel .jg-tabbar > .on { color: var(--ac); background: var(--acsoft); font-weight: 700; }
html.tel .jg-tabbar > :active { transform: scale(.94); }
html.tel .jg-tabbar svg { width: 22px; height: 22px; flex: none; }
/* Punto de aviso arriba del ícono (stock bajo, pagos, cartel en pantalla) */
html.tel .jg-tabbar .badge, html.tel .jg-tabbar .tab-dot {
  position: absolute; top: 7px; left: calc(50% + 9px); width: 9px; height: 9px; margin: 0;
  border-radius: 50%; background: var(--warn); box-shadow: 0 0 8px currentColor;
}

/* Escribiendo (teclado abierto) la barra se esconde: no le come lugar a lo que
   se está escribiendo. Al cerrar el teclado vuelve sola. */
html.tel body:has(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):focus, textarea:focus) .jg-tabbar { display: none; }

/* Con la barra abajo, el contenido, el chat y los avisos no quedan tapados */
html.tel body.con-tabbar { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
html.tel body.con-tabbar .jg-chat-fab { bottom: calc(82px + env(safe-area-inset-bottom)); }
html.tel body.con-tabbar .jg-chat-panel { bottom: calc(146px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 210px); }
html.tel body.con-tabbar #jg-toasts { bottom: calc(88px + env(safe-area-inset-bottom)); }

/* ── Encabezado: ícono + nombre del boliche (y su logo), sin el texto largo ── */
html.tel .jg-marca { gap: 9px; }
html.tel .jg-marca-nk { height: min(var(--marca-h, 42px), 32px); }
html.tel .jg-marca-nom { font-size: 17px; letter-spacing: 1.5px; gap: 6px; flex-wrap: nowrap; min-width: 0; }
html.tel .jg-marca-nom:has(.jg-marca-venue) > span:first-child,
html.tel .jg-marca-nom:has(.jg-marca-venue) > i { display: none; }
html.tel .jg-marca-venue { overflow: hidden; text-overflow: ellipsis; max-width: none; min-width: 0; }
html.tel .jg-marca-sub { display: none; }
html.tel .jg-marca-logo { height: 30px; max-width: 96px; }
/* Si el boliche tiene logo, en el teléfono habla el logo: el nombre escrito no entra */
html.tel .jg-marca:has(.jg-marca-logo) .jg-marca-tx { display: none; }

/* Botones de encabezado solo con el ícono: el texto queda en el título (title) */
html.tel .jg-solo-icono { width: 44px; min-width: 44px; padding: 0 !important; gap: 0; font-size: 0 !important; flex: none; }
html.tel .jg-solo-icono svg { width: 19px; height: 19px; }
html.tel .jg-solo-icono > span:not(.badge) { display: none; }

/* Tablet en horizontal: aprovecha el ancho sin apretar el contenido */
@media (min-width: 761px) and (max-width: 1100px) {
  .jg-modal { max-width: 620px; }
}
