/* Estilos que se aplican a todas las pantallas */

/* Personaliza el estilo de la barra de desplazamiento */
body, html {
  scrollbar-width: thin;
  scrollbar-color: #c50039 #000;	
}

html, body {
  height: 100%;
  margin: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #101010;
}

body::-webkit-scrollbar, html::-webkit-scrollbar {
  width: 10px;
}

body::-webkit-scrollbar-track, html::-webkit-scrollbar-track {
  background-color: #000;
}

body::-webkit-scrollbar-thumb, html::-webkit-scrollbar-thumb {
  background-color: #c50039;
  border-radius: 5px;
}

.description-container {
    display: none; /* Por defecto no se muestra */
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.95) 0%, rgba(45, 45, 45, 0.9) 50%, rgba(26, 26, 26, 0.95) 100%);
    border: 2px solid rgba(197, 0, 57, 0.4);
    border-radius: 20px;
    padding: 25px 20px;
    margin-top: 10px;
    text-align: center;
    width: 320px;
    position: absolute;
    top: 160px;
    left: 10px;
    color: #e0e0e0;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(197, 0, 57, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    transform: translateZ(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.description-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #C50039, #ff1744, #C50039, #ff1744);
    border-radius: 22px;
    z-index: -1;
    opacity: 0.3;
    animation: borderPulse 3s ease-in-out infinite;
}

.description-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(197, 0, 57, 0.1), transparent);
    transition: left 2s ease;
}

.description-container:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(197, 0, 57, 0.6);
    box-shadow: 
        0 20px 45px rgba(0, 0, 0, 0.7),
        0 0 20px rgba(197, 0, 57, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.description-container:hover::after {
    left: 100%;
}

@keyframes borderPulse {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(1.01);
    }
}

/* Estilos adicionales para el texto del cuadro de descripción */
.description-container strong {
    text-shadow: 0 0 8px rgba(197, 0, 57, 0.3);
    transition: all 0.3s ease;
}

.description-container em {
    font-style: normal;
    text-shadow: 0 0 6px rgba(255, 107, 157, 0.3);
    transition: all 0.3s ease;
}

.description-container:hover strong {
    text-shadow: 0 0 12px rgba(197, 0, 57, 0.5);
}

.description-container:hover em {
    text-shadow: 0 0 10px rgba(255, 107, 157, 0.5);
}

.controls {
  background: linear-gradient(145deg, rgba(197, 0, 57, 0.15) 0%, rgba(197, 0, 57, 0.08) 100%);
  border: 2px solid rgba(197, 0, 57, 0.4);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  max-width: 450px;
  border-radius: 18px;
  margin: 10px 0;
  box-shadow: 
    0 10px 25px rgba(197, 0, 57, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.controls::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #C50039, #ff1744, #C50039, #ff1744);
  border-radius: 20px;
  z-index: -1;
  opacity: 0.2;
  animation: controlsGlow 3s ease-in-out infinite;
}

@keyframes controlsGlow {
  0%, 100% {
    opacity: 0.15;
  }
  50% {
    opacity: 0.3;
  }
}

#resetButton, #undoButton, #screenshotButton {
  background: linear-gradient(145deg, rgba(197, 0, 57, 0.9) 0%, rgba(197, 0, 57, 0.7) 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 14px 16px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  min-width: 120px;
  box-shadow: 
    0 6px 15px rgba(197, 0, 57, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

#resetButton::before, #undoButton::before, #screenshotButton::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

#resetButton:hover, #undoButton:hover, #screenshotButton:hover {
  background: linear-gradient(145deg, rgba(255, 0, 64, 0.95) 0%, rgba(197, 0, 57, 0.85) 100%);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-4px) scale(1.03);
  box-shadow: 
    0 10px 30px rgba(197, 0, 57, 0.5),
    0 0 25px rgba(197, 0, 57, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

#resetButton:hover::before, #undoButton:hover::before, #screenshotButton:hover::before {
  left: 100%;
}

#resetButton:active, #undoButton:active, #screenshotButton:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 
    0 4px 12px rgba(197, 0, 57, 0.5),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Logo container */
.logo-container {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.logo-container img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  transition: all 0.3s ease;
  filter: drop-shadow(0 0 15px rgba(199, 0, 57, 0.4));
}

.logo-container img:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 20px rgba(199, 0, 57, 0.6));
}

.chess-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.board-wrapper {
  position: relative;
  width: 660px;
  margin: 0 auto;
}

#board1.board {
  margin: 0;
}

/* Estilos generales */
body {
  background-color: #101010;
}

/* Define los colores de las casillas */
.board-b72b1.board-b72b1 .square-55d63.white-1e1d7 {
  background-color: #EEE4D1 !important;
}

.board-b72b1.board-b72b1 .square-55d63.black-3c85d {
  background-color: #1a8e78 !important;
}

.board-b72b1.board-b72b1 {
  border: none;
}

.board-b72b1.board-b72b1 .square-55d63 {
  border-radius: 0;
}

.number-board {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    z-index: 2;
}

.number-cell {
    display: flex;
    align-items: center; 
    justify-content: center; 
    font-size: 24px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s;
    height: 100%; 
    width: 100%; 
    box-sizing: border-box;
    transform: translateY(0); 
}

.number-cell.visible {
  opacity: 1;
}

/* Estilos específicos para pantallas pequeñas */
@media only screen and (max-width: 767px) {
  
  body {
    display: block;
    padding-top: 0;
    margin-top: 0;
  }

  .logo-container {
    display: none; /* Ocultamos el logo en dispositivos móviles */
    position: relative; /* Cambiamos a posición relativa para que se muestre debajo de los botones */
    top: 0; /* Ajustamos para que esté en la parte superior */
    left: 50%;
    transform: translateX(-50%);
    width: 70px; /* Tamaño reducido del logo */
    height: 70px;
    margin-top: 10px; /* Espacio entre los botones y el logo */
    z-index: 10;
  }

  .logo-container img {
    width: 100%;
    height: 100%;
  }
  
  .chess-container {
    padding-top: 0;
    position: relative;
    margin-top: 0;
  }

  .board-wrapper {
    width: 90vw;
    z-index: 1;
  }

  .number-cell {
    font-size: 16px;
  }
	
  #board1 {
    touch-action: none;
  }
	
    .description-container {
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.95) 0%, rgba(45, 45, 45, 0.9) 50%, rgba(26, 26, 26, 0.95) 100%);
    border: 2px solid rgba(197, 0, 57, 0.4);
    border-radius: 15px;
    display: block;
    position: relative;
    top: 0;
    left: 50%;
    transform: translateX(-50%);  
    width: 92%;
    font-size: 0.75rem;
    line-height: 1.35;
    z-index: 2;
    margin-bottom: 12px;
    padding: 15px 12px;
    text-align: justify;
    color: #e0e0e0;
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(197, 0, 57, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    overflow: hidden;
    position: relative;
  }
  
  .description-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #C50039, #ff1744, #C50039, #ff1744);
    border-radius: 17px;
    z-index: -1;
    opacity: 0.25;
    animation: borderPulse 3s ease-in-out infinite;
  }
  
  .description-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(197, 0, 57, 0.08), transparent);
    transition: left 2s ease;
  }
  
  .description-container:hover {
    transform: translateX(-50%) translateY(-3px) scale(1.01);
    border-color: rgba(197, 0, 57, 0.5);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(197, 0, 57, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
  
  .description-container:hover::after {
    left: 100%;
  }
  
  /* Estilos específicos para móvil - texto más compacto */
  .mobile-title {
    font-size: 0.9em !important;
    margin-bottom: 8px !important;
  }
  
  .mobile-content {
    font-size: 0.75rem;
    line-height: 1.3;
  }
  
  .mobile-content br {
    margin: 0;
  }
  
  .mobile-content div {
    font-size: 0.9em !important;
    margin-top: 6px !important;
  }

  .controls {
    position: relative;
    z-index: 3;
    margin-top: 10px;
    max-width: 95vw;
    padding: 8px 12px;
    gap: 8px;
    max-width: 380px;
  }
  
  #resetButton, #undoButton, #screenshotButton {
    padding: 12px 12px;
    font-size: 0.75rem;
    border-radius: 10px;
    flex: 1;
    min-width: 100px;
  }
}



/* Estilos específicos para pantallas grandes */
@media only screen and (min-width: 768px) {
  .chess-container {
    flex-direction: column;
    align-items: center;
  }

  .description-container {
	margin-left: 40px;   
    display: block;
    position: absolute;
    top: 160px;
    left: 10px;
    width: 320px;
  }

  .board-wrapper {
    margin-top: 10px;
  }

  .controls {
    margin-top: 10px;
  }

  .logo-container {
	margin-left: 40px;   
    left: calc(10px + 150px);
  }
}

/* Ocultar elementos de audio */
audio {
    display: none;
}
