* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #0d0d0d;
  background-image: radial-gradient(#1a1a1a 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Rubik', Arial, Helvetica, sans-serif;
  overflow: hidden;
}

/* Global utility class for toggling interface elements */
.hidden {
  display: none !important;
}

.scale-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.artboard {
  width: 800px;
  height: 800px;
  position: relative;
  overflow: hidden;
  background-color: #007334;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 6px solid #2a0067;
  border-radius: 8px;
  flex: 0 0 800px;
  user-select: none;
  transition: border-color 0.15s ease;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.7);
}

.artboard.connected {
  border-color: #58ef79;
}

.view-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 648px;
}

/* Onboarding Screen */
.onboarding-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 648px;
  background: #ebe8c8;
  border-bottom: 4px solid #23405f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 50;
  color: #23405f;
  text-align: center;
}

.onboarding-screen h2 {
  font-size: 32px;
  margin-bottom: 10px;
}

.onboarding-screen p {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 24px;
  max-width: 500px;
}

.onboarding-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.token-input {
  width: 320px;
  height: 50px;
  border: 4px solid #23405f;
  border-radius: 12px;
  font-size: 20px;
  font-family: monospace;
  text-align: center;
  font-weight: 900;
  outline: none;
}

.onboarding-btn {
  background: #39a150;
  color: white;
  border: 4px solid #23405f;
  border-radius: 12px;
  padding: 12px 30px;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.1s;
}

.onboarding-btn:hover {
  transform: scale(1.05);
}

.onboarding-btn.secondary {
  background: #f3ef00;
  color: #23405f;
}

.toast-indicator {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: #ffef00;
  color: #2a0067;
  border: 4px solid #2a0067;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 18px;
  font-weight: 900;
  z-index: 100;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s;
  pointer-events: none;
}

.toast-indicator.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hero {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 456px;
  background: url("https://i.ibb.co/RkGxK7Qp/full-resolution-pixelated.png") center center / cover no-repeat;
  border-bottom: 4px solid #23405f;
}

/* Position placement of Rocker Switch in Chassis */
.switch-positioner {
  position: absolute;
  right: 92px;
  top: 130px;
  z-index: 10;
}

/* --- INTEGRATED 3D ROCKER SWITCH (Uiverse.io by ali-hv) --- */
.switch {
  display: block;
  background-color: black;
  width: 150px;
  height: 195px;
  box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.2), 0 0 1px 2px black,
    inset 0 2px 2px -2px white, inset 0 0 2px 15px #47434c,
    inset 0 0 2px 22px black;
  border-radius: 5px;
  padding: 20px;
  perspective: 700px;
}

.switch input {
  display: none;
}

.switch input:checked + .button {
  transform: translateZ(20px) rotateX(25deg);
  box-shadow: 0 -10px 20px #1cff42;
}

.switch input:checked + .button .light {
  animation: flicker 0.2s infinite 0.3s;
}

.switch input:checked + .button .shine {
  opacity: 1;
}

.switch input:checked + .button .shadow {
  opacity: 0;
}

.switch .button {
  display: block;
  transition: all 0.3s cubic-bezier(1, 0, 1, 1);
  transform-origin: center center -20px;
  transform: translateZ(20px) rotateX(-25deg);
  transform-style: preserve-3d;
  background-color: #03a614;
  height: 100%;
  position: relative;
  cursor: pointer;
  background: linear-gradient(
    #02961d 0%,
    #005e02 30%,
    #006300 70%,
    #009100 100%
  );
  background-repeat: no-repeat;
}

.switch .button::before {
  content: "";
  background: linear-gradient(
        rgba(255, 255, 255, 0.8) 10%,
        rgba(255, 255, 255, 0.3) 30%,
        #055c00 75%,
        #022e00
      )
      50% 50%/97% 97%,
    #00b00f;
  background-repeat: no-repeat;
  width: 100%;
  height: 50px;
  transform-origin: top;
  transform: rotateX(-90deg);
  position: absolute;
  top: 0;
}

.switch .button::after {
  content: "";
  background-image: linear-gradient(#006600, #003008);
  width: 100%;
  height: 50px;
  transform-origin: top;
  transform: translateY(50px) rotateX(-90deg);
  position: absolute;
  bottom: 0;
  box-shadow: 0 50px 8px 0px black, 0 80px 20px 0px rgba(0, 0, 0, 0.5);
}

.switch .light {
  opacity: 0;
  animation: light-off 1s;
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(#7dff83, #1bff17 40%, transparent 70%);
}

.switch .dots {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(transparent 30%, rgba(6, 97, 0, 0.7) 70%);
  background-size: 10px 10px;
}

.switch .characters {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(white, white) 50% 20%/5% 20%,
    radial-gradient(
        circle,
        transparent 50%,
        white 52%,
        white 70%,
        transparent 72%
      )
      50% 80%/33% 25%;
  background-repeat: no-repeat;
}

.switch .shine {
  transition: all 0.3s cubic-bezier(1, 0, 1, 1);
  opacity: 0.3;
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(white, transparent 3%) 50% 50%/97% 97%,
    linear-gradient(
        rgba(255, 255, 255, 0.5),
        transparent 50%,
        transparent 80%,
        rgba(255, 255, 255, 0.5)
      )
      50% 50%/97% 97%;
  background-repeat: no-repeat;
}

.switch .shadow {
  transition: all 0.3s cubic-bezier(1, 0, 1, 1);
  opacity: 1;
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(transparent 70%, rgba(0, 0, 0, 0.8));
  background-repeat: no-repeat;
}

@keyframes flicker {
  0% {
    opacity: 1;
  }

  80% {
    opacity: 0.8;
  }

  100% {
    opacity: 1;
  }
}

@keyframes light-off {
  0% {
    opacity: 1;
  }

  80% {
    opacity: 0;
  }
}

/* Control Layout Styling */
.controls {
  position: absolute;
  left: 0;
  top: 456px;
  width: 100%;
  height: 288px;
  background: transparent;
}

.button-row {
  position: absolute;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 58px;
}

.btn-wrapper {
  position: relative;
  width: 278px;
  height: 105px;
}

.big-btn {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -1px;
  cursor: pointer;
  border: 4px solid #23405f;
  outline: none;
  transition: transform 0.15s ease, background-color 0.15s;
}

.big-btn:hover {
  transform: translateY(-2px);
}

.big-btn:active {
  transform: translateY(1px);
}

.opera {
  background: #39a150;
  color: rgba(0, 0, 0, 0.45);
}

.opera.active {
  background: #58ef79;
  color: #000000;
}

.warp {
  background: #9d9900;
  color: rgba(27, 15, 127, 0.45);
}

.warp.active {
  background: #f4ef00;
  color: #1b0f7f;
}

.badge-recommended {
  position: absolute;
  top: -16px;
  right: -10px;
  background: #ff3366;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 8px;
  border: 3px solid #2a0067;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
  pointer-events: none;
}

.settings-top-bar {
  width: 736px;
  margin: 28px auto 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-back-btn {
  background: #ebe8c8;
  border: 3px solid #23405f;
  color: #23405f;
  font-size: 16px;
  font-weight: 900;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: background-color 0.1s;
}

.settings-back-btn:hover {
  background: #dfdac0;
}

.settings-title {
  color: #ffef00;
  font-family: "Courier New", monospace;
  font-size: 22px;
  font-weight: 900;
}

.panels {
  position: absolute;
  top: 90px;
  left: 32px;
  width: 736px;
  height: 514px;
  display: grid;
  grid-template-columns: 1fr 198px;
  gap: 16px;
  justify-items: stretch;
  transition: grid-template-columns 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel {
  background: #ebe8c8;
  border: 3px solid #23405f;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel .head {
  height: 52px;
  background: #7db08d;
  color: #143c2c;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  font-family: "Courier New", monospace;
  font-size: 28px;
  font-weight: 900;
  border-bottom: 3px solid #23405f;
}

.panel.right .head {
  font-size: 29px;
  text-transform: lowercase;
  justify-content: center;
}

.notepad-area {
  width: 100%;
  height: 100%;
  min-height: 250px;
  flex: 1;
  background: #fdf6e2;
  border: 3px solid #23405f;
  border-radius: 6px;
  font-family: "Courier New", monospace;
  font-weight: 900;
  font-size: 16px;
  line-height: 24px;
  color: #143c2c;
  padding: 8px 15px;
  resize: none;
  outline: none;
  background-image: linear-gradient(rgba(35, 64, 95, 0.12) 1px, transparent 1px);
  background-size: 100% 24px;
}

.notepad-hint {
  font-family: "Courier New", monospace;
  font-size: 13px;
  font-weight: 900;
  color: #143c2c;
  text-align: center;
  margin-top: 4px;
}

.toggle-editor-btn {
  background: #ebe8c8;
  border: 2px solid #23405f;
  border-radius: 6px;
  color: #23405f;
  font-family: "Courier New", monospace;
  font-size: 14px;
  font-weight: 900;
  padding: 4px 10px;
  cursor: pointer;
  outline: none;
  transition: background-color 0.1s;
}

.toggle-editor-btn:hover {
  background: #dfdac0;
}

.panel-inner {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.panel-inner::-webkit-scrollbar {
  width: 10px;
}
.panel-inner::-webkit-scrollbar-track {
  background: #dfdac0;
  border-left: 2px solid #23405f;
}
.panel-inner::-webkit-scrollbar-thumb {
  background: #7db08d;
  border: 2px solid #23405f;
  border-radius: 4px;
}

.rule-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.rule-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 2px dotted rgba(35, 64, 95, 0.3);
  font-family: "Courier New", monospace;
  font-weight: 900;
  font-size: 18px;
  color: #143c2c;
}

.btn-delete-rule {
  background: none;
  border: none;
  color: #cc2244;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 4px;
}

.btn-delete-rule:hover {
  color: #ff0000;
}

.add-rule-form {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.add-rule-form input {
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border: 3px solid #23405f;
  border-radius: 6px;
  background: #ffffff;
  font-family: "Courier New", monospace;
  font-weight: 900;
  font-size: 16px;
  color: #143c2c;
  outline: none;
}

.add-rule-form button {
  width: 46px;
  height: 42px;
  background: #7db08d;
  border: 3px solid #23405f;
  border-radius: 6px;
  color: #143c2c;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-rule-form button:hover {
  background: #5e9570;
}

.location-option {
  font-family: "Courier New", monospace;
  font-weight: 900;
  font-size: 16px;
  color: #143c2c;
  padding: 10px;
  border-bottom: 2px dotted rgba(35, 64, 95, 0.3);
  cursor: pointer;
}

.location-option:hover {
  background: rgba(125, 176, 141, 0.2);
}

.location-option.selected {
  background: #7db08d;
  color: #ffffff;
  border-radius: 4px;
}

.panels.warp-active {
  grid-template-columns: 1fr;
  justify-items: center;
}

.panels.warp-active .panel.left {
  width: 530px; 
  height: 100%;
}

.panels.warp-active .panel.right {
  display: none !important;
}

.spice-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 92px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffef00;
  font-size: 37px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
  padding: 5px 15px;
  border-radius: 8px;
  transition: transform 0.15s ease;
}

.spice-line:hover {
  transform: translateX(-50%) scale(1.02);
}

.spice-line:hover .spice-star-svg {
  transform: rotate(90deg);
}

.footer {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 56px;
  background: #2a0067;
  color: #ffef00;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border-top: 3px solid rgba(0, 0, 0, 0.15);
}

.footer a {
  color: #ffef00;
  text-decoration: underline;
  margin: 0 4px;
}

.footer a:hover {
  color: #ffffff;
}