* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background: #0f172a;
  font-family: 'Outfit', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: #ffffff;
  overflow: hidden;
}

.game-container {
  position: relative;
  width: 800px;
  height: 500px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border-radius: 16px;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.1);
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #1e293b;
}

/* Overlays y Pantallas */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.hidden {
  display: none !important;
}

/* Tarjeta Principal */
.card {
  background: rgba(30, 41, 59, 0.95);
  padding: 24px 32px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
  max-width: 520px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

h1 {
  font-family: 'Fredoka One', cursive;
  font-size: 2.2rem;
  color: #f59e0b;
  text-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
  margin-bottom: 4px;
}

.subtitle {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

/* Información del Estudiante */
.student-info {
  background: rgba(15, 23, 42, 0.6);
  padding: 10px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  border-left: 4px solid #3b82f6;
  text-align: left;
  font-size: 0.85rem;
  line-height: 1.5;
}

.student-info p {
  color: #cbd5e1;
}

.student-info strong {
  color: #60a5fa;
}

/* Instrucciones */
.instructions {
  background: rgba(15, 23, 42, 0.4);
  padding: 12px 16px;
  border-radius: 12px;
  text-align: left;
  font-size: 0.85rem;
  margin-bottom: 20px;
  line-height: 1.4;
}

.instructions h3 {
  font-size: 0.9rem;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.instructions ul {
  list-style: none;
  padding-left: 0;
}

.instructions li {
  margin-bottom: 4px;
  color: #94a3b8;
}

.key {
  background: #334155;
  padding: 2px 6px;
  border-radius: 4px;
  color: #f8fafc;
  font-weight: 600;
}

/* Botones */
.btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border: none;
  padding: 12px 28px;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  width: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.btn:active {
  transform: translateY(1px);
}

/* Game Over */
.card-gameover h2 {
  font-family: 'Fredoka One', cursive;
  color: #ef4444;
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.scores-display {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.score-box {
  flex: 1;
  background: #0f172a;
  padding: 12px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.score-box span {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
}

.score-box strong {
  font-size: 1.8rem;
  color: #f8fafc;
}

.score-box.highlight {
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.score-box.highlight strong {
  color: #f59e0b;
}

.btn-restart {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-restart:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

/* Cuenta regresiva */
.overlay-countdown {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 15;
}

#countdownNumber {
  font-family: 'Fredoka One', cursive;
  font-size: 6rem;
  color: #f59e0b;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.5; }
}

/* Controles táctiles en pantalla */
.touch-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 12px;
  z-index: 5;
}

.touch-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 0.9rem;
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.touch-btn:active {
  background: rgba(245, 158, 11, 0.8);
}