/* ============================================================
   НЕЙРО-ЗАВОД — СТИЛИ ИГРОВОЙ ПЛОЩАДКИ
   Использует токены сайта (style.css): цвета, шрифты, радиусы.
   ============================================================ */

.game-body { background: var(--bg); }

.game-shell {
  position: relative;
  height: calc(100vh - 132px);
  min-height: 540px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(139,92,246,.10), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  border-bottom: 1px solid var(--border);
  user-select: none;
  -webkit-user-select: none;
}
.game-shell:fullscreen { height: 100vh; border: none; }
.game-shell:-webkit-full-screen { height: 100vh; border: none; }

.game-viewport {
  position: absolute; inset: 0; overflow: hidden;
}
.game-canvas {
  position: absolute; inset: 0;
  display: block;
  width: 100%; height: 100%;
  touch-action: none;
  cursor: default;
}
.game-canvas.is-building { cursor: crosshair; }
.game-canvas.is-panning  { cursor: grabbing; }
.game-canvas.is-removing { cursor: not-allowed; }

/* Активный пункт меню на странице завода */
.nav a.nav-active { color: var(--text); }
.nav a.nav-active::after { width: 100%; }

/* ============ ВЕРХНЯЯ ПАНЕЛЬ ============ */
.game-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px 16px;
  background: linear-gradient(180deg, rgba(7,7,12,.92), rgba(7,7,12,.55) 60%, transparent);
  pointer-events: none;
}
.game-top > * { pointer-events: auto; }

.gt-brand { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.gt-mark { color: var(--cyan); font-size: 16px; text-shadow: 0 0 12px var(--cyan); }
.gt-name {
  font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 14px; letter-spacing: .07em;
}
.gt-name em {
  font-style: normal;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gt-sub {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--dim);
  letter-spacing: .08em; text-transform: uppercase;
}

.stock-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.stock-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 5px; border-radius: 999px;
  background: rgba(12,12,20,.78); border: 1px solid var(--border);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--text);
  transition: border-color .25s;
}
.stock-chip img { width: 18px; height: 18px; image-rendering: auto; }
.stock-chip b { font-weight: 600; }
.stock-chip i { font-style: normal; color: var(--cyan); font-size: 10px; opacity: .85; }
.stock-chip.is-zero { opacity: .45; }
.stock-chip.is-hot { border-color: rgba(0,229,255,.55); }

.gt-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.gt-fps {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--dim);
  padding: 4px 9px; border: 1px solid var(--border); border-radius: 999px;
  background: rgba(12,12,20,.7); white-space: nowrap;
}
.gt-fps b { color: var(--cyan); font-weight: 600; }

.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--border);
  background: rgba(12,12,20,.78); color: var(--muted); font-size: 13px;
  backdrop-filter: blur(8px); transition: all .18s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-hi); }
.icon-btn.is-on { color: var(--cyan); border-color: rgba(0,229,255,.5); box-shadow: 0 0 14px rgba(0,229,255,.18); }
.icon-btn.is-muted { color: var(--dim); opacity: .6; }

/* ============ КАРТОЧКА КОНТРАКТА ============ */
.contract-card {
  position: absolute; top: 68px; left: 14px; z-index: 15;
  width: 252px; padding: 12px 14px;
  background: rgba(12,12,20,.82); border: 1px solid var(--border);
  border-left: 3px solid var(--violet); border-radius: 12px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
}
.cc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--violet);
  margin-bottom: 6px;
}
.cc-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cc-desc { font-size: 12px; color: var(--muted); line-height: 1.45; margin-bottom: 10px; }
.cc-need { display: flex; flex-direction: column; gap: 7px; }
.cc-item { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.cc-item img { width: 20px; height: 20px; }
.cc-item-name { flex: 1; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-item-num { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text); }
.cc-bar { height: 4px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 3px; }
.cc-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.cc-hint {
  margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--dim); line-height: 1.45;
}
.cc-hint b { color: var(--cyan); font-weight: 600; }
.cc-done { color: var(--green, #4ade80); }

/* ---- панель обучения ---- */
.cc-hide {
  position: absolute; top: 8px; right: 9px;
  width: 20px; height: 20px; padding: 0; line-height: 1;
  border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--dim); font-size: 11px; cursor: pointer;
  transition: color .16s, border-color .16s, background-color .16s;
}
.cc-hide:hover { color: var(--text); border-color: var(--border-hi); background: var(--surface); }
.tut-list { display: flex; flex-direction: column; gap: 8px; }
.tut-row { display: flex; gap: 8px; align-items: flex-start; }
.tut-mark {
  flex: none; width: 15px; text-align: center; font-size: 11px; line-height: 1.5;
  color: var(--dim);
}
.tut-done .tut-mark { color: #4ade80; }
.tut-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tut-text b { font-size: 12px; font-weight: 600; color: var(--text); }
.tut-text i { font-size: 11px; font-style: normal; color: var(--dim); line-height: 1.4; }
.tut-done .tut-text b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-hi); }
.tut-done .tut-text i { display: none; }
.tut-more { font-size: 11px; color: var(--dim); }

/* ---- жидкости ---- */
.fluid-row { display: flex; align-items: center; gap: 7px; font-size: 11.5px; margin-top: 6px; }
.fluid-head { color: var(--muted); }
.fl-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; box-shadow: 0 0 6px rgba(0,0,0,.5); }
.fl-name { flex: 1; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-num { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text); }
.fl-num.ok { color: #4ade80; }
.fl-chip {
  display: inline-flex; align-items: center; margin: 0 3px;
  padding: 0 5px; height: 16px; border-radius: 5px; border: 1px solid var(--border-hi);
  font-size: 10px; color: var(--muted);
}

/* ============ ИНСПЕКТОР ============ */
.inspector {
  position: absolute; top: 68px; right: 14px; z-index: 15;
  width: 296px; max-height: calc(100% - 190px);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 14px;
  background: rgba(12,12,20,.88); border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
  animation: inspIn .18s ease-out;
}
@keyframes inspIn { from { opacity: 0; transform: translateX(10px); } }
.inspector[hidden] { display: none; }
.inspector::-webkit-scrollbar { width: 8px; }
.inspector::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 4px; }

.insp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.insp-head img { width: 38px; height: 38px; flex: none; }
.insp-titles { flex: 1; min-width: 0; }
.insp-name { font-size: 14.5px; font-weight: 600; }
.insp-kind {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--dim);
}
.insp-close {
  width: 24px; height: 24px; border-radius: 7px; color: var(--dim);
  border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; font-size: 11px;
}
.insp-close:hover { color: var(--text); border-color: var(--border-hi); }

.insp-status {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 9px; font-size: 12px; margin-bottom: 12px;
  background: rgba(0,229,255,.07); border: 1px solid rgba(0,229,255,.22); color: var(--cyan);
}
.insp-status.warn { background: rgba(255,214,10,.08); border-color: rgba(255,214,10,.3); color: var(--yellow); }
.insp-status.err  { background: rgba(255,46,136,.08); border-color: rgba(255,46,136,.3); color: var(--magenta); }
.insp-status.idle { background: rgba(85,85,122,.12); border-color: var(--border); color: var(--muted); }

.insp-section { margin-top: 14px; }
.insp-section-title {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 8px;
  display: flex; justify-content: space-between; gap: 8px;
}
.insp-section-title span { color: var(--muted); }

.insp-row {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12.5px; padding: 4px 0; color: var(--muted);
}
.insp-row b { color: var(--text); font-weight: 600; font-family: 'JetBrains Mono', monospace; font-size: 12px; }

.slot-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.slot {
  position: relative; width: 46px; height: 46px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  display: grid; place-items: center;
}
.slot img { width: 30px; height: 30px; }
.slot-count {
  position: absolute; right: 2px; bottom: 0;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  color: var(--text); text-shadow: 0 0 4px #000;
}
.slot-need {
  position: absolute; left: 3px; top: 1px;
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--cyan);
}
.slot.missing { border-color: rgba(255,46,136,.45); }
.empty-note { font-size: 12px; color: var(--dim); }

.bar-wrap { margin: 6px 0 2px; }
.bar { height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; transition: width .12s linear; }
.bar i.cyan { background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.bar i.green { background: linear-gradient(90deg, #4ade80, var(--cyan)); }
.bar i.warn { background: linear-gradient(90deg, var(--yellow), var(--magenta)); }
.bar-label {
  display: flex; justify-content: space-between;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--dim); margin-top: 3px;
}

.recipe-list { display: flex; flex-direction: column; gap: 5px; }
.recipe-btn {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 7px 9px; border-radius: 9px; font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  transition: all .16s;
}
.recipe-btn:hover { border-color: var(--border-hi); color: var(--text); }
.recipe-btn.active { border-color: rgba(0,229,255,.55); color: var(--text); background: rgba(0,229,255,.07); }
.recipe-btn.locked { opacity: .45; }
.recipe-btn img { width: 24px; height: 24px; flex: none; }
.recipe-btn .rb-name { flex: 1; min-width: 0; }
.recipe-btn .rb-time { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--dim); }

.insp-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ============ СКЛАД: ВЫДАЧА И ЗАПАС ============ */
.out-select {
  width: 100%; padding: 7px 10px; font-size: 12.5px; font-family: inherit;
  color: var(--text); background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 9px; outline: none;
  transition: border-color .2s;
}
.out-select:focus { border-color: var(--cyan); }
.out-select option { background: var(--surface); color: var(--text); }

.out-hint {
  margin-top: 8px; font-size: 11.5px; line-height: 1.45; color: var(--dim);
}
.out-hint b { color: var(--cyan); font-weight: 600; }

.stock-rows { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.stock-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 8px;
  background: var(--bg-2); border: 1px solid transparent;
}
.stock-row.is-out { border-color: rgba(0,229,255,.45); background: rgba(0,229,255,.06); }
.stock-row img { width: 22px; height: 22px; flex: none; }
.stock-row .sr-name {
  flex: 1; min-width: 0; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stock-row .sr-count {
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--text);
  min-width: 34px; text-align: right;
}
.sr-btn {
  flex: none; padding: 3px 7px; border-radius: 7px; font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--cyan);
  transition: background-color .15s, border-color .15s, color .15s;
}
.sr-btn:hover { background: rgba(0,229,255,.12); border-color: rgba(0,229,255,.5); color: var(--text); }
.sr-btn:active { background: rgba(0,229,255,.22); }
.btn-danger, .btn-ghost, .btn-primary {
  padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border); transition: all .18s;
}
.btn-primary { background: linear-gradient(100deg, var(--cyan), var(--violet)); color: #05050a; border-color: transparent; }
.btn-primary:hover { box-shadow: 0 0 22px rgba(0,229,255,.35); }
.btn-ghost { background: var(--surface); color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-hi); }
.btn-danger { background: rgba(255,46,136,.1); color: var(--magenta); border-color: rgba(255,46,136,.35); }
.btn-danger:hover { background: rgba(255,46,136,.2); }

/* ============ УВЕДОМЛЕНИЯ ============ */
.toasts {
  position: absolute; top: 66px; left: 50%; transform: translateX(-50%);
  z-index: 30; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(420px, 80%);
}
.toast {
  width: 100%; padding: 9px 14px; border-radius: 10px; font-size: 13px;
  background: rgba(12,12,20,.9); border: 1px solid var(--border);
  border-left: 3px solid var(--cyan); color: var(--text);
  backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0,0,0,.45);
  animation: toastIn .25s cubic-bezier(.2,.9,.3,1);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .35s; }
.toast.contract { border-left-color: var(--violet); }
.toast.win { border-left-color: var(--yellow); }
.toast.error { border-left-color: var(--magenta); }
.toast.remove { border-left-color: var(--dim); }
.toast b { color: var(--cyan); }

/* ============ МИНИКАРТА ============ */
.minimap {
  position: absolute; right: 14px; bottom: 14px; z-index: 15;
  width: 176px; padding: 6px;
  background: rgba(12,12,20,.85); border: 1px solid var(--border); border-radius: 12px;
  backdrop-filter: blur(10px); box-shadow: 0 14px 40px rgba(0,0,0,.45);
}
.minimap canvas { display: block; width: 100%; height: auto; border-radius: 6px; cursor: pointer; }
.minimap-label {
  display: block; text-align: center; margin-top: 5px;
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  letter-spacing: .1em; color: var(--dim);
}

/* ============ ХОТБАР ============ */
.hotbar-wrap {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  z-index: 20; width: min(100% - 420px, 1020px); min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none;
}
.hotbar {
  pointer-events: auto;
  display: flex; gap: 7px; padding: 7px;
  background: rgba(12,12,20,.88); border: 1px solid var(--border); border-radius: 16px;
  backdrop-filter: blur(12px); box-shadow: 0 16px 44px rgba(0,0,0,.5);
  overflow-x: auto; max-width: 100%; scrollbar-width: thin;
}
.hotbar::-webkit-scrollbar { height: 6px; }
.hotbar::-webkit-scrollbar-track { background: transparent; }
.hotbar::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }
.hotbar::-webkit-scrollbar-thumb:hover { background: var(--dim); }
.hb-btn {
  position: relative; flex: none;
  width: 58px; height: 76px; border-radius: 11px;
  padding: 15px 2px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  transition: background-color .16s, border-color .16s, color .16s, box-shadow .16s, opacity .16s;
}
.hb-btn img { width: 26px; height: 26px; pointer-events: none; }
.hb-btn .hb-name {
  font-size: 8.5px; line-height: 1.15; text-align: center; max-width: 54px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim);
}
.hb-btn .hb-key {
  position: absolute; top: 3px; left: 5px;
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--dim);
}
.hb-btn .hb-cost {
  position: absolute; bottom: 2px; left: 0; right: 0;
  display: flex; align-items: center; justify-content: center; gap: 2px;
  font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--dim);
}
.hb-btn .hb-cost img { width: 11px; height: 11px; }
.hb-btn .hb-cost .hb-more { color: var(--dim); opacity: .8; }
.hb-btn:hover { border-color: var(--border-hi); color: var(--text); }
.hb-btn.active {
  color: var(--text); border-color: transparent;
  background: linear-gradient(160deg, rgba(0,229,255,.22), rgba(139,92,246,.22));
  box-shadow: 0 0 0 1px rgba(0,229,255,.45), 0 0 22px rgba(0,229,255,.22);
}
.hb-btn.locked { opacity: .45; }
/* замок рисуем средствами CSS — без эмодзи и фильтров (они давали мерцание) */
.hb-btn.locked::after {
  content: ''; position: absolute; top: 5px; right: 5px;
  width: 9px; height: 7px; border-radius: 2px; background: var(--muted);
}
.hb-btn.locked::before {
  content: ''; position: absolute; top: 1px; right: 7px;
  width: 5px; height: 7px; border: 1.5px solid var(--muted);
  border-bottom: none; border-radius: 3px 3px 0 0; box-sizing: border-box;
}
.hb-btn.poor .hb-cost { color: var(--magenta); }
.hb-btn.poor .hb-cost img { opacity: .75; }
.hb-btn.tool-mode.active {
  background: linear-gradient(160deg, rgba(255,46,136,.25), rgba(255,214,10,.18));
  box-shadow: 0 0 0 1px rgba(255,46,136,.5);
}
.hb-sep { width: 1px; align-self: stretch; background: var(--border); margin: 4px 2px; flex: none; }

.hint-line {
  pointer-events: none; font-size: 11.5px; color: var(--dim);
  font-family: 'JetBrains Mono', monospace; letter-spacing: .02em;
  background: rgba(7,7,12,.7); padding: 3px 10px; border-radius: 999px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hint-line b { color: var(--cyan); }

/* ============ ПОДСКАЗКА ============ */
.tooltip {
  position: absolute; z-index: 60; pointer-events: none;
  max-width: 280px; padding: 10px 12px; border-radius: 11px;
  background: rgba(9,9,16,.96); border: 1px solid var(--border-hi);
  box-shadow: 0 16px 40px rgba(0,0,0,.6); font-size: 12.5px; line-height: 1.45;
}
.tooltip[hidden] { display: none; }
.tt-name { font-weight: 600; margin-bottom: 3px; }
.tt-cost { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--cyan); margin-bottom: 5px; }
.tt-desc { color: var(--muted); font-size: 12px; }
.tt-tech { color: var(--violet); font-size: 11.5px; margin-top: 5px; }
.tt-speed { color: var(--dim); font-family: 'JetBrains Mono', monospace; font-size: 11px; }

/* ============ МОДАЛЬНЫЕ ОКНА ============ */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 20px;
  background: rgba(7,7,12,.82);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  animation: fadeIn .18s ease-out;
}
.modal[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-box {
  position: relative; width: min(940px, 100%); max-height: 88vh; overflow-y: auto;
  padding: 28px 30px; border-radius: 20px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border-hi);
  box-shadow: var(--shadow);
}
.modal-box-sm { width: min(560px, 100%); }
.modal-close {
  position: absolute; top: 14px; right: 16px;
  width: 30px; height: 30px; border-radius: 9px; color: var(--dim);
  border: 1px solid var(--border); background: var(--surface);
}
.modal-close:hover { color: var(--text); border-color: var(--border-hi); }
.modal-kicker {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .14em;
  color: var(--cyan); text-transform: uppercase; margin-bottom: 12px;
}
.modal-title {
  font-family: 'Orbitron', sans-serif; font-weight: 900;
  font-size: clamp(20px, 2.4vw, 30px); line-height: 1.15; margin-bottom: 18px;
}
.modal-h3 {
  font-family: 'Orbitron', sans-serif; font-size: 15px; margin: 22px 0 12px;
  letter-spacing: .02em;
}
.modal-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; }
.modal-cols h3 {
  font-family: 'Orbitron', sans-serif; font-size: 14px; margin-bottom: 12px; color: var(--cyan);
}
.rule-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.rule-list li {
  position: relative; padding-left: 20px; font-size: 13.5px; color: var(--muted); line-height: 1.5;
}
.rule-list li::before {
  content: '▸'; position: absolute; left: 0; top: 1px; color: var(--cyan); font-size: 11px;
}
.rule-list b { color: var(--text); font-weight: 600; }
.key-table { width: 100%; border-collapse: collapse; }
.key-table td {
  padding: 6px 0; font-size: 13px; color: var(--muted); vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.key-table tr:last-child td { border-bottom: none; }
.key-table td:first-child {
  width: 44%; font-family: 'JetBrains Mono', monospace; font-size: 11.5px;
  color: var(--cyan); padding-right: 12px;
}
.recipe-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.rt-card {
  padding: 11px 13px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); font-size: 12.5px;
}
.rt-card.locked { opacity: .55; }
.rt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.rt-head img { width: 26px; height: 26px; }
.rt-head b { font-size: 13px; font-weight: 600; }
.rt-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.rt-line img { width: 18px; height: 18px; }
.rt-line .arrow { color: var(--cyan); }
.rt-time { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--dim); margin-left: auto; }
.rt-where { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--violet); margin-top: 6px; }

.menu-rows { display: flex; flex-direction: column; gap: 14px; }
.menu-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.menu-row:last-child { border-bottom: none; padding-bottom: 0; }
.menu-row > span { color: var(--muted); }
.menu-row-col { flex-direction: column; align-items: stretch; gap: 9px; }
.menu-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.menu-note { font-size: 11.5px; color: var(--dim); line-height: 1.5; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border); }
.seg button {
  padding: 5px 12px; border-radius: 999px; font-size: 12px; color: var(--dim); transition: all .16s;
}
.seg button:hover { color: var(--text); }
.seg button.active {
  background: linear-gradient(100deg, var(--cyan), var(--violet)); color: #05050a; font-weight: 600;
}

.win-box { text-align: center; }
.win-text { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 18px; }
.win-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px;
}
.win-stats div {
  padding: 10px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--muted);
}
.win-stats b { display: block; font-family: 'Orbitron', sans-serif; font-size: 18px; color: var(--cyan); margin-bottom: 3px; }

/* ============ АДАПТИВ ============ */
@media (max-width: 1100px) {
  .hotbar-wrap { width: min(100% - 36px, 860px); }
  .minimap { display: none; }
}
@media (max-width: 900px) {
  .gt-fps, .gt-sub { display: none; }
  .modal-cols { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 720px) {
  .game-shell { height: calc(100vh - 118px); min-height: 460px; }
  .contract-card { width: calc(100% - 28px); max-width: 320px; }
  .inspector {
    position: absolute; top: auto; bottom: 96px; left: 14px; right: 14px; width: auto;
    max-height: 46%;
  }
  .hotbar-wrap { bottom: 6px; }
  .hb-btn { width: 54px; height: 62px; }
  .stock-bar { display: none; }
  .gt-name { font-size: 12px; }
}

/* очень узкие экраны: убираем всё, что может выдавить вёрстку */
@media (max-width: 480px) {
  .game-shell { height: calc(100vh - 106px); min-height: 420px; }
  .game-top { flex-wrap: wrap; gap: 8px; padding: 8px 10px 12px; }
  .gt-brand { min-width: 0; }
  .gt-name { font-size: 11px; }
  .gt-actions { gap: 6px; }
  .icon-btn { width: 28px; height: 28px; font-size: 12px; }
  .contract-card { top: 58px; left: 10px; right: 10px; width: auto; max-width: none; }
  .inspector { left: 10px; right: 10px; bottom: 90px; max-height: 44%; padding: 12px; }
  .hb-btn { width: 50px; height: 70px; padding: 12px 2px 7px; }
  .hb-btn img { width: 24px; height: 24px; }
  .hb-btn .hb-name { font-size: 8.5px; max-width: 46px; }
  .hint-line { font-size: 10.5px; }
  .toasts { top: auto; bottom: 108px; width: calc(100% - 20px); }
}
