.window[data-window-id="minesweeper"] .window-body {
    overflow: hidden;
    background: #c0c0c0;
}

.xp-minesweeper {
    height: 100%;
    background: #c0c0c0;
    color: #000;
    font-family: Tahoma, "MS Sans Serif", sans-serif;
    font-size: 11px;
    display: flex;
    flex-direction: column;
}

.xp-menu-strip {
    height: 22px;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 1px 4px;
    border-bottom: 1px solid #808080;
    background: #ece9d8;
}

.xp-menu-strip button,
.xp-minesweeper-options button {
    font: inherit;
    border: 1px solid transparent;
    background: transparent;
    min-height: 18px;
    padding: 1px 8px;
    cursor: default;
}

.xp-menu-strip button:hover,
.xp-minesweeper-options button:hover,
.xp-minesweeper-options button.active {
    border-color: #316ac5;
    background: #e5f1fb;
}

.xp-minesweeper-shell {
    box-sizing: border-box;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-top: 1px solid #fff;
    overflow: hidden;
}

.xp-minesweeper-options {
    display: flex;
    gap: 4px;
    width: 100%;
    justify-content: center;
}

.xp-minesweeper-options button {
    border: 1px solid #808080;
    background: #d4d0c8;
    padding: 2px 7px;
}

.xp-minesweeper-options button.active {
    border-style: inset;
    background: #ece9d8;
    font-weight: 700;
}

.xp-minesweeper-panel {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080;
    background: #c0c0c0;
}

.xp-led {
    min-width: 48px;
    height: 28px;
    padding: 2px 4px;
    border: 2px solid;
    border-color: #404040 #dfdfdf #dfdfdf #404040;
    background: #050505;
    color: #ff1d16;
    font-family: "Courier New", monospace;
    font-size: 22px;
    font-weight: 700;
    line-height: 22px;
    text-align: right;
    letter-spacing: 1px;
}

.xp-face {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    background: #c0c0c0;
    box-shadow: 1px 1px 0 #000;
    color: #000;
    font-family: Tahoma, sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: default;
}

.xp-face:active {
    border-color: #808080 #fff #fff #808080;
    box-shadow: none;
    padding-top: 2px;
}

.xp-board-wrap {
    flex: 0 1 auto;
    min-height: 0;
    border: 3px solid;
    border-color: #808080 #fff #fff #808080;
    background: #808080;
    padding: 0;
    overflow: auto;
    max-width: 100%;
    max-height: calc(100% - 92px);
}

.xp-board {
    display: grid;
    grid-template-columns: repeat(var(--ms-cols), 18px);
    grid-template-rows: repeat(var(--ms-rows), 18px);
    width: max-content;
    background: #808080;
}

.xp-cell {
    box-sizing: border-box;
    width: 18px;
    min-width: 18px;
    max-width: 18px;
    height: 18px;
    min-height: 18px;
    max-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    background: #c0c0c0;
    color: #000;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    user-select: none;
    cursor: default;
    position: relative;
    padding: 0;
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

.xp-cell:focus-visible {
    outline: 1px dotted #000;
    outline-offset: -4px;
}

.xp-cell.revealed {
    border: 1px solid #808080;
    background: #c0c0c0;
}

.xp-cell.flagged::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 5px;
    width: 7px;
    height: 6px;
    background: #f00000;
    clip-path: polygon(0 0, 100% 20%, 0 60%);
}

.xp-cell.flagged::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 5px;
    width: 1px;
    height: 12px;
    background: #111;
    box-shadow: 0 10px 0 2px #111;
}

.xp-cell.question {
    color: #000080;
}

.xp-cell.mine-hit,
.xp-cell.mine-revealed {
    font-size: 0;
}

.xp-cell.mine-hit {
    background: #ff0000;
}

.xp-cell.mine-visible {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.xp-cell.mine-visible > span {
    filter: drop-shadow(1px 1px 0 rgba(255, 255, 255, 0.7));
}

.xp-cell.mine-hit::before,
.xp-cell.mine-revealed::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #111;
    box-shadow:
        -5px 0 0 -4px #111,
        5px 0 0 -4px #111,
        0 -5px 0 -4px #111,
        0 5px 0 -4px #111;
}

.xp-cell.wrong-flag::before {
    content: "X";
    color: #b00000;
    font-size: 14px;
    font-weight: 900;
}

.xp-cell[data-value="1"] { color: #0000ff; }
.xp-cell[data-value="2"] { color: #008000; }
.xp-cell[data-value="3"] { color: #ff0000; }
.xp-cell[data-value="4"] { color: #000080; }
.xp-cell[data-value="5"] { color: #800000; }
.xp-cell[data-value="6"] { color: #008080; }
.xp-cell[data-value="7"] { color: #000; }
.xp-cell[data-value="8"] { color: #808080; }

.xp-minesweeper-status {
    flex: 0 0 auto;
    width: 100%;
    min-height: 20px;
    padding: 3px 5px;
    border: 1px solid;
    border-color: #808080 #fff #fff #808080;
    background: #ece9d8;
    color: #1f1f1f;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
