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

body {
    background-color: #e6f3ff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: Arial, sans-serif;
}

.container {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(44, 82, 130, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 400px;
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 5px;
}

.mines-count, .timer {
    font-size: 1.2em;
    font-weight: bold;
    color: #2c5282;
}

#board {
    display: grid;
    gap: 1px;
    background-color: #999;
    border: 1px solid #999;
}

.cell {
    width: 30px;
    height: 30px;
    background-color: #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    font-size: 16px;
}

.cell:hover {
    background-color: #ddd;
}

.cell.revealed {
    background-color: #eee;
}

.cell.mine {
    background-color: #ff4444;
}

.cell.mine::after {
    content: "";
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='8' fill='%23333'/%3E%3Cpath d='M12 4v3M12 17v3M20 12h-3M7 12H4M18 6l-2 2M8 16l-2 2M18 18l-2-2M8 8L6 6' stroke='%23333' stroke-width='2'/%3E%3Ccircle cx='10' cy='10' r='1.5' fill='%23fff'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.cell.revealed.mine.exploded::after {
    content: "";
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='8' fill='%23ff4444'/%3E%3Cpath d='M12 4v3M12 17v3M20 12h-3M7 12H4M18 6l-2 2M8 16l-2 2M18 18l-2-2M8 8L6 6' stroke='%23ff4444' stroke-width='2'/%3E%3Ccircle cx='10' cy='10' r='1.5' fill='%23fff'/%3E%3Cpath d='M9 13c0 1 1.5 2 3 2s3-1 3-2' stroke='%23fff' stroke-width='1' fill='none'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.cell.flagged::after {
    content: "🚩";
    font-size: 18px;
}

.cell.wrong-flag {
    background-color: #ffd700;
}

.cell.wrong-flag::after {
    content: "❌";
}

.difficulty {
    display: flex;
    gap: 10px;
}

.difficulty button {
    padding: 8px 16px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #e2e8f0;
    color: #2d3748;
    transition: background-color 0.3s;
}

.difficulty button.active {
    background-color: #2c5282;
    color: white;
}

.difficulty button:hover {
    background-color: #cbd5e0;
}

.button-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

#start-button, .home-button {
    padding: 10px 20px;
    font-size: 1.1em;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    text-align: center;
    flex: 1;
}

#start-button {
    background-color: #4CAF50;
}

.home-button {
    background-color: #2c5282;
}

#start-button:hover {
    background-color: #45a049;
}

.home-button:hover {
    background-color: #1a365d;
}

/* 숫자별 색상과 아이콘 */
.cell[data-number="1"] { color: #2196F3; }
.cell[data-number="2"] { color: #4CAF50; }
.cell[data-number="3"] { color: #F44336; }
.cell[data-number="4"] { color: #9C27B0; }
.cell[data-number="5"] { color: #FF9800; }
.cell[data-number="6"] { color: #009688; }
.cell[data-number="7"] { color: #795548; }
.cell[data-number="8"] { color: #607D8B; }

/* 게임 오버 시 효과 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.game-over .mine {
    animation: shake 0.2s ease-in-out;
}

/* 셀 호버 효과 */
.cell:not(.revealed):hover {
    background-color: #ddd;
    transform: scale(1.05);
    transition: transform 0.1s ease-in-out;
}

/* 클릭 효과 */
.cell:active {
    transform: scale(0.95);
} 