:root {
    --xmas-wire-color: #2a2a2a;
    --xmas-wire-flow: #00f0ff;
}

.light-string-container {
    position: fixed;
    top: -12px;
    left: 0;
    width: 100%;
    height: 120px;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 10000;
}

.wire-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: 1;
    overflow: visible;
}

.wire-path {
    fill: none;
    stroke: var(--xmas-wire-color);
    stroke-width: 2.3;
    stroke-linecap: round;
    filter: drop-shadow(0 2px 1px rgba(0,0,0,0.6));
}

.wire-flow {
    fill: none;
    stroke: color-mix(in srgb, var(--xmas-wire-flow) 80%, white);
    stroke-width: 1.3;
    stroke-linecap: round;
    opacity: 0.55;
    stroke-dasharray: 6 12;
    filter:
        drop-shadow(0 0 8px rgba(0, 240, 255, 0.35))
        drop-shadow(0 0 14px rgba(0, 240, 255, 0.20));
    animation: wireFlow 1.25s linear infinite;
}

.light-fixture {
    position: relative;
    z-index: 2;
    top: 10px;
    width: 32px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: top center;
    animation: swing var(--swing-duration, 3s) ease-in-out infinite alternate;
    animation-delay: var(--swing-delay, 0s);
}

.socket {
    width: 11px;
    height: 14px;
    background: linear-gradient(90deg, #111 0%, #333 40%, #222 100%);
    border-radius: 2px 2px 4px 4px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 2px 4px rgba(0,0,0,0.8);
    position: relative;
    z-index: 3;
    margin-bottom: -1px;
}

.socket::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.bulb {
    width: 18px;
    height: 36px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    z-index: 2;
    cursor: default;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(1px);
    box-shadow: inset 0 0 4px rgba(0,0,0,0.6), inset 2px 2px 6px rgba(255,255,255,0.1);
    animation: breathe var(--flash-duration, 2s) ease-in-out infinite alternate;
    animation-delay: var(--flash-delay, 0s);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bulb::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 20%;
    height: 25%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(-45deg);
    opacity: 0.6;
    filter: blur(0.5px);
}

.bulb::after {
    content: '';
    position: absolute;
    top: 24%;
    left: 50%;
    transform: translateX(-50%);
    width: 44%;
    height: 54%;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, transparent 60%);
    opacity: 0.8;
    mix-blend-mode: overlay;
}

.bulb.faulting {
    animation: none;
    opacity: 0.25;
    filter: saturate(0.7) brightness(0.8);
    box-shadow:
        inset 0 0 6px rgba(0,0,0,0.65),
        0 0 6px rgba(var(--bulb-color), 0.15);
}

.bulb.fault-flicker {
    animation: glitchFlicker 140ms steps(2, end) infinite;
    opacity: 0.95;
    filter: saturate(1.15) brightness(1.35);
}

.bulb.red {
    --bulb-color: 255, 59, 48;
    background-color: rgba(var(--bulb-color), 0.3);
}

.bulb.blue {
    --bulb-color: 10, 132, 255;
    background-color: rgba(var(--bulb-color), 0.3);
}

.bulb.green {
    --bulb-color: 48, 209, 88;
    background-color: rgba(var(--bulb-color), 0.3);
}

.bulb.gold {
    --bulb-color: 255, 214, 10;
    background-color: rgba(var(--bulb-color), 0.3);
}

@keyframes breathe {
    0% {
        opacity: 0.5;
        box-shadow: inset 0 -5px 10px rgba(0,0,0,0.2), 0 0 4px rgba(var(--bulb-color), 0.3);
    }
    100% {
        opacity: 1;
        box-shadow:
            inset 0 -2px 5px rgba(0,0,0,0.1),
            0 0 10px rgba(var(--bulb-color), 0.8),
            0 10px 30px rgba(var(--bulb-color), 0.4),
            0 20px 60px rgba(var(--bulb-color), 0.1);
    }
}

@keyframes swing {
    0% { transform: rotate(-4deg); }
    100% { transform: rotate(4deg); }
}

@keyframes wireFlow {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -36; }
}

@keyframes glitchFlicker {
    0% {
        transform: translateX(0);
        box-shadow:
            0 0 10px rgba(var(--bulb-color), 0.8),
            0 10px 26px rgba(var(--bulb-color), 0.30);
    }
    50% {
        transform: translateX(0.5px);
        box-shadow:
            0 0 18px rgba(var(--bulb-color), 0.9),
            0 14px 34px rgba(var(--bulb-color), 0.40);
    }
    100% {
        transform: translateX(-0.5px);
        box-shadow:
            0 0 8px rgba(var(--bulb-color), 0.65),
            0 10px 22px rgba(var(--bulb-color), 0.25);
    }
}

@media (max-width: 600px) {
    .light-string-container { padding: 0 10px; height: 90px; top: -8px; }
    .wire-svg { height: 58px; }
    .wire-path { stroke-width: 2; }
    .wire-flow { stroke-width: 1.1; }
    .light-fixture { transform: scale(0.62); top: 6px; }
}
