* {
  padding: 0;
  margin: 0;
}
:root {
  --en-lang-size: 2.5vw;
  --th-txt-size: 2vw;
}

html,
main {
  touch-action: pan-x pan-y;
}

html,
body {
  touch-action: manipulation; /* ✅ Blocks pinch & double-tap zoom */
  overscroll-behavior: none; /* ✅ Stops bounce/scroll zoom */
}

html,
body {
  touch-action: manipulation;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}

body,
input,
button,
select,
textarea {
  font-size: 16px !important;
}
/* Disable unwanted text scaling & zoom triggers */
html,
body,
input,
button,
select,
textarea {
  font-size: 16px !important; /* Prevent Safari's forced zoom */
  touch-action: manipulation; /* Prevent double-tap zoom */
  -webkit-user-select: none; /* Disable text selection */
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* Disable long-press popup */
  overscroll-behavior: none; /* Prevent accidental pull-to-refresh */
}

#historyPanel {
  color: white;
  user-select: none;
  font-family: "Noto Sans";
  font-size: 0.9em;
  z-index: 1;
  background-color: rgba(0, 0, 0, 0.95);
  display: none;
}

.displayNone {
  visibility: hidden;
}

.displayHideDS {
  display: none;
}

#historyMain {
  width: 100%;
  height: 100%;
}

#historyHeader {
  box-sizing: content-box;
  border-bottom: 2.77px solid #a48723;
  width: 98%;
  height: 14%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: auto;
}

.h-heading {
  display: flex;
  align-items: center;
  width: 80vw;
  margin: auto;
  justify-content: center;

  height: 100%;
}

.headingText {
  font-family: "Inter-BoldItalic";
  font-size: min(7vmin, 56px);
  color: #ffca0d;
  line-height: 0.9;
  font-family: "Noto Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-style: normal;
  font-variation-settings: "wdth" 100;
}

.imageDiv {
  display: flex;
  gap: 1.2rem;
  visibility: hidden;
}

.imageDiv img {
  width: 50%;
  background-color: rgba(0, 0, 0, 0.8);
  border: 1px solid #ffffff;
  border-radius: 10px;
  padding: 0.8rem 0.5rem;
}

.imageDiv img:hover {
  background-color: #515151;
  cursor: pointer;
}

select {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  text-indent: 1px;
  text-overflow: "";
  padding: 8px 24px;
  background-color: #ffca0d;
  border-radius: 10px;
}

.ToggleDiv {
  background-color: #ffca0d;
  padding: 0rem 1.2rem;
  display: flex;
  font-family: "Inter-Medium";
  font-size: min(7vmin, 1.78rem);
  color: black;
  align-items: center;
  border-radius: 10px;
  gap: 10px;
  border: 1px solid white;
  font-weight: 700;
  justify-content: center;
  white-space: nowrap;
}

.ToggleDiv:hover {
  background-color: #cba009;
  cursor: pointer;
}

.ToggleDiv img {
  width: min(7vmin, 20%);
  height: 20%;
}

.ToggleDiv p {
  margin: 0;
  padding: 0;
}

.h-close {
  font-size: 28px;
  font-weight: bold;
  opacity: 1;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  height: 100%;
}

.break-all {
  word-break: break-all;
}

#h-detailsMainContainer {
  width: 100%;
  height: 81%;
  display: flex;
  flex-direction: column;
  font-family: "Inter-Bold";

  font-family: "Noto Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
  font-variation-settings: "wdth" 100;
}

#h-detailsSelectorBtns_Container {
  width: 80%;
  display: flex;
  align-self: center;
  margin-top: 25px;
  display: none !important;
}

.h-detailsSelectorBtn {
  cursor: pointer;
  width: 100%;
  aspect-ratio: 480.67 / 107;
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid white;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: var(--en-lang-size);
  line-height: 1.2;
  --borderRadius: 0.6vw;
}

.h-detailBtns_subText {
  font-size: 0.5em;
}

.h-detailsSelectorBtn:first-child {
  background: #ffca0d;
  color: black;
  pointer-events: none;
  border-top-left-radius: var(--borderRadius);
  border-bottom-left-radius: var(--borderRadius);
}

.h-detailsSelectorBtn:last-child {
  border-top-right-radius: var(--borderRadius);
  border-bottom-right-radius: var(--borderRadius);
}

#h-historyTables_Wrapper {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  margin-top: 15px;
}

#h-spinner-Wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  display: none;
}

#h-historyTable_Container {
  width: 80vw;
  margin: auto;
  translate: calc(var(--scrollWidth) / 2) 0;
  display: grid;
  grid-template-columns: auto repeat(3, 1fr) auto;
  font-size: 1.33vw;
  font-family: "Inter-Medium";
  font-family: "Noto Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
  font-variation-settings: "wdth" 100;
}

#h-historyTable_Container > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

#h-historyTable_Container > .h-tableContent {
  padding: 1em 0.5em;
  box-sizing: content-box;
}

.h-tableContent {
  cursor: pointer;
  font-size: 1rem;
  color: #bcbcbc;
}

#h-historyTable_Container > .h-tableTitle {
  padding-inline: 0.5em;
  box-sizing: content-box;
  text-transform: uppercase;
  font-weight: 500;
  border-bottom: 0.01em solid #202020;
  font-size: 1.125rem;
  color: #ffffff;
}

.h-detailIcon {
  width: 0.5em;
  display: grid;
  place-items: center;
}

.text-center {
  align-items: center !important;
}

.contentBonus {
  color: #ffca0d;
}

#historyPanel[isMobile="true"] #historyHeader {
  height: 15%;
  border-width: 2px;
}

#historyPanel[isMobile="true"] .h-close {
  width: 85px;
}

#historyPanel[isMobile="true"] .h-close img {
  margin: auto;
  height: 64%;
}

#historyPanel[isMobile="true"] .h-heading {
  margin-left: 40px;
}

#historyPanel[isLand="true"] #h-detailsSelectorBtns_Container {
  width: 60%;
  display: none;
}

#historyPanel[isLand="true"] .h-detailsSelectorBtn {
  aspect-ratio: 150/39;
  font-size: 1.5vw;
}

#historyPanel[isLand="true"] #h-historyTable_Container {
  font-size: 1.5vw;
  width: 75vw;
}

@media (orientation: portrait) {
  .ToggleDiv {
    font-size: min(4vmin, 1rem);
  }

  .displayNone {
    display: none;
  }

  .displayhide {
    display: none;
  }

  #historyPanel[isMobile="true"] #historyHeader {
    height: 9.5%;
  }

  #historyPanel[isMobile="true"] .h-close {
    width: auto;
  }

  #historyPanel[isMobile="true"] .h-close img {
    margin: auto;
    height: 50%;
  }

  #historyPanel[isMobile="true"] .h-heading {
    margin-left: 0px;
  }

  #historyHeader {
    width: 94%;
    height: 7.5%;
    align-items: flex-end;
  }

  .h-heading .headingText {
    font-size: min(3vh, 26px);
    align-items: flex-end;
  }
  .headingText {
    white-space: normal;
  }

  #h-detailsMainContainer,
  #lower {
    width: 100%;
    height: 78%;
  }

  .h-detailsSelectorBtn {
    aspect-ratio: 120.67/39;
    font-size: 3vw;
    --borderRadius: 1.6vw;
  }

  #h-detailsSelectorBtns_Container {
    width: 96%;
    display: none;
  }

  #h-historyTable_Container {
    width: 96%;
    font-size: 3vw;
    grid-template-columns: auto repeat(2, 1fr) auto auto;
  }
  #h-historyTable_Container > .h-tableTitle {
    padding-inline: 0.8em;
  }
}

@media (orientation: portrait) and (max-width: 530px) {
  .h-tableContent {
    font-size: 0.64rem;
  }

  #h-historyTable_Container > .h-tableTitle {
    font-size: 0.8rem;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .h-tableContent {
    font-size: 0.64rem;
  }

  #h-historyTable_Container > .h-tableTitle {
    font-size: 0.8rem;
  }
}

@media (min-width: 1180px) and (max-width: 1290px) {
  .headingText {
    font-size: min(7vmin, 46px);
  }
}

@media (min-width: 950px) and (max-width: 1180px) {
  .headingText {
    font-size: min(7vmin, 38px);
  }
}

@media (max-width: 750px) {
  .displayhide {
    display: none;
  }
}

#historyPanel[isLand="true"] .displayhide {
  display: none;
}

#historyPanel[isLand="true"] .ToggleDiv {
  font-size: 0.8rem;
  width: 7rem;
}

#historyPanel[isLand="true"] .ToggleDiv img {
  width: 25%;
  height: 25%;
}

#historyPanel[isLand="true"] .h-heading {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0;
  grid-template-rows: repeat(1, 1fr);
}

#historyPanel[isLand="true"] .headingText {
  grid-column: 2 / span 3;
  text-align: center;
}

#historyPanel[isLand="true"] .ToggleDiv {
  grid-column: 5 / span 5;
  padding: 0.3rem 1.2rem;
}

.modal-overlay {
  display: none;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

#gameHistoryIFrame {
  width: 100%;
  border: none;
  overflow: auto;
  flex-grow: 1;
}

#gameHistoryIFrame button {
  display: none !important;
}

.modalContent {
  display: flex;
  flex-direction: column;
  background-color: #fff;
  padding: 8px;
  border-radius: 16px;
  width: 90% !important;
  height: 75vh;
  position: relative;
}

.modalContentHeader {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  margin-bottom: 4px;
}

.close-btn {
  cursor: pointer;
  max-width: 48px;
  background: none;
  border: none;
  z-index: 100;
}

.close-btn:focus {
  outline: none;
}

.close-btn img {
  width: 100%;
}

#loader {
  border: 8px solid #f3f3f3;
  border-radius: 50%;
  border-top: 12px solid #444444;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  z-index: 99999;
  display: block;
}

.center {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
}

.bottom-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000000;
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 10%;
}

.bottom_image_container {
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: 1rem;
}

.bottom_image_container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

@media screen and (max-width: 1024px) {
  .close-btn {
    width: 32px;
  }
}

@media (orientation: landscape) {
  .bottom_image_container {
    padding: 0.5rem;
  }
}

.game-footer {
  bottom: 0;
  left: 0;
  width: 100%;
  height: 6%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  border-top: 2px solid #242324;
  border-bottom: 2px solid #242324;
  background: radial-gradient(
      1200px 560px at 50% -20%,
      rgba(255, 255, 255, 0.06),
      transparent 55%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(255, 255, 255, 0.02) 14%,
      rgba(0, 0, 0, 0.1) 100%
    ),
    linear-gradient(180deg, #0b0e14 0%, #080a10 100%);
}

.footer-item {
  border-radius: 16px;
  border: 1px solid transparent;
  background: /* surface */ linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.07),
        rgba(255, 255, 255, 0.02)
      )
      padding-box,
    /* border */
      linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.22))
      border-box;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 900;
  letter-spacing: 0.16em;
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease,
    color 0.12s ease;
  min-width: 150px;
  text-align: center;
  padding: 5px;
}

.footer-item::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 6px;
  height: 1.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0.45;
}

.footer-text {
  font-size: 14px;
  text-transform: uppercase;
  color: #8e8d8d;
  padding-top: 1px;
  text-shadow: 1px -2px 4px rgba(0, 0, 0, 0);
}

.footer-item.active {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.96);
  border: 1px solid transparent;
  background: /* top glow */ radial-gradient(
        220px 58px at 50% 0%,
        rgba(242, 213, 154, 0.28),
        transparent 70%
      )
      padding-box,
    /* surface */
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.02)
      )
      padding-box,
    /* gold border */
      linear-gradient(
        180deg,
        rgba(242, 213, 154, 0.78),
        rgba(183, 139, 68, 0.28)
      )
      border-box;
  box-shadow: 0 16px 44px rgba(242, 213, 154, 0.18),
    0 10px 28px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.42);
  transform: translateY(-1px);
}

.footer-item.active .footer-text {
  color: white !important;
}

.footer-item.active::before {
  display: none !important;
}

.footer-icon {
  width: 25px;
  height: 25px;
  object-fit: contain;
  transition: transform 0.2s ease;
  margin: 0;
}

.footer-item:hover {
  transform: scale(1.05);
}

@media (orientation: portrait) {
  .footer-icon {
    width: 26px;
    height: 26px;
  }

  .footer-text {
    letter-spacing: 0px;
    font-size: 10px;
  }
}

@media (orientation: portrait) and (max-width: 760px) {
  .footer-item {
    min-width: 100px;
  }
}

@media (orientation: portrait) and (max-width: 480px) {
  .footer-icon {
    width: 20px;
    height: 20px;
  }
  .footer-item {
    min-width: 100px;
  }
}

@media (orientation: portrait) and (max-width: 400px) {
  .footer-icon {
    width: 16px;
    height: 16px;
  }
  .footer-item {
    min-width: 100px;
  }
}

.candy_cancel_btn {
  box-sizing: border-box;
  width: 20%;
  height: 100%;
  display: flex;
  justify-content: flex-end !important;
  align-items: center !important;
  cursor: pointer;
}

.candy_cancel_btn img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

@media (orientation: portrait) {
  .game-footer {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6%;
    display: flex;
    align-items: center;
  }

  .candy_cancel_btn img {
    width: 45px;
    height: 45px;
    object-fit: contain;
  }
}

@media (orientation: portrait) and (min-width: 481px) {
  .candy_cancel_btn img {
    width: 50px;
    height: 50px;
    object-fit: contain;
  }
}

@media (orientation: landscape) {
  .game-footer {
    height: 9%;
  }
}

@media (orientation: landscape) and (max-width: 1000px) {
  .game-footer {
    height: 9%;
  }
}

@media (orientation: landscape) and (max-height: 550px) {
  .game-footer {
    height: 12%;
  }
  .footer-icon {
    height: 22px;
    width: 22px;
  }
  .betting-overlay {
    height: 88%;
  }
}

.h-tableContent > p {
  margin-bottom: 0 !important;
}

@media (orientation: portrait) {
  #h-detailsMainContainer,
  #lower {
    width: 100%;
    flex: 1;
  }
}

@media (orientation: portrait) and (max-width: 760px) {
  #h-detailsMainContainer,
  #lower {
    width: 100%;
    flex: 1;
  }
}

@media (min-width: 1920px) {
  #h-detailsMainContainer,
  #lower {
    height: 86%;
  }
}

@media (max-height: 376px) {
  #lower {
    height: 61%;
  }
}

@media (max-height: 360px) {
  .lower {
    height: 60%;
  }
}

@media (max-height: 344px) {
  #lower {
    height: 76%;
    flex: 1;
  }
}
