html {
    height: 100%;
    width: 100%;
}

body {
    font: 80% system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    max-width: 80em;
    min-height: 100vh;
    box-sizing: border-box;
    margin: 0 auto; /* Center horizontally */
    padding: 1em;
}

header {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    align-items: baseline;
}

/* Container for the speed control to prevent shifting */
#controls {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    margin-top: 1em;
    padding: 1em;
    background: #f5f5f5;
    border-radius: 8px;
}

/* ===== TOUCHSCREEN CONTROL ZONE ===== */
#touchscreen-zone {
    margin: 1.5em 0;
    padding: 1em;
    background: linear-gradient(to bottom, #f0f4ff, #ffffff);
    border-radius: 12px;
}

#touch-control-area {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 300px;
    margin: 0 auto;
    background: lightgrey;
    border: 4px solid #333;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.15);
}



.zone-label {
    position: absolute;
    font-size: 1.5em;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
}

.left-label {
    left: 10%;
}


.right-label {
    right: 10%;
}

#touch-indicator {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.8);
    border: 4px solid #fff;
    border-radius: 50%;
    pointer-events: none;
    transition: all 0.1s ease;
    display: none;
}

#touch-indicator.active {
    display: block;
}

/* Remove the old zone-speed-display since we're moving it */
#zone-speed-display {
    display: none;
}

/* Add this after the #touchscreen-zone rule (around line 40) */

#touch-and-controls-container {
    display: flex;
    gap: 2em;
    align-items: flex-start;
    margin-top: 1em;
}

#touch-control-wrapper {
    flex: 2;
    min-width: 300px;
}

#gesture-parameters {
    flex: 1;
    min-width: 250px;
    padding: 1em;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#gesture-parameters h3 {
    margin: 0 0 1em 0;
    font-size: 1.1em;
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 0.5em;
}

.param-group {
    margin-bottom: 1em;
    display: flex;
    flex-direction: column;
    gap: 0.3em;
}

.param-group label {
    font-weight: 500;
    color: #555;
    font-size: 0.9em;
}

.param-group input[type="range"],
.param-group input[type="number"] {
    width: 100%;
}

.param-group span {
    font-weight: bold;
    color: #4CAF50;
    font-size: 1.5em;
}

.readonly-slider {
    display: flex;
    align-items: center;
    gap: 0.5em;
    color: #888;
}

.param-group .readonly-slider span {
    font-weight: 500;
    color: #888;
    font-size: 0.9em;
}

.param-group .readonly-slider input[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.editable-number {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    user-select: none;
    transition: color 0.2s;
}

.editable-number:hover {
    color: #2196F3;
}

/* Input Mode Toggle */
#input-mode-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1em;
    margin-bottom: 1em;
    padding: 0.5em;
}

#input-mode-toggle-container label:first-child {
    font-weight: bold;
    color: #333;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

#fine-tune-controls {
    display: flex;
    flex-direction: row;
    gap: 0.5em;
    margin-top: 1em;
}

#speed-label {
    display: inline-block;
    min-width: 5ch; /* Reserve space for "-2.00x" */
    text-align: left; /* Keep left aligned within reserved space */
    font-variant-numeric: tabular-nums; /* Use monospace numbers */
}

p{
    margin: 0;
    font-weight: normal;
    font-size: 1.2em; 
    color: black;
}

h2 {
    margin: 0;
    font-weight: normal;
    font-size: 2em; 
    color: black;
}

/* ===== PROGRESS BAR ===== */
#progress-bar {
    width: 100%;
    height: 20px;
    appearance: none;
    background: transparent;
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    margin: 0.5em 0;
}

/* Track styling */
#progress-bar::-webkit-slider-runnable-track {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
}


/* Thumb styling - Chrome/Safari/Edge */
#progress-bar::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    background: white;
    border: 3px solid cornflowerblue;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: -2px;
}

#progress-bar::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

#progress-bar::-webkit-slider-thumb:active {
    transform: scale(1.05);
}

/* Responsive: stack on smaller screens */
@media (max-width: 768px) {
    #touch-and-controls-container {
        flex-direction: column;
    }
    
    #touch-control-wrapper,
    #gesture-parameters {
        width: 100%;
        min-width: 0;
    }
}



