body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

/* Game Container Styles */
#game-container {
    background-color: #c0c0c0;
    padding: 10px;
    border: 3px solid #fff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    width: 100%;
    margin-bottom: 10px;
    text-align: center;
}

h1 {
    font-size: 1.2rem;
    margin: 5px 0;
    color: #333;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.status-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #c0c0c0;
    border: 2px solid #808080;
    border-right-color: #fff;
    border-bottom-color: #fff;
    padding: 5px;
    margin-bottom: 10px;
}

#timer, #mine-count {
    background-color: #000;
    color: #f00;
    font-family: 'Courier New', Courier, monospace;
    font-size: 24px;
    font-weight: bold;
    padding: 2px 5px;
    min-width: 50px;
    text-align: right;
}

#reset-btn {
    font-size: 20px;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 2px solid #fff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    background-color: #c0c0c0;
}

#reset-btn:active {
    border: 2px solid #808080;
    border-right-color: #fff;
    border-bottom-color: #fff;
}

.difficulty-select {
    margin-bottom: 5px;
}

.instruction {
    font-size: 0.8rem;
    color: #555;
    margin: 5px 0;
}

/* Grid Styles */
#grid {
    display: grid;
    gap: 0;
    border: 3px solid #808080;
    border-right-color: #fff;
    border-bottom-color: #fff;
    background-color: #bdbdbd;
}

.cell {
    width: 20px;
    height: 20px;
    background-color: #c0c0c0;
    border: 2px solid #fff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: default;
    user-select: none;
}

.cell.revealed {
    border: 1px solid #808080;
    background-color: #bdbdbd;
}

.cell:active:not(.revealed):not(.flagged) {
    border: 1px solid #808080;
}

.cell.flagged {
    color: red;
}

.cell.mine {
    background-color: red;
    border: 1px solid #808080;
}

/* Number Colors */
.cell[data-num="1"] { color: blue; }
.cell[data-num="2"] { color: green; }
.cell[data-num="3"] { color: red; }
.cell[data-num="4"] { color: darkblue; }
.cell[data-num="5"] { color: darkred; }
.cell[data-num="6"] { color: teal; }
.cell[data-num="7"] { color: black; }
.cell[data-num="8"] { color: gray; }

/* Boss Mode Styles (Fake Excel) */
#boss-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    font-size: 11px;
}

.hidden {
    display: none !important;
}

.excel-header {
    background-color: #f3f3f3;
    border-bottom: 1px solid #ccc;
}

.excel-menu {
    padding: 5px 10px;
    border-bottom: 1px solid #e0e0e0;
}

.excel-toolbar {
    padding: 5px 10px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.excel-formula-bar {
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.excel-formula-bar input {
    flex-grow: 1;
    border: 1px solid #ccc;
    padding: 2px;
}

.excel-sheet {
    border-collapse: collapse;
    width: 100%;
    flex-grow: 1;
    background: #fff;
}

.excel-sheet th, .excel-sheet td {
    border: 1px solid #d4d4d4;
    padding: 2px 5px;
    text-align: left;
    height: 20px;
}

.excel-sheet thead th {
    background-color: #e6e6e6;
    text-align: center;
    font-weight: normal;
    border-bottom: 1px solid #ccc;
}

.excel-sheet tbody th {
    background-color: #e6e6e6;
    text-align: center;
    font-weight: normal;
    border-right: 1px solid #ccc;
    width: 30px;
}

.excel-footer {
    background-color: #f0f0f0;
    border-top: 1px solid #ccc;
    padding: 2px;
    display: flex;
}

.sheet-tab {
    padding: 3px 10px;
    border: 1px solid #ccc;
    border-bottom: none;
    background-color: #e0e0e0;
    margin-right: 2px;
    border-radius: 3px 3px 0 0;
    cursor: pointer;
}

.sheet-tab.active {
    background-color: #fff;
    font-weight: bold;
    border-bottom: 2px solid #fff;
    margin-bottom: -1px;
}
