/* Page background */
#page-timekeepers-symphony {
    background: #4a3c41;
}

/* Instruction box */
.ui-instruction {
    border: 1px solid #000;
    background-color: #00ff00;
    color: #000;
    padding: 16px 40px 16px 16px;
    margin-top: 14px;
    position: relative;
    line-height: 1.5;
}

.ui-instruction[data-aos=fade-right] {
    opacity: 1;
    transform: scale(1.3) translate3d(-800px, 0, 0) !important;
    transition: all 4.5s cubic-bezier(0.6, 0, 0, 1) !important;
    transition-delay: 2.2s !important;
}

.ui-instruction[data-aos=fade-right].aos-animate {
    transform: scale(1) translate3d(0, 0, 0) !important;
}

.ui-instruction p {
    margin: 0 0 8px 0;
    font-size: 13px;
}

.ui-instruction ul {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
}

.ui-instruction li {
    margin-bottom: 4px;
}

.ui-instruction__close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 1;
    font-size: 16px;
}

.ui-instruction__close:after {
    content: "\e812";
    position: relative;
    width: 20px;
    height: 20px;
    z-index: 10;
    display: inline-block;
    font-family: fontello;
    color: #000;
}

/* Container positioning context */
#timekeepers-canvas {
    position: relative;
    height: calc(100vh - 120px);
    max-height: calc(100vh - 120px);
    overflow: visible;
}

#timekeepers-canvas canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Audio Overlay UI */
#audio-overlay {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 15px;
    z-index: 1000;
    width: min(700px, calc(100vw - 40px));
    box-sizing: border-box;
}

#audio-overlay-bg {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    z-index: -1;
}

.controls-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 16px;
    align-items: center;
    width: 100%;
}

/* Individual ring control group */
.ring-control {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

/* Mute toggle button (colored circle) */
.ring-mute {
    width: 36px;
    height: 36px;
    min-width: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid black;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    margin-bottom: -8px;
}

.ring-mute:hover {
    transform: scale(1.1);
}

.ring-mute.muted {
    filter: grayscale(100%);
    opacity: 0.4;
}

/* Slider wrapper */
.slider-wrap {
    flex: 1;
    position: relative;
    min-width: 60px;
    padding-top: 22px;
}

.slider-label {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 11px;
    color: #000;
    background: #fff;
    font-family: monospace;
    line-height: 1;
    padding: 2px 4px;
    border: 1px solid #000;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.slider-label.visible {
    opacity: 1;
}

/* Duration slider */
.duration-slider {
    width: 100%;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.duration-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 28px;
    border-radius: 5px;
    background: white;
    cursor: pointer;
}

.duration-slider::-moz-range-thumb {
    width: 10px;
    height: 28px;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    border: none;
}

/* Tablet */
@media (max-width: 768px) {
    #audio-overlay {
        bottom: 15px;
        padding: 10px 12px;
        gap: 10px;
        width: calc(100vw - 30px);
    }

    .controls-row {
        gap: 10px 12px;
    }

    .ring-control {
        gap: 8px;
    }

    .ring-mute {
        width: 30px;
        height: 30px;
        min-width: 30px;
    }

    .slider-wrap {
        min-width: 50px;
        padding-top: 20px;
    }

    .slider-label {
        font-size: 10px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    #timekeepers-canvas {
        height: calc(100vh - 150px);
        max-height: calc(100vh - 150px);
    }

    #audio-overlay {
        position: absolute;
        bottom: 10px;
        padding: 8px;
        gap: 6px;
        width: calc(100% - 16px);
        left: 8px;
        transform: none;
    }

    /* Two column layout for controls */
    .controls-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px 10px;
        width: 100%;
    }

    .ring-control {
        gap: 6px;
    }

    .ring-mute {
        width: 26px;
        height: 26px;
        min-width: 26px;
        border-width: 1px;
    }

    .slider-wrap {
        min-width: 40px;
        padding-top: 18px;
    }

    .slider-label {
        font-size: 9px;
        padding: 1px 3px;
    }

    .duration-slider::-webkit-slider-thumb {
        width: 6px;
        height: 20px;
    }

    .duration-slider::-moz-range-thumb {
        width: 6px;
        height: 20px;
    }
}

/* Canvas touch handling - allow scrolling while preserving tap for play/pause */
#timekeepers-canvas canvas {
    touch-action: manipulation;
}

/* Hide audio.js generated UI */
#sequencersContainer,
.sequencer,
.controls,
#startBtn,
#playBtn,
#stopBtn,
#resetBtn,
#status {
    display: none !important;
}
