html,
body {
    margin: 0;
    height: 100%;
    background: #000;
    color: #ccc;
    font-family: 'Courier New', monospace;
}

/* ===== Layout ===== */
#app {
    display: flex;
    height: 100vh;
    position: relative;
}

#view {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* ===== Oscilloscope Shell ===== */
#scope-shell {
    position: relative;
    width: 135vmin;
    aspect-ratio: 16/9;
    background: url("images/scope.png") center/contain no-repeat;
}

/* ===== Screen (Square Canvas) ===== */
#screen {
    position: absolute;
    left: 15%;
    top: 20%;
    width: 33%;
    aspect-ratio: 7/5;
    background: #000;
    overflow: hidden;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, .8),
        0 0 25px rgba(0, 255, 200, .25);
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ===== Play Button Overlay ===== */
#play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #0f8;
    background: rgba(0, 0, 0, .65);
    cursor: pointer;
    user-select: none;
    transition: .3s;
}

#play-btn:hover {
    background: rgba(0, 255, 200, .15);
}

#play-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ===== Main Controls Overlay ===== */
#main-controls {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(0, 255, 200, 0.4);
    border-radius: 8px;
    padding: 20px 25px;
    width: 280px;
    backdrop-filter: blur(10px);
}

.control-header {
    color: #0f8;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 255, 200, 0.3);
    padding-bottom: 8px;
}

.control-group {
    margin-bottom: 15px;
}

.control-label {
    display: block;
    color: #0f8;
    font-size: 11px;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

/* ===== Select Dropdown ===== */
.osc-select {
    width: 100%;
    background: #111;
    color: #0f8;
    border: 1px solid rgba(0, 255, 200, 0.4);
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
}

.osc-select:focus {
    outline: none;
    border-color: #0f8;
    box-shadow: 0 0 8px rgba(0, 255, 200, 0.3);
}

/* ===== Progress Bar ===== */
.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.osc-progress {
    flex: 1;
    height: 6px;
    background: #222;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.osc-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #0f8;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(0, 255, 200, 0.6);
}

.osc-progress::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #0f8;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(0, 255, 200, 0.6);
}

.progress-time {
    color: #8f8;
    font-size: 11px;
    min-width: 90px;
    text-align: right;
}

/* ===== Slider ===== */
.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.osc-slider {
    flex: 1;
    height: 4px;
    background: #222;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.osc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #0f8;
    border-radius: 50%;
    cursor: pointer;
}

.osc-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #0f8;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.slider-value {
    color: #8f8;
    font-size: 11px;
    min-width: 35px;
    text-align: right;
}

/* ===== Button ===== */
.osc-button {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: rgba(0, 255, 200, 0.1);
    border: 1px solid rgba(0, 255, 200, 0.4);
    color: #0f8;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.osc-button:hover {
    background: rgba(0, 255, 200, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 200, 0.3);
}

/* ===== Settings Panel ===== */
.settings-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 380px;
    height: 100vh;
    background: #0a0a0a;
    border-left: 2px solid rgba(0, 255, 200, 0.4);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0, 255, 200, 0.1);
    border-bottom: 1px solid rgba(0, 255, 200, 0.3);
    color: #0f8;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
}

.close-btn {
    background: none;
    border: none;
    color: #0f8;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(0, 255, 200, 0.2);
}

.settings-content {
    padding: 20px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #8f8;
    font-size: 12px;
    margin-bottom: 8px;
}

.setting-item input[type=range] {
    width: 200px;
    margin: 0 10px;
}

.value {
    color: #0f8;
    font-size: 12px;
    min-width: 35px;
    text-align: right;
}