/* Stash Stacker (/stacker/). The stage fills the screen under the sticky tab strip so a game never needs scrolling. */
.stk-hero .hero-in { padding-top: 20px; padding-bottom: 24px; }
.stk-hero h1 { margin-bottom: 8px; }
.stk-hero .lede { margin: 0; font-size: 15px; }
main.stk-main { padding-top: 12px; }

.stk {
  --stk-gap: 8px;
  display: grid; gap: var(--stk-gap);
  grid-template-columns: minmax(0, 1fr) 76px; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "well hud" "pad pad";
  width: 100%; max-width: 30rem; margin: 0 auto; padding: 8px;
  height: calc(100vh - 56px); height: calc(100svh - 56px); min-height: 26rem; max-height: 52rem;
  border: 1px solid var(--board-line); border-radius: var(--r-lg);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.stk:focus { outline: none; }
/* Only a running game takes over touch, so the page still scrolls past the stage otherwise. */
.stk.playing, .stk.playing * { touch-action: none; }
html:has(.stk.playing) { overscroll-behavior: none; }
@media (min-width: 60rem) {
  .stk { height: calc(100vh - 84px); height: calc(100svh - 84px); padding: 12px; --stk-gap: 16px; grid-template-columns: minmax(0, 1fr) 96px; }
  .stk-stats dd { font-size: 20px; }
}

.stk-hud { grid-area: hud; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stk-stats { display: grid; gap: 10px; margin: 0; }
.stk-stats div { min-width: 0; }
.stk-stats dt { font-size: 11px; line-height: 1.2; color: var(--board-ink-2); }
.stk-stats dd { margin: 0; font-family: var(--mono); font-size: 16px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.stk-stats div:first-child dd { color: var(--accent); }
.stk-next { display: flex; flex-direction: column; gap: 6px; font-size: 11px; line-height: 1.2; color: var(--board-ink-2); }
.stk-next canvas { width: 64px; height: 40px; }
.stk-pause { flex: none; display: grid; place-items: center; width: 100%; margin-top: auto; height: 44px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--board-2); color: var(--board-ink); cursor: pointer; }
.stk-pause svg { width: 20px; height: 20px; }
.stk-pause:disabled { opacity: .4; cursor: default; }

.stk-well { grid-area: well; position: relative; min-height: 0; }
.stk-well canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: block; border-radius: 6px; box-shadow: 0 0 0 1px var(--board-line); }
.stk-over { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; padding: 12px; }
.stk-card { width: min(17rem, 100%); padding: 20px 16px; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--board); text-align: center; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); }
.stk-card h2 { margin: 0 0 8px; font-size: 22px; }
.stk-card p { color: var(--board-ink-2); font-size: 15px; }
.stk-card .btn { width: 100%; margin-top: 8px; }
.stk-card .stk-hint { margin: 12px 0 0; font-size: 13px; }
.stk-card .stk-hint:empty { display: none; }
.stk-card b { color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .stk-card { animation: rise 220ms var(--ease) both; }
}

.stk-pad { grid-area: pad; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.stk-pad button { display: grid; place-items: center; height: 56px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--board-2); color: var(--board-ink); cursor: pointer; transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease); }
.stk-pad svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.stk-pad button.down, .stk-pad button:active { background: var(--accent); color: var(--on-accent); transform: scale(.96); }
.stk-pad button[data-act="hard"] { color: var(--accent); }
.stk-pad button[data-act="hard"].down { color: var(--on-accent); }
/* Mouse and keyboard machines play with keys; the pad is for touch screens. */
@media (hover: hover) and (pointer: fine) { .stk-pad { display: none; } }
@media (max-height: 560px) { .stk-pad button { height: 48px; } }

.stk-help { max-width: 40rem; margin: 32px auto 0; }
.stk-keys { padding-left: 20px; color: var(--ink-2); }
.stk-keys li { margin-bottom: 8px; }
@media (hover: none) { .stk-keys .k-fine { display: none; } }
kbd { display: inline-block; min-width: 1.6em; padding: 0 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); color: var(--ink); font-family: var(--mono); font-size: 13px; line-height: 1.6; text-align: center; }
