/* 2048 게임 스타일 */
.game-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    min-height: 100vh;
    padding-bottom: calc(50px + 20px); /* 스크롤버튼 + 띠배너1번 + 띠배너여백 + 고정배너 + 여백 */
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-title {
    font-size: 42px;
    font-weight: 700;
    color: #2D2D2D;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8), 0 0 10px rgba(255, 182, 193, 0.5);
}

.game-subtitle {
    font-size: 18px;
    color: #5A5A5A;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* 게임 정보 */
.game-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 182, 193, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-label {
    font-size: 14px;
    color: #5A5A5A;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.info-value {
    font-size: 24px;
    font-weight: 700;
    color: #2D2D2D;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
}

/* 게임 영역 */
.game-area {
    background: white;
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

/* 게임 보드 */
.game-board {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    background: #bbada0;
    border-radius: var(--radius-md);
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 빈 셀 */
.cell {
    background: #eee4da;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
}

/* 타일 */
.tile {
    position: absolute;
    width: calc((100% - 50px) / 4);
    height: calc((100% - 50px) / 4);
    background: #eee4da;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: #776e65;
    transition: left 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                top 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.2s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    will-change: left, top, transform;
}

/* 타일 숫자별 색상 */
.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: 24px; }
.tile-2048 { background: #edc22e; color: #f9f6f2; font-size: 24px; }
.tile-super { background: #3c3a32; color: #f9f6f2; font-size: 20px; }

/* 새로 생성된 타일 애니메이션 */
.tile-new {
    animation: pop 0.2s ease-in-out;
}

/* 합쳐진 타일 애니메이션 */
.tile-merged {
    animation: pop 0.2s ease-in-out;
    z-index: 10;
}

@keyframes pop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 게임 오버레이 */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    z-index: 10;
}

.game-overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 40px;
}

.overlay-content h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.overlay-content p {
    font-size: 18px;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.final-score {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
}

.final-score span {
    color: #FFD700;
    font-size: 32px;
}

.start-btn {
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.4);
    margin: 8px;
    display: inline-block;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 182, 193, 0.6);
}

.start-btn:active {
    transform: translateY(-1px);
}

/* 컨트롤 안내 */
.controls-info {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    text-align: center;
    color: #2D2D2D;
    font-size: 14px;
    border: 1px solid rgba(255, 182, 193, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.controls-info strong {
    color: #FF69B4;
    font-weight: 700;
}

/* 반응형 */
@media (max-width: 768px) {
    .game-container {
        padding: 40px 16px 80px;
        padding-bottom: calc(50px + 20px); /* 스크롤버튼 + 띠배너1번 + 띠배너여백 + 고정배너 + 여백 */
    }
    
    .game-title {
        font-size: 36px;
    }
    
    .game-subtitle {
        font-size: 16px;
    }
    
    .game-info {
        gap: 15px;
    }
    
    .info-item {
        padding: 10px 16px;
    }
    
    .info-value {
        font-size: 20px;
    }
    
    .game-area {
        padding: 20px;
    }
    
    .game-board {
        max-width: 100%;
    }
    
    .tile {
        font-size: 24px;
    }
    
    .tile-128, .tile-256, .tile-512 {
        font-size: 20px;
    }
    
    .tile-1024, .tile-2048 {
        font-size: 18px;
    }
    
    .tile-super {
        font-size: 16px;
    }
}
