/* Shared placement for every game, independent of board height. */
body{display:block!important;min-height:100dvh!important;padding:24px 16px!important;margin:0!important;background:#faf8fa!important}
main,.game{width:min(100%,500px)!important;max-width:500px!important;min-width:0!important;margin:0 auto!important}
.game-navigation{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:8px!important;min-height:44px!important;margin:0!important;padding:0!important;line-height:18px!important}
.game-navigation a{display:block!important;float:none!important;margin:0!important;color:#7b3891!important;font:14px/18px Arial,sans-serif!important;text-decoration:none!important}
header{display:grid!important;grid-template-columns:minmax(0,1fr) 184px!important;align-items:center!important;gap:12px!important;height:136px!important;margin:0!important;padding:16px 0!important}
.game-heading{margin:0!important;font:700 20px/1.15 Arial,sans-serif!important;min-width:0!important}
.game-statistics{display:flex!important;flex-direction:column!important;align-items:flex-end!important;justify-content:center!important;gap:4px!important;margin:0!important;text-align:right!important;font-size:16px!important;line-height:20px!important;min-width:0!important}
.game-statistics .record,.game-statistics .vv-record,.game-record{font:12px/17px Arial,sans-serif!important;color:#766b79!important;white-space:nowrap!important}
.game-hud{position:absolute;top:8px;left:8px;z-index:1;display:flex;gap:8px;align-items:center;pointer-events:none;color:#fff;font:700 12px/1.2 Arial,sans-serif}
.game-hud .game-level,.game-hud .game-lives{display:block!important;padding:4px 7px;background:rgba(34,28,41,.75);border-radius:5px;color:#fff!important;font:700 12px/1.2 Arial,sans-serif!important;white-space:nowrap}
.stage:has(.overlay:not([hidden])) .game-hud,.vv-stage:has(.vv-overlay:not([hidden])) .game-hud,.board:has(.message:not([hidden])) .game-hud{display:none}
.game-statistics button{margin:6px 0 0!important;padding:6px 10px!important;font:700 12px/16px Arial,sans-serif!important;min-height:28px!important}
.game-statistics button{display:none!important}
.game-statistics .score{display:block!important;white-space:nowrap!important;flex:none!important;margin:0!important;font-size:14px!important}
.game-countdown{position:absolute;inset:0;z-index:5;display:grid;place-items:center;background:#faf8fa;color:#302b32;font:400 20px/1.25 Arial,sans-serif;pointer-events:auto}
.game-countdown[hidden]{display:none}
.overlay h2,.vv-overlay h2,.message h1{font-size:16px!important;line-height:1.25!important;margin:0 0 10px!important}
.overlay p,.vv-overlay p,.message p{font-size:14px!important;line-height:1.5!important;margin:0 0 14px!important}
.game-key-guide{display:inline-grid;grid-template-columns:repeat(2,minmax(34px,auto));gap:4px;margin:10px 0 4px;vertical-align:middle}
.game-key-guide.four-keys{grid-template-columns:repeat(3,34px)}
.game-key-guide span{display:grid;place-items:center;min-width:34px;height:30px;padding:0 6px;border:1px solid #d8c7dc;border-radius:6px;background:#f1eaf3;color:#7b3891;font:19px/1 Arial,sans-serif}
.game-key-guide:has(.space-key){grid-template-columns:1fr}
.game-key-guide .space-key{width:68px;font-size:18px}
.game-key-guide .key-up{grid-column:2}.game-key-guide.four-keys span:nth-child(2){grid-column:1}
.overlay #start,.vv-overlay #start,.message #start{font:600 14px/1.2 Arial,sans-serif!important;padding:9px 19px!important;border-radius:7px!important;background:#9145a6!important;color:#fff!important}
.overlay,.vv-overlay,.message{gap:0!important}
@media(max-width:420px){.overlay h2,.vv-overlay h2,.message h1{font-size:15px!important}.overlay p,.vv-overlay p,.message p{font-size:13px!important}}
@media(prefers-reduced-motion:no-preference){
  .overlay:not([hidden]),.vv-overlay:not([hidden]),.message:not([hidden]){animation:game-screen-in .22s ease-out}
  .overlay button,.vv-overlay button,.message button{transition:transform .15s ease,box-shadow .15s ease}
  .overlay button:hover,.vv-overlay button:hover,.message button:hover{transform:translateY(-2px);box-shadow:0 5px 14px #9145a626}
  .overlay button:active,.vv-overlay button:active,.message button:active{transform:translateY(0)}
}
@keyframes game-screen-in{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:420px){header{grid-template-columns:minmax(0,1fr) 164px!important;gap:8px!important}.game-heading{font-size:17px!important}header h1:before,header img{width:32px!important;height:32px!important;flex:none!important}}

/* Navigation, title and score share one compact row. */
body{padding:12px 20px!important}
body main,body .game{width:min(100%,1000px)!important;max-width:1000px!important}
body main header{display:grid!important;grid-template-columns:minmax(150px,1fr) minmax(0,1fr) max-content!important;align-items:center!important;gap:12px!important;width:min(100%,500px)!important;height:100px!important;margin:0 auto 8px!important;padding:0!important}
body main .game-navigation{grid-column:1!important;justify-self:start!important;min-height:0!important}
.game-title{grid-column:2;display:flex;align-items:center;justify-content:center;gap:10px;min-width:0}
.overlay .game-title,.vv-overlay .game-title,.message .game-title{display:flex;align-items:center;justify-content:center;gap:10px;position:absolute;top:15%;left:0;right:0;margin:0;padding:0 12px}
.overlay .game-title .game-heading,.vv-overlay .game-title .game-heading,.message .game-title .game-heading{font:700 16px/1.15 Arial,sans-serif!important;text-align:left!important;margin:0!important}
.game-title h1{display:flex;align-items:center;gap:10px}
.game-title h1:before{content:'';display:block;width:30px;height:30px;flex:none;background:url('/brand/visual-vector-logo-exact.svg') center/contain no-repeat}
.game-title>img{width:30px!important;height:30px!important;flex:none}
body main .game-statistics{grid-column:3!important;justify-self:end!important}
body main .stage,body main .board,body main .vv-stage{width:min(100%,500px,calc((100dvh - 132px)*var(--game-ratio,1)))!important;min-width:0!important;margin:0 auto!important}
body main .stage canvas,body main .board canvas,body main .vv-stage canvas{display:block;width:100%!important;min-width:0!important;height:auto!important}
@media(max-width:600px){
  body{padding:8px 12px!important}
  body main header{grid-template-columns:minmax(0,1fr) minmax(145px,1fr)!important;grid-template-rows:auto auto!important;height:auto!important;min-height:96px!important;gap:4px 8px!important;margin-bottom:8px!important}
  body main .game-navigation{grid-column:1!important;grid-row:1!important;gap:2px!important}
  .game-title{grid-column:1;grid-row:2;justify-content:flex-start}
  body main .game-statistics{grid-column:2!important;grid-row:1 / 3!important}
  .game-heading{font-size:16px!important}
  .game-title>img,header h1:before{width:30px!important;height:30px!important}
  body main .stage,body main .board,body main .vv-stage{width:min(100%,500px,calc((100dvh - 122px)*var(--game-ratio,1)))!important}
}
