/*! Chavito Games - norma de seguridad "tipo video" v1 - /_chavito/guard.css */
/*
 * Apache la inserta antes de </head> en todos los HTML de bgames.chavitogames.com
 * (Lobby, juegos publicados y los que vengan). Va junto con /_chavito/guard.js.
 * Solo presentacion: no cambia reglas, dinero, sesiones ni cabeceras del juego.
 */

/* 1. Como un video: nada se selecciona, el toque largo no abre "guardar/compartir imagen"
      (iPhone) y no hay destello al tocar. */
*,
*::before,
*::after {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* 2. Los campos de texto siguen funcionando normal (tocar, escribir, seleccionar, pegar).
      Reglas separadas: si un navegador no entiende un selector, no arrastra a las otras. */
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]) {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}
textarea,
select {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}
[contenteditable]:not([contenteditable="false"]),
[contenteditable]:not([contenteditable="false"]) * {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}

/* 2b. Excepcion a pedido del juego: lo que el juego marque con data-chavito-copy (codigo de mesa,
       sello del mazo, id de la mano para soporte) se puede seleccionar y copiar. Imagenes,
       videos, canvas, svg y links siguen protegidos aunque esten adentro (va despues: gana). */
[data-chavito-copy],
[data-chavito-copy] * {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}
img[data-chavito-copy], picture[data-chavito-copy], video[data-chavito-copy],
canvas[data-chavito-copy], svg[data-chavito-copy], a[data-chavito-copy], area[data-chavito-copy],
[data-chavito-copy] img, [data-chavito-copy] picture, [data-chavito-copy] video,
[data-chavito-copy] canvas, [data-chavito-copy] svg, [data-chavito-copy] svg *,
[data-chavito-copy] a, [data-chavito-copy] a *, [data-chavito-copy] area,
a [data-chavito-copy], a [data-chavito-copy] * {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

/* 3. Imagenes, videos y enlaces no se arrastran fuera del juego.
      Se respeta draggable="true" puesto por el propio juego. */
img:not([draggable="true"]),
video:not([draggable="true"]),
a:not([draggable="true"]),
area:not([draggable="true"]) {
  -webkit-user-drag: none !important;
}

/* 4. Sin zoom de doble toque (los toques rapidos son botones).
      :where() = especificidad 0: si el juego fija su propio touch-action (por ejemplo none
      en el canvas o en body), gana el del juego. */
:where(html, body) {
  touch-action: manipulation;
}

/* 5. Imprimir (Ctrl+P o desde el menu del navegador, tambien desde la pagina del casino)
      sale en blanco. :not(#id) sube la especificidad sin depender de clases del juego. */
@media print {
  :root:not(#chavito-guard-print),
  body:not(#chavito-guard-print) {
    display: none !important;
  }
}
