@font-face {
	font-family: "Comfortaa";
	src: url("fonts/Comfortaa-Regular.otf") format("opentype");
}

@font-face {
	font-family: "Open Sans";
	src: url("fonts/OpenSans-Regular.ttf") format("truetype");
	font-weight: normal;
}

@font-face {
	font-family: "Open Sans";
	src: url("fonts/OpenSans-Bold.ttf") format("truetype");
	font-weight: bold;
}

:root {
	--primary: #6366f1;
	--primary-glow: rgba(99, 102, 241, 0.5);
	--secondary: #22d3ee;
	--queue-color: #f59e0b;
	--queue-glow: rgba(245, 158, 11, 0.4);
}

* { box-sizing: border-box; }
html { background: #0a0a0a; }
body, html { padding: 0; margin: 0; width: 100%; height: 100%; }

body {
	font-family: "Open Sans", sans-serif;
	-webkit-font-smoothing: antialiased;
	font-size: 16px;
	color: #fff;
	overflow: hidden;
	opacity: 0;
	transition: opacity 0.3s ease;
}

body.loaded { opacity: 1; }
.hidden { display: none !important; }

video { display: block; object-fit: cover; width: 100%; height: 100%; }

#video-container {
	position: fixed;
	left: 0; top: 0;
	width: 100%; height: 100%;
	z-index: -2;
}

#player { position: absolute; z-index: -99; display: none; }

#overlay {
	position: fixed;
	left: 0; top: 0;
	width: 100%; height: 100%;
	z-index: -1;
	background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.7) 100%);
}

#header {
	position: absolute;
	top: 40px; left: 40px;
	z-index: 10;
}

#title {
	font-family: "Comfortaa", sans-serif;
	font-size: 56px;
	font-weight: bold;
	text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

#title img { display: block; max-height: 80px; filter: drop-shadow(0 4px 20px rgba(0,0,0,0.5)); }
.center #header { left: 50%; transform: translateX(-50%); text-align: center; }
.center #title-image { margin: 0 auto; }

#subtitle {
	margin-top: 12px;
	display: none;
	font-size: 14px;
	color: rgba(255,255,255,0.7);
}

#queue-container {
	position: fixed;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	z-index: 100;
	text-align: center;
	animation: queueFadeIn 0.5s ease-out;
}

@keyframes queueFadeIn {
	from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
	to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#queue-card {
	display: flex;
	align-items: center;
	gap: 24px;
	background: linear-gradient(135deg, rgba(245,158,11,0.15) 0%, rgba(245,158,11,0.05) 100%);
	border: 1px solid rgba(245,158,11,0.3);
	border-radius: 20px;
	padding: 24px 40px;
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	box-shadow: 0 0 60px var(--queue-glow), 0 20px 60px rgba(0,0,0,0.4);
	animation: queuePulse 3s ease-in-out infinite;
}

@keyframes queuePulse {
	0%, 100% { box-shadow: 0 0 60px var(--queue-glow), 0 20px 60px rgba(0,0,0,0.4); }
	50% { box-shadow: 0 0 80px var(--queue-glow), 0 20px 60px rgba(0,0,0,0.4); }
}

#queue-icon {
	width: 56px; height: 56px;
	color: var(--queue-color);
}

#queue-icon svg { width: 100%; height: 100%; }

#queue-icon .clock-minute {
	transform-origin: 12px 12px;
	animation: clockMinute 4s linear infinite;
}

#queue-icon .clock-hour {
	transform-origin: 12px 12px;
	animation: clockHour 48s linear infinite;
}

@keyframes clockMinute {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

@keyframes clockHour {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

#queue-info { text-align: left; }
#queue-title { font-size: 24px; font-weight: bold; color: var(--queue-color); margin-bottom: 4px; }
#queue-subtitle { font-size: 14px; color: rgba(255,255,255,0.7); }

#queue-position-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-left: 24px;
	border-left: 1px solid rgba(245,158,11,0.3);
}

#queue-position-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	color: rgba(255,255,255,0.5);
	margin-bottom: 4px;
}

#queue-position {
	font-size: 48px;
	font-weight: bold;
	line-height: 1;
	text-shadow: 0 0 30px var(--queue-glow);
}

#queue-message {
	margin-top: 20px;
	font-size: 14px;
	color: rgba(255,255,255,0.7);
	animation: queueMessagePulse 2s ease-in-out infinite;
}

@keyframes queueMessagePulse {
	0%, 100% { opacity: 0.7; }
	50% { opacity: 1; }
}

body.in-queue #status-container {
	opacity: 0.3;
	transform: translateX(-50%) translateY(80px);
}

#queue-info-callout {
	display: none;
	position: fixed;
	bottom: 14vh;
	right: 1.5vw;
	max-width: 20vw;
	z-index: 100;
}

body.in-queue #queue-info-callout {
	display: block;
	animation: calloutFadeIn 0.5s ease-out 1s both;
}

@keyframes calloutFadeIn {
	from { opacity: 0; transform: translateX(20px); }
	to { opacity: 1; transform: translateX(0); }
}

#queue-info-text {
	position: relative;
	background: linear-gradient(135deg, rgba(245,158,11,0.2) 0%, rgba(245,158,11,0.1) 100%);
	border: 1px solid rgba(245,158,11,0.4);
	border-radius: 0.8vw;
	padding: 1vw;
	font-size: 0.9vw;
	line-height: 1.5;
	color: rgba(255,255,255,0.9);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

#queue-info-text strong {
	color: var(--queue-color);
	display: block;
	margin-bottom: 0.4vw;
	font-size: 1vw;
}

#queue-info-arrow {
	width: 2vw;
	height: 2vw;
	color: var(--queue-color);
	flex-shrink: 0;
	position: absolute;
	bottom: -2.5vw;
	left: 1vw;
	animation: arrowBounce 1s ease-in-out infinite;
}

#queue-info-arrow svg {
	width: 100%;
	height: 100%;
	transform: rotate(90deg);
}

@keyframes arrowBounce {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(0.5vw); }
}

#status-container {
	position: fixed;
	bottom: 100px;
	left: 50%;
	transform: translateX(-50%);
	width: 90%;
	max-width: 600px;
	transition: all 0.5s ease;
}

#status-text {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
	font-size: 14px;
}

#status-left { color: rgba(255,255,255,0.7); font-weight: 500; }
#status-right { font-size: 24px; font-weight: bold; font-variant-numeric: tabular-nums; }

#loading {
	position: relative;
	width: 100%;
	height: 6px;
	background: rgba(255,255,255,0.1);
	border-radius: 10px;
	overflow: hidden;
}

#loading-progress {
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, var(--primary), var(--secondary));
	border-radius: 10px;
	transition: width 0.3s ease-out;
}

#loading-glow {
	position: absolute;
	top: 0; left: 0;
	width: 100%; height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
	transform: translateX(-100%);
	animation: loadingShimmer 2s infinite;
}

@keyframes loadingShimmer { 100% { transform: translateX(100%); } }

#file-info {
	margin-top: 12px;
	font-size: 12px;
	color: rgba(255,255,255,0.5);
	text-align: center;
	min-height: 18px;
}

#messages {
	margin-top: 16px;
	font-size: 16px;
	line-height: 1.5;
	color: rgba(255,255,255,0.7);
	text-align: center;
	min-height: 48px;
}

#music {
	position: fixed;
	left: 40px; bottom: 40px;
	display: none;
	align-items: center;
	gap: 16px;
	padding: 16px 24px;
	background: rgba(255,255,255,0.05);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 16px;
	backdrop-filter: blur(10px);
	max-width: 350px;
}

#music-icon {
	width: 32px; height: 32px;
	color: var(--primary);
	animation: musicPulse 1.5s ease-in-out infinite;
}

#music-icon svg { width: 100%; height: 100%; }

@keyframes musicPulse {
	0%, 100% { transform: scale(1); opacity: 0.8; }
	50% { transform: scale(1.1); opacity: 1; }
}

#music-details { min-width: 0; }
#music-details > span { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.5); display: block; margin-bottom: 4px; }
#music-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#enable-audio {
	position: fixed;
	left: 40px; bottom: 40px;
	display: none;
	align-items: center;
	gap: 12px;
	padding: 16px 24px;
	background: linear-gradient(135deg, var(--primary), #4f46e5);
	border-radius: 16px;
	color: white;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 4px 20px var(--primary-glow);
}

#enable-audio:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--primary-glow); }
#enable-audio svg { width: 24px; height: 24px; }

#error-box { position: fixed; top: 40px; right: 40px; max-width: 400px; z-index: 200; }

.error {
	position: relative;
	padding: 16px 20px;
	background: linear-gradient(135deg, rgba(239,68,68,0.9), rgba(220,38,38,0.9));
	border-radius: 12px;
	margin-bottom: 12px;
	backdrop-filter: blur(10px);
	box-shadow: 0 4px 20px rgba(239,68,68,0.3);
	animation: errorSlide 0.3s ease-out;
}

@keyframes errorSlide {
	from { opacity: 0; transform: translateX(20px); }
	to { opacity: 1; transform: translateX(0); }
}

.error-title { font-weight: bold; margin-bottom: 8px; font-size: 14px; }
.close-button { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-weight: bold; cursor: pointer; opacity: 0.7; border-radius: 4px; }
.close-button:hover { opacity: 1; background: rgba(255,255,255,0.1); }

#warn {
	display: none;
	position: fixed;
	width: 100%; height: 100%;
	z-index: 999;
	background: linear-gradient(135deg, #0f0f0f, #1a1a2e);
	color: white;
	padding: 60px;
	top: 0; left: 0;
}

#warn h1 { margin-top: 0; font-size: 32px; color: #ef4444; }
#warn p { font-size: 16px; color: rgba(255,255,255,0.7); line-height: 1.6; }

.center { text-align: center; }
.gamemode, .map { font-style: italic; color: var(--secondary); }

@media (max-width: 768px) {
	#header { top: 24px; left: 24px; }
	#title { font-size: 36px; }
	#status-container { bottom: 60px; width: 85%; }
	#queue-card { flex-direction: column; gap: 16px; padding: 24px; }
	#queue-position-wrapper { padding-left: 0; padding-top: 16px; border-left: none; border-top: 1px solid rgba(245,158,11,0.3); }
	#music, #enable-audio { left: 24px; bottom: 24px; }
}
