/* Кеңсе — симулятор офиса. Страница без каркаса сайта: холст на весь экран
   и несколько стеклянных плашек поверх. Цвета — из общих токенов, чтобы
   панель кабинета читалась так же, как остальной сайт. */

html, body.office-body {
  height: 100%;
  overflow: hidden;
  background: #0f1714;
  overscroll-behavior: none;
}
body.office-body { position: fixed; inset: 0; touch-action: none; }

#world {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: crosshair;
}

/* ─── плашки ─── */
.hud {
  position: absolute;
  z-index: 5;
  background: rgba(16, 24, 20, .72);
  color: #eef3f0;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  padding: 10px 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  user-select: none;
  -webkit-user-select: none;
}
.hud-top-left { top: 14px; left: 14px; min-width: 120px; }
.hud-time { font-size: 24px; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.hud-date { color: #a8b5ae; margin-top: 4px; font-size: 12px; }

.hud-top-right { top: 14px; right: 14px; padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; }
#minimap { display: block; width: 112px; height: 112px; border-radius: 50%; margin: 0 auto; border: 3px solid rgba(255,255,255,.35); box-shadow: 0 8px 30px rgba(0,0,0,.25); }

.hud-hint {
  bottom: 14px; left: 50%; transform: translateX(-50%);
  color: #c7d2cb; white-space: nowrap;
}
.hud-hint .key {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 4px;
  font-weight: 600; font-size: 11px; color: #fff;
  margin-right: 2px;
}

/* Лента событий: что только что случилось в офисе. */
.hud-feed {
  left: 14px; bottom: 14px;
  max-width: 320px;
  padding: 8px 12px;
  font-size: 12px;
  color: #d4ddd8;
}
.hud-feed div { padding: 3px 0; border-top: 1px dashed rgba(255,255,255,.08); }
.hud-feed div:first-child { border-top: 0; }
.hud-feed time { color: #8fa39a; margin-right: 6px; font-variant-numeric: tabular-nums; }
.hud-feed .ok { color: #7ed8a8; }
.hud-feed .bad { color: #ff9a8f; }

/* Кнопки правой руки: как в играх — три круга у большого пальца. */
.hud-actions { position: absolute; right: 16px; bottom: 16px; z-index: 6; width: 150px; height: 150px; }
.hud-btn {
  position: absolute; padding: 0; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.3); color: #fff; cursor: pointer;
  font: 700 15px var(--font); display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.hud-btn:active { transform: scale(.92); }
.hud-btn-act { right: 0; bottom: 0; width: 74px; height: 74px; background: rgba(44,157,98,.35); opacity: .55; }
.hud-btn-act:not([hidden]) { background: var(--green); opacity: 1; }
.hud-btn-act[hidden] { display: grid !important; pointer-events: none; }
.hud-btn-hit[hidden], .hud-btn-jump[hidden] { display: none !important; }
.hud-btn-jump { right: 84px; bottom: 6px; width: 60px; height: 60px; background: rgba(63,127,216,.85); font-size: 24px; }
.hud-btn-hit { right: 8px; bottom: 90px; width: 60px; height: 60px; background: rgba(229,127,54,.9); font-size: 24px; }

/* ─── панель кабинета ─── */
.panel {
  position: absolute; z-index: 30;
  top: 14px; right: 14px; bottom: 14px;
  width: min(420px, calc(100vw - 28px));
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-card);
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  overflow: auto;
  animation: panel-in .22s ease-out;
}
@keyframes panel-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-close {
  position: sticky; top: 10px; float: right; margin: 10px 10px 0 0;
  width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: var(--surface-2); color: var(--ink-2);
  font-size: 24px; line-height: 1; cursor: pointer; z-index: 2;
}
.panel-body { padding: 18px 22px 24px; }
.panel h2 { margin: 6px 0 2px; font-size: 20px; letter-spacing: -.01em; }
.panel .sub { color: var(--ink-3); font-size: 13px; margin-bottom: 14px; }
.panel .who {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 16px; background: var(--surface-2);
  margin: 10px 0 16px;
}
.panel .who .face {
  width: 44px; height: 44px; border-radius: 50%;
  background: #cfd8d3 center/cover no-repeat; flex: none;
  display: grid; place-items: center; font-weight: 700; color: #fff;
}
.panel .who b { display: block; font-size: 14px; }
.panel .who span { color: var(--ink-2); font-size: 12px; }
.panel .who .mood { margin-left: auto; font-size: 24px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.stat {
  padding: 12px 14px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--line-2);
}
.stat .n { font-size: 24px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat .l { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.stat.ok .n { color: var(--ok); }
.stat.mid .n { color: var(--mid); }
.stat.low .n { color: var(--low); }

.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 6px 0 2px; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 4px; transition: width .4s; }

.panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 18px 0 8px; }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.row:first-of-type { border-top: 0; }
.row span:last-child { color: var(--ink-2); text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip {
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: var(--low-bg); color: var(--low); font-weight: 600;
}
.chips .chip.ok { background: var(--ok-bg); color: var(--ok); }
.chips .chip.mute { background: var(--surface-2); color: var(--ink-2); font-weight: 500; }

.panel .go {
  display: inline-block; margin-top: 18px;
  padding: 10px 16px; border-radius: 12px;
  background: var(--green); color: #fff; text-decoration: none; font-weight: 600; font-size: 14px;
}
.panel .quote {
  margin: 8px 0 0; padding: 12px 14px; border-radius: 16px;
  background: var(--green-soft); color: var(--green-dark); font-size: 14px;
  border-left: 3px solid var(--green);
}

/* ─── заставка ─── */
.veil {
  position: absolute; inset: 0; z-index: 20;
  display: grid; place-items: center;
  background: #0f1714; color: #eef3f0;
  transition: opacity .35s;
}
.veil.off { opacity: 0; pointer-events: none; }
.veil-box { text-align: center; }
.veil-mark { width: 64px; height: 64px; border-radius: 16px; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.06); opacity: 1; } }
.veil-name { margin-top: 12px; font-size: 20px; letter-spacing: .01em; }
.veil-step { margin-top: 8px; font-size: 13px; color: #8fa39a; }
.veil-step.bad { color: #ff9a8f; max-width: 340px; }

@media (max-width: 640px) {
  .hud-feed { max-width: calc(100vw - 130px); bottom: 20px; }
  .hud-time { font-size: 20px; }
  .panel { top: auto; height: 62vh; width: calc(100vw - 20px); left: 10px; right: 10px; bottom: 10px; }
}

/* ─── письма бота: под кнопкой, а не на экране ─── */
.hud-mail {
  left: 14px; bottom: 14px;
  padding: 10px 14px; cursor: pointer; font: 600 13px var(--font); color: #eef3f0;
}
.hud-mail b { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--green); font-size: 11px; text-align: center; }
.hud-mail b:empty { display: none; }
.hud-feed { bottom: 64px; }

.panel .who .needs { display: flex; gap: 4px; margin-top: 5px; }
.panel .who .needs i { display: block; width: 34px; height: 5px; border-radius: 4px; background: var(--line); overflow: hidden; }
.panel .who .needs i b { display: block; height: 100%; background: var(--green); }

/* Кнопки масштаба — под картой; на телефоне карта спрятана, кнопки остаются. */
.hud-view { display: flex; gap: 6px; padding: 6px 0 0; justify-content: center; }
.hud-view button {
  flex: 1; padding: 4px 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08); color: #eef3f0; font: 700 16px var(--font); cursor: pointer; line-height: 1.2;
}
.hud-view button:active { background: rgba(255,255,255,.18); }
@media (max-width: 640px) {
  #minimap { width: 84px; height: 84px; }
  .hud-view { padding: 4px 0 0; }
  .hud-view button { min-width: 40px; padding: 6px 8px; background: rgba(16,24,20,.72); }
}

/* Джойстик: круг слева внизу, ручка идёт за пальцем. */
.joy {
  position: absolute; z-index: 6; left: 18px; bottom: 70px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(16,24,20,.35); border: 2px solid rgba(255,255,255,.25);
  touch-action: none; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.joy-knob {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 4px 14px rgba(0,0,0,.35);
  pointer-events: none;
}
@media (max-width: 640px) { .hud-feed { bottom: 200px; } .hud-mail { bottom: 14px; } .hud-actions { bottom: 24px; } }

/* Выход — рядом с часами, чтобы искать не пришлось. */
.hud-exit {
  top: 14px; left: 158px;
  padding: 10px 14px; text-decoration: none; font-weight: 600; color: #eef3f0;
  display: flex; align-items: center; height: 56px; line-height: 1;
}
.hud-exit:hover { background: rgba(44,157,98,.55); }
@media (max-width: 640px) { .hud-exit { left: 120px; top: 14px; height: 44px; padding: 8px 12px; font-size: 12px; } }

/* ─── арена ─── */
.arena { position: absolute; inset: 0; z-index: 8; pointer-events: none; color: #fff; }
.arena button, .arena .ar-end { pointer-events: auto; }
.ar-top { position: absolute; top: 12px; left: 14px; right: 14px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; }
.ar-me { width: min(320px, 40vw); }
.ar-bar { position: relative; height: 14px; border-radius: 8px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.2); overflow: hidden; margin-bottom: 6px; }
.ar-bar i { display: block; height: 100%; width: 100%; transition: width .12s; }
.ar-bar.hp i { background: linear-gradient(90deg, #57e08a, #2c9d62); }
.ar-bar.st { height: 8px; } .ar-bar.st i { background: #4fa3ff; }
.ar-bar.sp { height: 12px; } .ar-bar.sp i { background: #ffd23f; }
.ar-bar.sp span { position: absolute; left: 8px; top: -1px; font: 700 10px var(--font); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.ar-bar.sp.full { box-shadow: 0 0 14px #ffd23f; }
.ar-bar.small { height: 8px; width: 160px; }
.ar-center { text-align: center; }
.ar-time { font: 700 32px var(--font); text-shadow: 0 2px 8px rgba(0,0,0,.6); line-height: 1; }
.ar-live { font-size: 11px; color: #8ee6b4; margin-top: 2px; }
.ar-score { justify-self: end; background: rgba(0,0,0,.45); border-radius: 12px; padding: 8px 12px; min-width: 140px; font-size: 13px; }
.ar-score div { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.ar-score div.me { color: #ffd23f; font-weight: 700; }
.ar-target { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); text-align: center; font: 700 13px var(--font); text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.ar-target .ar-bar { margin: 4px auto 0; }
.ar-msg { position: absolute; top: 30%; left: 0; right: 0; text-align: center; font: 900 44px var(--font); color: #ffd23f; text-shadow: 0 4px 16px rgba(0,0,0,.7); opacity: 0; transform: scale(.7); transition: all .18s; }
.ar-msg.on { opacity: 1; transform: scale(1); }
.ar-exit { top: auto; bottom: 18px; left: 50%; transform: translateX(-50%); height: auto; padding: 8px 14px; font-size: 13px; }
.ar-btns { position: absolute; right: 16px; bottom: 16px; width: 190px; height: 190px; }
.ar-b { position: absolute; width: 62px; height: 62px; font-size: 24px; }
.ar-punch { right: 0; bottom: 0; width: 76px; height: 76px; background: #e57f36; }
.ar-kick { right: 88px; bottom: 10px; background: #e8443c; }
.ar-dash { right: 6px; bottom: 90px; background: #3f7fd8; }
.ar-block { right: 92px; bottom: 84px; background: #6b7a90; }
.ar-special { right: 40px; bottom: 140px; width: 52px; height: 52px; background: #b58a1c; font-size: 20px; }
.ar-end { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.55); }
.ar-end-box { width: min(420px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); border-radius: 20px; padding: 20px 22px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.ar-end-box h2 { margin: 0 0 12px; font-size: 24px; }
.ar-end-btns { display: flex; gap: 10px; margin-top: 16px; }
.ar-end-btns button { flex: 1; padding: 11px; border-radius: 12px; border: 0; background: var(--green); color: #fff; font: 600 14px var(--font); cursor: pointer; }
.ar-end-btns button.ghost { background: var(--surface-2); color: var(--ink); }
@media (max-width: 640px) {
  .ar-top { grid-template-columns: 1fr auto; }
  .ar-score { display: none; }
  .ar-time { font-size: 24px; }
  .ar-exit { left: auto; right: 14px; top: 60px; bottom: auto; transform: none; }
  .ar-btns { bottom: 24px; }
}

/* ─── Stick Fight ─── */
.stick { position: absolute; inset: 0; z-index: 9; color: #111; }
.stick canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.stick .ar-bar { background: rgba(0,0,0,.12); border-color: rgba(0,0,0,.2); }
.stick .ar-bar.sp span { color: #111; text-shadow: none; }
.sk-top { position: absolute; top: 12px; left: 14px; right: 14px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; pointer-events: none; }
.sk-me { width: min(300px, 40vw); }
.sk-center { text-align: center; }
.sk-score { font: 900 32px var(--font); line-height: 1; }
.sk-wave { font: 600 12px var(--font); color: #555; margin-top: 2px; }
.sk-right { justify-self: end; pointer-events: auto; }
.sk-snd { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #111; background: #fff; font-size: 16px; cursor: pointer; }
.sk-combo { position: absolute; top: 90px; right: 24px; font: 900 28px var(--font); color: #c0392f; transform: rotate(-8deg) scale(.6); opacity: 0; transition: all .12s; pointer-events: none; }
.sk-combo.on { opacity: 1; transform: rotate(-8deg) scale(1); }
.sk-msg { color: #111; text-shadow: none; font-size: 44px; letter-spacing: .02em; }
.stick .ar-exit { background: rgba(17,17,17,.8); color: #fff; }
.sk-btns { width: 210px; height: 210px; }
.sk-punch { right: 0; bottom: 0; width: 76px; height: 76px; background: #111; }
.sk-kick { right: 88px; bottom: 10px; background: #c0392f; }
.sk-roll { right: 6px; bottom: 90px; background: #3f7fd8; }
.sk-jump { right: 92px; bottom: 84px; background: #2c9d62; }
.sk-block { right: 150px; bottom: 60px; width: 52px; height: 52px; background: #6b7a90; font-size: 20px; }
.sk-grab { right: 44px; bottom: 150px; width: 52px; height: 52px; background: #8a5bd8; font-size: 20px; }
.sk-special { right: 120px; bottom: 140px; width: 52px; height: 52px; background: #b58a1c; font-size: 20px; }
@media (max-width: 640px) { .sk-btns { bottom: 24px; } .sk-score { font-size: 24px; } }

/* Звук — рядом с выходом. */
.hud-sound { top: 14px; left: 262px; height: 56px; width: 56px; padding: 0; font-size: 20px; cursor: pointer; }
@media (max-width: 640px) { .hud-sound { left: auto; right: 14px; top: 62px; width: 44px; height: 44px; font-size: 16px; } }

/* Подсказка у курсора: имя и группа. */
.tip { position: absolute; z-index: 12; pointer-events: none; background: rgba(16,24,20,.88); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12px; line-height: 1.3; max-width: 240px; }
.tip b { display: block; font-size: 13px; }
.tip span { color: #a8b5ae; }
.hud-light { left: 326px; }
.snd-state { top: 78px; left: 262px; font-size: 12px; padding: 6px 10px; }
@media (max-width: 640px) { .hud-light { left: auto; right: 66px; top: 62px; } .snd-state { left: auto; right: 14px; top: 112px; } }
.hud-mic { left: 390px; }
.hud-mic.on { background: #b8225a; color: #fff; box-shadow: 0 0 0 4px rgba(184,34,90,.25); }
@media (max-width: 640px) { .hud-mic { left: auto; right: 118px; top: 62px; } }
.pres-state { top: 78px; left: 390px; white-space: nowrap; }
@media (max-width: 640px) { .pres-state { left: 14px; right: auto; top: 112px; max-width: 70vw; overflow: hidden; text-overflow: ellipsis; } }
