* {
  box-sizing: border-box; margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
}
input, textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
html, body {
  height: 100%; height: 100dvh; overflow: hidden; background: #07121d; overscroll-behavior: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #eaf2f8; -webkit-tap-highlight-color: transparent;
}
#app {
  position: relative; width: 100vw; height: 100vh; height: 100dvh;
  display: grid; place-items: center; overflow: hidden;
}
canvas#game {
  display: block; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.55);
  touch-action: none; cursor: crosshair; background: #12263f;
}

/* верхняя панель */
#topbar {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: min(96vw, 1100px); display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px; border-radius: 12px; pointer-events: none;
  background: rgba(5, 18, 30, .62); backdrop-filter: blur(6px);
  border: 1px solid rgba(120, 190, 255, .18); font-size: 14px;
}
#topbar .team { display: flex; align-items: center; gap: 8px; min-width: 150px; }
#topbar .team.right { justify-content: flex-end; }
#topbar .dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
#topbar .tname { font-weight: 600; letter-spacing: .2px; }
#topbar .alive { font-size: 12px; opacity: .75; background: rgba(255,255,255,.08); padding: 1px 7px; border-radius: 99px; }
#topbar .chips { display: flex; gap: 3px; }
#topbar .chip { width: 16px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.14); overflow: hidden; }
#topbar .chip i { display: block; height: 100%; width: 100%; background: #51cf66; transition: width .2s, background .2s; }
#topbar .center { display: flex; align-items: center; gap: 14px; }
.snd {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  color: #cfe3f2; border-radius: 8px; width: 26px; height: 26px; font-size: 13px;
  cursor: pointer; pointer-events: auto; line-height: 1;
}
.snd.off { opacity: .35; text-decoration: line-through; }
#timer { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; color: #ffe066; min-width: 34px; text-align: center; }
#wind { display: flex; align-items: center; gap: 4px; font-size: 13px; opacity: .9; }
#windArrow { font-size: 16px; color: #8ecae6; transition: transform .2s; }
#turnLabel { font-size: 12px; opacity: .6; }

/* текущий червь */
#wormbar {
  position: absolute; bottom: 62px; left: 12px;
  width: 140px; padding: 5px 8px; border-radius: 9px;
  background: rgba(5, 18, 30, .6); border: 1px solid rgba(120,190,255,.15);
  font-size: 12px; pointer-events: none;
}
#wormbar .wname { display: flex; justify-content: space-between; margin-bottom: 4px; font-weight: 600; }
#hpwrap { height: 6px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; }
#hpbar { height: 100%; width: 100%; background: #51cf66; transition: width .15s; }
#jetwrap, #powerwrap { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 11px; opacity: .9; }
#powerwrap .pmeter { flex: 1; height: 6px; background: rgba(255,255,255,.15); border-radius: 3px; overflow: hidden; }
#powerbar { height: 100%; width: 0%; background: linear-gradient(90deg, #ffd43b, #ff922b); border-radius: 3px; }
#jetwrap .fuel { flex: 1; height: 4px; background: rgba(255,255,255,.15); border-radius: 3px; }
#fuelbar { height: 100%; width: 100%; background: #ff922b; border-radius: 3px; }

/* оружие */
#weapons {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px; padding: 5px; border-radius: 12px; max-width: 96vw; overflow-x: auto;
  background: rgba(5, 18, 30, .66); border: 1px solid rgba(120,190,255,.15);
}
.wbtn {
  position: relative; min-width: 54px; padding: 5px 6px 4px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  color: #dfeaf3; font-size: 10px; text-align: center; line-height: 1.15; user-select: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}
.ic-svg { width: 21px; height: 21px; display: block; color: inherit; }
.ic-svg.md { width: 22px; height: 22px; }
.ic-svg.lg { width: 38px; height: 38px; }
.wbtn .ic { display: block; line-height: 0; }
.wbtn .nm { display: none; }
.wbtn .lbl { display: block; font-size: 8px; line-height: 1.1; opacity: .75; margin-top: 1px; }
.wbtn .k { position: absolute; top: 1px; left: 4px; font-size: 8px; opacity: .5; }
.wbtn .am { position: absolute; top: 1px; right: 4px; font-size: 9px; color: #ffe066; }
.wbtn.active { background: rgba(255, 212, 59, .22); border-color: rgba(255,212,59,.8); box-shadow: 0 0 10px rgba(255,212,59,.25); }

/* кнопка текущего оружия и лист выбора */
.wcur {
  display: none; align-items: center; gap: 6px; min-height: 44px; padding: 4px 10px;
  border-radius: 10px; background: rgba(255,212,59,.16); border: 1px solid rgba(255,212,59,.5);
  color: #ffe066; font-size: 11px; font-weight: 600; cursor: pointer; pointer-events: auto;
}
.wcur .ic { font-size: 18px; line-height: 1; }
.wcur .tx { max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 25;
  background: linear-gradient(180deg, rgba(12, 28, 42, .98), rgba(6, 16, 26, .99));
  border-top: 1px solid rgba(120,190,255,.25); border-radius: 16px 16px 0 0;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -12px 30px rgba(0,0,0,.55);
}
.sheetHead { display: flex; align-items: center; justify-content: space-between; font-size: 12px; opacity: .8; margin-bottom: 8px; }
.sheetX { background: none; border: none; color: #cfe3f2; font-size: 16px; cursor: pointer; padding: 4px 8px; }
.sheetGrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wcard {
  padding: 8px 4px 6px; border-radius: 10px; text-align: center; cursor: pointer;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); color: #dfeaf3;
  font-size: 9px; line-height: 1.2; min-height: 56px;
}
.wcard .ic { display: block; font-size: 18px; margin-bottom: 2px; }
.wcard .nm2 { display: block; font-size: 9px; line-height: 1.15; margin-top: 2px; }
.wcard .am { font-size: 9px; color: #ffe066; }
.ic-svg.sm { width: 16px; height: 16px; }
.pad, .endbtn, .wcur, .snd { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.wcard.active { background: rgba(255,212,59,.2); border-color: rgba(255,212,59,.8); }
.wcard.empty { opacity: .35; }
.wbtn.empty { opacity: .32; }
#bottom { position: absolute; bottom: 78px; left: 12px; right: 12px; display: none; justify-content: space-between; pointer-events: none; }
.pad.on { background: rgba(255,212,59,.28); border-color: rgba(255,212,59,.8); }
.pad, .endbtn {
  pointer-events: auto; background: rgba(5,18,30,.7); color: #eaf2f8; border: 1px solid rgba(120,190,255,.25);
  border-radius: 10px; padding: 8px 12px; font-size: 13px; cursor: pointer; touch-action: none;
}
.endbtn { font-size: 12px; }
#hint {
  position: absolute; top: 54px; left: 50%; transform: translateX(-50%);
  font-size: 12px; opacity: .7; pointer-events: none; text-align: center;
  background: rgba(5,18,30,.5); padding: 4px 12px; border-radius: 99px;
  transition: opacity .4s, transform .4s; max-width: 90vw;
}
#hint.idle { opacity: 0; transform: translate(-50%, -6px); }

/* карточки апгрейдов */
.panel.wide { width: min(94vw, 720px); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 4px; }
.card {
  text-align: left; padding: 14px 12px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(180deg, rgba(38,74,104,.9), rgba(16,34,50,.95));
  border: 1px solid rgba(120,190,255,.25); color: #eaf2f8; transition: transform .12s, border-color .12s;
}
.card:hover, .card:active { transform: translateY(-2px); border-color: rgba(255,212,59,.8); }
.card .ic { font-size: 22px; display: block; margin-bottom: 6px; }
.card .nm { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.card .ds { font-size: 11.5px; line-height: 1.45; opacity: .75; }
#runChip {
  font-size: 11px; padding: 2px 8px; border-radius: 99px;
  background: rgba(255,212,59,.16); color: #ffe066; border: 1px solid rgba(255,212,59,.35);
}

/* оверлеи */
.overlay {
  position: absolute; inset: 0; display: flex; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px;
  background: radial-gradient(circle at 50% 30%, rgba(10,30,48,.82), rgba(3,9,15,.95));
  backdrop-filter: blur(4px); z-index: 20;
}
.overlay > .panel, .overlay > .rotbox { margin: auto; }
.hidden { display: none !important; }
.panel {
  width: min(92vw, 470px); padding: 26px 24px; border-radius: 16px; text-align: center;
  background: linear-gradient(180deg, rgba(20,44,66,.96), rgba(9,22,34,.98));
  border: 1px solid rgba(120,190,255,.22); box-shadow: 0 24px 70px rgba(0,0,0,.6);
}
.panel h1 { font-size: 26px; letter-spacing: 1px; margin-bottom: 6px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.logo-worm {
  display: inline-block; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff8f8f, #ff6b6b 60%, #b33a3a);
  box-shadow: inset -3px -4px 6px rgba(0,0,0,.25), 0 0 12px rgba(255,107,107,.35);
  position: relative;
}
.logo-worm::after {
  content: ''; position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: #0b1622; right: 5px; top: 7px;
}
.panel h1 span { font-size: 13px; opacity: .55; font-weight: 400; letter-spacing: 0; }
.panel h2 { font-size: 20px; margin-bottom: 8px; }
.panel .sub { font-size: 12.5px; opacity: .68; margin-bottom: 16px; line-height: 1.5; }
button.big {
  width: 100%; padding: 12px; margin-top: 8px; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: #06121c;
  background: linear-gradient(180deg, #ffe066, #f6b21d); border: none;
}
button.big.alt { background: linear-gradient(180deg, #74c0fc, #3b8ed0); color: #04121d; }
button.big:disabled { opacity: .4; cursor: default; }
button.small {
  margin-top: 12px; background: none; border: none; color: #94a9bb; cursor: pointer; font-size: 12px;
}
.row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: nowrap; }
.row button.big { flex: 0 0 auto; }
#roomInput {
  flex: 1 1 auto; min-width: 0; padding: 12px; border-radius: 10px; text-align: center; letter-spacing: 3px;
  text-transform: uppercase; font-size: 15px; font-weight: 700;
  background: rgba(255,255,255,.07); border: 1px solid rgba(120,190,255,.25); color: #eaf2f8;
}
#roomInput::placeholder { letter-spacing: 0; text-transform: none; font-weight: 400; font-size: 13px; }
.row button.big { margin-top: 0; width: auto; padding: 12px 18px; }
#roomCode { font-size: 38px; font-weight: 800; letter-spacing: 8px; color: #ffe066; margin: 6px 0 14px; }
.rules { margin-top: 18px; font-size: 11.5px; line-height: 1.7; opacity: .5; }

/* баннер хода */
#banner {
  position: absolute; top: 30%; left: 50%; transform: translateX(-50%);
  padding: 14px 34px; border-radius: 14px; font-size: 24px; font-weight: 800; letter-spacing: 1px;
  background: rgba(5,18,30,.72); border: 1px solid rgba(255,255,255,.15);
  animation: bannerIn .35s ease-out; pointer-events: none; z-index: 15; text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
@keyframes lookPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,212,59,0); }
  50% { box-shadow: 0 0 0 6px rgba(255,212,59,.18); }
}
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, 14px) scale(.94); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
#toast {
  position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%);
  padding: 8px 16px; border-radius: 10px; font-size: 13px; color: #e6f0fa;
  background: rgba(18, 38, 58, .96); border: 1px solid rgba(120, 190, 255, .28);
  box-shadow: 0 10px 24px rgba(0,0,0,.45); z-index: 30; max-width: 86vw; text-align: center;
}
#toast.err { background: rgba(200, 50, 50, .95); border-color: rgba(255,140,140,.45); color: #fff; }

/* ── поворот экрана ── */
#rotate {
  position: absolute; inset: 0; z-index: 40; display: grid; place-items: center;
  background: rgba(4, 12, 20, .92); backdrop-filter: blur(3px); padding: 24px;
}
#rotate .rotbox { text-align: center; max-width: 340px; width: 100%; }
#rotate .phone {
  width: 62px; height: 108px; margin: 0 auto 18px; border-radius: 12px;
  border: 3px solid #74c0fc; animation: rot 2.2s ease-in-out infinite;
}
@keyframes rot {
  0%, 35% { transform: rotate(0deg); }
  60%, 100% { transform: rotate(90deg); }
}
#rotate .rottxt { font-size: 15px; line-height: 1.5; color: #dbe9f5; margin-bottom: 16px; }
#btnRotateOk {
  display: block; width: 100%; padding: 15px 20px; border: 0; cursor: pointer;
  border-radius: 14px; font: 800 16px/1 var(--font, system-ui); letter-spacing: .02em;
  color: #08131f; background: linear-gradient(180deg, #ffe066, #f2b200);
  box-shadow: 0 6px 0 #8a6a00, 0 12px 26px rgba(0,0,0,.45);
  transition: transform .08s ease, box-shadow .08s ease;
}
#btnRotateOk:hover { filter: brightness(1.06); }
#btnRotateOk:active { transform: translateY(4px); box-shadow: 0 2px 0 #8a6a00, 0 6px 14px rgba(0,0,0,.4); }
#rotate .rotHint { margin-top: 12px; font-size: 12px; color: #8fa8bd; }

/* ── мобильная раскладка ── */
@media (max-width: 900px) {
  #hint { top: 48px; font-size: 11px; padding: 3px 10px; max-width: 94vw; }
  #btnLook.attn { animation: lookPulse 1.6s ease-in-out infinite; }
  #weapons { display: none; }
  .wcur { display: flex; }
  #bottom { display: flex; align-items: center; gap: 8px; bottom: 70px; }
  #wormbar { bottom: 118px; left: 50%; transform: translateX(-50%); width: 150px; }
  #topbar {
    font-size: 12px; padding: 4px 8px; width: calc(100vw - 12px);
    padding-top: max(4px, env(safe-area-inset-top));
  }
  #topbar .tname { font-size: 11px; }
  #topbar .chips .chip { width: 12px; height: 5px; }
  #timer { font-size: 18px; }
  #turnLabel { display: none; }
  .wbtn { min-width: 44px; min-height: 44px; padding: 6px 6px; }
  .wbtn .k, .wbtn .nm { display: none; }
  .cards { grid-template-columns: 1fr; }
  .wbtn .ic { font-size: 15px; }
  .panel h1 { font-size: 21px; }
  .pad, .endbtn { min-height: 44px; min-width: 44px; font-size: 14px; }
  .endbtn { flex: 1; }
  #weapons {
    padding: 6px; gap: 6px;
    bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 12px);
    scrollbar-width: none;
  }
  #weapons::-webkit-scrollbar { display: none; }
  #bottom { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  #menu .panel { padding: 20px 18px; }
  button.big { padding: 14px; font-size: 15px; }
  #roomInput { font-size: 16px; }
}

@media (max-width: 380px) {
  .row { flex-direction: column; }
  .row button.big { width: 100%; }
}

@media (max-width: 480px) {
  #topbar .tname { display: none; }
  #topbar .team { min-width: auto; gap: 5px; }
  #topbar .chips .chip { width: 10px; height: 5px; }
  #topbar .center { gap: 8px; }
  .snd { width: 22px; height: 22px; font-size: 11px; }
  #timer { font-size: 16px; }
  #wind { font-size: 11px; }
}

/* низкие экраны: адресная строка и маленькие телефоны */
@media (max-height: 560px) {
  .panel { padding: 14px 14px; }
  .panel h1 { font-size: 18px; gap: 6px; }
  .logo-worm { width: 18px; height: 18px; }
  .panel .sub { font-size: 11px; margin-bottom: 8px; }
  button.big { padding: 9px; font-size: 13px; margin-top: 6px; }
  .row { margin-top: 6px; }
  #roomInput { padding: 9px; font-size: 14px; }
  .rules { display: none; }
  #roomCode { font-size: 26px; letter-spacing: 5px; margin: 4px 0 8px; }
}

@media (max-height: 700px) {
  #hint { display: none; }
  .wbtn { min-height: 40px; padding: 4px 4px 3px; }
  .wbtn .ic { font-size: 15px; }
  .wbtn .lbl { font-size: 7px; }
  #weapons { padding: 4px; gap: 4px; bottom: calc(4px + env(safe-area-inset-bottom, 0px)); }
  #bottom { bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  #wormbar { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
  #topbar { padding-top: 3px; padding-bottom: 3px; }
}

@media (max-height: 620px) {
  #wormbar { display: none; }
  .wbtn { min-height: 36px; }
  .wbtn .lbl { display: none; }
}


/* ── язык и приглашение ─────────────────────────────────────────────── */
.langbtn {
  margin-left: 8px; padding: 3px 9px; border-radius: 999px; cursor: pointer;
  font: 700 12px/1 var(--font, system-ui); letter-spacing: .04em;
  color: #0b1a28; background: #ffd43b; border: 0; vertical-align: middle;
  box-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.langbtn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }

.invite { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 2px 0 14px; }
#qrbox {
  width: clamp(150px, 46vw, 200px);
  padding: 9px; background: #fff; border-radius: 18px; line-height: 0;
  box-shadow: 0 12px 26px rgba(0,0,0,.45), 0 0 0 3px rgba(255,212,59,.14);
}
#qrcode { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: 6px; image-rendering: pixelated; }
#qrbox.empty { background: rgba(255,255,255,.07); box-shadow: none; border: 1px dashed rgba(160,190,215,.35); }
#qrbox.empty #qrcode { visibility: hidden; }
.inviteSide { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.inviteLabel {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #7f93a6;
}
#roomCode {
  font: 800 clamp(26px, 8.5vw, 36px)/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .16em; color: #ffe066; text-shadow: 0 2px 0 rgba(0,0,0,.45);
  padding-left: .16em;
}
.ghostbtn {
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font: 600 12px/1 var(--font, system-ui); color: #d7e7f5;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18);
  transition: background .15s ease;
}
.ghostbtn:active { background: rgba(255,255,255,.18); }

#wait .panel { padding-bottom: 18px; }
#wait h2 { margin-bottom: 6px; }
#waitStatus {
  display: inline-block; padding: 5px 12px; border-radius: 999px; margin: 2px 0 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  font-size: 12px; color: #a9c0d4;
}
#wait .big:disabled {
  background: linear-gradient(180deg, #24384c, #1a2b3c);
  color: #7f93a6; box-shadow: none; border: 1px dashed rgba(160,190,215,.35);
  cursor: default;
}


/* альбомная ориентация телефона: приглашение в две колонки, чтобы влезло без прокрутки */
@media (max-height: 520px) {
  #wait .panel { width: min(94vw, 620px); padding: 14px 16px; }
  #wait h2 { font-size: 18px; margin: 0 0 2px; }
  #wait .sub { font-size: 11px; line-height: 1.35; margin: 0 auto 6px; max-width: 46ch; }
  .invite { flex-direction: row; align-items: center; gap: 16px; margin: 2px 0 6px; }
  #qrbox { width: clamp(104px, 15vh, 132px); padding: 6px; border-radius: 12px; }
  .inviteLabel { font-size: 9px; }
  #roomCode { font-size: 26px; }
  .ghostbtn { padding: 6px 12px; font-size: 11px; }
  #waitStatus { margin: 0 0 8px; padding: 3px 10px; font-size: 11px; }
  #wait .big { padding: 10px 14px; }
  #wait .small { margin-top: 4px; }
}

.warn {
  color: #ffc9c9; background: rgba(224,49,49,.14); border: 1px solid rgba(255,107,107,.35);
  border-radius: 10px; padding: 7px 10px; font-size: 11px; line-height: 1.4; margin: 0 0 8px;
}

/* установка PWA и подсказка про «на экран Домой» */
.big.ghost {
  background: rgba(255,255,255,.06); color: #cfe3f5; box-shadow: none;
  border: 1px solid rgba(255,255,255,.22); font-weight: 600;
}
.big.ghost:hover { background: rgba(255,255,255,.12); }
.installHint {
  margin: 10px 0 0; padding: 9px 11px; border-radius: 10px; text-align: left;
  font-size: 12px; line-height: 1.45; color: #b9cfe2;
  background: rgba(77,171,247,.10); border: 1px solid rgba(77,171,247,.28);
}

.iosSteps {
  margin: 4px 0 14px; padding: 10px 12px; border-radius: 10px; text-align: left;
  font-size: 13px; line-height: 1.6; color: #cfe3f5;
  background: rgba(77,171,247,.10); border: 1px solid rgba(77,171,247,.25);
}
.iosSteps b { color: #ffe066; }

/* кнопка «вернуться к активному червю», когда камера уведена */
.recenter {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 158px; z-index: 18;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font: 700 12px/1 var(--font, system-ui); color: #08131f;
  background: linear-gradient(180deg, #ffe066, #f2b200);
  border: 0; box-shadow: 0 4px 0 #8a6a00, 0 8px 18px rgba(0,0,0,.4);
  animation: rcPulse 1.8s ease-in-out infinite;
}
.recenter:active { transform: translateX(-50%) translateY(3px); box-shadow: 0 1px 0 #8a6a00; }
.recenter .rc-ic { font-size: 13px; }
@keyframes rcPulse {
  0%, 100% { box-shadow: 0 4px 0 #8a6a00, 0 8px 18px rgba(0,0,0,.4); }
  50% { box-shadow: 0 4px 0 #8a6a00, 0 8px 26px rgba(255,212,59,.45); }
}
@media (max-width: 900px) { .recenter { bottom: 196px; } }

/* десктоп: раньше нижней панели не было вообще (только клавиши) — теперь есть кнопки хода и движения */
@media (min-width: 901px) {
  #bottom { display: block; left: 0; right: 0; bottom: 10px; pointer-events: none; }
  #bottom > * { pointer-events: auto; }
  #btnWeapon { display: none; }
  #btnLeft { position: absolute; left: 16px; bottom: 4px; }
  #btnRight { position: absolute; left: 78px; bottom: 4px; }
  #btnLook { position: absolute; right: 148px; bottom: 4px; }
  #btnEnd { position: absolute; right: 16px; bottom: 4px; }
}
