:root { --bg: rgba(12, 16, 20, 0.72); --fg: #e6ece8; --dim: #a9b6b0; --acc: #e8c35a; --on: #3d7a4f; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0f12; color: var(--fg); font: 14px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif; }
#view canvas { display: block; }
.panel { position: fixed; background: var(--bg); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 10px 12px; }
.dim { color: var(--dim); } .small { font-size: 12px; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; font-size: 20px; color: var(--dim); }
#clock { top: 12px; left: 12px; min-width: 270px; max-width: 360px; }
#clock .row1 { display: flex; align-items: center; gap: 10px; }
#clock-time { font: 600 40px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 1px; }
#clock-date { font-size: 18px; margin-top: 4px; }
.badge { font: 600 11px/1 system-ui; padding: 4px 7px; border-radius: 5px; background: #2c6e43; color: #fff; }
.badge.test { background: #a8542b; }
.sep { height: 1px; background: rgba(255,255,255,0.12); margin: 8px 0; }
#wx-main { font-size: 15px; }
#probe { left: 12px; bottom: 12px; max-width: 560px; }
#bar { position: fixed; top: 12px; right: 12px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 60vw; }
button { background: var(--bg); color: var(--fg); border: 1px solid rgba(255,255,255,0.15); border-radius: 7px; padding: 7px 10px; font: inherit; cursor: pointer; }
button:hover { border-color: var(--acc); } button.on { background: var(--on); border-color: #6fbf87; }
#stats { position: fixed; right: 12px; top: 56px; text-align: right; text-shadow: 0 1px 2px #000; }
#help { display: none; left: 50%; transform: translateX(-50%); bottom: 12px; max-width: 760px; text-align: center; }
#help.open { display: block; }
#flash { position: fixed; top: 40%; left: 50%; transform: translateX(-50%); font-size: 18px; text-shadow: 0 1px 3px #000; opacity: 0; transition: opacity .4s; pointer-events: none; }
#crosshair { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); color: rgba(255,255,255,0.5); pointer-events: none; font-size: 18px; }
#test { display: none; top: 60px; right: 12px; width: 330px; max-height: calc(100vh - 110px); overflow: auto; }
#test.open { display: block; }
#test h3 { margin: 0 0 4px; font-size: 16px; } #test h4 { margin: 12px 0 6px; font-size: 13px; color: var(--dim); font-weight: 600; }
.hint { color: var(--dim); font-size: 12px; margin: 4px 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; } .grid.g4 { grid-template-columns: repeat(4, 1fr); }
.grid button { padding: 6px 4px; font-size: 12px; }
.wide { width: 100%; margin-top: 8px; }
#test input[type=range] { width: 100%; }
.fc { display: flex; gap: 4px; overflow-x: auto; font-size: 11px; text-align: center; }
.fc span { min-width: 40px; background: rgba(255,255,255,0.05); border-radius: 5px; padding: 3px; }
.maps div { font-size: 12px; padding: 4px 6px; border-radius: 5px; margin-bottom: 3px; background: rgba(255,255,255,0.04); }
.maps .act { outline: 1px solid var(--acc); }
.row { display: flex; gap: 6px; margin-top: 6px; } .row input { flex: 1; min-width: 0; background: #111; color: var(--fg); border: 1px solid #333; border-radius: 6px; padding: 6px; }
#mapview { display: none; position: fixed; inset: 0; background: rgba(5,8,10,0.92); padding: 10px; gap: 12px; }
#mapview.open { display: flex; }
.mapwrap { position: relative; } .mapwrap canvas { position: absolute; left: 0; top: 0; } .mapwrap canvas.over { cursor: crosshair; }
.mapwrap { flex: 0 0 auto; width: calc(min(100vw - 280px, 100vh - 20px)); height: calc(min(100vw - 280px, 100vh - 20px)); }
#map-side { position: static; width: 240px; overflow: auto; }
#map-side label { display: block; font-size: 13px; margin: 3px 0; cursor: pointer; }
#map-side h4 { margin: 10px 0 4px; color: var(--dim); font-size: 12px; }
@media (max-width: 700px) {
  #clock { min-width: 0; max-width: calc(100vw - 24px); } #clock-time { font-size: 30px; }
  #bar { top: auto; bottom: 120px; } #probe { display: none; } #test { width: calc(100vw - 24px); }
  #mapview { flex-direction: column; } #map-side { width: auto; }
}
/* ---- игровой интерфейс: прибор справа, компас слева внизу (js/hud.js) */
#gauge { right: 12px; top: 100px; width: 200px; padding: 10px; }
#gauge .lcd { background: linear-gradient(#a9b59a, #96a386); color: #1d2418; border-radius: 6px; padding: 6px 8px; font: 600 15px/1.35 ui-monospace, "SF Mono", Menlo, monospace; box-shadow: inset 0 1px 4px rgba(0,0,0,0.45); }
#gauge .lcd .l { display: flex; justify-content: space-between; }
#gauge .lcd .k { font-size: 11px; opacity: 0.75; text-transform: uppercase; align-self: center; }
#gauge .lcd b.warn { color: #7a0f0f; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
#gauge .bars { margin-top: 9px; display: grid; gap: 6px; }
#gauge .bar { position: relative; height: 15px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; font-size: 11px; }
#gauge .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c, #6fae5a); transition: width .4s; }
#gauge .bar .k { position: relative; z-index: 1; padding-left: 6px; line-height: 15px; text-shadow: 0 1px 2px #000; }
#gauge .bar em { position: absolute; right: 6px; top: 0; z-index: 1; font-style: normal; line-height: 15px; text-shadow: 0 1px 2px #000; }
#gauge .bar.warn i { animation: blink 1s steps(2) infinite; }
#g-health { --c: #c84a42; } #g-sat { --c: #c9953c; } #g-stamina { --c: #5fae5a; } #g-fatigue { --c: #7d6fc0; } #g-wet { --c: #3f8fd0; }
#gauge .stance { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-top: 2px; }
#gauge .eye { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #4c8 0%, #ec4 55%, #e54 100%); position: relative; opacity: 0.9; }
#gauge .eye::after { content: ""; position: absolute; top: -3px; left: var(--v, 0%); width: 3px; height: 14px; background: #fff; border-radius: 2px; transform: translateX(-1px); }
#compass { position: fixed; left: 12px; bottom: 12px; width: 150px; height: 178px; pointer-events: none; }
/* отладка (строки местности, fps) — только при открытой панели проверки */
body:not(.debug) #probe, body:not(.debug) #stats { display: none; }
body.debug #compass { bottom: auto; top: 50%; }
@media (max-width: 700px) { #gauge { width: 150px; top: auto; bottom: 200px; } #gauge .lcd { font-size: 12px; } }
#rating { display: none; left: 50%; top: 12%; transform: translateX(-50%); min-width: 420px; max-width: calc(100vw - 32px); max-height: 70vh; overflow: auto; z-index: 20; }
#rating.open { display: block; }
#rating h3 { margin: 0 0 8px; font-size: 16px; }
#rating table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
#rating th, #rating td { padding: 3px 8px; text-align: right; white-space: nowrap; }
#rating th:nth-child(2), #rating td:nth-child(2) { text-align: left; }
#rating th { opacity: .6; font-weight: 500; border-bottom: 1px solid rgba(255,255,255,.12); }
#rating tr.me td { color: #ffd479; }
#rating .gap td { opacity: .4; text-align: center; }
#rangefinder { display: none; position: fixed; left: 50%; bottom: 9%; transform: translateX(-50%); font: 600 18px ui-monospace, monospace; color: #ff5040; text-shadow: 0 0 6px rgba(255,60,40,.6); letter-spacing: .05em; pointer-events: none; z-index: 6; }

/* десктоп компактнее — как на телефоне (Иван 03.10): меньше панели, компас сверху по центру, справка по H */
@media (min-width: 701px) {
  body:not(.touch) #clock { transform: scale(0.7); transform-origin: top left; top: 8px; left: 8px; }
  body:not(.touch) #bar { transform: scale(0.85); transform-origin: top right; top: 8px; right: 8px; }
  body:not(.touch) #gauge { transform: scale(0.75); transform-origin: top right; top: 52px; right: 8px; }
  body:not(.touch) #compass { transform: scale(0.7); transform-origin: top center; left: calc(50% - 75px); top: 6px; bottom: auto; }
}
#helphint { position: fixed; left: 10px; bottom: 8px; font-size: 12px; opacity: 0.55; color: #fff; text-shadow: 0 1px 2px #000; pointer-events: none; }
body.touch #helphint { display: none; }

/* 03.10: полёт и панель проверки — только по 🛠 (разработка) */
body:not(.dev) .devonly { display: none; }
body.dev #b-dev { background: #3a5a3a; }
#help { text-align: left; line-height: 1.55; }

/* 03.10 меню ПК v2 (menu.js): выпадает под кнопкой, игру не перекрывает; круглые кнопки, одноцветные значки, олива/хаки */
#menu { display: none; position: fixed; top: 46px; right: 12px; z-index: 40; width: 300px; padding: 10px 12px 12px; border-radius: 12px;
  background: rgba(30,34,24,0.86); backdrop-filter: blur(6px); border: 1px solid rgba(196,180,130,0.28); box-shadow: 0 8px 24px rgba(0,0,0,0.35); color: #d8d2b8; }
#menu.open { display: block; }
#menu .m-h { font: 11px "Russo One", system-ui, sans-serif; text-transform: uppercase; letter-spacing: .14em; color: #a89c70; margin: 8px 2px 6px; }
#menu .m-h:first-child { margin-top: 0; }
#menu .m-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 4px; }
#menu .m-t { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; font: inherit; }
#menu .m-c { position: relative; width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(196,180,130,0.45); background: rgba(70,78,52,0.55); color: #d8d2b8; transition: background .12s, border-color .12s; }
#menu .m-c svg { width: 22px; height: 22px; }
#menu .m-t:hover .m-c { background: rgba(110,120,78,0.75); border-color: #cbbd8a; color: #f2ecd2; }
#menu .m-t.on .m-c { background: rgba(120,130,70,0.85); border-color: #d9c98f; }
#menu kbd { position: absolute; right: -5px; bottom: -3px; min-width: 15px; padding: 0 3px; font: 9px/14px ui-monospace, monospace; text-align: center;
  border-radius: 4px; background: #23271b; border: 1px solid rgba(196,180,130,0.45); color: #cfc59c; }
#menu .m-tx { font-size: 11px; line-height: 1.15; text-align: center; color: #c9c2a4; max-width: 66px; }
#b-menu.on { background: rgba(110,120,78,0.85); }
#menu-credits { position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,0.85); color: #eee; font: 13px system-ui; overflow: auto; display: flex; justify-content: center; cursor: pointer; }
#menu-credits .mc-in { max-width: 760px; padding: 24px 16px; }
#b-menu { font-weight: 600; }
body:not(.touch) #b-sound, body:not(.touch) #b-lang, body:not(.touch) #b-dev { display: none; }
body.touch #b-menu { display: none; }

/* 03.10 список действий по E (main.js actMenu) — у прицела, справа */
#actmenu { display: none; position: fixed; left: calc(50% + 28px); top: calc(50% - 12px); z-index: 30; min-width: 220px; padding: 6px; border-radius: 10px;
  background: rgba(30,34,24,0.86); border: 1px solid rgba(196,180,130,0.3); color: #e2dcc2; font: 14px system-ui; pointer-events: none; }
#actmenu .am { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; }
#actmenu .am.on { background: rgba(110,120,78,0.8); color: #fff; }
#actmenu kbd { font: 11px ui-monospace, monospace; padding: 0 5px; border-radius: 4px; background: #23271b; border: 1px solid rgba(196,180,130,0.45); }

/* 🛠, полёт и панель проверки — только по админ-ссылке ?admin= */
body:not(.admin) #b-dev, body:not(.admin) .devonly, body:not(.admin) #test { display: none !important; }
