body {
  background-color: black;
  overflow: hidden;
  user-select: none;
  font-family: "Rajdhani", sans-serif;
  z-index: -20;
}

h1 {
color: red;
position: absolute;
top: 10%;
width: 100%;
text-align: center;
}

#pausescreen {
  visibility: hidden;
  color: #f0f8ff;
  background-color: rgba(0, 0, 0, 0.556);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  font-size: 40px;
}

#statcontainer {
color: #04ff00;
background-color: #373e435f;
font-weight: bold;
position: absolute;
top: 0;
right: 0;
z-index: 100;  /* Ensure UI is above the canvas container */
text-align: left;
padding: 0;
margin: 0;
pointer-events: none;
}

/* 
The container wraps all canvases and preserves a 16:9 aspect ratio.
It scales down proportionally so that if the viewport is too narrow,
the container’s width fills 100vw (and height = 100vw * 9/16),
and if the viewport is too short, the container’s height fills 100vh (and width = 100vh * 16/9).
*/
#canvasContainer {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background-color: black;
overflow: hidden;
z-index: 0;
/* Default intrinsic size */
width: 1280px;
height: 720px;
}

/* If viewport aspect ratio is less than 16:9 (i.e. too narrow), use full viewport width */
@media (max-aspect-ratio: 16/9) {
#canvasContainer {
  width: 100vw;
  height: calc(100vw * 9 / 16);
}
}

/* If viewport aspect ratio is greater than 16:9 (i.e. too short), use full viewport height */
@media (min-aspect-ratio: 16/9) {
#canvasContainer {
  height: 100vh;
  width: calc(100vh * 16 / 9);
}
}

#canvastream:focus {
outline: none;
}

#canvastream:hover {
  
}

/* Video canvas fills the container */
#canvastream {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
outline: none;
}

/* Mouse canvas used by mouseworker (fullscreen overlay) fills the container */
#mousecanvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 20;
outline: none;
pointer-events: none;
}

/* Cheat canvas for local mouse drawing (non-fullscreen) fills the container */
#mousecheat {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
outline: none;
pointer-events: none;
}

#fullscreenbutton {
position: absolute;
top: 5px;
left: 5px;
width: 40px;
height: 40px;
z-index: 100;  /* UI element above the canvas container */
filter: invert(100%) sepia(94%) saturate(2606%) hue-rotate(179deg) brightness(102%) contrast(123%);
}

#menutab {
  position: absolute;
  top: 25%;
  left: 0;
  height: 80px;
  width: 10px;
  background-color: white;
  cursor: pointer;
  z-index: 100;
}

#menu {
  position: absolute;
  top: 25%;
  height: auto;
  width: 250px;
  background-color: #808688;
  transition: width 0.3s;
  overflow: hidden;
  border-color: white;
  border-style: solid;
  border-top: 0;
  border-width: 2px;
  transform: translateX(-250px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 20px;
  z-index: 100;
}

#menubar {
  top: 0;
  height: 20px;
  width: 100%;
  background-color: white;
}

#homescreen {
  width: 100vw;
  height: 100vh;
  background-color: #373e43;
  position: absolute;
}

.line {
width: 90%;
height: 2px;
background-color: white;
margin-top: 10px;
}

.divtext {
width: 90%;
margin-bottom: 2px;
color: white;
font-weight: bolder;
font-size: 20px;
}

.menutext {
  font-size: 15px;
  text-align: center;
  color: #e2e2e2;
  margin-top: 5px;
  margin-left: 10px;
  width: 200px;
  font-weight: bold;
  overflow: hidden;
}

.menubutton {
text-align: center;
height: 14px;
font-size: 12px;
width: 100px;
margin-top: 5px;
margin-left: 10px;
padding: 4px;
border-color: #373e43;
border-width: 2px;
border-style: solid;
background-color: #a6acb0;
overflow: hidden;
cursor: pointer;
justify-content: center;
}

.menubutton:hover {
text-align: center;
height: 14px;
font-size: 12px;
width: 102px;
margin-top: 5px;
margin-left: 10px;
padding: 4px;
border-color: #373e43;
border-width: 2px;
border-style: solid;
background-color: #8a8f92;
overflow: hidden;
cursor: pointer;
}

.menubutton:active {
font-size: 11px;
}

.menuinput {
text-align: center;
width: 100px;
height: 18px;
margin-top: 5px;
margin-right: 2px;
}

.menucontainer {
display: flex;
flex-direction: column;
align-items: center;
}

.menui {
display: flex;
justify-content: space-between;
width: 80%;
padding: 0 20px;
}

.qualitymenucontainer {
display: flex;
flex-direction: column;
align-items: center;
}

.move-right {
animation: moveRight 0.3s forwards;
}

.move-back {
animation: moveBack 0.3s forwards;
}

@keyframes moveRight {
from { transform: translateX(0); }
to { transform: translateX(262px); }
}

@keyframes moveBack {
from { transform: translateX(262px); }
to { transform: translateX(0); }
}

@keyframes moveRightBOX {
from { transform: translateX(-262px); }
to { transform: translateX(0); }
}

@keyframes moveBackBOX {
from { transform: translateX(0); }
to { transform: translateX(-262px); }
}

.move-rightbox {
animation: moveRightBOX 0.3s forwards;
}

.move-backbox {
animation: moveBackBOX 0.3s forwards;
}
