* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: white;
}

.back-home {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.back-home a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-home a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

.game-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 1000px;
}

.game-header h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
}

.info-item {
    text-align: center;
}

.info-label {
    display: block;
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.info-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #feca57;
}

.difficulty-selector {
    margin-bottom: 20px;
}

.difficulty-selector h3 {
    text-align: center;
    margin-bottom: 10px;
    color: #ccc;
}

.difficulty-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.difficulty-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.difficulty-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.difficulty-btn.active {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    border-color: transparent;
}

.game-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.game-board-container {
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding: 10px;
}

#gameBoard {
    display: inline-grid;
    gap: 2px;
    background: #333;
    padding: 5px;
    border-radius: 8px;
}

.cell {
    width: 30px;
    height: 30px;
    background: #ddd;
    border: 2px outset #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
}

.cell:hover:not(.revealed) {
    background: #eee;
}

.cell.revealed {
    background: #bbb;
    border-style: inset;
    cursor: default;
}

.cell.mine {
    background: #ff6b6b;
}

.cell.flagged {
    background: #feca57;
}

.cell.number-1 { color: #0000ff; }
.cell.number-2 { color: #008000; }
.cell.number-3 { color: #ff0000; }
.cell.number-4 { color: #000080; }
.cell.number-5 { color: #800000; }
.cell.number-6 { color: #008080; }
.cell.number-7 { color: #000; }
.cell.number-8 { color: #808080; }

.instructions {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.instructions h3 {
    margin-bottom: 10px;
    color: #feca57;
}

.instructions p {
    color: #ccc;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }

    .game-header h1 {
        font-size: 2rem;
    }

    .difficulty-buttons {
        flex-direction: column;
    }

    .cell {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }

    #gameBoard {
        gap: 1px;
    }
}
