:root {
  --bg-top: #070c14;
  --bg-bottom: #101725;
  --panel-border: rgba(120, 173, 214, 0.22);
  --text-main: #dfe7f2;
  --accent-glow: rgba(241, 174, 76, 0.2);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% -8%, rgba(54, 121, 196, 0.16), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(239, 167, 84, 0.12), transparent 46%),
    linear-gradient(165deg, var(--bg-top), var(--bg-bottom));
  color: var(--text-main);
  font-family: "Avenir Next", "Nunito Sans", "Segoe UI", sans-serif;
}

.siteContainer {
  max-width: 980px;
  margin: 20px auto;
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(9, 20, 33, 0.94), rgba(5, 13, 24, 0.94));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
}

.firstHeader {
  margin: 0;
  padding: 22px 0 12px;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-main);
  text-shadow: none;
}

.lightInfoContainer {
  padding-top: 12px;
}

.lightInfoDiv,
.lightInfoDivCollapsed {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  background: rgba(12, 19, 30, 0.6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  animation: card-enter 380ms ease both;
}

.lightInfoDivCollapsed:hover,
.lightInfoDiv:hover {
  background: rgba(18, 31, 48, 0.8) !important;
  border-color: rgba(241, 174, 76, 0.26);
}

.lightInfoDiv:nth-of-type(2n),
.lightInfoDivCollapsed:nth-of-type(2n) {
  animation-delay: 90ms;
}

.lightInfoDiv:nth-of-type(3n),
.lightInfoDivCollapsed:nth-of-type(3n) {
  animation-delay: 140ms;
}

.itemName {
  color: var(--text-main);
  letter-spacing: 0.04em;
}

.lightState,
.lightStateCollapsed {
  border-left: 2px solid rgba(241, 174, 76, 0.38);
}

.bulb {
  filter: drop-shadow(0 0 18px var(--accent-glow));
}

.groupSwitch {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(12, 20, 30, 0.55);
}

.colorIcon {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(14, 28, 42, 0.9);
}

.colorIcon:hover {
  border-color: rgba(241, 174, 76, 0.52);
  box-shadow: 0 0 0 3px rgba(241, 174, 76, 0.2);
}

.toggle-bg label.on,
.toggle-bg label.Lights,
.toggle-bg label.off {
  color: var(--text-main) !important;
}

.toggle-bg label.off {
  color: #6f7d93 !important;
  font-weight: 700;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .siteContainer {
    margin: 10px;
    border-radius: 16px;
  }
}

@media all and (min-width: 1024px) {
  body {
    width: auto !important;
    margin: 0 !important;
    padding: 0 24px;
  }

  .siteContainer {
    float: none !important;
    width: 100% !important;
    max-width: 1120px !important;
    margin: 24px auto !important;
  }

  #lightControllerDiv {
    float: none !important;
    width: auto !important;
    max-width: 1020px !important;
    margin: 0 auto 18px !important;
    text-align: center !important;
  }

  .lightInfoContainer {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 262px));
    justify-content: center;
    align-items: start;
    gap: 12px;
    padding-bottom: 10px;
  }

  .lightInfoDiv,
  .lightInfoDivCollapsed {
    float: none !important;
    display: block !important;
    margin: 0 !important;
  }

  .groupSwitch {
    grid-column: 1 / -1;
    justify-self: center;
    float: none !important;
    display: block !important;
    width: 15.48em !important;
    max-width: 100%;
    margin: 18px auto 8px !important;
    vertical-align: middle;
  }

  /* Demo: keep ALL LIGHTS geometry stable by driving knob from state class. */
  .groupSwitch input {
    width: 19.24em !important;
  }

  .groupSwitch .switch-group {
    width: 1.9em !important;
    height: 1.9em !important;
    border-radius: 2em !important;
    top: -0.05em !important;
  }

  .groupSwitch.on .switch-group {
    left: calc(100% - 2em) !important;
  }

  .groupSwitch.off .switch-group,
  .groupSwitch.Lights .switch-group {
    left: -0.1em !important;
  }

  .groupSwitch label.off.group {
    right: 0.35em !important;
  }

  .colorIcon {
    grid-column: 1 / -1;
    justify-self: center;
    float: none !important;
    display: block !important;
    width: 56px !important;
    height: auto !important;
    margin: 0 auto 22px !important;
    vertical-align: middle;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .colorIcon .colorIconImg {
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto;
    border-radius: 50%;
    border: 1px solid rgba(214, 226, 239, 0.55);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  }

  .colorIcon:hover {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .colorIcon:hover .colorIconImg {
    border-color: rgba(241, 174, 76, 0.7);
    box-shadow: 0 0 0 3px rgba(241, 174, 76, 0.22);
  }
}
