.game-2048-section {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.game-2048-section .game-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

.game-2048-section .eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--color-accent, #f65e3b);
  margin-bottom: 0.25rem;
  font-weight: 700;
  text-transform: uppercase;
}

.game-2048-section h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text, #f9fafb);
  line-height: 1.1;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.game-2048-section h1 span {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-text-dim, #9ca3af);
}

.game-tag {
  font-size: 0.85rem;
  background: rgba(246, 94, 59, 0.15);
  color: #f65e3b;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(246, 94, 59, 0.3);
}

.game-2048-section .game-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 840px) {
  .game-2048-section .game-layout {
    grid-template-columns: 1fr;
  }
}

.play-area {
  display: flex;
  flex-direction: column;
  gap: 1.25krem;
  align-items: center;
}

.game-header-bar {
  width: 100%;
  max-width: 440px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scores-box {
  display: flex;
  gap: 0.75rem;
}

.score-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.score-label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: #9ca3af;
  font-weight: 700;
}

.score-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.btn-primary, .btn-sub {
  background: #f65e3b;
  color: #fff;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: #e04e2d;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-sub {
  background: rgba(255, 255, 255, 0.15);
}

.btn-sub:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Board */
.board-container {
  position: relative;
  width: 440px;
  height: 440px;
  background: #bbada0;
  border-radius: 12px;
  padding: 16px;
  box-sizing: border-box;
  touch-action: none;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

@media (max-width: 480px) {
  .board-container {
    width: 320px;
    height: 320px;
    padding: 12px;
  }
}

.grid-container {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  bottom: 16px;
}

@media (max-width: 480px) {
  .grid-container {
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
}

.grid-row {
  display: flex;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .grid-row {
    margin-bottom: 12px;
  }
}

.grid-row:last-child {
  margin-bottom: 0;
}

.grid-cell {
  width: 92px;
  height: 92px;
  margin-right: 16px;
  background: rgba(238, 228, 218, 0.35);
  border-radius: 6px;
}

@media (max-width: 480px) {
  .grid-cell {
    width: 63.5px;
    height: 63.5px;
    margin-right: 12px;
  }
}

.grid-cell:last-child {
  margin-right: 0;
}

.tile-container {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  bottom: 16px;
  pointer-events: none;
}

@media (max-width: 480px) {
  .tile-container {
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
}

.tile {
  position: absolute;
  width: 92px;
  height: 92px;
  background: #eee4da;
  border-radius: 6px;
  font-weight: 800;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease-in-out, background-color 120ms ease-in-out;
  color: #776e65;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.1);
}

@media (max-width: 480px) {
  .tile {
    width: 63.5px;
    height: 63.5px;
    font-size: 1.5rem;
  }
}

/* Tile Colors */
.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.4rem; }
.tile-2048 { background: #edc22e; color: #f9f6f2; font-size: 1.4rem; box-shadow: 0 0 25px rgba(237, 194, 46, 0.7); }
.tile-super { background: #3c3a32; color: #f9f6f2; font-size: 1.2rem; }

@media (max-width: 480px) {
  .tile-128, .tile-256, .tile-512 { font-size: 1.3rem; }
  .tile-1024, .tile-2048 { font-size: 1.05rem; }
  .tile-super { font-size: 0.95rem; }
}

.tile-new {
  animation: appear 200ms ease 100ms;
  animation-fill-mode: backwards;
}

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

.tile-merged {
  animation: pop 200ms ease;
  z-index: 10;
}

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

/* Game Message Overlay */
.game-message {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(238, 228, 218, 0.85);
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 12px;
  animation: fadeIn 300ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.game-message.game-won {
  background: rgba(237, 194, 46, 0.85);
}

.game-message.game-won p {
  color: #776e65;
}

.game-message p {
  font-size: 2rem;
  font-weight: 800;
  color: #776e65;
  margin-bottom: 1.5rem;
}

.message-actions {
  display: flex;
  gap: 1rem;
}

/* Sidebar */
.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.game-status-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
}

.game-status {
  font-size: 0.95rem;
  color: var(--color-text, #f9fafb);
  line-height: 1.5;
  margin: 0.25rem 0 0 0;
}

.how-to {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
}

.how-to h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  color: var(--color-text, #f9fafb);
  letter-spacing: 0.05em;
}

.how-to dl {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 0.85rem 0;
  font-size: 0.85rem;
}

.how-to dl div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  padding-bottom: 0.35rem;
}

.how-to dt {
  font-weight: 700;
  color: var(--color-accent, #f65e3b);
  font-family: monospace;
}

.how-to dd {
  margin: 0;
  color: var(--color-text-dim, #9ca3af);
  text-align: right;
}

.how-to p {
  font-size: 0.8rem;
  color: var(--color-text-dim, #9ca3af);
  line-height: 1.5;
  margin: 0;
}

.storage-note {
  font-size: 0.75rem;
  color: #fbbf24;
  margin-top: 0.5rem;
  text-align: center;
}
