#app {
  display: flex; flex-direction: row; align-items: stretch;
  padding: 8px; gap: 8px; overflow: hidden;
  background: var(--bg);
}

/* ---------- Боковая панель игроков: компактно, без прокрутки ---------- */
#sidebar {
  width: 220px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 6px; min-height: 0;
}
#playerCards { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 5px; }
.pcard {
  position: relative; flex-shrink: 0;
  display: grid; grid-template-columns: 40px 1fr; grid-template-rows: 16px 16px 18px;
  gap: 2px 8px; align-items: center;
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  border: 1px solid var(--line); border-left: 3px solid var(--pc, #888);
  border-radius: 9px; padding: 5px 7px 5px 6px;
  transition: filter .4s, opacity .4s;
}
.pcard.me { background: linear-gradient(90deg, rgba(232,135,30,.22), rgba(232,135,30,.04)); border-color: rgba(232,135,30,.5); border-left-color: var(--pc, #e8871e); }
.pcard.dead { filter: grayscale(1); opacity: .45; }
.pcard .ava {
  position: relative; width: 40px; height: 40px; border-radius: 50%; grid-row: 1 / 4;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.18), rgba(0,0,0,.35)), var(--pc, #555);
  border: 2px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
}
.pcard .ava canvas { display: block; }
.pcard .ava .rank { position: absolute; right: -7px; bottom: -6px; }
.pcard .ava .skull { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-size: 20px; }
.pcard.dead .ava .skull { display: flex; }
.pcard.dead .ava canvas { opacity: .35; }
.pcard .pname {
  font-family: var(--font-display); font-size: 13.5px; letter-spacing: .4px; text-transform: uppercase;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 16px;
}
.pcard .pname small { font-family: var(--font-ui); text-transform: none; color: var(--muted); font-size: 10px; margin-left: 4px; letter-spacing: 0; }
.pcard .has-key { margin-right: 4px; filter: drop-shadow(0 0 4px rgba(255,215,0,.8)); }
.pcard .stats { display: flex; gap: 7px; font-size: 11.5px; font-weight: 700; color: #dfe2ea; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 16px; }
.pcard .lives { color: #ff7aa8; }
.pcard .dash { color: #8a90a2; margin-left: auto; }
.pcard .dash.ready { color: #5ee0ff; }
.pcard .fx { display: flex; gap: 3px; height: 18px; overflow: hidden; white-space: nowrap; }
.pcard .status-dead { color: #e74c3c; font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.sidebar-foot { display: flex; flex-direction: row; align-items: center; gap: 6px; flex-shrink: 0; }
.sidebar-foot #pingBadge { flex: 1; height: 30px; }
.sidebar-foot .tool-btn { height: 30px; min-width: 30px; font-size: 14px; }

/* Значки эффектов: спокойные, без мигания */
.timer-badge {
  display: inline-flex; align-items: center; justify-content: center;
  height: 18px; padding: 0 4px; gap: 2px;
  border-radius: 5px; font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: #fff;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
}
.timer-badge.good { background: rgba(46, 204, 113, .22); border-color: rgba(46,204,113,.6); }
.timer-badge.bad  { background: rgba(231, 76, 60, .22);  border-color: rgba(231,76,60,.6); }
.timer-badge.info { background: rgba(120, 140, 255, .22); border-color: rgba(120,140,255,.6); }
.timer-badge.gold { background: rgba(241, 196, 15, .2); border-color: rgba(241,196,15,.6); }
.timer-badge.rainbow { background: rgba(186, 120, 255, .25); border-color: rgba(186,120,255,.7); }
.timer-badge.psycho { background: rgba(230, 80, 200, .22); border-color: rgba(230,80,200,.7); }
#pingBadge {
  background: var(--panel-2); padding: 5px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  display: flex; align-items: center;
}

/* ---------- Раскладка: [игроки][поле][события+чат] вплотную, по центру ---------- */
#app { justify-content: center; align-items: center; }

#fieldCol { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; align-self: center; position: relative; }
#gameWrap {
  position: relative; flex: 0 0 auto;
}
/* наезд камеры на спавн перед стартом: увеличенное поле не вылезает за рамку */
#cv {
  display: block;
  background: #2c2c3e; border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  transform-origin: 50% 50%;
  will-change: transform;
}
#rightbar {
  width: 260px; flex-shrink: 0; min-height: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.rb-title {
  font-family: var(--font-display); font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); margin: 2px 2px 0;
}

/* Лента событий (убийства и т.п.) */
#feed { display: flex; flex-direction: column; gap: 4px; min-height: 0; }
#feed .fd {
  display: flex; align-items: flex-start; gap: 6px;
  background: rgba(255,255,255,.05); border-left: 3px solid #6c7386;
  padding: 5px 9px; border-radius: 6px; font-size: 12.5px; line-height: 1.35;
  animation: feedIn .2s ease-out; transition: opacity .8s;
}
/* мини-версия комбо: иллюстрация, заголовок цвета события, пояснение */
#feed .fd { align-items: center; gap: 8px; padding: 5px 9px 5px 6px; border-left-color: var(--c, #6c7386);
  background: linear-gradient(90deg, color-mix(in srgb, var(--c, #6c7386) 16%, transparent), rgba(255,255,255,.03)); }
#feed .fd-art { width: 30px; height: 30px; flex-shrink: 0; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
#feed .fd-art svg { width: 100%; height: 100%; display: block; }
#feed .fd-txt { min-width: 0; }
#feed .fd-txt b { display: block; font-size: 12.5px; font-weight: 700; color: var(--c2, #fff); line-height: 1.25; }
#feed .fd-txt small { display: block; font-size: 11.5px; color: #c4cad8; line-height: 1.25; }
#feed .fd.old { opacity: .5; }
#feed .fd.kill { border-left-color: #e74c3c; }
#feed .fd.good { border-left-color: #2ecc71; }
#feed .fd.chaos { border-left-color: #9b59b6; }
@keyframes feedIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

/* Чат */
#chatBox { margin-top: auto; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
#chatLog { display: flex; flex-direction: column; gap: 3px; max-height: 260px; overflow: hidden; justify-content: flex-end; }
#chatLog .msg {
  background: rgba(255,255,255,.05); border-radius: 6px; padding: 4px 9px; font-size: 13px; line-height: 1.35;
  word-wrap: break-word; transition: opacity .8s;
}
#chatLog .msg b { margin-right: 4px; }
#chatLog .msg.old { opacity: .45; }
#chatInput { display: none; font-size: 13px; padding: 8px 10px; background: rgba(10,12,20,.92); }
#chatBox.open #chatInput { display: block; }

/* ---------- Тикер уведомлений над полем: одно за раз, оформление «жетон» ---------- */
.k-good { --c: #2ecc71; --c2: #7dff9b; }
.k-bad { --c: #ff5a4e; --c2: #ffa69c; }
.k-info { --c: #ff9a2e; --c2: #ffcf8a; }
.k-chaos { --c: #b06bff; --c2: #d9b5ff; }
#notices { position: relative; height: 50px; flex-shrink: 0; pointer-events: none; z-index: 12; }
.tk {
  position: absolute; inset: 0; display: flex; align-items: center; gap: 12px; padding: 0 16px 0 66px; overflow: visible;
  border-radius: 12px; border: 2px solid color-mix(in srgb, var(--c) 70%, #000);
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 32%, #1a1c2c), #141624 70%);
  box-shadow: 0 6px 18px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.12);
  animation: tkIn .4s cubic-bezier(.2,1.4,.4,1);
}
.tk.out { animation: tkOut .3s ease-in forwards; }
.tk-art { position: absolute; left: 8px; bottom: 3px; width: 50px; height: 50px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.55)); animation: tkArt .5s cubic-bezier(.2,1.6,.4,1); }
.tk-art svg { width: 100%; height: 100%; display: block; }
.tk-t { font-family: var(--font-display); font-size: 19px; letter-spacing: .8px; text-transform: uppercase; color: var(--c2); white-space: nowrap; }
.tk-d { font-size: 13.5px; color: #d4d9e6; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.18); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.illo-disc { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--c, #ff9a2e); color: #0b0d14; border: 3px solid rgba(0,0,0,.45); box-sizing: border-box; }
@keyframes tkIn { from { opacity: 0; transform: translateY(-14px) scale(.97); } }
@keyframes tkOut { to { opacity: 0; transform: translateY(-10px); } }
@keyframes tkArt { from { transform: translateY(-20px) rotate(-14deg) scale(.6); } }

/* ---------- Комбо-счётчик событий: правый верхний угол поля, быстро (≤1 с) ---------- */
#combo { position: absolute; top: 4px; right: 4px; z-index: 13; pointer-events: none; }
.cb {
  display: flex; align-items: center; gap: 8px; padding: 4px 16px 4px 6px; transform: skewX(-10deg); transform-origin: right;
  background: linear-gradient(90deg, transparent, rgba(12,8,16,.88) 28%); border-right: 4px solid var(--c);
  animation: cbLife var(--ms, 900ms) cubic-bezier(.2,1,.3,1) forwards;
}
.cb > * { transform: skewX(10deg); }
.cb.streak .cb-art { width: 54px; height: 54px; }
.cb.streak b { font-size: 21px; }
.cb-art { width: 44px; height: 44px; flex-shrink: 0; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c) 70%, transparent)); }
.cb-art svg { width: 100%; height: 100%; display: block; }
.cb-n { font-family: 'Lilita One', var(--font-display); font-size: 40px; line-height: .9; color: #fff; -webkit-text-stroke: 5px #2a0606; paint-order: stroke fill; text-shadow: 0 0 16px var(--c); }
.cb-txt { max-width: 230px; }
.cb b { display: block; font-family: var(--font-display); font-size: 17px; letter-spacing: 1px; text-transform: uppercase; color: var(--c2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
.cb small { display: block; font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes cbLife {
  0% { opacity: 0; transform: skewX(-10deg) translateX(70px); }
  12% { opacity: 1; transform: skewX(-10deg) translateX(0); }
  88% { opacity: 1; transform: skewX(-10deg) translateX(0); }
  100% { opacity: 0; transform: skewX(-10deg) translateX(30px); }
}

/* тосты в меню и лобби */
.notice {
  display: flex; align-items: center; gap: 10px;
  background: rgba(14, 16, 26, .9); border: 1px solid rgba(255,255,255,.1);
  border-left: 4px solid #6c7386; border-radius: 10px;
  padding: 7px 14px 7px 10px; box-shadow: 0 6px 18px rgba(0,0,0,.45);
  animation: noticeIn .18s ease-out; transition: opacity .35s, transform .35s;
}
.notice.hide { opacity: 0; transform: translateY(-6px); }
.notice .ni { display: inline-flex; flex-shrink: 0; line-height: 1; color: #e8871e; }
.notice.good .ni { color: #2ecc71; }
.notice.bad .ni { color: #ff6b5e; }
.notice.chaos .ni { color: #c58bff; }
.notice .nt { font-weight: 700; font-size: 14px; color: #fff; }
.notice .nd { font-size: 12px; color: #b8bdcc; margin-top: 1px; }
.notice.good { border-left-color: #2ecc71; }
.notice.bad { border-left-color: #e74c3c; }
.notice.chaos { border-left-color: #9b59b6; }
.notice.info { border-left-color: #e8871e; }
@keyframes noticeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Колесо эмодзи ---------- */
#emoteWheel {
  position: absolute; left: 50%; top: 50%; width: 300px; height: 300px;
  transform: translate(-50%, -50%) scale(.85); border-radius: 50%;
  background: radial-gradient(circle, rgba(10,12,20,.55) 0 28%, rgba(10,12,20,.88) 29% 100%);
  border: 2px solid rgba(255,255,255,.15);
  opacity: 0; pointer-events: none; z-index: 20;
  transition: opacity .12s, transform .12s;
}
#emoteWheel.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
#emoteWheel button {
  position: absolute; width: 54px; height: 54px; margin: -27px 0 0 -27px;
  border-radius: 50%; border: none; background: rgba(255,255,255,.06);
  font-size: 30px; line-height: 54px; padding: 0; transition: transform .1s, background .1s;
}
#emoteWheel button.hot { background: rgba(232,135,30,.85); transform: scale(1.22); }
#emoteWheel .hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 90px; text-align: center; font-size: 11px; color: var(--muted); pointer-events: none;
}

#overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; border-radius: 8px; font-size: 20px;
  font-weight: bold; text-align: center; pointer-events: none;
  opacity: 0; transition: .3s; padding: 20px;
}
#overlay.show { opacity: 1; }
#overlay .title { font-family: var(--font-display); font-size: 30px; letter-spacing: 1px; margin-bottom: 12px; }
#overlay .rank-table { background: rgba(255,255,255,.05); padding: 10px 14px; border-radius: 10px; }
#overlay .rank-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 5px 12px; font-size: 14px; font-weight: 500; min-width: 360px;
}
#overlay .rank-row.win { color: #2ecc71; }
#overlay .rank-row.lose { color: #e74c3c; }
#overlay .rank-row .rn { display: flex; align-items: center; gap: 8px; }
#overlay .stage { color: #aaa; font-size: 11px; }

#controls { font-size: 11px; line-height: 1.5; color: var(--muted); }

@media (max-width: 1100px) {
  #rightbar { width: 200px; }
  #sidebar { width: 200px; }
}.pcard .dash.ready.hyper { color: #ffa53b; }
