:root {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --grid-line: #444;
    --grid-filled: #3b82f6; /* Blue-500 */
    --grid-empty: #262626;
    --grid-cross: #ef4444; /* Red-500 */
    --hint-bg: #333;
    --hint-text: #aaa;
    --accent: #3b82f6;
    --modal-bg: rgba(0, 0, 0, 0.8);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden; /* Prevent scroll on mobile */
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.controls-top button, .controls-bottom button, select {
    background: var(--hint-bg);
    border: none;
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
    margin-left: 5px;
}

.controls-top button:hover, .controls-bottom button:hover, select:hover {
    background: var(--grid-line);
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px; /* Max canvas size */
    aspect-ratio: 1;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    background-color: var(--grid-empty);
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    touch-action: none; /* Prevent browser handling of touch gestures */
}

.controls-bottom {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal.visible {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--hint-bg);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.hidden {
    display: none;
}
