/* /public/css/minigames/game-2048.css */

/**
 * 2048 미니게임 스타일
 */

.game-2048-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    gap: 1rem;
    max-height: calc(100vh - 150px); /* 뷰포트 높이에 맞춤 */
}

.game-2048-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 15px;
    background: var(--surface-light);
    border-radius: 12px;
    width: min(400px, calc(100vw - 40px)); /* 반응형 너비 */
    height: min(400px, calc(100vw - 40px)); /* 반응형 높이 */
    max-width: 90vw;
    max-height: calc(100vh - 400px); /* 다른 요소들을 위한 공간 확보 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    touch-action: none; /* 스와이프 시 브라우저 기본 동작 방지 */
    user-select: none; /* 텍스트 선택 방지 */
}

.game-2048-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: 8px;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    transition: all 0.15s ease;
}

/* 타일 색상 */
.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: 1.75rem;
}

.tile-256 {
    background: #edcc61;
    color: #f9f6f2;
    font-size: 1.75rem;
}

.tile-512 {
    background: #edc850;
    color: #f9f6f2;
    font-size: 1.75rem;
}

.tile-1024 {
    background: #edc53f;
    color: #f9f6f2;
    font-size: 1.5rem;
}

.tile-2048 {
    background: #edc22e;
    color: #f9f6f2;
    font-size: 1.5rem;
    box-shadow: 0 0 20px rgba(237, 194, 46, 0.5);
}

.tile-4096 {
    background: #3c3a32;
    color: #f9f6f2;
    font-size: 1.25rem;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .game-2048-container {
        padding: 0.5rem;
    }
    
    .game-2048-grid {
        width: 100%;
        max-width: 350px;
        height: auto;
        aspect-ratio: 1;
        gap: 8px;
        padding: 10px;
    }
    
    .game-2048-cell {
        font-size: 1.5rem;
    }
    
    .tile-128,
    .tile-256,
    .tile-512 {
        font-size: 1.25rem;
    }
    
    .tile-1024,
    .tile-2048 {
        font-size: 1rem;
    }
    
    .tile-4096 {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .game-2048-grid {
        max-width: 280px;
        gap: 6px;
        padding: 8px;
    }
    
    .game-2048-cell {
        font-size: 1.25rem;
    }
    
    .tile-128,
    .tile-256,
    .tile-512 {
        font-size: 1rem;
    }
    
    .tile-1024,
    .tile-2048 {
        font-size: 0.85rem;
    }
    
    .tile-4096 {
        font-size: 0.75rem;
    }
}
