:root { color-scheme: dark; --bg: #101114; --panel: #1b1c20; --line: #303136; --text: #f0eee8; --muted: #aaa8a2; --accent: #d8af81; --green: #a3cda7; --button: #e3c7a8; --button-text: #231f1a; font-family: var(--font-sans); }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; border-radius: 5px; color: inherit; transition: background .15s, opacity .15s; }
button:disabled { cursor: not-allowed; opacity: .4; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
input, select { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 5px; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
input:not([type="range"]):not([type="checkbox"]):not([type="file"]) { padding: 12px 13px; width: 100%; }
input::placeholder { color: var(--muted); }
input[type="range"], input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }
input[type="range"] { min-width: 0; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h2 { font-size: 19px; font-weight: 600; }
h2 span { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.primary { background: var(--button); color: var(--button-text); padding: 10px 16px; font-weight: 600; min-height: 42px; }
.primary:hover:not(:disabled) { opacity: .85; }
.ghost { background: transparent; padding: 8px 10px; font-size: 15px; min-height: 38px; }
.ghost:hover:not(:disabled) { background: var(--panel); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.login-screen { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; padding: 32px; gap: 32px; }
.login-art { position: relative; background: #242726; color: #efede6; min-height: 600px; border-radius: 4px; display: flex; flex-direction: column; justify-content: space-between; padding: 34px 40px; overflow: hidden; }
.wordmark { font-size: 26px; letter-spacing: 5px; }
.film-window { width: 100%; aspect-ratio: 16 / 10; margin: auto 0; display: grid; place-items: center; background: #303431; }
.film-window span { font-size: clamp(70px, 9vw, 145px); line-height: 1.12; font-weight: 600; letter-spacing: .18em; transform: translateX(.09em); }
.art-footer { font-size: 14px; color: #b8bcb4; letter-spacing: 2px; }
.login-panel { display: grid; place-items: center; padding: 56px 36px; position: relative; }
.login-panel form { width: min(100%, 340px); }
.login-panel h1 { font-size: 30px; font-weight: 500; margin-bottom: 38px; }
.login-panel label { display: block; margin: 24px 0 9px; font-size: 16px; }
.login-panel #enter { width: 100%; display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 13px 16px; }
.error { min-height: 24px; font-size: 14px; color: #d76c67; margin-top: 12px; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 76px; padding: 14px max(28px, calc((100vw - 1536px) / 2)); border-bottom: 1px solid var(--line); gap: 16px; }
.brand { font-size: 26px; letter-spacing: 3px; white-space: nowrap; }
.brand span { color: var(--muted); font-size: 14px; letter-spacing: 0; margin-left: 18px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.status { font-size: 14px; color: var(--muted); margin-right: 8px; white-space: nowrap; }
.status::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--green); vertical-align: middle; }
.room-grid { max-width: 1600px; margin: auto; padding: 30px 32px 48px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; }
.screen-column, .social-column { min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; margin-bottom: 14px; }
.section-heading > div { min-width: 0; }
.section-heading h1 { font-size: 26px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.sync-pill { font-size: 14px; color: var(--muted); flex: none; white-space: nowrap; }
.player-wrap { position: relative; background: #08090b; aspect-ratio: 16 / 9; border-radius: 5px 5px 0 0; overflow: hidden; display: grid; place-items: center; }
.player-wrap video { display: block; width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.player-wrap:fullscreen { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.empty-player { position: absolute; text-align: center; pointer-events: none; color: #c3c3c0; }
.empty-icon { font-size: 48px; line-height: 1; margin-bottom: 18px; color: #878a85; }
.empty-player h2 { font-size: 17px; font-weight: 400; }
.unlock { position: absolute; padding: 12px 22px; background: #ece2d3; color: #29241d; }
.player-notice { position: absolute; bottom: 16px; left: 16px; right: 16px; background: #17191be6; color: #eac59d; font-size: 14px; padding: 10px 12px; border-radius: 4px; }
.player-controls { min-height: 64px; display: flex; gap: 12px; align-items: center; padding: 10px 14px; background: var(--panel); border-radius: 0 0 5px 5px; }
.player-controls button { background: transparent; padding: 6px; min-width: 32px; min-height: 36px; font-size: 22px; }
.player-controls span { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.player-controls #seek { flex: 1; width: 0; }
.player-controls #volume { width: 65px; }
.player-controls select { padding: 5px; font-size: 14px; background: transparent; border-color: transparent; }
.player-controls #subtitle { font-size: 14px; padding: 5px; }
.library { padding-top: 30px; }
.library-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.library-actions { display: flex; gap: 4px; align-items: center; min-width: 0; }
.library #search { background: transparent; max-width: 230px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 6px 4px; font-size: 15px; }
.movie-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 20px; }
.movie { display: flex; flex-direction: column; position: relative; gap: 10px; padding: 0; border: 0; background: transparent; text-align: left; width: 100%; min-width: 0; align-items: stretch; border-radius: 3px; }
.movie-icon { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; height: auto; flex: none; font-size: 30px; color: var(--muted); background: var(--panel); border-radius: 4px; overflow: hidden; }
.movie:hover .movie-icon { opacity: .85; }
.movie.active .movie-icon { outline: 2px solid var(--accent); outline-offset: 3px; }
.movie-text { min-width: 0; display: block; }
.movie-title { font-size: 17px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.movie-meta { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }
.movie .choose { position: absolute; top: 9px; right: 9px; padding: 2px 8px; font-size: 12px; background: #161815d9; color: #f5f3ef; border-radius: 3px; display: none; }
.movie.active .choose { display: block; }
.empty-library { grid-column: 1 / -1; padding: 26px 0; font-size: 16px; color: var(--muted); }
.social-column { border-left: 1px solid var(--line); padding-left: 26px; display: flex; flex-direction: column; gap: 28px; align-self: start; }
.friends { padding-top: 13px; }
.friends .library-heading { margin-bottom: 16px; }
.users { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.user { display: flex; align-items: center; gap: 9px; font-size: 16px; min-width: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; color: var(--text); background: var(--panel); flex: none; }
.user-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.user small { font-size: 12px; color: var(--muted); }
.chat { display: flex; flex-direction: column; min-height: 400px; }
.chat-heading { margin-bottom: 14px; }
.messages { display: flex; flex-direction: column; gap: 18px; min-height: 220px; height: 320px; max-height: 46vh; overflow-y: auto; scrollbar-width: thin; flex: 1; padding: 0 2px 18px; }
.message small { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.message p { display: inline-block; font-size: 16px; line-height: 1.65; margin: 0; background: var(--panel); padding: 8px 12px; max-width: 100%; border-radius: 2px 8px 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.mine p { background: var(--mine); }
.message.system { color: var(--muted); font-size: 12px; line-height: 1.6; text-align: left; }
.reactions { display: flex; gap: 4px; padding: 9px 0; }
.reactions button { background: transparent; font-size: 20px; padding: 5px 8px; }
.reactions button:hover { background: var(--panel); }
.chat-form { display: flex; gap: 6px; padding: 8px 0 0; border-top: 1px solid var(--line); }
.chat-form input { background: transparent; border: 0; padding: 8px 0 !important; font-size: 16px; flex: 1; min-width: 0; }
.chat-form button { color: var(--text); background: var(--panel); font-size: 22px; width: 38px; height: 38px; flex: none; }
.toast { position: fixed; z-index: 30; bottom: 24px; left: 50%; transform: translateX(-50%); background: #242826; color: #f6f4ed; border-radius: 5px; padding: 11px 18px; font-size: 15px; max-width: min(90vw, 600px); text-align: center; box-shadow: 0 4px 20px #0002; }
@media (max-width: 1120px) {
  .room-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; padding: 24px; }
  .social-column { padding-left: 20px; }
  .player-controls { gap: 7px; padding-left: 10px; padding-right: 10px; }
  .player-controls #volume { display: none; }
  .movie-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .room-grid { grid-template-columns: 1fr; }
  .social-column { border-left: 0; border-top: 1px solid var(--line); padding: 24px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
  .friends { padding-top: 0; }
}
@media (max-width: 600px) {
  .login-screen { display: block; padding: 0; }
  .login-art { min-height: 180px; padding: 24px; border-radius: 0; }
  .film-window { position: absolute; right: 24px; top: 20px; width: 160px; height: 140px; }
  .film-window span { font-size: 49px; }
  .login-panel { min-height: calc(100dvh - 180px); padding: 70px 24px 32px; }
  .login-panel h1 { font-size: 27px; margin-bottom: 28px; }
  .topbar { min-height: 64px; padding: 12px 16px; gap: 10px; }
  .brand { font-size: 23px; }
  .brand span, .top-actions .theme-label { display: none; }
  .top-actions { gap: 2px; }
  .top-actions .ghost { font-size: 14px; padding: 7px; }
  .status { font-size: 12px; margin-right: 3px; }
  .room-grid { padding: 18px 16px 32px; gap: 26px; }
  .section-heading { gap: 12px; min-height: 52px; }
  .section-heading h1 { font-size: 23px; }
  .sync-pill { font-size: 12px; }
  .social-column { display: flex; padding-top: 24px; }
  .library { padding-top: 24px; }
  .library-heading { gap: 10px; }
  .library #search { width: 110px; font-size: 14px; }
  .movie-list { gap: 22px 14px; }
  .movie-title { font-size: 16px; }
  .movie-meta { font-size: 13px; }
  .chat { min-height: 350px; }
  .messages { height: 280px; max-height: 400px; }
}
