* {
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

body {
  background: black;
  color: #00f0ff;
  font-family: monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 10px;
  overflow-x: hidden; 
}

.container {
  border: 3px solid #00f0ff;
  box-shadow: 0 0 15px #00f0ff;
  padding: 20px;
  width: 100%;
  max-width: 420px; 
  text-align: center;
  background-color: rgba(0, 0, 0, 0.9);
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  text-shadow: 0 0 10px #00f0ff;
}

.panel {
  border: 2px solid #00f0ff;
  box-shadow: inset 0 0 10px #00f0ff;
  padding: 15px;
}

.clave {
  display: flex;
  justify-content: space-around;
  gap: 10px;
  margin-bottom: 15px;
}

.clave div {
  flex: 1;
  max-width: 65px;
  aspect-ratio: 1 / 1; 
  border: 2px solid #00f0ff;
  box-shadow: 0 0 10px #00f0ff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
}

#timer {
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  margin: 10px 0;
  text-shadow: 0 0 10px #00f0ff;
}

#mensaje {
  min-height: 50px;
  font-size: 0.9rem;
  margin: 10px 0;
}

.teclado {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.controles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}

button {
  background: transparent;
  border: 2px solid #00f0ff;
  color: #00f0ff;
  padding: 15px 5px;
  font-size: 1.2rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

button:hover:not(:disabled) {
  background: #001f26;
  box-shadow: 0 0 15px #00f0ff;
  transform: scale(1.05);
}

button:active:not(:disabled) {
  background: #00f0ff;
  color: black;
}

button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: #00555a;
}

.controles button {
  color: #ff5555;
  border-color: #ff5555;
}

.shake {
  animation: vibrar 0.3s;
}

@keyframes vibrar {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  40% { transform: translate(3px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  80% { transform: translate(3px, 1px) rotate(-1deg); }
  100% { transform: translate(0, 0); }
}

.explosion {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 300px;
  z-index: 999;
  pointer-events: none;
}

.confeti {
  position: fixed;
  width: 8px;
  height: 8px;
  top: -10px;
  z-index: 1000;
  animation: caer linear forwards;
}

@keyframes caer {
  to { transform: translateY(100vh) rotate(360deg); }
}