:root {
    --bg-color: #faf8ef;
    --grid-bg: #bbada0;
    --tile-empty: #cdc1b4;
    --text-dark: #776e65;
    --text-light: #f9f6f2;
    --accent: #8f7a66;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    touch-action: none;
}

body {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    color: var(--text-dark);
}

#game-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 32px;
    font-weight: bold;
    margin: 0;
}

.score-container {
    display: flex;
    gap: 10px;
}

.score-box {
    background: var(--grid-bg);
    color: white;
    padding: 5px 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    font-size: 13px;
    min-width: 70px;
}

.score-box span {
    font-size: 20px;
}

#canvas-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--grid-bg);
    border-radius: 8px;
    padding: 12px;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#overlay, #start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(238, 228, 218, 0.73);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border-radius: 8px;
    z-index: 10;
    text-align: center;
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

#overlay-content, .start-content {
    padding: 20px;
}

h2 {
    font-size: 48px;
    margin-bottom: 10px;
}

p {
    font-size: 18px;
    margin-bottom: 20px;
}

button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.1s;
}

button:active {
    transform: scale(0.95);
}

@media (max-width: 400px) {
    h1 { font-size: 24px; }
    h2 { font-size: 32px; }
}