html,
body {
  min-height: 100%;
  background: #11151d;
  color: #f4f3ee;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body {
  margin: 0;
  padding: 34px 20px 48px;
  background:
    radial-gradient(circle at 50% 0, rgba(200, 242, 115, 0.13), transparent 32rem),
    #11151d;
}

.container {
  width: min(500px, 100%);
  margin: 0 auto;
}

.pixplay-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  color: #a7acb3;
  font-size: 12px;
}

.pixplay-nav a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  color: #e9f8ce;
  text-decoration: none;
}

.pixplay-nav a:hover {
  color: #c8f273;
}

.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

h1.title {
  float: none;
  margin: 0;
  color: #c8f273;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(48px, 10vw, 72px);
  line-height: 1;
  letter-spacing: -0.07em;
}

.scores-container {
  display: flex;
  float: none;
  gap: 8px;
  text-align: center;
}

.score-container,
.best-container {
  min-width: 72px;
  height: 58px;
  margin-top: 0;
  padding: 19px 12px 8px;
  border: 1px solid #ffffff14;
  border-radius: 10px;
  background: #242c37;
  color: #fff;
  font-size: 20px;
  line-height: 1.1;
}

.score-container:after,
.best-container:after {
  top: 8px;
  color: #a7acb3;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.score-container:after { content: "得分"; }
.best-container:after { content: "最高"; }

.above-game {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.game-intro {
  float: none;
  width: auto;
  margin: 0;
  color: #c7ccd2;
  line-height: 1.6;
}

.game-intro strong {
  color: #c8f273;
}

.restart-button {
  flex: 0 0 auto;
  float: none;
  height: 42px;
  margin: 0;
  padding: 0 18px;
  border-radius: 999px;
  background: #c8f273;
  color: #20251a;
  font-size: 13px;
  font-weight: 700;
  line-height: 42px;
  white-space: nowrap;
  transition: transform 0.2s, background 0.2s;
}

.restart-button:hover {
  transform: translateY(-2px);
  background: #daf99b;
}

.game-container {
  margin: 24px auto 0;
  border: 1px solid #ffffff1b;
  border-radius: 16px;
  background: #26313c;
  box-shadow: 0 20px 55px #05080d80;
}

.grid-cell {
  border-radius: 7px;
  background: #18202a;
}

.tile .tile-inner {
  border-radius: 7px;
  color: #f5f5ee;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #ffffff12;
}

.tile.tile-2 .tile-inner { background: #475747; color: #f4f4e9; }
.tile.tile-4 .tile-inner { background: #637654; color: #fff; }
.tile.tile-8 .tile-inner { background: #8a9a5d; color: #fff; }
.tile.tile-16 .tile-inner { background: #c8f273; color: #20251a; }
.tile.tile-32 .tile-inner { background: #edbd69; color: #322416; }
.tile.tile-64 .tile-inner { background: #ec8b65; color: #fff9f2; }
.tile.tile-128 .tile-inner { background: #d76b58; color: #fff; }
.tile.tile-256 .tile-inner { background: #a85c73; color: #fff; }
.tile.tile-512 .tile-inner { background: #7d66a4; color: #fff; }
.tile.tile-1024 .tile-inner { background: #507c91; color: #fff; }
.tile.tile-2048 .tile-inner { background: #e9d585; color: #20251a; }
.tile.tile-super .tile-inner { background: #303946; color: #c8f273; }

.game-message {
  border-radius: 15px;
  background: #11151de8 !important;
  color: #f4f3ee !important;
  backdrop-filter: blur(8px);
}

.game-container .game-message p {
  position: absolute;
  top: 33%;
  right: 0;
  left: 0;
  height: auto;
  margin: 0;
  color: #c8f273;
  font-size: clamp(30px, 8vw, 48px);
  line-height: 1.2;
}

.game-container .game-message .lower {
  position: absolute;
  top: 57%;
  right: 0;
  left: 0;
  margin: 0;
}

.game-container .game-message a {
  min-height: 42px;
  margin: 4px;
  padding: 0 14px;
  border-radius: 999px;
  background: #c8f273;
  color: #20251a;
  font-size: 13px;
  font-weight: 700;
  line-height: 42px;
}

.game-explanation {
  margin-top: 24px;
  color: #d3d5d8;
  font-size: 14px;
  line-height: 1.8;
}

.game-explanation .important {
  color: #c8f273;
}

.game-credit {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #ffffff1c;
  color: #8e959f;
  font-size: 11px;
  line-height: 1.7;
}

a:focus-visible {
  outline: 2px solid #c8f273;
  outline-offset: 3px;
}

@media screen and (max-width: 520px) {
  body {
    margin: 0;
    padding: 18px 16px 36px;
    font-size: 15px;
  }

  .container {
    width: 100%;
  }

  .pixplay-nav {
    margin-bottom: 18px;
  }

  .heading {
    gap: 8px;
  }

  h1.title {
    margin: 0;
    font-size: clamp(42px, 12vw, 58px);
  }

  .scores-container {
    gap: 5px;
  }

  .score-container,
  .best-container {
    min-width: 58px;
    height: 54px;
    padding: 19px 8px 7px;
    font-size: 18px;
  }

  .above-game {
    gap: 8px;
  }

  .game-intro {
    flex: 1 1 auto;
    width: auto;
    font-size: 13px;
    line-height: 1.5;
  }

  .restart-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 86px;
    height: 40px;
    padding: 0 12px;
    font-size: 12px;
    line-height: 40px;
  }

  .game-container {
    width: 280px;
    max-width: 100%;
    height: 280px;
    margin-top: 18px;
  }

  .game-container .game-message p {
    top: 31%;
    font-size: 34px;
  }

  .game-container .game-message .lower {
    top: 57%;
  }

  .game-container .game-message a {
    padding: 0 11px;
    font-size: 12px;
  }

  .game-explanation {
    margin-top: 20px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
