/* 2048 — 游戏专用样式 */

.hero-art-card {
  padding: 24px;
}

.mini-2048 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: #bbada0;
}

.mini-tile {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: clamp(0.8rem, 3vw, 1.2rem);
  font-weight: 800;
  line-height: 1;
}

.mini-tile.mempty { background: #cdc1b4; }
.mini-tile.m2 { background: #eee4da; color: #4b3621; }
.mini-tile.m4 { background: #ede0c8; color: #4b3621; }
.mini-tile.m8 { background: #f2b179; color: #3b2415; }
.mini-tile.m16 { background: #f59563; color: #3b2415; }
.mini-tile.m32 { background: #c2410c; color: #ffffff; }
.mini-tile.m64 { background: #b91c1c; color: #ffffff; }
.mini-tile.m128 { background: #edcf72; color: #3b2f13; }

.mini-caption {
  margin: 14px 0 0;
  color: #78716c;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}

.board-frame {
  display: flex;
  justify-content: center;
  padding: 4px;
}

.board {
  width: min(100%, 460px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 2vw, 11px);
  padding: clamp(7px, 2.4vw, 12px);
  border-radius: 14px;
  background: #bbada0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  touch-action: none;
  user-select: none;
  cursor: default;
}

.board:focus-visible {
  outline: 3px solid #92400e;
  outline-offset: 4px;
}

.tile {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: clamp(5px, 1.5vw, 9px);
  background: #cdc1b4;
  color: #4b3621;
  font-size: clamp(1.15rem, 6.5vw, 2.35rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.05em;
}

.tile.len-3 {
  font-size: clamp(0.95rem, 5.2vw, 1.9rem);
}

.tile.len-4 {
  font-size: clamp(0.78rem, 4.4vw, 1.55rem);
}

.tile-2 { background: #eee4da; color: #4b3621; }
.tile-4 { background: #ede0c8; color: #4b3621; }
.tile-8 { background: #f2b179; color: #3b2415; }
.tile-16 { background: #f59563; color: #3b2415; }
.tile-32 { background: #f67c5f; color: #ffffff; }
.tile-64 { background: #f65e3b; color: #ffffff; }
.tile-128 { background: #edcf72; color: #3b2f13; }
.tile-256 { background: #edcc61; color: #3b2f13; }
.tile-512 { background: #edc850; color: #3b2f13; }
.tile-1024 { background: #edc53f; color: #3b2f13; }
.tile-2048 { background: #edc22e; color: #3b2f13; }
.tile-super { background: #3c3a32; color: #ffffff; }

.tile-new {
  animation: tile-appear 0.16s ease-out;
}

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

@keyframes tile-appear {
  from { opacity: 0; transform: scale(0.72); }
  to { opacity: 1; transform: scale(1); }
}

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

.game-status.is-win {
  color: #92400e;
  font-weight: 800;
}

.game-status.is-over {
  color: #b91c1c;
  font-weight: 800;
}

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

  .hero-art {
    display: none;
  }
}

@media (forced-colors: active) {
  .board,
  .tile,
  .mini-2048,
  .mini-tile {
    border: 1px solid ButtonText;
  }

  .tile {
    color: ButtonText;
    background: ButtonFace;
  }
}
