/* Toast notifications */

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;
}
.toast-container {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  min-width: 190px;
  max-width: 320px;
  background: var(--panel-alt);
  border: 1px solid var(--border-soft);
  padding: .65rem .85rem .7rem;
  border-radius: 10px;
  font-size: .7rem;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: .4px;
  color: var(--text);
  background: #0C1A24;
  box-shadow: 0 6px 20px -6px rgba(0, 0, 0, .55);
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  position: relative;
  overflow: hidden;
  animation: toastIn .35s ease both;
}

.toast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
}

.toast.success {
  border-color: #20c997;
}

.toast.success::before {
  background: #20c997;
}

.toast.danger {
  border-color: #b53030;
}

.toast.danger::before {
  background: #b53030;
}

.toast.warn {
  border-color: #f6c343;
}

.toast.warn::before {
  background: #f6c343;
}

.toast.hide {
  animation: toastOut .4s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-6px) scale(.92);
  }
}

body {
  background-color: #0C1A24;
  color: #e6e6e6;
  font-family: Arial, sans-serif;
}

.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: 32%;
  left: 0%;
  width: 99%;
  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%;
}

#show_win {
  position: absolute;

  top: 37%;
  left: 5%;
  width: 90%;
  height: 6%;
}

#show_loss {
  position: absolute;
  top: 47%;
  left: 5%;
  width: 90%;
  height: 6%;
}

#show_onporfit {
  position: absolute;
  top: 56%;
  left: 5%;
  width: 90%;
  height: 6%;
}

#show_onloss {
  position: absolute;

  top: 66.6%;
  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;
}

#conves {
  position: absolute;
  background-color: rgb(30, 43, 55);
  width: 70%;
  height: 89%;
  top: 7%;
  left: 28.7%;
  border-radius: 0px 5px 5px 0px;
  user-select: none;
}

#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;
}

#add-ball2,
#add-ball3 {
  position: absolute;
  width: 93%;
  height: 10%;
  top: 90%;
  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;
}

#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);
}

#randempic {
  position: absolute;
  width: 60%;
  height: 10%;
  top: 40%;
  left: 3%;
  background-color: rgb(17, 143, 3);
  font-size: 100%;
  cursor: pointer;
  border-radius: 7px;
}

#clear {
  position: absolute;
  width: 30%;
  height: 10%;
  top: 40%;
  left: 65%;
  background-color: rgb(236, 6, 6);
  font-size: 100%;
  cursor: pointer;
  border-radius: 7px;
}

#risk {
  position: absolute;
  width: 90%;
  top: 27%;
  color: white;
  font-size: 100%;
  top: 25%;
  left: 3%;
}

#riks {
  position: absolute;
  top: 30%;
  left: 2%;
  width: 95%;
  padding: 10px;

  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;
}

.spinner {
  border: 4px solid #f3f3f3;
  /* Light grey */
  border-top: 4px solid #3498db;
  /* Blue */
  border-radius: 50%;
  width: 28px;
  height: 28px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
  display: block;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

#code-block {
  position: absolute;
  top: 0%;
  left: 0%;
  width: 100%;
  height: 100%;
}

.grid {
  position: absolute;
  top: -2%;
  left: 10%;
  height: 90%;
  display: grid;
  grid-column-gap: 11%;
  grid-row-gap: 0%;
  grid-template-columns: repeat(8, 50px);
  margin-top: 20px;
}

.cell {
  width: 170%;
  height: 90%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ffffff;
  background-color: rgb(48, 65, 83);
  border: 1px solid transparent;
  box-sizing: border-box;
  font-family: cursive;
  font-size: 150%;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  box-shadow: 0 6px 0px #323247;
}

/* Responsive adjustments for small screens */

.cell:not(.winning):not(.los):hover {

 background: rgb(0 255 245);
  box-shadow: 0 6px 0px rgb(9, 148, 143);
  border-color: #000000;
  z-index: 2;
}

.selected {
  background: rgb(0 255 245);
  box-shadow: 0 6px 0px rgb(9, 148, 143);
  color: white;
}

/* Applied only to the single cell that was just clicked, via JS,
   so unrelated cells don't replay the animation on every grid redraw */
.pop {
  animation: selectPop 0.28s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes selectPop {
  0% {
    transform: scale(0.82);
  }

  55% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}

.winning {
  background: url(keno.svg) center / 93% 99% no-repeat, rgb(48, 65, 83);
  animation:
    winPop 0.5s cubic-bezier(.34, 1.56, .64, 1) forwards,
    winGlow 1.3s ease-in-out 0.5s infinite alternate;
  box-shadow: inset 0px -1px 12px rgb(5, 222, 142);
  cursor: default;
  position: relative;
}

@keyframes winPop {
  0% {
    transform: scale(0.4) rotate(-12deg);
    opacity: 0;
  }

  45% {
    transform: scale(1.22) rotate(6deg);
    opacity: 1;
  }

  70% {
    transform: scale(0.94) rotate(-3deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes winGlow {
  0% {
    box-shadow: inset 0px -1px 12px rgb(5, 222, 142), 0 0 6px 1px rgba(5, 222, 142, 0.35);
  }

  100% {
    box-shadow: inset 0px -1px 16px rgb(5, 222, 142), 0 0 16px 4px rgba(5, 222, 142, 0.7);
  }
}

.los {
  background-color: rgb(36, 53, 68);
  color: rgba(255, 0, 0, 0.932);
  box-shadow: inset 0 0px 0px 3px rgb(228, 6, 6);
  animation: losShake 0.45s ease-out forwards;
}

@keyframes losShake {
  0% {
    transform: scale(0.85) translateX(0);
    opacity: 0;
  }

  20% {
    transform: scale(1.05) translateX(-6px);
    opacity: 1;
  }

  40% {
    transform: scale(1) translateX(6px);
  }

  60% {
    transform: translateX(-3px);
  }

  80% {
    transform: translateX(3px);
  }

  100% {
    transform: translateX(0);
  }
}

.los:hover {
  background-color: rgb(36, 53, 68);
  color: rgba(255, 0, 0, 0.932);
  box-shadow: inset 0 0px 0px 3px rgb(228, 6, 6);
}

#things {
  position: absolute;
  width: 98%;
  height: 7%;
  top: 91.5%;
  left: 1%;
  display: grid;
  grid-column-gap: 1%;
  grid-row-gap: 0%;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  border: black solid 0px;
  justify-items: center;
  align-items: center;
  overflow: hidden;
}

.items {
  /* Reduced width to prevent overflow and center content */
  width: 100%;
  height: 90%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: rgb(255, 255, 255);
  background-color: rgb(48, 65, 83);
  border: rgb(24, 22, 22) solid 2px;
  font-size: 150%;
  border-radius: 8px;
  transition: all 0.2s ease;
}

@media (max-width: 1000px) {
  .grid {
    top: 0%;
    left: 15%;
    grid-template-columns: repeat(8, 30px);
    grid-column-gap: 12%;
  }

  .cell {
    width: 187%;
    height: 82%;
  }
}

@media (max-width: 1150px) {
  .grid {
    top: 0%;
    width: 46%;
    left: 15%;
    grid-template-columns: repeat(8, 30px);
    grid-column-gap: 12%;
  }

  .cell {
    width: 187%;
    height: 82%;
  }
}



@media (max-width: 900px) {
  .grid {
    top: 0%;
    width: 57%;
    left: 5%;
    grid-template-columns: repeat(8, 13%);
    grid-column-gap: 7%;
    margin-top: 9px;
  }

  #things {
    width: 98%;
    height: 10%;
    top: 89.5%;
    left: 1%;
  }

  .items {

    width: 100%;
    height: 64%;
    font-size: 81%;
  }

  .cell {
    width: 140%;
    height: 70%;
  }

  #conves {
    width: 400px;
    height: 57%;
    top: 6.02%;
    left: 50%;
    transform: translateX(-50%);

  }

  #box {
    position: absolute;
    position: absolute;
    width: 400px;
    height: 100%;
    top: 63%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgb(40, 56, 72);
    user-select: none;
    border-radius: 0%;
  }

  #manual_auto {
    width: 98%;
    height: 20%;
    left: 1%;
    top: 80%;
  }

  #money {
    position: absolute;
    width: 400px;
    height: 5.9%;
    top: 0%;
    left: 50%;
    transform: translateX(-50%);
  }

  #bet_amount {
    position: absolute;
    color: white;
    font-size: 150%;
    top: 0.5%;
    left: 3%;
    user-select: none;
  }

  #money_box {

    font-size: 100%;

    width: 25%;
    height: 90%;
    top: 5.8%;
    left: 45%;
  }

  #balance {
    width: 51%;
    height: 3.8%;
    top: 5%;
    top: 3.5%;
    font-size: 138%;
  }

  #decrementButton {
    font-size: 77%;
    width: 15%;
    height: 7%;
    top: 3%;
    left: 65.8%;
    border: 1px solid rgba(44, 43, 43, 0.224);
  }

  #add-ball {
    width: 94% !important;
    height: 8% !important;
    top: 17.9% !important;
    left: 3% !important;
    font-size: 100% !important;
  }

  #add-ball2,
  #add-ball3 {
    width: 94%;
    height: 8%;
    top: 17.9% !important;
    left: 3% !important;
    font-size: 100%;
  }

  #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;
  }

  #manual_auto {
    width: 98%;
    height: 10%;
    left: 1%;
    top: 26.8%;
    z-index: 1;
  }

  #incrementButton {
    font-size: 77%;
    width: 15%;
    height: 7%;
    top: 3%;
    left: 83%;
    border: 1px solid rgba(44, 43, 43, 0.224);
  }

  #show {
    width: 0%;
  }

  #randempic {
    width: 28% !important;
    height: 7% !important;
    top: 10% !important;
    left: 3% !important;
    border: 1px solid rgba(44, 43, 43, 0.224);
  }

  #clear {
    height: 7% !important;
    top: 10% !important;
    left: 32% !important;
    width: 27% !important;
    border: 1px solid rgba(44, 43, 43, 0.224);
  }

  #riks {
    top: 10.5% !important;
    left: 60% !important;
    width: 38% !important;
    height: 6.5% !important;
  }

  #risk {
    position: absolute;
    width: 20% !important;
    color: white;
    font-size: 94% !important;
    top: 10.2% !important;
    left: 72% !important;

  }
}

@media (max-width: 400px) {

  #conves {
    width: 95%;
  }

  #box {
    position: absolute;
    width: 95%;
  }

  #money {
    width: 95%;
  }
.cell {
        width: 103%;
        height: 78%;
    } 
  .grid {
    width: 76%;
    grid-column-gap: 5%;
    grid-template-columns: repeat(8, 13%);
  }
}

@media (max-width: 350px) {

  #conves {
    width: 95%;
  }

  #box {
    position: absolute;
    width: 95%;
  }

  #money {
    width: 95%;
  }

  .grid {
    grid-column-gap: 1.5%;
    grid-template-columns: repeat(8, 13%);
  }
}