@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
    /* Retro specific */
    --win-gray: #c0c0c0;
    --win-dark: #808080;
    --win-light: #ffffff;
    --win-black: #000000;
    --win-blue: #000080;
}

/* Shared CSS handles body background and text color */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    /* Prevent scrolling */
}

.container {
    /* Inherits flex column and 100vh from shared.css */
    align-items: center;
}

/* Game content centering */
.window {
    margin: auto;
    /* Centers the window in the available space */
    background-color: var(--win-gray);
    border: 2px solid;
    border-color: var(--win-light) var(--win-black) var(--win-black) var(--win-light);
    padding: 3px;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    max-width: 100vw;
    overflow-x: auto;
}

.title-bar {
    background: var(--win-blue);
    padding: 3px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.title-bar-text {
    color: white;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.title-bar-controls {
    display: flex;
    gap: 2px;
}

.title-bar-controls button {
    width: 16px;
    height: 14px;
    background: var(--win-gray);
    border: 1px solid;
    border-color: var(--win-light) var(--win-black) var(--win-black) var(--win-light);
    padding: 0;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.window-body {
    border: 2px solid;
    border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark);
    padding: 6px;
}

/* Game Status Bar */
.status-bar {
    border: 2px solid;
    border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark);
    padding: 4px 7px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--win-gray);
}

.counter {
    background: black;
    color: red;
    font-family: 'Courier New', monospace;
    /* Fallback */
    font-family: 'Press Start 2P', cursive;
    /* Digital look */
    font-size: 20px;
    padding: 2px 4px;
    border: 1px solid;
    border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark);
    min-width: 60px;
    text-align: center;
    line-height: 1.2;
}

.face-btn {
    width: 26px;
    height: 26px;
    font-size: 18px;
    background: var(--win-gray);
    border: 2px solid;
    border-color: var(--win-light) var(--win-black) var(--win-black) var(--win-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.face-btn:active {
    border-color: var(--win-black) var(--win-light) var(--win-light) var(--win-black);
    padding: 1px 0 0 1px;
    /* Shift content */
}

/* Game Board */
.game-board {
    display: grid;
    /* Grid template columns/rows will be set via JS */
    display: grid;
    border: 3px solid;
    border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark);
}

.cell {
    width: 24px;
    height: 24px;
    background: var(--win-gray);
    border: 2px solid;
    border-color: var(--win-light) var(--win-dark) var(--win-dark) var(--win-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    cursor: default;
    font-family: sans-serif;
}

.cell:active:not(.revealed) {
    border: none;
    padding: 2px;
    /* Simulate pressed */
    border-top: 1px solid var(--win-dark);
    border-left: 1px solid var(--win-dark);
}

.cell.revealed {
    border: 1px solid var(--win-dark);
    /* Flat look */
    border-color: var(--win-dark);
    border-width: 1px;
    padding: 0;
}

.cell.mine {
    background: red;
    /* Hit mine */
}

/* 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;
}

.menu-bar {
    margin-bottom: 6px;
    display: flex;
    justify-content: flex-start;
}

#difficulty-select {
    background: var(--win-gray);
    border: 2px solid;
    border-color: var(--win-light) var(--win-black) var(--win-black) var(--win-light);
    font-family: 'Segoe UI', sans-serif;
    font-size: 12px;
    padding: 2px 4px;
    outline: none;
    cursor: pointer;
    width: 100%;
}

#difficulty-select:active {
    border-color: var(--win-black) var(--win-light) var(--win-light) var(--win-black);
}

.instructions-card {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    text-align: center;
    max-width: 300px;
}

.instructions-card h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.instruction-row {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.key-combo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.mouse-btn {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.3);
}