.game-page {
  overflow: visible;
}

.game-shell {
  width: min(calc(100% - 32px), 680px);
  margin: 0 auto;
  padding: clamp(42px, 7vw, 76px) 0 88px;
}

.game-breadcrumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.9rem;
}

.game-breadcrumbs a {
  font-weight: 700;
}

.game-heading {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.game-heading h1 {
  margin: 0;
  font-size: clamp(3.2rem, 12vw, 6rem);
}

.scoreboard {
  display: flex;
  gap: 10px;
}

.score-box {
  min-width: 92px;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--green-deep);
  color: #fff;
  text-align: center;
}

.score-box span {
  display: block;
  color: #bcd8c7;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.score-box strong {
  display: block;
  overflow: hidden;
  font-size: 1.35rem;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.game-intro {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  color: var(--muted);
}

.game-intro p {
  margin: 0;
}

.game-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.game-button:hover {
  background: var(--green);
}

.play-board-wrap {
  position: relative;
}

.play-board {
  display: grid;
  width: min(100%, 620px);
  aspect-ratio: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(7px, 2vw, 12px);
  margin: 0 auto;
  padding: clamp(7px, 2vw, 12px);
  border-radius: clamp(18px, 4vw, 28px);
  background: #244d38;
  box-shadow: var(--shadow);
  touch-action: none;
  user-select: none;
}

.game-tile {
  display: grid;
  min-width: 0;
  place-items: center;
  border-radius: clamp(11px, 2.8vw, 19px);
  background: rgba(255, 255, 255, 0.1);
  color: var(--green-deep);
  font-size: clamp(1.45rem, 8vw, 3.25rem);
  font-weight: 900;
  line-height: 1;
}

.tile-2 { background: #f8f5e9; }
.tile-4 { background: #efe8cd; }
.tile-8 { background: #f5c878; color: #49300f; }
.tile-16 { background: #f4ad61; color: #43270c; }
.tile-32 { background: #eb8659; color: #fff; }
.tile-64 { background: #d95f42; color: #fff; }
.tile-128 { background: #d8d26b; font-size: clamp(1.25rem, 7vw, 2.8rem); }
.tile-256 { background: #b7ca62; font-size: clamp(1.25rem, 7vw, 2.8rem); }
.tile-512 { background: #82b75a; color: #fff; font-size: clamp(1.25rem, 7vw, 2.8rem); }
.tile-1024 { background: #4e8d55; color: #fff; font-size: clamp(1rem, 5.7vw, 2.35rem); }
.tile-2048 { background: var(--warm); color: #3e290b; font-size: clamp(1rem, 5.7vw, 2.35rem); }
.tile-super { background: var(--green-deep); color: #fff; font-size: clamp(0.9rem, 5vw, 2.1rem); }

.game-over {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 24px;
  border-radius: clamp(18px, 4vw, 28px);
  background: rgba(245, 247, 242, 0.9);
  text-align: center;
  backdrop-filter: blur(4px);
}

.game-over[hidden],
.milestone[hidden] {
  display: none;
}

.game-over h2 {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 10vw, 4.6rem);
}

.game-over p {
  margin: 0 0 20px;
  color: var(--muted);
}

.milestone {
  margin: 18px 0 0;
  padding: 13px 18px;
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-weight: 800;
  text-align: center;
}

.game-help {
  margin-top: 36px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.game-help h2 {
  margin-bottom: 10px;
  font-size: 1.4rem;
}

.game-help p {
  margin: 0;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 540px) {
  .game-shell {
    width: min(calc(100% - 24px), 680px);
    padding-top: 30px;
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .game-heading {
    display: block;
  }

  .scoreboard {
    margin-top: 16px;
  }

  .score-box {
    min-width: 84px;
  }

  .game-intro {
    align-items: flex-start;
  }
}
