body {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: teal;
  min-height: 100vh;
  overflow: hidden;
  user-select: none;
  /* Wooden texture */
  background-image: url('imagenes/darckBackground.jpg'); /* Replace with your image */
  background-size: cover; /* Cover the entire viewport */
  background-repeat: no-repeat;
  background-position: center;
}
.start-screen {
  position: absolute;
  inset: 0; /* This replaces width/height 100vw/vh */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1;
  background-color: rgb(155, 223, 99);
}
.game-screen {
  /* Layout properties */
  height: 86vh;
  padding: 20px;
  min-width: 829px;
  
  /* Grid setup */
  display: grid;
  grid-template-columns: 70% 30%;
  grid-template-rows: 1fr;
  gap: 5px;
  
  /* Visual styling */
  border: 10px solid #cfc7b4;
  overflow: hidden;
  aspect-ratio: 16 / 9;  /* More standard ratio */
  
  /* Background setup */
  background: 
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.5),
      rgba(0, 0, 0, 0.5)
    ),
    url('imagenes/fondo.webp') center / cover;
}
@media (max-width: 1024px) {
  .game-screen {
    min-width: unset;  /* Remove minimum width on smaller screens */
    width: 95vw;      /* Use most of the viewport width */
    height: auto;     /* Let height be determined by aspect ratio */
  }
}
main {
  /* Grid structure */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 5fr 5fr;
  grid-template-areas: 
    "name1 frutas name2"
    "stack1 frutas stack2"
    ". embudo .";
    
  /* Layout adjustments */
  height: 100%;  /* Take full height of parent */
  gap: 10px;     /* Add consistent spacing */
  justify-items: center;
  align-items: start;  /* Align items to the top by default */
}
@media (max-width: 768px) {
  main {
    gap: 5px;  /* Reduce spacing on smaller screens */
  }
}
.frutas{
  grid-area: frutas;
  font-size: 2.2rem;
  margin: 0 5px;
  padding: 3px 0;
  align-self: start;
  background-color: rgba(211, 206, 206, 0.411);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  justify-items: center;
  border-radius: 12px;
}
.elemento {
  background-color: #1b1b1b9c;
  border: 3px solid rgb(156, 98, 32);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* aspect-ratio: 1; Hace que las cajas sean cuadradas */
  font-size: 2rem; /* Tamaño adecuado para emojis */
  width: 100%; /* Se adapta al ancho del contenedor */
  height: 100%; /* Se adapta al alto del contenedor */
  box-sizing: border-box; /* Asegura que el padding y el border no desborden el tamaño */
}
.name{
  font-size: 2.6rem;
  margin: 0;
  color: aquamarine;
  font-weight: bold;
  font-family: 'Courier New', Courier, monospace;
}
.name1{
  grid-area: name1;
}
.name2{
  grid-area: name2;
}
/* Common styles for both stacks */
.stack-1,
.stack-2 {
  /* Grid layout */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
  
  /* Sizing */
  width: 100%;
  height: 100%;
  
  /* Visual styling */
  border: 5px solid rgb(219, 224, 226);
  background-color: rgba(147, 185, 179, 0.973);
  overflow: auto;
  
  /* Animation */
  transition: all 0.3s ease;

  /* Add these for better visual feedback */
  position: relative;
  
  /* Optional: Add a subtle hover effect */
  &:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  }
}

/* Individual grid areas */
.stack-1 { grid-area: stack1; }
.stack-2 { grid-area: stack2; }
#stack-1, #stack-2 {
  transition: all 0.5s ease-in-out;
}
.box {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Improved width/height */
  min-width: 100px;
  min-height: 50px;
  
  /* Flexible font size */
  font-size: clamp(1.5rem, 2vw, 2rem);

  /* Better background & border */
  background-color: rgba(245, 243, 247, 0.959);
  border: 3px solid rgb(128, 72, 28);
  
  /* Visual improvement */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}


aside {
  /* Layout */
  display: flex;
  flex-direction: column;
  gap: 10px; /* Instead of margin adjustments */
  align-items: center;

  /* Better height handling */
  height: 100vh;

  /* Responsive width */
  width: clamp(200px, 25vw, 300px);
}

#inputPlayer {
  width: 95%;
  
  /* Improved height handling */
  height: clamp(20px, 20vh, 500px);
  min-height: 20PX;
  
  /* Consistent padding */
  padding: 8px;
  
  /* Visual styling */
  border-radius: 12px;
  background-color: rgba(8, 115, 177, 0.8);
  font-weight: bold;
  color: #f5f5f5; /* Improved readability */
  border: 2px solid silver;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.2rem;
  resize: vertical;
  box-sizing: border-box;
  
  /* Smooth transitions */
  transition: border 0.2s ease, box-shadow 0.2s ease;
  
  /* Ensure scroll is always visible */
  overflow-y: auto;

  resize: none;

}

/* Themed Scrollbar */
#inputPlayer::-webkit-scrollbar {
  width: 15px; /* Width of the scrollbar */
  border-radius: 12px;
}

/* Scrollbar Track */
#inputPlayer::-webkit-scrollbar-track {
  background: rgba(8, 115, 177, 0.5); /* Same theme as input background */
  border-radius: 12px;
}

/* Scrollbar Handle */
#inputPlayer::-webkit-scrollbar-thumb {
  background: aquamarine; /* Match the glow effect */
  border-radius: 12px;
  border: 2px solid silver;
}

/* Scrollbar Handle on Hover */
#inputPlayer::-webkit-scrollbar-thumb:hover {
  background: rgba(127, 255, 212, 0.8); /* Slightly lighter aquamarine */
}


#inputPlayer:focus {
  outline: none;
  border: 3px solid aquamarine;
  box-shadow: 0 0 10px aquamarine;
}

.manual {
  background: rgba(255, 244, 230, 0.9);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    width: 500px;
    height: 400px;
    text-align: center;
    font-size: 1.2rem;
    position: absolute;
    top: 50%;
    left: 43%;
    transform: translate(-50%, -50%);
    color: #333;
    line-height: 1.5;
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    z-index: 1;
}
.manual_top{
  display: flex;
  padding-top: 20px;
  justify-content: space-between;
  font-size: small;
}
.manualTitle{
  font-weight: bold;
  font-size: large;
}
.manual_bottom{
  display: flex;
  justify-content: space-around;
  padding-bottom: 10px;
}
.speechBubble {
  background: rgba(255, 244, 230, 0.9);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    width: 500px;
    height: 100px;
    text-align: center;
    font-size: 1.2rem;
    position: absolute;
    top: 50%;
    left: 43%;
    transform: translate(-50%, -50%);
    color: #333;
    line-height: 1.5;
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: space-around;
    flex-direction: column;
    z-index: 10;
}
.map {
  background: rgba(255, 244, 230, 0.9);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    width: 500px;
    height: 400px;
    text-align: center;
    font-size: 1.2rem;
    position: absolute;
    top: 50%;
    left: 43%;
    transform: translate(-50%, -50%);
    color: #333;
    line-height: 1.5;
    font-family: 'Arial', sans-serif;
    display: grid;
    grid-template-rows: 10fr 1fr;
    flex-direction: column;
    z-index: 20;
}
.level-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Cuatro columnas */
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  justify-items: center;
  align-items: center;
}

.level-grid .level:nth-child(9),
.level-grid .level:nth-child(10) {
  grid-column: span 2; /* Centra los últimos dos niveles */
}

.level {
  min-width: 90px;
  min-height: 90px;
  background-color: #ddd; /* Fondo opaco para niveles bloqueados */
  color: black;
  font-size: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid #aaa;
  border-radius: 5px;
  cursor: pointer;
  position: relative;
  opacity: 0.5; /* Por defecto bloqueado */
  transition: background-color 0.3s ease, opacity 0.3s ease;
}

.level.unlocked {
  background-color: #4caf50; /* Color nítido para niveles desbloqueados */
  color: white;
  opacity: 1;
}

.level:hover.unlocked {
  background-color: #3e8e41; /* Color más oscuro al pasar el mouse */
}

.tooltip {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;

}
.level:hover .tooltip {
  opacity: 1;
}

.oculto{
  display: none;

}
.character{
  height: 45%;
  display: flex;
  justify-content: center;
}

aside img{
  display: flex;
  width: auto;
  height: 95%;
}

.buttons{
  display: flex;
  justify-content: space-evenly;
  margin-bottom: 2px;
}
.btn-61,
.btn-61 *,
.btn-61 :after,
.btn-61 :before,
.btn-61:after,
.btn-61:before {
  border: 0 solid;
  box-sizing: border-box;
}
.btn-61 {
  -webkit-tap-highlight-color: transparent;
  background-color: #000;
  background-image: none;
  color: #fff;
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif,
    Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
  font-size: 100%;
  line-height: 1.5;
  margin: 0 5px;
  padding: 0;
}
.btn-61:disabled {
  cursor: default;
}
.btn-61:-moz-focusring {
  outline: auto;
}
.btn-61 svg {
  display: block;
}
.btn-61 [hidden] {
  display: none;
}
.btn-61 {
  background: none;
  box-sizing: border-box;
  color: #000;
  display: block;
  font-weight: 900;
  padding: 1.5rem 4rem;
  position: relative;
  text-transform: uppercase;
}
#start{
  width: 93%;
  align-self: center;
}
.btn-61 span {
  background: #fff;
  border: 1px solid;
  border-radius: 999px;
  display: grid;
  inset: 0;
  place-items: center;
  pointer-events: none;
  position: absolute;
}
.btn-61:hover span {
  -webkit-animation: rubberBand 0.8s;
  animation: rubberBand 0.8s;
}
@-webkit-keyframes rubberBand {
  0% {
    transform: scaleX(1);
  }
  30% {
    transform: scale3d(1.25, 0.75, 1);
  }
  40% {
    transform: scale3d(0.75, 1.25, 1);
  }
  50% {
    transform: scale3d(1.15, 0.85, 1);
  }
  65% {
    transform: scale3d(0.95, 1.05, 1);
  }
  75% {
    transform: scale3d(1.05, 0.95, 1);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes rubberBand {
  0% {
    transform: scaleX(1);
  }
  30% {
    transform: scale3d(1.25, 0.75, 1);
  }
  40% {
    transform: scale3d(0.75, 1.25, 1);
  }
  50% {
    transform: scale3d(1.15, 0.85, 1);
  }
  65% {
    transform: scale3d(0.95, 1.05, 1);
  }
  75% {
    transform: scale3d(1.05, 0.95, 1);
  }
  to {
    transform: scaleX(1);
  }
}

html, body {
  overflow: hidden;
}
