/* RESET & BASE */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: #1e1e2f;
font-family: 'Segoe UI', sans-serif;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
text-align: center;
}
h1 {
margin-bottom: 2rem;
font-size: 2rem;
font-weight: 600;
}
/* LAMP STRUCTURE */
.lamp-container {
position: relative;
width: 200px;
height: 350px;
margin: 0 auto 2rem;
}
.lamp {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
z-index: 2;
}
/* HEAD */
.lamp-head {
width: 80px;
height: 40px;
background: #3b82f6;
border-radius: 40% 40% 5px 5px;
box-shadow: inset 0 -5px 10px rgba(0,0,0,0.2);
z-index: 2;
}
/* ARM */
.lamp-arm {
width: 6px;
height: 80px;
background: #4b5563;
margin-top: 5px;
}
/* STAND */
.lamp-stand {
width: 10px;
height: 60px;
background: #4b5563;
margin-top: -10px;
z-index: 1;
}
/* BASE */
.lamp-base {
width: 100px;
height: 20px;
background: #374151;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0,0,0,0.3);
margin-top: 10px;
}
.lamp-light {
position: absolute;
top: 40px; /* just under lamp head */
left: 50%;
transform: translateX(-50%);
width: 120px;
height: 160px;
background: radial-gradient(
ellipse at center,
rgba(255, 255, 180, 0.35),
rgba(255, 255, 150, 0.2) 50%,
transparent 80%
);
opacity: 0;
transition: opacity 0.4s ease;
pointer-events: none;
z-index: 0;
filter: blur(2px);
clip-path: polygon(45% 0%, 55% 0%, 100% 100%, 0% 100%);
}
/* SWITCH */
.switch-wrapper {
display: flex;
margin-top: -120px; /* move up */
align-items: center;
justify-content: center;
gap: 1rem;
}
#lamp-status {
font-size: 1.2rem;
font-weight: bold;
}
/* TOGGLE SWITCH STYLE */
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0; left: 0; right: 0; bottom: 0;
background-color: #888;
transition: 0.4s;
border-radius: 34px;
}
.slider:before {
position: absolute;
content: "";
height: 24px;
width: 24px;
left: 5px;
bottom: 5px;
background-color: white;
transition: 0.4s;
border-radius: 50%;
}
input:checked + .slider {
background-color: #facc15;
}
input:checked + .slider:before {
transform: translateX(26px);
}