/* --- 1. IMPORTACIÓN DE FUENTE Y VARIABLES DE COLOR --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    /* Nueva paleta de colores "Noche de Juegos" */
    --primary-color: #F59E0B; /* Ámbar/Dorado */
    --primary-hover: #D97706; /* Ámbar oscuro */
    --success-color: #10B981; /* Esmeralda */
    --success-hover: #059669; /* Esmeralda oscuro */
    --background-color: #1F2937; /* Gris oscuro azulado */
    --surface-color: #374151; /* Gris medio */
    --text-color: #F9FAFB; /* Texto casi blanco */
    --text-muted: #9CA3AF; /* Texto secundario gris claro */
    --border-color: #4B5563; /* Borde gris oscuro */
    --shadow-color: rgba(0, 0, 0, 0.25);
}

/* --- 2. ESTILOS GENERALES Y LAYOUT --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Fondo con gradiente sutil */
    background-color: var(--background-color);
    background-image: radial-gradient(circle, #374151, var(--background-color));
    color: var(--text-color);
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1500px; /* <-- Ancho correcto para 3 columnas */
    background-color: var(--surface-color);
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-color);
    text-align: center;
    border: 1px solid var(--border-color);
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

/* --- 3. FORMULARIOS DE USUARIO --- */
#user-forms h2, #dashboard h1, #dashboard h2, #dashboard h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

#user-forms form, #payment-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

#user-forms input, #payment-form input {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

#user-forms input:focus, #payment-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

#user-forms {
    text-align: center; /* centra todo */
    padding: 10px;
}

button {
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    color: var(--primary-hover);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#user-forms button {
    background-color: var(--primary-color);
}
#user-forms button:hover {
    background-color: var(--primary-hover);
    color: white;
}

#register-message, #login-message, #payment-message {
    min-height: 24px;
    font-weight: 600;
}

/* --- 4. DASHBOARD Y JUEGO --- */
#game-info, .history-section, #payment-section {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: left;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 3px solid var(--primary-color);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    background-color: var(--surface-color);
}

.square {
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    font-size: 10px;
    padding: 4px;
    color: var(--text-muted);
}

.player-piece {
    width: 7%;
    height: 7%;
    border-radius: 50%;
    position: absolute;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Animación con rebote */
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 8px var(--shadow-color);
    transform: translate(-50%, -50%); 
    top: 5%;
    left: 5%;
}

#roll-dice-button, #submit-payment-button {
    background-color: var(--success-color);
    color: white;
}

#roll-dice-button:hover, #submit-payment-button:hover {
    background-color: var(--success-hover);
}

#roll-dice-button:disabled {
    cursor: not-allowed;
    background-color: #555;
    transform: none;
    box-shadow: none;
}

/* --- 5. PANEL DE USUARIO --- */
.history-section ul {
    list-style: none;
    padding: 0;
    font-size: 14px;
    color: var(--text-muted);
}

.history-section li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.history-section li:last-child {
    border-bottom: none;
}

/* --- 6. AJUSTES PARA MÓVILES --- */
@media (max-width: 700px) {
    body { padding: 10px; }
    .container { padding: 15px; }
}

/* Añade o verifica estas reglas en tu style.css */
#board-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.board-asset {
    position: absolute;
    /* Hacemos que la imagen rote desde su centro */
    transform-origin: center;
    /* Ajusta el ancho si tus imágenes son muy gruesas o delgadas */
    width: 30px; 
}

#game-board, #game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}


#dashboard {
    display: flex;
    gap: 1rem; /* Espacio entre columnas */
    align-items: flex-start; /* Alinea las columnas en la parte superior */
}

.dashboard-column {
    /* Estilos base para todas las columnas */
}

.left-sidebar {
    flex-basis: 15%; /* Ancho de la columna izquierda */
    flex-shrink: 0;
}

.main-content {
    flex-grow: 1; /* La columna central ocupa el espacio restante */
}

.right-sidebar {
    flex-basis: 20%; /* Ancho de la columna derecha */
    flex-shrink: 0;
}

/* Estilos para la lista de juegos */
.game-list {
    list-style: none;
    padding: 0;
    text-align: left;
}

.game-list li a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 8px;
    transition: background-color 0.2s;
    font-weight: 600;
}

.game-list li a:hover {
    background-color: #f0f2f5;
}

.game-list li a.active-game {
    background-color: var(--primary-color);
    color: white;
}

#logout-button {
    margin-bottom: 5px;
    padding: 5px 10px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#logout-button:hover {
    background-color: #c0392b;
}

/* --- 7. ESTILO DE RETIROS --- */
#form-withdraw {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

#withdraw-amount {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

#withdraw-amount:focus {
    outline: none;
    border-color: #EF4444; /* rojo */
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

#form-withdraw button {
    background-color: #EF4444; /* rojo */
    color: white;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#form-withdraw button:hover {
    background-color: #B91C1C; /* rojo oscuro */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#withdraw-message {
    min-height: 24px;
    font-weight: 600;
}

/* Estilo general para inputs de texto */
#withdraw-account {
    width: 100%;              /* Ocupa todo el ancho del contenedor */
    padding: 12px 16px;       /* Espaciado interno */
    font-size: 16px;          /* Tamaño de fuente legible */
    border: 2px solid #ccc;   /* Borde inicial gris claro */
    border-radius: 8px;       /* Bordes redondeados */
    outline: none;            /* Quitar outline por defecto */
    transition: border-color 0.3s, box-shadow 0.3s; /* Animación suave */
    box-sizing: border-box;   /* Incluye padding en el ancho */
}

/* Placeholder más claro */
#withdraw-account::placeholder {
    color: #aaa;
}

/* Efecto al enfocar */
#withdraw-account:focus {
    border-color: #e74c3c;   /* Color rojo vivo al enfocar */
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5); /* Sombra suave */
}

/* Opcional: efecto hover */
#withdraw-account:hover {
    border-color: #bdc3c7;   /* Gris un poco más oscuro al pasar el mouse */
}

.form-logo {
    width: 150px;   /* ajusta tamaño */
    height: auto;
}

.logo-container {
    margin-bottom: 10px;
}

#chess-board {
    touch-action: none; /* evita scroll al arrastrar */
    -ms-touch-action: none; /* soporte IE/Edge */
}

.cell {
    width: 100px;
    height: 100px;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
  }
  
  .tictactoe-board {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(3, 100px);
  gap: 5px;
  margin: 20px auto;
  width: max-content;
}

.tictactoe-cell {
  width: 100px;
  height: 100px;
  background: #f1f1f1;
  border: 2px solid #333;
  font-size: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.tictactoe-cell:hover {
  background: #ddd;
}

  