/*===============================================
=            Variables CSS Globales             =
================================================*/
:root {
  --color-bg-main: #0c0a08;
  --color-bg-panel: #120f0def;
  --color-text-primary: #d4c2a2;
  --color-text-title: #e8d8b8;
  --color-border-panel: #2c251e;
  --color-bg-button: #080706;
  --color-bg-button-hover: #1f1b17;
  --color-text-button: #d4c2a2;
  --color-border-button-highlight: #ad8f63;
  --color-accent-gold: #f5c555;
  --font-family-title: "Trajan Pro", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --text-shadow-strong: 1px 1px 2px rgba(0,0,0,0.9);
  --color-scroll-track: #2c251e;
  --color-scroll-thumb: #ad8f63;
}

/*===============================================
=         Estilo de Scroll Medieval             =
===============================================*/
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-scroll-thumb) var(--color-scroll-track);
}

*::-webkit-scrollbar {
  width: 12px;
}

*::-webkit-scrollbar-track {
  background: var(--color-scroll-track);
}

*::-webkit-scrollbar-thumb {
  background-color: var(--color-scroll-thumb);
  border-radius: 6px;
  border: 2px solid var(--color-scroll-track);
}

/*===============================================
=            Estilos Generales BODY             =
================================================*/
body {
  /* Textura de madera oscura como fondo principal */
  background-image: url('../imgs/Texturas/Texture-background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;

  /* Asegura que el contenido ocupe toda la altura */
  min-height: 100vh;

  /* Tipografía y color de texto */
  font-family: var(--font-family-title);
  color: var(--color-text-primary);

  /* Centrar horizontal y verticalmente el contenido */
  display: flex;
  justify-content: center;
  align-items: center;
}

body::before {
  /* Se elimina el filtro oscuro para dar mayor luminosidad */
  display: none;
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(ellipse at center,
      rgba(255, 180, 80, 0.45) 0%,
      rgba(255, 110, 0, 0) 60%),
    radial-gradient(ellipse at center,
      rgba(255, 140, 40, 0.35) 0%,
      rgba(255, 80, 0, 0) 70%),
    radial-gradient(ellipse at center,
      rgba(255, 200, 100, 0.35) 0%,
      rgba(255, 120, 0, 0) 65%);
  background-repeat: no-repeat;
  background-size: 60% 60%, 40% 40%, 50% 50%;
  background-position: 50% 52%, 30% 57%, 70% 50%;
  animation: fuego 3s infinite ease-in-out;
}

/*===============================================
=       Contenedor Principal (Overlay/Form)      =
================================================*/
#overlay {
  /* Aspecto de carta de juego */
  background-color: rgba(50, 35, 25, 0.9);
  background-image: repeating-linear-gradient(90deg, rgba(100,80,60,0.3) 0, rgba(100,80,60,0.3) 2px, transparent 2px, transparent 5px);
  border: 3px double var(--color-border-button-highlight);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);

  /* Tamaño y centramiento */
  width: 90%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 30px;
  box-sizing: border-box;

  /* Texto claro con sombra suave */
  color: #f0f0f0;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);

  /* Bordes redondeados y sombra exterior */
  border-radius: 12px;

  /* Permite que la página maneje el scroll */
  overflow: visible;
}

/*===============================================
=       Logo Dentro del Overlay (Opcional)       =
================================================*/
/* Si eliminaste el logo interno en el HTML, puedes borrar todo este bloque */
#overlay > img {
  width: 180px;
  padding: 5px;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
  margin-bottom: 25px;
}

/*===============================================
=            Título Principal del Overlay        =
================================================*/
#overlay h1 {
  /* Tipografía y color definidos en variables */
  font-family: var(--font-family-title);
  color: var(--color-text-title);

  /* Sombra de texto más intensa */
  text-shadow: var(--text-shadow-strong);

  /* Tamaño y espaciados */
  font-size: 2.2em;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 30px;
}

/*===============================================
=        Contenedores de Label + Input          =
================================================*/
#overlay > div {
  /* Asegura que cada grupo ocupe todo el ancho */
  width: 100%;
  margin-bottom: 20px;
  box-sizing: border-box;
}

/*===============================================
=                Estilos de Labels               =
================================================*/
#overlay label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.95em;
  color: #ccc;
  text-align: left;
}

/*===============================================
=              Campos de Entrada                =
================================================*/
/* Inputs de texto y contraseña */
#overlay input[type="text"],
#overlay input[type="password"] {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #555;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1em;
  box-sizing: border-box;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

/* Estilo específico para inputs de texto */
#overlay input[type="text"] {
  background-color: #080706;
  border: 1px solid #2c251e;
  color: var(--color-text-primary);
  font-family: var(--font-family-title);
  padding: 10px;
}

/* Estado focus (cuando el usuario escribe) */
#overlay input[type="text"]:focus,
#overlay input[type="password"]:focus {
  outline: none;
  border-color: #aaa;
  background-color: rgba(255, 255, 255, 0.15);
}

/*===============================================
=                   Botones                     =
================================================*/
#overlay button {
  /* Fondo oscuro, texto claro y borde resaltado */
  background-color: #080706;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-button-highlight);

  /* Tipografía para botones */
  font-family: var(--font-family-title);
  text-transform: uppercase;
  letter-spacing: 1px;

  /* Transición suave en hover/active */
  transition: all 0.2s ease;

  padding: 12px 20px;
  font-size: 1em;
  cursor: pointer;
}

/* Hover general en botones */
#overlay button:hover {
  background-color: #1f1b17;
  color: var(--color-text-title);
}

/* Elevación al hacer clic */
#overlay button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/*--- Botón Primario: Crear Partida ---*/
button[onclick="crearPartida()"] {
  background-color: #4CAF50;
  color: white;
}
button[onclick="crearPartida()"]:hover {
  background-color: #45a049;
  transform: translateY(-1px);
}

/*--- Botón Secundario: Unirse a Partida ---*/
button[onclick="unirsePartida()"] {
  background-color: #007BFF;
  color: white;
}
button[onclick="unirsePartida()"]:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}


/*===============================================
=          Logo de Introducción (Pantalla)       =
================================================*/
#intro-logo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;

  /* Fondo negro completo */
  background-color: black;

  /* Centrado de la imagen */
  display: flex;
  justify-content: center;
  align-items: center;

  /* Por encima de todo */
  z-index: 9999;

  /* Animación de desaparición */
  animation: fadeOut 1s ease forwards;
  animation-delay: 1s;
}

#intro-logo img {
  width: 250px;
  max-width: 80%;

  /* Suavizado en la aparición */
  animation: fadeIn 1.5s ease;

  /* Sombra de luz */
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.7));
}

/*===============================================
=                 Animaciones                   =
================================================*/
@keyframes fadeIn {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

@keyframes fuego {
  0% {
    opacity: 0.85;
    transform: translate(0, 0) scale(1);
    background-position: 50% 52%, 30% 57%, 70% 50%;
  }
  25% {
    opacity: 1;
    transform: translate(-2%, 2%) scale(1.1);
    background-position: 45% 55%, 33% 50%, 65% 46%;
  }
  50% {
    opacity: 0.9;
    transform: translate(2%, -2%) scale(0.95);
    background-position: 55% 48%, 25% 60%, 75% 55%;
  }
  75% {
    opacity: 1;
    transform: translate(-1%, 1%) scale(1.05);
    background-position: 48% 53%, 35% 55%, 68% 52%;
  }
  100% {
    opacity: 0.85;
    transform: translate(0, 0) scale(1);
    background-position: 50% 52%, 30% 57%, 70% 50%;
  }
}

/*===============================================
=               Responsive Básico               =
================================================*/
@media (max-width: 600px) {
  /* Ajustes de padding y ancho en móvil */
  #overlay {
    width: 95%;
    padding: 30px 20px;
  }

  /* Tamaño de título más pequeño */
  #overlay h1 {
    font-size: 1.8em;
  }

  /* Ajuste de tamaño y padding en inputs y botones */
  #overlay input[type="text"],
  #overlay input[type="password"],
  #overlay button {
    font-size: 0.95em;
    padding: 10px 12px;
  }
}

/*=====================\
=   Cursor Antorcha   =
=====================*/
.torch-cursor{
  position:fixed;
  width:140px;
  height:140px;
  margin-left:-70px;
  margin-top:-70px;
  pointer-events:none;
  background:radial-gradient(circle,rgba(255,180,80,0.6),rgba(255,110,0,0.3) 60%,rgba(0,0,0,0) 70%);
  mix-blend-mode:screen;
  animation:torch-flicker 0.3s infinite alternate;
  z-index:1000;
}
@keyframes torch-flicker{
  from{transform:scale(0.95);opacity:0.9;}
  to{transform:scale(1.05);opacity:1;}
}

