:root {
  --ink: #2b2f36;
  --muted: #7a8190;
  --line: #e3e6ea;
  --pill: #eef0f3;
  --accent: #8b3dff;
  --loop: #1e6fd9;
  --green: #22a06b;
  --red: #e5484d;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  font: 14px/1.35 -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  color: var(--ink);
  background: #9fc4e8;
  user-select: none;
  -webkit-user-select: none;
}
#view { display: block; width: 100vw; height: 100vh; cursor: crosshair; }

/* ── HUD ───────────────────────────────────────────── */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.panel {
  position: absolute; top: 14px;
  background: rgba(255,255,255,.9);
  border-radius: 10px; padding: 10px 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.panel.left { left: 14px; min-width: 220px; }
.panel.right { right: 14px; text-align: right; max-width: 320px; }
.panel .kpi { display: flex; align-items: baseline; gap: 8px; line-height: 1; }
.panel .kpi i { font-style: normal; font-size: 11px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }
.panel .kpi b { font-size: 38px; font-variant-numeric: tabular-nums; }
.panel .kpi.bump b { animation: bump .25s; }
@keyframes bump { 50% { transform: scale(1.12); color: var(--green); } }
.panel .row { margin-top: 6px; font-size: 12px; color: #4d5462; }
.panel .row.muted { color: var(--muted); }
#weapon { color: var(--muted); }
#weapon.on { color: var(--accent); font-weight: 700; }
.panel .bar { margin-top: 8px; height: 6px; background: var(--pill); border-radius: 3px; overflow: hidden; }
.panel .bar > i { display: block; height: 100%; background: var(--accent); transform-origin: left; }

#vacay {
  display: none;
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, #ffd479, #ffb347); color: #5c3d00;
  font-weight: 700; font-size: 13px; padding: 6px 16px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
body.vacay #vacay { display: block; top: 56px; }
body.vacay #grab { top: 14px; }

#grab {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); margin: 0;
  pointer-events: auto;
  background: rgba(255,255,255,.9); color: var(--ink);
  font-size: 12px; font-weight: 600; padding: 8px 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
#grab:hover { background: #fff; filter: none; }
body.autorun #autorun-hint::after { content: ' · автобег включён'; color: var(--green); font-weight: 700; }

#bots {
  position: absolute; left: 16px; bottom: 16px;
  pointer-events: auto;
  background: rgba(255,255,255,.9); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  width: 230px;
}
.bots-head { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.bots-add { display: flex; gap: 6px; margin-top: 7px; }
.bots-add input {
  flex: 1; min-width: 0; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; background: #fff;
}
.bots-add input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.bots-add button { margin: 0; padding: 5px 10px; font-size: 12px; }
#bot-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.bot-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--pill); border-radius: 999px; padding: 2px 4px 2px 9px; font-size: 12px;
}
.bot-chip button {
  margin: 0; padding: 0; width: 17px; height: 17px; line-height: 1;
  border-radius: 50%; background: #d7dbe0; color: #4d5462; font-size: 11px;
}
.bot-chip button:hover { background: var(--red); color: #fff; filter: none; }

#crosshair {
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 22px; margin: -11px 0 0 -11px;
  opacity: .8;
}
#crosshair::before, #crosshair::after {
  content: ''; position: absolute; background: #fff;
  box-shadow: 0 0 2px rgba(0,0,0,.8);
}
#crosshair::before { left: 10px; top: 0; width: 2px; height: 22px; }
#crosshair::after { top: 10px; left: 0; height: 2px; width: 22px; }

#hitmark {
  position: absolute; left: 50%; top: 50%;
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border: 3px solid rgba(255,255,255,.9); border-radius: 50%;
  opacity: 0;
}
#hitmark.on { animation: hitmark .22s ease-out; }
@keyframes hitmark {
  from { opacity: 1; transform: scale(.5); }
  to { opacity: 0; transform: scale(1.2); }
}

#float { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.fx {
  position: absolute; font-weight: 800; font-size: 20px; color: #6bf0b0;
  text-shadow: 0 2px 6px rgba(0,0,0,.6);
  animation: fly .9s ease-out forwards;
}
.fx.minus { color: #ff8a8d; }
@keyframes fly { to { transform: translateY(-60px); opacity: 0; } }

/* ── уведомления ZaLoop ────────────────────────────── */
#toasts {
  position: fixed; bottom: 16px; right: 16px; z-index: 50;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  pointer-events: none; max-width: min(390px, 88vw);
}
.toast {
  width: min(390px, 88vw); text-align: left;
  background: #fff; border-radius: 10px; border-left: 4px solid var(--loop);
  padding: 9px 14px 12px; box-shadow: 0 10px 28px rgba(0,0,0,.45);
  animation: slide-in .22s cubic-bezier(.2,.9,.3,1.3);
}
.toast.out { animation: slide-out .25s forwards; }
.toast .head {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: 12px; color: var(--muted);
  padding-bottom: 8px; margin-bottom: 9px; border-bottom: 1px solid var(--line);
}
.toast .loop { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }
.toast .loop-mark {
  width: 18px; height: 18px; border-radius: 5px; background: var(--loop); color: #fff;
  display: grid; place-items: center; font-size: 11px; line-height: 1;
}
.toast .chan { color: var(--loop); }
.toast .time { margin-left: auto; }
.toast .body { display: flex; align-items: center; gap: 12px; }
.toast .face {
  width: 39px; height: 39px; border-radius: 50%; background: var(--pill);
  display: grid; place-items: center; font-size: 22px; flex: 0 0 auto;
}
.toast .who { font-size: 13px; font-weight: 700; }
.toast .text { font-size: 18px; line-height: 1.22; margin-top: 2px; }
.toast.angry { border-left-color: var(--red); box-shadow: 0 10px 28px rgba(229,72,77,.45); }
.toast.angry .chan { color: var(--red); }
@keyframes slide-in { from { opacity: 0; transform: translateX(110%); } }
@keyframes slide-out { to { opacity: 0; transform: translateX(110%) scale(.95); } }

/* ── ЗаЗум, 500, модалка ───────────────────────────── */
.sheet { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(10,12,18,.6); }
.sheet.hidden { display: none; }

.zoom-win { width: min(760px, 94vw); background: #20242e; color: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.zoom-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #2b303c; font-size: 14px; }
.zoom-bar .zz { font-weight: 700; color: #4aa3ff; }
.zoom-bar .rec { margin-left: auto; color: #ff6b6e; font-size: 12px; }
.zoom-body { padding: 16px; }
.zoom-body .tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.zoom-body .tiles span {
  aspect-ratio: 4 / 3; border-radius: 10px; background: #2b303c;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.zoom-body .tiles b { font-size: 30px; font-weight: 400; }
.zoom-body .tiles i { font-style: normal; font-size: 11px; color: #aeb6c6; }
.zoom-body .tiles .you { outline: 2px solid #4aa3ff; }
.zoom-note { margin-top: 14px; color: #aeb6c6; font-size: 13px; text-align: center; }
.zoom-acts { padding: 0 16px 18px; display: flex; justify-content: center; }
.zoom-acts .drop { background: var(--red); min-width: 260px; }
.zoom-acts .drop:disabled { background: #4a4f5c; color: #aeb6c6; cursor: not-allowed; }

.oops-win { width: min(420px, 92vw); background: #fff; border-radius: 12px; padding: 26px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.oops-code { font-size: 54px; font-weight: 800; color: var(--red); line-height: 1; }
.oops-text { margin-top: 8px; color: #4d5462; }
.oops-bar { margin-top: 16px; height: 4px; background: var(--pill); border-radius: 2px; overflow: hidden; }
.oops-bar > i { display: block; height: 100%; width: 40%; background: var(--red); animation: slide 1s linear infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

#overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(10,12,18,.72); }
#overlay.hidden { display: none; }
.modal { background: #fff; border-radius: 12px; padding: 26px 30px; max-width: 520px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.modal h1 { margin: 0 0 6px; font-size: 24px; }
.modal p { color: #4d5462; margin: 8px 0; text-align: left; font-size: 13.5px; }
.modal .kpi { font-size: 44px; font-weight: 700; margin-top: 8px; }
.modal .grade { color: var(--accent); font-size: 17px; margin-bottom: 12px; }

button {
  margin-top: 14px; background: var(--accent); color: #fff; border: 0;
  border-radius: 7px; padding: 11px 22px; font: inherit; font-weight: 600; cursor: pointer;
}
button:hover { filter: brightness(1.08); }
