.minesweeper-window {
    display: inline-flex;
    flex-direction: column;
    user-select: none;
    width: fit-content;
}

/* Override standard window content for Minesweeper */
.window[data-window="minesweeper"] {
    min-width: 0 !important;
    min-height: 0 !important;
    width: fit-content !important;
}

.window[data-window="minesweeper"] .content {
    background-color: #c0c0c0 !important;
    padding: 3px !important;
    overflow: hidden !important;
    width: fit-content !important;
    display: flex;
}

.menubar {
    display: flex;
    background: var(--win98-gray);
    padding: 2px 4px;
    border-bottom: 1px solid var(--win98-dark);
}

.menu-item {
    position: relative;
    padding: 2px 6px;
    cursor: default;
}

.menu-item:hover {
    background: var(--win98-blue);
    color: white;
}

.menu-item .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--win98-gray);
    border: 2px solid #000;
    box-shadow: 2px 2px 0 #000;
    z-index: 100;
    min-width: 120px;
}

.menu-item:hover .dropdown {
    display: block;
}

.dropdown div {
    padding: 4px 8px;
    color: black;
}

.dropdown div:hover {
    background: var(--win98-blue);
    color: white;
}

.minesweeper-board {
    background-color: #c0c0c0;
    padding: 6px;
    border-left: 3px solid #fff;
    border-top: 3px solid #fff;
    border-right: 3px solid #808080;
    border-bottom: 3px solid #808080;
}

.minesweeper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
    margin-bottom: 6px;
    border-left: 2px solid #808080;
    border-top: 2px solid #808080;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
}

.minesweeper-display {
    background-color: #000;
    color: #ff0000;
    font-family: "Courier New", Courier, monospace;
    font-weight: bold;
    font-size: 20px;
    padding: 2px 4px;
    min-width: 40px;
    text-align: right;
    border: 1px solid #808080;
}

.minesweeper-smiley {
    width: 26px;
    height: 26px;
    background-color: #c0c0c0;
    border-left: 2px solid #fff;
    border-top: 2px solid #fff;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
}

.minesweeper-smiley:active {
    border-left: 2px solid #808080;
    border-top: 2px solid #808080;
    border-right: 2px solid #c0c0c0;
    border-bottom: 2px solid #c0c0c0;
    padding-left: 1px;
    padding-top: 1px;
}

.minesweeper-grid {
    display: grid;
    grid-template-columns: repeat(9, 16px);
    grid-template-rows: repeat(9, 16px);
    border-left: 2px solid #808080;
    border-top: 2px solid #808080;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
}

.minesweeper-cell {
    width: 16px;
    height: 16px;
    border-left: 2px solid #fff;
    border-top: 2px solid #fff;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    cursor: default;
}

.minesweeper-cell.revealed {
    border: 1px solid #7b7b7b;
    background-color: #bdbdbd;
}

.minesweeper-cell.mine {
    background-color: red;
}

.minesweeper-cell.flagged::after {
    content: '🚩';
    font-size: 10px;
}

.minesweeper-cell.mine::after {
    content: '💣';
    font-size: 10px;
}

.cell-1 {
    color: blue;
}

.cell-2 {
    color: green;
}

.cell-3 {
    color: red;
}

.cell-4 {
    color: darkblue;
}

.cell-5 {
    color: darkred;
}

.cell-6 {
    color: teal;
}

.cell-7 {
    color: black;
}

.cell-8 {
    color: gray;
}