* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: #121212;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Roboto', sans-serif;
    user-select: none;
}

.wood-background {
    background: #3a2213;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.9);
}

.control-panel {
    position: relative;
    width: 880px;
    background-color: #33383c;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,0.02) 0px,
        rgba(255,255,255,0.02) 1px,
        transparent 1px,
        transparent 3px
    ), linear-gradient(90deg, #2b2f33 0%, #3e444a 50%, #2b2f33 100%);
    border-radius: 6px;
    padding: 25px;
    border: 1px solid #1a1a1a;
}

/* Panel Screws */
.screw {
    position: absolute; width: 14px; height: 14px;
    background: radial-gradient(circle, #d0d5d9 0%, #666a6d 100%);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.screw::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: 8px; height: 8px; background: #222;
    transform: translate(-50%, -50%);
    clip-path: polygon(40% 0, 60% 0, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0 60%, 0 40%, 40% 40%);
}
.screw-tl { top: 10px; left: 10px; transform: rotate(15deg); }
.screw-tr { top: 10px; right: 10px; transform: rotate(45deg); }
.screw-bl { bottom: 10px; left: 10px; transform: rotate(-20deg); }
.screw-br { bottom: 10px; right: 10px; transform: rotate(70deg); }
.screw-bc { bottom: 10px; left: 50%; transform: translateX(-50%) rotate(10deg); }

.panel-header {
    text-align: center; color: #d5dadf;
    font-size: 18px; font-weight: 700;
    letter-spacing: 1.5px; margin-bottom: 20px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}

.outline-box {
    border: 2px solid #798288;
    border-radius: 6px; position: relative;
}

.top-section {
    display: flex; justify-content: space-between;
    align-items: center; padding: 18px; margin-bottom: 20px;
}

/* LED Matrix Display */
.led-display {
    background-color: #030303;
    padding: 15px 20px; border-radius: 4px;
    border: 2px solid #111; width: 590px;
    font-family: 'Meddon', cursive;
    font-size: 22px; line-height: 1.5;
    position: relative; overflow: hidden;
    box-shadow: inset 0 0 12px rgba(0,0,0,1);
}
.led-grid-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(rgba(0,0,0,0.55) 1px, transparent 1px);
    background-size: 3px 3px; pointer-events: none;
}
.red { color: #ff4d4d; text-shadow: 0 0 6px #ff4d4d; }
.yellow { color: #ffcc00; text-shadow: 0 0 6px #ffcc00; }
.green { color: #4dff66; text-shadow: 0 0 6px #4dff66; }
.blue { color: #4d94ff; text-shadow: 0 0 6px #4d94ff; }
.cyan { color: #4deeea; text-shadow: 0 0 6px #4deeea; }
.white { color: #ffffff; text-shadow: 0 0 6px #ffffff; }

/* Interactive Knob */
.knob-wrapper {
    width: 120px; display: flex;
    justify-content: center; align-items: center;
}
.knob {
    width: 95px; height: 95px;
    background: radial-gradient(circle at 35% 35%, #4a4f54 0%, #111315 80%);
    border-radius: 50%; cursor: grab;
    box-shadow: 0 8px 18px rgba(0,0,0,0.8), inset 0 2px 3px rgba(255,255,255,0.3);
    position: relative; touch-action: none;
}
.knob:active { cursor: grabbing; }
.knob-pointer {
    position: absolute; top: 8px; left: 50%;
    transform: translateX(-50%);
    width: 4px; height: 12px; background: #fff;
    border-radius: 2px; box-shadow: 0 0 4px #fff;
}
.dimple {
    position: absolute; width: 8px; height: 8px;
    background: #080808; border-radius: 50%;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.9), 0 1px 1px rgba(255,255,255,0.1);
}
.d1 { top: 12px; left: 43px; } .d2 { top: 22px; left: 66px; } .d3 { top: 43px; left: 75px; }
.d4 { top: 65px; left: 66px; } .d5 { top: 74px; left: 43px; } .d6 { top: 65px; left: 20px; }
.d7 { top: 43px; left: 11px; } .d8 { top: 22px; left: 20px; }

/* Bottom Section */
.bottom-section { display: flex; gap: 15px; }

.switch-box {
    flex: 1; padding: 18px 10px;
    display: flex; flex-direction: column; align-items: center;
}
.box-title {
    position: absolute; top: -11px;
    background: #33383c; padding: 0 8px;
    color: #cad0d4; font-size: 14px; font-weight: 700;
    letter-spacing: 1px;
}
.switch-layout {
    display: flex; align-items: center;
    gap: 12px; margin-top: 5px;
}
.led-col, .label-col {
    display: flex; flex-direction: column;
    justify-content: space-between; height: 110px;
}
.label-col span { color: #c0c6ca; font-size: 12px; font-weight: 700; }

/* Indicator LEDs */
.led {
    width: 11px; height: 11px; border-radius: 50%;
    background: #181818; border: 1px solid #000;
}
.led.green.on { background: #4dff66; box-shadow: 0 0 8px #4dff66, inset 0 1px 2px #fff; }
.led.red.on { background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d, inset 0 1px 2px #fff; }

/* ========================================================
   ABSOLUTE NO-BOUNCE SWITCH OVERLAY
   ======================================================== */
.industrial-switch {
    position: relative;
    width: 80px;
    height: 120px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.switch-img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover; /* পিক্সেলে মিল না থাকলেও নিখুঁত ফিট করবে */
    transform: translate(-50%, -50%); /* একদম মাঝখানে লক করে রাখবে */
    filter: drop-shadow(0px 3px 5px rgba(0, 0, 0, 0.4));
    pointer-events: none;
    transition: none; /* কোনো টাইপ বাউন্স বা এনিমেশন হতে দেবে না */
}

/* State controls via visibility/opacity */
.industrial-switch[data-state="on"] .img-on {
    opacity: 1;
    visibility: visible;
}
.industrial-switch[data-state="on"] .img-off {
    opacity: 0;
    visibility: hidden;
}

.industrial-switch[data-state="off"] .img-on {
    opacity: 0;
    visibility: hidden;
}
.industrial-switch[data-state="off"] .img-off {
    opacity: 1;
    visibility: visible;
}

/* Voltmeter Gauge */
.gauge-box {
    width: 140px; display: flex;
    justify-content: center; align-items: center; padding: 10px;
}
.gauge {
    width: 105px; height: 105px;
    background: radial-gradient(circle, #e0e5e9 0%, #888c90 100%);
    border-radius: 50%; border: 3px solid #ccc;
    box-shadow: 0 6px 12px rgba(0,0,0,0.6), inset 0 2px 4px rgba(0,0,0,0.4);
    padding: 4px;
}
.gauge-inner {
    width: 100%; height: 100%; background: #fff;
    border-radius: 50%; position: relative;
}
.gauge-face { width: 100%; height: 100%; }
.gauge-lbl { font-size: 7px; fill: #222; font-weight: bold; }
.gauge-title { font-size: 6px; fill: #555; font-weight: bold; letter-spacing: 0.5px; }

.needle {
    position: absolute; top: 50%; left: 50%;
    width: 2px; height: 40px; background: #d32f2f;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(-120deg);
    transition: transform 0.08s ease-out;
    border-radius: 1px;
}
.pin {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 10px; height: 10px; background: #222; border-radius: 50%;
    border: 1px solid #666;
}