body {
  font-family: Arial, sans-serif;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  min-height:100vh;
  margin:0;
}
#message {text-align:center;}
.como-funciona {text-align:center;width:100%;margin-bottom:20px;}
.link {color:Blue;font-size:15px;}
#board {
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  width: 260px;
}
.grid { display:grid; gap:5px; margin-bottom:10px; }
.cell {
  width:50px;
  height:50px;
  border:1px solid #ccc;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:24px;
  font-weight:bold;
  text-transform:uppercase;
  background:white;
  transition: transform 0.3s ease, background 0.3s ease;
  transform-style: preserve-3d;
  border-radius:5px;
}
.flip { transform: rotateX(90deg); }
.shake { animation: shake 0.4s; }
@keyframes shake { 0%{transform:translateX(0);} 20%{transform:translateX(-5px);} 40%{transform:translateX(5px);} 60%{transform:translateX(-5px);} 80%{transform:translateX(5px);} 100%{transform:translateX(0);} }
.correct { background:#6aaa64 !important; color:white !important; }
.absent { background:#787c7e !important; color:white !important; }

#keyboard {
  display:flex;
  flex-direction:column;
  gap:5px;
  margin-top:20px;
  width:420px; /* ancho suficiente para las teclas */
  margin-left:auto;
  margin-right:auto;
}
.keyboard-row {
  display:flex;
  gap:5px;
  justify-content:center;
  width: 100%;
}
.key {
  width:40px;       /* ancho normal */
  height:50px;
  border:1px solid #ccc;
  display:flex;
  align-items:center;
  justify-content:center;
  background:white;
  font-weight:bold;
  cursor:pointer;
  user-select:none;
  transition: background 0.3s ease;
  border-radius:4px;
  box-sizing:border-box;
  font-size:24px;   /* letras grandes */
  text-align:center;
}
.key.enter {
  width:80px;       /* un poco más ancho para que “ENTER” quepa */
  font-size:15px;   /* opcional: reducir ligeramente la letra para ajustar mejor */
  white-space: nowrap;
}
#key-⌫ { width:70px;font-size:15px; }

#toast-container {
  position: fixed;
  top:20px;
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:center;
  z-index:1000;
}
.toast {
  background: rgba(0,0,0,0.85);
  color:white;
  padding:10px 20px;
  border-radius:5px;
  font-size:16px;
  opacity:0;
  animation:fadeInOut 2s forwards;
}
@keyframes fadeInOut {
  0%{opacity:0;transform:translateY(-10px);}
  10%{opacity:1;transform:translateY(0);}
  90%{opacity:1;}
  100%{opacity:0;transform:translateY(-10px);}
}

/* --- Nombre jugador --- */
#player-name {
  display:flex;
  gap:10px;
  margin-top:20px;
  margin-bottom:30px;
  flex-direction: column;
}
.word-container {
  display:flex;
  gap:5px;
  margin-left: auto;
  margin-right: auto;
}
.letter {
  width:50px;
  height:50px;
  border:1px solid #ccc;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:24px;
  font-weight:bold;
  text-transform:uppercase;
  background:white;
  border-radius:5px;
}
#instructions-modal {
  padding-left: 0px;
} 
#toast-container {
  top:150px;
  left:500px;
}
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  padding: 1rem;
}
.modal-content {
  background: #fff;
  max-width: 50%;
  width: 100%;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  position: relative;
  animation: fadeIn 0.3s ease;
}
.modal-content h2 {
  margin-bottom: 15px;
}
.modal-content p {
  margin: 10px 0;
  line-height: 1.5;
}
.close-modal {
  position: absolute;
  top: 10px; right: 15px;
  font-size: 24px;
  cursor: pointer;
}
.close-button {
  margin-top: 20px;
  background: #0044cc;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: background 0.3s;
}
.close-button:hover {
  background: #003399;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@media screen and (max-width:800px){
  .cell {
    width:30px;
    height:30px;
    font-size:20px;
  }
  .key {
    width:30px;
    height:40px;
    font-size:19px;
  }  
  #keyboard {
    width:100%;
  }
  .letter {
    width:25px;
    height:25px;
  }
  .key.enter {
    width:48px;
    font-size:12px;
    white-space: nowrap;
  }
  #key-⌫ { width:48px;font-size:15px; }
  .modal-content { padding: 15px; font-size: 14px; max-width: 75%;}
  .close-button { width: 100%; }
  #toast-container {left:80px;}
}