.game-2048-panel {
  max-width: 620px;
}

.board-2048 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.45rem, 2vw, 0.7rem);
  width: min(100%, 28rem);
  margin: 1.25rem auto 0;
  padding: clamp(0.45rem, 2vw, 0.7rem);
  border: 2px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface-soft);
  touch-action: none;
}

.board-2048:focus-visible {
  outline: 3px solid rgba(90, 164, 105, 0.45);
  outline-offset: 3px;
}

.tile-2048 {
  display: grid;
  aspect-ratio: 1;
  min-width: 0;
  place-items: center;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: clamp(1.15rem, 7vw, 2.2rem);
  font-weight: 900;
  line-height: 1;
}

.tile-2048[data-value="2"] { background: #fffaf3; }
.tile-2048[data-value="4"] { background: #fff0dc; }
.tile-2048[data-value="8"] { background: #ffd2a6; color: #6f3d16; }
.tile-2048[data-value="16"] { background: #ffb38c; color: #ffffff; }
.tile-2048[data-value="32"] { background: #ff8f8f; color: #ffffff; }
.tile-2048[data-value="64"] { background: var(--accent); color: #ffffff; }
.tile-2048[data-value="128"] { background: #d7c0ff; color: #38281f; font-size: clamp(1rem, 6vw, 2rem); }
.tile-2048[data-value="256"] { background: #b894ff; color: #ffffff; font-size: clamp(1rem, 6vw, 2rem); }
.tile-2048[data-value="512"] { background: #8f6ee8; color: #ffffff; font-size: clamp(1rem, 6vw, 2rem); }
.tile-2048[data-value="1024"] { background: var(--leaf); color: #ffffff; font-size: clamp(0.9rem, 5vw, 1.7rem); }
.tile-2048[data-value="2048"],
.tile-2048[data-value="4096"],
.tile-2048[data-value="8192"],
.tile-2048[data-value="16384"],
.tile-2048.is-max-tile {
  color: #ffffff;
  box-shadow: 0 0 0.75rem rgba(240, 98, 123, 0.28), inset 0 -0.25rem 0 rgba(56, 40, 31, 0.16);
  text-shadow: 0 1px 2px rgba(56, 40, 31, 0.32);
}
.tile-2048[data-value="2048"] { background: var(--accent-dark); font-size: clamp(0.9rem, 5vw, 1.7rem); }
.tile-2048[data-value="4096"] { background: #d9277c; font-size: clamp(0.84rem, 4.6vw, 1.55rem); }
.tile-2048[data-value="8192"] { background: linear-gradient(135deg, #7c4dff, #f062b6); font-size: clamp(0.84rem, 4.6vw, 1.55rem); }
.tile-2048[data-value="16384"] { background: linear-gradient(135deg, #238be6, #8f6ee8); font-size: clamp(0.72rem, 4vw, 1.32rem); }
.tile-2048.is-max-tile {
  background: linear-gradient(135deg, #f0627b 0%, #ffd166 34%, #5aa469 66%, #7c4dff 100%);
  font-size: clamp(0.66rem, 3.5vw, 1.15rem);
}

@media (max-width: 420px) {
  .board-2048 {
    width: 100%;
  }
}

.debug-2048 {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 0.5rem;
  background: rgba(255, 240, 220, 0.58);
}

.debug-2048-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.debug-2048-actions .button {
  min-height: 2.35rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
}
