#sumulation {
  position: absolute;
  width: 50%;
  height: 10%;
  border: black 2px red;
  top: 100%;
  z-index: 10;
}

body {
  background-color: #0C1A24;
  color: #e6e6e6;
  font-family: Arial, sans-serif;
}

html {
  margin: 0;
  padding: 0;
  height: var(--app-height, 100vh);
  overflow: hidden;
}

body {
  margin: 0;
  padding: 0;
  position: relative;
  height: var(--app-height, 100vh);
  overflow-y: auto;
  overflow-x: hidden;
}

.show {
  font-size: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #8b8b8b00;
}

#show {
  position: absolute;
  top: 6%;
  left: 0%;
  width: 5.4%;
  height: 90%;
  border-radius: 4px;

  user-select: none;
}

#show_game {
  position: absolute;
  top: 0%;
  left: 5%;
  width: 90%;
  height: 5%;
  border-radius: 4px;

  user-select: none;
}

#show_mode {
  position: absolute;
  top: 5.4%;
  left: 5%;
  width: 90%;
  height: 6%;
  border-radius: 4px;

  user-select: none;
}

#show_money {
  position: absolute;
  top: 17.5%;
  left: 5%;
  width: 90%;
  height: 6%;
  border-radius: 4px;
  user-select: none;
}

#show_bet {
  position: absolute;
  top: 53%;
  left: 5%;
  width: 90%;
  height: 6%;
  border-radius: 4px;
  user-select: none;
}

#show_multi {
  position: absolute;
  top: 30%;
  left: 5%;
  width: 90%;
  height: 6%;
  border-radius: 4px;
  user-select: none;
}

#show_multi2 {
  position: absolute;
  top: 42%;
  left: 5%;
  width: 90%;
  height: 6%;
  border-radius: 4px;
  user-select: none;
}

#show_round {
  position: absolute;
  top: 94%;
  left: 5%;
  width: 90%;
  height: 6%;
}

.Ashow {
  border: #20c997 solid 1px;
  font-size: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

}

#show_number {
  position: absolute;
  top: 28%;
  left: 5%;
  width: 90%;
  height: 6%;
}

#money {
  position: absolute;
  top: 0%;
  left: -1%;
  width: 101%;
  height: 6%;
  border-radius: 4px;
  background-color: rgba(30, 43, 55, 0.52);
  user-select: none;
}

#birr {
  position: absolute;
  color: rgb(0, 204, 41);
  font-size: 100%;
  width: 10%;
  height: 90%;
  top: 5.8%;
  left: 107%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#money_box {
  position: absolute;
  color: white;
  font-size: 100%;
  border: #8b8b8b solid 1px;
  width: 10%;
  height: 90%;
  top: 5.8%;
  left: 50%;
  background-color: #0C1A24;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#id_gameCanvas {
  position: absolute;
  background-color: rgb(30, 43, 55);
  width: 70%;
  height: 89%;
  top: 7%;
  left: 28.7%;
  border: 0px solid rgba(56, 56, 56, 0) !important;
  border-radius: 0px 5px 5px 0px;
  user-select: none;
}

#gameCanvas {
  position: absolute;
  width: 72%;
  height: 100%;
  top: -5%;
  left: 17%;
}

#simulation {
  overflow: hidden;
  position: absolute;
  z-index: 2;
  background: rgba(255, 0, 0, 0);
  border: red solid 0px;
}

.item {
  position: relative;
  width: 10%;
  height: 110%;
  /* was 200% — this was making items overflow the bar */
  font-size: 70%;
  margin-left: 1%;
  margin-right: 1%;
  border-radius: 20%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: black;
  font-weight: bold;
  box-shadow: 0px 2px 0px #a60004;
  overflow: hidden;
  /* clip any text that's still too wide */
  white-space: nowrap;
  /* prevent text wrapping out vertically */
  box-sizing: border-box;
}


#add-ball {
  position: absolute;
  width: 93%;
  height: 10%;
  top: 51%;
  left: 3%;
  border: 0;
  background-color: rgb(29, 165, 15);
  font-size: 100%;
  cursor: pointer;
  border-radius: 7px;
}

#box {
  position: absolute;
  width: 23%;
  height: 89%;
  top: 7%;
  left: 5.7%;
  background-color: rgb(40, 56, 72);
  border-radius: 10px 0px 0px 10px;
  user-select: none;

}

#output {
  position: absolute;
  display: flex;
  flex-direction: row-reverse;
  gap: 8px;
  width: 99%;
  height: 10%;
  left: 1%;
  align-items: center;
  padding-right: 10px;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: hidden;
}

.output-item {
  background: rgb(34, 48, 62);
  color: #fff;
  min-width: 55px;
  height: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 20px;
  font-size: 1.1em;
  font-weight: 600;
  transition: background 0.2s;
  text-align: center;
  opacity: 1;
  animation: slideInFromRight 0.4s cubic-bezier(.4, 1.7, .7, 1) backwards;
}

.output-item.removing {
  animation: slideOutToLeft 0.4s cubic-bezier(.4, 1.7, .7, 1) forwards;
}

#add-ball2,
#add-ball3 {
  position: absolute;
  width: 93%;
  height: 10%;
  top: 64%;
  left: 3%;
  border: 0;
  background-color: rgb(29, 165, 15);
  font-size: 100%;
  cursor: pointer;
  border-radius: 7px;
}


#balance {
  position: absolute;
  width: 55%;
  height: 3%;
  border-radius: 4px;
  padding: 10px;
  background-color: rgb(30, 43, 55);
  color: white;
  border: rgb(0, 115, 223);
  top: 17%;
  left: 3%;
  font-size: 150%;
}

#bet_amount {
  position: absolute;
  color: white;
  font-size: 130%;
  top: 12%;
  left: 3%;
  user-select: none;
}

#manual_auto {
  position: absolute;
  color: white;
  background-color: rgb(30, 43, 55);
  width: 98%;
  height: 10%;
  left: 1%;
  top: 2%;
  border-radius: 40px;
}

#manual {
  position: absolute;
  color: white;
  background-color: rgb(40, 56, 72);
  width: 48%;
  height: 80%;
  left: 2%;
  top: 10%;
  border: #0000000f solid 1px;
  cursor: pointer;
  border-radius: 40px;
}

#auto {
  position: absolute;
  color: white;
  background-color: rgb(30, 43, 55);
  width: 45%;
  height: 80%;
  left: 52%;
  top: 10%;
  border: #0000000f solid 1px;
  cursor: pointer;
  border-radius: 40px;
}

#incrementButton {
  position: absolute;
  color: white;
  background-color: rgb(30, 43, 55);
  font-size: 130%;
  width: 15%;
  height: 7%;
  top: 17%;
  left: 83%;
  cursor: pointer;
  border-radius: 7px;
}

#decrementButton {
  position: absolute;
  color: white;
  background-color: rgb(30, 43, 55);
  font-size: 130%;
  width: 15%;
  height: 7%;
  top: 17%;
  left: 66.8%;
  cursor: pointer;
  border-radius: 7px;
}

#Labelnumberofbet {
  position: absolute;
  font-size: 100%;
  width: 90%;
  height: 5%;
  left: 1%;
  top: 24%;
}

#numberofbet {
  position: absolute;
  font-size: 100%;
  justify-content: center;
  align-items: center;
  width: 95%;
  height: 5%;
  left: 1%;
  top: 27.5%;
  border-radius: 4px;
  background-color: rgb(30, 43, 55);
  color: white;
  border: rgb(0, 115, 223);
}

#Labelonwin {
  position: absolute;
  font-size: 100%;
  width: 90%;
  height: 5%;
  left: 1%;
  top: 33.5%;
}

#onwin {
  position: absolute;
  font-size: 100%;
  justify-content: center;
  align-items: center;
  width: 50%;
  height: 5%;
  left: 45%;
  top: 37%;
  border-radius: 4px;
  background-color: rgb(30, 43, 55);
  color: white;
  border: rgb(0, 115, 223);
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

#reset1 {
  position: absolute;
  color: white;
  background-color: rgb(30, 43, 55);
  font-size: 1%;
  width: 15%;
  height: 6%;
  top: 37%;
  left: 1%;
  border: 0;
  font-size: 80%;
  cursor: pointer;
  border-radius: 7px;
  border: 1px solid rgb(255, 255, 255);
}

#Increase1 {
  position: absolute;
  color: white;
  background-color: rgb(30, 43, 55);
  font-size: 1%;
  width: 27%;
  height: 6%;
  top: 37%;
  left: 17%;
  border: 1px solid rgba(0, 0, 0, 0);
  font-size: 80%;
  cursor: pointer;
  border-radius: 7px;
}

#Labelonloss {
  position: absolute;
  font-size: 100%;
  width: 90%;
  height: 5%;
  left: 1%;
  top: 43%;
}

#onloss {
  position: absolute;
  font-size: 100%;
  justify-content: center;
  align-items: center;
  width: 50%;
  height: 5%;
  left: 45%;
  top: 46.5%;
  border-radius: 4px;
  background-color: rgb(30, 43, 55);
  color: white;
  border: rgb(0, 115, 223);
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

#reset2 {
  position: absolute;
  color: white;
  background-color: rgb(30, 43, 55);
  font-size: 1%;
  width: 15%;
  height: 6%;
  top: 46.5%;
  left: 1%;
  border: 0;
  font-size: 80%;
  cursor: pointer;
  border-radius: 7px;
  border: 1px solid rgb(255, 255, 255);
}

#Increase2 {
  position: absolute;
  color: white;
  background-color: rgb(30, 43, 55);
  font-size: 1%;
  width: 27%;
  height: 6%;
  top: 46.5%;
  left: 17%;
  border: 1px solid rgba(0, 0, 0, 0);
  font-size: 80%;
  cursor: pointer;
  border-radius: 7px;
}

#Labelstoponprofit {
  position: absolute;
  font-size: 100%;
  width: 90%;
  height: 5%;
  left: 1%;
  top: 53%;
}

#onprofit {
  position: absolute;
  font-size: 100%;
  justify-content: center;
  align-items: center;
  width: 90%;
  height: 5%;
  left: 1%;
  top: 56.7%;
  border-radius: 4px;
  background-color: rgb(30, 43, 55);
  color: white;
  border: rgb(0, 115, 223);
}

#Labelstoponloss {
  position: absolute;
  font-size: 100%;
  width: 90%;
  height: 5%;
  left: 1%;
  top: 63.5%;
}

#stoponloss {
  position: absolute;
  font-size: 100%;
  justify-content: center;
  align-items: center;
  width: 90%;
  height: 5%;
  left: 1%;
  top: 67.2%;
  border-radius: 4px;
  background-color: rgb(30, 43, 55);
  color: white;
  border: rgb(0, 115, 223);
}

/* Container styling */
#risk {
  position: absolute;
  color: white;
  font-size: 100%;
  top: 25%;
  left: 3%;
}

#riks {
  position: absolute;
  top: 25.4%;
  width: 90%;
}

#row {
  position: absolute;
  color: white;
  font-size: 100%;
  top: 37%;
  left: 3%;
}

#rows {
  position: absolute;
  width: 90%;
  top: 38%;
}

#selecter {
  position: absolute;
  width: 90%;
  top: 24%;

}

/* Styling the select element */
.selectC {
  width: 100%;
  padding: 10px;
  margin: 6%;
  font-size: 16px;
  border: 2px solid rgb(8, 38, 58);
  border-radius: 4px;
  background-color: rgb(37, 53, 68);
  color: rgb(255, 255, 255);
  appearance: none;
  background-position: right 10px center;
  background-size: 10px;
  cursor: pointer;
}

/* Additional styling for better appearance */
.selectC:focus {
  border-color: rgb(255, 255, 255);
  outline: none;

}

@media (max-width: 900px) {
  #id_gameCanvas {
    position: absolute;
    background-color: rgb(30, 43, 55);
    width: 400px;
    height: 63%;
    top: 6.02%;
    left: 50%;
    transform: translateX(-50%);
    user-select: none;
    overflow: hidden;
    border: 0px solid rgba(56, 56, 56, 0) !important;
  }

  #gameCanvas {
    position: absolute;
    width: 139%;
    height: 100%;
    top: -2%;
    left: -19%;
  }

  canvas {
    position: absolute;
    width: 105%;
    height: 99%;
    top: -5%;
    left: 0%;
  }

  #simulation {
    width: 92.5% !important;
    height: 2.5% !important;
    top: 93.5% !important;
    left: 4% !important;
  }

  #box {
    position: absolute;
    width: 400px;
    height: 270px;
    top: 69%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgb(40, 56, 72);
    user-select: none;
    border-radius: 0%;
  }

  #manual_auto {
    width: 390px;
    height: 65px;
    left: 5px;
    top: 215px;
    z-index: 2;
  }

  #money {
    position: absolute;
    width: 400px;
    height: 5.9%;
    top: 0%;
    left: 50%;
    transform: translateX(-50%);
  }

  #bet_amount {
    position: absolute;
    color: white;
    font-size: 24px;
    top: 1px;
    left: 12px;
    user-select: none;
  }

  #money_box {
    font-size: 100%;
    width: 25%;
    height: 90%;
    top: 5.8%;
    left: 45%;
  }

  #balance {
    z-index: 1;
    width: 56%;
    height: 35px;
    top: 30px;
    left: 10px;
    font-size: 25px;
  }

  #decrementButton {
    z-index: 1;
    font-size: 20px;
    width: 15%;
    height: 50px;
    top: 30px;
    left: 263px;
    border: 1px solid rgba(44, 43, 43, 0.224);
  }

  #incrementButton {
    z-index: 1;
    font-size: 20px;
    width: 15%;
    ;
    height: 50px;
    top: 30px;
    left: 332px;
    border: 1px solid rgba(44, 43, 43, 0.224);
  }

  #add-ball {
    width: 380px;
    height: 55px;
    top: 158px;
    left: 3%;
    font-size: 100%;
  }

  #add-ball2,
  #add-ball3 {
    width: 380px;
    height: 55px;
    top: 158px;
    left: 3%;
    font-size: 100%;
  }

  #show {
    width: 0%;
  }

  #Labelnumberofbet {
    font-size: 108%;
    width: 90%;
    height: 5%;
    left: 2%;
    top: 62%;
  }

  #numberofbet {
    width: 80%;
    height: 13%;
    top: 70.5%;
  }

  #risk {
    left: 32px !important;
    top: 90px !important;
  }

  #riks {
    position: absolute;
    top: 87px !important;
    width: 45% !important;
    left: 0px;
  }

  #row {
    top: 90px !important;
    left: 235px !important;
  }

  #rows {
    position: absolute;
    width: 43% !important;
    top: 87px !important;
    left: 200px !important;
  }

  #auto_view {
    position: absolute;
    top: 13%;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0 0 10px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    z-index: 0;
  }

  .output-item {
    min-width: 41px;
    font-size: 12px;
  }

}

@media (max-width: 400px) {
  #id_gameCanvas {
    position: absolute;
    background-color: rgb(30, 43, 55);
    width: 98%;
    height: 63%;
    top: 6.02%;
    left: 50%;
    transform: translateX(-50%);
    user-select: none;
    overflow: hidden;
  }

  canvas {
    position: absolute;
    width: 105%;
    height: 99%;
    top: -5%;
    left: 0%;
  }

  #gameCanvas {
    position: absolute;
    width: 139%;
    height: 100%;
    top: -2%;
    left: -19%;
  }

  #simulation {
    left: 4% !important;
    width: 93% !important;
    top: 91% !important;
    height: 5% !important;
  }

  .item {
    margin: 2px !important;
    min-width: 0;
    height: 80% !important;
    flex: 1;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    font-size: clamp(6px, 2.4vw, 10px);
  }

  /* ---- Control panel ---- */
  #box {
    position: absolute;
    width: 98%;
    height: 270px;
    top: 69%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgb(40, 56, 72);
    user-select: none;
    border-radius: 0%;
    box-sizing: border-box;
  }

  /* Manual/Auto tab row — sits at bottom of #box */
  #manual_auto {
    width: 96%;
    height: 55px;
    left: 2%;
    top: 205px;
    z-index: 2;
  }

  /* ---- Top bar ---- */
  #money {
    position: absolute;
    width: 98%;
    height: 5.9%;
    top: 0%;
    left: 50%;
    transform: translateX(-50%);
  }

  #bet_amount {
    position: absolute;
    color: white;
    font-size: 18px;
    top: 1px;
    left: 10px;
    user-select: none;
  }

  #money_box {
    font-size: 90%;
    width: 28%;
    height: 90%;
    top: 5.8%;
    left: 42%;
  }

  /* ---- Bet input + half/double buttons ---- */
  #balance {
    z-index: 1;
    width: 52%;
    height: 35px;
    top: 30px;
    left: 3%;
    font-size: 20px;
  }

  #decrementButton {
    z-index: 1;
    font-size: 16px;
    width: 18%;
    height: 45px;
    top: 30px;
    left: 57%;
    border: 1px solid rgba(44, 43, 43, 0.224);
  }

  #incrementButton {
    z-index: 1;
    font-size: 16px;
    width: 18%;
    height: 45px;
    top: 30px;
    left: 77%;
    border: 1px solid rgba(44, 43, 43, 0.224);
  }

  /* ---- Risk & Row selects — side by side, fluid ---- */
  #risk {
    left: 3% !important;
    top: 90px !important;
    font-size: 85% !important;
  }

  #riks {
    position: absolute;
    top: 104px !important;
    width: 46% !important;
    left: 1% !important;
    margin: 0 !important;
    padding: 6px !important;
    font-size: 14px !important;
    box-sizing: border-box;
  }

  #row {
    top: 90px !important;
    left: 52% !important;
    font-size: 85% !important;
  }

  #rows {
    position: absolute;
    width: 46% !important;
    top: 104px !important;
    left: 51% !important;
    margin: 0 !important;
    padding: 6px !important;
    font-size: 14px !important;
    box-sizing: border-box;
  }

  /* ---- Add Ball button ---- */
  #add-ball {
    width: 95%;
    height: 50px;
    top: 148px;
    left: 2.5%;
    font-size: 95%;
    box-sizing: border-box;
  }

  #add-ball2,
  #add-ball3 {
    width: 95%;
    height: 50px;
    top: 148px;
    left: 2.5%;
    font-size: 95%;
    box-sizing: border-box;
  }

  /* ---- Misc ---- */
  #show {
    width: 0%;
  }

  #Labelnumberofbet {
    font-size: 100%;
    width: 90%;
    height: 5%;
    left: 2%;
    top: 62%;
  }

  #numberofbet {
    width: 80%;
    height: 13%;
    top: 70.5%;
  }

  #auto_view {
    position: absolute;
    top: 13%;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0 0 10px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    z-index: 0;
  }

  .output-item {
    min-width: 36px;
    font-size: 11px;
  }
}