:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --border: #d8dee6;
  --text: #1f2933;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #dc2626;
  --ok: #16a34a;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.card.hidden { display: none; }

.session-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--accent);
  margin: 8px 0 4px;
  user-select: all;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
}
.status.online .dot { background: var(--ok); }
.status.online { color: var(--ok); }

/*input[type="text"] {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  width: 220px;
  outline: none;
}
input[type="text"]:focus { border-color: var(--accent); }

 button {
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: .5; cursor: not-allowed; }

button.secondary {
  background: #e5e7eb;
  color: var(--text);
}
button.secondary:hover { background: #d1d5db; } */

.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* -------- Консоль пользователя -------- */
#consoleLog {
  background: #0f172a;
  color: #cbd5e1;
  padding: 10px 12px;
  border-radius: 8px;
  height: 260px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  contain: strict;
  will-change: scroll-position;
}
#consoleLog .line {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 1px 0;
}

/* Цвета уровней в консоли пользователя */
#consoleLog .line .ts    { color: #64748b; }
#consoleLog .line .level { font-weight: 600; margin: 0 6px; }
#consoleLog .line.level-log   .level { color: #93c5fd; }
#consoleLog .line.level-error .level { color: #f87171; }
#consoleLog .line.level-error        { color: #fca5a5; }

/* -------- Счётчики в шапке -------- */
.stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}
.stats b { color: var(--text); font-weight: 600; }

/* -------- Контейнер воспроизведения -------- */
#replayContainer {
  position: relative;
  border: 2px solid var(--accent);
  border-radius: 10px;
  width: 100%;
  /* height: 70vh; */
  min-height: 480px;
  overflow: auto;                /* оператор может скроллить */
  background: #fff;
}

/* Внутренняя «сцена» — размеры 1:1 с viewport клиента.
   Задаются из JS: width/height = recordedViewport. */
#replayStage {
  position: relative;
  width: 100% !important;
  height: 100%;
  /* CSS-трансформации не используем — «настоящий» размер */
}

/* rrweb-плеер кладётся внутрь #replayStage */
#replayStage > iframe,
#replayStage > .replayer-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#replayStage iframe {
  margin: auto;
}

#overlay {
  position: absolute;
  inset: 0;
}

/* -------- Оверлей для курсора и вспышек кликов -------- */
/* Лежит внутри #replayStage и скроллится вместе с ним. */
#clickLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1000;
}

/* -------- Курсор клиента -------- */
.client-pointer {
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.35);
  border: 2px solid rgba(37, 99, 235, 0.95);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
  pointer-events: none;
  transition: transform 60ms linear;
  will-change: transform;
  z-index: 20;
}

/* -------- Вспышка клика -------- */
.click-pulse {
  position: absolute;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.45);
  border: 2px solid rgba(220, 38, 38, 0.95);
  pointer-events: none;
  animation: clickPulse 0.6s ease-out forwards;
  transform-origin: center center;
  z-index: 15;
}

@keyframes clickPulse {
  0%   { transform: scale(0.4); opacity: 1; }
  70%  { transform: scale(1.6); opacity: 0.6; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* -------- Крестик в момент клика -------- */
.click-cross {
  position: absolute;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  margin-top: -10px;
  pointer-events: none;
  animation: clickCross 0.6s ease-out forwards;
  opacity: 0.9;
  z-index: 15;
}
.click-cross::before,
.click-cross::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 100%;
  background: rgba(220, 38, 38, 0.95);
  transform-origin: center;
}
.click-cross::before { transform: translate(-50%, -50%) rotate(45deg); }
.click-cross::after  { transform: translate(-50%, -50%) rotate(-45deg); }

@keyframes clickCross {
  0%   { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}