/* ==========================================================================
   2048 — NOWEY
   ========================================================================= */

.titulo-juego {
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  color: #00b7ff;
  text-shadow: 0 0 12px rgba(0, 183, 255, 0.6);
  letter-spacing: 2px;
  margin: 20px 0 10px 0;
}

.g2048-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 10px 30px 10px;
}

.g2048-viewport {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.g2048-hud {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  font-family: 'Chakra Petch', monospace;
  font-weight: 700;
  color: #e2e8f0;
  padding: 8px 4px;
}
.hud-puntaje { color: #00b7ff; text-shadow: 0 0 6px rgba(0, 183, 255, 0.5); }

.record-chip {
  font-family: 'Chakra Petch', monospace;
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: #94a3b8;
  border: 1px solid rgba(0, 183, 255, 0.25);
  border-radius: 20px;
  padding: 6px 16px;
  background: rgba(0, 183, 255, 0.06);
}
.record-chip span { color: #00b7ff; font-weight: 800; text-shadow: 0 0 6px rgba(0, 183, 255, 0.5); }

.g2048-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #04080c;
  border: 1px solid rgba(0, 183, 255, 0.25);
  border-radius: 10px;
  overflow: hidden;
  padding: 3%;
  box-sizing: border-box;
  box-shadow: 0 0 30px rgba(0, 183, 255, 0.08) inset;
  touch-action: none;
}

.g2048-logo-fondo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 45%;
  opacity: 0.04;
  pointer-events: none;
  z-index: 1;
}

.g2048-grid {
  position: absolute;
  inset: 3%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 3%;
  z-index: 2;
}
.g2048-celda {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

.g2048-fichas {
  position: absolute;
  inset: 3%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 3%;
  z-index: 3;
  pointer-events: none;
}

.ficha {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  transition: left 0.1s ease, top 0.1s ease, transform 0.1s ease;
}
.ficha.nueva { animation: ficha-aparece 0.18s ease; }
.ficha.fusionada { animation: ficha-fusion 0.18s ease; }
@keyframes ficha-aparece { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes ficha-fusion { 0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }

.btn-fullscreen-mate {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 25;
  background: rgba(4, 8, 12, 0.7);
  border: 1px solid rgba(0, 183, 255, 0.35);
  color: #00b7ff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-fullscreen-mate:hover { background: rgba(0, 183, 255, 0.15); }

.overlay-inicio, .overlay-fin, .overlay-gana {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(4, 8, 12, 0.94);
  padding: 20px;
}
.oculto { display: none !important; }

.overlay-inicio h2, .overlay-fin h2, .overlay-gana h2 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  color: #00b7ff;
  text-shadow: 0 0 12px rgba(0, 183, 255, 0.6);
  margin-bottom: 12px;
}
.overlay-fin h2 { color: #ff2b5e; text-shadow: 0 0 12px rgba(255, 43, 94, 0.6); }
.overlay-gana h2 { color: #ffe94d; text-shadow: 0 0 12px rgba(255, 233, 77, 0.7); }

.overlay-inicio p, .overlay-fin p, .overlay-gana p {
  font-family: 'Chakra Petch', monospace;
  color: #94a3b8;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 16px;
  max-width: 300px;
}

.record-nuevo {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  color: #ffe94d;
  text-shadow: 0 0 10px rgba(255, 233, 77, 0.7);
  font-size: 0.9rem;
  margin: -6px 0 14px 0 !important;
  animation: record-brillo 0.9s ease-in-out infinite;
}
@keyframes record-brillo { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }

.btn-mate {
  font-family: 'Chakra Petch', monospace;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #00b7ff, #0080b3);
  color: #021018;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(0, 183, 255, 0.4);
  margin-bottom: 10px;
}
.btn-mate:active { transform: scale(0.96); }
.btn-salir {
  display: inline-block;
  color: #94a3b8;
  text-decoration: none;
  font-family: 'Chakra Petch', monospace;
  font-size: 0.8rem;
}

.g2048-board.sacudida { animation: sacudida-tablero 0.25s ease; }
@keyframes sacudida-tablero {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.staff-footer-note { margin-top: 18px; text-align: center; }
.staff-footer-note a { color: #64748b; text-decoration: none; font-family: 'Chakra Petch', monospace; font-size: 0.8rem; }

/* Colores por valor de ficha — estilo neón NOWEY */
.v2   { background: #0f2a3a; color: #00b7ff; }
.v4   { background: #0f3a2a; color: #39ff14; }
.v8   { background: #3a260f; color: #ff7b00; }
.v16  { background: #3a0f2a; color: #ff2b9c; }
.v32  { background: #2a0f3a; color: #b388ff; }
.v64  { background: #3a0f0f; color: #ff2b5e; }
.v128 { background: #3a3a0f; color: #ffe94d; }
.v256 { background: #0f3a3a; color: #14ffe9; }
.v512 { background: #1a1a1a; color: #ffffff; box-shadow: 0 0 12px rgba(255,255,255,0.3); }
.v1024{ background: #1a1a1a; color: #ffe94d; box-shadow: 0 0 14px rgba(255,233,77,0.5); }
.v2048{ background: #1a1a1a; color: #39ff14; box-shadow: 0 0 18px rgba(57,255,20,0.7); }