/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 100%;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.5rem;
    color: #1a1a2e;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Controles del juego */
.game-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.difficulty-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.difficulty-selector label {
    font-weight: 600;
    color: #333;
}

.difficulty-selector select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    background: white;
    transition: border-color 0.3s;
}

.difficulty-selector select:hover {
    border-color: #0f3460;
}

.btn-new-game {
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-new-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

.btn-new-game:active {
    transform: translateY(0);
}

/* Info del juego */
.game-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background: #1a1a2e;
    border-radius: 10px;
}

.info-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    color: #ff6b6b;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.info-box .icon {
    font-size: 1.3rem;
}

.info-box.face {
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.info-box.face:hover {
    transform: scale(1.1);
}

/* Tablero del juego */
.game-container {
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding: 10px;
}

.game-board {
    display: grid;
    gap: 2px;
    background: #333;
    padding: 5px;
    border-radius: 5px;
    border: 3px solid #1a1a2e;
}

/* Celdas */
.cell {
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s;
    border-radius: 3px;
}

.cell.hidden {
    background: linear-gradient(145deg, #a0a0a0, #808080);
    border: 2px outset #ccc;
}

.cell.hidden:hover {
    background: linear-gradient(145deg, #b0b0b0, #909090);
}

.cell.hidden:active {
    border: 2px inset #999;
}

.cell.revealed {
    background: #e0e0e0;
    border: 1px solid #bbb;
    cursor: default;
}

.cell.flagged {
    background: linear-gradient(145deg, #a0a0a0, #808080);
    border: 2px outset #ccc;
}

.cell.mine {
    background: #ff4444;
}

.cell.mine-exploded {
    background: #ff0000;
    animation: explode 0.3s ease-out;
}

@keyframes explode {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Colores de números */
.cell.num-1 { color: #0000ff; }
.cell.num-2 { color: #008000; }
.cell.num-3 { color: #ff0000; }
.cell.num-4 { color: #000080; }
.cell.num-5 { color: #800000; }
.cell.num-6 { color: #008080; }
.cell.num-7 { color: #000000; }
.cell.num-8 { color: #808080; }

/* Mensaje */
.message {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    border-radius: 10px;
    font-size: 1.3rem;
    font-weight: bold;
    animation: fadeIn 0.5s ease-out;
}

.message.hidden {
    display: none;
}

.message.win {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
}

.message.lose {
    background: linear-gradient(135deg, #e94560, #ff6b6b);
    color: white;
}

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

/* Footer */
footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .game-controls {
        flex-direction: column;
        gap: 10px;
    }

    .cell {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .game-info {
        gap: 15px;
        padding: 10px;
    }

    .info-box {
        font-size: 1.2rem;
    }
}

/* Para tableros grandes */
@media (max-width: 1000px) {
    .game-board.large {
        transform: scale(0.8);
        transform-origin: top center;
    }
}
