html {
  height: 100%;
}

body {
    background: repeating-linear-gradient(
        to bottom,
        #7cb9d3 0 16px,
        #90bfd3 16px 32px
    );

    background-size: 100% 20px;
  box-shadow: inset 0 0 25px 10px rgba(10, 96, 182, 0.848);
  min-height: 100vh;
  margin: 0;
  font-family: Helvetica, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}


/* Striped background now applied to `body` using repeating-linear-gradient above. */

h1 {
  color: #EAEDEC;
  font-family: 'Tourney', sans-serif;
  font-size: 72px;
  margin-bottom: -10px;
  font-weight: 400;
   -webkit-text-stroke: 2px black; /* width and color */
}

h2 {
  color: #EAEDEC;
  font-family: 'libre-franklin', sans-serif;
  font-size: 48px;
  margin-top: 0;
  margin-bottom: 0;
   -webkit-text-stroke: 2px black; /* width and color */
}

h3 {
  color: #EAEDEC;
  text-align: center;
  font-family: 'libre-franklin', sans-serif;
  font-weight: 300 !important;
}

label {
  color: #EAEDEC;
  font-size: 10px;
}

p {
  color: #aaa;
}

/* ************** Start of Footer Styling ******* */
#footer-disclaimer {
  background-color: rgba(0, 0, 0, 0.7);
  padding: 12px 20px;
  border-radius: 8px;
  max-width: 90%;
  text-align: center;
  left: 50%;
  transform: translateX(-50%);
    position: relative;
}

#footer-disclaimer.is-hidden {
    display: none;
}

#footer-disclaimer p {
  margin: 0;
  padding-right: 10px;
  font-size: 12px;
  letter-spacing: 0.5px;
  font-family: 'Orbitron', sans-serif;
  color: #b7c0d3;
}

#footer-disclaimer a {
    color: #EBA85B;
    text-decoration: none;
}

#footer-disclaimer-close {
    position: absolute;
    top: 4px;
    right: 8px;
    background: transparent;
    border: none;
    color: #b7c0d3;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}

#footer-disclaimer-close:hover {
    color: #EBA85B;
}

#version-number {
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    font-family: 'Orbitron', sans-serif;
    color: #313236;
    cursor: pointer;
    text-align: center;
}

#version-number:hover {
    color: #4e5262;
}

#about-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(38, 43, 48, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.modal-hidden {
    display: none !important;
}

#about-modal-content {
    position: relative;
    background-color: #717682;
    border: 3px solid #585c64;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 0 10px 1px rgba(0, 0, 0, 0.1);
    padding: 18px 20px 12px;
    min-width: 260px;
    width: min(360px, 100%);
    text-align: center;
}

#about-modal-content p {
    margin: 0 0 8px;
    color: #EAEDEC;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    letter-spacing: 0.4px;
}

#about-modal-title {
    color: #EAEDEC;
    font-size: 16px !important;
    margin: 0 0 12px !important;
    background-color: #313236;
    border-radius: 4px;
    padding: 6px 8px;
}

#about-modal-content a {
    color: #EBA85B;
    text-decoration: none;
}

#about-modal-content a:hover {
    text-decoration: underline;
}

#about-modal-close {
    position: absolute;
    top: 7px;
    right: 10px;
    background: transparent;
    border: none;
    color: #EAEDEC;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}

#about-modal-close:hover {
    color: #EBA85B;
}

#controls a {
    color: #EBA85B;
    text-decoration: none;
}

#controls a:hover {
    text-decoration: underline;
}

@media (max-width: 1200px) {
  #footer-disclaimer {
    position: relative;
    margin: 10px auto 0;
    margin-bottom: 5px;
    transform: none;
    left: auto;
  }

    #version-number {
        position: relative;
        left: auto;
        bottom: auto;
        transform: none;
    }
}

@media (min-width: 1201px) {
  #footer-disclaimer {
    position: fixed;
    bottom: 20px;
    z-index: 999;
  }

    #version-number {
        position: fixed;
        left: 50%;
        bottom: 4px;
        transform: translateX(-50%);
        z-index: 999;
        margin: 0;
    }
}

.side-nav a.linkText {
    font-family: Helvetica, sans-serif;
    color: #aaa;
    font-size: 16px;
    /* font-weight: ; */
}
/* ************** Endof Footer Styling ******* */

.guideNote {
  color: #b7c0d3 !important;
}

.nav-note {
    padding: 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: #aaa;
    line-height: 1.5;
    justify-content: space-between;
    /* border-top: 1px solid #333; */
    /* margin-top: 20px; */
}

.nav-note a {
    color: #aaa;
    text-decoration: underline;
}

.nav-note a:hover {
    color: #aaa;
}

.side-nav .nav-note a {
    display: inline;
    padding: 0;
    margin: 0;
    font-size: inherit;
    font-family: inherit;
    text-align: inherit;
    border: none;
    text-decoration: underline;
    text-underline-offset: 2px;
    color: #aaa;
}

.side-nav .nav-note a:hover {
    color: #aaa;
    text-decoration: underline;
}

/* ********** HAMBURGER STYLING ******* */
/* Hamburger Button */
.hamburger-menu {
    position: fixed;
    top: 20px;
    right: 15px;
    cursor: pointer;
    z-index: 1001; /* Above everything, except for the slide nav*/
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bar {
    width: 30px;
    height: 4px;
    background-color: #313236;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

.hamburger-menu:hover .bar {
    background-color: #4e5262;
    cursor: pointer;
}

/* Slide-out Panel */
.side-nav {
    height: 100%;
    width: 0; /* Hidden by default */
    position: fixed;
    z-index: 1002;
    top: 0;
    right: 0;
    background-color: #262B30;
    overflow-x: hidden;
    transition: 0.2s; /* Smooth slide effect */
    padding-top: 60px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    color: white;
}

.side-nav a {
    padding: 15px 10px 15px 15px; /* top right bottom left */
    text-decoration: none;
    font-size: 18px;
    color: #aaa;
    display: block;
    font-family: 'Orbitron', sans-serif;
    transition: 0.3s;
    text-align: left;
}

.side-nav a:hover {
    color: #7cb9d3;
}

.side-nav .close-btn {
    position: absolute;
    top: 0px;
    right: 20px;
    font-size: 36px;
}

.side-nav hr {
    border: 0;
    border-top: 1px solid #333;
    margin: 20px;
}

.HambText {
    text-align: center;
    margin-bottom: 10px;
}

/* ********** END OF HAMBURGER STYLING ******* */


/* ********** Start OF ACCORDION STYLING ********** */
.accordion-header {

    background-color: transparent;
    color: #aaa;
    cursor: pointer;
    padding: 15px 25px;
    width: 100%;
    text-align: left;
    border: none;
    outline: none;
    transition: 0.4s;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    border-bottom: 1px solid #333;
}

.accordion-header:hover, .active {
    color: #7cb9d3; /* Highlight color */
}

/* plus/minus icon */
.accordion-header:after {
    content: '\002B'; /* Plus sign */
    float: right;
    margin-left: 5px;
}

.active:after {
    content: "\2212"; /* Minus sign */
}

.accordion-content {
    padding: 0 10px;
    background-color: #222;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out; /* Smooth slide */
}

.accordion-content p {
    font-size: 14px;
    color: #eee;
    line-height: 1.6;
}

/* ********** END OF ACCORDION STYLING ********** */





#main-header {
    display: flex;
    justify-content: space-around;
    align-items: center; 
    max-width: 1280px;
    width: 100%;
    margin-bottom: 10px;
    padding: 0 10px;
    box-sizing: border-box;
}

#header-block {  /* The main title */
    text-align: left;
    margin-left: 10px;
}

#header-block, #header-spacer {
    width: 300px;
    flex-shrink: 0;
}

/* the black text on the top line */
.outerLabel {
    color: #202020;
}

#controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 1280px;
    padding: 10px;
}

.control-box {
    background-color: #717682;
    border: 1px solid #313236;
    padding: 40px 10px 10px 10px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 0 10px 1px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    flex: 1 1 360px;
    height: 215px; /* Fixed height for consistent layout */
    box-sizing: border-box;
    margin: 10px;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    align-content: flex-start;
    gap: 4px;
}

.control-box > img,
.control-box > .wave-display-container {
    flex: 0 0 100%;
}

.control-box h3 {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px 10px;
    background-color: #313236;
    border-radius: 5px 5px 0 0;
}

body.privacy-page #controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    width: 100%;
    max-width: 1000px;
    gap: 20px;
    box-sizing: border-box;
}

body.privacy-page .control-box {
    width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
}

.parameter-row {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 7px;
    position: relative;
    padding-bottom: 2px;
    min-width: 38px;
}

.parameter-row label {
    font-size: 9px;
    text-align: center;
    line-height: 1.2;
}

/* Decorative tick-mark track behind range sliders */
.parameter-row:has(input[type="range"])::before {
    content: "";
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 98px;
    background: repeating-linear-gradient(
        180deg,
        transparent 0px,
        transparent 7px,
        #c7c7c7 7px,
        #bebdbdd4 8.5px
    );
    background-position: 0 -5px;
    z-index: 0;
}

.parameter-row:has(input[type="range"])::after {
    content: "";
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 98px;
    background: #13171F;
    z-index: 1;
}

/* TOGGLE BUTTON */
.toggle-btn {
    position: relative;
    width: 22px;
    height: 34px;
    border-radius: 3px;
    margin-bottom: 30px;
    border: 1px solid #1c222d;
    background: #2e3240;
    cursor: pointer;
    box-shadow:
        inset 0 0 0 1px rgb(22, 22, 23),
        inset 0 2px 6px rgba(0, 0, 0, 0.3),
        0 1px 1px rgba(0, 0, 0, 0.55),
        0 0 6px 1px rgba(26, 28, 30, 0.4);
}

.toggle-btn:hover {
    border-color: #7CB9D3;
}

.toggle-btn:focus {
    outline: none;
}

.toggle-btn:active {
    transform: translateY(1px);
}

/* .toggle-btn.is-active {
    background: #1a1e2a;
    box-shadow:
        inset 0 0 0 1px rgb(22, 22, 23),
        inset 0 3px 8px rgba(0, 0, 0, 0.6);
} */

.btn-led {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2f1416;
    border: 1px solid #38181b;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.65);
}

.toggle-btn.is-active .btn-led {
    background: radial-gradient(circle at 35% 30%, #ffd8d8 0, #ff6363 25%, #ff2222 58%, #b70808 100%);
    border-color: #6e1015;
    box-shadow:
        0 0 5px rgba(255, 61, 61, 0.85),
        0 0 1px rgba(255, 152, 152, 0.95);
}

/* SLIDER STYLING */
input[type="range"] {
    writing-mode: vertical-lr;
    direction: rtl;
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 96px;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 2;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 22px;
    border-radius: 6px;
    background: transparent;
    border: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid #0d1018;
    border-top-color: #5a6070;
    background: linear-gradient(180deg,
        #7a8090 0%,
        #50566a 18%,
        #2e3248 40%,
        #222640 43%,
        #e4e4e8 44%,
        #e4e4e8 56%,
        #1e2236 57%,
        #14182a 80%,
        #0c1018 100%
    );
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        0 2px 5px rgba(0, 0, 0, 0.7);
}

input[type="range"]::-moz-range-track {
    width: 22px;
    border-radius: 6px;
    background: transparent;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid #0d1018;
    border-top-color: #5a6070;
    background: linear-gradient(180deg,
        #7a8090 0%,
        #50566a 18%,
        #2e3248 40%,
        #222640 43%,
        #e4e4e8 44%,
        #e4e4e8 56%,
        #1e2236 57%,
        #14182a 80%,
        #0c1018 100%
    );
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        0 2px 5px rgba(0, 0, 0, 0.7);
}

/* --- Tooltip Styling --- */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width:max-content;
    background-color: #201c13;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 5px 5px;
    position: absolute;
    z-index: 10;
    bottom: 100%;
    right: 100%;
    margin-left: 10px;
    opacity: 0;
    transition: opacity 0.3s;
}


.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    bottom: 0%;
    left: -10%;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent #201c1300;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* --- End of Tooltip Styling --- */

/* Styling for the MIDI output selection box */
#midi-output-select {
    width: 250px;
    background-color: #262B30;
    color: #51E7FF;
    text-shadow: rgba(110, 233, 250, 0.5) 1px 0 8px; /* set glow of text */
    font-family: 'VT323', monospace;
    font-size: 1.2em;
    border: 5px solid #313236;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 0 10px 1px rgba(0, 0, 0, 0.1);
    padding: 5px;
    border-radius: 5px;
}

/* Centering the MIDI device selection */
#midi-status {
    display: flex;
    flex-direction: column; /* Stack the label and select box vertically */
    align-items: center; /* Center the stacked items horizontally */
    margin-top: 20px;
}

/* Add space below the label within the MIDI status block */
#midi-status label {
    margin-bottom: 8px;
}

#patch-controls {
    display: flex;
    gap: 15px;
    margin-right: 10px;
    margin-top: 15px;
    flex-shrink: 0;
}

input[type="checkbox"] {
    accent-color: #3C496B; /* Replace with your preferred hex color */
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.envelope-diagram {
    width: 100%;
    max-width: 80px;
    height: 25px;
    border-radius: 2px;
    opacity: 0.9;
}

.wavs-diagram {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 2px;
    opacity: 0.9;
}

.side-nav .wavs-diagram {
    width: 70%;
    margin-top: 10px;
    margin-bottom: 10px;
}

.nav-synth-wrap {
    position: relative;
    width: 70%;
    margin: 10px auto;
    cursor: pointer;
}

.nav-synth-img {
    display: block;
    width: 100%;
    height: auto;
}

.nav-synth-img--front {
    position: relative;
    z-index: 3;
    opacity: 0.92;
}

.nav-synth-img--mid {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    opacity: 0.4;
}

.nav-synth-img--back {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    opacity: 0.2;
}

.vca-diagram {
    width: 100%;
    max-width: 120px;
    height: auto;
    border-radius: 4px;
    opacity: 0.9;
}

@keyframes modal-synth-spin {
    0%   { transform: perspective(400px) rotateY(0deg); }
    100% { transform: perspective(400px) rotateY(360deg); }
}

.about-modal-synth {
    animation: modal-synth-spin 6s linear infinite;
}

.osc-common-diagram {
    width: 100%;
    max-width: 120px;
    height: auto;
    opacity: 0.9;
}

.filter-image-row,
.diagram-image-row {
    flex: 0 0 100%;
    text-align: center;
    margin-bottom: 2px;
}

.filter-diagram {
    height: 25px;
    width: auto;
    max-width: 100px;
    border-radius: 4px;
    opacity: 0.9;
}



.patch-button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 30px;
}

.patch-button-group label {
    margin-bottom: 8px;
}

/* Style for the buttons themselves */
#init-patch-button, #random-patch-button {
    width: 22px;
    height: 34px;
    border-radius: 3px;
    border: 1px solid #1c222d;
    background: #2e3240;
    cursor: pointer;
    box-shadow:
        inset 0 0 0 1px rgb(22, 22, 23),
        inset 0 2px 6px rgba(0, 0, 0, 0.3),
        0 1px 1px rgba(0, 0, 0, 0.55),
        0 0 6px 1px rgba(26, 28, 30, 0.4);
}

#init-patch-button:hover, #random-patch-button:hover {
    border-color: #7CB9D3;
}

#init-patch-button:focus, #random-patch-button:focus {
    outline: none;
}

#init-patch-button:active, #random-patch-button:active {
    transform: translateY(1px);
    box-shadow:
        inset 0 0 0 1px rgb(22, 22, 23),
        inset 0 3px 8px rgba(0, 0, 0, 0.6);
}

/* New style to highlight the active OSC2 PWM control */
.active-control {
    /* Apply underline */
    text-decoration: underline;
    /* You might also want to change the color for emphasis */
    color: #EBA85B !important; 
}

/* ******************START OF WAVE MARKER STYLES ******************** */
/* Container for the image and the line */
.wave-display-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2px;
}

.wave-inner {
    position: relative;
    width: 120px;
}

.wave-diagram {
    display: block;
    width: 100%;
    height: auto;
}

/* The white highlight line */
.wave-marker {
    position: absolute;
    bottom: 1px; /* near the bottom of image */
    height: 1.5px;
    width: 33.33%;
    background-color: #9CA0A8;
    /* box-shadow: 0 0 5px rgba(255, 255, 255, 0.3); */
    /* transition: all 0.2s ease; Smooth sliding movement */
    display: none; /* Hidden by default (Off state) */
}
/* ******************END OF WAVE MARKER STYLES ******************** */

/* ---- PER-BOX WIDTH OVERRIDES ----
   Change flex-basis to set each box's preferred width.
   flex-grow:1 still applies so boxes fill their row equally.
   To pin a box to an exact width, also set flex-grow:0.
------------------------------------------------- */
#box-arpeggiator { flex-basis: 400px; flex-grow: 0; }
#box-osc-common  { flex-basis: 330px; flex-grow: 0;  }
#box-osc1        { flex-basis: 205px; flex-grow: 0;  }
#box-osc2        { flex-basis: 205px; flex-grow: 0;  }
#box-filter      { flex-basis: 205px; flex-grow: 0;  }
#box-lfo1        { flex-basis: 130px; flex-grow: 0; }
#box-lfo2        { flex-basis: 130px; flex-grow: 0; }
#box-vca         { flex-basis: 80px; flex-grow: 0; min-width: 130px; }
#box-vca-eg      { flex-basis: 205px; flex-grow: 0; }
#box-vcf-eg      { flex-basis: 205px; flex-grow: 0; }

/* --- NEW MEDIA QUERY FOR MOBILE VIEW --- */
@media (max-width: 768px) {

    /* Floating Screen bar */
    #midi-status {
        position: fixed; /* Makes it float relative to the viewport */
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000; 
        
        /* Compact/Horizontal layout */
        display: flex; 
        flex-direction: row; 
        justify-content: center;
        gap: 20px;
        align-items: center;
        
        /* Appearance */
        background-color: #717682;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
        padding: 10px 0; 
        margin: 0;
    }

    /* Hide the MIDI device label on mobile to save space on the floating bar */
    #midi-status label {
        display: none;
    }

    body {
        padding-top: 40px;
    }
    
    /* 1. Stack the three main header sections vertically */
    #main-header {
        flex-direction: column;
        /* Remove space-around and use flex-start for a tight stack, 
           then center the content within the header */
        justify-content: flex-start; 
        align-items: center; /* Center the entire header block */
        padding: 10px 0; /* Add some vertical padding */
    }

    /* 2. Ensure each block is full width (or nearly full) and centered */
    #header-block,
    /* #midi-status, */
    #patch-controls {
        width: 90%; /* Take up the full width of the main-header */
        margin: 10px 0; /* Add vertical spacing between stacked elements */
        text-align: center; /* Center text inside the header block */
        
        /* Optional: Center the button groups horizontally within their block */
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    /* 3. Adjust specific inner elements to ensure they stack/center correctly */
    
    /* Center the buttons within the patch-controls group */
    #patch-controls {
        flex-direction: row;
        gap: 15px; /* Remove horizontal gap when stacked */
        justify-content: center; /* <<< THIS IS THE CRITICAL ADDITION */
        width: 100%;
    }
    
    /* Center the individual button groups and add vertical margin */
    .patch-button-group {
        margin: 0; 
        width: auto; /* Allow content to dictate width */
    }
}

/* ===== Back to Home Button ===== */
.back-home-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.back-home-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}
.back-home-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}