body {
    background-color: #faf8ef;
    color: #776e65;
    font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    user-select: none;
    touch-action: none;
}

h1 {
    font-size: 48px;
    margin: 0 0 10px 0;
}

.score-board {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.score-container {
    background: #bbada0;
    padding: 8px 20px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    border-radius: 4px;
    text-align: center;
    min-width: 90px;
}

.best-container {
    background: #8f7a66;
}

/* 4x4 ì˜¤ë¦¬ì§€ë„ í¬ê¸° ì„¸íŒ… */
#game-board {
    width: 90vw;
    height: 90vw;
    max-width: 400px;
    max-height: 400px;
    background-color: #bbada0;
    border-radius: 6px;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 12px;
    position: relative;
    box-sizing: border-box;
}

.cell {
    background-color: rgba(238, 228, 218, 0.35);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px; /* 4x4 í¬ê¸°ì— ë§žê²Œ ê¸€ìž í¬ê¸° ì—…ê·¸ë ˆì´ë“œ */
    font-weight: bold;
    color: #776e65;
    position: relative;
    box-sizing: border-box;
}

/* ì• ë‹ˆë©”ì´ì…˜ */
@keyframes appearance {
    0% { opacity: 0; transform: scale(0); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.tile-new {
    animation: appearance 0.2s ease-in-out;
}

.tile-merged {
    animation: pop 0.15s ease-in-out;
}

/* ì˜¤ë¦¬ì§€ë„ ìƒ‰ìƒ ìŠ¤ì¼€ì¼ ë° ê¸€ìž ì„¸íŒ… */
.tile-2 { background: #eee4da; color: #776e65; }
.tile-4 { background: #ede0c8; color: #776e65; }
.tile-8 { background: #f2b179; color: #f9f6f2; }
.tile-16 { background: #f59563; color: #f9f6f2; }
.tile-32 { background: #f67c5f; color: #f9f6f2; }
.tile-64 { background: #f65e3b; color: #f9f6f2; }
.tile-128 { background: #edcf72; color: #f9f6f2; font-size: 28px; }
.tile-256 { background: #edcc61; color: #f9f6f2; font-size: 28px; }
.tile-512 { background: #edc850; color: #f9f6f2; font-size: 28px; }
.tile-1024 { background: #edc53f; color: #f9f6f2; font-size: 22px; }
.tile-2048 { background: #edc22e; color: #f9f6f2; font-size: 22px; }
.tile-super { background: #3c3a32; color: #f9f6f2; font-size: 18px; }

.game-overlay {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(238, 228, 218, 0.85);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    z-index: 10;
    text-align: center;
}

.game-overlay p {
    font-size: 36px;
    font-weight: bold;
    margin: 0 0 10px 0;
}

.game-overlay span {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 500;
}

.action-btn {
    background: #8f7a66;
    color: #f9f6f2;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
}
.action-btn:hover { background: #9f8a76; }
