body {
    font-family: 'HakgyoansimNadeuriTTF-B', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background:
      radial-gradient(circle at 12% 8%, rgba(255, 211, 235, 0.62), transparent 34%),
      radial-gradient(circle at 88% 10%, rgba(139, 215, 255, 0.48), transparent 32%),
      linear-gradient(135deg, #fff7ec 0%, #eef8ff 50%, #f8f0ff 100%);
    min-height: 100vh;
}

.page-wrap {
    min-height: calc(100vh - 62px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 22px 16px 44px;
}

.game-container {
    background: rgba(255,255,255,0.76);
    border: 1px solid var(--my-line);
    padding: 22px;
    border-radius: 26px;
    box-shadow: var(--my-shadow);
    text-align: center;
    width: min(370px, 100%);
    backdrop-filter: blur(18px);
}

h1 {
    font-size: clamp(1.55rem, 5vw, 2rem);
    margin: 0 0 14px;
    color: #172033;
    letter-spacing: -0.04em;
}

#message {
    font-size: 0.96rem;
    margin: 14px 0 0;
    color: var(--my-muted);
    line-height: 1.5;
}

button {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 10px 14px;
    background-color: var(--my-pink);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 5px;
}

button:hover {
    background-color: #ff6fba;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(255,143,199,0.25);
}

#game-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 9px;
    background: rgba(119, 110, 101, 0.35);
    padding: 10px;
    border-radius: 16px;
    margin: 12px auto;
    width: 310px;
    height: 310px;
}

.grid {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.58);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 21px;
    font-weight: bold;
    color: #776e65;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.tile-2 { background: #eee4da; }
.tile-4 { background: #ede0c8; }
.tile-8 { background: #f2b179; color: #fff; }
.tile-16 { background: #f59563; color: #fff; }
.tile-32 { background: #f67c5f; color: #fff; }
.tile-64 { background: #f65e3b; color: #fff; }
.tile-128 { background: #edcf72; color: #fff; }
.tile-256 { background: #edcc61; color: #fff; }
.tile-512 { background: #edc850; color: #fff; }
.tile-1024 { background: #edc53f; color: #fff; font-size: 18px; }
.tile-2048 { background: #edc22e; color: #fff; font-size: 18px; }

#controls {
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.control-btn {
    font-size: 1.1rem;
    width: 56px;
    height: 39px;
    padding: 0;
}

@media (max-width: 420px) {
  #game-container { width: 280px; height: 280px; gap: 8px; }
  .grid { width: 58px; height: 58px; font-size: 19px; }
}
