/* ==========================================================================
   MAHJONG SOLITAIRE — ESTILO NOWEY (V2)
   ========================================================================= */

:root {
  --color-neon-blue:   #00b7ff;
  --color-neon-green:  #39ff14;
  --color-neon-orange: #ff7b00;
  --color-neon-red:    #ff0064;
  --bg-dark-box:       rgba(10, 21, 32, 0.85);
  --border-neon:       1px solid rgba(0, 183, 255, 0.2);
}

body {
  background-color: #050a0e;
  color: #e2e8f0;
  font-family: 'Chakra Petch', 'Courier New', monospace;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── LOGO HEADER ── */
.logo-header {
  width: 100%;
  text-align: center;
  padding: 8px 0;
}

/* ── MESA PRINCIPAL ── */
.mesa {
  background: var(--bg-dark-box);
  border: var(--border-neon);
  border-radius: 16px;
  max-width: 460px;
  width: calc(100% - 24px);
  margin: 0 auto;
  padding: 15px;
  box-sizing: border-box;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  text-align: center;
}

/* ── STATUS PILL ── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(5, 10, 14, 0.6);
  border: 1px solid rgba(57, 255, 20, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.65rem;
  letter-spacing: 1px;
  color: #94a3b8;
  margin-bottom: 5px;
}
.status-dot {
  width: 6px;
  height: 6px;
  background: var(--color-neon-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-neon-green);
}

/* ── TÍTULO ── */
.titulo-juego {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  margin: 5px 0;
  background: linear-gradient(90deg, var(--color-neon-blue), var(--color-neon-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.instrucciones-juego {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0 0 12px 0;
}

/* ── CONTENEDOR DEL TABLERO ── */
.board-relative {
  position: relative;
  width: 100%;
  min-height: 380px;
  background: #04080c;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mesa-logo-fondo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 55%;
  max-width: 220px;
  opacity: 0.1;
  z-index: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 18px rgba(0, 183, 255, 0.3));
}

/* ── TABLERO DE FICHAS ── */
.mahjong-table {
  position: relative;
  width: 100%;
  height: 380px;
  z-index: 1;
}

/* ── FICHAS ── */
.mahjong-tile {
  position: absolute;
  width: 44px;
  height: 58px;
  background: linear-gradient(155deg, #0d1e2e, #050b10);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  user-select: none;
  cursor: pointer;
  border: 1.5px solid var(--tile-neon, rgba(0, 183, 255, 0.6));
  box-shadow:
    -3px 3px 0 rgba(0, 0, 0, 0.6),
    -5px 5px 8px rgba(0, 0, 0, 0.5),
    0 0 8px color-mix(in srgb, var(--tile-neon, #00b7ff) 30%, transparent);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.mahjong-tile.selected {
  background: linear-gradient(155deg, #1a2e1a, #0a1a0a);
  border-color: var(--color-neon-green) !important;
  transform: translateY(-5px) scale(1.06);
  box-shadow:
    -3px 8px 0 rgba(0, 0, 0, 0.5),
    0 0 16px rgba(57, 255, 20, 0.8);
  z-index: 999 !important;
}

.mahjong-tile.blocked {
  filter: brightness(0.45) saturate(0.5);
  cursor: not-allowed;
  border-color: rgba(100, 116, 139, 0.3) !important;
}

.mahjong-tile:not(.blocked):hover {
  border-color: var(--color-neon-green);
  box-shadow:
    -3px 3px 0 rgba(0, 0, 0, 0.6),
    0 0 14px rgba(57, 255, 20, 0.6);
  transform: translateY(-2px);
}

.mahjong-tile.hint {
  animation: hintPulse 0.5s ease-in-out 3;
  box-shadow: 0 0 0 2px #39ff14, 0 0 18px rgba(57, 255, 20, 0.9) !important;
  z-index: 999 !important;
}
@keyframes hintPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.1); }
}

.mahjong-tile.matched-anim {
  animation: tileMatched 0.22s ease-in forwards;
  pointer-events: none;
}
@keyframes tileMatched {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.2) rotate(20deg); opacity: 0; }
}

/* ── SCORE POPUP ── */
.score-popup {
  position: absolute;
  color: #39ff14;
  font-family: 'Chakra Petch', monospace;
  font-weight: 900;
  font-size: 0.95rem;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.9);
  pointer-events: none;
  z-index: 1000;
  animation: floatPopup 0.8s ease-out forwards;
}
@keyframes floatPopup {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-40px); opacity: 0; }
}

/* ── AVISO SIN JUGADAS ── */
.sin-jugadas-aviso {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 15, 22, 0.95);
  border: 1px solid var(--color-neon-orange);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--color-neon-orange);
  z-index: 1001;
  box-shadow: 0 0 20px rgba(255, 123, 0, 0.35);
  white-space: nowrap;
}
.sin-jugadas-aviso button {
  background: var(--color-neon-orange);
  color: #050a0e;
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Chakra Petch', monospace;
}

/* ── DASHBOARD ── */
.arcade-dashboard {
  margin-top: 12px;
  width: 100%;
}

.marcador-box {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(5, 10, 14, 0.8);
  border: 1px solid rgba(0, 183, 255, 0.15);
  border-radius: 8px;
  padding: 8px 4px;
  margin-bottom: 10px;
  gap: 2px;
}
.marcador-box small {
  font-size: 0.55rem;
  color: #64748b;
  letter-spacing: 1px;
  display: block;
}
.marcador-box b {
  font-size: 0.95rem;
  color: var(--color-neon-green);
}

.mahjong-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

/* ── BOTONES ── */
.btn-action {
  width: 100%;
  background: transparent;
  padding: 9px 6px;
  border-radius: 6px;
  font-family: 'Chakra Petch', monospace;
  font-weight: 700;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-sizing: border-box;
  white-space: nowrap;
}
.btn-green  { border: 1px solid var(--color-neon-green);  color: var(--color-neon-green); }
.btn-green:hover  { background: rgba(57, 255, 20, 0.1); }
.btn-orange { border: 1px solid var(--color-neon-orange); color: var(--color-neon-orange); }
.btn-orange:hover { background: rgba(255, 123, 0, 0.1); }
.btn-blue   { border: 1px solid var(--color-neon-blue);   color: var(--color-neon-blue); }
.btn-blue:hover   { background: rgba(0, 183, 255, 0.1); }

/* ── OVERLAY ── */
.overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(5, 10, 14, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(3px);
}
.overlay.oculto { display: none !important; }

.mensaje-alerta {
  padding: 20px;
  text-align: center;
}
.mensaje-alerta h2 {
  color: var(--color-neon-green);
  font-family: 'Orbitron', sans-serif;
  font-size: 1.6rem;
  margin: 0 0 8px 0;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
}
.mensaje-alerta p {
  color: #94a3b8;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

/* ── FOOTER ── */
.staff-footer-note {
  margin-top: 14px;
  font-size: 0.85rem;
}
.staff-footer-note a {
  color: var(--color-neon-blue);
  text-decoration: none;
  font-weight: bold;
}

/* ── FOOTER GLOBAL DEGRADADO ── */
.site-footer p,
.site-footer strong,
.site-footer .copyright {
  background: linear-gradient(90deg, #00b7ff 0%, #39ff14 50%, #ff7b00 100%) !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  filter: drop-shadow(0 0 4px rgba(57, 255, 20, 0.5));
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .mahjong-table {
    height: 300px;
  }
  .board-relative {
    min-height: 310px;
  }
  .marcador-box {
    padding: 6px 2px;
  }
  .marcador-box small {
    font-size: 0.5rem;
  }
  .marcador-box b {
    font-size: 0.8rem;
  }
  .btn-action {
    font-size: 0.65rem;
    padding: 8px 4px;
  }
}
