/* ============================================================
   КИБЕРСАПЁР — визуальная тема
   Один источник правды для цвета, ритма и движения интерфейса.
   ============================================================ */

:root {
  /* Палитра */
  --bg-0: #04060b;
  --bg-1: #070b14;
  --bg-2: #0b1220;
  --panel: rgba(10, 18, 32, 0.72);
  --panel-solid: #0a1220;
  --line: rgba(80, 140, 180, 0.18);
  --line-hot: rgba(34, 232, 255, 0.45);

  --cyan: #22e8ff;
  --cyan-dim: #7fe3ff;
  --magenta: #ff2e88;
  --lime: #a6ff3d;
  --amber: #ffb03a;
  --violet: #8b5cff;
  --red: #ff5c3a;

  --text: #d7ecf7;
  --text-dim: #7f9aad;
  --text-mute: #4f6577;

  /* Ритм */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 0.42s;

  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Menlo', 'Consolas', monospace;
  --glow-cyan: 0 0 12px rgba(34, 232, 255, 0.55), 0 0 34px rgba(34, 232, 255, 0.18);
  --glow-magenta: 0 0 12px rgba(255, 46, 136, 0.55), 0 0 34px rgba(255, 46, 136, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--mono);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

body { position: relative; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
canvas { display: block; }

/* --- Фоновые слои ------------------------------------------------- */

#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }

.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 40%, transparent 35%, rgba(0, 0, 0, 0.55) 100%),
    radial-gradient(ellipse 60% 50% at 50% 110%, rgba(139, 92, 255, 0.10), transparent 70%);
}

.scanlines {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.35;
  background: repeating-linear-gradient(to bottom,
    rgba(255, 255, 255, 0.028) 0px, rgba(255, 255, 255, 0.028) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: overlay;
  animation: scan-drift 9s linear infinite;
}
@keyframes scan-drift { to { background-position: 0 60px; } }

.grain {
  position: fixed; inset: -50%; z-index: 3; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-move 0.6s steps(3) infinite;
}
@keyframes grain-move {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-2%, 1%); }
  66% { transform: translate(1%, -2%); }
}

#app { position: relative; z-index: 5; height: 100%; }

/* --- Экраны -------------------------------------------------------- */

.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  opacity: 0; transform: scale(0.985) translateY(10px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), filter var(--dur) var(--ease);
  filter: blur(6px);
  pointer-events: none;
}
.screen[hidden] { display: none; }
.screen.is-active { opacity: 1; transform: none; filter: none; pointer-events: auto; }
.screen.is-leaving { opacity: 0; transform: scale(1.02); filter: blur(8px); }

/* --- Главное меню --------------------------------------------------- */

.screen--menu { align-items: center; justify-content: center; }

.menu-wrap {
  width: min(680px, 90vw);
  display: flex; flex-direction: column; align-items: center; gap: 26px;
  text-align: center;
}

.logo { position: relative; }
.logo__glitch {
  font-size: clamp(38px, 8.2vw, 82px);
  font-weight: 700; letter-spacing: 0.16em;
  color: #eafcff;
  text-shadow: 0 0 22px rgba(34, 232, 255, 0.55), 0 0 60px rgba(34, 232, 255, 0.22);
  position: relative;
}
.logo__glitch::before, .logo__glitch::after {
  content: attr(data-text); position: absolute; inset: 0;
  clip-path: inset(0 0 55% 0);
}
.logo__glitch::before { color: var(--magenta); animation: glitch-a 4.2s infinite steps(2); }
.logo__glitch::after { color: var(--cyan); clip-path: inset(55% 0 0 0); animation: glitch-b 3.4s infinite steps(2); }
@keyframes glitch-a {
  0%, 92%, 100% { transform: translate(0); opacity: 0; }
  93% { transform: translate(-3px, -2px); opacity: 0.85; }
  95% { transform: translate(2px, 1px); opacity: 0.6; }
  97% { transform: translate(-1px, 2px); opacity: 0.7; }
}
@keyframes glitch-b {
  0%, 88%, 100% { transform: translate(0); opacity: 0; }
  89% { transform: translate(3px, 1px); opacity: 0.8; }
  92% { transform: translate(-2px, -1px); opacity: 0.55; }
  94% { transform: translate(1px, 2px); opacity: 0.7; }
}
.logo__sub {
  margin-top: 10px; font-size: clamp(9px, 1.5vw, 12px); letter-spacing: 0.42em;
  color: var(--text-mute);
}

.menu-tag { color: var(--text-dim); font-size: 13px; line-height: 1.85; letter-spacing: 0.06em; }

.menu-actions { display: flex; flex-direction: column; gap: 12px; width: min(340px, 80vw); }

.btn {
  position: relative; padding: 15px 22px;
  background: linear-gradient(180deg, rgba(18, 32, 52, 0.85), rgba(10, 18, 32, 0.85));
  border: 1px solid var(--line);
  color: var(--text); font-size: 13px; letter-spacing: 0.22em; font-weight: 600;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: all 0.28s var(--ease);
  overflow: hidden;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(34, 232, 255, 0.22), transparent 70%);
  transform: translateX(-120%); transition: transform 0.65s var(--ease);
}
.btn:hover { border-color: var(--line-hot); color: #fff; box-shadow: var(--glow-cyan); transform: translateY(-2px); }
.btn:hover::before { transform: translateX(120%); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn span { position: relative; z-index: 1; }
.btn em { font-style: normal; color: var(--violet); margin-left: 8px; }

.btn--primary {
  background: linear-gradient(180deg, rgba(34, 232, 255, 0.16), rgba(34, 232, 255, 0.05));
  border-color: rgba(34, 232, 255, 0.5); color: #eafcff;
  box-shadow: 0 0 0 1px rgba(34, 232, 255, 0.1), var(--glow-cyan);
}
.btn--primary:hover { background: linear-gradient(180deg, rgba(34, 232, 255, 0.28), rgba(34, 232, 255, 0.1)); }

.btn--danger { border-color: rgba(255, 46, 136, 0.45); color: #ffd6e6; }
.btn--danger:hover { box-shadow: var(--glow-magenta); border-color: var(--magenta); }

.menu-stats {
  display: flex; gap: 26px; flex-wrap: wrap; justify-content: center;
  font-size: 10px; letter-spacing: 0.2em; color: var(--text-mute);
}
.menu-stats b { color: var(--cyan-dim); font-weight: 600; }

.menu-foot { display: flex; gap: 10px; }
.chip {
  padding: 7px 14px; font-size: 10px; letter-spacing: 0.18em;
  border: 1px solid var(--line); border-radius: 999px; color: var(--text-mute);
  transition: all 0.25s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line-hot); }
.chip[aria-pressed="false"] { opacity: 0.35; text-decoration: line-through; }

/* --- Верхняя панель -------------------------------------------------- */

.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 14px clamp(14px, 3vw, 30px);
  background: linear-gradient(180deg, rgba(6, 11, 20, 0.94), rgba(6, 11, 20, 0.55));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  flex-shrink: 0; min-height: 62px;
}

.hud-block { display: flex; align-items: center; gap: 9px; }
.hud-label { font-size: 9px; letter-spacing: 0.24em; color: var(--text-mute); }
.hud-value { font-size: 15px; font-weight: 700; letter-spacing: 0.06em; }

.integrity { display: flex; gap: 5px; }
.integrity__cell {
  width: 15px; height: 22px; border: 1px solid rgba(255, 46, 136, 0.4);
  background: rgba(255, 46, 136, 0.08);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
  transition: all 0.35s var(--ease);
}
.integrity__cell.is-full {
  background: linear-gradient(180deg, var(--magenta), rgba(255, 46, 136, 0.35));
  box-shadow: 0 0 10px rgba(255, 46, 136, 0.6);
}
.integrity__cell.is-lost { animation: cell-break 0.6s var(--ease); }
@keyframes cell-break {
  0% { background: #fff; box-shadow: 0 0 24px #fff; transform: scale(1.35); }
  100% { transform: scale(1); }
}

.credits { color: var(--lime); text-shadow: 0 0 12px rgba(166, 255, 61, 0.45); }
.credits.is-bump { animation: bump 0.45s var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }

.spacer { flex: 1; }

.sector-tag { display: flex; flex-direction: column; gap: 3px; }
.sector-tag__name { font-size: 13px; letter-spacing: 0.2em; font-weight: 700; }
.sector-tag__sub { font-size: 9px; letter-spacing: 0.14em; color: var(--text-mute); }

.trace-bar {
  position: relative; width: clamp(90px, 16vw, 190px); height: 7px;
  background: rgba(255, 46, 136, 0.1); border: 1px solid rgba(255, 46, 136, 0.3);
  overflow: hidden;
}
.trace-bar__fill {
  position: absolute; inset: 0; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, var(--amber), var(--magenta));
  box-shadow: 0 0 14px rgba(255, 46, 136, 0.7);
  transition: transform 0.14s linear;
}
.trace-bar.is-critical { animation: trace-alarm 0.75s infinite; }
@keyframes trace-alarm { 50% { box-shadow: 0 0 22px rgba(255, 46, 136, 0.85); border-color: var(--magenta); } }

.affix-row { display: flex; gap: 7px; }
.affix-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 11px; font-size: 9.5px; letter-spacing: 0.16em;
  border: 1px solid currentColor; border-radius: 3px; opacity: 0.9;
  background: rgba(0, 0, 0, 0.35); cursor: help;
  transition: all 0.25s var(--ease);
}
.affix-pill:hover { opacity: 1; box-shadow: 0 0 14px currentColor; }
.affix-pill i { font-style: normal; font-size: 12px; }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--text-dim); font-size: 14px;
  transition: all 0.25s var(--ease);
}
.icon-btn:hover { color: var(--cyan); border-color: var(--line-hot); box-shadow: var(--glow-cyan); }

/* --- Карта --------------------------------------------------------- */

.screen--map { overflow: hidden; }
#map-canvas { flex: 1; width: 100%; min-height: 0; cursor: pointer; }

.map-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 12px clamp(14px, 3vw, 30px) 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(0deg, rgba(6, 11, 20, 0.95), transparent);
  flex-wrap: wrap;
}
.map-hint { font-size: 10px; letter-spacing: 0.22em; color: var(--cyan-dim); animation: pulse-soft 2.6s infinite; }
@keyframes pulse-soft { 50% { opacity: 0.45; } }
.map-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 9px; letter-spacing: 0.14em; color: var(--text-mute); }
.map-legend span { display: flex; align-items: center; gap: 6px; }
.map-legend i { font-style: normal; font-size: 13px; }

/* --- Игровой экран -------------------------------------------------- */

.play-body { flex: 1; display: flex; min-height: 0; gap: 0; }

.side-panel {
  width: clamp(160px, 15vw, 220px); flex-shrink: 0;
  padding: 16px 14px; overflow-y: auto;
  background: linear-gradient(180deg, rgba(8, 14, 26, 0.6), transparent);
  display: flex; flex-direction: column; gap: 12px;
}
.side-panel--left { border-right: 1px solid var(--line); }
.side-panel--right { border-left: 1px solid var(--line); }
.side-panel::-webkit-scrollbar { width: 4px; }
.side-panel::-webkit-scrollbar-thumb { background: var(--line-hot); }

.panel-title {
  font-size: 9px; letter-spacing: 0.26em; color: var(--text-mute);
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}

.implant-card {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: rgba(10, 18, 32, 0.5);
  transition: all 0.28s var(--ease); cursor: help;
  animation: card-in 0.5s var(--ease) backwards;
}
@keyframes card-in { from { opacity: 0; transform: translateX(-14px); } }
.implant-card:hover { border-color: var(--line-hot); background: rgba(20, 36, 58, 0.7); transform: translateX(3px); }
.implant-card__icon { font-size: 15px; line-height: 1.1; flex-shrink: 0; }
.implant-card__body { min-width: 0; }
.implant-card__name { font-size: 9.5px; letter-spacing: 0.1em; font-weight: 700; }
.implant-card__desc { font-size: 9px; color: var(--text-mute); line-height: 1.55; margin-top: 3px; }

.stat-row { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 0.1em; }
.stat-row span:last-child { color: var(--cyan-dim); font-weight: 700; }

.board-stage {
  flex: 1; position: relative; min-width: 0;
  display: grid; place-items: center; padding: 10px;
}
#board-canvas { max-width: 100%; max-height: 100%; touch-action: none; cursor: crosshair; }
.board-overlay { position: absolute; inset: 0; pointer-events: none; }

.softbar {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px clamp(14px, 3vw, 30px);
  border-top: 1px solid var(--line);
  background: linear-gradient(0deg, rgba(6, 11, 20, 0.95), rgba(6, 11, 20, 0.4));
  backdrop-filter: blur(14px); flex-shrink: 0; min-height: 76px; flex-wrap: wrap;
}

.soft-slot {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 9px 15px 9px 11px; min-width: 168px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: rgba(10, 18, 32, 0.7);
  transition: all 0.26s var(--ease);
}
.soft-slot:hover:not(.is-empty):not(.is-spent) {
  border-color: var(--line-hot); box-shadow: var(--glow-cyan); transform: translateY(-3px);
}
.soft-slot.is-armed {
  border-color: var(--cyan); box-shadow: var(--glow-cyan), inset 0 0 24px rgba(34, 232, 255, 0.15);
  animation: armed 1.1s infinite;
}
@keyframes armed { 50% { box-shadow: 0 0 26px rgba(34, 232, 255, 0.75), inset 0 0 30px rgba(34, 232, 255, 0.25); } }
.soft-slot.is-spent { opacity: 0.32; cursor: not-allowed; }
.soft-slot.is-empty { opacity: 0.25; border-style: dashed; cursor: default; justify-content: center; }
.soft-slot__icon { font-size: 19px; color: var(--cyan); text-shadow: var(--glow-cyan); }
.soft-slot__name { font-size: 10px; letter-spacing: 0.12em; font-weight: 700; }
.soft-slot__key {
  position: absolute; top: -8px; left: 9px; padding: 1px 6px; font-size: 8px;
  background: var(--panel-solid); border: 1px solid var(--line); color: var(--text-mute); letter-spacing: 0.1em;
}
.soft-slot__charges { display: flex; gap: 3px; margin-top: 4px; }
.soft-slot__pip { width: 12px; height: 3px; background: var(--line); }
.soft-slot__pip.is-on { background: var(--cyan); box-shadow: 0 0 7px var(--cyan); }

.hotkey-hint { font-size: 9px; letter-spacing: 0.16em; color: var(--text-mute); margin-left: 8px; }

/* --- Модальные окна --------------------------------------------------- */

.modal-layer {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; padding: 20px;
  background: rgba(3, 6, 12, 0.82); backdrop-filter: blur(10px);
  animation: fade-in 0.35s var(--ease);
}
.modal-layer[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } }

.modal {
  width: min(760px, 94vw); max-height: 88vh; overflow-y: auto;
  background: linear-gradient(160deg, rgba(12, 22, 38, 0.97), rgba(7, 12, 22, 0.97));
  border: 1px solid var(--line-hot);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75), 0 0 60px rgba(34, 232, 255, 0.09);
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
  padding: clamp(22px, 4vw, 38px);
  animation: modal-in 0.5s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(26px) scale(0.97); } }
.modal::-webkit-scrollbar { width: 5px; }
.modal::-webkit-scrollbar-thumb { background: var(--line-hot); }

.modal__kicker { font-size: 9px; letter-spacing: 0.35em; color: var(--cyan); margin-bottom: 10px; }
.modal__title {
  font-size: clamp(20px, 3.6vw, 32px); font-weight: 700; letter-spacing: 0.13em;
  margin-bottom: 8px; text-shadow: 0 0 26px rgba(34, 232, 255, 0.35);
}
.modal__sub { font-size: 11px; letter-spacing: 0.16em; color: var(--text-dim); margin-bottom: 24px; }
.modal__text { font-size: 13px; line-height: 1.95; color: var(--text-dim); margin-bottom: 24px; }
.modal__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.modal__actions .btn { flex: 1; min-width: 160px; }

/* Диалоги */
.dialogue { display: flex; flex-direction: column; gap: 16px; margin-bottom: 8px; }
.dline {
  display: flex; gap: 14px; align-items: flex-start;
  animation: line-in 0.55s var(--ease) backwards;
}
@keyframes line-in { from { opacity: 0; transform: translateX(-18px); } }
.dline__who {
  flex-shrink: 0; width: 104px; text-align: right;
  font-size: 10px; letter-spacing: 0.16em; font-weight: 700; padding-top: 2px;
}
.dline__text { font-size: 13px; line-height: 1.85; color: var(--text); flex: 1; }
.dline--vector .dline__who { color: var(--amber); }
.dline--oracle .dline__who { color: var(--violet); }
.dline--boss .dline__who { color: var(--magenta); }
.dline--sys .dline__who { color: var(--cyan); }

/* Карточки выбора: награды, магазин, события */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }

.pick-card {
  position: relative; padding: 18px 16px; text-align: left;
  border: 1px solid var(--line); background: rgba(10, 18, 32, 0.65);
  transition: all 0.3s var(--ease); overflow: hidden;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  animation: card-pop 0.5s var(--ease) backwards;
}
@keyframes card-pop { from { opacity: 0; transform: translateY(20px) scale(0.95); } }
.pick-card::after {
  content: ''; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(circle at 50% 0%, currentColor, transparent 65%);
  transition: opacity 0.3s var(--ease); pointer-events: none;
}
.pick-card:hover:not(:disabled) { transform: translateY(-5px); border-color: currentColor; }
.pick-card:hover:not(:disabled)::after { opacity: 0.12; }
.pick-card:disabled { opacity: 0.32; cursor: not-allowed; }
.pick-card__icon { font-size: 26px; margin-bottom: 12px; display: block; }
.pick-card__rarity { font-size: 8px; letter-spacing: 0.28em; margin-bottom: 6px; }
.pick-card__name { font-size: 12px; letter-spacing: 0.1em; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.pick-card__desc { font-size: 10.5px; line-height: 1.7; color: var(--text-mute); }
.pick-card__price {
  margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 12px; font-weight: 700; color: var(--lime); letter-spacing: 0.08em;
}
.pick-card__price.is-poor { color: var(--red); }
.pick-card__hint { font-size: 9.5px; color: var(--amber); margin-top: 10px; letter-spacing: 0.08em; }
.pick-card.is-sold { opacity: 0.3; }

/* Итоги забега */
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; margin: 24px 0; }
.result-cell { padding: 14px; border: 1px solid var(--line); background: rgba(10, 18, 32, 0.5); }
.result-cell__label { font-size: 8.5px; letter-spacing: 0.2em; color: var(--text-mute); }
.result-cell__value { font-size: 23px; font-weight: 700; margin-top: 6px; color: var(--cyan); }

/* Экран улучшений */
.unlock-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.unlock-card {
  padding: 14px; border: 1px solid var(--line); text-align: left;
  background: rgba(10, 18, 32, 0.55); transition: all 0.28s var(--ease);
}
.unlock-card:hover:not(:disabled) { border-color: var(--line-hot); transform: translateY(-3px); }
.unlock-card.is-owned { border-color: rgba(166, 255, 61, 0.4); background: rgba(166, 255, 61, 0.06); }
.unlock-card:disabled { opacity: 0.4; cursor: not-allowed; }
.unlock-card__cost { font-size: 11px; color: var(--violet); margin-top: 10px; font-weight: 700; }

/* --- Уведомления ----------------------------------------------------- */

.toasts {
  position: fixed; top: 78px; left: 50%; transform: translateX(-50%);
  z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 9px 20px; font-size: 10.5px; letter-spacing: 0.2em; font-weight: 700;
  border: 1px solid currentColor; background: rgba(5, 9, 17, 0.92);
  box-shadow: 0 0 24px currentColor, inset 0 0 20px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.4s var(--ease), toast-out 0.45s var(--ease) forwards;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(0.94); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* --- Адаптив --------------------------------------------------------- */

@media (max-width: 900px) {
  .side-panel { display: none; }
  .topbar { gap: 12px; padding: 10px 12px; min-height: 54px; flex-wrap: wrap; }
  .hud-label { display: none; }
  .soft-slot { min-width: 0; padding: 8px 11px; }
  .soft-slot__name, .soft-slot__key, .hotkey-hint { display: none; }
  .softbar { min-height: 62px; gap: 8px; }
  .dline__who { width: 74px; font-size: 9px; }
  .map-legend { display: none; }
}

@media (max-width: 620px) {
  .modal { padding: 20px 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .trace-bar { width: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .scanlines { animation: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.12s !important; }
}
