/**
 * 2048 전용 스타일 (game2048.css)
 */

.game2048-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  margin: 0 auto;
}

/* 4×4 보드 */
.grid-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #bbada0;
  border-radius: var(--radius-md);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 12px;
  position: relative;
  box-shadow: var(--shadow);
  user-select: none;
}

.grid-cell {
  background: rgba(238, 228, 218, 0.35);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: clamp(22px, 5vw, 36px);
  font-weight: 800;
  font-family: var(--font-sans);
  transition: all 0.1s 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: clamp(18px, 4.2vw, 30px); }
.tile-256  { background: #edcc61; color: #f9f6f2; font-size: clamp(18px, 4.2vw, 30px); }
.tile-512  { background: #edc850; color: #f9f6f2; font-size: clamp(18px, 4.2vw, 30px); }
.tile-1024 { background: #edc53f; color: #f9f6f2; font-size: clamp(15px, 3.5vw, 24px); }
.tile-2048 { background: #edc22e; color: #f9f6f2; font-size: clamp(15px, 3.5vw, 24px); box-shadow: 0 0 16px rgba(237, 194, 46, 0.5); }
.tile-super { background: #3c3a32; color: #f9f6f2; font-size: clamp(14px, 3vw, 22px); }

/* 스폰 및 병합 애니메이션 */
.tile-new {
  animation: tileAppear 0.15s ease-out;
}

.tile-merged {
  animation: tilePop 0.18s ease-in-out;
}

@keyframes tileAppear {
  0% { opacity: 0; transform: scale(0); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes tilePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* 터치 제스처 도움말 안내 */
.swipe-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 500px) {
  .grid-container {
    padding: 8px;
    gap: 8px;
  }
}
