* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    touch-action: none; /* Prevent default touch actions */
}

html, body {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background-color: #faf8ef;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-touch-callout: none; /* Prevent callout to copy image */
    -webkit-user-select: none; /* Prevent text selection */
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overscroll-behavior-y: none; /* Prevent pull-to-refresh */
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 520px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 36px !important;
    }

    .tile {
        height: 70px !important;
        font-size: 28px !important;
    }

    .tile[data-value="128"],
    .tile[data-value="256"],
    .tile[data-value="512"] {
        font-size: 24px !important;
    }

    .tile[data-value="1024"],
    .tile[data-value="2048"] {
        font-size: 20px !important;
    }
}

h1 {
    font-size: 48px;
    color: #776e65;
    margin-bottom: 20px;
}

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

.scores {
    display: flex;
    gap: 10px;
}

.score-box {
    background: #bbada0;
    padding: 10px 20px;
    border-radius: 6px;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-box span:first-child {
    font-size: 14px;
}

.score-box span:last-child {
    font-size: 20px;
    font-weight: bold;
}

#new-game {
    background: #8f7a66;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}

.game-board {
    background: #bbada0;
    border-radius: 6px;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    position: relative;
    touch-action: none !important;
}

.tile {
    background: #cdc1b4;
    height: 100px;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 36px;
    font-weight: bold;
    color: #776e65;
    transition: all 0.15s ease;
}

.tile[data-value="2"] { background: #eee4da; }
.tile[data-value="4"] { background: #ede0c8; }
.tile[data-value="8"] { background: #f2b179; color: #f9f6f2; }
.tile[data-value="16"] { background: #f59563; color: #f9f6f2; }
.tile[data-value="32"] { background: #f67c5f; color: #f9f6f2; }
.tile[data-value="64"] { background: #f65e3b; color: #f9f6f2; }
.tile[data-value="128"] { background: #edcf72; color: #f9f6f2; font-size: 32px; }
.tile[data-value="256"] { background: #edcc61; color: #f9f6f2; font-size: 32px; }
.tile[data-value="512"] { background: #edc850; color: #f9f6f2; font-size: 32px; }
.tile[data-value="1024"] { background: #edc53f; color: #f9f6f2; font-size: 28px; }
.tile[data-value="2048"] { background: #edc22e; color: #f9f6f2; font-size: 28px; } 

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.language-select {
    padding: 8px 12px;
    font-size: 14px;
    border: 2px solid #bbada0;
    border-radius: 6px;
    background-color: #faf8ef;
    color: #776e65;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease;
}

.language-select:hover {
    border-color: #8f7a66;
}

.language-select:focus {
    border-color: #8f7a66;
    box-shadow: 0 0 0 2px rgba(143, 122, 102, 0.2);
} 