:root {
  --scienceBlue: #052850;
  --buttonBlue: #6aa0dd;
  --backgroundBlue: #14283e;
  --highlightBlue: #cce3fd;
  --disabledGrey: #939393;
  --darkBackground: #14283e;
  --lane1Background: #e9bd3750;
  --lane2Background: #6aa0dd50;
  --trashAccent: #e93737;
  --lane1Accent: #e9bd37;
  --lane2Accent: #6aa0dd;
  --boxHadamard: #df715b;
  --boxPauliX: #10de8d;
  --boxIdentity: #c9cfde;
  --boxCNOT: #9d8ddf;
  --boxControl: #9d8ddf;
  --boxPauliZ: #10de8d;
}

html,
body {
  margin: 0;
  height: 100%;
  width: 100%;
  display: flex;
    font-size: 1.2em;
}

body {
  flex-direction: column;
  font-family: "Genos", serif;
  font-optical-sizing: auto;
  font-style: normal;
  color: white;
}

#mainArea {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: row;
  background-color: var(--scienceBlue);
}
#menuArea {
  height: 100%;
  width: 160px;
  background-color: var(--scienceBlue);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

#menuButtonArea {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.menuButton {
  margin-bottom: 20px;
}

#logoArea {
  height: 100px;
  width: 100%;
  background-color: var(--scienceBlue);
  display: flex;
  color: white;
  justify-content: center;
  align-items: center;
  font-size: 2em;
  text-align: center;
}
#logoArea:hover {
  cursor: pointer;
  color: var(--highlightBlue);
}

#modeInfoText {
  color: white;
  font-size: 1em;
  text-align: center;
}

#robotBox{
  height: 160px;
  width: 100px;
  border: 1px solid var(--buttonBlue);
  border-radius: 10px;
}

#robotImage {
  height: 160px;
  width: 100px;
  display: flex;
  border-radius: 10px;
  flex-direction: column;
  
}
#robotBox:hover {
  cursor: pointer;
  border: 1px solid var(--highlightBlue);
}

#robotBox.speaking {
  border: 1px solid var(--lane1Accent);
}

.robotDescription {
  position: relative;
  top: -38px;
left: 1px;
}

.speechBubble {
  background-color: white;
  color: black;
  border-radius: 10px;
  padding: 10px 15px;
  margin: 10px;
  display: inline-block;
  position: fixed;
  text-align: left;
  left: 270px;
  bottom: 300px;
  z-index: 200;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.speechBubble p {
  margin: 0;
  text-align: left;
  white-space: normal;
}

.speechBubble .task {
  font-weight: bold;
  color: var(--buttonBlue);
}

.qubitArea {
  display: flex;
  flex-direction: column;
  margin-top: 20px;
}

.qubitMenu {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  color: white;
  margin-bottom: 20px;
}

.qubitMenu .button {
  margin-left: 10px;
  margin-right: 10px;
}
#exportButton {
  position: absolute;
  right: 0px;
  z-index: 11;
}
#exportArea {
  display: none;
  flex-direction: column;
  width: calc(100% - 160px);
  border-bottom: 1px solid var(--buttonBlue);
  border-left: 1px solid var(--buttonBlue);
  background-color: var(--darkBackground);
}

#exportArea textarea {
  height: 30vh;
  width: 400px;
}

#exportCopyButton1.success, #exportCopyButton2.success{
  color: lightgreen;
  border-color: lightgreen;
}

#exportArea span {
  margin-top: 10px;
  margin-bottom: 20px;
}


#exportArea .backButton {
  margin-left: -1px;
  margin-top: 0px;
}
.exportField {
  margin-left: 20px;
}

.exportTextAreas {
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: center;
}

.exportTextAreafield {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.exportTextAreafield .button {
  margin-top: 10px;
}

#qubit2Name {
  visibility: hidden;
}
.qubitLanes {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qubitLane {
  width: calc(100% - 100px);
  visibility: visible;
  opacity: 1;
  transition: all 0.7s;
  border-radius: 10px;
  height: 110px;
}

.qubitLane #qubitLabel {
  position: absolute;
  transform: rotate(-90deg) translateY(-38px) translateX(-46px);
  font-size: 1.5em;
  margin-left: -22px;
}

#qubit2Lane {
  background-color: var(--lane2Background);
  border-top-left-radius: 0px;
  border-top-right-radius: 0px;
}

.qubitLane.hidden {
  opacity: 0;
  height: 0px;
  visibility: hidden;
}

#qubit1Lane {
  background-color: var(--lane1Background);
}

.qubitLane.sharpCornersButtom {
  border-bottom-right-radius: 0px;
  border-bottom-left-radius: 0px;
}

.qubitLane.sharpCorners {
  border-radius: 0px;
}

#buildingArea {
  width: calc(100% - 160px);
  background-color: var(--darkBackground);
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--buttonBlue);
  border-left: 1px solid var(--buttonBlue);
  border-bottom-left-radius: 10px;
}

#buttonArea {
  display: flex;
  flex-direction: row;
  height: 120px;
  background-color: var(--scienceBlue);
  justify-content: space-around;
  align-items: center;
}

#optionsArea {
  display: flex;
  flex-direction: column;
  height: 100%;
  align-items: center;
  justify-content: space-evenly;
}
.optionsAreaButtons {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.optionsAreaButtons > .button {
  margin-right: 12px;
  margin-left: 12px;
}
.optionsLabeldesktop {
    display: initial;
}
.optionsLabelmobile {
    display: none;
}

.seperator {
  border-left: 1px solid var(--buttonBlue);
  height: 60%;
}

#toolArea {
  background-color: var(--scienceBlue);
  display: flex;
  flex-direction: row;
}

#toolArea > .box {
  width: 100px;
  height: 80px;
  margin-left: 5px;
  margin-right: 5px;
}

#trashArea {
  display: none;
  width: 450px;
  height: 100px;
  border: 1px solid var(--trashAccent);
  background-color: var(--backgroundBlue);
  border-radius: 10px;
  justify-content: center;
  align-items: center;
}
#trashArea > span {
  position: absolute;
  color: var(--trashAccent);
  font-size: 3em;
}

#infoArea {
  display: none;
  flex-direction: column;
  width: calc(100% - 160px);
  border-bottom: 1px solid var(--buttonBlue);
  border-left: 1px solid var(--buttonBlue);
  background-color: var(--darkBackground);
}
#infoArea .button {
  margin-left: -1px;
}
#infoText {
  border: none;
  margin-left: 20px;
  margin-right: 20px;
  height: 100%;
}

mjx-container{
  text-align: left !important;
}

.controlArea {
  display: flex;
  flex-direction: column;
  height: 100%;
  align-items: center;
  justify-content: space-evenly;
}

.controlAreaButtons {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.button {
  height: 50px;
  width: 100px;
  background-color: var(--backgroundBlue);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 1px solid var(--buttonBlue);
  color: var(--buttonBlue);
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 10;
  touch-action: manipulation;
}

.controlAreaButtons > .button {
  margin-right: 12px;
  margin-left: 12px;
}

.disabledButton {
  color: var(--disabledGrey);
  border: 1px solid var(--disabledGrey);
}

.activeButton {
  background-color: var(--backgroundBlue);
  border: 1px solid lightgreen;
  color: lightgreen;
}

.button:hover {
  cursor: pointer;
  border: 1px solid var(--highlightBlue);
  color: var(--highlightBlue);
}
.activeButton:hover {
  cursor: pointer;
  background-color: var(--backgroundBlue);
  border: 1px solid lightgreen;
  color: lightgreen;
}

.disabledButton:hover {
  cursor: default;
  color: var(--disabledGrey);
  border: 1px solid var(--disabledGrey);
}

.queue {
  height: 100px;
  padding-top: 4px;
  display: flex;
  flex-direction: row;
  width: 100%;
}
.mathContainer {
  height: 150px;
  display: flex;
  width: calc(100% - 100px);
  flex-direction: row;
  transition: all 0.7s;
  position: relative;
  overflow: visible;
}
.mathContainer.mathBig {
  height: 310px;
}
.mathContainer.hidden {
  height: 0;
  visibility: hidden;
  transition: all 0.7s;
}
.mathBlockMatrices {
  display: flex;
  flex-direction: row;
  height: 50px;
}

.mathCalcMatrices {
  height: 0px;
  display: flex;
  flex-direction: row;
}

.mathBig .mathCalcMatrices {
  height: 75px;
  margin-top: 50px;
}

.mathBig .mathBlockMatrices {
  height: 50px;
}
.mathSolutionMatrices {
  margin-top: 50px;
  display: flex;
  flex-direction: row;
  height: 50px;
}
.mathBig .mathSolutionMatrices {
  height: 75px;
}

.mathDots {
  position: absolute;
  height: 150px;
  width: 150px;
  transition: all 0.7s;
  border-left: 2px dotted var(--lane1Background);
}

.mathBig .mathDots {
  position: absolute;
  height: 310px;
  width: 150px;
  border-left: 2px dotted var(--lane2Background);
}

.mathContainer.hidden .mathDots {
  height: 0px;
}

.mathArrow0l {
  position: absolute;
  transform: translateY(-74px) translateX(-0px);
  height: 92px;
  pointer-events: none;
}

.mathArrow0w {
  position: absolute;
  transform: translateY(-128px) translateX(-0px);
  height: 160px;
  pointer-events: none;
}

.mathArrow0 {
  position: absolute;
  transform: translateY(50px) translateX(-0px);
  height: 46px;
  z-index: 2;
  pointer-events: none;
}

.mathArrow3o {
  position: absolute;
  transform: translateY(-90px) translateX(-40px);
  z-index: 2;
  height: 136px;
  pointer-events: none;
}
.mathArrow3b {
  position: absolute;
  transform: translateY(-33px) translateX(25px);
  z-index: 2;
  height: 27px;
  pointer-events: none;
}

.mathArrow0s {
  position: absolute;
  transform: translateY(62px) translateX(-0px);
  height: 40px;
  z-index: 2;
  pointer-events: none;
}
.mathArrow1 {
  position: absolute;
  height: 44px;
  pointer-events: none;
}

.mathArrow2 {
  position: absolute;
  transform: translateY(50px) translateX(-10px);
  height: 46px;
  z-index: 2;
  pointer-events: none;
}

.mathArrow2cnot {
  position: absolute;
  transform: translateY(28px) translateX(-8px);
  height: 80px;
  z-index: 2;
  pointer-events: none;
  width: 32px;
}

.mathArrow1PauliX {
  transform: translateY(50px) translateX(-72px);
  width: 194px;
  pointer-events: none;
}

.firstMathArrow1PauliX {
  transform: translateY(50px) translateX(-54px);
  width: 154px;
  pointer-events: none;
}

.firstMathArrow2Hadamard {
  transform: translateY(62px) translateX(-34px);
  width: 194px;
  height: 40px;
  pointer-events: none;
}
.firstMathArrow2PauliX {
  transform: translateY(62px) translateX(-44px);
  width: 170px;
  height: 40px;
  pointer-events: none;
}
.mathArrow2PauliX {
  transform: translateY(62px) translateX(-64px);
  width: 200px;
  height: 40px;
  pointer-events: none;
}

.blockArrow1 {
  position: absolute;
  transform: translateY(-100px) translateX(-27px);
  width: 56px;
  height: 160px;
  pointer-events: none;
}
.blockArrow2 {
  position: absolute;
  transform: translateY(-46px) translateX(14px);
  width: 33px;
  height: 50px;
  pointer-events: none;
}

.mathArrow2Hadamard {
  transform: translateY(62px) translateX(-52px);
  width: 220px;
  height: 40px;
  pointer-events: none;
}

.mathArrow1Hadamard {
  transform: translateY(50px) translateX(-60px);
  width: 200px;
  pointer-events: none;
}

.firstMathArrow1Hadamard {
  transform: translateY(50px) translateX(-50px);
  width: 164px;
  pointer-events: none;
}

.math {
  background-color: var(--darkBackground);
  display: flex;
  flex-direction: column;
  width: calc(100% - 100px);
  border-left: 2px solid var(--lane1Background);
  border-bottom: 2px solid var(--lane1Background);
  border-bottom-left-radius: 10px;
}

.mathBig .math {
  border-left: 2px solid var(--lane2Background);
  border-bottom: 2px solid var(--lane2Background);
  border-bottom-left-radius: 10px;
}

.math_x {
  color: white;
  width: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.solution {
  color: white;
  background-color: var(--darkBackground);
  width: 100px;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-direction: column;
}

.solutionText {
  text-align: center;
}

#solution1 {
  border-left: 2px solid var(--lane1Background);
  border-right: 2px solid var(--lane1Background);
  border-bottom: 2px solid var(--lane1Background);
  border-bottom-right-radius: 10px;
}

#solution1.solutionBig {
  border-left: 2px solid var(--lane2Background);
  border-right: 2px solid var(--lane2Background);
  border-bottom: 2px solid var(--lane2Background);
  border-bottom-right-radius: 10px;
}

.matrix {
  color: white;
  height: 100%;
  width: 175px;
  /* border: 1px solid white; */
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 5;
  background-color: var(--darkBackground);
  padding: 2px;
}

mjx-mtable {
  min-width: auto !important;
  font-size: 0.8em;
}

mjx-mtd {
  padding-left: 0.2em !important;
  padding-right: 0.2em !important;
}

#math1 .startMatrix {
  color: var(--lane1Accent);
  width: 100px;
}

.mathBig #math1 .startMatrix {
  color: white;
  width: 100px;
}

.penny {
  height: 80px;
  z-index: 2;
  width: 80px;
  position: relative;
  padding: 10px;
  margin-right: 10px;
  transform-style: preserve-3d;
  cursor: pointer;
  transition: transform 0.1s linear;
}
.qubitLane.hidden .penny {
  cursor: default;
}

.clone {
  opacity: 0.33;
  position: fixed;
}
.clone:hover {
  cursor: default;
}

.heads,
.tails {
  position: absolute;
  backface-visibility: hidden;
  height: 80px;
  width: 80px;
  background-color: #cce3fd;
  border-radius: 50%;
  display: inline-block;
}

.innerPenny {
  height: 60px;
  width: 60px;
  margin: 10px;
  background-color: #6aa0dd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: #cce3fd;
}

.blockArea {
  display: flex;
  overflow: hidden;
  flex-wrap: nowrap;
  flex-direction: row;
  height: 100%;
  width: calc(100% - 210px);
  border-radius: 10px;
  margin-left: 5px;
}
#blockArea1 {
  border: 1px solid var(--lane1Accent);
}
#blockArea2 {
  border: 1px solid var(--lane2Accent);
}

.percentages {
  position: absolute;
  right: 149px;
  height: 100px;
  margin-top: 1px;
  width: 160px;
  display: flex;
  flex-direction: column;
  align-items: end;
  justify-content: space-evenly;
}

.percentage {
  height: 10px;
  width: 0%;
  transition: all 0.7s;
}

.percentage1 {
  background-color: var(--lane1Accent);
}
.percentage2 {
  background-color: var(--lane2Accent);
}

.percentages span {
  color: white;
  font-size: 0.8em;
  text-align: right;
  margin-right: 5px;
  margin-top: -14px;
}

.box {
  flex-shrink: 0;
  height: 96px;
  margin: 2px;
  width: 171px;
  color: black;
  border: 1px solid transparent;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.boxIcon {
  font-size: 2em;
}

.box.empty {
  background-color: transparent;
  border: none;
}

.box.control {
  background-color: var(--boxControl);
  width: 100px;
  margin-left: 37.5px;
  margin-right: 37.5px;
  border-radius: 50%;
}
.box.control::after {
  content: "";
  width: 50px;
  height: 40px;
  position: absolute;
  transform: translateY(50px);
  background-color: var(--boxControl);
}

.box.control.lane1::after {
  transform: translateY(-50px);
}
.box.control.lane2::after {
  transform: translateY(50px);
}
.identityText1 {
  transform: translateY(-190px);
position: absolute;
}
.identityText2 {
  transform: translateY(-80px);
position: absolute;
}

.box.pauliX {
  background-color: var(--boxPauliX);
}
.box.identity {
  background-color: var(--boxIdentity);
}
.box.hadamard {
  background-color: var(--boxHadamard);
}
.box.cnot {
  background-color: var(--boxCNOT);
}
.box.pauliZ {
  background-color: var(--boxPauliZ);
}

.boxInfoArea {
  width: 80px;
  position: absolute;
  margin-top: 10px;
  margin-bottom: 12px;
  transform: translateX(100px) translateY(-33px);
}
#toolArea .boxInfoArea {
  transform: translateX(66px) translateY(-25px);
}

.boxInfoButton {
  color: white;
  background: var(--backgroundBlue);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  text-align: center;
  line-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.boxInfoButton:hover {
  color: black;
  background: var(--highlightBlue);
  cursor: pointer;
}

.ghostBoxClone {
  opacity: 0.33; /* Stellen Sie die Transparenz nach Bedarf ein */
  z-index: 5;
}
.transparentBoxClone {
  opacity: 1; /* Stellen Sie die Transparenz nach Bedarf ein */
}

.box:hover {
  cursor: grab;
}


/* ========================================
   IMPRESSUM LINK STYLING
   ======================================== */

#impressumLink {
  text-align: center;
  padding: 10px;
  margin-bottom: 10px;
}

#impressumLink a {
  color: var(--buttonBlue);
  text-decoration: none;
  font-size: 0.9em;
  transition: color 0.3s;
}

#impressumLink a:hover {
  color: var(--highlightBlue);
  text-decoration: underline;
}

/* ========================================
   RESPONSIVE DESIGN - LARGER SCREENS
   ======================================== */

/* Medium screens (13-15" laptops) */
@media screen and (min-width: 1280px) and (min-height: 720px) {
  #logoArea {
    height: 120px;
    font-size: 2.5em;
  }
  
  #robotBox, #robotImage {
    height: 192px;
    width: 120px;
  }
  
  .robotDescription {
    top: -45px;
    font-size: 1.15em;
  }
  
  .qubitLane {
    height: 132px;
  }
  
  .queue {
    height: 120px;
  }
  
  .blockArea {
    height: 120px;
  }
  
  .speechBubble {
    font-size: 1.25em;
    left: 150px;
      max-width: 80%;
  }
  
  #buttonArea {
    height: 144px;
  }
  
  .mathContainer {
    height: 180px;
  }
  
  .mathContainer.mathBig {
    height: 372px;
  }
  
  .innerPenny {
    height: 72px;
    width: 72px;
    margin: 12px;
    font-size: 43px;
  }
  
  .heads, .tails {
    height: 96px;
    width: 96px;
  }
  
  .boxIcon {
    font-size: 2.4em;
  }
  
  .boxText {
    font-size: 1.15em;
  }
  
  #toolArea > .box {
    width: 120px;
    height: 96px;
  }
  
  #trashArea {
    width: 540px;
    height: 120px;
  }
  
  .button {
    height: 60px;
    width: 120px;
    font-size: 1.15em;
  }
  
  .box {
    height: 115px;
    width: 205px;
  }
  
  body {
    font-size: 20px;
  }
  
  #menuArea {
    width: 192px;
  }
  
  #buildingArea {
    width: calc(100% - 192px);
  }
  
  #exportArea, #infoArea {
    width: calc(100% - 192px);
  }
  
  .optionsLabel, .controlLabel {
    font-size: 1.15em;
  }
  
  #modeInfoText {
    font-size: 1.15em;
  }
  
  .percentages span {
    width: 180px;
    font-size: 0.9em;
  }
}

/* Large screens (17"+ laptops, desktops) */
@media screen and (min-width: 1600px) and (min-height: 900px) {
  #logoArea {
    height: 140px;
    font-size: 2.9em;
  }
  
  #robotBox, #robotImage {
    height: 224px;
    width: 140px;
  }
  
  .robotDescription {
    top: -53px;
    font-size: 1.3em;
  }
  
  .qubitLane {
    height: 154px;
  }
  
  .queue {
    height: 140px;
  }
  
  .blockArea {
    height: 140px;
  }
  
  .speechBubble {
    font-size: 1.4em;
    left: 170px;
    padding: 15px;
  }
  
  #buttonArea {
    height: 168px;
  }
  
  .mathContainer {
    height: 210px;
  }
  
  .mathContainer.mathBig {
    height: 434px;
  }
  
  .innerPenny {
    height: 84px;
    width: 84px;
    margin: 14px;
    font-size: 50px;
  }
  
  .heads, .tails {
    height: 112px;
    width: 112px;
  }
  
  .boxIcon {
    font-size: 2.8em;
  }
  
  .boxText {
    font-size: 1.3em;
  }
  
  #toolArea > .box {
    width: 140px;
    height: 112px;
  }
  
  #trashArea {
    width: 630px;
    height: 140px;
  }
  
  .percentages {
    right: 174px;
    height: 120px;
    width: 130px;
  }
  
  .percentage {
    height: 12px;
  }
  
  .percentages span {
    font-size: 1em;
  }
  
  .box.control {
    width: 117px;
    margin-left: 60px;
    margin-right: 60px;
  }
  
  .box.control::after {
    width: 60px;
    height: 50px;
  }
  
  .button {
    height: 70px;
    width: 140px;
    font-size: 1.3em;
  }
  
  .box {
    height: 134px;
    width: 240px;
  }
  
  body {
    font-size: 22px;
  }
  
  #menuArea {
    width: 224px;
  }
  
  #buildingArea {
    width: calc(100% - 224px);
  }
  
  #exportArea, #infoArea {
    width: calc(100% - 224px);
  }
  
  .optionsLabel, .controlLabel {
    font-size: 1.3em;
  }
  
  #modeInfoText {
    font-size: 1.3em;
  }
}

/* Extra large screens (projectors, smartboards, 4K) */
@media screen and (min-width: 1920px) and (min-height: 1080px) {
  #logoArea {
    height: 160px;
    font-size: 3.3em;
  }
  
  #robotBox, #robotImage {
    height: 256px;
    width: 160px;
  }
  
  .robotDescription {
    top: -60px;
    font-size: 1.4em;
  }
  
  .qubitLane {
    height: 176px;
  }
  
  .queue {
    height: 160px;
  }
  
  .blockArea {
    height: 160px;
  }
  
  .speechBubble {
    font-size: 1.55em;
    left: 190px;
    padding: 20px;
    max-width: 600px;
  }
  
  #buttonArea {
    height: 192px;
  }
  
  .mathContainer {
    height: 240px;
  }
  
  .mathContainer.mathBig {
    height: 496px;
  }
  
  .innerPenny {
    height: 96px;
    width: 96px;
    margin: 16px;
    font-size: 58px;
  }
  
  .heads, .tails {
    height: 128px;
    width: 128px;
  }
  
  .boxIcon {
    font-size: 3.2em;
  }
  
  .boxText {
    font-size: 1.4em;
  }
  
  #toolArea > .box {
    width: 160px;
    height: 128px;
  }
  
  #trashArea {
    width: 720px;
    height: 160px;
  }
  
  .percentages {
    right: 198px;
    height: 140px;
    width: 150px;
  }
  
  .percentage {
    height: 14px;
  }
  
  .percentages span {
    font-size: 1.05em;
  }
  
  .box.control {
    width: 134px;
    margin-left: 70px;
    margin-right: 70px;
  }
  
  .box.control::after {
    width: 70px;
    height: 60px;
  }
  
  .button {
    height: 80px;
    width: 160px;
    font-size: 1.4em;
  }
  
  .box {
    height: 154px;
    width: 274px;
  }
  
  body {
    font-size: 24px;
  }
  
  #menuArea {
    width: 256px;
  }
  
  #buildingArea {
    width: calc(100% - 256px);
  }
  
  #exportArea, #infoArea {
    width: calc(100% - 256px);
  }
  
  .optionsLabel, .controlLabel {
    font-size: 1.4em;
  }
  
  #modeInfoText {
    font-size: 1.4em;
  }
}

/* ========================================
   MOBILE RESPONSIVE DESIGN
   ======================================== */

/* Tablets in portrait mode and large phones */
@media screen and (max-width: 1024px) {
  body {
    font-size: 16px;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: var(--scienceBlue);
    min-height: 100vh;
  }
  
  /* Mobile fix: Math arrows and matrices */
  .mathContainer:not(.hidden) {
    overflow-x: auto;
    overflow-y: visible;
  }
  
  .matrix {
    min-width: 100px;
    font-size: 0.85em;
  }
  
  /* Mobile fix: Info button centering */
  .boxInfoButton {
    line-height: 32px;
    font-size: 16px;
  }
  
  /* Mobile fix: Speech bubble position */
  .speechBubble {
    position: fixed;
    left: 15px;
    right: 15px;
    top: auto;
    bottom: auto;
    margin-top: 100px;
    max-width: calc(100% - 30px);
    z-index: 300;
    white-space: normal;
    display: block;
    margin-top: 65px;
  }
  
  .speechBubble p {
    white-space: normal;
  }
  
  /* Mobile fix: Penny spacing */
  .penny {
    margin-right: 8px;
  }
  
  .blockArea {
    width: calc(100% - 190px);
  }
  
  #mainArea {
    flex-direction: column;
    background-color: var(--scienceBlue);
    /*min-height: 100vh;*/
    height: auto;
  }
  
  #menuArea {
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 12px 8px;
    box-sizing: border-box;
    flex-wrap: wrap;
    z-index: 100;
    position: relative;
  }
  
  #logoArea {
    height: auto;
    width: auto;
    font-size: 1.8em;
    padding: 2px 12px;
    order: 1;
    pointer-events: auto;
    cursor: pointer;
  }
  
  #menuButtonArea {
    flex-direction: row;
    gap: 4px;
    flex-wrap: wrap;
    order: 2;
    justify-content: center;
    z-index: 101;
  }
  
  .menuButton {
    margin: 6px;
    font-size: 1em;
    height: 50px;
    width: 95px;
    padding: 6px;
    pointer-events: auto;
    touch-action: manipulation;
    z-index: 102;
  }
  
  #robotBox {
    height: 100px;
    width: 65px;
    order: 3;
    pointer-events: auto;
    cursor: pointer;
  }
  
  #robotImage {
    height: 100px;
    width: 65px;
    pointer-events: auto;
  }
  
  .robotDescription {
    font-size: 0.85em;
    top: -22px;
  }
  .qubitLane #qubitLabel {
      margin-left: -6px;
  }
  
  #impressumLink {
    padding: 8px;
    margin-bottom: 8px;
    order: 2;
    width: 100%;
    z-index: 100;
  }
  
  #impressumLink a {
    font-size: 1em;
    pointer-events: auto;
    touch-action: manipulation;
  }
  
  .speechBubble {
    left: 75px;
    top: 100px;
    max-width: 65%;
    font-size: 1em;
    z-index: 200;
  }
  
  #buildingArea {
    width: 100%;
    border-left: none;
    overflow-x: hidden;
    overflow-y: visible;
    position: relative;
    background-color: var(--darkBackground);
    min-height: 40vh;
    flex: 1;
  }
  
  #exportArea, #infoArea {
    width: 100%;
    border-left: none;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    z-index: 50;
    max-height: 80vh;
  }
  
  #exportArea {
    padding: 15px;
  }
  
  #exportArea h1 {
    font-size: 1.5em;
    margin: 10px 0;
  }
  
  #exportArea .button {
    margin: 10px 0;
    pointer-events: auto;
    touch-action: manipulation;
  }
  
  #exportArea textarea {
    width: 100%;
    max-width: 100%;
    min-height: 200px;
    font-size: 0.9em;
    box-sizing: border-box;
    padding: 10px;
    margin-bottom: 10px;
  }
  
  .exportTextAreas {
    flex-direction: column;
    gap: 20px;
    width: 100%;
  }
  
  .exportTextAreafield {
    width: 100%;
  }
  
  .exportTextAreafield .button {
    margin-top: 10px;
    width: 100%;
    max-width: 200px;
  }
  
  .exportField {
    margin-left: 0;
    width: 100%;
  }
  
  .qubitArea {
    margin-top: 12px;
  }
  
  .qubitMenu {
    flex-wrap: wrap;
    margin-bottom: 12px;
    justify-content: center;
    z-index: 90;
    position: relative;
  }
  
  .qubitMenu .button {
    margin: 6px;
    font-size: 1em;
    height: 50px;
    width: 95px;
    pointer-events: auto;
    touch-action: manipulation;
    z-index: 91;
    padding: 0 6px;
  }
  
  #exportButton {
    position: static;
    margin: 6px;
    pointer-events: auto;
    touch-action: manipulation;
  }
  
  .qubitLane {
    width: calc(100% - 50px);
    height: 110px;
    margin: 0 25px;
  }
  
  .queue {
    height: 100px;
  }
  
  .penny {
    height: 75px;
    width: 75px;
    padding: 10px;
    pointer-events: auto;
    touch-action: manipulation;
  }
  
  .heads, .tails {
    height: 75px;
    width: 75px;
  }
  
  .innerPenny {
    height: 56px;
    width: 56px;
    margin: 9.5px;
    font-size: 33px;
  }
  
  .blockArea {
    width: calc(100% - 180px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    height: 100px;
  }
  
  .box {
    height: 96px;
    width: 160px;
    flex-shrink: 0;
    pointer-events: auto;
    touch-action: pan-x;
    position: relative;
    overflow: visible;
  }
  
  .boxIcon {
    font-size: 2em;
  }
  
  .boxText {
    font-size: 1em;
  }
  
  .boxInfoArea {
    position: absolute;
    right: 5px;
    top: 5px;
    transform: none;
    width: auto;
    z-index: 150;
    pointer-events: auto;
    margin: 0;
  }
  
  #toolArea .boxInfoArea {
    right: 1px;
    top: 1px;
    transform: none;
    z-index: 150;
  }
  
  .boxInfoButton {
    width: 32px;
    height: 32px;
    font-size: 1.1em;
    line-height: 1.8;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(204, 227, 253, 0.3);
    z-index: 151;
  }
  
  .percentages {
    right: 130px;
    height: 100px;
    width: 140px;
  }
  
  .percentages span {
    font-size: 1.05em;
    margin-top: -10px;
      margin-right: 0;
  }
  
  .percentage {
    height: 10px;
  }
  
  #buttonArea {
    flex-direction: column;
    flex-wrap: nowrap;
    height: auto;
    min-height: 180px;
    padding: 15px 10px;
    justify-content: flex-start;
    align-items: center;
    gap: 2px;
    position: relative;
    z-index: 100;
    background-color: var(--scienceBlue);
  }
  
  #optionsArea {
    margin: 2px;
    width: 95%;
    max-width: 500px;
    z-index: 101;
    order: 1;
  }
  
  .controlArea {
    margin: 2px;
    width: 95%;
    max-width: 500px;
    z-index: 101;
    order: 2;
  }
  
  .optionsAreaButtons, .controlAreaButtons {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  
  .optionsLabel, .controlLabel {
    font-size: 1em;
    margin-bottom: 8px;
  }
    .optionsLabeldesktop {
        display: none;
    }
    .optionsLabelmobile {
        display: initial;
    }

  .button {
    height: 50px;
    width: 95px;
    font-size: 1em;
    touch-action: manipulation;
    pointer-events: auto;
    cursor: pointer;
    z-index: 102;
    position: relative;
  }
  
  .optionsAreaButtons > .button,
  .controlAreaButtons > .button {
    margin: 4px;
  }
  
  .seperator {
    display: none;
  }
  
  #toolArea {
    flex-wrap: wrap;
    justify-content: center;
    padding: 4px;
    gap: 4px;
    z-index: 90;
    position: relative;
  }
  
  #toolArea > .box {
    width: 110px;
    height: 85px;
    margin: 2px;
    position: relative;
    z-index: 91;
  }
  
  #trashArea {
    width: 90%;
    max-width: 450px;
    height: 100px;
  }
  
  .mathContainer {
    display: none;
  }
  
  /* Allow math container to be shown when not hidden class */
  .mathContainer:not(.hidden) {
    display: flex !important;
    height: auto;
    min-height: 200px;
    flex-direction: column;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
  }
  
  .solution {
    width: 90px;
    font-size: 0.95em;
  }
  
  .box.control {
    width: 90px;
    margin-left: 35px;
    margin-right: 35px;
  }
  
  .box.control::after {
    width: 48px;
    height: 42px;
  }
  
  .box.control.lane1::after {
    transform: translateY(-48px);
  }
  
  .box.control.lane2::after {
    transform: translateY(48px);
  }
}

/* Small phones */
@media screen and (max-width: 640px) {
  body {
    font-size: 14px;
    background-color: var(--scienceBlue);
  }
  
  #logoArea {
    font-size: 2.6em;
  }
  
  .menuButton {
    height: 45px;
    width: 85px;
    font-size: 0.9em;
    margin: 4px;
  }
  
  #robotBox, #robotImage {
    height: 80px;
    width: 50px;
  }
  
  .robotDescription {
    font-size: 0.75em;
    top: -18px;
  }
  
  #impressumLink a {
    font-size: 1em;
  }
  .qubitLane #qubitLabel {
    margin-left: 2px;
  }
  
  .speechBubble {
    font-size: 1.1em;
    left: 60px;
    padding: 10px;
    top: 80px;
  }
  
  .qubitLane {
    height: 95px;
    width: calc(100% - 30px);
    margin: 0 15px;
  }
  
  .queue {
    height: 85px;
  }
  
  .penny {
    height: 65px;
    width: 65px;
    padding: 8px;
  }
  
  .heads, .tails {
    height: 65px;
    width: 65px;
  }
  
  .innerPenny {
    height: 49px;
    width: 49px;
    margin: 8px;
    font-size: 28px;
  }
  
  .blockArea {
    height: 85px;
    width: calc(100% - 150px);
  }
  
  .box {
    height: 81px;
    width: 65px;
  }
  
  .boxIcon {
    font-size: 1.8em;
  }
  
  .boxText {
    font-size: 1em;
  }
  
  .boxInfoButton {
    width: 28px;
    height: 28px;
    font-size: 1.5em;
    min-width: 28px;
    min-height: 28px;
  }
  
  .percentages {
    right: 110px;
    height: 85px;
    width: 110px;
  }
  
  .percentages span {
    font-size: 0.95em;
  }
  
  .button {
    height: 40px;
    width: 60px;
    font-size: 1.2em;
  }
  
  .qubitMenu .button {
    height: 45px;
    width: 85px;
    padding: 0 6px;
  }
  
  #toolArea > .box {
    width: 65px;
    height: 80px;
  }
  
  #trashArea {
    height: 85px;
  }
  
  .box.control {
    width: 75px;
    margin-left: 30px;
    margin-right: 30px;
  }
  
  .box.control::after {
    width: 42px;
    height: 38px;
  }
  
  .box.control.lane1::after {
    transform: translateY(-42px);
  }
  
  .box.control.lane2::after {
    transform: translateY(42px);
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .button,
  .box,
  .penny {
    -webkit-tap-highlight-color: rgba(204, 227, 253, 0.3);
    cursor: pointer;
    pointer-events: auto;
  }
  
  .button {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
  }
  
  .boxInfoButton {
    min-width: 28px;
    min-height: 28px;
    touch-action: manipulation;
  }

    .qubitLane #qubitLabel {
        font-size: 1.4em;
        padding-left: 6px;
    }

}

/* Landscape mode optimization for tablets */
@media screen and (max-width: 1024px) and (orientation: landscape) {
  #mainArea {
    flex-direction: row;
  }
  
  #menuArea {
    width: 140px;
    height: 100%;
    flex-direction: column;
    padding: 8px;
    justify-content: flex-start;
  }
  
  #logoArea {
    font-size: 1.2em;
    height: auto;
    padding: 8px;
    order: 1;
  }
  
  #menuButtonArea {
    flex-direction: column;
    order: 3;
  }
  
  .menuButton {
    margin: 6px 0;
    width: 100%;
  }
  
  #robotBox {
    order: 3;
    margin-top: auto;
    margin-bottom: 10px;
  }
  
  #impressumLink {
    order: 2;
    width: 100%;
  }
  
  #buildingArea {
    width: calc(100% - 140px);
    border-left: 1px solid var(--buttonBlue);
  }
  
  #exportArea, #infoArea {
    width: calc(100% - 140px);
    border-left: 1px solid var(--buttonBlue);
  }
  
  .qubitLane {
    width: calc(100% - 70px);
  }
  
  .speechBubble {
    left: 150px;
  }
}
