/* Holsha, 19.10.2026: вигляд космічних міні-ігор (на основі спільного вигляду нових міні-ігор).
   Поле вписується у вільне місце й зберігає пропорції; кольори гри задає index.html змінними --acc, --acc2, --bg1, --bg2. */
*,*::before,*::after{box-sizing:border-box}
html,body{height:100%;margin:0;background:#fff;color:#111;overflow:hidden}
body{font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-tap-highlight-color:transparent}
button{font:inherit;color:inherit}
[hidden]{display:none!important}

.game{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:10px;padding:14px;max-width:1100px;margin:0 auto;outline:none}

.game-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-bottom:10px;border-bottom:1px solid #ccc;min-width:0}
.game-head h1{margin:0;font-size:23px;line-height:1.1;letter-spacing:-.02em;min-width:0}
.game-stats{display:flex;align-items:flex-end;gap:16px;margin:0;font:700 10px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.08em;color:#777}
.game-stats span{display:flex;flex-direction:column;gap:4px;white-space:nowrap}
.game-stats b{color:#111;font-size:20px;letter-spacing:0}

.stage{position:relative;min-height:0;min-width:0;display:flex;align-items:center;justify-content:center}
.field{position:relative;width:var(--fw,300px);height:var(--fh,400px);background:#0b1030;touch-action:none;user-select:none;-webkit-user-select:none}
.field canvas{display:block;width:100%;height:100%;cursor:crosshair}

.overlay{position:absolute;inset:0;display:none;align-items:center;justify-content:center;padding:12px;background:rgba(11,16,48,.55);z-index:5}
.overlay.is-show{display:flex}
.card{width:min(100%,340px);max-height:100%;overflow:auto;background:#fff;padding:20px 18px;text-align:center}
.card small{display:block;color:#777;font:700 10px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.12em;margin-bottom:8px}
.card strong{display:block;font-size:26px;line-height:1.1;letter-spacing:-.02em}
.card p{margin:10px 0 16px;color:#555;font-size:14px;line-height:1.45;text-align:left}
.card button{width:100%;min-height:46px;border:1px solid #111;background:#111;color:#fff;font-weight:800;cursor:pointer;letter-spacing:.04em}
.card button:active{transform:translateY(2px)}

.pad{display:none;gap:6px}
.pad button{min-height:52px;border:1px solid #111;background:#fff;cursor:pointer;font:800 13px/1 ui-monospace,SFMono-Regular,Menlo,monospace;touch-action:none;user-select:none;-webkit-user-select:none;display:flex;align-items:center;justify-content:center;padding:0 4px;min-width:0}
.pad button.is-down,.pad button:active{background:#111;color:#fff}
.pad svg{width:24px;height:24px}
.game.show-pad .pad{display:grid}

.game-foot{border-top:1px solid #ccc;padding-top:8px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px}
.game-foot p{margin:0;flex:1 1 280px;font-size:13px;line-height:1.45;color:#555}
.foot-btns{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.game-foot .foot-btns button,.game-foot .rk-open{min-height:44px;min-width:44px;padding:0 14px;border:2px solid var(--line,#d9ddef);border-radius:12px;background:#fff;cursor:pointer;font-size:13px;font-weight:700}
.game-foot .sound-btn{font:700 11px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.06em}
.game-foot .sound-btn[aria-pressed="false"]{opacity:.6}

@media (max-width:560px){
  .game{padding:10px;gap:8px}
  .game-head{gap:8px;padding-bottom:8px}
  .game-head h1{font-size:17px}
  .game-stats{gap:10px;font-size:8px}
  .game-stats b{font-size:16px}
  .game-foot p{font-size:12px;flex-basis:100%}
  .foot-btns{width:100%}
  .foot-btns button{flex:1 1 0}
}
@media (max-width:400px){.game-stats .opt{display:none}}
@media (max-height:560px){.game-foot p{display:none}}
