:root {
    --stack-paper: #f0eadc;
    --stack-grid: #ded8ca;
    --stack-shadow: #d7cdbb;
    --stack-sage-top: #b8c5a7;
    --stack-sage-front: #8eaa8e;
    --stack-sage-side: #6c8971;
    --stack-gold-top: #e6c792;
    --stack-gold-front: #cda46c;
    --stack-gold-side: #ae8755;
    --stack-rose-top: #dfb1a0;
    --stack-rose-front: #c58e7b;
    --stack-rose-side: #a57565;
    --stack-blue-top: #abc1c5;
    --stack-blue-front: #87a7ab;
    --stack-blue-side: #6d898f;
    --stack-moss-top: #cad0a1;
    --stack-moss-front: #a7b27c;
    --stack-moss-side: #89945f;
}
.stack-shell { max-width: 1080px; }
.stack-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr); gap: clamp(28px, 6vw, 84px); padding-top: 32px; align-items: center; }
.stack-stage { min-width: 0; }
.stack-field { position: relative; height: clamp(380px, 61svh, 610px); overflow: hidden; border: 1px solid var(--arcade-line); background: var(--stack-paper); border-radius: 4px 4px 30px 4px; }
#tower { display: block; width: 100%; height: 100%; cursor: pointer; touch-action: manipulation; outline-offset: -6px; }
#tower:hover { background: var(--arcade-bg); }
#tower:active { cursor: grabbing; }
#tower:focus-visible { outline: 3px solid var(--arcade-accent); }
.stack-scoreboard { position: absolute; top: 24px; left: 28px; right: 28px; display: flex; justify-content: space-between; align-items: start; pointer-events: none; z-index: 1; }
.stack-label { display: block; font-size: 12px; color: var(--arcade-muted); letter-spacing: .08em; }
.stack-scoreboard strong { display: block; line-height: 1.1; font-size: 62px; font-weight: 400; font-variant-numeric: tabular-nums; }
.stack-best { text-align: right; }
.stack-best strong { font-size: 30px; margin-top: 10px; }
.stack-field-footer { position: absolute; bottom: 18px; left: 28px; right: 28px; display: flex; justify-content: space-between; font-size: 11px; color: var(--arcade-muted); letter-spacing: .08em; pointer-events: none; }
.stack-overlay { position: absolute; top: 28%; width: 100%; text-align: center; pointer-events: none; padding: 0 20px; }
.stack-overlay h2 { font-size: clamp(23px, 4vw, 32px); font-weight: 400; margin: 14px 0 5px; }
.stack-overlay p { font-size: 14px; margin: 0 auto; max-width: 28em; color: var(--arcade-muted); }
.stack-seal { display: inline-grid; place-items: center; border: 1px solid var(--arcade-accent); color: var(--arcade-accent); width: 30px; height: 34px; font-size: 19px; transform: rotate(-5deg); }
.stack-field[data-status="paused"] .stack-overlay, .stack-field[data-status="gameover"] .stack-overlay { top: 28%; padding-block: 14px; background: var(--arcade-surface); border-block: 1px solid var(--arcade-line); }
.stack-field[data-status="paused"] .stack-seal, .stack-field[data-status="gameover"] .stack-seal { display: none; }
.stack-field[data-status="paused"] .stack-overlay h2, .stack-field[data-status="gameover"] .stack-overlay h2 { margin-top: 0; }
.stack-drop { width: 100%; min-height: 52px; margin-top: 14px; font-size: 17px; }
.stack-key { font-size: 12px; opacity: .7; margin-left: 7px; }
.stack-toolbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.stack-toolbar .arcade-button { padding-inline: 8px; }
.stack-notes > .arcade-kicker { margin-top: 0; }
.stack-notes .arcade-title { margin: 12px 0 22px; font-size: clamp(38px, 5vw, 60px); }
.stack-intro { font-size: 21px; line-height: 1.9; margin: 0 0 26px; color: var(--arcade-muted); }
.stack-status { min-height: 54px; margin: 0 0 20px; color: var(--arcade-accent); }
.stack-width { margin-bottom: 28px; }
.stack-width > div { display: flex; justify-content: space-between; font-size: 13px; color: var(--arcade-muted); }
.stack-width meter { display: block; width: 100%; height: 8px; margin-top: 8px; appearance: none; background: var(--arcade-line); border: 0; border-radius: 0; }
.stack-width meter::-webkit-meter-bar { background: var(--arcade-line); border: 0; border-radius: 0; }
.stack-width meter::-webkit-meter-optimum-value { background: var(--arcade-accent); }
.stack-width meter::-moz-meter-bar { background: var(--arcade-accent); }
.stack-rules { border-top: 1px solid var(--arcade-line); padding-top: 20px; }
.stack-rules h2 { font-size: 16px; font-weight: 400; margin: 0 0 14px; }
.stack-rules ol { margin: 0; padding-left: 21px; color: var(--arcade-muted); font-size: 14px; }
.stack-rules li { padding-left: 5px; margin-bottom: 11px; }
.stack-storage { border-top: 1px solid var(--arcade-line); padding-top: 17px; margin: 20px 0 0; font-size: 12px; }
@media (max-width: 720px) {
    .stack-layout { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-top: 18px; }
    .stack-field { height: clamp(340px, 57svh, 520px); }
    .stack-notes .arcade-title { font-size: 30px; margin: 8px 0; }
    .stack-notes > .arcade-kicker, .stack-intro { display: none; }
    .stack-status { min-height: 0; margin: 12px 0 16px; }
    .stack-width { margin-bottom: 20px; }
    .stack-scoreboard { top: 18px; left: 22px; right: 22px; }
    .stack-scoreboard strong { font-size: 48px; }
    .stack-best strong { font-size: 26px; }
    .stack-field-footer { left: 22px; right: 22px; }
    .stack-key { display: none; }
}
@media (max-height: 500px) and (min-width: 600px) {
    .stack-layout { grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); padding-top: 12px; gap: 24px; }
    .stack-field { height: 300px; }
    .stack-intro { display: none; }
}
