* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: #0f141c;
  color: #e0e6ed;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.navbar {
  height: 60px;
  background: #18202c;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid #283548;
}

.logo {
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 1px;
}
.logo span {
  color: #00adb5;
}

.main-container {
  display: flex;
  flex: 1;
  padding: 20px;
  gap: 20px;
}

/* Altura y dimensiones fijas para que WebGL nunca inicialice en 0 */
.emulator-wrapper {
  flex: 3;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  min-height: 520px;
  height: 72vh;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* La zona de arrastre flota encima (z-index 20) con fondo opaco */
.drop-zone {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0f141c;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #3a4d6b;
  border-radius: 12px;
  z-index: 20;
}

.drop-content {
  text-align: center;
}
.drop-content h2 { margin: 15px 0 5px; }
.drop-content p { color: #8295af; margin-bottom: 20px; }

/* El juego está abajo (z-index 10) listo desde el primer momento */
.game-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
}

#game {
  width: 100% !important;
  height: 100% !important;
}

/* Forzar que el canvas generado por PPSSPP se expanda */
#game canvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

.sidebar {
  flex: 1;
  background: #18202c;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.panel {
  background: #0f141c;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.panel label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

select {
  width: 100%;
  padding: 8px;
  background: #1f2a3a;
  color: white;
  border: 1px solid #33445c;
  border-radius: 6px;
}

.keyboard-guide {
  list-style: none;
  margin-top: 10px;
}
.keyboard-guide li {
  margin-bottom: 6px;
  color: #9cb3d1;
}

.btn {
  background: #2a3b50;
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
  display: inline-block;
}
.btn:hover { background: #3b526f; }
.btn.primary { background: #00adb5; color: #000; }
.btn.primary:hover { background: #00c4cc; }

@media (max-width: 900px) {
  .main-container { flex-direction: column; }
  .emulator-wrapper { min-height: 350px; height: 50vh; }
}