:root {
  --neon-teal: #00ffff;
  --charge-gradient: linear-gradient(to top, red, yellow, lime);
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  image-rendering: pixelated;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Orbitron', sans-serif;
  background: #000;
  color: #ccc;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overflow-y: auto;
  font-size: clamp(14px, 2vw, 18px);
  height: 100%;
}

/* HEADER */
header.widgetwheel-header {
  width: 100%;
  padding: 2rem;
  background: rgba(17, 17, 17, 0.85);
  border: 4px double var(--neon-teal);
  text-align: center;
  box-shadow: 0 0 20px var(--neon-teal);
  position: relative;
  overflow: hidden;
  animation: strobeHeader 2s infinite;
  @keyframes strobeHeader {
  0%, 17%, 19%, 21%, 23%, 25%, 100% { opacity: 1; }
  18%, 20%, 22%, 24% { opacity: 0.2; }
}

.widgetwheel-title {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--neon-teal);
  text-shadow: 0 0 15px var(--neon-teal), 0 0 30px white;
}

.widget-subtext {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.75rem, 2.5vw, 1.3rem);
  color: var(--neon-yellow);
  text-shadow: 0 0 10px var(--neon-yellow), 0 0 20px var(--neon-yellow);
  position: absolute;
  left: -100%;
  top: 68%;
  transform: translateY(-50%);
  white-space: nowrap;
  animation: swipeIn 2s forwards 1.5s;
}


}

@keyframes strobeHeader {
  0%, 17%, 19%, 21%, 23%, 25%, 100% { opacity: 1; }
  18%, 20%, 22%, 24% { opacity: 0.2; }
}

@keyframes swipeIn {
  0% { left: -100%; }
  100% { left: 50%; transform: translateX(-50%) translateY(-50%); }
}

.home-button-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 3rem 0 4rem 0;
}

.home-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  padding: 1rem 2rem;
  font-weight: bold;
  border-radius: 10px;
  border: 3px solid silver;
  background: var(--neon-teal);
  color: #0e1a2b;
  box-shadow: 0 0 20px silver;
  text-decoration: none;
  transition: all 0.3s ease;
  text-align: center;
}

.home-button:hover {
  background: silver;
  color: #000;
  box-shadow: 0 0 35px var(--neon-teal);
}

.home-button span.emoji {
  font-size: 2rem;
  line-height: 1;
}

.widget-watts,
.total-widget-watts {
  width: 90%;
  max-width: 320px;
  margin: 0.5rem auto;
  padding: 0.4rem;
  text-align: center;
  border-radius: 8px;
  font-size: clamp(0.9rem, 2.2vw, 1.1rem);
}

.widget-watts {
  border: 2px solid #999;
  background: #111;
  color: #ccc;
}

.total-widget-watts {
  border: 2px solid #fff;
  background: linear-gradient(90deg, red, orange, yellow, green, blue, indigo, violet);
  color: white;
  box-shadow: 0 0 20px rgba(255,255,255,0.2);
}

#wattCount,
#storedWattCount {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  margin-top: 0.25rem;
}

.main-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.5rem;
  gap: 0.75rem;
}

.game-layout-wrapper {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 1rem;
  max-width: 1000px;
  width: 100%;
}

.battery-column {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 0 0 80px;
}

.component-button {
  background: #222;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1.4;
}

.component-button img {
  width: 90%;
  height: auto;
  filter: grayscale(100%) brightness(0.5);
}

.game-widget {
  box-sizing: border-box;
  width: 280px;
  padding: 0.5rem;
  background: var(--charge-gradient);
  border: 4px solid #ffaa00;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  transition: background 0.3s ease-in-out;
}

.game-square {
  width: 60%;
  aspect-ratio: 1 / 1;
  background: #222;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-square img {
  width: 90%;
  filter: grayscale(100%) brightness(0.5);
}

.cradle.active {
  background: #00ffff;
  box-shadow: 0 0 20px cyan;
}

.cradle.active img {
  filter: brightness(2.5) drop-shadow(0 0 10px cyan);
}

.lightbulb.active {
  background: linear-gradient(45deg, red, orange, yellow, green, blue, indigo, violet);
  box-shadow: 0 0 30px yellow, 0 0 60px white;
  animation: rainbowFlash 0.5s infinite;
}

.lightbulb.active img {
  filter: brightness(2.5);
}

@keyframes rainbowFlash {
  0% { filter: hue-rotate(0deg) brightness(2); }
  50% { filter: hue-rotate(180deg) brightness(3) drop-shadow(0 0 15px yellow); }
  100% { filter: hue-rotate(360deg) brightness(2); }
}

.battery.pulse {
  background: #0f0;
  animation: pulseBattery 0.6s infinite alternate;
  box-shadow: 0 0 12px #0f0, 0 0 20px white !important;
}

.battery.pulse img {
  filter: brightness(2) drop-shadow(0 0 5px white);
}

@keyframes pulseBattery {
  0% {
    box-shadow: 0 0 8px #0f0, 0 0 10px white;
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 30px white, 0 0 40px #0f0;
    transform: scale(1.1);
  }
  100% {
    box-shadow: 0 0 20px #0f0, 0 0 30px white;
    transform: scale(1);
  }
}

.widget-description {
  max-width: 900px;
  margin: 2rem auto;
  padding: 2rem;
  border: 3px solid silver;
  border-radius: 12px;
  background-color: rgba(0, 0, 0, 0.6);
  color: var(--neon-teal);
  font-family: 'Orbitron', sans-serif;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

.widget-description h3 {
  color: silver;
  text-shadow: 0 0 10px silver;
  margin-bottom: 1rem;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
}

@media (max-width: 768px) {
  .game-layout-wrapper {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
    align-items: stretch;
  }

  .battery-column {
    width: 20vw;
    gap: 0.3rem;
  }

  .game-widget {
    width: 50vw;
  }

  .game-square {
    width: 70%;
  }

  .game-square img {
    width: 90%;
  }
}

body.charged {
  animation: rainbowBg 10s infinite linear;
}

@keyframes rainbowBg {
  0%   { background: #000; }
  14%  { background: red; }
  28%  { background: orange; }
  42%  { background: yellow; }
  56%  { background: green; }
  70%  { background: blue; }
  84%  { background: indigo; }
  100% { background: violet; }
}