/* ===== MINESWEEPER LAUNCH BUTTON ===== */
#ms-launch-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 52px;
    height: 52px;
    background: #c0c0c0;
    border-top: 3px solid #ffffff;
    border-left: 3px solid #ffffff;
    border-bottom: 3px solid #808080;
    border-right: 3px solid #808080;
    cursor: pointer;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 1px 1px 0 #000;
    user-select: none;
    transition: none;
}
#ms-launch-btn:active {
    border-top: 3px solid #808080;
    border-left: 3px solid #808080;
    border-bottom: 3px solid #ffffff;
    border-right: 3px solid #ffffff;
    box-shadow: none;
}
#ms-launch-btn:hover {
    background: #d0d0d0;
}

/* ===== OVERLAY ===== */
#ms-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
#ms-overlay.ms-open {
    display: flex;
}

/* ===== WINDOW ===== */
#ms-window {
    background: #c0c0c0;
    border-top: 3px solid #ffffff;
    border-left: 3px solid #ffffff;
    border-bottom: 3px solid #808080;
    border-right: 3px solid #808080;
    box-shadow: 2px 2px 0 #000000;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    min-width: 280px;
    user-select: none;
    position: relative;
}

/* ===== TITLE BAR ===== */
#ms-titlebar {
    background: linear-gradient(to right, #000080, #1084d0);
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
}
#ms-titlebar-left {
    display: flex;
    align-items: center;
    gap: 5px;
}
#ms-titlebar span {
    font-size: 12px;
}
#ms-close-btn {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #808080;
    border-right: 2px solid #808080;
    color: #000;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    padding-bottom: 2px;
}
#ms-close-btn:active {
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-bottom: 2px solid #ffffff;
    border-right: 2px solid #ffffff;
}

/* ===== MENU BAR ===== */
#ms-menubar {
    display: flex;
    padding: 2px 4px 0;
    font-size: 12px;
    border-bottom: 1px solid #808080;
    position: relative;
}
.ms-menu-item {
    padding: 2px 6px;
    cursor: pointer;
    position: relative;
}
.ms-menu-item:hover {
    background: #000080;
    color: #fff;
}
.ms-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #808080;
    border-right: 2px solid #808080;
    box-shadow: 2px 2px 0 #000;
    z-index: 100;
    min-width: 140px;
    white-space: nowrap;
}
.ms-menu-item:hover .ms-dropdown,
.ms-menu-item.active .ms-dropdown {
    display: block;
}
.ms-dropdown-item {
    padding: 4px 20px 4px 24px;
    font-size: 12px;
    cursor: pointer;
    color: #000;
}
.ms-dropdown-item:hover {
    background: #000080;
    color: #fff;
}
.ms-dropdown-item.ms-checked::before {
    content: '✓';
    position: absolute;
    left: 8px;
}
.ms-dropdown-sep {
    border-top: 1px solid #808080;
    border-bottom: 1px solid #ffffff;
    margin: 3px 4px;
}

/* ===== CONTENT AREA ===== */
#ms-content {
    padding: 8px;
}

/* ===== INFO PANEL ===== */
#ms-info-panel {
    background: #c0c0c0;
    border-top: 3px solid #808080;
    border-left: 3px solid #808080;
    border-bottom: 3px solid #ffffff;
    border-right: 3px solid #ffffff;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* ===== LCD DISPLAY ===== */
.ms-lcd {
    background: #000;
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-size: 22px;
    font-weight: bold;
    padding: 2px 6px;
    min-width: 52px;
    text-align: right;
    letter-spacing: 2px;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-bottom: 2px solid #ffffff;
    border-right: 2px solid #ffffff;
    display: inline-block;
}

/* ===== SMILEY BUTTON ===== */
#ms-smiley {
    width: 26px;
    height: 26px;
    background: #c0c0c0;
    border-top: 3px solid #ffffff;
    border-left: 3px solid #ffffff;
    border-bottom: 3px solid #808080;
    border-right: 3px solid #808080;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 1px 1px 0 #000;
}
#ms-smiley:active {
    border-top: 3px solid #808080;
    border-left: 3px solid #808080;
    border-bottom: 3px solid #ffffff;
    border-right: 3px solid #ffffff;
    box-shadow: none;
}

/* ===== GRID CONTAINER ===== */
#ms-grid-wrap {
    border-top: 3px solid #808080;
    border-left: 3px solid #808080;
    border-bottom: 3px solid #ffffff;
    border-right: 3px solid #ffffff;
    display: inline-block;
    line-height: 0;
}

#ms-grid {
    display: inline-grid;
    gap: 0;
}

/* ===== CELL ===== */
.ms-cell {
    width: 22px;
    height: 22px;
    background: #c0c0c0;
    border-top: 3px solid #ffffff;
    border-left: 3px solid #ffffff;
    border-bottom: 3px solid #808080;
    border-right: 3px solid #808080;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}
.ms-cell:active:not(.ms-revealed):not(.ms-flagged) {
    border: 1px solid #808080;
    border-top-color: #808080;
    border-left-color: #808080;
    background: #c0c0c0;
}
.ms-cell.ms-revealed {
    border: 1px solid #808080;
    background: #c0c0c0;
    cursor: default;
}
.ms-cell.ms-flagged {
    cursor: pointer;
}
.ms-cell.ms-mine-hit {
    background: #ff0000;
}

/* ===== NUMBER COLORS ===== */
.ms-n1 { color: #0000ff; }
.ms-n2 { color: #007b00; }
.ms-n3 { color: #ff0000; }
.ms-n4 { color: #00007b; }
.ms-n5 { color: #7b0000; }
.ms-n6 { color: #007b7b; }
.ms-n7 { color: #000000; }
.ms-n8 { color: #7b7b7b; }

/* ===== STATUS BAR ===== */
#ms-statusbar {
    border-top: 2px solid #808080;
    margin-top: 6px;
    padding: 3px 6px;
    font-size: 11px;
    color: #000;
    display: flex;
    gap: 8px;
}
#ms-statusbar .ms-status-pane {
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-bottom: 1px solid #ffffff;
    border-right: 1px solid #ffffff;
    padding: 1px 4px;
    flex: 1;
}

/* ===== WIN/LOSE OVERLAY ===== */
#ms-result-msg {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #c0c0c0;
    border-top: 3px solid #ffffff;
    border-left: 3px solid #ffffff;
    border-bottom: 3px solid #808080;
    border-right: 3px solid #808080;
    padding: 20px 30px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 2px 2px 0 #000;
    z-index: 10;
}
#ms-result-msg button {
    margin-top: 12px;
    display: block;
    width: 100%;
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #808080;
    border-right: 2px solid #808080;
    padding: 4px 16px;
    font-size: 12px;
    cursor: pointer;
    font-family: 'MS Sans Serif', Arial, sans-serif;
}
#ms-result-msg button:active {
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-bottom: 2px solid #ffffff;
    border-right: 2px solid #ffffff;
}