/* Stick Hero — contained canvas, consistent with other games */

html, body {
  overflow: hidden;
  height: 100%;
}

/* Float the site header above the canvas */
.site-header {
  position: relative;
  z-index: 100;
  background: rgba(250, 248, 239, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
body.dark .site-header {
  background: rgba(21, 17, 14, 0.88);
}

/* Centres the bounded canvas on the page */
.game-wrap {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

/* Sized by the canvas element inside; overlays anchor to this */
#canvas-wrapper {
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  line-height: 0; /* collapse inline whitespace around canvas */
}

#game {
  display: block;
  border-radius: 8px;
  overflow: hidden;
}

/* ── Score ── */
#score {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: clamp(22px, 6vw, 36px);
  font-weight: 900;
  color: #333344;
  pointer-events: none;
  z-index: 10;
}
body.dark #score { color: #e8e4da; }

/* ── High score ── */
#high-score {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(51, 51, 68, 0.55);
  pointer-events: none;
  z-index: 10;
}
body.dark #high-score { color: rgba(232, 228, 218, 0.55); }

/* ── Introduction overlay ── */
#introduction {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-weight: 600;
  font-size: 0.85em;
  color: #444;
  transition: opacity 2s;
  pointer-events: none;
  z-index: 10;
  width: 180px;
  line-height: 1.5;
}
body.dark #introduction { color: rgba(232, 228, 218, 0.85); }

/* ── Perfect hit banner ── */
#perfect {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translate(-50%, -50%);
  font-size: clamp(14px, 3.5vw, 20px);
  font-weight: 900;
  color: #edc22e;
  opacity: 0;
  transition: opacity 1s;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ── Restart button ── */
#restart {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 10;
  padding: 12px 32px;
  font-size: 1em;
}

@media (prefers-reduced-motion: reduce) {
  #introduction, #perfect { transition: none; }
}
