* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #fff;
}

.container {
    max-width: 1200px;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
    /* padding: 30px; */
    padding: 10px;
    position: relative;
}

header {
    margin-bottom: 30px;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.game-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 15px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat-box {
    background: rgba(255, 204, 0, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
    min-width: 120px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffcc00;
}

.difficulty-selector {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.difficulty-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #ffcc00;
    color: #fff;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.difficulty-btn:hover {
    background: rgba(255, 204, 0, 0.2);
    transform: translateY(-3px);
}

.difficulty-btn.active {
    background: rgba(255, 204, 0, 0.4);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
}

.game-container {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 30px;
    overflow: auto;
    /* max-height: 70vh; */
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.board {
    display: grid;
    gap: 2px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
    border-radius: 4px;
    margin: 0 auto;
    height: 100%;
}

.cell {
    width: 40px;
    height: 40px;
    background: #3a6ea5;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2);
    user-select: none;
}

.cell:hover {
    background: #4a7eb5;
    transform: scale(1.05);
}

.cell.revealed {
    background: #2c5282;
    box-shadow: none;
    transform: none;
}

.cell.flagged::after {
    content: "🚩";
}

.cell.mine {
    background: #c53030;
}

.cell.mine::after {
    content: "💣";
}

.number-1 { color: #4299e1; }
.number-2 { color: #48bb78; }
.number-3 { color: #e53e3e; }
.number-4 { color: #805ad5; }
.number-5 { color: #d69e2e; }
.number-6 { color: #38a169; }
.number-7 { color: #b83280; }
.number-8 { color: #0bc5ea; }

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.btn {
    background: linear-gradient(to right, #ffcc00, #ff9500);
    color: #1a202c;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 12px 35px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(255, 204, 0, 0.4);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 204, 0, 0.6);
}

.btn:active {
    transform: translateY(1px);
}

.cell.question::after {
    content: "?";
    color: #ffcc00;
    font-weight: bold;
}

.cell.double-click {
    animation: pulse 0.5s;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.instructions {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-top: 30px;
    text-align: left;
}

.instructions h3 {
    color: #ffcc00;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.instructions ul {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.game-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #ffcc00;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    z-index: 100;
    max-width: 90%;
    display: none;
}

.game-message h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #ffcc00;
}

.game-message p {
    font-size: 1.4rem;
    margin-bottom: 30px;
}

.game-message .btn {
    margin: 0 auto;
}

footer {
    margin-top: 30px;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Estilos para diferentes niveles */
.easy .cell { width: 30px; height: 30px; font-size: 0.9rem; }
.medium .cell { width: 20px; height: 20px; font-size: 0.7rem; }
.hard .cell { width: 18px; height: 18px; font-size: 0.6rem; }

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .difficulty-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .stat-box {
        padding: 8px 15px;
        min-width: 100px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .btn {
        padding: 10px 25px;
        font-size: 1rem;
    }

    .cell {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    .easy .cell { width: 20px; height: 20px; }
    .medium .cell { width: 15px; height: 15px; }
    .hard .cell { width: 10px; height: 10px; }
}