﻿::-webkit-scrollbar-track, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb {
	border: 4px solid #f9f9f9;
}

::-webkit-scrollbar-track {
	background-color: #f9f9f9;
}

::-webkit-scrollbar, ::-webkit-scrollbar-thumb {
	background-color: #DDD;
}

html, body, header, main, footer, div, i, ul, li, select, input {
	transition: background-color 200ms linear;
	box-sizing: border-box;
	padding: 0;
	margin: 0;
}

input, select, option {
	font-family: inherit;
	font-weight: inherit;
}

i {
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

html, body, header, main, footer {
	display: -webkit-box;
	display: -ms-flexbox;
	display: -webkit-flex;
	display: flex;
	-webkit-box-flex: 1;
	-webkit-flex: 1;
	-ms-flex: 1;
	flex: 1;
}

html, body {
	-webkit-box-orient: vertical;
	-webkit-box-direction: normal;
	-ms-flex-direction: column;
	flex-direction: column;
	font-family: Verdana, 'DejaVu Sans', 'Bitstream Vera Sans', Geneva, sans-serif;
	font-size: 15px;
	background: #f9f9f9;
	max-height: 100%;
	height: 100%;
	width: 100%;
	color: #333;
}

header {
	max-height: 50px;
	height: 50px;
	z-index: 25;
}

footer {
	max-height: 94px;
	height: 94px;
	z-index: 25;
}

header, #window > div:first-child {
	background: linear-gradient(to bottom, #EEE 0%, #FFF 100%);
}

footer {
	background: linear-gradient(to bottom, #FFF 0%, #EEE 100%);
	align-items: center;
}

header {
	padding-right: 200px;
}

header > div {
	width: 182px;
	height: 75px;
	margin: 5px auto 0;
	background: url("/img/logo_in.svg") no-repeat;
	background-size: 182px 75px !important;
}

header > div > img {
	opacity: 0;
	width: 182px;
	height: 75px;
	-webkit-animation: 2s ease-out 10s 1 forwards running opacityin;
	animation: 2s ease-out 10s 1 forwards running opacityin;
}

@-webkit-keyframes opacityin {
	0% { opacity: 0; }
	100% { opacity: 1; }
}
@keyframes opacityin {
	0% { opacity: 0; }
	100% { opacity: 1; }
}

footer > div {
	height: 100%;
	width: 200px;
	border-left: 2px solid #BBB;
	display: -webkit-box;
	display: -ms-flexbox;
	display: -webkit-flex;
	display: flex;
	-webkit-box-orient: vertical;
	-webkit-box-direction: normal;
	-ms-flex-direction: column;
	flex-direction: column;
}

#room-options {
	width: 100%;
	height: 44px;
	min-height: 44px;
	display: flex;
	border-bottom: 2px solid #BBB;
}

.room-option {
	-webkit-box-flex: 1;
	-webkit-flex: 1;
	-ms-flex: 1;
	flex: 1;
	min-width: 0;
	padding: 0;
	border: 0;
	border-right: 2px solid #BBB;
	background: transparent;
	color: inherit;
	font: inherit;
	opacity: 1;
	cursor: not-allowed;
	text-align: center;
	font-size: 22px;
}

.room-option:last-child {
	border-right: 0;
}

#chat-controls {
	width: 100%;
	height: 50px;
	min-height: 50px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

#chat-controls > i {
	-webkit-box-flex: 1;
	-webkit-flex: 1;
	-ms-flex: 1;
	flex: 1;
	text-align: center;
	padding: 13px 10px;
}

#chat-controls > i:not(:first-child) {
	border-left: 2px solid #BBB;
}

#chat-controls > i:hover {
	background: #EEE;
}

main {
	z-index: 20;
	min-width: 0;
	min-height: 0;
	height: 100%;
	border-top: 2px solid #BBB;
	border-bottom: 2px solid #BBB;
	display: -webkit-box;
	display: -ms-flexbox;
	display: -webkit-flex;
	display: flex;
}

#input {
	-webkit-box-flex: 1;
	-webkit-flex: 1;
	-ms-flex: 1;
	flex: 1;
	height: 50px ;
	font-size: 30px;
	padding: 5px 10px;
	outline: 0;
	border: 0;
	min-width: 0;
	background: #f9f9f9;
}

#chat {
	-webkit-box-flex: 1;
	-webkit-flex: 1;
	-ms-flex: 1;
	flex: 1;
	min-width: 0;
	overflow-y: scroll;
	z-index: 20;
}

#chat > div {
	display: -webkit-box;
	display: -ms-flexbox;
	display: -webkit-flex;
	display: flex;
	-webkit-box-orient: horizontal;
	-webkit-box-direction: normal;
	-ms-flex-direction: row;
	flex-direction: row;
	-webkit-box-pack: justify;
	-ms-flex-pack: justify;
	justify-content: space-between;
	padding: 5px 0;
	position: relative;
}

#chat > div > :not(:nth-child(2)) {
	white-space: nowrap;
	width: 70px;
}

#chat > div > div:last-child {
	font-family: monospace;
	padding-right: 5px;
	text-align: right;
	line-height: 24px;
	font-size: 11px;
}

#chat > div > :first-child {
	margin: 0 10px;
}

#chat > div > div:first-child {
	background-color: #DDD;
	border-radius: 99px;
	position: relative;
	overflow: hidden;
	height: 70px;
	border-right: 2px solid rgba(0, 0, 0, 0.5);
	border-bottom: 2px solid rgba(0, 0, 0, 0.5);	
}

#chat > div > div:first-child > img {
	position: absolute;
	margin: auto;
	display: none;
}

#chat > div > div:first-child > img:nth-child(1) {
	top: auto;
	left: 4px;
	right: auto;
	bottom: 6px;
}

#chat > div > div:first-child > img:not(:first-child), ul > li > div > div:first-child > div > img {
	top: -100%;
	left: -100%;
	right: -100%;
	bottom: -100%;
}

#chat > div > :nth-child(2) {
	-webkit-box-flex: 1;
	-webkit-flex: 1;
	-ms-flex: 1;
	flex: 1;
	min-width: 0;
	overflow: hidden;
	overflow-wrap: anywhere;
	word-break: keep-all;
}

#chat > div > div > div {
	padding: 5px;
}

#chat > div > :nth-child(2) > div:not(:first-child) {
	color: #333;
}

#chat > .msg > :nth-child(3) {
	color: #999;
}

ul {
	width: 200px;
	flex-shrink: 0;
	height: 100%;
	border-left: 2px solid #BBB;
	overflow-x: hidden;
	overflow-y: scroll;
	background: #f9f9f9;
}

ul > li {
	background-position: left 4px bottom 6px;
	background-repeat: no-repeat;
	padding-left: 40px;
	line-height: 36px;
	width: 180px;
	height: 36px;
	display: -webkit-box;
	display: -ms-flexbox;
	display: -webkit-flex;
	display: flex;
	-ms-flex-pack: justify;
	justify-content: space-between;
}

ul > li > i {
	margin: 1px 0;
	padding: 6px 5px;
	color: #333;
}

a {
	color: #06A;
	text-decoration: none;
}

audio + a {
	margin-left: 5px;
}

a:hover, li > i:hover, footer i:hover, #window input:hover, #window label:hover, select:hover {
	cursor: pointer;
}

ul > li:hover > div {
	display: block;
}

ul > li > div {
	z-index: 25;
	color: #333;
	display: none;
	position: absolute;
	top: 57px;
	right: 222px;
	width: 400px;
	font-size: 11px;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 35px, #f9f9f9 35px, #f9f9f9 100%);
}

ul > li > div > div:first-child {
	font-size: 25px;
	line-height: 30px;
	padding-bottom: 10px;
	text-align: center;
}

ul > li > div > div:first-child > div {
	background-color: #DDD;
	border-radius: 99px;
	overflow: hidden;
	height: 70px;
	width: 70px;
	position: relative;
	display: inline-block;
	border-right: 2px solid rgba(0, 0, 0, 0.5);
	border-bottom: 2px solid rgba(0, 0, 0, 0.5);	
}

ul > li > div > div:first-child > div > img {
	position: absolute;
	display: block;
	margin: auto;
}

ul > li > div > div:last-child {
	padding: 5px 10px;
	line-height: 25px;
	border: 2px solid #BBB;
	border-top: 0;
}

ul > li > div > div:last-child > i {
	position: relative;
	top: 3px;
	font-size: 15px;
	margin-right: 5px;
}

.backlog {
	-webkit-filter: blur(1px);
	-moz-filter: blur(1px);
	-o-filter: blur(1px);
	-ms-filter: blur(1px);
	filter: blur(1px);
}

.log, .log > div > div {
	color: #3C3 !important;
	border-color: #3C3;
}

.part, .part > div > div {
	color: #1AC !important;
	border-color: #1AC;
}

.kick, .kick > div > div {
	color: #F33 !important;
	border-color: #F33;
}

.me > div > div {
	color: inherit !important;
}

.log, .part, .me, .kick {
	text-align: center;
}

.bot > :nth-child(2) {
	font-style: italic;
}

.spoiler, .spoiler * {
	-webkit-filter: blur(3px);
	-moz-filter: blur(3px);
	-o-filter: blur(3px);
	-ms-filter: blur(3px);
	filter: blur(3px);
}

.spoiler:hover, .spoiler:hover * {
	-webkit-filter: blur(0px);
	-moz-filter: blur(0px);
	-o-filter: blur(0px);
	-ms-filter: blur(0px);
	filter: blur(0px);
}

.greentext {
	color: #792;
	font-family: monospace;
}

.pinktext {
	color: #F6F;
}

#close:hover {
	background: #F33 !important;
}

#underlay {
	position: fixed;
	opacity: 0.025;
	z-index: 10;
	top: 50px;
	left: 0;
	right: 200px;
	bottom: 50px;
	background-position: center center;
	background-repeat: no-repeat;
	filter: invert(50%) brightness(0%);
}

.pulse {
	-webkit-animation: pulse 200ms forwards;
	animation: pulse 200ms forwards;
}

@-webkit-keyframes pulse {
	50% { opacity: 0.1; }
	100% { opacity: 0.025; }
}
@keyframes pulse {
	50% { opacity: 0.1; }
	100% { opacity: 0.025; }
}

.blur-in {
	-webkit-animation: blurin 500ms forwards;
	animation: blurin 500ms forwards;
}

@-webkit-keyframes blurin {
	0% { -webkit-filter: blur(0px); -moz-filter: blur(0px); -o-filter: blur(0px); -ms-filter: blur(0px); filter: blur(0px); }
	100% { -webkit-filter: blur(3px); -moz-filter: blur(3px); -o-filter: blur(3px); -ms-filter: blur(3px); filter: blur(3px); }
}
@keyframes blurin {
	0% { -webkit-filter: blur(0px); -moz-filter: blur(0px); -o-filter: blur(0px); -ms-filter: blur(0px); filter: blur(0px); }
	100% { -webkit-filter: blur(3px); -moz-filter: blur(3px); -o-filter: blur(3px); -ms-filter: blur(3px); filter: blur(3px); }
}

#overlay {
	display: none;
	z-index: 30;
}

#cover {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.3);
}

#window {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	max-width: 680px;
	max-height: 700px;
	width: 680px;
	height: 700px;
	margin: auto;
	line-height: 1.5em;
	font-size: 25px;
	background: #f9f9f9;
	border: 2px solid #BBB;
}

#window > div:first-child {
	border-bottom: 2px solid #BBB;
	padding-left: 8px;
	height: 40px;
	display: -webkit-box;
	display: -ms-flexbox;
	display: -webkit-flex;
	display: flex;
	-ms-flex-pack: justify;
	justify-content: space-between;
}

#window > div:last-child {
	position: absolute;
	left: 0;
	right: 0;
	padding: 10px 0;
}

#window > div:last-child > div {
	height: 80px;
	padding: 10px 115px;
}

#window > div:last-child > div:nth-last-child(-n+2) {
	text-align: center;
}

#window > div:last-child a {
	text-decoration: underline;
}

#window > div:last-child label {
	display: inline-block;
	padding: 0 10px;
	min-width: 80px;
	width: 80px;
}

#window > div:last-child span {
	display: inline-block;
	width: 165px;
	margin: 0 10px;
	text-align: right;
	white-space: nowrap;
}

input[type=range] {
	vertical-align: middle;
	margin-left: 5px;
	width: 170px;
}

select {
	background: #f9f9f9;
	font-size: 25px;
	border: none;
	outline: 0;
}

#close {
	cursor: pointer;
	text-align: center;
	padding: 7px;
	background: #EEE;
	border-left: 2px solid #BBB;
}

@media screen and (max-width: 680px) {
	head {
		padding-right: 0;
	}

	footer {
		height: 144px;
		max-height: 144px;
	}

	footer > div {
		width: 100px;
	}

	footer > #footer-actions {
		width: 100px;
	}

	#chat-controls {
		height: 100px;
		min-height: 100px;
		-webkit-flex-wrap: wrap;
		flex-wrap: wrap;
	}

	#chat-controls > i {
		-webkit-box-flex: 0;
		-webkit-flex: 0 0 50%;
		-ms-flex: 0 0 50%;
		flex: 0 0 50%;
		height: 50%;
		padding: 0;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	#chat-controls > i:nth-child(odd) {
		border-left: 0;
	}

	#chat-controls > i:nth-child(-n+2) {
		border-bottom: 2px solid #BBB;
	}

	#input {
		height: auto;
		padding: 10px;
		font-size: 40px;
	}

	ul {
		z-index: 25;
		position: absolute;
		right: 0;
		top: 50px;
		bottom: 169px;
		height: auto;
		width: 0px;
		border-top: 2px solid #BBB;
		border-bottom: 2px solid #BBB;
	}

	#window {
		max-height: none;
		width: auto;
		height: auto;
		overflow: auto;
		bottom: 169px;
	}

	#window > div:last-child {
		top: 80px;
	}

	#window > div:last-child, select {
		font-size: 16px;
	}

	#window > div:last-child > div {
		padding: 10px;
		margin: 0 auto;
	}

	#window > div:last-child span {
		width: 115px;
	}

	#window > div:last-child label {
		min-width: 60px;
		width: 60px;
	}

	#underlay {
		right: 0;
	}
}

.comic {
	font-family: 'Comic Sans MS', 'Comic Sans', cursive;
	font-weight: bold;
}

.mono {
	font-family: monospace;
}

.compact #chat > div > div:first-child > img:nth-child(1), .cozy #chat > div > div:first-child > img:nth-child(2), .fat #chat > div > div:first-child > img:nth-child(3) {
	display: block;
}

.compact #chat > div > :first-child {
	width: 40px;
	max-width: 40px;
	max-height: 40px;
}

.fat #chat {
	padding-left: 4px;
}

.fat #chat > div > div:first-child {
	position: absolute;
	top: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
	opacity: 0.1;
	z-index: 21;
	background: transparent !important;
}

.fat #chat > div:not(:first-child) {
	border-top: 2px solid #999;
	border-color: inherit;
}

.fat #chat > div > :nth-child(2) {
	padding-left: 1px;
	z-index: 24;
}

.fat #underlay {
	display: none;
}

.fat #chat > div > :nth-child(2) > div:not(:first-child) {
	color: inherit !important;
}

.console #chat > div > i, .console #chat > div > div:first-child, .console #chat > div > div:first-child > img {
	display: none;
}

.console #chat > div > div:nth-child(2) {
	text-align: left !important;
	padding-left: 5px;
}

.console #chat > div.msg > div:nth-child(2) > div:first-child {
	float: left;
	height: 100%;
}

.console #chat > div.msg > div:nth-child(2) > div:first-child::after {
	content: ':';
	padding-left: 5px;
}

.console #chat > div {
	padding: 0;
}

.console #chat > div > div:last-child {
	line-height: inherit;
	font-size: inherit;
}

.blue main, .blue ul, .blue footer > div, .blue #window, .blue #window > div:first-child {
	border-color: #0074d9;
}

.blue header, .blue #window > div:first-child, .blue #chat-controls > i, .blue footer, .blue #close {
	background: #0074d9;
}

.blue #chat-controls > i, .blue .room-option, .blue #close, .blue #window > div:first-child {
	color: #EEE;
}

.blue #chat-controls > i, .blue .room-option {
	border-color: #EEE;
}

.blue ul > li > i {
	color: #333;
}

.blue #close {
	padding: 5px;
	border-radius: 99px;
	border: 2px solid #DDD;
}

.blue #close:hover {
	background: #0074d9 !important;
	opacity: 0.8;
}

.pink main, .pink ul, .pink footer > div, .pink #window, .pink #window > div:first-child {
	border-color: #F09;
}

.pink header, .pink #window > div:first-child, .pink #chat-controls > i, .pink footer, .pink #close {
	background: #F09;
}

.pink #chat-controls > i, .pink .room-option, .pink #close, .pink #window > div:first-child {
	color: #EEE;
}

.pink #chat-controls > i, .pink .room-option {
	border-color: #EEE;
}

.pink #close {
	padding: 5px;
	border-radius: 99px;
	border: 2px solid #DDD;
}

.pink #close:hover {
	background: #F09 !important;
	opacity: 0.8;
}

.pink, .pink ul, .pink #window, .pink #input, .pink select {
	background: #FCE;
	color: #F09;
}

.pink ::-webkit-scrollbar-track {
	background-color: #FCE;
}

.pink ::-webkit-scrollbar, .pink ::-webkit-scrollbar-thumb {
	background-color: #F09;
}

.pink ::-webkit-scrollbar-track, .pink ::-webkit-scrollbar, .pink ::-webkit-scrollbar-thumb {
	border-color: #FCE;
}

.night #chat > div > :nth-child(2) > div:not(:first-child), .night ul > li > div > div {
	color: #EEE;
}

.night, .night ul, .night #window, .night #input, .night select {
	background: #222;
	color: #EEE;
}

.night ul > li > i, .night select, .night #chat-controls > i, .night .room-option {
	color: #DDD;
}

.night #close, .night #chat > div > div:first-child, .night ul > li > div > div:first-child > div, .night #chat-controls > i:hover {
	background-color: #333;
}

.night main, .night #window > div:first-child, .night footer > div, .night #chat-controls > i, .night .room-option, .night #room-options, .night ul, .night #close, .night #window, .night ul > li > div > div:last-child {
	border-color: #111;
}

.night header, .night #window > div:first-child {
	background: linear-gradient(to bottom, #111 0%, #333 100%);
}

.night footer {
	background: linear-gradient(to bottom, #333 0%, #111 100%);
}

.night ul > li > div {
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 35px, #222 35px, #222 100%);
}

.night #underlay {
  -webkit-filter: invert(50%) brightness(200%);
  filter: invert(50%) brightness(200%);
}

.night ::-webkit-scrollbar-track {
	background-color: #222;
}

.night ::-webkit-scrollbar, .night ::-webkit-scrollbar-thumb {
	background-color: #333;
}

.night ::-webkit-scrollbar-track, .night ::-webkit-scrollbar, .night ::-webkit-scrollbar-thumb {
	border-color: #222;
}

.poker.cozy #chat > div > div:first-child {
	border: 10px solid #FFF;
}

.poker.compact #chat > div > div:first-child {
	border: 5px solid #FFF;
}

.poker #chat > div > div:first-child > img:nth-child(1) {
	left: 0;
	bottom: 3px;
}

.poker #chat > div > div:first-child {
	background-color: #111 !important;
}

.poker #chat > div:nth-child(odd) > div:first-child {
	border-left-color: inherit;
	border-right-color: inherit;
}

.poker #chat > div:nth-child(even) > div:first-child {
	border-top-color: inherit;
	border-bottom-color: inherit;
}

.flip #chat, .flip ul {
	transform: rotate(180deg);
	direction: rtl;
	padding: 5px;
	border: 0;
}

.omg #underlay {
	background-image: url("/img/logo_shiny.svg") !important;
	background-size: 90%
}

.omg header {
	display: none;
}

.omg main {
	border-top: 0;
}

.retro {
	-webkit-filter: grayscale(100%);
	filter: grayscale(100%);
}

.drukqs {
	-webkit-animation: fader 30s infinite;
	animation: fader 30s infinite;
}

@-webkit-keyframes fader {
	0% { -webkit-filter: hue-rotate(0deg); filter: hue-rotate(0deg); }
	50% { -webkit-filter: hue-rotate(180deg); filter: hue-rotate(180deg); }
	100% { -webkit-filter: hue-rotate(360deg); filter: hue-rotate(360deg); }
}
@keyframes fader {
	0% { -webkit-filter: hue-rotate(0deg); filter: hue-rotate(0deg); }
	50% { -webkit-filter: hue-rotate(180deg); filter: hue-rotate(180deg); }
	100% { -webkit-filter: hue-rotate(360deg); filter: hue-rotate(360deg); }
}

html {
	background: #07060c url("/img/royaume.jpg") center 42% / cover no-repeat;
}

body.night {
	background: transparent;
	color: #f2f2f2;
}

body.night header {
	height: 82px;
	max-height: 82px;
	padding-right: 220px;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.15));
	border: 0;
	overflow: visible;
}

body.night header > div {
	margin-top: 4px;
}

body.night main {
	background: transparent;
	border: 0;
}

body.night #underlay {
	display: none;
}

body.night #chat {
	background: linear-gradient(90deg, rgba(4, 3, 10, 0.76), rgba(4, 3, 10, 0.58) 58%, rgba(4, 3, 10, 0.64));
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

body.night #chat > div > div:first-child {
	width: 46px;
	height: 46px;
	min-width: 46px;
	margin: 2px 10px 0;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.22);
	background: rgba(0, 0, 0, 0.55);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
	flex: none;
}

body.night.cozy #chat > div > div:first-child > img:nth-child(2),
body.night.compact #chat > div > div:first-child > img:nth-child(1) {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 28%;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	margin: 0;
}

body.night #chat > div > :nth-child(2) > div:first-child {
	font-weight: 700;
	padding-bottom: 1px;
}

body.night #chat > div > :nth-child(2) > div:not(:first-child) {
	color: #f4f4f4;
	line-height: 1.35;
}

body.night #chat > .msg > :nth-child(3) {
	color: rgba(255, 255, 255, 0.55);
}

body.night ul {
	width: 220px;
	background: rgba(6, 6, 10, 0.84);
	border-left: 1px solid rgba(255, 255, 255, 0.08);
}

body.night ul > li {
	width: 100%;
	height: 42px;
	padding: 0 0 0 8px;
	align-items: center;
	gap: 8px;
	background-image: none;
}

body.night ul > li > img.avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
	object-position: center 28%;
	flex: none;
	background: rgba(0, 0, 0, 0.45);
	border: 1px solid rgba(255, 255, 255, 0.22);
}

body.night ul > li > .nick {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 700;
	font-size: 13px;
	line-height: 42px;
}

body.night ul > li > i {
	flex: none;
	width: 28px;
	overflow: hidden;
	font-size: 22px;
}

body.night ul > li > div {
	top: 90px;
	right: 236px;
	width: 360px;
	color: #eee;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 30px, rgba(14, 14, 18, 0.96) 30px);
	filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.55));
}

body.night ul > li > div > div:last-child {
	background: rgba(14, 14, 18, 0.96);
	border-color: rgba(255, 255, 255, 0.12);
	color: #eee;
}

body.night footer {
	background: rgba(6, 6, 10, 0.94);
	border: 0;
}

body.night footer > div {
	width: 220px;
	border-left-color: rgba(255, 255, 255, 0.08);
}

body.night #input {
	background: transparent;
	color: #fff;
}

body.night #input::placeholder {
	color: rgba(255, 255, 255, 0.62);
}

/* Decorative video stays behind all chat controls. */
#background-video {
	display: none;
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 42%;
	pointer-events: none;
	z-index: 0;
	filter: brightness(0.78);
}
body.night #background-video {
	display: block;
}
@media (prefers-reduced-motion: reduce) {
	body.night #background-video {
		display: none;
	}
}

/* Keep the header node for chat controls, without reserving logo space. */
#head {
	display: none;
}

/* Fit photo portraits to the profile bubble instead of using sprite offsets. */
#userlist > li > div > div:first-child > div > img {
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center;
    transform: none;
}

/* Interactive profile cards live outside the scrolling user list. */
.profile-card {
    position: fixed;
    z-index: 40;
    top: 12px;
    right: 236px;
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 80px);
    overflow: auto;
    padding: 18px;
    border: 1px solid #585267;
    border-radius: 16px;
    background: #16131f;
    color: #f5f3fa;
    box-shadow: 0 16px 50px #0009;
    font: 14px/1.5 Verdana, sans-serif;
    box-sizing: border-box;
}
.profile-card[hidden], .profile-card [hidden], .private-notification[hidden] { display: none; }
.profile-card h2 { margin: 8px 0; font-size: 22px; text-align: center; }
.profile-card h3 { margin: 16px 0 8px; font-size: 15px; }
.profile-card p { margin: 4px 0; }
.profile-card button, .private-notification {
    border: 1px solid #766c8d;
    border-radius: 8px;
    padding: 8px 10px;
    background: #332a46;
    color: #fff;
    cursor: pointer;
    font: inherit;
}
.profile-card button { margin: 5px 5px 5px 0; }
.profile-card button:hover { background: #49395f; }
.profile-card button:disabled { opacity: .5; cursor: default; }
.profile-card :focus-visible, #userlist > li:focus-visible { outline: 2px solid #d5b3ff; outline-offset: 2px; }
.profile-card .profile-close { position: absolute; top: 6px; right: 8px; font-size: 22px; }
.profile-card .profile-portrait {
    display: block;
    width: 84px;
    height: 84px;
    margin: 0 auto;
    border-radius: 50%;
    object-fit: contain;
    object-position: center;
    background: #08070c;
}
.profile-card label { display: block; margin: 8px 0; }
.profile-card input[type=range] { width: 62%; vertical-align: middle; }
.profile-card textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    margin-top: 8px;
    resize: vertical;
    border: 1px solid #766c8d;
    border-radius: 8px;
    background: #0d0b13;
    color: #fff;
    font: inherit;
}
.profile-card audio { display: block; width: 100%; margin: 6px 0; }
.profile-card small, .profile-card .private-status { color: #c9bfdc; }
.private-thread { max-height: 190px; overflow-y: auto; overflow-wrap: anywhere; }
.private-message { padding: 9px; margin: 6px 0; border-radius: 8px; background: #24202f; }
.private-message.sent { background: #302344; }
.private-message p { white-space: pre-wrap; }
.private-message strong { font-size: 11px; color: #c9bfdc; }
.private-notification { position: fixed; z-index: 41; bottom: 66px; right: 236px; max-width: calc(100vw - 24px); }
#userlist > li.has-private .nick::after { content: ' • MP'; color: #e6bbff; }
#userlist > li { cursor: pointer; }
@media (max-width: 650px) {
    .profile-card { right: 12px; }
    .private-notification { right: 12px; bottom: 160px; }
    #footer-actions, body.night #footer-actions { width: 100px; }
}

#room-options {
	gap: 4px;
	padding: 4px;
	border-bottom: 1px solid rgba(100, 100, 120, 0.22);
}

#chat-controls {
	gap: 4px;
	padding: 4px;
}

.toolbar-button {
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
	min-width: 0;
	margin: 0;
	border: 1px solid rgba(255, 255, 255, 0.24);
	border-radius: 11px;
	background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.035));
	box-shadow: inset 0 1px rgba(255, 255, 255, 0.12), 0 3px 8px rgba(0, 0, 0, 0.18);
	color: inherit;
	font: inherit;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

#room-options > .toolbar-button {
	flex: 1 1 0;
	height: 34px;
	padding: 4px;
	border-right: 1px solid rgba(255, 255, 255, 0.24);
}

#chat-controls > .toolbar-button {
	flex: 1 1 0;
	height: 40px;
	padding: 7px;
	cursor: pointer;
}

.toolbar-icon {
	display: block;
	width: 21px;
	height: 21px;
	overflow: visible;
	fill: none;
	stroke: var(--icon-accent, currentColor);
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	filter: drop-shadow(0 0 4px var(--icon-accent, currentColor));
	transition: transform 160ms ease, filter 160ms ease;
}

.toolbar-icon .icon-fill {
	fill: var(--icon-accent, currentColor);
	stroke: none;
}

.room-cinema { --icon-accent: #63d8ff; }
.room-game { --icon-accent: #85f0ad; }
.room-casino { --icon-accent: #ffc96b; }
.room-secret { --icon-accent: #d4a2ff; }
.control-upload { --icon-accent: #85f0ad; }
.control-gallery { --icon-accent: #85f0ad; }
.control-volume { --icon-accent: #70d8ff; }
.control-settings { --icon-accent: #ffc36b; }
.control-users { --icon-accent: #b89aff; }

#composer {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	flex-direction: row;
	align-items: center;
	gap: 8px;
	padding: 0 10px;
	border-left: 0;
}

.composer-attach {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	padding: 9px;
	cursor: pointer;
	--icon-accent: #85f0ad;
}

.composer-attach:hover,
.media-gallery-close:hover {
	transform: translateY(-2px);
	border-color: rgba(255, 255, 255, 0.76);
	background: linear-gradient(145deg, rgba(255, 255, 255, 0.23), rgba(255, 255, 255, 0.07));
}

.composer-attach:active,
.media-gallery-close:active {
	transform: scale(0.95);
}

.chat-attachment {
	max-width: 100%;
	white-space: normal !important;
}

.chat-attachment img,
.chat-attachment video {
	display: block;
	max-width: min(100%, 520px);
	max-height: min(60vh, 480px);
	border-radius: 10px;
	object-fit: contain;
	background: rgba(0, 0, 0, 0.16);
}

.chat-attachment img.chat-image-preview {
	max-width: min(100%, 180px);
	max-height: 120px;
	cursor: zoom-in;
	transition: max-width 160ms ease, max-height 160ms ease;
}

.chat-attachment img.chat-image-preview.chat-image-expanded {
	max-width: min(100%, 520px);
	max-height: min(70vh, 640px);
	cursor: zoom-out;
	object-fit: contain;
}

.chat-attachment img.chat-image-preview:focus-visible {
	outline: 2px solid #85f0ad;
	outline-offset: 3px;
}

#window > div:last-child > .media-reduction-setting label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	width: auto;
	min-width: 0;
	padding: 0 8px;
	line-height: 1.3;
}

#window > div:last-child > .media-reduction-setting {
	text-align: left;
}

.media-gallery[hidden] {
	display: none;
}

.media-gallery {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(5, 4, 10, 0.78);
}

.media-gallery-panel {
	display: flex;
	flex-direction: column;
	width: min(960px, 100%);
	max-height: 88vh;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 16px;
	background: #17151f;
	color: #f5f1ff;
	box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
}

.media-gallery-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.media-gallery-heading h2 {
	margin: 0;
	font-size: 20px;
}

.media-gallery-close {
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	padding: 8px;
	cursor: pointer;
	--icon-accent: #ffc36b;
}

.media-gallery-items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	align-content: start;
	gap: 12px;
	min-height: 100px;
	padding: 16px;
	overflow-y: auto;
}

.media-gallery-card {
	min-width: 0;
	padding: 8px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 11px;
	background: rgba(255, 255, 255, 0.045);
}

.media-gallery-card img,
.media-gallery-card video {
	display: block;
	width: 100%;
	height: 150px;
	border-radius: 7px;
	background: rgba(0, 0, 0, 0.35);
	object-fit: contain;
}

.media-gallery-card a {
	display: block;
	margin-top: 8px;
	color: inherit;
	font-size: 13px;
	text-align: center;
}

.media-gallery-message {
	grid-column: 1 / -1;
	padding: 24px 8px;
	color: #c9bfdc;
	text-align: center;
}

.toolbar-button:disabled {
	opacity: 0.86;
	cursor: not-allowed;
}

#chat-controls > .toolbar-button:hover,
#cinema-actions > .toolbar-button:hover {
	transform: translateY(-2px);
	border-color: rgba(255, 255, 255, 0.76);
	background: linear-gradient(145deg, rgba(255, 255, 255, 0.23), rgba(255, 255, 255, 0.07));
	box-shadow: inset 0 1px rgba(255, 255, 255, 0.18), 0 5px 13px rgba(0, 0, 0, 0.28), 0 0 10px rgba(255, 255, 255, 0.12);
}

#chat-controls > .toolbar-button:hover .toolbar-icon,
#cinema-actions > .toolbar-button:hover .toolbar-icon {
	transform: scale(1.1);
	filter: drop-shadow(0 0 7px var(--icon-accent, currentColor));
}

#chat-controls > .toolbar-button:active,
#cinema-actions > .toolbar-button:active {
	transform: scale(0.95);
}

.control-mic[data-icon="mic_on"] {
	border-color: var(--icon-accent);
	box-shadow: inset 0 0 12px rgba(255, 131, 182, 0.2), 0 0 12px rgba(255, 131, 182, 0.28);
}

.blue .toolbar-button, .pink .toolbar-button {
	background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
	border-color: rgba(255, 255, 255, 0.36);
}

.night .toolbar-button {
	background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.025));
	border-color: rgba(255, 255, 255, 0.13);
}

@media screen and (max-width: 680px) {
	#footer-actions, body.night #footer-actions {
		width: 120px;
	}

	#room-options {
		gap: 3px;
		padding: 4px 3px;
	}

	#room-options > .toolbar-button {
		height: 34px;
		padding: 3px;
		border-right: 1px solid rgba(255, 255, 255, 0.24);
		border-radius: 9px;
	}

	#chat-controls {
		gap: 4px;
		padding: 4px;
		align-content: space-between;
	}

	#chat-controls > .toolbar-button {
		flex: 0 0 calc(50% - 3px);
		height: calc(50% - 4px);
		padding: 5px;
		border-radius: 9px;
	}

	#composer {
		gap: 4px;
		padding: 0 6px;
	}

	.composer-attach {
		flex-basis: 38px;
		width: 38px;
		height: 38px;
		padding: 8px;
	}

	.media-gallery {
		padding: 10px;
	}

	.media-gallery-panel {
		max-height: 92vh;
	}

	.media-gallery-items {
		grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
		gap: 8px;
		padding: 10px;
	}

	.media-gallery-card img,
	.media-gallery-card video {
		height: 120px;
	}

	#window > div:last-child > .media-reduction-setting {
		padding: 10px 4px;
	}

	#window > div:last-child > .media-reduction-setting span {
		width: 92px;
		margin: 0 6px 0 0;
	}

	#window > div:last-child > .media-reduction-setting label {
		padding: 0 4px;
		font-size: 13px;
	}

	.toolbar-icon {
		width: 19px;
		height: 19px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.toolbar-button, .toolbar-icon {
		transition: none;
	}
}

/* SURF and Street Fighter still shrink the chat. Cinema itself is the chat background. */
#head .room-game { position:absolute; right:24px; top:18px; width:auto; display:flex; gap:9px; align-items:center; padding:10px 16px; color:#85f0ad; font-weight:bold; background:#151923; border:1px solid #85f0ad; border-radius:12px; cursor:pointer; }
#head .room-game .toolbar-icon { width:24px; height:24px; }
body.cinema-open #main { position:fixed; top:85px; right:16px; bottom:180px; left:auto; width:350px; margin:0; z-index:12; border:1px solid #8675ba; border-radius:16px; background:rgba(15,18,30,.97); }
body.cinema-open #chat { width:100%; }
body.cinema-open #userlist { display:none; }
body.cinema-open #foot { position:fixed; left:auto; right:16px; bottom:12px; width:350px; z-index:13; box-sizing:border-box; }
@media(max-width:850px) {
    body.cinema-open #main { top:55vh; bottom:150px; left:8px; right:8px; width:auto; }
    body.cinema-open #foot { left:8px; right:8px; width:auto; }
}

#chat-stage {
	position: relative;
	flex: 1 1 0%;
	min-width: 0;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

#chat-stage > #chat {
	min-height: 0;
}

#cinema[hidden] { display: none !important; }

body.cinema-screen #cinema {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: #000;
	pointer-events: none;
	overflow: hidden;
}

#cinema-stage,
body.cinema-screen #cinema-video,
body.cinema-screen #cinema-youtube,
body.cinema-screen #cinema-youtube iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

body.cinema-screen #cinema-video {
	object-fit: contain;
	background: #000;
}

body.cinema-screen #chat,
body.night.cinema-screen #chat {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	background: transparent;
}

body.cinema-screen #chat::before {
	content: "";
	flex: 1 0 0;
	min-height: 0;
}

body.cinema-screen #chat > div {
	flex: none;
	align-self: flex-start;
	width: fit-content;
	min-width: 0;
	max-width: min(720px, calc(100% - 16px));
	margin: 4px 8px;
	padding: 2px 4px;
	border-radius: 14px;
	background: rgba(8, 6, 14, 0.62);
	color: #f4f2ff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
	transition: opacity 420ms ease;
}

body.cinema-screen #chat > div > :nth-child(2) > div:not(:first-child),
body.night.cinema-screen #chat > div > :nth-child(2) > div:not(:first-child) {
	color: #f7f4ff;
}

body.cinema-screen #chat > .msg > :nth-child(3) {
	color: rgba(255, 255, 255, 0.72);
}

body.cinema-screen #chat > div.cinema-fade {
	opacity: 0;
	pointer-events: none;
}

#cinema-controls[hidden] { display: none !important; }

#cinema-controls {
	display: flex;
	flex: 1 0 100%;
	flex-direction: row;
	align-items: center;
	gap: 8px;
	width: 100%;
	height: auto;
	padding: 6px 8px;
	border-bottom: 1px solid rgba(100, 100, 120, 0.22);
	border-left: 0;
}

#cinema-status {
	display: -webkit-box;
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	max-height: 2.4em;
	overflow: hidden;
	color: inherit;
	font-size: 12px;
	line-height: 1.2;
	line-clamp: 2;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

body.cinema-screen #footer-actions {
	height: auto;
}

body.cinema-screen #sf2-open {
	flex: 0 0 auto;
	height: 36px;
}

#cinema-actions {
	display: flex;
	flex: 0 0 auto;
	gap: 4px;
	margin-left: auto;
	--icon-accent: #63d8ff;
}

#cinema-actions > .toolbar-button {
	flex: 0 0 44px;
	width: 44px;
	height: 40px;
	padding: 8px;
	cursor: pointer;
}

#cinema-actions > .toolbar-button[aria-pressed="true"] {
	border-color: #63d8ff;
	box-shadow: inset 0 0 12px rgba(99, 216, 255, 0.25), 0 0 10px rgba(99, 216, 255, 0.28);
}

body.cinema-screen #cinema-open {
	cursor: pointer;
	border-color: #63d8ff;
	box-shadow: inset 0 0 12px rgba(99, 216, 255, 0.25), 0 0 10px rgba(99, 216, 255, 0.28);
}

#cinema-open { cursor: pointer; }

#cinema-actions > .toolbar-button:focus-visible,
#cinema-link button:focus-visible,
#cinema-url:focus-visible {
	outline: 2px solid #63d8ff;
	outline-offset: 2px;
}

#cinema-link-popover {
	display: none;
	position: fixed;
	inset: auto;
	z-index: 40;
	flex: none;
	width: min(360px, calc(100vw - 16px));
	height: auto;
	margin: 0;
	padding: 12px;
	border: 1px solid rgba(255, 255, 255, 0.24);
	border-radius: 12px;
	background: #17151f;
	color: #f4f2ff;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

#cinema-link-popover:is(:popover-open, .\:popover-open) {
	display: block;
	position: fixed;
	inset: auto;
	height: auto;
	margin: 0;
}

#cinema-link-popover[hidden] { display: none; }

#cinema-link {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
}

#cinema-link p {
	margin: 0;
	color: #c9c2dc;
	font-size: 12px;
	line-height: 1.35;
}

.cinema-link-row {
	display: flex;
	gap: 8px;
}

#cinema-url {
	flex: 1;
	min-width: 0;
	padding: 8px 10px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 8px;
	background: #0e0c14;
	color: inherit;
	font: inherit;
}

#cinema-link button[type="submit"] {
	padding: 8px 12px;
	border: 0;
	border-radius: 8px;
	background: #63d8ff;
	color: #081018;
	font: inherit;
	cursor: pointer;
}

body.cinema-screen footer,
body.night.cinema-screen footer {
	flex: 0 0 auto;
	flex-wrap: wrap;
	height: auto;
	max-height: none;
}

@media screen and (max-width: 680px) {
	#cinema-controls {
		gap: 6px;
		padding: 6px;
	}

	#cinema-actions > .toolbar-button {
		flex-basis: 40px;
		width: 40px;
		height: 40px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.cinema-screen #chat > div {
		transition: none;
	}
}

/* Show the SURF entry in the previously hidden header without reserving space. */
#head {
    display: block;
    position: fixed;
    inset: 0 0 auto auto;
    width: 0;
    height: 0;
    min-height: 0;
    padding: 0 !important;
    border: 0;
    background: transparent;
    overflow: visible;
    pointer-events: none;
}
#head .room-game { pointer-events: auto; }

/* Place SURF immediately above the footer icon rows. */
#head { display: none; }
#footer-actions { position: relative; overflow: visible; }
#footer-actions > #surf-open {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px;
    color: #85f0ad;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: auto;
    cursor: pointer;
}
