* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
    margin: 0;
    padding: 10px;
}

#game {
    text-align: center;
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

h1 {
    margin: 0;
    font-size: 24px;
}

#settings-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: background-color 0.2s;
}

#settings-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

#settings-panel {
    margin-bottom: 10px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 200px;
    opacity: 1;
}

#settings-panel.hidden {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

.settings-content {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: inline-block;
}

#board {
    display: grid;
    gap: 2px;
    margin: 0 auto;
    width: fit-content;
}

.cell {
    width: 40px;
    height: 40px;
    background-color: #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 18px;
    user-select: none;
    -webkit-user-select: none;
}

.cell.revealed {
    background-color: #bbb;
    cursor: default;
}

.cell.revealed.mine {
    background-color: red;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row label {
    font-size: 14px;
    white-space: nowrap;
}

.form-row input {
    width: 60px;
    padding: 4px 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

@media (max-width: 400px) {
    .cell {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}
