/*! 由 ./zh/game/2048/index.html 内联 <style> 原样提取，勿手改（保持视觉一致） */

/*───Reset&Base───────────────────────────────────────────────*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: #faf8ef;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  user-select: none;
  -webkit-user-select: none;
}

/*───Container──────────────────────────────────────────────────*/
.container {
  width: 500px;
  max-width: 95vw;
}

/*───Header─────────────────────────────────────────────────────*/
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.title {
  font-size: 64px;
  font-weight: 800;
  color: #776e65;
  line-height: 1;
}
.scores {
  display: flex;
  gap: 8px;
}
.score-box {
  background: #bbada0;
  border-radius: 6px;
  padding: 8px 20px;
  text-align: center;
  min-width: 90px;
}
.score-box .label {
  font-size: 11px;
  font-weight: 700;
  color: #eee4da;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.score-box .value {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  margin-top: 2px;
}

/*───SubtitleRow───────────────────────────────────────────────*/
.subtitle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
}
.subtitle {
  font-size: 14px;
  color: #776e65;
}
.subtitle b {
  font-weight: 700;
}
.btn-group {
  display: flex;
  gap: 8px;
}
.new-game-btn, .lang-btn {
  background: #8f7a66;
  color: #f9f6f2;
  border: none;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.new-game-btn:hover, .lang-btn:hover {
  background: #9f8b77;
}
.new-game-btn:active, .lang-btn:active {
  transform: scale(0.97);
}

/*───Board──────────────────────────────────────────────────────*/
.board {
  position: relative;
  background: #bbada0;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  aspect-ratio: 1;
}
.cell {
  background: #cdc1b4;
  border-radius: 6px;
  aspect-ratio: 1;
}
.tile-container {
  position: absolute;
  top: 12px; left: 12px; right: 12px; bottom: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  pointer-events: none;
}
.tile {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 6px;
  font-weight: 700;
  transition: all 0.12s ease;
  aspect-ratio: 1;
}

/*───TileColors────────────────────────────────────────────────*/
.tile[data-value="0"] { background: transparent; color: transparent; }
.tile[data-value="2"] { background: #eee4da; color: #776e65; font-size: clamp(28px,6vw,48px); }
.tile[data-value="4"] { background: #ede0c8; color: #776e65; font-size: clamp(28px,6vw,48px); }
.tile[data-value="8"] { background: #f2b179; color: #f9f6f2; font-size: clamp(28px,6vw,48px); }
.tile[data-value="16"] { background: #f59563; color: #f9f6f2; font-size: clamp(26px,5.5vw,44px); }
.tile[data-value="32"] { background: #f67c5f; color: #f9f6f2; font-size: clamp(26px,5.5vw,44px); }
.tile[data-value="64"] { background: #f65e3b; color: #f9f6f2; font-size: clamp(26px,5.5vw,44px); }
.tile[data-value="128"] { background: #edcf72; color: #f9f6f2; font-size: clamp(22px,5vw,38px); box-shadow: 0 0 30px 10px rgba(243,215,116,0.3); }
.tile[data-value="256"] { background: #edcc61; color: #f9f6f2; font-size: clamp(22px,5vw,38px); box-shadow: 0 0 30px 10px rgba(243,215,116,0.4); }
.tile[data-value="512"] { background: #edc850; color: #f9f6f2; font-size: clamp(22px,5vw,38px); box-shadow: 0 0 30px 10px rgba(243,215,116,0.5); }
.tile[data-value="1024"] { background: #edc53f; color: #f9f6f2; font-size: clamp(18px,4.5vw,32px); box-shadow: 0 0 30px 10px rgba(243,215,116,0.6); }
.tile[data-value="2048"] { background: #edc22e; color: #f9f6f2; font-size: clamp(18px,4.5vw,32px); box-shadow: 0 0 40px 15px rgba(243,215,116,0.7); }
.tile[data-value="super"] { background: #3c3a32; color: #f9f6f2; font-size: clamp(16px,4vw,28px); box-shadow: 0 0 40px 15px rgba(60,58,50,0.4); }

/*───TileAnimations────────────────────────────────────────────*/
@keyframes tile-pop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes tile-merge {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.tile.new-tile { animation: tile-pop 0.2s ease forwards; }
.tile.merged-tile { animation: tile-merge 0.2s ease; }

/*───Overlay────────────────────────────────────────────────────*/
.overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.overlay.active { opacity: 1; pointer-events: auto; }
.overlay-gameover { background: rgba(238,228,218,0.75); }
.overlay-win { background: rgba(237,194,46,0.55); }
.overlay h2 { font-size: 48px; font-weight: 800; color: #776e65; }
.overlay-win h2 { color: #f9f6f2; }
.overlay button {
  background: #8f7a66;
  color: #f9f6f2;
  border: none;
  border-radius: 6px;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.overlay button:hover { background: #9f8b77; }

/*───Status&Footer───────────────────────────────────────────*/
.status {
  text-align: center;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #776e65;
  min-height: 45px;
}
.status.win { color: #27ae60; }
.status.lose { color: #c0392b; }
.footer {
  text-align: center;
  font-size: 12px;
  color: #a09080;
  padding: 8px 0 20px;
}

/*───Mobile───────────────────────────────────────────────*/
@media (max-width: 520px) {
  .title { font-size: 48px; }
  .score-box { min-width: 70px; padding: 6px 12px; }
  .score-box .value { font-size: 18px; }
  .board { padding: 8px; gap: 8px; }
  .tile-container { top: 8px; left: 8px; right: 8px; bottom: 8px; gap: 8px; }
}
