/* Holsha: вигляд спортивних міні-ігор (однаковий у кожній грі). Поле вписується у вільне місце й зберігає пропорції,
   кнопки не менші за 44 px, на вузьких екранах без горизонтальної прокрутки. Кольори дає barvy.css. */
*,*::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;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;flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.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;font-variant-numeric:tabular-nums}
.game-stats{order:2}
.head-btns{display:flex;gap:6px;flex:none;order:3}
.sound-btn{border:1px solid #111;background:#fff;min-width:56px;min-height:44px;padding:0 10px;cursor:pointer;font:700 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.06em}
.sound-btn[aria-pressed="false"]{color:#999;border-color:#bbb}
.pause-btn[aria-pressed="true"]{color:#fff!important;background:var(--acc,#111)!important;border-color:var(--acc,#111)!important}

.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);border:1px solid #111;background:#fff;touch-action:none;user-select:none;-webkit-user-select:none}
.field canvas{display:block;width:100%;height:100%;touch-action:none}

.overlay{position:absolute;inset:0;display:none;align-items:center;justify-content:center;padding:12px;background:rgba(255,255,255,.88);z-index:5}
.overlay.is-show{display:flex}
.card{width:min(100%,360px);max-height:100%;overflow:auto;border:1px solid #111;background:#fff;padding:20px 18px;box-shadow:5px 6px 0 #111;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;white-space:pre-line}
.card button{width:100%;min-height:48px;border:1px solid #111;background:#111;color:#fff;font-weight:800;cursor:pointer;letter-spacing:.04em}
.card button:active{transform:translateY(2px)}

.toast{position:absolute;left:50%;top:22%;z-index:4;transform:translate(-50%,-50%) scale(.9);opacity:0;pointer-events:none;white-space:nowrap;padding:10px 16px;border-radius:999px;background:linear-gradient(135deg,var(--acc,#111),var(--acc2,#333));color:#fff;box-shadow:0 8px 20px rgba(31,37,71,.25);font:800 13px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.06em;transition:.18s ease}
.toast.is-show{opacity:1;transform:translate(-50%,-50%) scale(1)}

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

.game-foot{border-top:1px solid #ccc;padding-top:6px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.game-foot p{margin:0;font-size:13px;line-height:1.45;color:#555;flex:1 1 auto;min-width:0}
.game-foot button{flex:none;min-height:44px;border:0;background:transparent;padding:2px 4px;text-decoration:underline;cursor:pointer;font-size:13px}

@media (max-width:560px){
  .game{padding:8px 10px;gap:8px}
  .game-head{flex-wrap:wrap;gap:6px 8px;padding-bottom:6px}
  .game-head h1{font-size:18px;order:1}
  .head-btns{order:2}
  .game-stats{order:3;width:100%;justify-content:space-between;gap:8px;font-size:9px}
  .game-stats b{font-size:17px}
  .sound-btn{min-width:48px;padding:0 6px;font-size:9px}
  .game-foot{flex-wrap:wrap;gap:0 10px}
  .game-foot p{font-size:11px;line-height:1.35;flex-basis:100%}
  .game-foot button{font-size:13px;min-height:44px}
  .card{padding:16px 14px}
  .card strong{font-size:22px}
  .card p{font-size:13px;margin:8px 0 12px}
}
@media (max-height:620px){
  .game-foot p{display:none}
}
@media (max-width:380px){.game-stats .opt{display:none}}
