.ejs_parent {
    background: #000;
    overflow: hidden;
    position: relative;
    font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    font-weight: 500;
    line-height: 1.7;
    width: 100%;
    height: 100%;
    color: #bcbcbc;
    outline-width: 0;
    outline: none;
    font-size: 14px;
}

.ejs_parent *, .ejs_parent *::after, .ejs_parent *::before {
    font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.ejs_parent ::-webkit-scrollbar{
    width: 8px;
    height: 16px;
}
.ejs_parent ::-webkit-scrollbar-thumb{
    border-radius: 10px;
    background: rgba(var(--ejs-primary-color));
}
.ejs_parent ::-webkit-scrollbar-track{
    border-radius: 10px;
    background: rgba(64, 64, 64, 0.5)
}

.ejs_ad_iframe {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    transform: translate(-50%, -50%);
}
.ejs_ad_close {
    cursor: pointer;
}
.ejs_ad_close:after {
    content: "";
    position: absolute;
    border-left: 20px solid transparent;
    border-right: 20px solid #a7a7a77d;
    border-top: 20px solid #a7a7a77d;
    border-bottom: 20px solid transparent;
    right: 0;
}
.ejs_ad_close a {
    right: 4px;
    top: 4px;
    position: absolute;
    border: 0;
    padding: 0;
    width: 15px;
    height: 15px;
    z-index: 99;
}
.ejs_ad_close a:before {
    content: "";
    border-bottom: 1px solid #fff;
    transform: rotate(45deg) translateY(-45%);
    width: 15px;
    height: 15px;
    display: block;
    position: absolute;
    top: 0;
    right: 0;
}
.ejs_ad_close a:after {
    content: "";
    border-bottom: 1px solid #fff;
    width: 15px;
    height: 15px;
    display: block;
    position: absolute;
    right: 0;
    background: transparent;
    top: 0;
    transform: rotate(-45deg) translateY(-50%) translateX(0);
}

.ejs_game {
    width: inherit;
    height: inherit;
    background-color: var(--ejs-background-color);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.ejs_game_background {
    background-image: var(--ejs-background-image);
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
    text-align: -webkit-auto;
}

.ejs_game_background_blur:before,
.ejs_game_background_blur:after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--ejs-background-image);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.ejs_game_background_blur:before {
  background-size: cover;
  filter: blur(10px);
  transform: scale(1.1);
}

.ejs_start_button {
    position: absolute;
    bottom: 65px;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    box-sizing: inherit;
    display: flex;
    justify-content: center;
    text-shadow: 0 1px 1px rgba(0,0,0,0.5);
    font-size: 20px;
    line-height: 45px;
    text-transform: uppercase;
    font-weight: bolder;
    position: relative;
    text-decoration: none;
    width: fit-content;
    padding-left: 40px;
    padding-right: 40px;
    white-space: nowrap;
    height: 45px;
    border: 0;
    color: #fff !important;
    border-radius: 35px;
    text-align: center;
    background-color: rgba(var(--ejs-primary-color),1);
    box-shadow: 0 0 0 0 #222, 0 0px 0px 0 #111, inset 0 0px 0px 0 rgba(250,250,250,0.2), inset 0 0px 0px 0px rgba(0,0,0,0.5);
}

.ejs_start_button_border {
    border: 0.5px solid #333;
}

.ejs_start_button:active, .ejs_start_button:hover {
    animation: ejs_start_button_pulse 2s infinite;
}

@keyframes ejs_start_button_pulse {
    50% {
      box-shadow: 0 0 0 0 #222, 0 3px 7px 0 #111, inset 0 1px 1px 0 rgba(250,250,250,0.2), inset 0 0px 15px 1px rgba(0,0,0,0.5);
    }
    0%, 100% {
      box-shadow: 0 0 0 0 #222, 0 0px 0px 0 #111, inset 0 0px 0px 0 rgba(250,250,250,0.2), inset 0 0px 0px 0px rgba(0,0,0,0.5);
    }
  }

.ejs_loading_text {
    position: absolute;
    bottom: 20px;
    font-weight: 500;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: inherit;
    font-size: 12px;
    color: #bcbcbc;
}

.ejs_loading_text_glow {
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 10px;
    padding: 1px 5px 1px 5px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
}

.ejs_canvas {
    width: 100%;
    height: 100%;
}

.ejs_context_menu {
    position: absolute;
    display: none;
    z-index: 9;
    background: rgba(16,16,16,0.9);
    border-radius: 3px;
    font-size: 13px;
    min-width: 140px;
    padding: 8px;
    box-sizing: inherit;
}

.ejs_context_menu li {
    padding: 4px 11px;
    text-align: center;
}

.ejs_context_menu li a {
    color: #999;
    display: block;
    font-size: 13px;
}
.ejs_context_menu ul {
    color: #999;
    display: block;
    font-size: 13px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ejs_context_menu li:hover {
    background: rgba(var(--ejs-primary-color),1);
    border-radius: 4px;
    box-shadow: 0 0 0 5px rgba(var(--ejs-primary-color),0.5);
    outline: 0;
}
.ejs_context_menu li:hover a {
    color: #fff;
}

.ejs_list_selector {
    background: rgba(0,0,0,0.5);
    border-radius: 3px;
    font-size: 13px;
    min-width: 140px;
    padding: 8px;
    box-sizing: inherit;
    float: left;
    position: absolute;
    width: 10%;
    max-width: 15%;
    top: 10%;
    left: 0px;
    height: 80%;
    overflow: auto;
}

.ejs_list_selector li {
    padding: 4px 11px;
    text-align: center;
}

.ejs_list_selector li a {
    color: #999 !important;
    display: block;
    font-size: 13px;
}
.ejs_list_selector ul {
    color: #999 !important;
    display: block;
    font-size: 13px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ejs_list_selector li:hover {
    background: rgba(var(--ejs-primary-color),1);
    border-radius: 4px;
    box-shadow: 0 0 0 5px rgba(var(--ejs-primary-color),0.5);
    outline: 0;
}
.ejs_list_selector li:hover a {
    color: #fff !important;
}

.ejs_svg_rotate {
    transform: rotate(90deg);
}
.ejs_small_screen .ejs_settings_parent::before {
    border: none;
}
.ejs_small_screen .ejs_settings_parent::after {
    border: none;
}
.ejs_small_screen .ejs_settings_center_right {
    right: -35%
}
.ejs_small_screen .ejs_settings_center_left {
    right: -135%
}
.ejs_small_screen .ejs_settings_center_right::after {
    right: 25%;
}
.ejs_small_screen .ejs_settings_center_left::after {
    left: 25%;
}
.ejs_small_screen .ejs_menu_bar {
    transition: opacity .4s ease-in-out,transform .4s ease-in-out;
    position: absolute;
    transform: translate(-50%,0);
    width: 300px;
    max-height: 260px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    background: rgba(0,0,0,.9);
    padding: 10px;
    z-index: 9999;
    left: 50%;
    bottom: 0;
}
.ejs_small_screen .ejs_menu_bar_hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 100%);
}
.ejs_small_screen .ejs_menu_button {
    width: 135px;
    margin: 0px;
    margin-left: 2px!important;
    margin-right: 0!important;
    line-height: 1;
    background: 0 0;
    border: 0;
    border-radius: 3px;
    color: inherit;
    cursor: pointer;
    flex-shrink: 0;
    overflow: visible;
    padding: 7px;
    position: relative;
    transition: all .3s ease;
}
.ejs_small_screen .ejs_menu_button:hover {
    background: rgba(var(--ejs-primary-color),1);
    color: #fff;
}
.ejs_small_screen .ejs_menu_button svg {
    float: left;
    transition: transform .3s ease;
}
.ejs_small_screen .ejs_menu_text {
    position: static;
    color: #fff;
    background: 0 0;
    opacity: 1;
    padding: 0;
    transform: scale(.8)!important;
    font-size: 12px;
}
.ejs_small_screen .ejs_menu_bar_spacer {
    display:none;
}
.ejs_small_screen .ejs_volume_parent span {
    display: none;
}
.ejs_small_screen .ejs_volume_parent button {
    width: 30px;
}

.ejs_big_screen .ejs_menu_bar_hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(100%);
}
.ejs_big_screen .ejs_settings_parent {
    right: -3px;
}
/* .ejs_big_screen .ejs_settings_parent::after {
    right: 15px;
} */
.ejs_big_screen .ejs_settings_text {
    display: none;
}
.ejs_big_screen .ejs_disks_text {
    display: none;
}
.ejs_big_screen .ejs_menu_bar_spacer {
    flex:1;
}
.ejs_big_screen .ejs_menu_button svg {
    transition: transform .3s ease;
}
.ejs_big_screen .ejs_menu_button {
    width: auto;
    margin: auto;
    font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
    margin-right: 2px;
    touch-action: manipulation;
    background: transparent;
    border: 0;
    border-radius: 3px;
    color: inherit;
    cursor: pointer;
    flex-shrink: 0;
    overflow: visible;
    padding: 7px;
    position: relative;
    transition: all .3s ease;
}

.ejs_big_screen .ejs_menu_button:hover {
    background: rgba(var(--ejs-primary-color),1);
    color: #fff;
}

.ejs_big_screen .ejs_menu_button:hover .ejs_menu_text {
    transform: translate(0,0) scale(1);
    opacity: 1;
}

.ejs_big_screen .ejs_menu_text_right {
    right: 0;
    left: auto !important;
}

.ejs_big_screen .ejs_menu_text {
    left: 0;
    background: rgba(255,255,255,0.9);
    border-radius: 3px;
    bottom: 100%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    color: #4f5b5f;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 10px;
    opacity: 0;
    padding: 5px 7.5px;
    pointer-events: none;
    position: absolute;
    transform: translate(0,10px) scale(0.8);
    transform-origin: 0 100%;
    transition: transform .2s .1s ease,opacity .2s .1s ease;
    white-space: nowrap;
    z-index: 2;
}

.ejs_big_screen .ejs_menu_text::before {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid rgba(255,255,255,0.9);
    bottom: -4px;
    content: '';
    height: 0;
    left: 16px;
    position: absolute;
    transform: translateX(-50%);
    width: 0;
    z-index: 2;
}
.ejs_big_screen .ejs_menu_text_right::before {
    left: auto !important;
    right: 16px;
    transform: translateX(50%) !important;
}
.ejs_big_screen .ejs_menu_bar {
    padding: 15px 10px 10px;
    background: linear-gradient(rgba(0,0,0,0),rgba(0,0,0,0.7));
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
    bottom: 0;
    color: #fff;
    left: 0;
    position: absolute;
    right: 0;
    transition: opacity .4s ease-in-out,transform .4s ease-in-out;
    z-index: 9999;
    align-items: center;
    display: flex;
    justify-content: flex-start;
    text-align: center;
}


.ejs_menu_bar svg {
    display: block;
    fill: currentColor;
    height: 18px;
    pointer-events: none;
    width: 18px;
}

.ejs_popup_container {
    background: rgba(0,0,0,0.8);
    text-align: center;
    z-index: 9999;
    height: 100%;
    overflow: hidden;
    position: absolute;
    top: 0;
    width: 100%;
    color: #ccc;
}

.ejs_popup_container *, .ejs_popup_container *::after, .ejs_popup_container *::before {
    box-sizing: border-box;
    color: #bcbcbc !important;
    
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.ejs_popup_container h4 {
    color: #ccc;
    font-size: 24px;
    margin: 0;
    padding: 10px;
}

.ejs_button {
    border-radius: .25rem;
    font-size: .875rem;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: .5rem;
    padding-bottom: .5rem;
    display: inline-block;
    background-color: rgba(var(--ejs-primary-color),1);
    margin: 0 10px;
    color: #fff !important;
    touch-action: manipulation;
    cursor: pointer;
}

.ejs_popup_body {
    height: calc(100% - 130px);
    overflow: auto;
}

.ejs_control_body {
    color: #bcbcbc !important;
    border: unset;
}

.ejs_control_body input[type='text'] {
    background-color: #fff;
    border: 1px solid #000;
    font-size: 12px;
    font-weight: 700;
    color: #000 !important;
}
.ejs_control_player_bar {
    margin: 0;
    padding: 0;
}
.ejs_control_player_bar ul {
    list-style: none;
}
.ejs_control_player_bar li {
    color: #bcbcbc !important;
    display: inline-block;
}
.ejs_control_player_bar a {
    padding: 2px 5px;
    color: #bcbcbc !important;
    font-size: 14px;
    cursor: pointer;
}

.ejs_control_selected {
    border-bottom: 1px solid #fff;
    background-color: #fff;
}
.ejs_control_selected a {
    color: #000 !important;
}

.ejs_control_bar:hover {
    background-color: #2d2d2d;
}
.ejs_control_set_button {
    float: none;
    padding: .1rem .5rem;
    background-color: rgba(var(--ejs-primary-color),1);
    color: #fff !important;
    border-radius: .25rem;
    cursor: pointer;
    font-size: 14px;
}

.ejs_control_row label::before {
    top: -0.15rem !important;
}

.ejs_control_row label::after {
    top: calc(-0.15rem + 2px) !important;
}

.ejs_popup_box {
    position: absolute;
    width: 300px;
    top: 50%;
    margin-left: -150px;
    margin-top: -50px;
    left: 50%;
    background: rgba(0,0,0,0.8) !important;
    padding: 15px 0;
}

.ejs_virtualGamepad_parent {
    width: 100%;
    position: absolute;
    bottom: 50px;
}
.ejs_virtualGamepad_top {
    position: absolute;
    bottom: 250px;
    width: 100%;
}
.ejs_virtualGamepad_bottom {
    position: absolute;
    bottom: 10px;
    height: 30px;
    width: 124px;
    left: 50%;
    margin-left: -62px;
}
.ejs_virtualGamepad_left {
    position: absolute;
    bottom: 50px;
    width: 125px;
    height: 125px;
    left: 10px;
}
.ejs_virtualGamepad_right {
    position: absolute;
    bottom: 50px;
    width: 130px;
    height: 130px;
    right: 10px;
}
.ejs_virtualGamepad_button {
    position: absolute;
    font-size: 20px;
    width: 50px;
    height: 50px;
    text-align: center;
    line-height: 50px;
    border: 1px solid #ccc;
    border-radius: 50%;
    font-size: 30px;
    font-weight: bold;
    background-color: rgba(255,255,255,0.15);
    user-select: none;
    transition: all .2s;
    z-index: 20;
}
.ejs_virtualGamepad_button_down {
    background-color:#000000ad;
}

.ejs_dpad_main {
    touch-action: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: .7;
}
.ejs_dpad_horizontal {
    width: 100%;
    height: 36px;
    transform: translate(0,-50%);
    position: absolute;
    left: 0;
    top: 50%;
    border-radius: 5px;
    overflow: hidden;
}
.ejs_dpad_horizontal:before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    z-index: 1;
    transform: translate(0,-50%);
    width: 0;
    height: 0;
    border: 8px solid;
    border-color: transparent #333 transparent transparent;
}
.ejs_dpad_horizontal:after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    z-index: 1;
    transform: translate(0,-50%);
    width: 0;
    height: 0;
    border: 8px solid;
    border-color: transparent transparent transparent #333;
}
.ejs_dpad_vertical {
    width: 36px;
    height: 100%;
    transform: translate(-50%,0);
    position: absolute;
    left: 50%;
    border-radius: 5px;
    overflow: hidden;
}
.ejs_dpad_vertical:before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 1;
    transform: translate(-50%,0);
    width: 0;
    height: 0;
    border: 8px solid;
    border-color: transparent transparent #333 transparent;
}
.ejs_dpad_vertical:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    z-index: 1;
    transform: translate(-50%,0);
    width: 0;
    height: 0;
    border: 8px solid;
    border-color: #333 transparent transparent transparent;
}
.ejs_dpad_bar {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #787878;
}
.ejs_dpad_left_pressed .ejs_dpad_horizontal:before {
    border-right-color:#fff;
}
.ejs_dpad_right_pressed .ejs_dpad_horizontal:after {
    border-left-color:#fff;
}
.ejs_dpad_up_pressed .ejs_dpad_vertical:before {
    border-bottom-color:#fff;
}
.ejs_dpad_down_pressed .ejs_dpad_vertical:after {
    border-top-color:#fff
}

/* Joystick-style D-pad */
.ejs_dpad_joystick {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Hide the default dpad elements in joystick mode */
.ejs_dpad_joystick .ejs_dpad_vertical,
.ejs_dpad_joystick .ejs_dpad_horizontal {
    display: none;
}

/* Nipple.js Styling Overrides */
.nipple {
    opacity: 0.9 !important;
}

.front {
    background: rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3) !important;
}

.back {
    background: rgba(100, 100, 100, 0.2) !important;
}

.ejs_virtualGamepad_open {
    display: inline-block;
    width: 50px;
    height: 50px;
    color: #fff;
    position: absolute;
    top: 5px;
    left: 5px;
    opacity: 0.9;
    z-index: 9999;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 10px;
}
.ejs_virtualGamepad_open svg {
    fill: currentColor;
    width: 100%;
    height: 100%;
}

@keyframes ejs_settings_parent_animation {
    0% {
        opacity: 0.5;
        transform: translateY(10px)
    }
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* Custom D-Pad Buttons */
.ejs_dpad_buttons_container {
    position: relative;
    width: 150px;
    height: 150px;
    /* Centering handled by parent layout logic usually, but here we assume it fits in the zone */
}

.ejs_dpad_btn {
    position: absolute;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 5px;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ejs_dpad_btn:active, .ejs_dpad_btn_active {
    background: rgba(255, 255, 255, 0.6);
}

.ejs_dpad_btn::after {
    content: '';
    display: block;
    width: 0; 
    height: 0; 
    border-style: solid;
}

.ejs_dpad_btn_up { top: 0; left: 52px; }
.ejs_dpad_btn_up::after { border-width: 0 10px 15px 10px; border-color: transparent transparent #fff transparent; }

.ejs_dpad_btn_down { bottom: 0; left: 52px; }
.ejs_dpad_btn_down::after { border-width: 15px 10px 0 10px; border-color: #fff transparent transparent transparent; }

.ejs_dpad_btn_left { top: 52px; left: 0; }
.ejs_dpad_btn_left::after { border-width: 10px 15px 10px 0; border-color: transparent #fff transparent transparent; }

.ejs_dpad_btn_right { top: 52px; right: 0; }
.ejs_dpad_btn_right::after { border-width: 10px 0 10px 15px; border-color: transparent transparent transparent #fff; }

/* In-game Menu */
.ejs_ingame_menu {
    position: absolute;
    top: 60px;
    left: 10px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px;
    z-index: 10000;
    display: none;
    flex-direction: column;
    width: 200px;
}
.ejs_ingame_menu.active {
    display: flex;
}
.ejs_menu_item {
    color: #fff;
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #333;
    text-align: left;
}
.ejs_menu_item:last-child {
    border-bottom: none;
}
.ejs_menu_item:hover {
    background: rgba(255, 255, 255, 0.1);
}