/* ==========================================================================
   SOLITARIO RELOJ - ESTILO INTEGRADO NOWEY JUEGOS
   ========================================================================= */

:root {
  --color-neon-blue: #00b7ff;
  --color-neon-green: #39ff14;
  --color-neon-orange: #ff6c00;
  --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;
}

/* Navbar e Interfaz superior fija (compartido con el resto de NOWEY) */
.logo-header{
    width:100%;
    text-align:center;
    padding:8px 0;
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL DEL JUEGO
   ========================================================================= */
.game-container {
  background: var(--bg-dark-box);
  border: var(--border-neon);
  border-radius: 16px;
  max-width: 420px;
  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;
}

.game-intro h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  margin: 5px 0;
  background: linear-gradient(90deg, var(--color-neon-orange), var(--color-neon-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-intro p {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0 0 15px 0;
}

/* ==========================================================================
   TABLERO DEL RELOJ
   ========================================================================= */
.board-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #04080c;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 15px;
}

.cell {
  /* Proporción real de las cartas individuales (211x313px) */
  aspect-ratio: 211 / 313;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s ease;
}

/* El <span> placeholder (REY/SOTA/CABALLO) se saca del flujo flex para que
   no comparta espacio con la carta cuando esta se coloca en la celda */
.cell span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.25);
  text-align: center;
  pointer-events: none;
  z-index: 0;
  width: 100%;
}

.cell.rey {
  border: 1px dashed rgba(255, 108, 0, 0.35);
  background: rgba(255, 108, 0, 0.04);
}
.cell.caballo {
  border: 1px dashed rgba(0, 183, 255, 0.35);
  background: rgba(0, 183, 255, 0.04);
}
.cell.sota {
  border: 1px dashed rgba(57, 255, 20, 0.35);
  background: rgba(57, 255, 20, 0.04);
}
.cell.centro {
  border: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.02);
}

.cell:hover {
  filter: brightness(1.3);
}

/* ==========================================================================
   CARTAS - RENDERIZADO CON SPRITES PNG (Baraja Española desde 107d.cl)
   ========================================================================= */
.card {
  width: 100%;
  height: 100%;
  border-radius: 5px;
  position: relative;
  z-index: 1;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: #1a242f;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px) scale(1.03);
}

.card.selected {
  outline: 2px solid var(--color-neon-green);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.6);
  transform: translateY(-6px);
  z-index: 99;
}
/* Imagen individual de la carta */
.card-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  pointer-events: none;
}

/* Reverso del mazo (patrón decorativo como en Pirámide) */
.card-back {
  width: 46px;
  height: 68px;
  background-image: linear-gradient(135deg, #0f172a 25%, #1e293b 25%, #1e293b 50%, #0f172a 50%, #0f172a 75%, #1e293b 75%, #1e293b 100%);
  background-size: 10px 10px;
  border: 1px solid var(--color-neon-orange);
  box-shadow: 0 0 8px rgba(255, 123, 0, 0.2);
  border-radius: 5px;
  display: inline-block;
}

/* ==========================================================================
   ZONA DE MAZO Y CARTA EN MANO
   ========================================================================= */
.deck-area {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 10px;
  background: rgba(5, 10, 14, 0.8);
  border: 1px solid rgba(0, 183, 255, 0.15);
  border-radius: 8px;
  padding: 12px 8px;
  margin-bottom: 12px;
}

.deck-pile {
  width: 46px;
  height: 68px;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  filter: drop-shadow(0 0 6px rgba(0, 183, 255, 0.4));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.deck-pile:hover {
  transform: scale(1.1);
}

.slot-label {
  font-size: 0.6rem;
  color: #64748b;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.current-card-slot {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.current-card-slot .card {
  width: 46px;
  height: 68px;
}

.btn-action {
  width: 100%;
  background: transparent;
  border: 1px solid var(--color-neon-orange);
  color: var(--color-neon-orange);
  padding: 10px;
  border-radius: 6px;
  font-family: 'Chakra Petch', 'Courier New', monospace;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-sizing: border-box;
}
.btn-action:hover {
  background: rgba(255, 108, 0, 0.1);
}

/* ==========================================================================
   MENSAJES DE ESTADO
   ========================================================================= */
#status-msg {
  font-size: 0.78rem;
  color: #94a3b8;
  min-height: 20px;
  padding: 6px 4px;
}

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

/* ==========================================================================
   FOOTER
   ========================================================================= */
footer {
  margin-top: auto;
  background: #030609;
  padding: 15px 20px;
  border-top: 1px solid rgba(255,255,255,0.02);
  font-size: 0.8rem;
  color: #475569;
}
