﻿/*****************************/
/* 1. VARIABLES CORPORATIVAS */
/*****************************/
:root {
    --camx-azul: #001F5B;
    --camx-rojo: #D92632;
    --camx-blanco: #FFFFFF;
}

/******************************/
/* 2. TIPOGRAFÍA Y FONDO BASE */
/******************************/
camx-body {
    font-family: 'Helvetica Neue LT Std', 'Helvetica Neue', Helvetica, Calibri, Arial, 'Roboto', sans-serif;
    background: radial-gradient(circle at top left, #ffffff 0%, #eef1f6 100%);
    background-attachment: fixed;
    margin: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

    camx-body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url(/images/login.png);
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        background-color: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

.LogoImg {
    height: 50px;
    margin-right: 55px;
    margin-top: 5px;
}

/***********************/
/* 3. EL GLASSMORPHISM */
/***********************/
.glass-panel {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 31, 91, 0.05) !important;
    border-radius: 12px !important;
}

.glass-dark-panel {
    background: rgba(0, 31, 91, 0.8) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2) !important;
    border-radius: 12px !important;
    color: var(--camx-blanco) !important;
}

/* Fondo sutil con gradiente corporativo para que el cristal destaque */
.home-glass-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 31, 91, 0.05);
    border: 1px solid rgba(255,255,255,0.6);
}

/* El efecto Glassmorphism para los Tiles */
.glass-tile-hover {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, background 0.3s ease;
}

    .glass-tile-hover:hover {
        transform: translateY(-8px);
        box-shadow: 0 15px 35px rgba(0, 31, 91, 0.15); /* Sombra con un toque azul corporativo */
        background: rgba(255, 255, 255, 0.85); /* Se aclara al pasar el mouse */
    }

    .glass-tile-hover:active {
        transform: translateY(-2px) scale(0.98);
        box-shadow: 0 5px 15px rgba(0, 31, 91, 0.1);
        transition: transform 0.1s ease, box-shadow 0.1s ease;
    }

/* Botones de Enlaces Rápidos (Píldoras esmeriladas) */
.glass-link-btn {
    background: rgba(255, 255, 255, 0.8) !important;
    color: #001F5B !important;
    border-radius: 30px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .glass-link-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 15px rgba(0, 31, 91, 0.1) !important;
        background: rgba(255, 255, 255, 1) !important;
    }

/*************************/
/* 4. MEDIA PRINT LIMPIO */
/*************************/
@media print {
    .mud-layout, .mud-appbar, .mud-drawer, .mud-overlay, .mud-snackbar-provider, .mud-snackbar {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .d-print-none, .mud-dialog-actions {
        display: none !important;
    }

    .mud-dialog-container, .mud-dialog, .mud-dialog-content {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        transform: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    #ticket-area {
        width: 100% !important;
        margin: 0 !important;
        border: none !important;
    }
}

/*****************************/
/* 5. UI GAMING & COMPONENTES*/
/*****************************/

/* --- UTILIDADES GLOBALES --- */
.user-select-none {
    user-select: none;
    -webkit-user-select: none;
}

.outline-none {
    outline: none !important;
}

.blurred {
    filter: blur(6px);
    pointer-events: none;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

/* --- SOPA DE LETRAS (Word Search) --- */
.board {
    display: grid;
    gap: 4px;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    transition: filter 0.3s ease;
}

.cell {
    aspect-ratio: 1 / 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: crosshair;
    border-radius: 4px;
    background-color: transparent; 
    color: #000000;
    font-weight: bold;
}

    .cell:hover {
        background-color: var(--mud-palette-action-default-hover);
    }

    .cell.highlighted {
        background-color: var(--mud-palette-primary) !important;
        color: var(--mud-palette-primary-text) !important;
        border-color: var(--mud-palette-primary);
        border-radius: 14px;
        transform: scale(1.05);
        z-index: 1;
    }

.highlights-layer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2;
}

    .highlights-layer line {
        stroke-width: 36px;
        stroke-linecap: round;
        opacity: 0.6;
        transition: all 0.2s ease;
    }

/* --- TABLEROS TIPO MATRIZ (Sudoku & Crucigrama) --- */
.sudoku-paper-wrapper {
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--mud-palette-surface);
    padding: 4px;
}

.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0px;
    background-color: var(--mud-palette-lines-default);
    border: 3px solid #000000;
    border-radius: 8px;
    width: 100%;
    aspect-ratio: 1 / 1;
    transition: filter 0.3s ease;
}

.sudoku-cell {
    position: relative; 
    background-color: var(--mud-palette-surface);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-right: 1px solid var(--mud-palette-lines-default);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

    /* Quitar bordes redundantes del perímetro */
    .sudoku-cell:nth-child(9n) {
        border-right: none;
    }

    .sudoku-cell:nth-last-child(-n+9) {
        border-bottom: none;
    }

.cell-text {
    font-weight: 500;
    transition: transform 0.1s ease;
}

/* Estados Sudoku */
.sudoku-cell.clue {
    background-color: var(--mud-palette-background-grey);
    color: var(--mud-palette-text-primary);
}

    .sudoku-cell.clue .cell-text {
        font-weight: 700;
    }

.sudoku-cell.editable:hover {
    background-color: var(--mud-palette-action-default-hover);
}

.sudoku-cell.selected {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.15) !important;
    box-shadow: inset 0 0 0 2px var(--mud-palette-primary);
    z-index: 1;
}

    .sudoku-cell.selected .cell-text {
        transform: scale(1.1);
    }

.sudoku-cell.error {
    background-color: #ffebee !important;
    color: var(--mud-palette-error) !important;
    animation: shake 0.4s ease-in-out;
}

/* Teclado numérico inferior */
.numpad-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px 8px;
    justify-items: center;
}

.numpad-circle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50% !important;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

    .numpad-circle-btn:active {
        transform: scale(0.92);
    }

/* Paleta de Colores Sudoku */
.color-num-1, .text-num-1 {
    color: #E53935 !important;
}

.color-num-2, .text-num-2 {
    color: #43A047 !important;
}

.color-num-3, .text-num-3 {
    color: #1E88E5 !important;
}

.color-num-4, .text-num-4 {
    color: #FB8C00 !important;
}

.color-num-5, .text-num-5 {
    color: #8E24AA !important;
}

.color-num-6, .text-num-6 {
    color: #00ACC1 !important;
}

.color-num-7, .text-num-7 {
    color: #D81B60 !important;
}

.color-num-8, .text-num-8 {
    color: #3949AB !important;
}

.color-num-9, .text-num-9 {
    color: #7CB342 !important;
}

/* --- NUEVOS REQUERIMIENTOS SUDOKU --- */
.border-right-thick {
    border-right: 3px solid #000000 !important;
}

.border-bottom-thick {
    border-bottom: 3px solid #000000 !important;
}

.sudoku-board {
    border: 3px solid #000000;
}

.sudoku-crosshair {
    background-color: rgba(0, 0, 0, 0.08) !important;
}

/* 1. El castigo final: Escala de grises profunda con transición suave */
.sudoku-minimal-zone {
    filter: grayscale(100%) contrast(1.1) brightness(0.9);
    pointer-events: auto; /* Permite seguir jugando pero en un ambiente hostil */
}

/* 2. La música de Mario Bros acelerada (Visual): Reloj latiendo en rojo neón/amarillo */
.sudoku-warning-zone .sudoku-timer-text {
    color: #FFD700 !important;
    animation: latido-rapido 0.4s infinite alternate ease-in-out;
}

.alerta-pulsante {
    animation: latido-rapido 0.4s infinite alternate ease-in-out;
}

@keyframes latido-rapido {
    0% {
        transform: scale(1);
        text-shadow: 0 0 5px #ff3333;
    }

    100% {
        transform: scale(1.15);
        text-shadow: 0 0 15px #FFD700, 0 0 30px #ff3333;
    }
}

/* --- CRUCIGRAMA (Crossword) --- */
.crossword-classic {
    border-radius: 0 !important;
    background-color: #000000;
    gap: 1px;
    border: 2px solid #000000;
}

    .crossword-classic .sudoku-cell.editable {
        background-color: #ffffff;
        color: #000000;
        border: none !important;
        border-radius: 0 !important;
    }

.crossword-black {
    background-color: #000000 !important;
    border: none !important;
    cursor: default;
}

/* El número pequeño bien posicionado en la esquina */
.crossword-num {
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #000000;
    line-height: 1;
    z-index: 2;
}

.word-active {
    background-color: #e3f2fd !important;
}

.cell-active {
    background-color: #ffeb3b !important;
    box-shadow: none !important;
    z-index: 1;
}

.crossword-classic .cell-text {
    text-transform: uppercase;
    margin-top: 6px;
}

/* Timbiriche SVG */
.hover-line {
    cursor: pointer;
}

    .hover-line:hover {
        stroke: rgba(var(--mud-palette-text-primary-rgb), 0.2) !important;
    }

/* --- BATALLA NAVAL --- */
.bs-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 1px;
    background-color: var(--camx-azul); /* Líneas azules oscuras */
    border: 2px solid var(--camx-azul);
    border-radius: 4px;
    width: max-content;
}

.bs-water {
    background-color: #bbdefb !important;
} /* Agua clara (Flota propia) */

.bs-water-radar {
    background-color: #0d47a1 !important;
    transition: background-color 0.2s;
} /* Agua oscura (Radar) */

    .bs-water-radar:hover {
        background-color: #1976d2 !important;
    }

.bs-ship {
    background-color: #78909c !important;
    box-shadow: inset 0 0 4px rgba(0,0,0,0.3);
} /* Gris metálico */

.bs-miss {
    background-color: #42a5f5 !important;
} /* Splash de agua */

.bs-hit {
    background-color: #212121 !important;
    animation: shake 0.3s;
} /* Fuego/Humo negro */

/* Temas del Océano */
.ocean-morning .bs-water {
    background-color: #4dd0e1 !important;
} /* Turquesa */

.ocean-afternoon .bs-water {
    background-color: #1565c0 !important;
} /* Marino */

.ocean-night .bs-water {
    background-color: #001020 !important;
} /* Casi negro */

/* Efecto Relámpago */
@keyframes lightning-flash {
    0%, 95%, 100% {
        background-color: transparent;
    }

    96%, 98% {
        background-color: rgba(255, 255, 255, 0.5);
    }
}

.storm-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    animation: lightning-flash 8s infinite;
    z-index: 5;
}

/* --- IDENTIDAD DE LA FLOTA JUGADOR 1 (Gama Rojos y Naranjas) --- */
.bs-ship-p1-1 {
    background-color: #b71c1c !important;
} /* Portaaviones: Rojo Sangre */

.bs-ship-p1-2 {
    background-color: #d32f2f !important;
} /* Acorazado: Rojo Carmesí */

.bs-ship-p1-3 {
    background-color: #e53935 !important;
} /* Submarino: Rojo Brillante */

.bs-ship-p1-4 {
    background-color: #f44336 !important;
} /* Crucero: Rojo Estándar */

.bs-ship-p1-5 {
    background-color: #ef5350 !important;
} /* Patrulla: Rojo Claro */

/* --- IDENTIDAD DE LA FLOTA JUGADOR 2 (Gama Azules y Púrpuras) --- */
.bs-ship-p2-1 {
    background-color: #1a237e !important;
} /* Portaaviones: Azul Marino Profundo */

.bs-ship-p2-2 {
    background-color: #283593 !important;
} /* Acorazado: Índigo Oscuro */

.bs-ship-p2-3 {
    background-color: #303f9f !important;
} /* Submarino: Índigo */

.bs-ship-p2-4 {
    background-color: #3949ab !important;
} /* Crucero: Azul Cobalto */

.bs-ship-p2-5 {
    background-color: #3f51b5 !important;
} /* Patrulla: Azul Estándar */

/* Sombra interior para darle relieve metálico a todas las naves */
[class*="bs-ship-"] {
    box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Coordenadas del Radar */
.naval-coord {
    color: #ffffff; /* Letra blanca pura */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9); /* Sombra negra pesada para que no se pierda en el mar claro */
    font-family: monospace; /* Tipo radar de submarino */
    font-size: 1.1rem;
}

    /* Variante oscura si la necesitas para contraste dentro del MudPaper */
    .naval-coord.text-dark {
        color: var(--camx-azul);
        text-shadow: none;
    }

/* --- NUEVOS REQUERIMIENTOS BATALLA NAVAL --- */
.bs-ship-sunk {
    background-color: #4e342e !important; /* Café madera oscuro */
    box-shadow: inset 0 0 8px rgba(0,0,0,0.8);
    opacity: 0.9;
}

@keyframes board-shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

.shake-animation {
    animation: board-shake 0.4s;
}

.bs-ship-golden {
    background: linear-gradient(135deg, #FFD700 0%, #FDB931 50%, #FFD700 100%) !important;
    box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.8), 0 0 5px rgba(255, 215, 0, 0.5) !important;
    border: 1px solid #FFF8DC !important;
}

/* --- CONECTA 4 --- */
.c4-board {
    display: flex;
    gap: 8px;
    padding: 8px;
}
.c4-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: background-color 0.2s;
}
.c4-column:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
.c4-cell {
    width: 50px;
    height: 50px;
    background-color: #01579B; /* Azul fuerte corporativo para la placa */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 4px 6px rgba(0,0,0,0.4);
}
.c4-token {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.c4-empty { background-color: var(--mud-palette-surface); } /* Hueco */
.c4-p1 { background-color: var(--camx-rojo); box-shadow: inset -2px -2px 6px rgba(0,0,0,0.3); } /* Ficha Roja */
.c4-p2 { background-color: #FFCA28; box-shadow: inset -2px -2px 6px rgba(0,0,0,0.3); } /* Ficha Amarilla */

/* --- MEMORAMA --- */
.memo-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Ajustable dinámicamente si metes más pares */
    gap: 12px;
    width: 100%;
    perspective: 1000px;
}
.memo-card {
    width: 100%;
    aspect-ratio: 1 / 1;
    cursor: pointer;
}
.memo-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.5s;
    transform-style: preserve-3d;
}
.memo-card.flipped .memo-card-inner {
    transform: rotateY(180deg);
}
.memo-card-front, .memo-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.memo-card-back {
    background: linear-gradient(135deg, var(--camx-azul), #001020);
    color: white;
}
.memo-card-front {
    background-color: white;
    transform: rotateY(180deg);
}