/* Estilos principales para Snake Game */
@import url('https://fonts.googleapis.com/css?family=Lobster&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');

 
    /* Estilos principales para Snake Game */
 
  .seccion-juego body,
  .seccion-juego-movil body {
      margin: 0;
      background: #111;
      font-family: sans-serif;
      color: #fb9812;
      display: flex;
      flex-direction: column;
      align-items: center;
  }
  .seccion-juego canvas,
  .seccion-juego-movil canvas {
      background: #222;
      border: 4px dashed #fb9812;
      margin-top: 10px;
      touch-action: none;
  }
  .seccion-juego #controls,
  .seccion-juego-movil #controls {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin: 10px;
  }
  .seccion-juego .row,
  .seccion-juego-movil .row {
      display: flex;
      justify-content: center;
      margin: 5px;
  }
  .seccion-juego .btn,
  .seccion-juego-movil .btn {
      width: 60px;
      height: 60px;
      margin: 5px;
      font-size: 24px;
      background: #333;
      color: #fb9812;
      border: 2px solid #fb9812;
      border-radius: 10px;
  }
  .seccion-juego #scoreboard,
  .seccion-juego-movil #scoreboard {
      font-size: 18px;
      margin-top: 10px;
      color: #fff !important;
  }
  .seccion-juego #gameover,
  .seccion-juego-movil #gameover {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      width: 100vw;
      height: 100vh;
      background: #000;
      color: #fb9812;
      display: none;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      font-size: 24px;
      z-index: 10;
  }
  .seccion-juego #gameover .game-over-text,
  .seccion-juego-movil #gameover .game-over-text {
      margin-bottom: 24px;
  }
  .seccion-juego #restartBtn,
  .seccion-juego-movil #restartBtn {
      margin-top: 20px;
      padding: 10px 20px;
      font-size: 18px;
      background: #222;
      color: #fb9812;
      border: 2px solid #fb9812;
      border-radius: 8px;
      cursor: pointer;
  }
  .seccion-juego details,
  .seccion-juego-movil details {
      margin: 10px;
      max-width: 400px;
      color: #fb9812;
  }
.seccion-juego .custom-details,
.seccion-juego-movil .custom-details {
  border-radius: 16px;
  border: 2px solid #fb9812;
  background: #181818;
  max-width: 400px;
  margin: 10px auto;
  color: #fb9812;
  overflow: hidden;
}
.seccion-juego .custom-summary,
.seccion-juego-movil .custom-summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: bold;
  background: #222;
  user-select: none;
  transition: background 0.2s;
}
.seccion-juego .custom-summary:hover,
.seccion-juego-movil .custom-summary:hover {
  background: #333;
}
.seccion-juego .custom-details-content,
.seccion-juego-movil .custom-details-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1), padding 0.5s;
  padding: 0 16px;
}
.seccion-juego .custom-details.open .custom-details-content,
.seccion-juego-movil .custom-details.open .custom-details-content {
  padding: 12px 16px 6px 16px;
}
  

  
@media (max-width: 480px) {
  .seccion-juego canvas,
  .seccion-juego-movil canvas {
    margin-left: 10px;
    margin-right: 10px;
    width: calc(100% - 20px);
    max-width: 400px;
  }
}

/* Ajuste responsive para el bloque de instrucciones */
@media (max-width: 400px) {
  .seccion-juego #instrucciones.custom-details,
  .seccion-juego-movil #instrucciones.custom-details {
    margin-left: 10px !important;
    margin-right: 10px !important;
    width: calc(100% - 20px) !important;
    max-width: unset !important;
    box-sizing: border-box;
  }
}

.seccion-juego .game-over-text,
.seccion-juego-movil .game-over-text {
      font-family: 'Lobster', cursive;
}
.seccion-juego,
.seccion-juego-movil {
    background: linear-gradient(to right, #000, #000);
    font-family: 'Poppins', sans-serif;
    color: #fff !important;
    text-align: center;
    margin: 0;
    padding: 0;
}
.seccion-juego canvas,
.seccion-juego-movil canvas {
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
    border-radius: 10px;
    transition: transform 0.2s ease-in-out;
}
.seccion-juego canvas:hover,
.seccion-juego-movil canvas:hover {
    transform: scale(1.01);
}
.seccion-juego button, .seccion-juego .touch-controls button,
.seccion-juego-movil button, .seccion-juego-movil .touch-controls button {
    background-color: #ffffff22;
    border: 1px solid #fff;
    color: #fff !important;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.seccion-juego button:hover, .seccion-juego .touch-controls button:hover,
.seccion-juego-movil button:hover, .seccion-juego-movil .touch-controls button:hover {
    background-color: #ffffff44;
}
.seccion-juego details[open] > .details-content,
.seccion-juego-movil details[open] > .details-content {
  animation: openDetails 0.5s cubic-bezier(0.4,0,0.2,1);
  max-height: 1000px;
}
.seccion-juego details:not([open]) > .details-content,
.seccion-juego-movil details:not([open]) > .details-content {
  animation: closeDetails 0.4s cubic-bezier(0.4,0,0.2,1);
  max-height: 0;
}
.seccion-juego .details-content,
.seccion-juego-movil .details-content {
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1);
  max-height: 0;
}
@keyframes openDetails {
  from { max-height: 0; }
  to { max-height: 1000px; }
}
@keyframes closeDetails {
  from { max-height: 1000px; }
  to { max-height: 0; }
}
.seccion-juego .custom-summary, .seccion-juego #historiaMarySummary,
.seccion-juego-movil .custom-summary, .seccion-juego-movil #historiaMarySummary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
}
.seccion-juego #historiaMaryLockIcon,
.seccion-juego-movil #historiaMaryLockIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
}
.seccion-juego #historiaMarySummaryText,
.seccion-juego-movil #historiaMarySummaryText {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
}
.seccion-juego #custom-details-content,
.seccion-juego-movil #custom-details-content {
  color: #fff !important;
}