*{ box-sizing:border-box; }

/* =======================
   BASE
   ======================= */
body.games-page{
  margin:0;
  min-height:100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  background:#0e0e0e;
  color:#111;
}

.games-main{
  display:flex;
  justify-content:center;
  padding:20px;
}

.game-card{
  background:#fff;
  border-radius:18px;
  width:100%;
  max-width:1000px;
  box-shadow:0 20px 60px rgba(0,0,0,.45);
  padding:22px 24px 18px;
}

/* =======================
   HEADER
   ======================= */
.game-card-top{
  display:flex;
  justify-content:center;
  align-items:center;
  margin-bottom:14px;
}

.game-title{
  font-size:2.2rem;
  font-weight:900;
  letter-spacing:.18em;
  text-transform:uppercase;
}

/* =======================
   STAGE (Canvas)
   ======================= */
.game-stage{
  position:relative;
  width:100%;
  background:#000;
  border-radius:14px;
  overflow:hidden;

  /* canvas encaja perfecto */
  aspect-ratio:16 / 9;  /* 960x540 */
}

canvas#game{
  display:block;
  width:100%;
  height:100%;
  background:#070910;
  image-rendering:pixelated;
  image-rendering:crisp-edges;
  object-fit:cover;
}

/* =======================
   SPLASH + INSERT COIN
   ======================= */
:root{
  --splash-img: url("/daniNuevo/sources/img/street/ronin_splash.png");
}

.splash{
  position:absolute;
  inset:0;
  z-index:50;
  display:flex;
  overflow:hidden;
  background:#000;
}

.splash-half{
  width:50%;
  height:100%;
  background-image:var(--splash-img);
  background-repeat:no-repeat;
  background-size:200% 100%;
  transition:transform 1600ms cubic-bezier(.2,.9,.2,1);
}

.splash-half.left{ background-position:0 0; }
.splash-half.right{ background-position:100% 0; }

.splash.open .splash-half.left{ transform:translateX(-105%); }
.splash.open .splash-half.right{ transform:translateX(105%); }

.splash.hidden{ display:none; }

.coin{
  position:absolute;
  inset:0;
  z-index:40;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.35);
}
.coin.hidden{ display:none; }

.coin-inner{
  padding:18px 22px;
  border-radius:14px;
  background:rgba(0,0,0,.45);
  border:1px solid rgba(255,255,255,.12);
  color:#fff;
  text-align:center;
}

.coin-title{
  font-size:48px;
  font-weight:900;
  letter-spacing:.1em;
  animation:blink 1s steps(1,end) infinite;
}

.coin-sub{
  margin-top:8px;
  font-size:16px;
  opacity:.85;
}

@keyframes blink{ 50%{ opacity:0; } }

/* =======================
   OVERLAY
   ======================= */
.overlay-actions{ display:none; }
/* =======================
   GAME BOY CONTROL PANEL
   ======================= */
.gb-panel{
  margin-top:12px;
  padding:22px 26px 18px;
  background:#f3f1ef;
  border-radius:18px;
  border:1px solid rgba(0,0,0,.08);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.75),
    0 14px 40px rgba(0,0,0,.25);
  position:relative;
  z-index:10;
}

/* Top row: dpad izquierda, botones derecha */
.gb-row-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}

/* Bottom row: START centrado */
.gb-row-bottom{
  display:flex;
  justify-content:center;
  margin-top:14px;
}

/* ===== START (abajo centrado) ===== */
.gb-start{
  min-width:190px;
  height:38px;
  border-radius:999px;
  border:0;
  cursor:pointer;
  font-size:13px;
  font-weight:900;
  letter-spacing:.14em;
  color:#222;

  background:linear-gradient(#9a9a9a, #6f6f6f);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.25),
    inset 0 -3px 0 rgba(0,0,0,.25),
    0 8px 14px rgba(0,0,0,.18);
}
.gb-start:active{
  transform:translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -1px 0 rgba(0,0,0,.35),
    0 4px 8px rgba(0,0,0,.25);
}

/* ===== D-PAD (como la foto) ===== */
.gb-dpad{
  position:relative;
  width:150px;
  height:150px;
  flex:0 0 150px;
}

/* Brazos de la cruz: cuadrados, mate */
.gb-dir{
  position:absolute;
  border:0;
  cursor:pointer;

  background:linear-gradient(#1a1a1a, #0b0b0b);
  border:1px solid rgba(255,255,255,.05);

  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.10),
    inset 0 -8px 0 rgba(0,0,0,.65),
    0 12px 18px rgba(0,0,0,.35);
}

/* Formas y posiciones para cruz sólida */
.gb-dir.up{
  top:0; left:50px;
  width:50px; height:64px;
  border-radius:12px;
}
.gb-dir.down{
  bottom:0; left:50px;
  width:50px; height:64px;
  border-radius:12px;
}
.gb-dir.left{
  left:0; top:50px;
  width:64px; height:50px;
  border-radius:12px;
}
.gb-dir.right{
  right:0; top:50px;
  width:64px; height:50px;
  border-radius:12px;
}

/* pieza central “bloque” */
.gb-dpad-core{
  position:absolute;
  inset:50px;
  border-radius:14px;
  background:linear-gradient(#141414, #070707);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.08),
    inset 0 -7px 0 rgba(0,0,0,.7);
  z-index:2;
}

/* agujero circular (como la foto) */
.gb-dpad-hole{
  position:absolute;
  left:50%;
  top:50%;
  width:30px;
  height:30px;
  transform:translate(-50%,-50%);
  border-radius:50%;
  background:radial-gradient(circle at 40% 35%, #3a3a3a 0%, #101010 55%, #050505 100%);
  box-shadow:
    inset 0 2px 3px rgba(0,0,0,.75),
    0 1px 0 rgba(255,255,255,.06);
  z-index:3;
}

.gb-dir:active{
  transform:translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -4px 0 rgba(0,0,0,.7),
    0 8px 12px rgba(0,0,0,.35);
}

/* ===== BOTONES A/B ===== */
.gb-buttons{
  display:flex;
  gap:16px;
  align-items:center;
  transform:rotate(-12deg);
  flex:0 0 auto;
}

.gb-btn{
  width:74px;
  height:74px;
  border-radius:50%;
  border:0;
  cursor:pointer;
  color:#fff;
  font-weight:900;

  box-shadow:
    inset 0 4px 0 rgba(255,255,255,.12),
    inset 0 -10px 0 rgba(0,0,0,.35),
    0 12px 18px rgba(0,0,0,.28);
}
.gb-btn span{
  font-size:18px;
  text-shadow:0 2px 2px rgba(0,0,0,.5);
}

/* B rojo / A azul */
.gb-btn.b{
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.25), transparent 45%),
    linear-gradient(#e53935, #8e1e1b);
}
.gb-btn.a{
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.25), transparent 45%),
    linear-gradient(#2f6bff, #1537a8);
}

.gb-btn:active{
  transform:translateY(4px);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.10),
    inset 0 -5px 0 rgba(0,0,0,.45),
    0 8px 12px rgba(0,0,0,.30);
}


/* =======================
   RESPONSIVE
   ======================= */
@media (max-width: 820px){
  .arcade-controls.gb-panel{ padding:18px 16px; }

  .gb-dpad{
    width:130px;
    height:130px;
    flex:0 0 130px;
  }
  .gb-dir.up,.gb-dir.down{ left:44px; width:40px; }
  .gb-dir.left,.gb-dir.right{ top:44px; height:40px; }
  .gb-dpad-center{ inset:44px; }

  .gb-btn{ width:66px; height:66px; }
}

/* mobile: pantalla 1:1 + apilar panel */
@media (max-width: 520px){

  /* Pantalla cuadrada como lo tienes */
  .game-stage{
    aspect-ratio:5 / 5;
    max-height:70vh;
  }

  /* Panel EN HORIZONTAL (Game Boy) */
  .arcade-controls.gb-panel{
    flex-direction:row;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    padding:14px 14px 16px;
  }

  /* Izquierda: D-PAD fijo y centrado */
  .gb-dpad{
    width:110px;
    height:110px;
    flex:0 0 110px;
  }

  /* Recalcular medidas para que se vea “cruz” real */
  .gb-dir.up,.gb-dir.down{
    left:38px;
    width:34px;
    height:52px;
    border-radius:10px;
  }
  .gb-dir.left,.gb-dir.right{
    top:38px;
    width:52px;
    height:34px;
    border-radius:10px;
  }
  .gb-dpad-center{
    inset:38px;
    border-radius:10px;
  }

  /* Centro: START (más corto para que quepa) */
  .gb-mid{
    width:auto;
    flex:1 1 auto;
    display:flex;
    justify-content:center;
  }

  #btnStart.gb-pill-btn,
  .gb-pill-btn{
    min-width:120px;
    height:34px;
    line-height:34px;
    font-size:13px;
  }

  /* Derecha: botones A/B en diagonal Game Boy */
  .gb-buttons{
    flex:0 0 auto;
    transform:rotate(-12deg);
    gap:12px;
    padding-bottom:0;
  }

  .gb-btn{
    width:58px;
    height:58px;
  }
  .gb-btn span{ font-size:15px; }

  .gb-btn:active{ transform:translateY(3px); }
}
.fight-overlay{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.25);
  z-index: 9999;
  pointer-events: none;
}
.fight-overlay.hidden{ display:none; }

.fight-text{
  font-weight: 900;
  letter-spacing: .25rem;
  font-size: clamp(3rem, 10vw, 7rem);
  color: #fff;
  text-shadow: 0 10px 35px rgba(0,0,0,.55);
  transform: scale(0.95);
  opacity: 0;
  animation: fightPop 420ms ease-out forwards;
}
@keyframes fightPop{
  to { opacity: 1; transform: scale(1); }
}
