:root {
  --bg: #070912;
  --bg-2: #0d1122;
  --panel: rgba(16, 20, 40, 0.82);
  --panel-border: rgba(120, 140, 255, 0.16);
  --text: #e8ecff;
  --muted: #8a93b8;
  --p1: #34e6ff;
  --p2: #ff4fd8;
  --warn: #ffb547;
  --hot: #ff4a3d;
  --ok: #6dff9e;
  --accent: #8c7bff;
  --radius: 14px;
  --font: 'Chakra Petch', system-ui, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60rem 40rem at 15% -10%, rgba(52, 230, 255, 0.10), transparent 60%),
    radial-gradient(50rem 40rem at 110% 110%, rgba(255, 79, 216, 0.10), transparent 60%),
    linear-gradient(rgba(140, 123, 255, 0.05) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(140, 123, 255, 0.05) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--bg);
  pointer-events: none;
}

#app {
  position: relative;
  height: 100%;
  width: 100%;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.screen.active {
  display: flex;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: clamp(20px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  margin: auto;
}
.lobby-panel { width: min(560px, 100%); }
.small-panel { width: min(400px, 100%); }

/* LOGO */
.logo {
  margin: 0 0 4px;
  text-align: center;
  line-height: 0.9;
  font-weight: 700;
  letter-spacing: 0.06em;
  user-select: none;
}
.logo-dodge {
  display: block;
  font-size: clamp(46px, 11vw, 76px);
  color: #fff;
  text-shadow: 0 0 18px rgba(52, 230, 255, 0.55), 0 0 2px #fff;
  transform: skewX(-8deg);
}
.logo-arena {
  display: block;
  font-size: clamp(22px, 5vw, 32px);
  letter-spacing: 0.55em;
  margin-left: 0.55em;
  color: var(--p2);
  text-shadow: 0 0 14px rgba(255, 79, 216, 0.6);
}
.tagline { margin: 0; text-align: center; color: var(--muted); font-size: 15px; }

.title {
  margin: 0;
  text-align: center;
  letter-spacing: 0.18em;
  font-size: 22px;
  color: #fff;
}

.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 160px; }

/* PRZYCISKI */
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.12em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.3); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:focus-visible { outline: 2px solid var(--p1); outline-offset: 2px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary {
  color: #061018;
  background: linear-gradient(135deg, #5cf0ff, #34e6ff 45%, #8c7bff);
  border-color: transparent;
  box-shadow: 0 6px 24px rgba(52, 230, 255, 0.28);
}
.btn.primary:hover:not(:disabled) { background: linear-gradient(135deg, #8af5ff, #5cf0ff 45%, #a79bff); box-shadow: 0 8px 30px rgba(52, 230, 255, 0.42); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.btn.small { font-size: 13px; padding: 10px 12px; }
.btn.primary.is-on { color: #061018; animation: searching 1.4s ease-in-out infinite; }
@keyframes searching { 50% { box-shadow: 0 0 34px rgba(109, 255, 158, 0.55); } }
.btn.is-on { border-color: var(--ok); color: var(--ok); box-shadow: 0 0 18px rgba(109, 255, 158, 0.2); }

.icon-btn {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 30;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(16, 20, 40, 0.75);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-btn .ico-off { display: none; }
.icon-btn.muted .ico-on { display: none; }
.icon-btn.muted .ico-off { display: block; color: var(--muted); }
.icon-btn:hover { border-color: rgba(255, 255, 255, 0.3); }

/* POLA */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }
input[type='text'] {
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type='text']:focus { border-color: var(--p1); box-shadow: 0 0 0 3px rgba(52, 230, 255, 0.15); }
.field.p2 input:focus { border-color: var(--p2); box-shadow: 0 0 0 3px rgba(255, 79, 216, 0.15); }

.code-input { flex: 1; text-transform: uppercase; letter-spacing: 0.4em; text-align: center; font-weight: 700; font-size: 20px !important; min-width: 0; }
.join-row { display: flex; gap: 10px; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.1); }

.quick-counts { font-size: 12px; color: var(--muted); text-align: center; }
.quick-counts b { color: var(--ok); }
.segmented .count { display: inline-block; min-width: 16px; margin-left: 5px; padding: 0 4px; border-radius: 6px; font-size: 11px; background: rgba(109, 255, 158, 0.18); color: var(--ok); }
.segmented .count:empty { display: none; }

.status-line { min-height: 1.3em; margin: 0; text-align: center; font-size: 14px; color: var(--muted); }
.status-line.error { color: var(--hot); }
.status-line.good { color: var(--ok); }

.segmented { display: flex; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 4px; gap: 4px; }
.segmented button {
  flex: 1;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  padding: 9px 6px;
  cursor: pointer;
}
.segmented button[aria-checked='true'] { background: rgba(140, 123, 255, 0.22); color: #fff; box-shadow: inset 0 0 0 1px rgba(140, 123, 255, 0.5); }
.segmented button:disabled { cursor: default; }
.segmented button:focus-visible { outline: 2px solid var(--p1); }

/* KLAWISZE / KROPKI */
kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  margin: 0 2px;
  font-family: inherit;
  font-size: 12px;
  text-align: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom-width: 2px;
  border-radius: 5px;
}
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.dot.p1 { background: var(--p1); box-shadow: 0 0 8px var(--p1); }
.dot.p2 { background: var(--p2); box-shadow: 0 0 8px var(--p2); }
.controls-hint { display: grid; gap: 6px; font-size: 13px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.local-players { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .local-players { grid-template-columns: 1fr; } }

/* LOBBY */
.room-code-box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; border-radius: var(--radius); background: rgba(0, 0, 0, 0.3); border: 1px dashed rgba(140, 123, 255, 0.35); }
.room-code { font-size: clamp(34px, 9vw, 48px); font-weight: 700; letter-spacing: 0.3em; margin-left: 0.3em; color: #fff; text-shadow: 0 0 16px rgba(140, 123, 255, 0.6); }
.room-code-box .row { width: 100%; }

.lobby-players { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.vs { align-self: center; font-weight: 700; color: var(--muted); letter-spacing: 0.1em; }
.player-card {
  border-radius: var(--radius);
  padding: 14px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  min-height: 118px;
  justify-content: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.player-card .avatar { width: 34px; height: 34px; border-radius: 50%; border: 3px solid currentColor; box-shadow: 0 0 14px currentColor; }
.player-card.p1 { color: var(--p1); }
.player-card.p2 { color: var(--p2); }
.player-card.filled { border-color: currentColor; box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.03); }
.player-card .pname { color: var(--text); font-weight: 700; font-size: 16px; word-break: break-word; }
.player-card .ptag { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; }
.player-card .pstate { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.player-card .pstate.ready { color: var(--ok); background: rgba(109, 255, 158, 0.1); }
.player-card .pstate.off { color: var(--hot); background: rgba(255, 74, 61, 0.1); }
.player-card.empty .avatar { border-style: dashed; box-shadow: none; opacity: 0.4; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.9; } }

/* ARENA */
#screen-game { flex-direction: column; justify-content: flex-start; gap: 10px; padding: 12px 16px; overflow: hidden; }
.hud {
  width: 100%;
  max-width: 1400px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding-right: 52px; /* miejsce na przycisk wyciszenia */
  padding-left: 52px;
}
.hud-player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hud-player.p2 { justify-content: flex-end; text-align: right; }
.hud-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.hud-player.p1 .hud-dot { background: var(--p1); box-shadow: 0 0 12px var(--p1); }
.hud-player.p2 .hud-dot { background: var(--p2); box-shadow: 0 0 12px var(--p2); }
.hud-name { font-weight: 700; font-size: clamp(13px, 1.6vw, 17px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-player.p1 .hud-name { color: var(--p1); }
.hud-player.p2 .hud-name { color: var(--p2); }
.hud-state { font-size: 11px; letter-spacing: 0.12em; color: var(--muted); }
.hud-player.dead .hud-dot { background: #3a3f55; box-shadow: none; }
.hud-player.dead .hud-state { color: var(--hot); }
.hud-player.away .hud-state { color: var(--warn); }
.hud-center { text-align: center; }
.hud-time { font-size: clamp(26px, 4vw, 40px); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; line-height: 1; }
.hud-level { font-size: 11px; letter-spacing: 0.18em; color: var(--warn); margin-top: 4px; }

.arena-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#canvas { display: block; border-radius: 10px; }

.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.modal-overlay { align-items: flex-start; pointer-events: auto; background: rgba(5, 7, 15, 0.55); backdrop-filter: blur(3px); animation: fadeIn 0.3s ease; padding: 12px; overflow-y: auto; }
.countdown { font-size: clamp(70px, 16vw, 170px); font-weight: 700; color: #fff; text-shadow: 0 0 30px rgba(140, 123, 255, 0.8); }
.countdown .num { animation: pop 0.9s ease-out forwards; }
.countdown .go { color: var(--ok); text-shadow: 0 0 30px rgba(109, 255, 158, 0.8); animation: popOut 0.8s ease-out forwards; }
@keyframes pop { 0% { transform: scale(1.8); opacity: 0; } 20% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(0.85); opacity: 0; } }
@keyframes popOut { 0% { transform: scale(0.6); opacity: 0; } 25% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }

.fx-banner { align-items: flex-start; padding-top: 12%; }
.fx-banner .msg { font-size: clamp(18px, 3.2vw, 30px); font-weight: 700; letter-spacing: 0.1em; text-align: center; padding: 8px 18px; border-radius: 12px; background: rgba(5, 7, 15, 0.7); border: 1px solid currentColor; box-shadow: 0 0 24px currentColor; animation: fxIn 1.6s ease-out forwards; }
.fx-banner .msg small { display: block; font-size: 0.5em; letter-spacing: 0.15em; color: var(--muted); }
@keyframes fxIn { 0% { transform: scale(1.4); opacity: 0; } 12% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }

.game-footer { width: 100%; max-width: 1400px; display: flex; justify-content: space-between; gap: 12px; min-height: 16px; }

/* KONIEC RUNDY */
.end-panel { text-align: center; }
.end-badge { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; border: 4px solid currentColor; box-shadow: 0 0 30px currentColor, inset 0 0 18px currentColor; }
.end-title { margin: 0; font-size: clamp(28px, 6vw, 40px); letter-spacing: 0.12em; }
.end-times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.end-time { border-radius: 12px; padding: 10px; background: rgba(0, 0, 0, 0.3); border: 1px solid currentColor; display: flex; flex-direction: column; gap: 2px; }
.end-time.p1 { color: var(--p1); }
.end-time.p2 { color: var(--p2); }
.end-time { text-align: left; gap: 6px; }
.end-time .who { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.end-time .res { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); }
.end-time.winner .res { color: var(--ok); }
.end-time .lbl { font-size: 10px; letter-spacing: 0.12em; color: var(--muted); margin-top: 2px; }
.end-time .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.end-time .none { font-size: 12px; color: var(--muted); }
.end-series { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: -4px; }
.end-series:empty { display: none; }
.end-series .lbl { font-size: 10px; letter-spacing: 0.18em; color: var(--muted); }
.series-score { display: flex; align-items: baseline; justify-content: center; gap: 10px; max-width: 100%; }
.series-score .name { font-weight: 700; font-size: 14px; max-width: 38%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.series-score .name.p1 { color: var(--p1); }
.series-score .name.p2 { color: var(--p2); }
.series-score .score { font-size: 24px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.series-life { font-size: 12px; color: var(--muted); }
.chip { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; border: 1px solid currentColor; background: rgba(0, 0, 0, 0.3); white-space: nowrap; }
.end-duration { display: flex; flex-direction: column; align-items: center; }
.end-duration .lbl { font-size: 10px; letter-spacing: 0.18em; color: var(--muted); }
.end-duration .val { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.end-time.winner { box-shadow: 0 0 22px currentColor; }

/* JAK GRAĆ */
.dialog { padding: 0; border: 0; background: transparent; color: var(--text); max-width: min(560px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(3, 4, 10, 0.7); backdrop-filter: blur(3px); }
.dialog-panel { width: 100%; }
.howto { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 15px; line-height: 1.45; }
.warn-text { color: var(--warn); font-weight: 700; }
.hot-text { color: var(--hot); font-weight: 700; }
.legend { display: grid; gap: 10px; }
.legend-item { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.lg { flex: none; width: 44px; height: 30px; position: relative; border-radius: 6px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.lg-meteor::after { content: ''; position: absolute; left: 10px; top: 3px; width: 24px; height: 24px; border-radius: 50%; border: 2px dashed var(--warn); background: radial-gradient(circle, var(--hot) 35%, transparent 40%); }
.lg-block::after { content: ''; position: absolute; left: 13px; top: 0; width: 18px; height: 30px; background: linear-gradient(rgba(255, 181, 71, 0.4), transparent); }
.lg-block::before { content: ''; position: absolute; left: 13px; top: 8px; width: 18px; height: 14px; background: var(--hot); border-radius: 3px; z-index: 1; }
.lg-beam::after { content: ''; position: absolute; left: 0; right: 0; top: 11px; height: 8px; background: var(--hot); box-shadow: 0 0 8px var(--hot); }

/* TOASTY */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 50; pointer-events: none; width: min(92vw, 420px); }
.toast { background: rgba(16, 20, 40, 0.95); border: 1px solid var(--panel-border); border-left: 3px solid var(--accent); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); animation: toastIn 0.25s ease; text-align: center; }
.toast.good { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--hot); }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: all 0.3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  .hud { padding-left: 0; padding-right: 48px; gap: 6px; }
  .hud-state { font-size: 10px; }
  .lobby-players { grid-template-columns: 1fr; }
  .vs { justify-self: center; }
}

@media (max-height: 640px) {
  .panel { padding: 16px 20px; gap: 9px; }
  .btn { padding: 10px 14px; font-size: 14px; }
  .end-badge { width: 40px; height: 40px; border-width: 3px; }
  .end-title { font-size: 26px; }
  .end-time .val { font-size: 19px; }
  .logo-dodge { font-size: 46px; }
  .tagline { font-size: 13px; }
  .player-card { min-height: 92px; padding: 10px; }
  .room-code-box { padding: 10px; }
  #screen-game { padding: 8px 12px; gap: 6px; }
  .hud-time { font-size: 26px; }
}

/* ---------- Telefon / ekran dotykowy ---------- */
button { touch-action: manipulation; }
.touch-only { display: none; font-size: 13px; }
body.touch .touch-only { display: block; }
body.touch { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
body.touch input, body.touch textarea { -webkit-user-select: text; user-select: text; }
#screen-game .arena-wrap { touch-action: none; }
.icon-btn.fullscreen { right: 62px; }
.icon-btn.pause { right: 112px; }
body:not([data-screen='game']) .icon-btn.pause { display: none; }
body.touch .hud { padding-right: 160px; }

.stick {
  position: absolute;
  width: 112px;
  height: 112px;
  margin: -56px 0 0 -56px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  pointer-events: none;
  z-index: 5;
}
.stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50px;
  height: 50px;
  margin: -25px 0 0 -25px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.5);
}
.stick-p1 { border-color: rgba(52, 230, 255, 0.45); }
.stick-p1 .stick-knob { background: rgba(52, 230, 255, 0.35); border-color: var(--p1); box-shadow: 0 0 16px rgba(52, 230, 255, 0.5); }
.stick-p2 { border-color: rgba(255, 79, 216, 0.45); }
.stick-p2 .stick-knob { background: rgba(255, 79, 216, 0.35); border-color: var(--p2); box-shadow: 0 0 16px rgba(255, 79, 216, 0.5); }

.touch-hint { align-items: flex-end; padding-bottom: 8%; gap: 10%; }
.touch-hint .hint { font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-align: center; padding: 8px 14px; border-radius: 10px; background: rgba(5, 7, 15, 0.7); border: 1px dashed rgba(255, 255, 255, 0.35); }
.touch-hint .hint.p1 { color: var(--p1); border-color: var(--p1); }
.touch-hint .hint.p2 { color: var(--p2); border-color: var(--p2); }

.rotate-hint { display: none; position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); font-size: 12px; color: var(--warn); background: rgba(5, 7, 15, 0.75); padding: 4px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; }
@media (orientation: portrait) {
  body.touch .rotate-hint { display: block; }
}
/* Telefon w pionie: czas na górze, gracze pod nim – pod przyciskami w rogu. */
@media (max-width: 640px) {
  body.touch .hud { grid-template-columns: 1fr 1fr; padding: 50px 0 0 0; row-gap: 6px; }
  body.touch .hud-center { grid-column: 1 / -1; grid-row: 1; }
  body.touch .hud-level { white-space: normal; }
}

@media (max-height: 500px) {
  .game-footer { display: none; }
  #screen-game { padding: 4px 8px; gap: 4px; }
  .hud-time { font-size: 22px; }
  .hud-level { font-size: 10px; margin-top: 1px; }
  .hud-state { font-size: 9px; }
  .icon-btn { top: 6px; width: 38px; height: 38px; }
  .icon-btn.fullscreen { right: 52px; }
  .icon-btn.pause { right: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

