:root {
  --accent: #d4ff3f;
  --danger: #f2554c;
  --glass: rgba(0, 0, 0, 0.45);
  --glass-border: rgba(255, 255, 255, 0.2);
  --muted: rgba(255, 255, 255, 0.7);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #fff;
  background: #111;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }

.screen { position: fixed; inset: 0; }

/* ---------- вход ---------- */
#join { display: flex; align-items: center; justify-content: center; background: #111; padding: 24px; }
.join-box { width: 100%; max-width: 420px; }
.join-head { display: flex; align-items: center; justify-content: space-between; }
h1 { font-size: 44px; font-weight: 800; margin: 0; }
#lang { background: #2a2a2a; color: #fff; border: 0; border-radius: 20px; padding: 8px 14px; }
.field { display: block; margin-top: 28px; }
.field span { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.field input { width: 100%; padding: 16px; font-size: 20px; letter-spacing: 1px; color: #fff; background: transparent; border: 1px solid #777; border-radius: 6px; outline: none; }
.field input:focus { border-color: var(--accent); }
.btn-primary { margin-top: 24px; width: 100%; height: 60px; border-radius: 30px; background: var(--accent); color: #000; font-size: 20px; font-weight: 800; }
.error { color: var(--danger); min-height: 1em; }

/* ---------- просмотр ---------- */
#watch { background: #000; }
#video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
/* На широком экране (компьютер) вертикальное видео не обрезаем. */
@media (min-aspect-ratio: 3/4) { #video { object-fit: contain; } }
.shade { position: absolute; left: 0; right: 0; bottom: 0; height: 55%; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.6)); }

.waiting { position: absolute; left: 24px; right: 140px; top: 30%; }
.wait-text { font-size: 18px; margin: 16px 0 6px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(212,255,63,0.25); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.glass { background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 28px; }
.controls { position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) 16px max(8px, env(safe-area-inset-bottom)); pointer-events: none; }
.controls > * { pointer-events: none; }
.controls button, .controls input, .controls .msg, .controls .metro, .controls .menu, .controls label { pointer-events: auto; }

.top { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.round { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; flex: none; }
.pill { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 16px; font-weight: 600; }
.badge { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-weight: 600; white-space: nowrap; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--danger); }
.chip { padding: 6px 12px; font-size: 14px; color: var(--muted); border-radius: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.quality-row { margin-top: 8px; min-height: 30px; position: relative; }
.small-chip { color: #fff; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.hd { color: var(--accent); font-weight: 800; font-size: 11px; border: 1.5px solid var(--accent); border-radius: 3px; padding: 0 2px; }
.menu { position: absolute; top: 34px; left: 0; background: #222; border-radius: 10px; overflow: hidden; z-index: 5; }
.menu button { display: block; width: 100%; text-align: left; padding: 10px 18px; }
.menu button.sel { color: var(--accent); }

.middle { flex: 1; display: flex; justify-content: flex-end; align-items: center; min-height: 0; overflow: auto; padding: 8px 0; }
.commands { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.commands button { pointer-events: auto; height: 44px; padding: 0 14px; border-radius: 22px; font-size: 16px; font-weight: 600; }
.commands button:disabled { opacity: 0.5; }

.bottom { display: flex; flex-direction: column; gap: 10px; }
.chat { display: flex; flex-direction: column; gap: 4px; text-shadow: 0 0 6px #000; }
.chat .row { font-size: 18px; font-weight: 500; overflow-wrap: anywhere; }
.chat .who { color: var(--muted); font-size: 14px; font-weight: 400; margin-right: 10px; }
.chat .cmd { border-left: 3px solid var(--accent); padding-left: 12px; margin: 4px 0; }
.chat .cmd .text { color: var(--accent); font-size: 30px; font-weight: 800; }

.metro { padding: 6px 16px 8px; border-radius: 24px; }
.metro-row { display: flex; align-items: center; gap: 8px; }
.metro-icon { font-size: 20px; width: 24px; color: var(--muted); transition: color 0.05s; cursor: pointer; }
.metro-icon.on { color: #fff; }
.metro-icon.flash { color: var(--accent); }
.metro-label { flex: 1; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bpm { font-size: 16px; color: var(--muted); }
.bpm.on { color: #fff; }
.icon-btn { font-size: 18px; opacity: 0.5; }
.icon-btn.on { opacity: 1; }
#bpm { width: 100%; accent-color: var(--accent); height: 28px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: #444; transition: 0.15s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #bbb; transition: 0.15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(18px); background: #000; }

.input-row { display: flex; gap: 12px; align-items: center; }
.msg { flex: 1; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 8px 0 18px; }
.msg input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: #fff; font-size: 17px; }
.msg input::placeholder { color: var(--muted); }
.send { color: var(--accent); font-size: 22px; padding: 6px 10px; }
.talking { flex: 1; display: flex; gap: 10px; align-items: center; font-size: 17px; }
.eq { color: var(--accent); }
.mic { width: 60px; height: 60px; font-size: 26px; transition: transform 0.12s, background 0.12s; touch-action: none; user-select: none; -webkit-user-select: none; }
.mic.on { background: var(--accent); transform: scale(1.12); box-shadow: 0 0 16px rgba(212,255,63,0.6); }
.mic:disabled { opacity: 0.5; }
.hint { text-align: right; color: var(--muted); font-size: 13px; }

.show-btn { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; }
.focus-ring { position: absolute; width: 72px; height: 72px; margin: -36px 0 0 -36px; border: 2px solid var(--accent); border-radius: 6px; pointer-events: none; animation: ring 0.25s ease-out; }
@keyframes ring { from { transform: scale(1.4); } to { transform: scale(1); } }

/* Компьютер: колонку элементов держим узкой, как на телефоне. */
@media (min-width: 700px) {
  .controls { padding-left: 24px; padding-right: 24px; }
  .bottom { max-width: 480px; }
}
