:root { --ink: #fff6c8; --bg: #10121c; --panel: #1b1f33; --edge: #3a4166; --accent: #ffcc33; --bad: #ff6a5a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font-family: 'Press Start 2P', ui-monospace, monospace; font-size: 11px; line-height: 1.6; image-rendering: pixelated; user-select: none; }
.screen { position: fixed; inset: 0; display: none; }
.screen.show { display: block; }
#menu, #room { background:
  repeating-linear-gradient(45deg, #151a2c 0 18px, #121626 18px 36px); }
#room.show { display: grid; place-items: center; padding: 16px; overflow: auto; }
#menu.show { display: block; overflow-y: auto; }
.panel { background: var(--panel); border: 4px solid var(--edge); box-shadow: 0 0 0 4px #000, 8px 8px 0 4px #0008;
  padding: 22px; width: min(560px, 100%); display: flex; flex-direction: column; gap: 12px; }
.logo { display: flex; flex-direction: column; align-items: center; font-size: 46px; line-height: 1.05; letter-spacing: 2px; }
.logo span:first-child { color: #e0a24a; text-shadow: 4px 4px 0 #6a3c12, 8px 8px 0 #000; }
.logo span:last-child { color: var(--accent); text-shadow: 4px 4px 0 #8a4a10, 8px 8px 0 #000; }
.sub { text-align: center; color: #9aa3cc; font-size: 9px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 9px; color: #9aa3cc; }
input, select, button { font: inherit; color: var(--ink); background: #0d0f1a; border: 3px solid var(--edge); padding: 10px; outline: none; }
input:focus, select:focus { border-color: var(--accent); }
input { text-transform: uppercase; }
button { cursor: pointer; background: #2a3152; box-shadow: 0 4px 0 #000; transition: transform .05s; }
button:hover:not(:disabled) { background: #3a4470; }
button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
button:disabled { opacity: .5; cursor: default; }
button.big { background: #b8402e; border-color: #e86a4a; font-size: 13px; padding: 14px; }
button.big:hover:not(:disabled) { background: #d0503a; }
.row { display: flex; gap: 8px; } .row > * { flex: 1; } .grow { flex: 1; }
.row #code { flex: 0 0 110px; text-align: center; letter-spacing: 4px; }
.online { display: flex; flex-direction: column; gap: 8px; border-top: 3px dashed var(--edge); padding-top: 12px; }
.offline-note { display: none; font-size: 8px; color: #9aa3cc; text-align: center; }
body.offline .online { display: none; } body.offline .offline-note { display: block; }
.err { color: var(--bad); min-height: 14px; font-size: 9px; text-align: center; }
.how { font-size: 8px; line-height: 1.9; color: #b9c0e0; background: #0d0f1a; padding: 10px; border: 2px solid var(--edge); }
.how b { color: var(--accent); }
.code { font-size: 44px; text-align: center; color: var(--accent); letter-spacing: 10px; cursor: pointer; text-shadow: 4px 4px 0 #000; }
#slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot { display: flex; gap: 10px; align-items: center; padding: 10px; background: #0d0f1a; border: 3px solid #2a3152; }
.slot .sw { width: 24px; height: 24px; background: var(--c); box-shadow: 3px 3px 0 #000; flex: none; }
.slot .tn { color: var(--c); font-size: 10px; } .slot .pn { font-size: 8px; color: #b9c0e0; }
.slot.free { cursor: pointer; opacity: .75; } .slot.free:hover { opacity: 1; border-color: var(--c); }
.slot.mine { border-color: var(--accent); }

/* игра */
#view, #overlay { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#view { cursor: none; }
#overlay { pointer-events: none; }
#teams { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; pointer-events: none; }
.tm { background: #000a; border: 3px solid var(--c); padding: 5px 8px; min-width: 128px; font-size: 8px; }
.tm.me { box-shadow: 0 0 0 2px #fff; }
.tm.out { opacity: .4; filter: grayscale(1); }
.tm .nm { color: var(--c); white-space: nowrap; } .tm .nm i { font-style: normal; color: #888; font-size: 7px; }
.tm .hq { height: 6px; background: #222; margin: 4px 0; } .tm .hq span { display: block; height: 100%; background: var(--c); }
.tm .st { color: #ddd; font-size: 7px; }
#timer { position: absolute; top: 12px; right: 176px; font-size: 12px; text-shadow: 2px 2px 0 #000; pointer-events: none; }
#minimap { position: absolute; top: 10px; right: 10px; width: 152px; height: 152px; border: 3px solid var(--edge); box-shadow: 0 0 0 3px #000; image-rendering: pixelated; pointer-events: none; }
#feed { position: absolute; top: 176px; right: 10px; width: 260px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; font-size: 8px; pointer-events: none; }
#feed div { background: #000a; padding: 4px 6px; text-align: right; }
#toast { position: absolute; top: 25%; left: 50%; transform: translate(-50%, -10px); font-size: 16px; text-align: center; text-shadow: 3px 3px 0 #000; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#center { position: absolute; top: 45%; width: 100%; text-align: center; font-size: 18px; text-shadow: 3px 3px 0 #000; pointer-events: none; }
#bottom { position: absolute; left: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
#hpbox .lbl { font-size: 8px; color: #9aa3cc; }
.hpbar { width: 220px; height: 14px; background: #000a; border: 3px solid #000; }
.hpbar span { display: block; height: 100%; background: linear-gradient(#8f8 0 40%, #3c3 40%); transition: width .15s; }
#weapon { font-size: 13px; text-shadow: 2px 2px 0 #000; } #weapon b { color: var(--accent); }
#hint { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); font-size: 10px; text-shadow: 2px 2px 0 #000; background: #0008; padding: 6px 10px; pointer-events: none; white-space: nowrap; }
#hint:empty { display: none; }
#hint b { color: var(--accent); } #hint b.off { color: #666; }
#squad { position: absolute; right: 14px; bottom: 14px; text-align: right; font-size: 8px; text-shadow: 2px 2px 0 #000; pointer-events: none; }
#squad b { color: var(--accent); } #squad span { color: #888; }
#controls { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(720px, 94vw); max-height: 86vh; overflow: auto;
  background: #0d0f1ae8; border: 4px solid var(--edge); box-shadow: 0 0 0 4px #000; padding: 16px 18px; display: none; pointer-events: none; }
#controls.show { display: block; z-index: 5; }
#controls.show ~ #lockhint { display: none; }
#controls h3 { margin: 0 0 10px; color: var(--accent); font-size: 14px; text-align: center; text-shadow: 3px 3px 0 #000; }
#controls .close { text-align: center; color: #888; font-size: 8px; margin-top: 10px; }
.ctl summary { cursor: pointer; color: var(--accent); font-size: 10px; padding: 6px 0; }
#controls table, .ctl table, .ctlbox table { width: 100%; border-collapse: collapse; font-size: 8px; line-height: 1.7; }
#controls td, .ctl td, .ctlbox td { padding: 4px 6px; vertical-align: middle; border-bottom: 1px solid #ffffff12; color: #d6dbf0; }
#controls td:first-child, .ctl td:first-child, .ctlbox td:first-child { white-space: nowrap; text-align: right; width: 1%; }
#controls b, .ctl b, .ctlbox b { color: var(--accent); }
kbd { display: inline-block; font: inherit; font-size: 8px; color: #10121c; background: #f2ead0; border-radius: 3px; padding: 3px 5px 2px; box-shadow: 0 3px 0 #9a9070, 0 3px 0 1px #000; margin: 0 1px 3px; }
.gp { font-size: 7px; line-height: 1.9; color: #9aa3cc; margin-top: 8px; }
.ctlbox { max-height: 34vh; overflow: auto; background: #0d0f1a; border: 2px solid var(--edge); padding: 6px; }
#lockhint { position: absolute; bottom: 22%; left: 50%; transform: translateX(-50%); background: #000b; border: 3px solid var(--accent); padding: 10px 14px; font-size: 10px; display: none; pointer-events: none; text-align: center; }
#lockhint.show { display: block; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { border-color: #fff; } }
input[type=range] { padding: 6px 0; accent-color: var(--accent); }
#pause .panel { width: min(640px, 100%); max-height: 94vh; overflow: auto; }
.modal { position: absolute; inset: 0; display: none; place-items: center; background: #0009; z-index: 10; }
.modal.show { display: grid; }
.modal h1, .modal h2 { margin: 0; text-align: center; text-shadow: 4px 4px 0 #000; }
.modal h1 { font-size: 32px; }
.modal .who, .modal .note { text-align: center; font-size: 9px; } .modal .note { color: #888; }
.modal .stats { font-size: 8px; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 760px) {
  #teams { flex-wrap: wrap; justify-content: center; width: 96%; top: 170px; }
  .tm { min-width: 0; flex: 1 1 40%; }
  #hint { white-space: normal; width: 92%; text-align: center; bottom: 90px; }
  #feed { display: none; } #timer { right: auto; left: 14px; }
}

#squad .dots { color: #ffd84a; letter-spacing: 2px; font-size: 10px; }

.slot { position: relative; }
.slot .sb { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
button.mini { font-size: 7px; padding: 4px 6px; border-width: 2px; box-shadow: 0 2px 0 #000; }
.slot.empty { opacity: .45; }
.slot.empty .tn { text-decoration: line-through; }
select option { font-size: 10px; }

/* ---- главное меню ---- */
.menu-wrap { display: grid; grid-template-columns: minmax(300px, 400px) minmax(340px, 640px); gap: 18px; justify-content: center; align-items: start; padding: 24px 16px; min-height: 100%; align-content: center; }
.menu-left, .menu-right .panel { width: 100%; }
.menu-right { display: flex; flex-direction: column; gap: 18px; }
.menu-left .logo { font-size: 52px; margin: 6px 0 2px; }
.cap { font-size: 9px; color: var(--accent); letter-spacing: 1px; margin-bottom: 2px; }
.sum { font-size: 8px; color: #b9c0e0; text-align: center; line-height: 1.8; margin-top: -4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.map-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.map-card { position: relative; background: #0d0f1a; border: 3px solid var(--edge); padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 4px 0 #000; transition: transform .08s; text-align: left; }
.map-card:hover { transform: translateY(-2px); border-color: #6a74a8; }
.map-card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px #000, 0 0 14px #ffcc3355; }
.map-card canvas { width: 100%; aspect-ratio: 1; image-rendering: pixelated; display: block; border: 2px solid #000; background: #2f5a2a; }
.map-card .mn { font-size: 9px; color: var(--ink); }
.map-card .md { font-size: 6px; color: #9aa3cc; line-height: 1.6; min-height: 20px; }
.map-card .lv { position: absolute; top: 10px; right: 10px; font-size: 7px; background: #000c; padding: 3px 4px; color: var(--accent); }
.seg { display: flex; border: 3px solid var(--edge); box-shadow: 0 4px 0 #000; }
.seg button { flex: 1; border: 0; box-shadow: none; padding: 9px 4px; font-size: 9px; background: #0d0f1a; border-right: 2px solid var(--edge); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: #10121c; }
#menu-modal { position: fixed; z-index: 20; }
#menu-modal .panel { width: min(760px, 96vw); max-height: 92vh; overflow: auto; }
.ctlbox.big { max-height: none; }
#menu-rules { display: none; font-size: 9px; }
#menu-modal.rules #menu-rules { display: block; }
#menu-modal.rules #menu-controls { display: none; }
@media (max-width: 900px) {
  .menu-wrap { grid-template-columns: minmax(0, 560px); }
  .map-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .map-cards { grid-template-columns: repeat(2, 1fr); }
  .menu-left .logo { font-size: 40px; }
  .two { grid-template-columns: 1fr; }
}

#settings-modal { position: fixed; z-index: 20; }
#settings-modal .panel { width: min(560px, 96vw); }
.map-card canvas { aspect-ratio: 1.25; }

/* ---- иконки оружия и танка ---- */
img.ic { width: 56px; height: 56px; image-rendering: auto; filter: drop-shadow(2px 3px 0 #0008); vertical-align: middle; }
img.ic.big { width: 150px; height: 150px; }
img.ic.mini { width: 26px; height: 26px; filter: none; }
img.ic.hint { width: 34px; height: 34px; margin: -10px 4px -10px -4px; }
img.ic.toast { width: 64px; height: 64px; margin-right: 8px; }
#toast { display: flex; align-items: center; justify-content: center; }
#weapon { display: flex; align-items: center; gap: 8px; background: #000a; border: 3px solid #000; padding: 4px 12px 6px 6px; min-width: 210px; }
#weapon img.ic { width: 72px; height: 72px; }
#weapon .wn { font-size: 9px; color: #b9c0e0; }
#weapon b { font-size: 16px; }
#weapon .sm { font-size: 8px; color: #9aa3cc; }
#weapon .ab { width: 120px; height: 5px; background: #333; margin-top: 4px; } #weapon .ab span { display: block; height: 100%; background: var(--accent); }
#squad .tk { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; color: #fff; }
#menu-gallery { display: none; }
#menu-modal.arsenal #menu-gallery { display: block; }
#menu-modal.arsenal #menu-controls, #menu-modal.arsenal #menu-rules { display: none; }
.gallery { display: flex; flex-direction: column; gap: 12px; }
.wg { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.wc { background: #0d0f1a; border: 2px solid var(--edge); padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.wc img.ic { width: 96px; height: 96px; }
.wc b { font-size: 9px; color: var(--accent); } .wc span { font-size: 7px; color: #b9c0e0; line-height: 1.7; }
.wc.wide { grid-column: 1 / -1; flex-direction: row; text-align: left; } .wc.wide span { font-size: 8px; }
