/* Custom properties for easy manipulation via JS */
:root {
    --bulb-size: 60px;
    --intensity: 1;
}

body {
    background-color: #0d0614;
    color: #fff;
    font-family: 'Libre Franklin', 'Courier New', monospace;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    margin: 0;
}

/* --- 1. Glowing Header Font --- */
header h1 {
    font-family: 'Metal Mania', 'Courier New', monospace;
    color: #ff5500;
    font-size: 3.5rem;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-shadow:
        0 0 5px #ff5500,
        0 0 10px #ff5500,
        0 0 20px #ff3300,
        0 0 40px #ff3300,
        0 0 80px #ff0000;
}

header p {
    font-family: 'Libre Franklin',
    'Courier New',
    monospace;
    color: #aaa;
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* Controls Grid styling */
.controls {
    background: rgba(25, 15, 35, 0.6);
    border: 2px solid #ff5500;
    border-radius: 10px;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    width: 90%;
    max-width: 800px;
    margin-bottom: 40px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

label {
    font-size: 1rem;
    color: #aaa;
}

button {
    background-color: #ff5500;
    color: white;
    font-family: inherit;
    font-size: 1.2rem;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background-color: #ff3300;
}

/* Master grid container holding our rows vertically */
#gridContainer {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
    align-items: center;
}

/* Row layout: Aligns bulb circles side-by-side */
.lights {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    width: 100%;
}

/* Base Light Bulb Shape */
.light-bulb {
    width: var(--bulb-size);
    height: calc(var(--bulb-size) * 1.4);
    background-color: #222;
    border-radius: 50% 50% 40% 40%;
    position: relative;
    transition: background-color 0.05s ease, box-shadow 0.05s ease;
}

/* Traditional bulb base cap socket */
.light-bulb::before {
    content: '';
    position: absolute;
    top: calc(var(--bulb-size) * -0.15);
    left: calc(var(--bulb-size) * 0.3);
    width: calc(var(--bulb-size) * 0.4);
    height: calc(var(--bulb-size) * 0.15);
    background-color: #555;
    border-radius: 3px 3px 0 0;
}

/* Native Theme Colors when Active */
.light-bulb.purple.glow {
    background-color: rgba(160, 32, 240, var(--intensity));
    box-shadow: 0 0 calc(20px * var(--intensity)) #a020f0, 0 0 calc(40px * var(--intensity)) #800080;
}

.light-bulb.orange.glow {
    background-color: rgba(255, 85, 0, var(--intensity));
    box-shadow: 0 0 calc(20px * var(--intensity)) #ff5500, 0 0 calc(40px * var(--intensity)) #ff3300;
}

.light-bulb.red.glow {
    background-color: rgba(255, 0, 0, var(--intensity));
    box-shadow: 0 0 calc(20px * var(--intensity)) #ff0000, 0 0 calc(40px * var(--intensity)) #cc0000;
}

.light-bulb.green.glow {
    background-color: rgba(0, 255, 0, var(--intensity));
    box-shadow: 0 0 calc(20px * var(--intensity)) #00ff00, 0 0 calc(40px * var(--intensity)) #00aa00;
}

.light-bulb.white.glow {
    background-color: rgba(240, 248, 255, var(--intensity));
    box-shadow: 0 0 calc(20px * var(--intensity)) #f0f8ff, 0 0 calc(40px * var(--intensity)) #ffffff;
}

/* --- 2. Corner Layout Configurations --- */
.spooky-corner {
    position: fixed;
    bottom: 20px;
    display: flex;
    align-items: flex-end;
    gap: 20px;
    z-index: 1000;
    pointer-events: none;
    animation: floatingGlow 4s ease-in-out infinite;
}

.left-corner {
    left: 30px;
}

.right-corner {
    right: 30px;
    flex-direction: row-reverse;
}

/* --- 3. Pure CSS Ghost Shape --- */
.css-ghost {
    position: relative;
    width: 45px;
    height: 60px;
    background: #f0f0f0;
    border-radius: 25px 25px 0 0;
    box-shadow: 0 0 15px rgba(240, 240, 240, 0.6);
}

/* Ghost Eyes */
.ghost-eyes {
    position: absolute;
    top: 20px;
    left: 10px;
    width: 6px;
    height: 6px;
    background: #0d0614;
    border-radius: 50%;
    box-shadow: 18px 0 0 #0d0614;
}

/* Ghost Bottom Skirt Ripples */
.ghost-skirt {
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 8px;
    background-image: radial-gradient(circle at 50% 0%, transparent 4px, #f0f0f0 5px);
    background-size: 15px 12px;
}

/* --- 4. Pure CSS Pumpkin Shape --- */
.css-pumpkin {
    position: relative;
    width: 55px;
    height: 45px;
    background: #ff5500;
    border-radius: 50% 50% 45% 45%;
    box-shadow:
        0 0 15px rgba(255, 85, 0, 0.5),
        inset 8px 0 0 rgba(255, 115, 0, 0.5),
        inset -8px 0 0 rgba(255, 115, 0, 0.5);
}

/* Pumpkin Stem */
.pumpkin-stem {
    position: absolute;
    top: -8px;
    left: 24px;
    width: 7px;
    height: 10px;
    background: #4a7c59;
    border-radius: 3px 3px 0 0;
    transform: rotate(-10deg);
}

/* Pumpkin Carved Jack-O-Lantern Eyes */
.pumpkin-eyes {
    content: '';
    position: absolute;
    top: 14px;
    left: 13px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 7px solid #221100;
    box-shadow: 22px 0 0 transparent;
}

.pumpkin-eyes::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 7px solid #221100;
}

/* Pumpkin Carved Mouth Jagged Line */
.pumpkin-mouth {
    position: absolute;
    bottom: 10px;
    left: 15px;
    width: 25px;
    height: 8px;
    background: #221100;
    border-radius: 0 0 15px 15px;
}

/* --- 5. Ambient Float Animation Loop --- */
@keyframes floatingGlow {
    0% {
        transform: translateY(0px);
        filter: drop-shadow(0 0 5px rgba(255, 85, 0, 0.3));
    }

    50% {
        transform: translateY(-12px);
        filter: drop-shadow(0 0 20px rgba(255, 85, 0, 0.6)) drop-shadow(0 0 15px rgba(160, 32, 240, 0.4));
    }

    100% {
        transform: translateY(0px);
        filter: drop-shadow(0 0 5px rgba(255, 85, 0, 0.3));
    }
}
