/* style.css - Diseño Dark Pro System v2 */

:root {
    /* Paleta de colores profesional */
    --bg-color: #0f172a;       /* Slate 900 - Fondo principal */
    --card-bg: #1e293b;        /* Slate 800 - Fondo de tarjetas */
    --input-bg: #020617;       /* Slate 950 - Fondo inputs */
    --accent: #38bdf8;         /* Sky 400 - Color de acento (cyan) */
    --accent-hover: #0ea5e9;   /* Sky 500 - Hover botones */
    --text-primary: #f1f5f9;   /* Slate 100 - Texto principal */
    --text-muted: #94a3b8;     /* Slate 400 - Texto secundario */
    --border-color: #334155;   /* Slate 700 - Bordes sutiles */
    --board-wood: #eebb77;     /* Color madera del tablero */
}

/* --- Reset & Base --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Layout Principal --- */
.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

/* --- Componente: Tarjeta Flotante (Login/Menu) --- */
.hero-card {
    background: var(--card-bg);
    width: 100%;
    padding: 40px 30px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Tipografía --- */
h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.05em;
    line-height: 1;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.badge {
    background: #000;
    color: var(--accent);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.4em;
    vertical-align: super;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Formularios y Inputs --- */
input[type="text"], 
.custom-select {
    width: 100%;
    padding: 16px;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
    margin-bottom: 15px;
    appearance: none; /* Elimina estilo nativo del select */
}

input[type="text"]:focus,
.custom-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

/* Estilos específicos para Dropdowns */
.custom-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.8rem auto;
}

.input-label {
    display: block; 
    color: var(--text-muted); 
    font-size: 0.75rem; 
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    text-align: left;
    margin-left: 2px;
}

.config-box {
    background: rgba(2, 6, 23, 0.3); /* Fondo sutilmente más oscuro */
    padding: 15px; 
    border-radius: 12px; 
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

/* --- Botones --- */
.btn {
    display: inline-block;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s, background-color 0.2s, box-shadow 0.2s;
    text-align: center;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; filter: grayscale(1); }

.btn-primary {
    background: var(--accent);
    color: #0f172a;
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover { background: #475569; }

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-muted);
}
.btn-outline:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* --- Loader / Spinner --- */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(5px);
    z-index: 1000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/* --- Juego y Tablero --- */
canvas {
    display: block;
    background: var(--board-wood);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-width: 100%;
    height: auto;
    cursor: crosshair;
    touch-action: none; 
    -webkit-tap-highlight-color: transparent;
}

.game-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.player-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 80px;
    padding: 5px;
    border-radius: 8px;
    transition: background 0.3s;
}

.active-turn {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.1);
}

.status-bar {
    margin-top: 15px;
    width: 100%;
    text-align: center;
    font-weight: 600;
    padding: 10px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    font-size: 1rem;
    color: var(--accent);
}