/* Компоненты Тортуги: сохранён порядок прежних слоёв, чтобы не менять раскладку.
   Палитра и декоративные эффекты — tortuga-harbor.css; основа — layout.css. */

/* upgrade.css — совместимые правила компонента */
:root { color-scheme: dark; --caption-size: 100%; --caption-background: transparent; --caption-shadow: 0 2px 3px #000, 0 0 4px #000; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid #f47571; outline-offset: 3px; }
header { max-width: 1600px; align-items: center; margin-bottom: 18px; }
.header-actions { flex-wrap: wrap; justify-content: flex-end; }
.badge { opacity: 1; color: #becbd1; }
.badge.host { color: #e5c5c5; }
.login-box { width: min(370px, calc(100vw - 32px)); }
.login-box h2 { color: #e9e5de; }
.login-box p { line-height: 1.5; }
#loginError { margin: 12px 0 0; color: #ffbcb5; }
.connection-status { display: flex; align-items: center; gap: 7px; font-size: .77rem; color: #c0bcae; }
.connection-status::before { content: ''; width: 7px; height: 7px; border-radius: 100%; background: #c6a463; }
.connection-status[data-state=connected]::before { background: #71c6a1; box-shadow: 0 0 8px #71c6a133; }
.connection-status[data-state=offline]::before { background: #ed706b; }
.view-controls { width: 100%; max-width: 1600px; display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.view-controls button, .drawer-close, .library-list button, .queue-action, .history-item button, #pinForm button, #enableVoiceAudio { background: #242f36; border: 1px solid #3a474f; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.view-caption { flex: 1; color: #81939d; font-size: .75rem; letter-spacing: .04em; }
#unreadBadge { background: #b62631; border-radius: 15px; padding: 1px 6px; }
.layout { max-width: 1600px; gap: 16px; }
.rooms-column { width: 300px; max-height: calc(100dvh - 146px); height: auto; min-height: 300px; }
.room-sidebar { padding: 14px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.room-sidebar-title { margin: 0; }
.sidebar-room-list { margin-top: 14px; max-height: min(360px, 45dvh); gap: 8px; overflow: auto; }
.room-choice { min-width: 0; }
.room-choice .room-copy { min-width: 0; flex: 1; }
.room-choice strong, .room-choice .room-film { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-choice .room-icon { width: 30px; height: 34px; display: grid; place-items: center; flex-shrink: 0; border-radius: 7px; color: #d2c2ad; background: #ffffff07; font-size: 1.2rem; }
.room-choice .room-meta { color: #acb9c1; font-size: .69rem; }
.room-choice .room-film { color: #90a09a; font-size: .7rem; margin-top: 4px; }
.room-choice.active .room-icon { background: #ab253426; color: #f59390; }
.workspace-label { color: #73848f; text-transform: uppercase; font-size: .66rem; letter-spacing: .12em; margin: 26px 0 10px; }
.host-tabs { display: flex; padding: 3px; background: #060b0e; border-radius: 8px; }
.host-tabs button { flex: 1; font-size: .73rem; border: 0; border-radius: 6px; padding: 9px 3px; background: transparent; color: #8e9ca5; cursor: pointer; }
.host-tabs [aria-selected=true] { background: #2a343c; color: #f5f1ec; }
.host-pane h3 { font-size: .78rem; color: #bfc8ce; margin: 16px 0 10px; font-weight: 500; }
.room-form { margin-top: 12px; padding-top: 12px; }
.room-form > label { display: block; font-size: .75rem; color: #aebac1; }
.room-form input, .room-form select, .room-form textarea { margin-top: 5px; width: 100%; min-width: 0; }
.room-form input[type=checkbox] { width: 15px; margin: 0; accent-color: #bf3942; }
.room-icon-picker { margin: 10px 0; border: 1px solid #334149; border-radius: 9px; background: #0d151a; }
.room-icon-picker summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 8px; min-height: 44px; cursor: pointer; font-size: .75rem; }
.room-icon-picker summary::-webkit-details-marker { display: none; }
.room-icon-picker summary > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.room-icon-preview { font-size: 1.4rem; width: 32px; flex-shrink: 0; text-align: center; }
.room-icon-hint { margin-left: auto; flex-shrink: 0; color: #97a7b0; font-size: .65rem; }
.room-form .room-icon-picker > input { width: calc(100% - 16px); margin: 0 8px 8px; padding: 9px; font-size: .75rem; }
.room-icon-catalogue { padding: 0 8px 8px; max-height: 290px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.room-icon-catalogue h4 { color: #92a3ad; font-size: .67rem; font-weight: 500; margin: 12px 0 7px; }
.room-icon-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.room-sidebar .room-icon-option { width: 100%; min-height: 44px; margin: 0; padding: 3px 0; border: 1px solid transparent; border-radius: 7px; background: #ffffff04; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif; font-size: 1.3rem; line-height: 1.3; cursor: pointer; }
.room-sidebar .room-icon-option:hover { background: #ffffff10; border-color: #566872; }
.room-sidebar .room-icon-option[aria-pressed=true] { background: #9e303037; border-color: #dc6368; }
.room-icon-catalogue .empty-hint { margin: 0; }
.room-toggles { flex-wrap: wrap; }
select, textarea { color: #e9eef1; background: #0d151a; border: 1px solid #334149; padding: 8px; border-radius: 7px; }
.button-pair { display: flex; gap: 7px; }
.room-sidebar .button-pair button { width: auto; flex: 1; }
.library-list { max-height: 250px; overflow: auto; }
.library-item, .history-item { padding: 9px 0; border-bottom: 1px solid #ffffff0a; font-size: .76rem; overflow-wrap: anywhere; }
.library-item > div:last-child { display: flex; gap: 5px; margin-top: 7px; }
.library-item button, .history-item button { padding: 5px 8px; font-size: .72rem; }
.history-item small { display: block; color: #87969d; margin: 5px 0; }
.empty-hint { font-size: .8rem; color: #8999a2; line-height: 1.5; padding: 14px 0; }
.person { display: flex; justify-content: space-between; gap: 8px; padding: 11px 0; border-bottom: 1px solid #ffffff0a; font-size: .8rem; }
.person span:first-child { overflow-wrap: anywhere; min-width: 0; }
.person small { color: #8d9d9f; }
.rooms-collapsed .rooms-column { width: 66px; min-height: 0; }
.rooms-collapsed .room-sidebar { padding: 10px; }
.rooms-collapsed .room-sidebar-title, .rooms-collapsed .room-copy, .rooms-collapsed #hostWorkspace { display: none; }
.rooms-collapsed .room-choice { padding: 4px; justify-content: center; }
.rooms-collapsed .sidebar-room-list { max-height: none; margin-top: 0; }
.chat-collapsed .sidebar { display: none; }
.main-column { min-width: 280px; }
.player-container { aspect-ratio: 16/9; justify-content: center; }
#mediaContainer { height: 100%; width: 100%; }
#mediaContainer > .plyr, #mediaContainer > video { width: 100%; height: 100%; }
.empty-video { width: 100%; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; background: radial-gradient(ellipse at 50% 70%, #53312b33, transparent 64%), linear-gradient(145deg, #172229, #090e12); }
.empty-video .empty-symbol { color: #a96760; font-size: 44px; margin-bottom: 12px; }
.empty-video h2 { font-size: clamp(1rem, 1.4vw, 1.5rem); font-weight: 500; color: #e1dfd9; }
.empty-video p { color: #83929a; font-size: .8rem; max-width: 310px; line-height: 1.6; margin: 10px 0 17px; }
.empty-video button { padding: 9px 14px; background: #343d42; border: 1px solid #566067; color: #eee; border-radius: 7px; cursor: pointer; }
.media-status { position: absolute; top: 14px; left: 14px; right: 14px; background: #10191ce6; border: 1px solid #657178; border-radius: 6px; padding: 10px; font-size: .78rem; pointer-events: none; z-index: 11; }
.resume-playback { position: absolute; z-index: 12; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 12px 20px; border: 1px solid #d17975; border-radius: 10px; background: #8c2531; cursor: pointer; }
.film-heading { min-width: 0; flex: 1; }
.film-heading small { font-size: .64rem; color: #8d9da6; text-transform: uppercase; letter-spacing: .09em; }
#currentTitle { margin: 5px 0; font-size: 1rem; overflow-wrap: anywhere; }
#syncStatus { color: #82938f; }
.queue-heading { display: flex; justify-content: space-between; color: #8a9ba4; font-size: .8rem; }
.queue-heading h3 { margin-bottom: 14px; }
.playlist li { gap: 8px; font-size: .8rem; }
.queue-title { background: transparent; border: 0; color: inherit; text-align: left; cursor: pointer; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.queue-actions { display: flex; gap: 3px; flex-shrink: 0; }
.queue-action { font-size: .7rem; padding: 5px; min-width: 26px; }
.reaction-bar { padding: 8px; }
.reaction-bar button { border: 0; padding: 5px 11px; border-radius: 20px; background: transparent; cursor: pointer; font-size: 1rem; }
.reaction-bar button:hover { background: #ffffff0c; }
.floating-emoji { font-size: 1.5rem; animation: quietFloat 2s ease-out forwards; }
@keyframes quietFloat { to { transform: translateY(-100px); opacity: 0; } }
.subtitle-settings { display: flex; flex-wrap: wrap; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #ffffff10; }
.subtitle-settings label { font-size: .75rem; color: #9daeb7; }
.subtitle-settings select { display: block; max-width: 240px; margin-top: 5px; }
.subtitle-settings p { width: 100%; color: #81959e; font-size: .72rem; }
video::cue { font-size: var(--caption-size); background: var(--caption-background); text-shadow: var(--caption-shadow); color: #fff; }
.plyr__captions { font-size: var(--caption-size); }
.plyr__caption { background: var(--caption-background); text-shadow: var(--caption-shadow); }
.sidebar { width: 310px; height: calc(100dvh - 146px); min-height: 450px; overflow: hidden; }
.sidebar-header { font-size: .73rem; }
.voice-controls { padding: 13px; background: #141d22; }
.voice-heading { display: flex; justify-content: space-between; font-size: .72rem; color: #b2c1c9; }
.voice-heading small { color: #738b81; }
.btn-join { font-size: .8rem; padding: 10px; }
#voiceStatus { font-size: .72rem; color: #ccaaa0; line-height: 1.4; }
.voice-participants:empty { display: none; }
.participant-row { background: #1c2b31; border-color: #627e70; }
.participant-row.speaking { border-color: #8bdbac; background: #254137; }
.participant-row button { flex: 0 0 30px; }
.pinned-section { background: #25272166; padding: 0 13px; }
#pinnedMessage { font-size: .78rem; border-left: 2px solid #b49e65; margin: 12px 0; padding-left: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
#pinForm { font-size: .72rem; color: #929f9c; margin: 10px 0; }
#pinForm textarea { width: 100%; margin: 9px 0; min-height: 66px; resize: vertical; }
.chat-messages { min-height: 0; gap: 12px; }
.msg { width: 100%; max-width: 100%; font-size: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; white-space: normal; }
.msg-head strong { font-weight: 600; color: #c4d0d5; }
.msg-head time { color: #73858e; font-size: .63rem; flex-shrink: 0; }
.chat-input { padding: 10px; background: #141d22; }
.chat-input input { min-width: 0; }
.chat-disabled { padding: 30px 15px; color: #87979e; text-align: center; font-size: .85rem; }
.new-messages { background: #385951; border: 0; padding: 8px; font-size: .75rem; cursor: pointer; }
.notice { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 1500; max-width: min(650px, calc(100vw - 30px)); padding: 12px 20px; background: #30443f; border: 1px solid #77978b; border-radius: 9px; box-shadow: 0 8px 50px #0008; font-size: .85rem; }
.notice.error { background: #472b2c; border-color: #9f6464; }
.confirmation-dialog { position: fixed; inset: 0; margin: auto; width: min(420px, calc(100vw - 32px)); padding: 24px; border: 1px solid #99444c; border-radius: 14px; color: #e8edf0; background: #192126; box-shadow: 0 24px 80px #0009; }
.confirmation-dialog::backdrop { background: #000b; backdrop-filter: blur(4px); }
.confirmation-dialog h2 { font-size: 1.15rem; margin-bottom: 12px; }
.confirmation-dialog p { color: #b8c4ca; line-height: 1.5; }
.drawer-close, .drawer-backdrop { display: none; }
@media(min-width: 1001px) and (max-width: 1250px) { .rooms-column { width: 265px; } .sidebar { width: 270px; } body { padding: 14px; } .layout { gap: 12px; } }
@media(max-width: 1000px) {
  body { padding: 14px 12px; }
  header { align-items: flex-start; gap: 8px; }
  .header-actions { gap: 5px; flex-direction: column; align-items: flex-end; }
  .badge { font-size: .65rem; padding: 4px 7px; }
  .brand-tagline { font-size: .65rem; }
  .connection-status { font-size: .67rem; }
  .view-caption { font-size: .65rem; }
  .main-column { width: 100%; min-width: 0; }
  .layout { display: block !important; z-index: auto; }
  .rooms-column, .rooms-collapsed .rooms-column, .sidebar, .chat-collapsed .sidebar { position: fixed; top: 0; bottom: 0; z-index: 100; height: 100dvh; max-height: 100dvh; border-radius: 0; width: min(360px, 91vw); display: none; }
  .rooms-column { left: 0; }
  .sidebar { right: 0; }
  .rooms-open .rooms-column { display: block; }
  .chat-open .sidebar, .chat-open.chat-collapsed .sidebar { display: flex; }
  .drawer-close { display: inline-block; font-size: 1.3rem; border: 0; padding: 5px 10px; }
  .drawer-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 90; border: 0; background: #000a; }
  .rooms-collapsed .room-copy, .rooms-collapsed .room-sidebar-title, .rooms-collapsed #hostWorkspace:not([hidden]) { display: block; }
  .rooms-collapsed .room-choice { justify-content: flex-start; padding: 9px 10px; }
  .rooms-collapsed .sidebar-room-list { max-height: 40dvh; margin-top: 14px; }
  .room-sidebar { padding: 18px; }
  .view-controls button { min-height: 42px; }
  .info-panel, .playlist { padding: 14px; }
  .empty-video { min-height: 190px; padding: 14px; }
  .empty-video .empty-symbol { font-size: 30px; margin-bottom: 6px; }
  .empty-video p { margin: 8px 0; font-size: .72rem; }
  .player-container { min-height: 190px; }
  .plyr__controls { padding-left: 6px !important; padding-right: 6px !important; }
  .btn-icon, .chat-input button { min-width: 44px; min-height: 44px; }
}
@media(prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* theme.css — совместимые правила компонента */
/* Тортуга 2.2. Фон берется из public/back.png — замените PNG без правок кода. */
:root {
  --navy: #0b1522; --panel: rgba(12, 24, 38, .94); --line: #29384b;
  --bronze: #d4ad73; --text: #e8edf5; --muted: #a4b3c5; --plyr-color-main: #a97a3e;
  --rooms-width: 240px; --chat-width: 320px;
}
body {
  color: var(--text); padding: 24px 28px;
  background: linear-gradient(rgba(5, 12, 24, .38), rgba(5, 12, 24, .62)), url('/back.png') center / cover fixed no-repeat;
  background-color: #091322;
}
button, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button, summary { touch-action: manipulation; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, [role=separator]:focus-visible { outline: 2px solid var(--bronze); outline-offset: 3px; }
button { transition: background .15s, border-color .15s; }
header, .view-controls, .layout { max-width: 1800px; }
header { margin-bottom: 24px; }
h1 { color: #f4e8d3; text-shadow: 0 3px 20px #0008; }
.brand-tagline { color: #bdc6d1; font-size: 13px; }
h1 .title-accent { color: var(--bronze); }
.badge { border: 1px solid var(--line); background: #0b1726dd; color: #c2cede; font-size: 13px; }
.badge.host { color: #eed0a0; border-color: #655035; background: #2b241bdd; }
.connection-status { color: #c4d2df; font-size: 13px; }
.view-controls { margin-bottom: 16px; gap: 10px; }
.view-controls button { background: #102036e8; border-color: #35465c; min-height: 42px; font-size: 14px; }
.view-controls button:hover, .view-controls button[aria-pressed=true] { background: #26364a; border-color: var(--bronze); }
.view-caption { font-size: 13px; color: #c0cbd9; }
.layout { gap: 0; }
.rooms-column { width: var(--rooms-width); flex-shrink: 0; border: 1px solid var(--line); border-radius: 14px; max-height: calc(100dvh - 172px); background: var(--panel); overflow: hidden; }
.room-sidebar { padding: 18px 12px; background: transparent; border: 0; display: flex; flex-direction: column; max-height: inherit; }
.room-sidebar-title { color: #c1cbda; font-size: 13px; margin: 0; }
.sidebar-room-list { max-height: calc(100dvh - 302px); grid-auto-rows: max-content; overflow-y: auto; margin-top: 18px; padding: 0 2px 4px; gap: 8px; }
.room-sidebar .room-choice { min-height: 114px; padding: 14px 10px; background: #111f30; border: 1px solid #26374b; box-shadow: none; }
.room-sidebar .room-choice:hover { background: #172a3f; border-color: #516479; }
.room-sidebar .room-choice.active { background: #202b36; border-color: #94774e; box-shadow: inset 3px 0 0 var(--bronze); }
.room-choice .room-icon { font-size: 24px; width: 34px; background: transparent; }
.room-choice strong { font-size: 15px; color: #ecedf1; font-weight: 600; }
.room-sidebar .room-choice small, .room-choice .room-film { font-size: 12px; color: #a5b5c8; line-height: 1.6; }
.room-choice .room-film { color: #c0c9d2; margin: 4px 0; }
.room-choice.active .room-icon { color: var(--bronze); background: #b794521a; }
.create-room-shortcut { background: transparent; border: 1px dashed #536076; color: #dac4a3; padding: 12px 8px; border-radius: 8px; width: 100%; margin-top: 16px; font-size: 14px; cursor: pointer; }
.create-room-shortcut:hover { border-color: var(--bronze); background: #b7945210; }
.main-column { background: var(--panel); border-color: var(--line); min-width: 320px; box-shadow: 0 18px 50px #0005; backdrop-filter: none; }
.resize-handle { flex: 0 0 16px; align-self: stretch; min-height: 220px; cursor: col-resize; position: relative; touch-action: none; border-radius: 8px; }
.resize-handle::after { content: ''; position: absolute; top: 42%; left: 7px; height: 44px; width: 2px; background: #95a5b666; border-radius: 2px; }
.resize-handle:hover::after, .resize-handle:focus-visible::after { background: var(--bronze); }
.resizing { cursor: col-resize; user-select: none; }
.host-quick-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: #101e30; }
.quick-label { color: #c3aa85; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-right: auto; }
.host-quick-bar button { background: #1c2c40; border: 1px solid #35475d; border-radius: 7px; padding: 9px 11px; font-size: 14px; cursor: pointer; }
.host-quick-bar button:hover { background: #2c3b4e; border-color: #8e785a; }
.host-quick-bar #openFilmBtn { background: #d4ad73; color: #191b20; border-color: #d4ad73; font-weight: 600; }
.player-container { border-radius: 0; background: #030810; --plyr-color-main: #b4915f; }
.plyr__control:hover { background: #b4915f44 !important; }
.empty-video { background: radial-gradient(ellipse at 50% 65%, #31517944, transparent 65%), #091321; min-height: 240px; }
.empty-video .empty-symbol { color: var(--bronze); }
.empty-video h2 { color: #f0e4d2; font-size: clamp(18px, 1.5vw, 26px); }
.empty-video p { font-size: 14px; color: #afbdcc; }
.empty-video button { color: #edd4af; background: #273344; border-color: #79654b; min-height: 42px; font-size: 14px; }
.reaction-bar { background: #0c1827; border-color: var(--line); padding: 8px; }
.reaction-bar button { min-width: 44px; min-height: 40px; }
.info-panel { background: #102035; padding: 20px; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.film-heading small { font-size: 12px; color: var(--bronze); }
#currentTitle { font-size: 17px; line-height: 1.5; color: #ecf0f6; }
.info-panel #syncStatus { font-size: 12px !important; color: #a7b9cb; text-transform: none; }
.subtitle-toggle, #qualitySelect { min-height: 40px; font-size: 13px; background: #1b2c41; border-color: #3b4d63; }
.playlist { padding: 20px; background: #0c1828; }
.queue-heading h3 { color: #b4c4d7; font-size: 13px; }
.playlist li { background: #13243a; border-color: #293d56; font-size: 14px; padding: 12px; }
.playlist li.active { border-color: #a58b61; background: #242d37; }
.queue-actions button { min-width: 32px; min-height: 36px; color: #cbd4df; background: #203247; }
.empty-hint { font-size: 14px; color: #a0b1c5; }
.sidebar { width: var(--chat-width); height: calc(100dvh - 172px); min-height: 480px; background: var(--panel); border-color: var(--line); backdrop-filter: none; }
.sidebar-header { background: #132237; border-color: var(--line); font-size: 13px; letter-spacing: .03em; padding: 12px 16px; min-height: 58px; }
.chat-heading-actions { display: flex; align-items: center; gap: 5px; }
#clearChatBtn { background: transparent; color: #c6b391; border: 1px solid #485165; border-radius: 6px; padding: 8px; min-height: 34px; font-size: 12px; text-transform: none; cursor: pointer; }
.voice-controls { background: #0e1c2d; border-color: var(--line); padding: 16px; }
.voice-heading { color: #b7c5d5; font-size: 13px; }
.voice-heading small { font-size: 12px; color: #94aabd; }
.btn-join { background: #1b2c40; color: #decdaf; border-color: #3a4c62; font-size: 14px; }
.participant-row { background: #1c3045; border-color: #476176; }
.pinned-section { background: #a6844020; flex-shrink: 0; }
#pinnedMessage { font-size: 14px; line-height: 1.6; max-height: 150px; overflow: auto; border-color: var(--bronze); color: #e9d6b7; }
#pinForm { font-size: 13px; color: #cab896; }
#pinForm details[open] { max-height: 210px; overflow-y: auto; }
#pinForm button { font-size: 14px; }
.chat-messages { padding: 16px 14px; gap: 14px; background: transparent; overscroll-behavior: contain; }
.msg { position: relative; padding: 0 0 0 10px; background: transparent; border: 0; border-radius: 0; box-shadow: none; font-size: 14px; line-height: 1.65; }
.msg.viewer { border-left: 2px solid #334b66; }
.msg.admin { border-left: 2px solid var(--bronze); background: transparent; }
.msg-head { gap: 6px; padding-right: 26px; margin-bottom: 3px; }
.viewer-mode .msg-head { padding-right: 0; }
.msg-head strong { color: #cbd9e7; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.msg.admin .msg-head strong { color: #e6c695; }
.msg-head time { font-size: 12px; color: #8d9eb2; }
.message-menu { white-space: normal; }
.message-menu summary { list-style: none; position: absolute; right: -5px; top: -5px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; color: #b7c5d7; border-radius: 6px; font-size: 22px; }
.message-menu summary::-webkit-details-marker { display: none; }
.message-menu summary:hover, .message-menu[open] summary { background: #29384b; }
.message-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.message-actions button { cursor: pointer; padding: 8px 10px; min-height: 38px; font-size: 13px; border: 1px solid #415269; border-radius: 6px; background: #203044; color: #e0d2b8; }
.message-actions .danger-text { color: #ffb7b7; border-color: #6c4148; background: #3b242d; }
.chat-input { background: #112035; padding: 12px; border-color: var(--line); }
.chat-input input { background: #091626; border-color: #354a65; font-size: 14px; padding: 12px 10px; }
.chat-input input::placeholder { color: #9aaabe; }
.chat-input button { color: #161c26; background: var(--bronze); border-color: var(--bronze); min-width: 44px; }
.chat-readonly { color: #dec6a1; background: #9c7d361c; font-size: 13px; padding: 12px 16px; line-height: 1.6; }
.chat-empty { padding: 26px 20px 0; color: #a1b3c7; text-align: center; font-size: 14px; line-height: 1.7; }
.host-dialog { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(480px, 100vw); height: 100dvh; max-height: 100dvh; max-width: 100vw; border: 0; border-left: 1px solid #596071; padding: 24px; background: #0e1b2d; color: var(--text); overflow-y: auto; box-shadow: -30px 0 90px #0008; }
.host-dialog::backdrop { background: #02071199; backdrop-filter: blur(3px); }
.host-dialog-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.host-dialog-heading small { display: block; color: var(--bronze); font-size: 13px; max-width: 340px; overflow-wrap: anywhere; }
.host-dialog h2 { font-size: 24px; font-weight: 500; margin-top: 4px; }
#closeHostDialogBtn { background: #1c2d43; border: 1px solid #3c4c61; width: 44px; height: 44px; font-size: 26px; border-radius: 8px; cursor: pointer; flex-shrink: 0; }
.host-dialog .workspace-label { display: none; }
.host-dialog #hostWorkspace:not([hidden]) { display: block; }
.host-tabs { background: #091422; padding: 4px; gap: 4px; }
.host-tabs button { font-size: 14px; padding: 12px 5px; color: #aebcd0; }
.host-tabs [aria-selected=true] { background: #2c3541; color: #eed2a9; }
.host-pane h3 { font-size: 16px; color: #d9e1ec; margin-bottom: 14px; }
.room-form { margin-top: 20px; padding-top: 8px; }
.room-form > label { font-size: 14px; color: #b4c4d8; }
.room-form input:not([type=checkbox]):not([type=hidden]), .room-form textarea, #pinText { background: #091624; border: 1px solid #3d516b; border-radius: 7px; color: var(--text); padding: 12px; font-size: 16px; }
.room-form .room-submit { background: #b4915f; border-color: #b4915f; color: #111b28; min-height: 44px; font-size: 14px; }
.room-form .room-submit:hover { background: #d4ad73; }
.room-form .button-pair { margin-top: 10px; }
.room-form > .room-submit { margin-top: 12px; }
.room-toggles { margin-top: 18px; gap: 24px; font-size: 14px; }
.room-form input[type=checkbox] { accent-color: #b4915f; }
.room-form .check-label, .check-label { display: flex; gap: 10px; align-items: center; font-size: 14px; margin: 16px 0; color: #c4d0df; }
.check-label input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: #b4915f; flex-shrink: 0; }
.room-icon-picker { background: #0b1828; border-color: #3d4c63; }
.room-icon-picker summary { font-size: 14px; padding: 12px; }
.room-icon-hint, .room-icon-catalogue h4 { font-size: 12px; }
.room-icon-grid .room-icon-option { min-height: 48px; border: 1px solid transparent; background: #ffffff05; border-radius: 7px; font-size: 26px; cursor: pointer; }
.room-icon-grid .room-icon-option[aria-pressed=true] { background: #b4915f33; border-color: var(--bronze); }
.room-icon-grid .room-icon-option:hover { border-color: #7c8999; }
.library-list { max-height: 330px; }
.library-item, .history-item, .person { font-size: 14px; }
.library-item > div:last-child { flex-wrap: wrap; }
.library-item button, .history-item button { font-size: 13px; padding: 10px; min-height: 40px; background: #1b2d44; border-color: #405471; }
.person { padding: 16px 0; }
.person small { color: #a6bacd; font-size: 13px; }
.room-delete { min-height: 42px; font-size: 14px; margin-top: 28px; }
.confirmation-dialog { background: #112035; border-color: #976665; }
.confirmation-dialog p { overflow-wrap: anywhere; }
.confirmation-dialog button { min-height: 42px; font-size: 14px; }
.notice { background: #193947; color: #e3f0f2; border-color: #65838d; }
.notice.error { background: #422731; border-color: #986571; }
#nicknameOverlay { background: rgba(5, 12, 23, .68); backdrop-filter: blur(6px); }
.login-box { background: #0d1b2eee; border-color: #6b5d48; padding: 36px; border-radius: 16px; width: min(400px, calc(100vw - 32px)); }
.login-box h2 { color: #efdabc; font-size: 24px; }
.login-box p { color: #afbed2; font-size: 14px; }
.login-box input { font-size: 16px; background: #091422; border-color: #3e5068; }
.login-box button { background: var(--bronze); color: #142033; border-color: var(--bronze); }
.rooms-collapsed .rooms-column { width: 72px; }
.rooms-collapsed .room-sidebar { padding: 14px 8px; }
.rooms-collapsed .room-sidebar .room-choice { min-height: 52px; padding: 8px; justify-content: center; }
.rooms-collapsed .create-room-shortcut { display: none; }
.rooms-collapsed .resize-handle[data-panel=rooms] { visibility: hidden; }
.chat-collapsed .resize-handle[data-panel=chat] { display: none; }
.cinema-mode .rooms-column, .cinema-mode .resize-handle, .cinema-mode .sidebar { display: none; }
.cinema-mode .host-quick-bar { display: none; }
@media(min-width: 1001px) and (max-width: 1200px) {
  body { padding: 16px; }
  .quick-label { display: none; } .host-quick-bar { padding: 10px; gap: 6px; } .host-quick-bar button { font-size: 13px; padding: 8px; }
}
@media(max-width: 1000px) {
  body { padding: 18px 12px; background-attachment: scroll; }
  header { margin-bottom: 20px; } h1 { font-size: 32px; }
  .brand-tagline { font-size: 12px; max-width: 180px; } .badge, .connection-status { font-size: 12px; }
  .view-controls { gap: 6px; } .view-controls button { font-size: 13px; padding: 8px; } .view-caption { display: none; }
  #cinemaModeBtn { margin-left: auto; }
  .main-column { min-width: 0; } .resize-handle { display: none; }
  .rooms-column, .rooms-collapsed .rooms-column, .sidebar, .chat-collapsed .sidebar { width: min(380px, 94vw); height: 100dvh; max-height: 100dvh; background: #0c192b; }
  .room-sidebar, .rooms-collapsed .room-sidebar { padding: 24px 16px; }
  .sidebar-room-list, .rooms-collapsed .sidebar-room-list { max-height: calc(100dvh - 190px); margin-top: 20px; }
  .rooms-collapsed .room-sidebar .room-choice { min-height: 112px; padding: 14px 10px; justify-content: flex-start; }
  .rooms-collapsed .create-room-shortcut:not([hidden]) { display: block; }
  .host-quick-bar { padding: 10px; gap: 6px; } .quick-label { display: none; }
  .host-quick-bar button { flex: 1; font-size: 13px; padding: 10px 6px; min-height: 44px; }
  .host-dialog { padding: 24px 18px; } .host-dialog-heading small { max-width: 260px; }
  .info-panel, .playlist { padding: 16px; } .empty-video { min-height: 210px; }
  .subtitle-settings label { font-size: 14px; } .subtitle-settings select { font-size: 16px; }
  .message-menu summary { min-width: 44px; min-height: 44px; top: -10px; }
  .msg-head { padding-right: 34px; } .message-actions button { min-height: 44px; }
  .chat-input input { font-size: 16px; } .sidebar-header { min-height: 64px; }
  .cinema-mode .rooms-column, .cinema-mode .sidebar { display: none; }
}
@media(prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.player-diagnostics { margin: 12px 0; padding: 14px 16px; border: 1px solid rgba(187,155,105,.22); border-radius: 12px; background: rgba(9,17,25,.86); color: #d4dde4; }
.player-diagnostics summary { cursor: pointer; font-weight: 600; min-height: 28px; }
.player-diagnostics p { margin: 12px 0; line-height: 1.55; }
.diagnostics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.diagnostics-grid dt { color: #9faeb9; font-size: .78rem; margin-bottom: 4px; }
.diagnostics-grid dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.diagnostics-wide { grid-column: 1 / -1; }
.diagnostics-note, #qualityHint { font-size: .8rem; color: #afbbc4; }
#retryPlaybackBtn { padding: 10px 14px; border: 1px solid #716047; border-radius: 8px; background: #26323d; color: #f0e6d7; cursor: pointer; }
#retryPlaybackBtn:disabled { opacity: .5; cursor: default; }
.build-warning { margin: 8px 20px; padding: 12px; border: 1px solid #b18346; border-radius: 8px; color: #ffe2b4; background: #30281f; overflow-wrap: anywhere; }
@media (max-width: 480px) { .diagnostics-grid { grid-template-columns: minmax(0, 1fr); } }
.screen-tools, .screen-section { margin: 12px 0; padding: 14px; border-radius: 12px; background: rgba(12,24,38,.94); border: 1px solid #29384b; }
.screen-options { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.screen-tools summary { cursor: pointer; font-size: .88rem; font-weight: 600; }
.screen-tools[open] summary { margin-bottom: 14px; }
.screen-options label { display: grid; gap: 5px; font-size: .8rem; min-width: 0; flex: 1 1 190px; }
.screen-options select { min-width: 0; max-width: 100%; padding: 8px; color: #e8edf5; background: #152438; border: 1px solid #455264; border-radius: 6px; }
.screen-tools p, #screenStatus { font-size: .8rem; line-height: 1.5; color: #a4b3c5; margin-top: 10px; }
.screen-tools button, .screen-section button { padding: 10px 14px; border: 1px solid #716047; border-radius: 8px; background: #26323d; color: #f0e6d7; cursor: pointer; }
.screen-section h2 { margin: 0 0 10px; font-size: 1rem; }
#screenVideo { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; object-fit: contain; border-radius: 8px; }

/* polish.css — совместимые правила компонента */
/* Отдельный слой оформления. back.png остаётся единственным пользовательским
   фоном; готовые картинки и внешние шрифты для этого экрана не нужны. */
:root { --bronze: #d9b887; --plyr-color-main: #d9b887; --line: #34424b; --panel: rgba(15,25,32,.96); }
body { background-color: #0a131a; color: #edece7; }
body.awaiting-entry { overflow: hidden; }
/* Пока человек представляется, элементы зала не должны попадать в Tab-порядок.
   !important перекрывает старую мобильную раскладку основного контейнера. */
.awaiting-entry > header, .awaiting-entry > .view-controls,
.awaiting-entry > #appContent { display: none !important; }
#nicknameOverlay {
  height: 100dvh; padding: 32px; overflow: auto; align-items: safe center;
  background: linear-gradient(110deg, rgba(5,14,20,.76), rgba(8,17,23,.35)), url('/back.png') center / cover no-repeat;
  backdrop-filter: none;
}
.entry-layout { width: min(1020px, 100%); margin: auto; }
.entry-brand { display: flex; align-items: center; gap: 14px; color: #f0dfc2; margin: 0 0 32px 8px; }
.entry-brand > svg { width: 42px; height: 42px; stroke: #d9b887; stroke-width: 1.2; flex-shrink: 0; }
.entry-brand > span { font: 30px Georgia, 'Times New Roman', serif; letter-spacing: .02em; }
.entry-brand small { display: block; font: 10px 'Segoe UI', sans-serif; letter-spacing: .24em; color: #bec6c5; margin-top: 7px; }
.login-box { display: grid; grid-template-columns: 1.15fr 1fr; width: 100%; text-align: left; padding: 48px; gap: 48px; border: 1px solid #dfbc8040; border-radius: 22px; background: linear-gradient(120deg, rgba(14,27,34,.96), rgba(17,27,34,.9)); box-shadow: 0 28px 100px #0007, inset 0 1px 0 #ffffff09; }
.entry-kicker, .entry-form-caption { display: block; font-size: 10px; font-weight: 600; letter-spacing: .2em; color: #c5ae8d; }
.login-box h2 { color: #f2ece0; font: 48px/1.12 Georgia, 'Times New Roman', serif; letter-spacing: -.035em; margin: 23px 0 22px; }
.login-box h2 em { color: #dfbd86; font-weight: normal; }
.login-box p { font-size: 15px; line-height: 1.8; color: #b5c1c5; margin: 0; }
.entry-ornament { display: flex; align-items: center; gap: 12px; color: #c7a978; width: 92px; margin-top: 28px; font-size: 13px; }
.entry-ornament span { flex: 1; height: 1px; background: #b89b684d; }
.entry-form { align-self: center; border-left: 1px solid #c5a57529; padding-left: 48px; min-width: 0; }
.entry-form-caption { color: #94a6ae; margin-bottom: 30px; font-size: 9px; }
.entry-form label { display: block; color: #e4e7e5; font-size: 16px; margin-bottom: 12px; }
.login-box input { height: 54px; font-size: 16px; padding: 0 16px; border-radius: 9px; border: 1px solid #51616a; background: #08141bcc; margin: 0; color: #f5eee3; }
.login-box input::placeholder { color: #84969f; }
.login-box input:focus { border-color: #d9b887; box-shadow: 0 0 0 3px #d9b88718; }
.login-box #nicknameHint { margin: 9px 0 24px; font-size: 12px; color: #a3b0b5; }
.login-box button { height: 52px; display: flex; justify-content: space-between; align-items: center; padding: 0 18px; color: #15232a; background: #ddbd8c; border: 1px solid #e7cda3; border-radius: 9px; font-size: 15px; font-weight: 650; box-shadow: 0 6px 18px #0003; }
.login-box button:hover { background: #ead0a6; }
.login-box button svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.6; }
.login-box .entry-note { font-size: 12px; margin: 22px 0 0; color: #b3b9b6; }
.login-box #loginError { color: #ffc2b4; font-size: 13px; margin-top: 14px; overflow-wrap: anywhere; }
.login-box #loginError:empty { display: none; }
.entry-footer { color: #d3d4cb; font-size: 10px; letter-spacing: .16em; text-align: center; padding: 28px 8px 0; line-height: 1.7; text-shadow: 0 2px 6px #000; }
/* Полировка зала: привычные места панелей сохранены. Ни анимаций фона,
   ни тяжёлого blur поверх проигрываемого фильма здесь нет. */
header { margin-bottom: 20px; }
.brand-tagline { font-family: 'Segoe UI', sans-serif; font-style: normal; transform: none; letter-spacing: .03em; color: #b7c4c6; }
.view-controls { padding: 8px; border: 1px solid #9caeaf29; background: #101d26e8; border-radius: 12px; }
.view-controls button { border-radius: 8px; background: #1c2b34; border-color: transparent; }
.view-controls button:hover, .view-controls button[aria-pressed=true] { background: #34434a; border-color: #9d855e; }
.view-caption { color: #bec7c7; padding-left: 8px; }
.rooms-column, .sidebar, .main-column { border-color: #8d9e9e32; box-shadow: 0 16px 42px #0003; }
.room-sidebar-title, .sidebar-header { color: #d4d8d2; }
.room-sidebar .room-choice { border-radius: 10px; background: #172630; border-color: #778d9826; }
.room-sidebar .room-choice.active { background: #32372f; border-color: #a98c5e; }
.room-sidebar .room-choice:hover { background: #23353e; border-color: #82908c; }
.room-sidebar .room-choice.active:hover { background: #3b4037; }
.host-quick-bar, .sidebar-header { background: #1a2b35; }
.host-quick-bar button { background: #263943; border-color: #52636a; }
.host-quick-bar #openFilmBtn { background: var(--bronze); border-color: var(--bronze); }
.info-panel { background: #182b35; }
.playlist, .reaction-bar, .voice-controls { background: #11212b; }
.playlist li { background: #1c303c; border-color: #41555f; border-radius: 9px; }
.playlist li.active { background: #303a37; border-color: #ac9267; }
.chat-input { background: #1a2b35; }
.chat-input input { background: #101f28; border-color: #50616a; border-radius: 9px; }
.chat-input button { border-radius: 9px; }
.chat-empty { color: #b0c0c5; }
.msg { line-height: 1.75; }
.player-container { --plyr-color-main: #d9b887; }
/* Ширина индикатора постоянная: смена 100% на 97,5% не двигает кнопки. */
.plyr .tortuga-volume { min-width: 160px; max-width: 185px; }
.tortuga-volume input[type=range] { min-width: 0; flex: 1 1 60px; width: 60px; }
.tortuga-volume-value { color: #f2e5cf; flex: 0 0 47px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: 7px; pointer-events: none; }
@media (max-width: 760px) {
  #nicknameOverlay { padding: 24px 18px; }
  .entry-layout { max-width: 470px; }
  .entry-brand { margin: 0 0 22px 5px; }
  .entry-brand > span { font-size: 25px; }
  .entry-brand > svg { width: 35px; height: 35px; }
  .login-box { grid-template-columns: 1fr; gap: 24px; padding: 28px; border-radius: 17px; }
  .login-box h2 { font-size: 38px; margin: 16px 0; }
  .login-box p { font-size: 14px; }
  .entry-ornament, .entry-form-caption { display: none; }
  .entry-form { border-left: 0; border-top: 1px solid #c5a57529; padding: 24px 0 0; }
  .login-box #nicknameHint { margin-bottom: 19px; }
  .login-box .entry-note { margin-top: 16px; }
  .entry-footer { padding-top: 19px; font-size: 9px; letter-spacing: .1em; }
}
@media (max-width: 480px) {
  .plyr .tortuga-volume { min-width: 126px; max-width: 126px; }
  .tortuga-volume-value { flex-basis: 43px; font-size: 11px; margin-left: 3px; }
  .view-controls { gap: 6px; }
  .view-controls button { padding: 8px 10px; }
}
@media (max-height: 600px) and (min-width: 761px) {
  #nicknameOverlay { padding: 18px; }
  .entry-brand { margin-bottom: 14px; }
  .login-box { padding: 28px 36px; }
  .login-box h2 { font-size: 40px; }
  .entry-footer { padding-top: 14px; }
}

/* voice-screen.css — совместимые правила компонента */
/* Голосовой блок независим от переписки. Не увеличиваем весь правый столбец. */
#voiceSection { flex: 0 1 auto; min-height: 120px; max-height: 65%; overflow-y: auto; border-top: 1px solid #516055; border-bottom: 0; padding: 12px; gap: 6px; background: #15272b; }
#chatEmpty.voice-active { display: none; }
#chatSidebar > .sidebar-header, #chatSidebar > .chat-input { flex-shrink: 0; }
#chatSidebar .chat-messages { min-height: 0; padding-block: 8px; }
#voiceSection .voice-heading { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
#voiceSection .voice-heading strong { color: #e7c99b; font: 21px Georgia, serif; }
#voiceConnectionState { font-size: 11px; color: #a6beb6; margin: -5px 0 0; }
#voiceRoster > summary, .voice-settings > summary { cursor: pointer; font-size: 12px; color: #d0d8cd; padding: 5px 0; }
#voiceUserCount { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 10px; background: #536250; color: #f3e7ce; }
#voiceEmpty { font-size: 12px; color: #aebeb9; padding: 5px 0; }
#voiceUsersList { max-height: 180px; margin: 6px 0 0; gap: 7px; }
.voice-person { padding: 6px 8px; border: 1px solid #45554f; border-radius: 9px; background: #1c3134; }
.voice-person-heading { display: flex; gap: 8px; align-items: center; }
.voice-avatar { width: 26px; height: 26px; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: #556052; color: #f5ddaf; font-size: 12px; }
.voice-person-name { min-width: 0; overflow-wrap: anywhere; color: #e4e7dc; font-size: 12px; flex: 1; }
.voice-person.speaking { border-color: #8cbda0; }
.voice-person.locally-muted .voice-avatar { opacity: .5; }
.voice-peer-mute { background: #13252b; border: 1px solid #526459; border-radius: 6px; min-height: 30px; min-width: 30px; cursor: pointer; }
.voice-peer-level { display: flex; gap: 10px; align-items: center; margin-top: 5px; }
#voiceSection input[type=range] { accent-color: #d9b887; padding: 0; height: 22px; width: 100%; min-width: 0; cursor: pointer; }
.voice-level-value { flex: 0 0 36px; font-size: 11px; color: #e7d3b0; text-align: right; font-variant-numeric: tabular-nums; }
#voiceSection .local-controls-row { display: flex; gap: 5px; padding: 0; border: 0; background: transparent; }
#voiceSection .local-controls-row button { min-height: 36px; min-width: 0; padding: 7px; border: 1px solid #536158; border-radius: 7px; background: #243a3c; color: #e7e5d5; font-size: 11px; cursor: pointer; }
#voiceSection .local-controls-row [aria-pressed=true] { background: #55393b; border-color: #96706a; }
#voiceSection #btnLeaveVoice { margin-left: auto; color: #f5bdb0; }
#voiceSection .btn-join { padding: 10px; min-height: 38px; width: 100%; background: #d7b889; color: #14292b; border-color: #e3caa4; border-radius: 8px; }
.voice-settings { border-top: 1px solid #4a5b504d; padding-top: 5px; }
.voice-settings label { display: flex; justify-content: space-between; font-size: 12px; color: #d3ddd4; margin: 10px 0 3px; }
.voice-settings label span { color: #e7d3b0; font-variant-numeric: tabular-nums; }
.voice-settings .voice-sounds { justify-content: flex-start; align-items: center; gap: 8px; }
.voice-sounds input { width: 16px; height: 16px; accent-color: #d7b889; }
.voice-settings p, #voiceStatus, .screen-quality-note { font-size: 11px; color: #b6c6bd; line-height: 1.6; margin: 7px 0 0; }
#voiceStatus:empty { display: none; }
#enableVoiceAudio { background: #d7b889; color: #172c2b; border: 0; border-radius: 7px; padding: 10px; }
#screenMediaInfo { font-variant-numeric: tabular-nums; line-height: 1.7; }
@media (max-width: 1000px) { #voiceSection { max-height: 55dvh; } }
@media (min-width: 1001px) { #chatSidebar { height: calc(100dvh - 196px); } }

