 body,
 html {
     margin: 0;
     padding: 0;
     width: 100%;
     height: 100dvh;
     overflow: hidden;
     font-family: sans-serif;
     background: #222;
     color: #fff;
 }

 .screen {
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100dvh;
     display: flex;
     flex-direction: column;
     align-items: flex-start;
     justify-content: flex-end;
     padding: 3rem;
     box-sizing: border-box;

     background-image: url('./assets/splash.png');
     background-size: cover;
     background-position-y: center;
     z-index: 10;
     user-select: none;
     -moz-user-select: none;


     font-family: "Jersey 10", sans-serif;
     font-weight: 400;
     font-style: normal;

     animation: wiggle 0.5s infinite;

 }



 @keyframes wiggle {
     0% {
         background-position-y: center;
     }

     50% {
         background-position-y: 49%;
     }

     100% {
         background-position-y: center;
     }
 }


 .hidden {
     display: none !important;
 }

 .screen h1,
 #pauseOverlay h2 {
     position: absolute;
     top: 40px;
     left: 60px;
     margin: 0;
     padding: 0;

     font-size: 5rem;
     letter-spacing: 5px;
 }



 .btn-group {
     display: flex;
     flex-direction: column;
 }

 button {
     font-size: 2rem;
     font-family: "Jersey 10", sans-serif;
     font-weight: 400;
     font-style: normal;
     text-align: left;

     background: none;
     padding: 10px 20px;
     flex: 1;
     border: none;
     border-radius: 5px;
     outline: none;
     color: #e0e0e0;
     cursor: pointer;

     transition: transform 0.2s ease-in;
 }

 button:focus {
     transform: translateY(-3px);
     color: #fff;
 }

 button:hover {
     transform: translateY(-3px);
     color: #fff;
 }

 #gameContainer {
     position: relative;
     width: 100%;
     height: 100dvh;
     display: grid;
     place-items: center;
 }

 #gameCanvas {
     display: block;
     background: #444;
     height: 100%;
     width: 100%;

     image-rendering: pixelated;
 }


 
 .pause-button {
     position: absolute;
     top: 16px;
     right: calc(50% - 40px);
     width: 40px;
     height: 40px;
     border: none;
     border-radius: 4px;
     background: rgba(0, 0, 0, 0.5);
     color: #fff;
     font-size: 18px;
     cursor: pointer;
     z-index: 5;


     padding: 0;
     display: grid;
     place-items: center;
     outline: none;

 }

 .pause-button:hover,
 .pause-button:active {
     background: rgba(0, 0, 0, 0.7);
     transform: translateY(0);
 }



 #settingsScreen h2 {
     letter-spacing: 10px;
     font-size: 3rem;
     padding: 0;
     margin: 0 0 2rem 0;
 }

 #settingsScreen {
     background-image:
         linear-gradient(to right, rgb(0, 0, 0), rgba(0, 0, 0, 0.5)),
         url('./assets/splash.png');
 }

 .settings-form {
     display: flex;
     flex-direction: column;
     align-items: flex-start;
     margin-left: 2rem;
 }

 .settings-form label {
     margin: 8px 0 4px;
     font-size: 1.3rem;
     letter-spacing: 5px;
 }

 .settings-form input[type="range"],
 .settings-form select {
     margin-bottom: 12px;
 }

 .settings-form select {
     outline: none;
     padding: 8px 12px;
     background-color: #222;
     color: #e0e0e0;
     border-radius: 6px;
     transition: border 0.2s ease;
 }

 .settings-form select:hover {
     border: 1px solid #bdbdbd;
 }

 .settings-form select:focus {
     outline: 1px solid #bdbdbd;
 }

 #settingsBackButton,
 #instructionsBackButton {
     margin-top: 2rem;
     padding: 5px 20px;
     flex: 0;
 }

 #instructionsScreen {
     display: flex;
     flex-direction: column;
     justify-content: flex-start;
     background-image:
         linear-gradient(to right, rgb(0, 0, 0), rgba(0, 0, 0, 0.5)),
         url('./assets/splash.png');
 }

 #instructionsScreen p {
     margin: 0;
     font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif
 }

 #instructionsScreen h2 {
     font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
 }



 /* Mobile controls overlay */
 #mobileControls {
     position: absolute;
     bottom: 20px;
     left: 0;
     width: 100%;
     height: 150px;
     z-index: 20;
 }


 .touch-button {
     position: absolute;
     width: 80px;
     height: 80px;
     background: rgba(255, 255, 255, 0.3);
     border-radius: 50%;
     touch-action: none;
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 24px;
     color: #fff;
     user-select: none;
     transition: transform 0.2s ease;
 }

 .touch-button:active,
 .touch-button:active,
 .touch-button:focus {
     background-color: #222;
 }


 #btnLeft {
     left: 20px;
     bottom: 20px;
 }

 #btnRight {
     left: 130px;
     bottom: 20px;
 }

 #btnJump {
     right: 130px;
     bottom: 20px;
 }

 #btnAttack {
     right: 20px;
     bottom: 20px;
 }

 #btnBlock {
     right: 20px;
     bottom: 130px;
 }

 #rotateOverlay {
     position: fixed;
     top: 0;
     left: 0;
     right: 0;
     bottom: 0;
     background: rgba(0, 0, 0, 0.9);
     color: white;
     display: none;
     align-items: center;
     justify-content: center;
     text-align: center;
     padding: 20px;
     z-index: 9999;
     flex-direction: column;
 }

 @media screen and (orientation: landscape) and (max-height: 500px) {
     .screen {
         padding: 2rem;
         justify-content: flex-end;
     }

     .screen h1 {
         font-size: 2.5rem;
         top: 2rem;
         left: 3rem;
     }

     .btn-group button {
         font-size: 1.2rem;
         padding: 8px 16px;
     }

     #settingsScreen h2 {
         font-size: 1.5rem;
         letter-spacing: 5px;
     }

     .settings-form {
         margin-left: 1rem;
         max-height: 70vh;
         overflow-y: auto;

     }

     .settings-form label {
         font-size: 1rem;
         letter-spacing: 3px;
     }
 }

 
 .instructions-screen,
 #instructionsScreen {
     overflow-y: auto;
 }

 
 @media screen and (max-height: 500px) {
     @keyframes wiggle {

         0%,
         100% {
             background-position-y: center;
         }

         50% {
             background-position-y: 49.5%;
         }
     }
 }