/******************************************************/
/*************** GLOBAL *******************************/
/******************************************************/
:root {
    --whitish-color: rgb(238, 238, 238);
    --blackish-color: #1d1d1d/*#3e0000*/;
}
body {
    display: flex;
    justify-content: center;
    /*align-items: center;*/
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    font-family: Arial, Helvetica, sans-serif;
    margin: 0px;
    background-color:#450000 /*var(--blackish-color)*//*#193030*/;
}
@font-face {
	font-family: 'text_font';
	src: url('fonts/coolvetica.ttf');/*development*/
	/*src: url('https://ltms.online/frontend/styles/fonts/OpenSans-Regular.ttf');*//*staging*/
}
@font-face {
	font-family: 'number_font';
	src: url('fonts/TeXGyreAdventor-Regular.ttf');/*development*/
	/*src: url('https://ltms.online/frontend/styles/fonts/OpenSans-Regular.ttf');*//*staging*/
}
* {
    -webkit-tap-highlight-color: transparent; /* Disables the touch highlight */
	font-family: text_font;
}

/******************************************************/
/*************** INTERFACE ****************************/
/******************************************************/
.application_wrap {
    display: flex;
    position: absolute;
    align-items: center;
    flex-direction: column;
}
.skin_normal {
    display: flex;
    max-width: 100vw;
    max-height: 100vh; /* Ensures image never grows beyond viewport height */
    z-index: -2;
}
.skin_mobile {
    display: none;
    width: 100vw; /* Adjust as needed */
    height: 100vh; /* Adjust as needed */
    object-fit: cover; /* Ensures the image covers the entire space while maintaining its aspect ratio */
    object-position: center/* 70%*/; /* Adjusts the image position */
    z-index: -2;
}
.input_group {
    display:flex;
    justify-content: space-around;
    width:80%;
}
.center_wrap,
.left_wrap,
.right_wrap {
    display: flex;
    position: absolute;
    flex-direction: column;
    align-items: center;
    height: calc(71% - 71% * 0.11);
    padding-top: 2.75%;
    padding-bottom: 2.75%;
}
.center_wrap {
    justify-content: flex-start;
    width:/*60%*/50%;
}
.left_wrap,
.right_wrap {
    justify-content: space-between;
    width:/*20%*/25%;
}
.left_wrap {
    left: 0px;
}
.right_wrap {
    right: 0px;
}
.bottom_wrap {
    display: flex;
    position: absolute;
    height: 29%;
    width:100%;
    bottom: 0px;
}

/* key-based instrument */
.instrument_wrap {
    display: flex;
    position: absolute;
    width:100%;
    height:83%;
    bottom: 0px;
    overflow: hidden;
    -webkit-box-shadow: inset 0px 23px 17px -12px rgba(0,0,0,0.36);
    -moz-box-shadow: inset 0px 23px 17px -12px rgba(0,0,0,0.36);
    box-shadow: inset 0px 23px 17px -12px rgba(0,0,0,0.36);
}
.white_key,
.black_key {
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 3px;
    -webkit-box-shadow: inset 0px 18px 11px -12px rgba(0,0,0,0.36);
    -moz-box-shadow: inset 0px 18px 11px -12px rgba(0,0,0,0.36);
    box-shadow: inset 0px 18px 11px -12px rgba(0,0,0,0.36);
    cursor: pointer;
}
.white_key {
    height: 100%;
    width: calc(100% / 26);
    background-image: url('images/key_white_big.png');
    background-size: cover;
    background-position: bottom;
    background-repeat: no-repeat;
    border-left-style: solid;
    border-right-style: solid;
    border-width: 1px;
    border-color: black;
    box-sizing: border-box;
    -webkit-box-shadow: inset 0px 18px 11px -12px rgba(0,0,0,0.36);
    -moz-box-shadow: inset 0px 18px 11px -12px rgba(0,0,0,0.36);
    box-shadow: inset 0px 18px 11px -12px rgba(0,0,0,0.36);
}
.black_key {
    position: relative;
    height: 67%;
    width:1.8%;
    margin-left: -0.9%;
    margin-right: -0.9%;
    background-image: url('images/key_black_big.png');
    background-size: cover; /* make the image cover the entire div */
    background-position: bottom; /* center the image */
    background-repeat: no-repeat; /* prevent tiling/repeating */
    z-index: 1; /* to stay on top of white key hover overlay */
}
.white_key[playing]:not(:hover)::before,
.white_key:hover:not([playing])::before {
    content: '';
    position: absolute;
    width: calc(100% / 26);
    height: 100%;
    background-color:rgb(229, 174, 65);/* Semi-transparent overlay color */
    opacity: 0.5;
    pointer-events: none; /* Allow clicks to pass through */
}
.black_key[playing]:not(:hover)::before,
.black_key:hover:not([playing])::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color:rgb(229, 174, 65);/* Semi-transparent overlay color */
    opacity: 0.5;
    pointer-events: none; /* Allow clicks to pass through */
}

/******************************************************/
/******************** INPUTS **************************/
/******************************************************/

/* ROTARY INPUT */
.rotary_input_thumb,
.rotary_input_track {
    display: none;
}
.rotary_input_arc {
    position: absolute;
    --b: 5.5px;
    --a: calc(270deg / 2);
    width: 10vh;
    aspect-ratio: 1;
    padding: var(--b);
    box-sizing: border-box;
    border-radius: 50%;
    background: #E6BE8A;
    --_g:/var(--b) var(--b) no-repeat
        radial-gradient(50% 50%,#000 calc(100% - 1px),#0000);
    mask:
        top var(--_g),
        calc(50% + 50%*sin(var(--a))) 
        calc(50% - 50%*cos(var(--a))) var(--_g),
        linear-gradient(#0000 0 0) content-box intersect,
        conic-gradient(#000 var(--a),#0000 0);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-135deg);
}
.rotary_input.small .rotary_input_arc {
    --b: 4px;
    width: 8vh;
}
.rotary_input {
    position: relative;
    height: 9vh;
    margin-bottom: -2vh; /*compensate for not reaching wrap bottom*/
}
.rotary_input_value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    z-index: -1;
    color:#E6BE8A;
    font-size:3vh;
    font-family: number_font;
}
.rotary_input.small .rotary_input_value {
    font-size: 2vh;
}
.rotary_input_label {
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0%);
    color: var(--whitish-color);
    font-size: 2.25vh;
    /*font-size: clamp(16px, 2.25vh, 1.25vw);*/
    margin-top: -3.5vh;
}
.rotary_input.small .rotary_input_label {
    margin-top: -2.5vh;
}
.rotary_input_circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    color: var(--whitish-color);
    border-radius: 50%;
    border-style: solid;
    border-width: 2.5px;
    width: calc(10vh - 2 * 5.5px - 10px);
    height: calc(10vh - 2 * 5.5px - 10px);
}
.rotary_input.small .rotary_input_circle {
    width: calc(8vh - 2  * 4px - 10px);
    height: calc(8vh - 2 * 4px - 10px);
}
.rotary_input_range {
    -webkit-appearance: none; /* Remove default styling for Webkit browsers */
    -moz-appearance: none;    /* Remove default styling for Firefox */
    appearance: none;         /* General appearance removal for modern browsers */
    position: absolute;
    height: 1px;             /* Height of the track */
    outline: none;            /* Remove focus outline */
    cursor: pointer;          /* Pointer cursor for better UX */
    top: 48%;
    left: calc(50% - 2px);
    transform: translate(-50%, -50%) rotate(-90deg); /* Combined transforms */
    width: 8vh;
    opacity: 0;

}
.rotary_input_range::-webkit-slider-thumb {
    -webkit-appearance: none; /* Remove default styling for Webkit browsers */
    -moz-appearance: none;    /* Remove default styling for Firefox */
    appearance: none;         /* General appearance removal for modern browsers */
    width: 1px;               /* Width of the slider */
    height: 100px;            /* Height of the slider */
    background: #0078d7;      /* Slider color */
    cursor: pointer;          /* Pointer cursor for better UX */
}
.rotary_input_range::-moz-range-thumb {
    width: 60px;               /* Width of the slider */
    height: 60px;            /* Height of the slider */
    background: #0078d7;      /* Slider color */
    cursor: pointer;          /* Pointer cursor for better UX */

}

/* CAROUSEL INPUT */
.carousel_input {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 45%;
    height: 4vh;
    border-radius: 5vh;
    background-color: #1d1d1d6e;
    padding-left: 1.5vh;
    padding-right: 1.5vh;
}
.carousel_input_left_button,
.carousel_input_right_button {
    height: 50%;
    padding:10px;
    margin:-10px;
    cursor:pointer;
}
.carousel_input_value,
.carousel_input_list {
    color: var(--whitish-color);
    font-size:2.25vh;
}
.carousel_input.preset_picker {
    margin-bottom: 1vh;
    width: 55%;
}

/*SWITCH INPUT*/
.switch_input {
    display: flex;
    justify-content: center;
    width: 45%;
}
.switch_input_left_button,
.switch_input_middle_button,
.switch_input_right_button {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(4vh - 4px);
    width: calc(4vh - 4px);
    color: var(--whitish-color);
    font-size:2.25vh;
    background-color: #E6BE8A;
    border-radius: 50%;
    cursor: pointer;
}
.switch_input_middle_button {
    font-size:1.75vh;
}
.switch_input_label {
    display: flex;
    justify-content: center;
    width:100%;
    color: var(--whitish-color);
    font-size:2.25vh;
    margin-bottom: 1vh;
}
.switch_input_column {
    width:80%;
}
.switch_input_row {
    display:flex;
    justify-content: space-between;
    align-items: center;
    border-style: solid;
    border-width: 2px;
    border-color: var(--whitish-color);
    height: 4vh;
    border-radius: 5vh;
    padding-left: 2px;
    padding-right: 2px;
}

/*SCROLL INPUT*/
.scroll_input {
    display: flex;
    width: 100%;
    height:17%;
    background-color: var(--blackish-color);
    justify-content: center;
    align-items: center;
    padding-left:25px;
    padding-right:25px;
}
 
.scroll_input_range {
     -webkit-appearance: none; /* Remove default styling for Webkit browsers */
     -moz-appearance: none;    /* Remove default styling for Firefox */
     appearance: none;         /* General appearance removal for modern browsers */
     display: flex;
     width: 100%;
     height:2px;
     outline: none;            /* Remove focus outline */
     cursor: pointer;    
 }
 .scroll_input_range::-webkit-slider-thumb {
     -webkit-appearance: none; /* Remove default styling for Webkit browsers */
     -moz-appearance: none;    /* Remove default styling for Firefox */
     appearance: none;         /* General appearance removal for modern browsers */
     width: calc(100% / 21);               /* Width of the slider */
     height: 6.5px;            /* Height of the slider */
     background: #0078d7;      /* Slider color */
     cursor: pointer;          /* Pointer cursor for better UX */
     border-radius: 3px;
     margin-top: -2.5px;
     background-color: #E6BE8A;
 }
 .scroll_input_range::-moz-range-thumb {
    width: calc(100% / 21);           /* Width of the slider */
     height: 5px;            /* Height of the slider */
     background: #0078d7;      /* Slider color */
     cursor: pointer;          /* Pointer cursor for better UX */
     border-radius: 3px;
     border-style: none;
     margin-top: -2px;
     background-color: #E6BE8A;
 }
 .scroll_input_range::-webkit-slider-runnable-track {
     height: 1px;
     background-color: var(--whitish-color); /* Example: Light gray track */
 }
 .scroll_input_range::-moz-range-track {
     height: 1px;
     background-color: var(--whitish-color); /* Example: Light gray track */
 }

/********************************************************/
/****************** OTHER ELEMENTS **********************/
/********************************************************/
.samples_loaded {
    color:#E6BE8A;
    font-size:2.25vh;
    font-family: text_font;
    position: absolute;
    bottom: 5%;
}
.volume_meter_wrap {
    display: flex;
    position: relative;
    flex-direction: column;
    justify-content: center;
    width: 13vh;
    margin-right: 1.5vh;
}
.volume_meter_track {
    position: absolute;
    height: 2px;
    width: 100%;
    background-color: var(--whitish-color);
    border-radius: 2px;
    margin: auto;
}
.volume_meter_thumb {
   /* position: absolute;
    height: 8px;
    width: 70%;
    background-color: #E6BE8A;
    border-radius: 4px;*/


width: 100%;
height: 8px;
background: linear-gradient(to right, 
    rgb(0, 211, 0) 0%, 
    /*rgb(0, 211, 0) 35%,*/  /* Green covers the first 50% */
    yellow 70%, /* Transition from green to yellow between 50%-60% */
    yellow 65%, /* Yellow covers 60%-80% */
    /*75% red zone (65+85)/2 starts between these values !!!*/
    red 85%,    /* Transition from yellow to red between 80%-90% */
    red 100%    /* Red covers 90%-100% */
);
-webkit-mask-image: linear-gradient(to right, black 0%, black 0%); /* Initial masking */
mask-image: linear-gradient(to right, black 0%, black 0%); /* Initial masking */
/*border-radius: 10px; */ /* Add rounded corners */


   /* 
0 - #E6BE8A
90 - #DF9B43
100 - #FE4D15
*/
}
.volume_volume_meter {
    display: flex;
    flex-direction: column;
    width: fit-content;
}
.left_volume_meter_wrap, .right_volume_meter_wrap {
    display: flex;
    align-items: center;
}
.volume_meter_label {
    color: var(--whitish-color);
    font-size:2.25vh;
}
.top_controls {
    display: flex;
    width: 15vh;
    justify-content: space-between;
    filter: brightness(1.5);
}
.top_control {
    width:4vh;
}
.top_control > img {
    width: 100%;
    cursor: pointer;
}
[hidden] {
    display:none;
}

[blink] {
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.4; } /* Adjust transparency level */
    100% { opacity: 1; }
}

.rotate_me {
    display: none;
}

/*@media screen and (orientation: portrait), (max-width: 800px) and (max-height: 450px) {*/
@media (orientation: portrait) {
/*@media (max-aspect-ratio: 1) {*/

    .volume_meter_wrap {
        width: 12vw;
    }

    .carousel_input {
        height: 3.5vw;
    }
    .carousel_input.preset {
        margin-bottom: 1vw;
    }

    .top_controls {
        width: 15vw;
    }
    .top_control {
        width:4vw;
    }

    .rotary_input.big {
        height: 10vw;
    }
    .rotary_input.big .rotary_input_label {
        /*font-size: 1.75vw;*/
        margin-top: -2.5vw;
    }
    .rotary_input.big .rotary_input_circle {
        width: calc(10vw - 2* 4px - 10px);
        height: calc(10vw - 2* 4px - 10px);
    }
    .rotary_input.big .rotary_input_arc {
        --b: 4px;
        width: 10vw;
    }
    .rotary_input.big .rotary_input_value {
        font-size: 3vw;
    }

    .rotary_input.small {
        height: 10vw;
    }
    .rotary_input.small .rotary_input_label {
        /*font-size: 1.75vw;*/
        margin-top: -1vw;
        /*transform: translate(-50%, -50%);*/
    }
    .rotary_input.small .rotary_input_circle {
        width: calc(7.5vw - 2* 4px - 10px);
        height: calc(7.5vw - 2* 4px - 10px);
    }
    .rotary_input.small .rotary_input_arc {
        --b: 4px;
        width: 7.5vw;
    }
    .rotary_input.small .rotary_input_value {
        font-size: 2vw;
    }

    .samples_loaded,
    .rotary_input_label,
    .switch_input_label,
    .carousel_input_value,
    .switch_input_left_button,
    .switch_input_middle_button,
    .switch_input_right_button,
    .volume_meter_label {
        font-size: 1.75vw;
    }
    
    .switch_input_label {
        margin-bottom: 0.5vw;
    }

    .switch_input_column {
        width: 95%;
    }

    .switch_input_row {
        height: 3.5vw;
    }

    .switch_input_left_button, .switch_input_middle_button, .switch_input_right_button {
        height: calc(3.5vw - 4px);
        width: calc(3.5vw - 4px);
    }

    .scroll_input_range::-webkit-slider-thumb {
        height: 4px;
        margin-top: -1.5px;
    }
    .scroll_input_range::-moz-range-thumb {
        height: 4px;
        margin-top: -1.5px;
    } 
    
    .volume_meter_thumb {
        height: 6px;
    }

}


/* landscape ipads/tablets */
@media (max-aspect-ratio: /*1180/820*//*1.5*//*2000/1400*/1.67) /*and (max-width: 1368px)*/ and (orientation: landscape) {
    .skin_normal {
        display: none;
    }
    .skin_mobile {
        display: flex;
    }
}

/* landscape smartphones */
@media (max-width: 850px) and /*(orientation: landscape)*/ (aspect-ratio > 1.49) {
    .skin_normal {
        display: none;
    }
    .skin_mobile {
        display: flex;
    }


    /*.rotary_input_arc,
    .rotary_input_circle,*/
    .rotary_input_value  {
       /* display: none;*/
    }
    .rotary_input_range {
        height: 1px;             /* Height of the track */
        top: 48%;
        left: calc(50% - 2px);
        transform: translate(-50%, -50%); /* Combined transforms */
        width: 100%;
       /* opacity: 1;*/

    }
    .rotary_input_range::-webkit-slider-thumb {
        width: 1px;               /* Width of the slider */
        height: 10px;            /* Height of the slider */
        background: #0078d7;      /* Slider color */
    }

    .rotary_input_range::-moz-range-thumb {
        width: 1px;               /* Width of the slider */
        height: 10px;            /* Height of the slider */
        background: #0078d7;      /* Slider color */
    }


    .rotary_input_arc,
    .rotary_input_circle,
    .rotary_input_value {
        display: none;
    }


    .rotary_input_thumb,
    .rotary_input_track {
        display: flex;
    }

    .rotary_input_thumb {
        width: 50%;
        height: 4px;
        background-color: #E6BE8A;
        border-radius: 2px;
        /*margin-top:-1px;*/
        /* z-index: 2; */
        position: absolute;
        min-width:4px;
    }

    .rotary_input {
        width: 80%;
        height: 0px;
        margin-bottom:0px;
    }

    .rotary_input_track {
        width: 99%;
        /*height: 1px;*/
        border-color: var(--whitish-color);
        /*background-color: var(--whitish-color);*/
        border-style: solid;
        border-width: 1px;
        
        /*margin-top:-1px;*/
        /* z-index: 2; */
        position: absolute;
        margin-top:1.5px;
    }

    .scroll_input_range::-webkit-slider-thumb {
        height: 4px;
        margin-top: -1.5px;
    }
    .scroll_input_range::-moz-range-thumb {
        height: 4px;
        margin-top: -1px;
    } 

    .volume_meter_thumb {
        height: 5px;
    }

    .left_wrap {
        align-items: start;
        padding-left:4%;
    }

    .right_wrap {
        align-items: end;
        padding-right:4%;
    }

    .switch_input {
        justify-content: start;
    }

    .input_group {
        width: 100%;
        flex-direction: column;
        height: 45%;
    }

    .volume_meter_wrap {
        width: 10vw;
    }

    .center_wrap,
    .left_wrap,
    .right_wrap {
        height: calc(71% - 71%* 0.2);
        padding-top: 2.1%;
    }

    .rotary_input.small .rotary_input_label {
        margin-top: -3.5vh;
    }

    .top_control {
        width: 6vh;
    }
    .top_controls {
        width: 22vh;
    }

    .switch_input_left_button,
    .switch_input_middle_button,
    .switch_input_right_button {
        font-size: 1.5vw;
    }
    
    .switch_input_label {
        margin-bottom: 0.5vw;
    }

    .switch_input_column {
        width: 95%;
    }

    .switch_input_row {
        height: 3.5vw;
    }

    .switch_input_left_button, .switch_input_middle_button, .switch_input_right_button {
        height: calc(3.5vw - 4px);
        width: calc(3.5vw - 4px);
    }

}

@media (max-height: 850px) and (orientation: portrait) {
    .rotate_me {
        display: flex;
        position: absolute;
        width: 100%;
        height: 100vh;
        background-color: var(--whitish-color);
        z-index: 9;
        align-items: center;
        justify-content: center;
        color: var(--blackish-color);
        font-size: 25px;
    }
}
