header {
    text-align: center;
    padding: 20px 0;
    font-family: "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    color: #333;
}
header h1 {
    margin: 0;
    font-size: 2.5rem;
    letter-spacing: 2px;
}
header h2 {
    margin: 10px 0 0;
    font-size: 1.5rem;
    color: #666;
    font-weight: normal;
}
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid #ccc;
}
footer a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}
footer a:hover {
    text-decoration: underline;
}
body {
    background-color: #ffffff;
    margin: 0;
    padding-bottom: 50px;
}



#bus-container {
    position: relative;
    width: 2667px; 
    height: 989px;
    background-color: #fff;
    overflow: hidden;
}

#bus-container img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -ms-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

#bus-wrapper {
    width: 95%;
    max-width: 2667px;
    margin: 0 auto;
    overflow: hidden;
}

#bus-container > * {
    transform-origin: top left;
}

#bus-body {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    pointer-events: none;
}

.maku-layer {
    position: absolute;
    z-index: 5;
    transition-timing-function: linear;
    transform-origin: top;
}

/* 各幕の初期位置 */
#maku-front { left: 336px; top: 173px; width: 696px; }
#maku-side  { left: 2055px; top: 224px; width: 409px; }
#maku-rear  { left: 1176px; top: 601px; width: 343px; }

/* コントロールパネル */
#controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    font-family: sans-serif;
}
.control-panel {
    padding: 20px;
    background: #f0f0f0;
    border-radius: 8px;
    margin-top: 10px;
}

.serial-inputs {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: bold;
}

#status-lamp {
    font-size: 30px;
    color: #ccc;
    transition: color 0.2s;
}

#status-lamp.active {
    color: #ff0000;
    text-shadow: 0 0 10px rgba(255,0,0,0.5);
}

#mode-selector {
    margin-bottom: 10px;
}

.lamp-container {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
}

#status-lamp {
    font-size: 24px;
    line-height: 1;
}

.rotary-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #444;
    padding: 10px;
    border-radius: 5px;
    color: white;
}

.switches {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.rotary-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.rotary-val {
    width: 45px;
    height: 45px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    background: #eee;
    border: 3px solid #888;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none; 
}

.rotary-btn {
    width: 30px;
    height: 30px;
    cursor: pointer;
    background: #666;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
}

.rotary-btn:hover { background: #888; }
.rotary-btn:active { background: #444; }

.rotary-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}


.label {
    font-size: 12px;
    margin-bottom: 2px;
}

