/* Базовая раскладка, извлечённая из index.html. */
* { box-sizing: border-box; margin: 0; padding: 0; }
        body {
            font-family: 'Segoe UI', Tahoma, sans-serif;
            color: #f1f1f1;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px;
            min-height: 100vh;
            overflow-x: hidden;
            background:
                linear-gradient(rgba(5, 8, 11, 0.48), rgba(5, 8, 11, 0.62)),
                var(--tortuga-bg-url, url('/back.png')) center center / cover fixed no-repeat;
            background-color: #080b0f;
        }
        
        #nicknameOverlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(15, 15, 18, 0.95); display: flex; justify-content: center; align-items: center; z-index: 1000; }
        .login-box { background: #16161a; padding: 30px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.8); border: 1px solid #222; text-align: center; width: 320px; }
        .login-box h2 { color: #3e3b3b; margin-bottom: 10px; font-size: 1.5rem; }
        .login-box p { color: #aaa; font-size: 0.85rem; margin-bottom: 20px; }
        .login-box input { width: 100%; padding: 12px; margin-bottom: 15px; background: #0f0f12; border: 1px solid #333; color: #fff; border-radius: 6px; outline: none; }
        .login-box input:focus { border-color: #4d494a; }
         .login-box button {
            width: 100%;
            padding: 12px;
            background: linear-gradient(180deg, rgba(53,64,71,.94), rgba(31,40,46,.96));
            color: rgba(236,240,242,.92);
            border: 1px solid rgba(150,166,174,.16);
            border-radius: 9px;
            cursor: pointer;
            font-size: 1rem;
            font-weight: 700;
            box-shadow: 0 8px 20px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.035);
        }
        
        header {
            width: 100%;
            max-width: 1400px;
            margin-bottom: 20px;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
        }
        .brand {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 6px;
        }
        h1 {
            font-family: "Segoe Script", "Brush Script MT", "Lucida Handwriting", cursive;
            font-size: clamp(1.9rem, 3vw, 2.65rem);
            font-weight: 600;
            color: #f1eee8;
            letter-spacing: 0.02em;
            line-height: 1;
            text-shadow: 0 2px 16px rgba(0,0,0,0.65);
            transform: rotate(-1deg);
            transform-origin: left center;
            user-select: none;
        }
        h1 .title-accent {
            color: #e50914;
            font-family: 'Segoe UI', sans-serif;
            font-weight: 800;
            margin-left: 4px;
            display: inline-block;
        }
        .brand-tagline {
            font-family: "Segoe Script", "Brush Script MT", "Lucida Handwriting", cursive;
            font-size: clamp(0.72rem, 1.1vw, 0.95rem);
            font-style: italic;
            font-weight: 500;
            color: rgba(224, 220, 211, 0.72);
            letter-spacing: 0.04em;
            margin-left: 3px;
            text-shadow: 0 1px 10px rgba(0,0,0,0.75);
            transform: rotate(-0.6deg);
        }
         .badge {
            background: rgba(18,24,28,.64);
            padding: 6px 10px;
            border-radius: 8px;
            font-size: .74rem;
            border: 1px solid rgba(125,142,150,.08);
            color: rgba(158,171,178,.48);
            box-shadow: none;
            opacity: .72;
            backdrop-filter: blur(8px);
        }
         .badge.host {
            color: rgba(171,181,186,.58);
            border-color: rgba(125,142,150,.10);
            background: rgba(18,24,28,.68);
        }

        .layout { display: flex; gap: 22px; align-items: flex-start; width: 100%; max-width: 1500px; display: none; position: relative; z-index: 2; }
        .main-column { flex: 1; min-width: 0; max-width: 100%; background: linear-gradient(180deg, rgba(12,17,21,.86), rgba(5,8,11,.94)); border-radius: 16px; overflow: hidden; box-shadow: 0 25px 70px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.035); border: 1px solid rgba(151,170,179,.14); display: flex; flex-direction: column; backdrop-filter: blur(10px) saturate(115%); }
        
        .sidebar { width: 340px; background: linear-gradient(180deg, rgba(11,16,20,.92), rgba(5,8,11,.96)); border-radius: 16px; display: flex; flex-direction: column; height: calc(100vh - 100px); border: 1px solid rgba(151,170,179,.14); box-shadow: 0 25px 70px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.025); flex-shrink: 0; backdrop-filter: blur(12px) saturate(120%); }
        .sidebar-header { padding: 16px 18px; background: linear-gradient(180deg, rgba(22,29,33,.88), rgba(12,17,21,.74)); border-bottom: 1px solid rgba(151,170,179,.10); font-weight: 700; text-align: left; letter-spacing: .04em; text-transform: uppercase; font-size: .78rem; color: rgba(230,235,237,.84); }
        .voice-controls { padding: 15px; border-bottom: 1px solid #222; display: flex; flex-direction: column; gap: 10px; background: #111115;}
        
         .btn-join {
            padding: 12px 14px;
            border: 1px solid rgba(150,166,174,.16);
            border-radius: 10px;
            cursor: pointer;
            font-weight: 700;
            color: rgba(232,237,239,.88);
            background: linear-gradient(180deg, rgba(53,64,71,.94), rgba(31,40,46,.96));
            box-shadow: 0 8px 20px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.035);
            transition: .2s ease;
            width: 100%;
        }
         .btn-join:hover {
            background: linear-gradient(180deg, rgba(63,75,82,.96), rgba(38,48,54,.98));
            border-color: rgba(170,185,192,.23);
            transform: translateY(-1px);
        }
        
        .voice-participants { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; max-height: 150px; overflow-y: auto; }
        .participant-row { display: flex; justify-content: space-between; align-items: center; background: #22222b; padding: 8px 12px; border-radius: 6px; font-size: 0.85rem; border-left: 3px solid #4caf50;}
        .participant-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; margin-right: 10px;}
        .participant-row.host-row { border-left: 3px solid #e50914; }

        .local-controls-row { display: flex; gap: 8px; justify-content: space-between; background: #1a1a20; padding: 10px; border-radius: 8px; border: 1px solid #333;}
        .btn-icon { background: #2b2b36; border: none; color: white; width: 40px; height: 40px; border-radius: 6px; cursor: pointer; transition: 0.2s; display: flex; justify-content: center; align-items: center; font-size: 1.1rem; flex: 1;}
        .btn-icon:hover { background: #3b3b4a; }
         .btn-icon.danger {
            background: linear-gradient(180deg, rgba(53,64,71,.94), rgba(31,40,46,.96));
            border-color: rgba(150,166,174,.16);
            color: rgba(232,237,239,.88);
        }
         .btn-icon.danger:hover {
            background: linear-gradient(180deg, rgba(63,75,82,.96), rgba(38,48,54,.98));
            border-color: rgba(170,185,192,.23);
        }

        .chat-messages { flex: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; font-size: .9rem; background: radial-gradient(circle at top right, rgba(36,55,68,.14), transparent 34%), linear-gradient(180deg, rgba(5,9,12,.12), rgba(3,6,8,.32)); scrollbar-width: thin; }
        .msg { padding: 10px 12px; border-radius: 10px 10px 10px 4px; background: linear-gradient(180deg, rgba(25,34,39,.82), rgba(14,21,25,.76)); width: fit-content; max-width: 90%; border: 1px solid rgba(151,170,179,.08); box-shadow: 0 5px 18px rgba(0,0,0,.16); line-height: 1.45; }
        .msg.admin { border-left: 3px solid #e50914; background: linear-gradient(180deg, rgba(49,23,25,.78), rgba(20,12,14,.72)); }
        .msg.viewer { border-left: 3px solid rgba(128,157,171,.6); }
        .chat-input { display: flex; padding: 15px; background: #1a1a20; border-top: 1px solid #222; }
        .chat-input input { flex: 1; padding: 10px; background: #0f0f12; border: 1px solid #333; color: #fff; border-radius: 6px 0 0 6px; outline: none; }
         .chat-input button {
            padding: 10px 16px;
            background: linear-gradient(180deg, rgba(53,64,71,.94), rgba(31,40,46,.96));
            border: 1px solid rgba(150,166,174,.16);
            color: rgba(236,240,242,.92);
            cursor: pointer;
            border-radius: 0 10px 10px 0;
            font-weight: 800;
            box-shadow: 0 6px 16px rgba(0,0,0,.20);
            transition: .2s ease;
        }
        .chat-input button:hover {
            background: linear-gradient(180deg, rgba(63,75,82,.96), rgba(38,48,54,.98));
            border-color: rgba(170,185,192,.23);
        }

        .player-container { position: relative; width: 100%; background: radial-gradient(circle at center, rgba(14,23,28,.14), transparent 52%), #000; --plyr-color-main: #e50914; display: flex; flex-direction: column; box-shadow: inset 0 0 0 1px rgba(255,255,255,.025); }
        #mediaContainer { width: 100%; display: flex; }
        .plyr { width: 100%; --plyr-font-family: 'Segoe UI', Tahoma, sans-serif; --plyr-video-control-color: rgba(245,247,248,.92); --plyr-video-control-color-hover: #fff; --plyr-menu-background: rgba(10,15,18,.96); --plyr-menu-color: #eef2f3; --plyr-tooltip-background: rgba(5,8,10,.94); --plyr-video-progress-buffered-background: rgba(255,255,255,.22); } .plyr--video { border-radius: 14px 14px 0 0; overflow: hidden; background: #000; } .plyr__controls { background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.10) 14%, rgba(0,0,0,.82) 100%) !important; padding: 54px 14px 12px !important; } .plyr__control { border-radius: 8px; } .plyr__control:hover { background: rgba(229,9,20,.18) !important; } .plyr__menu__container { border: 1px solid rgba(151,170,179,.14); box-shadow: 0 18px 42px rgba(0,0,0,.52); backdrop-filter: blur(14px); }
        
        body.viewer-mode .plyr__progress { pointer-events: none; }

        #reactionLayer { position: absolute; bottom: 60px; left: 0; width: 100%; height: 80%; pointer-events: none; z-index: 10; overflow: hidden; }
        .floating-emoji { position: absolute; bottom: 0; font-size: 2rem; animation: floatUp 2.5s ease-out forwards; opacity: 1; }
        @keyframes floatUp { 0% { transform: translateY(0) scale(1); opacity: 1; } 50% { transform: translateY(-100px) scale(1.5); opacity: 0.8; } 100% { transform: translateY(-200px) scale(1); opacity: 0; } }

        .reaction-bar { display: flex; gap: 9px; padding: 11px 18px; background: linear-gradient(180deg, rgba(16,23,27,.95), rgba(9,14,17,.92)); border-bottom: 1px solid rgba(151,170,179,.09); justify-content: center; }
        .reaction-btn { background: linear-gradient(180deg, rgba(34,44,49,.88), rgba(20,27,31,.90)); border: 1px solid rgba(151,170,179,.12); font-size: 1.18rem; border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: .2s ease; box-shadow: 0 5px 16px rgba(0,0,0,.14); }
        .reaction-btn:hover { background: #3b3b4a; transform: scale(1.1); }

        #hostPanel { display: none; padding: 15px 20px; background: #1a1a20; border-bottom: 1px solid #222; }
        .url-input-group { display: flex; gap: 10px; }
        .url-input-group input { flex: 1; padding: 10px; background: #0f0f12; border: 1px solid #333; color: #fff; border-radius: 6px; outline: none;}
         .url-input-group button {
            padding: 10px 20px;
            background: linear-gradient(180deg, rgba(53,64,71,.94), rgba(31,40,46,.96));
            color: rgba(236,240,242,.90);
            border: 1px solid rgba(150,166,174,.16);
            border-radius: 8px;
            cursor: pointer;
            font-weight: 700;
            box-shadow: 0 7px 18px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.035);
            transition: .2s ease;
        }
        .url-input-group button:hover {
            background: linear-gradient(180deg, rgba(63,75,82,.96), rgba(38,48,54,.98));
            border-color: rgba(170,185,192,.23);
            transform: translateY(-1px);
        }
        
        .info-panel { padding: 17px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(151,170,179,.09); flex-wrap: wrap; gap: 15px; background: linear-gradient(180deg, rgba(13,20,24,.76), rgba(8,13,16,.74)); }
        
        .playlist { padding: 18px 20px 20px; background: linear-gradient(180deg, rgba(8,13,16,.78), rgba(5,9,11,.90)); }
        .playlist h3 { font-size: 1rem; margin-bottom: 10px; color: #aaa; }
        .playlist ul { list-style: none; }
        .playlist li { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; margin-bottom: 7px; background: linear-gradient(180deg, rgba(21,29,33,.80), rgba(13,19,22,.78)); border-radius: 10px; font-size: .95rem; word-break: break-all; transition: all .2s ease; border: 1px solid rgba(151,170,179,.07); box-shadow: inset 0 1px 0 rgba(255,255,255,.02); }
        .playlist li.active { border-left: 4px solid #e50914; color: #fff; font-weight: 700; background: linear-gradient(180deg, rgba(49,22,25,.80), rgba(21,11,13,.80)); box-shadow: inset 0 0 22px rgba(229,9,20,.06), 0 6px 18px rgba(0,0,0,.15); }
        .playlist li.host-clickable { cursor: pointer; border-left: 4px solid transparent; }
        .playlist li.host-clickable:hover { background: #2b2b36; border-left: 4px solid #4caf50; }
        
        .btn-delete-item { background: transparent; border: none; color: #888; cursor: pointer; font-size: 1rem; padding: 2px 6px; border-radius: 4px; transition: 0.2s; }
        .btn-delete-item:hover { color: #fff; background: #e50914; }

        @media (max-width: 1000px) {
            body { background-attachment: scroll; }
            .layout { flex-direction: column; }
            .sidebar { width: 100%; height: 400px; }
        }

        .main-column, .sidebar { position: relative; }
        .main-column::before, .sidebar::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.015); }
        .info-panel #currentTitle { letter-spacing: .01em; text-shadow: 0 2px 14px rgba(0,0,0,.45); }
        .info-panel #syncStatus { letter-spacing: .03em; text-transform: uppercase; font-size: .72rem !important; }
        .playlist h3 { letter-spacing: .06em; text-transform: uppercase; color: rgba(220,228,232,.56); font-weight: 600; }
        .chat-input input::placeholder { color: rgba(180,194,201,.34); }
        ::-webkit-scrollbar { width: 8px; height: 8px; }
        ::-webkit-scrollbar-track { background: rgba(0,0,0,.12); }
        ::-webkit-scrollbar-thumb { background: rgba(142,161,170,.22); border-radius: 999px; }
        ::-webkit-scrollbar-thumb:hover { background: rgba(142,161,170,.34); }

        .room-overlay { position: fixed; inset: 0; z-index: 1001; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(5,8,11,.92); backdrop-filter: blur(10px); }
        .room-dialog { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 28px; border: 1px solid rgba(151,170,179,.16); border-radius: 16px; background: linear-gradient(180deg, rgba(20,29,34,.98), rgba(7,12,15,.98)); box-shadow: 0 30px 90px rgba(0,0,0,.60); }
        .room-dialog h2 { margin-bottom: 7px; color: rgba(238,242,244,.95); font-size: 1.35rem; }
        .room-dialog > p { margin-bottom: 20px; color: rgba(185,198,204,.66); font-size: .9rem; }
        .room-list { display: grid; gap: 9px; }
        .room-choice { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid rgba(151,170,179,.13); border-radius: 10px; color: rgba(237,242,244,.94); cursor: pointer; text-align: left; background: linear-gradient(180deg, rgba(35,47,54,.78), rgba(17,25,30,.88)); transition: .2s ease; }
        .room-choice:hover { transform: translateY(-1px); border-color: rgba(177,193,201,.26); background: linear-gradient(180deg, rgba(48,61,68,.92), rgba(25,35,41,.96)); }
        .room-choice small { display: block; margin-top: 4px; color: rgba(178,193,200,.58); }
        .room-flags { flex-shrink: 0; color: rgba(213,221,225,.64); font-size: .9rem; white-space: nowrap; }
        .room-form, .room-admin { margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(151,170,179,.12); }
        .room-form h3, .room-admin h3 { margin-bottom: 12px; font-size: .92rem; letter-spacing: .04em; text-transform: uppercase; color: rgba(220,228,232,.66); }
        .room-form input, .room-admin input { width: 100%; padding: 10px 12px; margin-bottom: 10px; color: #fff; background: #0f1418; border: 1px solid rgba(151,170,179,.18); border-radius: 8px; outline: none; }
        .room-toggles { display: flex; gap: 16px; margin: 4px 0 14px; color: rgba(218,226,230,.78); font-size: .88rem; }
        .room-toggles label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
        .room-submit, .header-room-button { padding: 10px 14px; border: 1px solid rgba(150,166,174,.16); border-radius: 8px; color: rgba(236,240,242,.92); cursor: pointer; font-weight: 700; background: linear-gradient(180deg, rgba(53,64,71,.94), rgba(31,40,46,.96)); transition: .2s ease; }
        .room-submit:hover, .header-room-button:hover { background: linear-gradient(180deg, rgba(63,75,82,.96), rgba(38,48,54,.98)); border-color: rgba(170,185,192,.23); }
        .header-actions { display: flex; align-items: center; gap: 10px; }
        .header-room-button { display: none; padding: 7px 10px; font-size: .78rem; }
        .room-admin { display: none; }
        .room-admin.visible { display: block; }
        .room-sidebar { padding: 13px 15px; border-bottom: 1px solid rgba(151,170,179,.10); background: linear-gradient(180deg, rgba(13,20,24,.84), rgba(8,13,16,.80)); }
        .room-sidebar-title { margin-bottom: 9px; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: rgba(213,224,230,.62); }
        .sidebar-room-list { display: grid; gap: 6px; max-height: 280px; overflow-y: auto; }
        .room-sidebar .room-choice { padding: 9px 10px; border-radius: 8px; font-size: .84rem; }
        .room-sidebar .room-choice small { font-size: .72rem; }
        .room-sidebar .room-choice.active { border-color: rgba(229,9,20,.46); box-shadow: inset 3px 0 0 #e50914; }
        .room-sidebar .room-form, .room-sidebar .room-admin { margin-top: 13px; padding-top: 13px; }
        .room-sidebar .room-form h3, .room-sidebar .room-admin h3 { font-size: .76rem; margin-bottom: 8px; }
        .room-sidebar .room-form input, .room-sidebar .room-admin input { margin-bottom: 7px; padding: 8px 10px; font-size: .85rem; }
        .room-sidebar .room-toggles { margin: 3px 0 10px; gap: 11px; font-size: .79rem; }
        .room-sidebar .room-submit { width: 100%; padding: 9px 10px; font-size: .82rem; }
        .rooms-column { width: 275px; height: calc(100vh - 100px); flex-shrink: 0; overflow-y: auto; border: 1px solid rgba(151,170,179,.14); border-radius: 16px; background: linear-gradient(180deg, rgba(11,16,20,.92), rgba(5,8,11,.96)); box-shadow: 0 25px 70px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.025); backdrop-filter: blur(12px) saturate(120%); }
        .rooms-column .room-sidebar { min-height: 100%; border-bottom: 0; }
        .subtitle-toggle { padding: 8px 11px; border: 1px solid rgba(151,170,179,.16); border-radius: 8px; color: rgba(235,240,242,.9); background: linear-gradient(180deg, rgba(43,54,60,.92), rgba(24,33,38,.96)); cursor: pointer; font-size: .8rem; font-weight: 700; }
        .subtitle-toggle:hover:not(:disabled) { background: linear-gradient(180deg, rgba(60,73,80,.96), rgba(32,43,49,.98)); }
        .subtitle-toggle:disabled { opacity: .45; cursor: not-allowed; }
        .room-delete { width: 100%; margin-top: 8px; padding: 8px 10px; border: 1px solid rgba(229,9,20,.35); border-radius: 8px; background: rgba(95,17,22,.48); color: rgba(255,224,226,.9); cursor: pointer; font-size: .8rem; font-weight: 700; }
        .room-delete:hover:not(:disabled) { background: rgba(145,22,30,.65); }
        .room-delete:disabled { opacity: .4; cursor: not-allowed; }
        .delete-room-dialog { position: fixed; inset: 0; z-index: 1200; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
        .delete-room-dialog.visible { display: flex; }
        .delete-room-card { width: min(420px, 100%); padding: 24px; border: 1px solid rgba(229,9,20,.42); border-radius: 14px; background: linear-gradient(180deg, #20272c, #101518); box-shadow: 0 24px 70px rgba(0,0,0,.6); }
        .delete-room-card h2 { margin: 0 0 10px; font-size: 1.18rem; color: #fff; }
        .delete-room-card p { margin: 0; color: rgba(229,235,238,.76); line-height: 1.5; }
        .delete-room-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
        .delete-room-actions button { padding: 9px 14px; border-radius: 8px; cursor: pointer; font-weight: 700; }
        .delete-room-cancel { border: 1px solid rgba(180,194,202,.24); background: rgba(255,255,255,.06); color: #e8edf0; }
        .delete-room-confirm { border: 1px solid rgba(229,9,20,.55); background: #b20b16; color: #fff; }
        .delete-room-confirm:hover { background: #df111f; }
        @media (max-width: 1000px) { .rooms-column { width: 100%; height: auto; max-height: 360px; } }
