.theremin-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* 映像・描画エリア */
.canvas-panel {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid #1e293b;
}

#output_canvas {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transform: scaleX(-1); /* 鏡合わせにする */
}

/* 演奏領域ガイド枠 */
#play-area-guide {
    position: absolute;
    top: 15%;
    left: 15%;
    width: 70%;
    height: 70%;
    border: 2px dashed rgba(59, 130, 246, 0.4);
    border-radius: 8px;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.1);
}

.guide-label {
    color: rgba(59, 130, 246, 0.7);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* オーバーレイ */
.overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
    z-index: 10;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay p {
    margin-top: 1rem;
    font-weight: bold;
    letter-spacing: 1px;
}

/* コントロールパネル (Glassmorphism) */
.control-panel {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
    color: #f8fafc;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.switch-group {
    flex-direction: row;
    align-items: center;
}

.control-group label {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.glass-select {
    background: rgba(15, 23, 42, 0.6);
    color: #e2e8f0;
    border: 1px solid #475569;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.glass-select:focus {
    border-color: #38bdf8;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

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

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

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

input:checked + .slider {
    background-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

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

.label-text {
    font-weight: bold;
    color: #cbd5e1;
}

/* 操作説明 */
.instructions {
    flex: 1;
    min-width: 250px;
    background: rgba(15, 23, 42, 0.4);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #38bdf8;
}

.instructions h4 {
    margin: 0 0 0.5rem 0;
    color: #38bdf8;
}

.instructions ul {
    margin: 0;
    padding-left: 1.2rem;
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .control-panel {
        flex-direction: column;
        gap: 1.5rem;
    }
    .instructions {
        width: 100%;
        box-sizing: border-box;
    }
}
