/* Estilos Base */
body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  overflow: hidden;
}

.box {
  flex: 1;
  min-height: 0;
  width: 97%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-body {
  width: min(100vw, calc(100dvh * 112 / 45));
  height: auto;

  display: grid;
  grid-template-columns: 1fr 5fr 1fr;
  border-radius: 80px;
  align-items: stretch; /* joy-cons crecen hasta el alto de la pantalla */
}

/* Pantalla e Iframe */
.screen-body {
  background: #0d0d0d;
  border-top: 10px solid #5d5d5d;
  border-radius: 0 0 10px 10px;
  position: relative;

  /* Esto es la clave: la columna central mantiene 16:9 */
  aspect-ratio: 16 / 9;
}

.screen {
  overflow: hidden;
  position: absolute;
  top: 5%;
  left: 2.5%;
  width: 95%;
  height: 90%;
  background: #d2d2d2;
  border-radius: 5px;
}

.iframe-juego {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Joy-Cons Común */
.joy-con-left,
.joy-con-right {
  position: relative;
  border-top: 10px solid #3a4365;
  overflow: hidden;
}

.joy-con-left {
  background: transparent;
  border-radius: 70px 0 0 70px;
  border-left: 7px solid #3a4365;
  position: relative;
}

.joy-con-right {
  background: transparent;
  border-radius: 0 70px 70px 0;
  border-right: 7px solid #39405b;
  position: relative;
}

/* Joysticks */
.joystick-left,
.joystick-left-bottom,
.joystick-right,
.joystick-right-bottom {
  position: absolute;
  width: 50%;
  height: 17%;
  border-radius: 100%;
  left: 25%;
}

.joystick-left,
.joystick-left-bottom {
  top: 15%;
}
.joystick-right,
.joystick-right-bottom {
  bottom: 20%;
}

.joystick-left-bottom,
.joystick-right-bottom {
  background: #484848;
  z-index: 1;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.8);
}

.joystick-left {
  background: #b4b4b3;
  z-index: 2;
  transition: transform 0.1s linear;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.joystick-right {
  background: #ecec05;
  z-index: 2;
  transition: transform 0.1s linear;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

/* Botones y D-Pad */
.minus-sign {
  position: absolute;
  top: 5%;
  left: 68%;
  width: 20%;
  height: 2%;
  background: #b4b3b3;
  border-radius: 3px;
}
.plus-sign-2 {
  position: absolute;
  top: 5%;
  left: 10%;
  width: 20%;
  height: 2%;
  background: #b4b3b3;
  border-radius: 3px;
}

.plus-sign-1 {
  position: absolute;
  top: 2.5%;
  right: 77%;
  width: 5%;
  height: 8%;
  background: #b4b3b3;
  border-radius: 3px;
}

.d-pad-left-1,
.d-pad-left-2,
.d-pad-left-3,
.d-pad-left-4,
.d-pad-right-4,
.d-pad-right-2 {
  position: absolute;
  width: 23%;
  height: 8%;
  background: #b4b3b3;
  border-radius: 100%;
}

.d-pad-right-1 {
  position: absolute;
  width: 23%;
  height: 8%;
  background: #be2323;
  border-radius: 100%;
}

.d-pad-right-3 {
  position: absolute;
  width: 23%;
  height: 8%;
  background: #0bddcc;
  border-radius: 100%;
}

/* Posiciones D-Pad Izquierdo */
.d-pad-left-1 {
  top: 55%;
  left: 38.5%;
}
.d-pad-left-2 {
  top: 70%;
  left: 38.5%;
}
.d-pad-left-3 {
  top: 62.5%;
  left: 18%;
}
.d-pad-left-4 {
  top: 62.5%;
  right: 18%;
}

/* Posiciones D-Pad Derecho */
.d-pad-right-1 {
  bottom: 55%;
  left: 38.5%;
}
.d-pad-right-2 {
  bottom: 70%;
  left: 38.5%;
}
.d-pad-right-3 {
  bottom: 62.5%;
  left: 18%;
}
.d-pad-right-4 {
  bottom: 62.5%;
  right: 18%;
}

.small-square,
.small-circle {
  position: absolute;
  top: 85%;
  width: 23%;
  height: 8%;
  background: #b4b3b3;
}

.small-square {
  right: 10%;
  border-radius: 5px;
}
.small-circle {
  left: 10%;
  border-radius: 100%;
}
