.stack-page main { max-width: 760px; }
.stack-page .page-heading { padding-bottom: 16px; }
.stack-page h1, .stack-stage { font-family: Calibri, Carlito, Arial, sans-serif; }
.stack-stage {
  max-width: 480px;
  margin: 0 auto 32px;
  padding: 12px;
  border: 1px solid #3d4d77;
  border-radius: 12px;
  background: #141b35;
  color: #f6f7ff;
}
.stack-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 15px; }
.stack-bar strong { color: #fff; }
.stack-bar button { margin-left: auto; }
#stack-board {
  width: 100%;
  aspect-ratio: 420 / 480;
  margin: 8px auto;
  border: 1px solid #465779;
  border-radius: 6px;
  background-color: #211b3c;
  touch-action: none;
}
.stack-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.stack-stage button {
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid #5d719a;
  border-radius: 5px;
  background: #26375e;
  color: #f6f7ff;
  font: inherit;
  font-size: 15px;
}
.stack-stage button:focus-visible, #stack-board:focus-visible { outline: 3px solid #74dfff; outline-offset: 2px; }
.stack-stage button:hover:not(:disabled) { background: #354c7b; }
.stack-stage button[data-stack-action="rotate"] { touch-action: none; -webkit-user-select: none; user-select: none; }
.stack-stage button[data-stack-action="drop"] { background: #ffd63d; color: #161a28; border-color: #ffd63d; font-weight: 700; }
.stack-stage button[data-stack-action="drop"]:hover:not(:disabled) { background: #ffe47d; }
.stack-status { margin: 8px 0 0; font-size: 15px; min-height: 24px; }
.stack-help { color: #c5d1ed; font-size: 13px; }
.stack-leaderboard {
  margin: 0 auto 32px;
  max-width: 480px;
  font-family: Calibri, Carlito, Arial, sans-serif;
}
.stack-leaderboard table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.stack-leaderboard th, .stack-leaderboard td { text-align: left; padding: 6px; border-bottom: 1px solid var(--border); }
.stack-results {
  width: min(380px, calc(100% - 32px));
  padding: 20px;
  border: 1px solid #5d719a;
  border-radius: 10px;
  background: #211b3c;
  color: #f6f7ff;
}
.stack-results::backdrop { background: #101020b5; }
.stack-results p, .stack-results label { margin-top: 8px; }
.stack-results label { display: block; }
.stack-results input {
  margin: 6px 0 12px;
  width: 5em;
  min-height: 44px;
  text-transform: uppercase;
  letter-spacing: .2em;
  text-align: center;
}
.stack-result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stack-art {
  height: 130px;
  width: 100%;
  border: 1px solid #465779;
  border-radius: 4px;
  background: #1b284c;
  display: grid;
  place-items: center;
}
.stack-art span {
  display: block;
  width: 112px;
  height: 92px;
  background: linear-gradient(#ffd63d 0 0) 35px 30px / 34px 34px,
    linear-gradient(#29ddf5 0 0) center 64px / 94px 18px,
    conic-gradient(from 150deg at 50% 0%, #e95bfa 60deg, transparent 0) center top / 40px 30px,
    linear-gradient(#9bf373 0 0) center bottom / 112px 8px;
  background-repeat: no-repeat;
}
