/* =========================================================================
   PALAG · obra.css
   -------------------------------------------------------------------------
   Estilos de "Leo Rompe, Hernán Arregla" (#/obra): la máquina con el canvas,
   los paneles de inicio / fin y los controles táctiles.
   ========================================================================= */

.ob { padding-top: 24px; padding-bottom: 40px; }
.ob-cab h1 {
  margin: 0 0 8px;
  font-family: var(--f-pixel);
  font-size: clamp(20px, 4.4vw, 40px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--neon-lima);
  text-shadow: 4px 4px 0 var(--neon-brasa), 8px 8px 0 rgba(255, 79, 43, .35);
}
.ob-cab p { margin: 0 0 18px; max-width: 60ch; color: var(--tinta-2); }

.ob-maquina {
  display: grid;
  gap: 10px;
  width: min(100%, 560px, calc(100vh - 150px));
  margin: 0 auto;
  padding: clamp(8px, 2vw, 16px);
  background: #1a1416;
  border: 3px solid #000;
  border-radius: 18px;
  box-shadow: inset 0 0 0 3px #2c2226, 0 0 0 3px var(--tinta), var(--sombra);
  color: #f3ece1;
}
.ob-pantalla { position: relative; overflow: hidden; background: #000; border: 3px solid #000; border-radius: 6px; }
.ob-pantalla canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: manipulation;
}

.ob-btn {
  position: absolute;
  top: 6px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  font-size: 14px;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  border: 2px solid rgba(255, 255, 255, .45);
  border-radius: 8px;
  cursor: pointer;
}
.ob-btn:hover { border-color: var(--neon-lima); }
.ob-btn-pausa { right: 6px; top: 18px; }
.ob-btn-fs { right: 46px; top: 18px; font-size: 16px; }

/* Paneles encima del canvas */
.ob-panel, .ob-pausa {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 12px;
  background: rgba(8, 6, 5, .72);
}
.ob-panel[hidden], .ob-pausa[hidden] { display: none; }
.ob-pausa { gap: 10px; align-content: center; justify-items: center; background: rgba(8, 6, 5, .8); }
.ob-caja { display: grid; gap: 10px; justify-items: center; text-align: center; max-width: 440px; }
.ob-titulo {
  margin: 0;
  font-family: var(--f-pixel);
  font-size: clamp(14px, 3.4vw, 24px);
  font-weight: 400;
  line-height: 1.3;
  color: var(--neon-ambar);
  text-shadow: 3px 3px 0 #000, 5px 5px 0 var(--neon-brasa);
}
.ob-caja p { margin: 0; font-size: clamp(12px, 2.6vw, 15px); line-height: 1.4; color: #e8e0d4; }
.ob-chico { font-size: 12px !important; color: #b8ab9a !important; }
.ob-puntos { font-family: var(--f-pixel); font-size: clamp(16px, 4vw, 26px) !important; color: var(--neon-lima) !important; }
.ob-nuevo { font-family: var(--f-pixel); font-size: 11px !important; color: var(--neon-ambar) !important; }
.ob-record { font-size: 12px; color: #b8ab9a; }

/* Controles táctiles (en compu con mouse no se ven) */
.ob-mando {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 6px 2px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
@media (hover: hover) and (pointer: fine) { .ob-mando { display: none; } }
.ob-mando-fuerza .ob-mando { display: flex; }
.ob-cruz {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(3, 56px);
  gap: 4px;
}
.ob-dir, .ob-martillo {
  font-size: 22px;
  color: #fff;
  background: #2e2428;
  border: 3px solid #000;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px #4a3c42;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.ob-dir:active, .ob-martillo:active { background: var(--acento); transform: translateY(2px); }
.ob-arr { grid-column: 2; grid-row: 1; }
.ob-izq { grid-column: 1; grid-row: 2; }
.ob-der { grid-column: 3; grid-row: 2; }
.ob-abj { grid-column: 2; grid-row: 3; }
.ob-martillo { width: 104px; height: 104px; font-size: 44px; border-radius: 50%; background: #5a2a1e; box-shadow: inset 0 0 0 3px #a2503a; }

.ob-ayuda { width: min(100%, 560px); margin: 12px auto 0; font-size: 13px; color: var(--tinta-2); }

/* Pantalla completa (el JS le pone la clase ob-fs al contenedor) */
.ob-maquina.ob-fs {
  display: flex; flex-direction: column; width: 100vw; height: 100vh; max-width: none; margin: 0;
  border: 0; border-radius: 0; box-shadow: none; padding: 6px; background: #000;
}
.ob-fs .ob-pantalla { flex: 1 1 auto; min-height: 0; border-radius: 0; border: 0; }
.ob-fs .ob-pantalla canvas { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; }

@media (max-width: 560px) {
  .ob { padding-top: 14px; }
  .ob-cruz { grid-template-columns: repeat(3, 50px); grid-template-rows: repeat(3, 50px); }
  .ob-martillo { width: 92px; height: 92px; }
}

.ob-saltar {
  position: absolute; left: 6px; bottom: 6px;
  padding: 6px 12px;
  font: 700 12px sans-serif;
  color: #fff;
  background: rgba(0, 0, 0, .6);
  border: 2px solid rgba(255, 255, 255, .55);
  border-radius: 8px;
  cursor: pointer;
}
.ob-saltar[hidden] { display: none; }
.ob-saltar:hover { border-color: var(--neon-lima); }
@media (max-width: 560px) { .ob-maquina { width: 100%; } }
