/* Shared chrome for every game page: header bar, score pills, on-screen
   controls, modal buttons. Game-specific board styling lives in its own
   css file (2048.css, snake.css, solitaire.css). */

.game-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem;
  padding: .7rem .8rem;
  background: rgba(11, 7, 19, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--accent);
}
.game-header .back-link {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .5rem .7rem;
  border-radius: 999px;
  background: var(--bg-panel);
  border: 1px solid rgba(255,255,255,.12);
  font-weight: 800;
  font-size: .82rem;
  white-space: nowrap;
}
.game-header .game-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent-3);
  text-shadow: var(--glow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.score-pills { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.score-pill {
  background: var(--bg-panel);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: .3rem .6rem;
  text-align: center;
  min-width: 58px;
}
.score-pill .label { display: block; font-size: .58rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); font-weight: 800; }
.score-pill .value { display: block; font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; }

.game-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 1rem .8rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.game-toolbar { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; width: 100%; }

/* On-screen D-pad for touch devices without swipe habit */
.dpad {
  display: grid;
  grid-template-columns: 52px 52px 52px;
  grid-template-rows: 52px 52px 52px;
  gap: 6px;
  user-select: none;
  margin-top: .4rem;
}
.dpad button {
  border: 1px solid rgba(255,255,255,.15);
  background: var(--bg-panel);
  color: var(--text-main);
  border-radius: 12px;
  font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.dpad button:active { background: var(--accent); color: #1a1027; }
.dpad .up { grid-column: 2; grid-row: 1; }
.dpad .left { grid-column: 1; grid-row: 2; }
.dpad .center { grid-column: 2; grid-row: 2; opacity: .35; }
.dpad .right { grid-column: 3; grid-row: 2; }
.dpad .down { grid-column: 2; grid-row: 3; }

.milestone-banner {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 250;
  pointer-events: none;
}
.milestone-banner.show { display: flex; }
.milestone-banner .msg {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 10vw, 3.4rem);
  color: var(--accent-3);
  text-shadow: 0 0 24px var(--accent), 0 0 60px var(--accent-2);
  animation: milestone-pop 1.6s ease forwards;
  text-align: center;
}
@keyframes milestone-pop {
  0% { transform: scale(.3) rotate(-8deg); opacity: 0; }
  15% { transform: scale(1.15) rotate(3deg); opacity: 1; }
  25% { transform: scale(1) rotate(0); }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.05); opacity: 0; }
}

.confetti-piece {
  position: fixed;
  top: -5%;
  width: 10px; height: 10px;
  z-index: 249;
  pointer-events: none;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(600deg); opacity: .2; }
}
