/* Созвон */

/* главная ученика: кнопка созвона */
.call-live {
  display: flex; align-items: center; gap: 16px; text-decoration: none; margin-bottom: 20px;
  box-shadow: 0 0 0 2px var(--pink), var(--shadow);
}
.call-live .grow small { font-weight: 400; }
.pulse { width: 14px; height: 14px; border-radius: 50%; background: #E0475B; flex: none; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(224,71,91,.5); } 70% { box-shadow: 0 0 0 12px rgba(224,71,91,0); } 100% { box-shadow: 0 0 0 0 rgba(224,71,91,0); } }
.call-idle { display: flex; align-items: center; gap: 12px; margin: -8px 0 20px; flex-wrap: wrap; font-size: 14px; }
.chip.live { animation: pulse 1.4s infinite; vertical-align: 2px; }

/* экран перед входом */
.prejoin { max-width: 560px; margin: 2vh auto 0; text-align: center; }
.prejoin h1 { margin-bottom: 6px; }
.pv-wrap { position: relative; margin: 18px auto 10px; border-radius: 18px; overflow: hidden; background: #2D2A4A; aspect-ratio: 16 / 9; }
.pv-wrap video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.pv-off { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 600; }
.actions.center { justify-content: center; margin-bottom: 16px; }
.btn.ghost.on { box-shadow: 0 0 0 2px var(--olive) inset; }
.tablet-note { background: var(--yel); border-radius: 14px; padding: 14px 16px; margin: 16px 0; line-height: 1.55; text-align: left; }
.prejoin > .btn { min-width: 220px; }
.linkish { border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink-soft); text-decoration: underline; cursor: pointer; margin-top: 10px; }

/* сам созвон */
body.in-call main { max-width: none; padding: 0; }
body.in-call .top { display: none; }
body.in-call { background: #23213A; }
.call {
  display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0;
  background: #23213A; color: #fff; overflow: hidden;
}
.call-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; flex-wrap: wrap; flex: none; }
.call-title { display: flex; flex-direction: column; }
.call-title span { font-size: 13px; color: #C9C6EA; }
.call-people { flex: 1; font-size: 13px; color: #C9C6EA; text-align: right; }
.call-body { flex: 1; display: flex; gap: 10px; padding: 0 10px; min-height: 0; }
.stage { min-height: 120px; }
.stage { flex: 1; min-width: 0; position: relative; border-radius: 16px; overflow: hidden; background: #191829; }
.stage-box { position: absolute; inset: 0; }
#svideo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #191829; }
#sboard, #sink { position: absolute; }
#sboard { background: #fff; border-radius: 4px; }
#sink { pointer-events: none; touch-action: none; }
#sink.drawing { pointer-events: auto; cursor: crosshair; }
#sink.drawing[data-tool="laser"] { cursor: none; }
#sink.drawing[data-tool="eraser"] { cursor: cell; }
.stage-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #B7B4DA; font-size: 18px; text-align: center; padding: 20px; pointer-events: none; }
.stage-msg:empty { display: none; }
.ipad-hint { position: absolute; left: 14px; top: 14px; z-index: 3; max-width: min(420px, calc(100% - 28px)); max-height: calc(100% - 28px); overflow: auto;
  background: #fff; color: var(--ink); border-radius: 16px; padding: 14px 16px; font-size: 14px; line-height: 1.5; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.ipad-hint ol { margin: 8px 0 0; padding-left: 20px; }
.ipad-hint li { margin: 3px 0; }
.ipad-devs { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.ipad-devs .muted { color: var(--ink-soft); }
.ipad-dev .linkish { margin: 0 0 0 4px; font-size: 13px; }
.board-nav {
  flex: none; align-self: center; display: flex; align-items: center; gap: 2px;
  max-width: calc(100% - 20px); margin: 0 10px 8px; overflow-x: auto; scrollbar-width: none;
  background: #2E2B47; padding: 4px; border-radius: 12px;
}
.board-nav::-webkit-scrollbar { display: none; }
.board-nav[hidden] { display: none; }
.bn {
  flex: none; border: 0; font: inherit; font-size: 13px; font-weight: 650; color: #E8E6FA; background: transparent;
  padding: 6px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; margin: 0;
}
.bn:hover:not(:disabled) { background: #3B3860; }
.bn:disabled { opacity: .35; cursor: default; }
.bn[data-bn="prev"], .bn[data-bn="next"] { font-size: 18px; line-height: 1; padding: 4px 12px; }
.bn.busy { opacity: .5; pointer-events: none; }
.bn-label { font-size: 13px; color: #C9C6EA; padding: 0 6px; white-space: nowrap; }
.call.tablet .bn { padding: 8px 12px; font-size: 14px; }

.tiles { width: 220px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.tile { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: #34314F; flex: none; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.self video { transform: scaleX(-1); }
.tile .avatar {
  position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; background: var(--lav); color: var(--ink); font-size: 24px; font-weight: 800;
}
.tname {
  position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(20,18,36,.65); padding: 2px 8px; border-radius: 8px; font-size: 12px;
}
.call:not(.has-stage) .tiles { width: 260px; }

.chatbox { width: 280px; display: flex; flex-direction: column; background: #2E2B47; border-radius: 16px; padding: 10px; }
.chat-log { flex: 1; overflow-y: auto; font-size: 14px; display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.chat-log .muted { color: #A9A6CC; }
.chat-row b { color: var(--lav); }
#chatform { display: flex; gap: 6px; margin-top: 8px; }
#chatform input { background: #fff; padding: 8px 10px; }

.call-tools { display: flex; gap: 10px; padding: 10px; flex-wrap: wrap; justify-content: center; flex: none; }
.tg { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; background: #2E2B47; padding: 6px; border-radius: 14px; }
.ct {
  border: 0; font: inherit; font-size: 14px; font-weight: 650; color: #E8E6FA; background: transparent;
  padding: 8px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap; margin: 0;
}
.ct:hover { background: #3B3860; }
.ct.on { background: var(--lav); color: var(--ink); }
#tmic:not(.on), #tcam:not(.on) { background: #5A2B3D; color: #FFD5DE; }
#tscreen.on { background: var(--pink); }
.ink.disabled { opacity: .4; pointer-events: none; }
.swatches, .widths { display: inline-flex; gap: 5px; padding: 0 4px; }
.sw { width: 24px; height: 24px; border-radius: 8px; border: 2px solid rgba(255,255,255,.25); cursor: pointer; padding: 0; }
.sw.on { outline: 2px solid #fff; outline-offset: 2px; }
.wd { width: 30px; height: 30px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.wd i { display: block; border-radius: 50%; background: #E8E6FA; }
.wd.on { background: #3B3860; }

/* планшет: только сцена и инструменты */
.call.tablet .tiles { display: none; }
.call.tablet .call-body { padding: 0 6px; }
.call.tablet .ct { padding: 10px 13px; font-size: 15px; }
.call.tablet .sw { width: 30px; height: 30px; }

@media (max-width: 900px), (max-height: 600px) {
  .call-bar { padding: 6px 10px; gap: 10px; flex-wrap: nowrap; }
  .call-title { min-width: 0; }
  .call-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .call-people { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .call-body { gap: 6px; padding: 0 6px; }
  .board-nav { margin: 0 6px 6px; }
  .call-tools { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; gap: 6px; padding: 6px; scrollbar-width: none; }
  .call-tools::-webkit-scrollbar { display: none; }
  .tg { flex: none; flex-wrap: nowrap; padding: 4px; gap: 4px; }
  .ct { padding: 7px 10px; font-size: 13px; }
  .call.tablet .ct { padding: 9px 12px; font-size: 14px; }
  .swatches, .widths { flex: none; }
  .tiles { width: 150px; }
  .call:not(.has-stage) .tiles { width: 170px; }
  .chatbox { width: 230px; }
}
/* телефон боком и другие низкие экраны: шапка, панель листов и кнопки — минимальной высоты */
@media (max-height: 480px) {
  .call-bar { padding: 4px 8px; }
  .call-title span { display: none; }
  .call-title b { font-size: 14px; }
  .call-bar .btn.sm { padding: 4px 10px; font-size: 13px; }
  .call-people { font-size: 12px; }
  .board-nav { padding: 2px; margin-bottom: 4px; border-radius: 10px; }
  .bn, .call.tablet .bn { padding: 4px 9px; font-size: 12px; }
  .bn[data-bn="prev"], .bn[data-bn="next"] { font-size: 16px; padding: 2px 10px; }
  .bn-label { font-size: 12px; }
  .call-tools { padding: 4px 6px; }
  .tg { padding: 2px; border-radius: 10px; }
  .ct, .call.tablet .ct { padding: 5px 9px; font-size: 12px; border-radius: 8px; }
  .sw, .call.tablet .sw { width: 22px; height: 22px; border-radius: 7px; }
  .wd { width: 24px; height: 24px; }
  .tiles { width: 120px; gap: 6px; }
  .tile .avatar { width: 40px; height: 40px; font-size: 18px; }
  .stage { min-height: 100px; border-radius: 12px; }
}
@media (max-width: 640px) and (orientation: portrait) {
  .call-body { flex-direction: column; }
  .stage { flex: 1; }
  .tiles, .call:not(.has-stage) .tiles { width: 100%; flex-direction: row; overflow-x: auto; flex: none; height: 96px; }
  .tile { width: 140px; height: 100%; aspect-ratio: auto; }
  .chatbox { width: 100%; height: 220px; flex: none; }
  .call-people { display: none; }
}

/* эффекты камеры */
.fx-row { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; }
.fx-menu { position: relative; display: inline-flex; }
.fx-pop { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 20; display: flex; flex-direction: column; gap: 8px;
  background: #fff; color: var(--ink); border-radius: 14px; padding: 12px 14px; box-shadow: 0 12px 30px rgba(0,0,0,.3); white-space: nowrap; font-size: 14px; }
.fx-pop[hidden] { display: none; }
.fx-pop label { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; }
.fx-pop input { width: auto; }
