.game2048-page-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.game2048-head {
  padding-bottom: 10px;
}

.game2048-stage-card {
  padding: 18px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.44), transparent 28%),
    linear-gradient(180deg, rgba(255, 251, 247, 0.94), rgba(243, 236, 228, 0.96));
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--moyu-accent-deep);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compact-list li:last-child {
  margin-bottom: 0;
}

.game2048-topbar,
.score-stack,
.action-stack,
.status-strip,
.game2048-controls-head {
  display: flex;
  gap: 12px;
}

.game2048-topbar {
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.score-stack {
  flex: 1 1 auto;
}

.action-stack {
  flex: 0 0 132px;
  flex-direction: column;
}

.score-card {
  flex: 1 1 0;
  padding: 14px 16px;
  border-radius: 22px;
  border: 1px solid rgba(79, 57, 37, 0.08);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.best-card {
  background: linear-gradient(135deg, rgba(255, 201, 90, 0.36), rgba(255, 255, 255, 0.9));
}

.score-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--moyu-muted);
}

.score-card strong {
  display: block;
  font-size: clamp(1.4rem, 4vw, 2rem);
  line-height: 1;
}

.action-stack .touch-button {
  width: 100%;
}

.action-stack .touch-button[disabled] {
  opacity: 0.45;
}

.status-strip {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(244, 124, 56, 0.12);
  color: var(--moyu-accent-deep);
  font-size: 0.8rem;
  font-weight: 800;
}

.status-pill[data-tone="good"] {
  background: rgba(120, 212, 189, 0.18);
  color: #1c705a;
}

.status-pill[data-tone="warn"] {
  background: rgba(255, 201, 90, 0.2);
  color: #936415;
}

.status-pill[data-tone="danger"] {
  background: rgba(238, 102, 117, 0.18);
  color: #b33d4b;
}

.stage-copy {
  margin: 0;
  flex: 1 1 200px;
  color: var(--moyu-muted);
  line-height: 1.6;
  font-size: 0.92rem;
}

.board-panel {
  margin-bottom: 16px;
}

.board-shell {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.28), transparent 28%),
    linear-gradient(180deg, #b8997d 0%, #a88465 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 18px 40px rgba(92, 61, 35, 0.18);
  touch-action: none;
}

.board-grid,
.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.board-grid {
  aspect-ratio: 1 / 1;
}

.tile-grid {
  position: absolute;
  inset: 14px;
}

.board-slot,
.tile-card {
  border-radius: 20px;
  aspect-ratio: 1 / 1;
}

.board-slot {
  background: rgba(255, 245, 235, 0.24);
  box-shadow: inset 0 1px 1px rgba(82, 55, 32, 0.14);
}

.tile-card {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
}

.tile-value {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 18px rgba(92, 61, 35, 0.12);
}

.tile-card.is-empty .tile-value {
  background: transparent;
  box-shadow: none;
}

.tile-card.is-new .tile-value {
  animation: tile-pop 180ms ease;
}

.tile-card.is-merged .tile-value {
  animation: tile-bounce 220ms ease;
}

.tile-value[data-value="0"] {
  visibility: hidden;
}

.tile-value[data-value="2"] {
  background: #f7f0e8;
  color: #67574b;
}

.tile-value[data-value="4"] {
  background: #f3e6d4;
  color: #665142;
}

.tile-value[data-value="8"] {
  background: #f9b26d;
  color: #fffaf5;
}

.tile-value[data-value="16"] {
  background: #f59b59;
  color: #fffaf5;
}

.tile-value[data-value="32"] {
  background: #f87f5b;
  color: #fffaf5;
}

.tile-value[data-value="64"] {
  background: #ef6a4f;
  color: #fffaf5;
}

.tile-value[data-value="128"] {
  background: linear-gradient(135deg, #f8d772, #edbf51);
  color: #4d3416;
}

.tile-value[data-value="256"] {
  background: linear-gradient(135deg, #f6cf5a, #e0a934);
  color: #4d3416;
}

.tile-value[data-value="512"] {
  background: linear-gradient(135deg, #80c1ff, #5f98f0);
  color: #ffffff;
}

.tile-value[data-value="1024"] {
  background: linear-gradient(135deg, #92b2ff, #6e7ff6);
  color: #ffffff;
}

.tile-value[data-value="2048"] {
  background: linear-gradient(135deg, #9ee8c4, #44bf7e);
  color: #143e2b;
}

.tile-value[data-value="4096"],
.tile-value[data-value="8192"],
.tile-value[data-value="16384"] {
  background: linear-gradient(135deg, #6d6fef, #3945b8);
  color: #ffffff;
}

.tile-value[data-digits="1"] { font-size: clamp(2rem, 10vw, 3rem); }
.tile-value[data-digits="2"] { font-size: clamp(1.8rem, 9vw, 2.6rem); }
.tile-value[data-digits="3"] { font-size: clamp(1.5rem, 7vw, 2.15rem); }
.tile-value[data-digits="4"] { font-size: clamp(1.2rem, 6vw, 1.8rem); }
.tile-value[data-digits="5"] { font-size: clamp(1rem, 5vw, 1.45rem); }

.board-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(52, 35, 20, 0.28);
  backdrop-filter: blur(8px);
}

.board-overlay.hidden {
  display: none;
}

.board-overlay-card {
  width: min(100%, 296px);
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 251, 246, 0.94);
  border: 1px solid rgba(79, 57, 37, 0.1);
  box-shadow: 0 18px 42px rgba(52, 35, 20, 0.16);
  text-align: center;
}

.board-overlay-tag {
  margin: 0 0 8px;
  color: var(--moyu-accent-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.board-overlay-card h2 {
  margin: 0 0 10px;
  font-size: 1.45rem;
  line-height: 1.15;
}

.board-overlay-card p {
  margin: 0;
  color: var(--moyu-muted);
  line-height: 1.65;
}

.board-overlay-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.game2048-controls-card {
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(79, 57, 37, 0.08);
}

.game2048-controls-head {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.game2048-controls-head h2 {
  margin: 2px 0 0;
  font-size: 1.15rem;
}

.control-hint {
  color: var(--moyu-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.game2048-dpad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    ". up ."
    "left core right"
    ". down .";
  gap: 10px;
}

.dpad-button.up { grid-area: up; }
.dpad-button.left { grid-area: left; }
.dpad-button.right { grid-area: right; }
.dpad-button.down { grid-area: down; }

.dpad-core {
  grid-area: core;
  display: grid;
  place-items: center;
  min-height: 56px;
  border-radius: 22px;
  color: var(--moyu-muted);
  font-size: 0.84rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(79, 57, 37, 0.16);
}

.game2048-insight-grid {
  display: grid;
  gap: 16px;
}

.game2048-info-card {
  border-radius: 26px;
}

@keyframes tile-pop {
  0% { transform: scale(0.72); }
  100% { transform: scale(1); }
}

@keyframes tile-bounce {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@media (max-width: 420px) {
  .game2048-stage-card {
    padding: 14px;
  }

  .game2048-topbar {
    flex-direction: column;
  }

  .action-stack {
    width: 100%;
    flex: 1 1 auto;
  }

  .score-stack {
    width: 100%;
  }

  .score-card {
    min-width: 0;
  }
}

@media (max-width: 430px) {
  .game2048-page-content {
    gap: 14px;
  }

  .game2048-stage-card {
    border-radius: 26px;
  }

  .action-stack {
    gap: 8px;
  }

  .score-card {
    padding: 12px 13px;
    border-radius: 18px;
  }

  .board-shell {
    padding: 10px;
    border-radius: 22px;
  }

  .board-grid,
  .tile-grid {
    gap: 8px;
  }

  .tile-grid {
    inset: 10px;
  }

  .tile-value {
    border-radius: 16px;
  }
}
