/* =============================================================
   GAME: Stack Tower
   ============================================================= */
.board-stacktower { display: flex; flex-direction: column; align-items: center; gap: 10px; outline: none; max-width: 100%; }
.st-stage { position: relative; touch-action: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.st-canvas {
  display: block; width: 360px; height: 540px; border-radius: 14px; background: #0e0a2a;
  box-shadow: 0 0 0 2px #8f7bff, 0 0 26px rgba(143, 123, 255, .38);
}
.board-stacktower:focus-visible .st-canvas { box-shadow: 0 0 0 3px #fff, 0 0 26px rgba(143, 123, 255, .55); }
.st-msg {
  position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); width: max-content; max-width: 86%;
  padding: 10px 16px; border-radius: 12px; background: rgba(14, 10, 42, .84); color: #ece8ff; font-weight: 700; text-align: center;
  box-shadow: 0 0 0 1px rgba(143, 123, 255, .6); pointer-events: none;
}
.st-msg[hidden] { display: none; }
.st-pop {
  position: absolute; left: 0; right: 0; top: 20%; text-align: center; pointer-events: none; opacity: 0;
  font: 800 1.3rem var(--font-head, system-ui); text-transform: uppercase; color: #fff; text-shadow: 0 0 12px #8f7bff, 0 0 28px #ff7ad9;
}
.st-pop.show { animation: stPop .9s ease-out forwards; }
@keyframes stPop { 0% { opacity: 0; transform: scale(.6); } 15% { opacity: 1; transform: scale(1.1); } 65% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-14px); } }
@media (prefers-reduced-motion: reduce) { .st-pop.show { animation: stFade .9s linear forwards; } }
@keyframes stFade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.st-num { color: #c4b8ff; font-variant-numeric: tabular-nums; }
.st-combo { color: #ffd23f; font-weight: 700; }

/* on-screen buttons: phones and tablets only */
.st-pad { display: none; align-items: center; gap: 10px; width: min(100%, 360px); touch-action: none; }
.st-key {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 58px; border: 0; border-radius: 16px; cursor: pointer;
  color: #c4b8ff; background: var(--surface-2); box-shadow: inset 0 0 0 1px rgba(143, 123, 255, .55), 0 4px 0 rgba(0, 0, 0, .35);
  font: 800 1rem var(--font-head, system-ui); text-transform: uppercase; letter-spacing: .04em;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.st-key svg { width: 24px; height: 24px; fill: currentColor; }
.st-key-pause { width: 58px; flex: none; color: var(--ink); border-radius: 50%; }
.st-key-pause svg { width: 20px; height: 20px; }
.st-key-drop { flex: 1; }
.st-key:active { background: #1e1850; transform: translateY(2px); box-shadow: inset 0 0 0 1px #8f7bff, 0 2px 0 rgba(0, 0, 0, .35); }
@media (pointer: coarse) { .st-pad { display: flex; } .board-stacktower { gap: 8px; } }

/* miss: a short shake (off when motion is reduced) */
.st-crash { animation: stShake .4s cubic-bezier(.36, .07, .19, .97); }
@keyframes stShake { 15%, 55% { translate: -4px 0; } 35%, 75% { translate: 4px 0; } 90% { translate: -2px 0; } }
@media (prefers-reduced-motion: reduce) { .st-crash { animation: none; } }
