body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    font-family: "Bricolage Grotesque", sans-serif;
    /* font-family: "Luckiest Guy", cursive; */
    /* font-family: "Raleway", sans-serif; */
    font-family: "Space Mono", monospace;
    /* font-family: "Anton", sans-serif; */
    /* font-family: "Bagel Fat One", system-ui; */
    /* font-family: "Fascinate", system-ui; */
    /* font-family: "Ultra", serif; */
    /* font-family: "Limelight", serif; */
}
h4 {
    margin: 0;
    margin-bottom: 15px;
    text-align: center;
    text-transform: uppercase;
    line-height: 1;
    color: #444;
}
h1 {
    font-family: "Limelight", serif;
    text-transform: uppercase;
    margin-top: 10px;
    margin-bottom: 0;
    background: linear-gradient(90deg, #5c00ff, #ffa17a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 4em;
}
.message {
    width: 650px;
    text-align: center;
    margin: 0 auto;
    z-index: 999;
    margin-top: -40px;
}
.message img {
    width: 150px;
    margin-top: 25px;
    margin-bottom: 10px;
}
.message p {font-family: "Bricolage Grotesque", sans-serif;font-size: 1.1em;margin-top: 5px;margin-bottom: 25px;}
#composer-container {
    display: flex;
    width: 100%;
    max-width: 1366px;
    flex-direction: column;
    position: relative;
}
#chord-palette {
    padding: 5px;
    /* border: 1px solid #ccc; */
    display: flex;
    gap: 20px;
    height: 213px;
    justify-content: center;
    background: linear-gradient(0deg, #f8f6ff 2%, #ffffff 38%);
    z-index: 9999;
    /* border: 1px solid #f1f1f1; */
    border-top: none;
    margin: 0 10px;
    box-shadow: 0 3px 2px -2px #939393;
    margin-right: 9px;
    position: fixed;
    padding-top: 12px;
    left: 2px;
    right: 1px;
    top: 0;
    width: 1345px;
    margin: 0 auto;
    padding: 15px 20px;
    box-sizing: border-box;
}
.chord-item {
    padding: 5px 10px;
    margin-bottom: 5px;
    /* border: 1px solid #ddd; */
    cursor: grab;
    text-align: center;
    border-radius: 3px;
    font-weight: bold;
    width: calc(33.33% - 5px);
    float: left;
    box-sizing: border-box;
    height: 41px;
    display: flex;
    align-items: center;
    margin-right: 5px;
    font-weight: 500;
    box-shadow: 0 1px 2px #00000070;
    color: #444;
    background: linear-gradient(135deg, #ffffff, #ffffff, #f2f2f2);
}
#composer-stage {
    flex-grow: 1;
    border-radius: 5px;
    padding: 40px 10px;
    /* --- CSS CHANGE: Allow bars to wrap into rows --- */
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0px;
    grid-auto-rows: 100px;
    row-gap: 10px;
    margin-top: 210px;
    position: relative;
}

#composer-stage.ts-6-8 {
    grid-template-columns: repeat(3, 1fr);
}
.bar {
    height: 80px;
    border-top: 1px solid #ededed;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #c3ffff1c;
    /* --- CSS CHANGE: Add margin for spacing between bars --- */
    /* margin: 5px; */
    min-width: 0; /* Prevents content from expanding width */
    box-sizing: border-box;
    position: relative;
    margin-right: -1px;
    border-left: none;
    border-right: none;
    box-shadow: 0 4px 3px -2px #b3b3b3;
    transition: .2s;
}
.block {
    width: 25%;
    height: 100%;
    border-left: 1px solid #79797926;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #000;
    padding: 8px;
    box-sizing: border-box;
    position: relative;
    z-index: 99;
    font-size: 1.2em;
    font-weight: 400;
    flex: 1;
}
.block.playing:after {
    content: '';
    position: absolute;
    height: 100px;
    width: 50px;
    background-image: url(note.gif);
    background-size: 100%;
    top: -100px;
    /* filter: grayscale(100%); */ /* 1. Apply grayscale */
    animation: slideIn 0.5s forwards; /* 2. Add animation */
    z-index:99999999999999999999;
    opacity:.9;
}
.bar:first-of-type .block.playing:first-of-type:after {
    content: '';
    position: absolute;
    height: 100px;
    width: 50px;
    background-image: url(note.gif);
    background-size: 100%;
    top: -102px;
    animation: unset;
}
/* Add this new keyframes rule */
@keyframes slideIn {
    from {
        left: -50px;
    }
    to {
        left: 15%;
    }
}
.block:before {
    content:'';
    position: absolute;
    left: 0;
    right: 0;
    top: -1000px;
    bottom: -3000px;
    border-left: 1px solid #ebebebb8;
    pointer-events: none;
}
.bar:after {
    content:'';
}
.bar:before {
    content:'';
    position: absolute;
    left: 0;
    right: 0;
    top: -1000px;
    bottom: -3000px;
    border-left: 1px solid #ffc3c3;
    z-index: 999;
    border-right: 1px solid #ffc3c3;
    pointer-events: none;
}
.block:first-child {
    border-left: none;
}
.chord-instance {
    padding: 5px 15px;
    /* background-color: #e0f0ff; */
    /* border: 1px solid #a0c0ff; */
    border-radius: 3px;
    width: 50px;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    color: #000000;
    font-size: .9em;
    font-family: "Limelight", sans-serif;
    pointer-events: none;
}
.controls {
    align-items: center;
    z-index: 9999;
    flex: 1;
    box-sizing: border-box;
}
.controls.actions {
    position: absolute;
    bottom: 10px;
    text-align: center;
    bottom: -14px;
    right: 10px;
    display: flex;
    gap: 5px;
}
.controls #strum-pattern-selector {
    width:100%;
    
}
#play-pause-btn {
    background: #e3dfffa6;
    color: #5c00ff;
    width: 75px;
}
button, select {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #fff;
    color: #333;
    font-size: 1em;
    font-family: "Bricolage Grotesque", sans-serif;
}
.actions button {
    background-color: #ffffffa6;
    box-shadow: 0 2px 2px #00000069;
    padding: 8px 10px;
}
.stop {
    width: 12px;
    height: 12px;
    display: inline-block;
    margin: 4px -1px;
    background: #000;
    border-radius: 3px;
}
.block.playing {
    background-color: #fffbe0;
}
.bar.playing-bar {

}
#play-pause-btn.playing {
    background-color: #ff180094;
    color: white;
    border-color: #c0392b;
}
.paused {
    background: #fffaba;
}			
#pattern-palette, #tone-palette {
    gap: 5px;
    z-index: 9999;
    position: relative;
    height: 142px;
    overflow: auto;
}

.pattern-item {
    align-items: center;
    padding: 7px 8px;
    background-color: #fff;
    cursor: pointer;
    margin: 3px;
    line-height: 1;
    margin-bottom: 7px;
    position: relative;
    text-transform: uppercase;
    box-shadow: 0 1px 2px #00000040;
    border-radius: 4px;
    display: inline-block;
    padding-right: 20px;
    font-size: .9em;
    letter-spacing: -1px;
    margin-top: 0;
    width: 45%;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    background: linear-gradient(135deg, #ffffff, #c6d6ff40);
}
.speed-controls {
    
}
.speed-controls input {
    
}
.speed-controls p {
    
}
.pattern-item.selected {color: #5c00ff;padding-left: 12px;}
.pattern-item.selected:after {content:'';background: #5c00ff;position: absolute;width: 5px;height: 5px;border-radius: 50%;left: 4px;top: 11px;}
.pattern-palette-row {
    text-align: center;
    margin-top: 35px;
    padding: 0 10px;
}
.pattern-palette-row .pattern-item {width: 21%;padding: 0;box-shadow: none;position: relative;overflow: visible;background: none;}
.pattern-item button {
    padding: 2px 8px;
    font-size: 0.8em;
    border: 1px solid #ccc;
    height: 12px;
    background: transparent;
    background-image: url(play.png);
    background-size: contain;
    position: absolute;
    border: navajowhite;
    right: 1px;
    width: 10px;
    background-repeat: no-repeat;
    opacity: .15;
    top: 8px;
}
.pattern-palette-row .pattern-item:after {
    content:'';
    width: 6px;
    height: 6px;
    position: absolute;
    background: #d1bce7;
    left: 0;
    right: 0;
    margin: 0 auto;
    top: -15px;
    z-index: 9999;
    border-radius: 50%;
}
.pattern-palette-row .pattern-item:before {
    content:'';
    width: 56px;
    height: 1px;
    position: absolute;
    background: #f5f5f5;
    left: 0;
    right: 0;
    margin: 0 auto;
    top: -13px;
    z-index: 9999;
    border-radius: 50%;
}
.pattern-palette-row .pattern-item.selected:after {
    background: #5c00ff;
}
.bar {
    position: relative; /* Needed for positioning the indicator */
}

.strum-pattern-indicator {
    position: absolute;
    top: -18px;
    right: 2px;
    font-size: 10px;
    color: #888;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: lowercase;
    font-family: "Bricolage Grotesque", sans-serif;
}
.drum-pattern-indicator {
    position: absolute;
    top: -18px;
    left: 2px;
    font-size: 10px;
    color: #888;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: lowercase;
    font-family: "Bricolage Grotesque", sans-serif;
}
.beat-pattern-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    left: 8px;
    font-size: 10px;
    color: #888;
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: lowercase;
    font-family: "Bricolage Grotesque", sans-serif;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* While dragging, slightly fade the non-target blocks */
.is-dragging .block {
}

/* Style for highlighting a single beat */
.block.highlight-beat {
    opacity: 1;
    background-color: rgb(226 255 248); /* Light blue */
}

/* Style for highlighting a whole bar */
.bar.highlight-bar .block {
    opacity: 1;
    background-color: rgb(193 255 238 / 40%); /* Light orange */
}
.bar.highlight-bar {
}

.note-item {
     /* A different color to distinguish from chords */
     color: #4d9927;
     background: linear-gradient(135deg, #ffffff, #ffffff, #abf5b140);
}

.note-instance {
    display: flex;
    color: #4d9927;
    font-size: .9em;
    font-family: "Limelight", sans-serif;
}

/* Target the whole scrollbar */
::-webkit-scrollbar {
  width: 10px; /* Width of the vertical scrollbar */
  height: 10px;
   
}

/* Target the track (the bar itself) */
::-webkit-scrollbar-track {
  background: #ffffff; /* Color of the track */
  border-radius: 5px;
}

/* Target the thumb (the draggable handle) */
::-webkit-scrollbar-thumb {
  background: #888; /* Color of the thumb */
  border-radius: 0px;
  border-bottom: 34px solid #fff;
  border-top: 25px solid #fff;
}

/* Change thumb color on hover */
::-webkit-scrollbar-thumb:hover {
  background: #555; 
}

.speed-control {text-align: center;margin-top: 25px;position: relative;margin: 25px 15px;}
.speed-control p {position: absolute;font-size: 14px;bottom: -22px;color: #8f8f8f;}
.speed-control input {margin: 0 auto;width: 50%;margin-top: 5px;}

input[type="range"] {
  /* Basic track styling */
  appearance: none;
  height: 2px;
  background: #ddd;
  border-radius: 5px;
}

input[type="range"]::-webkit-slider-thumb {
  /* Thumb for WebKit browsers */
  appearance: none;
  width: 14px;
  height: 14px;
  background: #5c00ff;
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  /* Thumb for Firefox */
  width: 14px;
  height: 14px;
  background: #5c00ff;
  border-radius: 50%;
  cursor: pointer;
}

.landing {
    position: absolute;
    top: 280px;
    text-align: center;
    width: 100%;
    font-family: "Bricolage Grotesque", sans-serif;
    color: #367d63;
    z-index: 999;
    pointer-events: none;
}
.land-hide {
    opacity:1;
    transition:.2s;
}
body.has-content .land-hide {
    opacity:0;
}

#download-btn {
    background: #4900cbb5;
    padding: 10px;
    box-sizing: border-box;
    color: #fff;
    width: 40px;
    background-image: url(download.png);
    background-repeat: no-repeat;
    background-size: 15px;
    background-position: center;
    height: 38px;
    box-shadow: 0 2px 2px #0000006b;
    position:relative;
}
#download-btn.processing {
    background: #ffffffcc;
    background-image: unset;
}
.processing:after {
    content:'';
    background-image: url(wave.gif);
    position: absolute;
    width: 24px;
    z-index: 999999999999999;
    height: 24px;
    top: 8px;
    left: 8px;
    bottom: 0;
    background-size: contain;
    right: 0;
    transform: rotate(15deg);
}
#download-btn img {
    width: 16px;
}

.user-controls button {
    display: block;
    margin: 0 auto;
    background: linear-gradient(45deg, #6105fb, #6105fb);
    color: #fff;
    margin-bottom: 20px;
    background: #fff;
    color: #6105fb;
    border: 1px solid #bdbdbd;
}

.user-controls p {
    font-size:15px;
    color: #9d9d9d;
    margin: 5px;
}

.foot {
    position: fixed;
    bottom: 10px;
    font-size: 15px;
}

.chord-instance, .note-instance, .strum-pattern-indicator, .beat-pattern-indicator, .drum-pattern-indicator {
  pointer-events: none;
}