/* live.css — трансляции партий: страница зрителя (live.js) и пульт (live-pult.js). */

.lv-page { background: var(--bg, #f7f6f2); color: var(--ink, #16161a); min-height: 100dvh; }

.lv-top { background: var(--surface, #fff); border-bottom: 1px solid var(--line, #e3e1da); }
.lv-top-in {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1120px; margin: 0 auto; padding: 14px 16px;
}
.lv-kicker { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #5c5b57); }
.lv-title { margin: 2px 0 0; font-size: clamp(1.125rem, 3.6vw, 1.5rem); line-height: 1.2; }
.lv-h2 { margin: 0 0 8px; font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #5c5b57); }
.lv-link { background: none; border: 0; padding: 0; color: var(--accent, #2f5bea); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-transform: none; letter-spacing: 0; }
.lv-link:hover { text-decoration: underline; }

.lv-badge {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 999px; font-size: .8125rem; font-weight: 700; white-space: nowrap;
}
.lv-badge[hidden] { display: none; }
.lv-badge-live { background: #fdecea; color: #b8322a; }
.lv-badge-live::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #e0362c;
  animation: lv-pulse 1.4s ease-in-out infinite;
}
.lv-badge-over { background: var(--surface-2, #f1efe9); color: var(--ink, #16161a); }
@keyframes lv-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }

/* ---------------------------------------------------------------- зритель */

.lv {
  display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 24px;
  max-width: 1120px; margin: 0 auto; padding: 20px 16px 32px; align-items: start;
}
@media (max-width: 860px) { .lv { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 12px; } }

.lv-stage { display: flex; flex-direction: column; gap: 8px; }
.lv-player {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px;
  background: var(--surface, #fff); border: 1px solid var(--line, #e3e1da); border-radius: 10px;
}
.lv-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #16161a; flex: none; }
.lv-dot-w { background: #fff; }
.lv-dot-b { background: #16161a; }
.lv-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-colour { color: var(--muted, #5c5b57); font-size: .875rem; }
.lv-adv { font-family: var(--font-num, ui-monospace, monospace); font-weight: 700; color: var(--ok, #1d7a46); font-size: .875rem; }
.lv-turn {
  margin-left: auto; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft, #e9eefc);
  color: var(--accent-ink, #2449c4); font-size: .75rem; font-weight: 700;
}

.lv-boardwrap { display: flex; gap: 8px; align-items: stretch; }
.lv-boardwrap > #lv-board { flex: 1; min-width: 0; }
.lv-eval {
  position: relative; width: 12px; flex: none; border-radius: 6px; overflow: hidden;
  background: #3a3a40; border: 1px solid var(--line-strong, #cfccc3);
}
.lv-eval-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; background: #f4f2ec; transition: height .5s ease; }

.lv-hist { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft, #fdf5e4); color: var(--warn, #8f5300); font-size: .875rem; display: flex; gap: 8px; flex-wrap: wrap; }
.lv-hist[hidden] { display: none; }

.lv-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lv-rex { display: flex; align-items: flex-end; gap: 4px; }
.lv-rex-img { width: 120px; height: 120px; flex: none; object-fit: contain; margin-bottom: -6px; }
.lv-bubble {
  position: relative; flex: 1; min-width: 0; padding: 14px 16px; background: var(--surface, #fff);
  border: 1px solid var(--line, #e3e1da); border-radius: 16px 16px 16px 4px; box-shadow: var(--shadow-md, 0 4px 14px rgba(0,0,0,.07));
}
.lv-say { margin: 0 0 10px; font-size: 1.0625rem; line-height: 1.45; font-weight: 500; min-height: 3em; }
.lv-voice {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong, #cfccc3); background: var(--surface-2, #f1efe9); font: inherit; font-size: .875rem; font-weight: 600; color: var(--ink, #16161a);
}
.lv-voice-note { margin: 6px 0 0; font-size: .8125rem; color: var(--muted, #5c5b57); min-height: 1.2em; }
.lv-voice-note:empty { display: none; }
.lv-voice[aria-pressed="true"] { background: var(--accent, #2f5bea); border-color: var(--accent, #2f5bea); color: #fff; }

.lv-moves-wrap { background: var(--surface, #fff); border: 1px solid var(--line, #e3e1da); border-radius: 14px; padding: 12px; }
.lv-moves {
  list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto;
  display: grid; grid-template-columns: 1fr; font-family: var(--font-num, ui-monospace, monospace);
}
.lv-pair { display: grid; grid-template-columns: 2.6em 1fr 1fr; align-items: center; }
.lv-pair:nth-child(odd) { background: var(--surface-2, #f1efe9); border-radius: 6px; }
.lv-n { color: var(--muted, #5c5b57); font-size: .8125rem; padding-left: 6px; }
.lv-mv { text-align: left; background: none; border: 0; padding: 6px 8px; font: inherit; font-size: .9375rem; color: var(--ink, #16161a); cursor: pointer; border-radius: 6px; }
.lv-mv:hover { background: var(--accent-soft, #e9eefc); }
.lv-mv.lv-cur { background: var(--accent, #2f5bea); color: #fff; font-weight: 700; }
.lv-conn { margin: 0; font-size: .8125rem; color: var(--muted, #5c5b57); }
.lv-conn-ok::before { content: "● "; color: var(--ok, #1d7a46); }
.lv-conn-bad { color: var(--warn, #8f5300); }

/* ---------------------------------------------------------------- доска */

.lb-board {
  display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; width: 100%;
  border-radius: 8px; overflow: hidden; user-select: none; -webkit-user-select: none;
  box-shadow: var(--shadow-md, 0 4px 14px rgba(0,0,0,.07)); container-type: inline-size;
}
.lb-sq { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; margin: 0; border: 0; border-radius: 0; min-height: 0; }
button.lb-sq { cursor: pointer; }
.lb-light { background: #f0d9b5; }
.lb-dark { background: #b58863; }
.lb-last.lb-light { background: #cdd26a; }
.lb-last.lb-dark { background: #aaa23a; }
.lb-sel { box-shadow: inset 0 0 0 4px rgba(20, 85, 30, .6); }
.lb-check { background: radial-gradient(circle, #ff3b30 0%, rgba(255, 59, 48, .6) 35%, transparent 75%) !important; }
.lb-dot::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 28%; height: 28%;
  transform: translate(-50%, -50%); border-radius: 50%; background: rgba(20, 85, 30, .45);
}
.lb-take::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 5px rgba(20, 85, 30, .45); border-radius: 50%; }
.lb-sq:focus-visible { outline: 3px solid var(--focus, #2f6fed); outline-offset: -3px; }
.lb-pc { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lb-arrive { animation: lb-arrive .35s ease-out; }
@keyframes lb-arrive { from { transform: scale(.82); opacity: .4; } to { transform: none; opacity: 1; } }
.lb-coord { position: absolute; font-size: clamp(10px, 2.4cqw, 16px); font-weight: 700; line-height: 1; pointer-events: none; z-index: 1; }
.lb-light .lb-coord { color: #b58863; }
.lb-dark .lb-coord { color: #f0d9b5; }
.lb-rank { left: .25em; top: .2em; }
.lb-file { right: .3em; bottom: .2em; }
@media (prefers-reduced-motion: reduce) {
  .lb-arrive, .lv-badge-live::before { animation: none; }
  .lv-eval-fill { transition: none; }
}

/* ---------------------------------------------------------------- пульт */

.lp {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px;
  max-width: 1120px; margin: 0 auto; padding: 20px 16px 32px; align-items: start;
}
@media (max-width: 860px) { .lp { grid-template-columns: minmax(0, 1fr); } }
.lp-login { grid-column: 1 / -1; margin: 0; padding: 12px 16px; border-radius: 10px; background: var(--warn-soft, #fdf5e4); }
.lp-login[hidden], .lp-game[hidden] { display: none; }
.lp-list { display: flex; flex-direction: column; gap: 16px; }
.lp-new { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--surface, #fff); border: 1px solid var(--line, #e3e1da); border-radius: 14px; }
.lp-field { display: flex; flex-direction: column; gap: 4px; font-size: .875rem; font-weight: 600; }
.lp-field small { font-weight: 400; color: var(--muted, #5c5b57); }
.lp-field input { font: inherit; font-weight: 400; padding: 9px 12px; border: 1px solid var(--line-strong, #cfccc3); border-radius: 8px; background: var(--surface, #fff); min-width: 0; }
.lp-err { margin: 0; color: var(--danger, #b8322a); font-size: .875rem; min-height: 1.2em; }
.lp-err:empty { min-height: 0; }
.lp-games { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lp-empty { color: var(--muted, #5c5b57); font-size: .875rem; }
.lp-gm {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 10px 12px; cursor: pointer;
  background: var(--surface, #fff); border: 1px solid var(--line, #e3e1da); border-radius: 10px; font: inherit; color: inherit;
}
.lp-gm-cur { border-color: var(--accent, #2f5bea); box-shadow: 0 0 0 1px var(--accent, #2f5bea); }
.lp-gm-names { font-weight: 700; }
.lp-gm-meta { font-size: .8125rem; color: var(--muted, #5c5b57); }

.lp-game { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lp-game-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lp-game-title { margin: 0; font-size: 1.375rem; }
.lp-game-sub { margin: 2px 0 0; color: var(--muted, #5c5b57); }
.lp-share { display: flex; gap: 8px; flex-wrap: wrap; }
.lp-url { flex: 1 1 220px; min-width: 0; font: inherit; font-size: .875rem; padding: 9px 12px; border: 1px solid var(--line-strong, #cfccc3); border-radius: 8px; background: var(--surface-2, #f1efe9); }
.lp-play { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .lp-play { grid-template-columns: minmax(0, 1fr); } }
.lp-hint { margin: 8px 0 0; font-size: .875rem; color: var(--muted, #5c5b57); }
.lp-controls { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lp-typed { display: flex; gap: 8px; align-items: flex-end; }
.lp-typed .lp-field { flex: 1; min-width: 0; }
.lp-row { display: flex; gap: 8px; flex-wrap: wrap; }
.lp-results .btn { flex: 1; font-family: var(--font-num, ui-monospace, monospace); }
.lp-rex .lv-rex-img { width: 96px; height: 96px; }
.lp-rex .lv-say { margin: 0; font-size: 1rem; }
.lp-voice { margin: 0; font-size: .8125rem; color: var(--muted, #5c5b57); }
.lp-del { align-self: flex-start; color: var(--danger, #b8322a); font-size: .875rem; }
