:root {
  --bg-gradient-start: #2c3e50;
  --bg-gradient-end: #233140;
  --panel-bg: #34495e;
  --panel-border: #2c3e50;
  --shadow-dark: #1e2732;
  --shadow-light: #4a5a70;
  --text-color: #ecf0f1;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Teko", sans-serif;
}
.nav-link {
  font-family: "Roboto Mono", monospace;
}
p,
a {
  font-family: "Roboto Mono", monospace;
  font-weight: 400;
}
button {
  font-family: "Roboto Mono", monospace !important;
}
#basherButton {
  font-family: "Teko", sans-serif !important;
}
#vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 20vw rgba(177, 177, 177, 0);
  pointer-events: none;
  z-index: 100;
  transition: box-shadow 0.3s ease;
}

.scene {
  perspective: 1200px;
}

.console-panel {
  width: 440px;
  height: 450px;
  background: linear-gradient(145deg, var(--panel-bg), var(--shadow-dark));
  border-radius: 20px;
  border: 3px solid var(--panel-border);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.3);
  /* transform: rotateX(15deg); */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 30px;
  position: relative;
}

.button-area {
  width: 250px;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.button-housing {
  width: 220px;
  height: 220px;
  background: #2c3e50;
  border-radius: 50%;
  box-shadow: inset 0 10px 20px rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
}

#basherButton {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: white;
  font-family: "Teko", sans-serif;
  font-size: 48px;
  letter-spacing: 2px;
  text-shadow: 0 3px 5px rgba(0, 0, 0, 0.5);
  transform-style: preserve-3d;
  transition: all 0.15s ease-out;
  outline: none;
  position: relative;
  overflow: hidden;
}

/* --- THEMES --- */

/* 1. Overcharge Theme */
.theme-overcharge #basherButton {
  background: linear-gradient(180deg, #f39c12, #e67e22);
  box-shadow: 0 15px 25px rgba(243, 156, 18, 0.3), inset 0 5px 10px #f1c40f;
  transform: translateZ(30px);
}
.theme-overcharge #basherButton.pressed {
  transform: translateZ(5px);
  box-shadow: 0 2px 5px rgba(243, 156, 18, 0.5), inset 0 3px 8px #d35400;
}
.theme-overcharge #basherButton.charging::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0) 60%
  );
  animation: charge-pulse 1s infinite alternate;
}
@keyframes charge-pulse {
  from {
    transform: scale(0.5);
    opacity: 0.5;
  }
  to {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* 2. Hydraulic Theme */
.theme-hydraulic #basherButton {
  background: linear-gradient(180deg, #95a5a6, #7f8c8d);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), inset 0 0 15px #34495e;
  transform: translateZ(20px);
  transition: transform 0.4s cubic-bezier(0.8, 0, 0.2, 1); /* Slow, heavy transition */
}
.theme-hydraulic #basherButton.pressed {
  transform: translateZ(2px);
  background: linear-gradient(180deg, #7f8c8d, #95a5a6);
}

/* 3. Slime Theme */
.theme-slime #basherButton {
  background: linear-gradient(180deg, #2ecc71, #27ae60);
  box-shadow: 0 15px 25px rgba(46, 204, 113, 0.3), inset 0 5px 15px #adebad;
  transform: translateZ(25px);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy */
}
.theme-slime #basherButton.pressed {
  transform: translateZ(10px) scale(0.95);
}
.theme-slime #basherButton::after {
  /* Wobble effect */
  content: "";
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.2) 20%,
    transparent 70%
  );
  border-radius: 45%;
  animation: wobble 5s infinite ease-in-out;
}
@keyframes wobble {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
    border-radius: 45% 55% 60% 40%;
  }
  25% {
    transform: rotate(-5deg) scale(1.05);
    border-radius: 55% 45% 40% 60%;
  }
  50% {
    transform: rotate(0deg) scale(1);
    border-radius: 40% 60% 55% 45%;
  }
  75% {
    transform: rotate(5deg) scale(1.05);
    border-radius: 60% 40% 45% 55%;
  }
}

/* 4. Nuclear Theme */
.theme-nuclear #basherButton {
  background: linear-gradient(180deg, #e74c3c, #c0392b);
  box-shadow: 0 20px 30px rgba(192, 57, 43, 0.4), inset 0 5px 10px #ff7675;
  transform: translateZ(25px);
  border: 4px solid #c0392b;
}
.theme-nuclear #basherButton.pressed {
  transform: translateZ(0px);
  box-shadow: 0 0 10px rgba(192, 57, 43, 0.8), inset 0 2px 5px #7b241c;
}
.screen-shake {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes shake {
  10%,
  90% {
    transform: translate3d(-2px, 0, 0);
  }
  20%,
  80% {
    transform: translate3d(4px, 0, 0);
  }
  30%,
  50%,
  70% {
    transform: translate3d(-8px, 0, 0);
  }
  40%,
  60% {
    transform: translate3d(8px, 0, 0);
  }
}

/* --- Controls --- */
.controls-area {
  width: 100%;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 15px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
}
.theme-selector {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}
.theme-btn {
  flex-grow: 1;
  padding: 10px 5px;
  border: 2px solid var(--shadow-light);
  background: var(--panel-bg);
  color: var(--text-color);
  font-family: "Roboto Mono", monospace;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}
.theme-btn:hover {
  border-color: #fff;
  background: var(--shadow-light);
}
.theme-btn.active {
  color: #1e2732;
  border-color: #fff;
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.3);
  transform: translateY(2px);
}
.theme-btn.active.overcharge {
  background: #f39c12;
}
.theme-btn.active.hydraulic {
  background: #95a5a6;
}
.theme-btn.active.slime {
  background: #2ecc71;
}
.theme-btn.active.nuclear {
  background: #e74c3c;
}
.launch-family {
  font-family: "Teko", sans-serif;
}
@media screen and (max-width: 600px) {
  .scene {
    perspective: 1200px;
  }

  .console-panel {
    width: 340px;
    max-width: 500px;
    height: 370px;
    background: linear-gradient(145deg, var(--panel-bg), var(--shadow-dark));
    border-radius: 20px;
    border: 3px solid var(--panel-border);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4),
      inset 0 0 20px rgba(0, 0, 0, 0.3);
    /* transform: rotateX(15deg); */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    position: relative;
  }

  .button-area {
    width: 225px;
    height: 225px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
  }

  .button-housing {
    width: 190px;
    height: 190px;
    background: #2c3e50;
    border-radius: 50%;
    box-shadow: inset 0 10px 20px rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
  }

  #basherButton {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    color: white;
    font-family: "Teko", sans-serif;
    font-size: 31px;
    letter-spacing: 2px;
    text-shadow: 0 3px 5px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    transition: all 0.15s ease-out;
    outline: none;
    position: relative;
    overflow: hidden;
  }
  .theme-btn {
    padding: 7px 3px;
    font-size: 10px;
  }
}

.tool-container {
  background-color: #2c303a;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 400px;
  text-align: center;
  border: 1px solid #444;
}

.tool-title {
  margin-bottom: 25px;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 2px;
}

.stabilizer-display {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 20px auto 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stabilize-btn {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #833ab4, #fd1d1d, #fcb045);
  background-size: 200% 200%;
  color: white;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 25px rgba(253, 29, 29, 0.5),
    0 0 15px rgba(131, 58, 180, 0.4) inset;
  transition: transform 0.2s ease;
  animation: pulse 3s infinite ease-in-out, background-pan 5s infinite linear;
}

.stabilize-btn:hover {
  transform: scale(1.05);
}

.stabilize-btn:active {
  transform: scale(0.95);
  animation: none;
  /* Pause animation on click */
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.option-btn {
  background-color: #3a404d;
  border: 2px solid #555;
  color: #a0a0a0;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 700;
}

.option-btn:hover {
  background-color: #4a5162;
  color: #fff;
}

.option-btn.active {
  background-color: #833ab4;
  color: white;
  border-color: #fcb045;
  box-shadow: 0 0 15px rgba(252, 176, 69, 0.5);
}

.status-message {
  margin-top: 20px;
  color: #999;
  font-size: 14px;
  height: 20px;
  /* Reserve space to prevent layout shifts */
}

/* Animations */
@keyframes pulse {
  0% {
    box-shadow: 0 0 25px rgba(253, 29, 29, 0.4),
      0 0 15px rgba(131, 58, 180, 0.3) inset;
  }

  50% {
    box-shadow: 0 0 45px rgba(253, 29, 29, 0.8),
      0 0 25px rgba(131, 58, 180, 0.6) inset;
  }

  100% {
    box-shadow: 0 0 25px rgba(253, 29, 29, 0.4),
      0 0 15px rgba(131, 58, 180, 0.3) inset;
  }
}

@keyframes background-pan {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.reactor-container {
  background: #28313e;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 380px;
  text-align: center;
  border-top: 2px solid var(--glow-color);
  transition: border-top-color 0.5s ease;
}

.reactor-title {
  margin-bottom: 20px;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.core-display {
  margin: 30px 0;
}

.ignite-btn {
  width: 80%;
  padding: 20px;
  background: #1e252f;
  border: 2px solid var(--glow-color);
  color: white;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  border-radius: 5px;
  box-shadow: 0 0 15px var(--glow-color), 0 0 10px var(--glow-color) inset;
  transition: all 0.3s ease;
  clip-path: polygon(
    0 10px,
    10px 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%
  );
}

.ignite-btn:hover {
  box-shadow: 0 0 25px var(--glow-color), 0 0 15px var(--glow-color) inset;
}

.ignite-btn:disabled {
  cursor: not-allowed;
  background: #333;
  color: #777;
  border-color: #666;
  box-shadow: none;
}

.toggles-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.toggle-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 15px;
  border-radius: 6px;
}

.toggle-label {
  font-size: 16px;
  font-weight: 500;
  color: #ccc;
}

/* The switch - a checkbox-based toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #4a5568;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #03a9f4;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.status-panel {
  background: #1e252f;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 12px;
  min-height: 50px;
}

#statusText {
  margin: 0;
  color: #00ffc3;
  /* A nice "terminal green" color */
  font-weight: 500;
}
