/* 2048/index.html 전용 스타일 (파스텔/미니멀 톤) */
.g2048-page {
    margin: 0;
    min-height: 100vh;
    background: #faf8ef;
    color: #776e65;
    font-family: 'Nanum Gothic', 'Apple SD Gothic Neo', sans-serif;
    display: flex;
    justify-content: center;
    padding: 24px 16px 40px;
    box-sizing: border-box;
}
.g2048-page *, .g2048-page *::before, .g2048-page *::after {
    box-sizing: border-box;
}

.g2048-wrap {
    width: 100%;
    max-width: 640px;
}

.g2048-back {
    display: inline-block;
    color: #9b8f83;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 16px;
}
.g2048-back:hover { color: #776e65; }

.g2048-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.g2048-title {
    font-size: 40px;
    font-weight: 800;
    color: #776e65;
    margin: 0;
}

.g2048-score-box {
    display: flex;
    gap: 8px;
}

.g2048-score-panel {
    background: #bbada0;
    border-radius: 6px;
    padding: 8px 16px;
    text-align: center;
    min-width: 64px;
}

.g2048-score-label {
    font-size: 11px;
    font-weight: 700;
    color: #eee4da;
    letter-spacing: 1px;
}

.g2048-score-value {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.g2048-desc {
    font-size: 14px;
    color: #776e65;
    line-height: 1.5;
    margin: 0 0 12px;
}
.g2048-desc strong { color: #f67c5f; }

.g2048-btn {
    display: inline-block;
    border: none;
    border-radius: 6px;
    background: #8f7a66;
    color: #f9f6f2;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 18px;
    cursor: pointer;
}
.g2048-btn:hover { background: #7a6656; }

.g2048-newgame-btn { margin-bottom: 16px; }

.g2048-layout {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.g2048-board-area {
    position: relative;
    flex: 0 0 auto;
}

.g2048-board {
    position: relative;
    width: 320px;
    height: 320px;
    background: #bbada0;
    border-radius: 8px;
    padding: 8px;
}

.g2048-grid-bg {
    position: absolute;
    inset: 8px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 8px;
}

.g2048-cell {
    background: rgba(238, 228, 218, 0.35);
    border-radius: 4px;
}

.g2048-tiles {
    position: absolute;
    inset: 8px;
}

.g2048-tile {
    position: absolute;
    width: calc(25% - 6px);
    height: calc(25% - 6px);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 28px;
    color: #776e65;
    background: #eee4da;
    transition: top 0.1s ease-in-out, left 0.1s ease-in-out;
}

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

.g2048-tile-new { animation: g2048-appear 0.15s ease-in-out; }
.g2048-tile-merged { animation: g2048-pop 0.15s ease-in-out; }

@keyframes g2048-appear {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}
@keyframes g2048-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.g2048-overlay {
    position: absolute;
    inset: 0;
    background: rgba(238, 228, 218, 0.73);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.g2048-hidden { display: none; }

.g2048-overlay-box {
    text-align: center;
    padding: 16px;
}

.g2048-overlay-title {
    font-size: 26px;
    font-weight: 800;
    color: #776e65;
    margin: 0 0 8px;
}

.g2048-overlay-text {
    font-size: 15px;
    color: #776e65;
    margin: 0 0 12px;
}

.g2048-name-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.g2048-name-label {
    font-size: 12px;
    color: #9b8f83;
}

.g2048-name-input {
    font-family: inherit;
    font-size: 14px;
    padding: 8px 10px;
    border: 2px solid #bbada0;
    border-radius: 4px;
    text-align: center;
    width: 160px;
}

.g2048-save-msg {
    font-size: 12px;
    min-height: 16px;
    color: #8f7a66;
}

.g2048-side {
    flex: 0 0 auto;
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.g2048-panel {
    background: #eee4da;
    border-radius: 6px;
    padding: 12px;
}

.g2048-panel-label {
    font-size: 12px;
    font-weight: 700;
    color: #9b8f83;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.g2048-ranking-list {
    margin: 0;
    padding: 0 0 0 20px;
    font-size: 13px;
    line-height: 1.7;
    color: #776e65;
}
.g2048-ranking-empty { list-style: none; margin-left: -20px; color: #9b8f83; }

.g2048-ranking-more {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #8f7a66;
    text-decoration: none;
}
.g2048-ranking-more:hover { text-decoration: underline; }

.g2048-controls-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    line-height: 1.8;
    color: #776e65;
}

.g2048-key {
    display: inline-block;
    background: #776e65;
    color: #f9f6f2;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 11px;
    margin-right: 3px;
}

@media (max-width: 480px) {
    .g2048-board { width: 90vw; height: 90vw; max-width: 320px; max-height: 320px; }
    .g2048-title { font-size: 32px; }
    .g2048-side { width: 100%; max-width: 320px; }
}
