body {
  cursor: default;
  padding: 0;
  border: 0;
  margin: 0;
  /* 禁止橡皮筋效果 */
  -webkit-overflow-scrolling: touch;
  text-align: center;
  height: 100%;
  width: 100%;
  background-color: black!important;
  font-family: Helvetica, Verdana, Arial, sans-serif;
}


html {
  background: unset !important;
}

body, canvas, div {
  outline: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -khtml-user-select: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Remove spin of input type number */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  /* display: none; <- Crashes Chrome on hover */
  -webkit-appearance: none;
  margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}

#Cocos2dGameContainer {
  position: absolute;
  margin: 0;
  overflow: hidden;
  left: 0px;
  bottom: 0px;
  top: 0px;
}

#Cocos2dGameContainer iframe {
  background: unset !important;
}

#Cocos2dGameContainer div {
  background-color: transparent !important;
}

/* 手機版 media query */
@media (max-width: 768px) {
  .splash-image-wrap {
    flex-direction: column;
    gap: 30px;
  }

  .p_k {
    gap: 20px!important;

    .splash-image {
      width: 60px!important;
    }

    .splash-name {
      width: 100px!important;
    }

    .progress-bar {
      height: 5px!important;
      width: 180px!important;
    }
  }
}

#landscape-dummy-div {
  display: none;
}

@media (orientation: landscape) {

  #landscape-dummy-div {
    height: 100lvh;
    display: block;
  }

  body.is-safari #Cocos2dGameContainer {
    position: fixed;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100lvh !important;
  }

  body.is-safari #GameCanvas {
    height: 100lvh !important;
    width: auto !important;
  }

  body.is-safari {
    height: calc(100lvh + 100px);
  }
}

canvas {
  background-color: rgba(0, 0, 0, 0);
}

a:link, a:visited {
  color: #000;
}

a:active, a:hover {
  color: #666;
}

p.header {
  font-size: small;
}

p.footer {
  font-size: x-small;
}

#splash {
  position: absolute;
  display: none;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  align-items: center;
  flex-direction: column;
  justify-content: center;
}

#splash.p_m.rotate {
  .splash-image {
    transform: rotate(90deg);
    height: 100vw;
    width: calc(100vw / 1.77);
  }
}

#splash.p_t.rotate,
#splash.p_f.rotate,
#splash.p_b.rotate {
  .splash-image {
    transform: rotate(90deg);
  }
}

#splash.p_9.rotate {
  .splash-video {
    transform: rotate(90deg);
  }
}

#splash.is-visible {
  display: flex!important;
  opacity: 1;
}

.splash-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-video {
  display: none;
}

.p_9 {
  background: #000;
  background-size: cover;

  .splash-video {
    display: block;
    /* 9G logo 略放大一點 */
    width: 340px;
    max-width: 90vw;
    height: auto;
    object-fit: contain;
  }

  .progress-bar {
    /* 9G 版本不顯示進度條 */
    display: none !important;
  }

  .progress-bar span {
    display: block;
    height: 100%;
    border-radius: 5px;
    transition: width .4s ease-in-out;
    background-color: #ffffff;
  }
}

.p_j {
  background: #000000 no-repeat center;
  background-size: cover;
  gap: 15px;

  .splash-image-wrap {
    gap: 15px;
  }

  .splash-image {
    width: 150px;
  }

  .splash-name {
    width: 200px;
  }


  .progress-bar {
    z-index: 2;
    background-color: #2d261c !important;
    height: 3px;
    width: 150px;
    border-radius: 5px;
    /* box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444;            */
  }

  .progress-bar span {
    display: block;
    height: 100%;
    border-radius: 5px;
    /* box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset; */
    transition: width .4s ease-in-out;
    background-color: #dbb14c;
  }
}

.p_k {
  background: #202a33 no-repeat center;
  background-size: cover;
  gap: 50px;

  .splash-image-wrap {
    gap: 15px;
  }

  .splash-image {
    width: 100px;
  }

  .splash-name {
    width: 200px;
  }


  .progress-bar {
    z-index: 2;
    background-color: #063f3a !important;
    height: 9px;
    width: 340px;
    border-radius: 5px;
    /* box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444;            */
  }

  .progress-bar span {
    display: block;
    height: 100%;
    border-radius: 5px;
    /* box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset; */
    transition: width .4s ease-in-out;
    background-color: #2BC69D;
}
}

.p_g {
  background: #171717 url(./p_g/background.jpg) no-repeat center;
  background-size: cover;

  .progress-bar {
    z-index: 2;
    background-color: #484747 !important;
    position: absolute;
    left: 50%;
    top: calc(50% + 35px);
    height: 9px;
    width: 260px;
    margin: 0 -125px;
    border-radius: 5px;
    /* box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444;            */
  }

  .progress-bar span {
      display: block;
      height: 100%;
      border-radius: 5px;
      /* box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset; */
      transition: width .4s ease-in-out;
      background-color: #3ddd64;
  }
}

.p_m {
  background: black;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

/* p_g logo */
.p_g .splash-image {
  width: 250px;
}

.p_g::after {
  content: '';
  display: block;
  background-image: url(./p_g/jszc.png);
  background-size: contain;
  background-repeat: no-repeat;
  position: absolute;
  top: 100%;
  transform: translate(-50%, -100%);
  left: 50%;
  width: 110px;
  height: 90px;
}

.p_k::after {
  content: '';
  display: block;
  background-image: url(./p_k/gem_support.png);
  background-size: contain;
  background-repeat: no-repeat;
  position: absolute;
  top: 100%;
  transform: translate(-50%, -100%);
  left: 50%;
  width: 110px;
  height: 65px;
}

.p_m .splash-image {
  max-width: 100%;
  max-height: 100%;
  background-size: contain;
  width: 300px;
}

.p_m.is-visible {
  opacity: 1;
}

.p_t {
  background: black;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.p_t .splash-image{
  width: 300px;
}

.p_b .splash-image{
  width: 300px;
}

.p_kb .splash-image{
  width: 400px;
}

/* 定義淡出動畫 */
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* 定義淡出類 */
.fade-out {
  animation: fadeOut 200ms forwards;
}


/* .stripes span {
    background-size: 30px 30px;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%,
                        transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%,
                        transparent 75%, transparent);

    animation: animate-stripes 1s linear infinite;
} */

@keyframes animate-stripes {
    0% {background-position: 0 0;} 100% {background-position: 60px 0;}
}

h1 {
    color: #444;
    text-shadow: 3px 3px 15px;
}

#GameDiv {
    width: 800px;
    height: 450px;
    margin: 0 auto;
    background: black;
    position: relative;
    border: 3px solid black;
    border-radius: 6px;
    box-shadow: 0 5px 40px #333
}

/* 以下為新增樣式 */

.image-container {
  display: inline-block;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}


#game_rule {
  display: inline-block;
  width: 100%;
  height: auto;
  object-fit: cover;
  z-index: 2;
}

#eventIfram2 {
  z-index: 2;
}

#newWagerRecordIframe {
  z-index: 2;
}

#fullscreenIframe {
  z-index: 2;
  width: 100%;
  height: 100%;
}

/* HappyFish / 橫屏遊戲下注紀錄：全螢幕鋪滿 viewport（橫屏時勿用 vh 算寬，否則只剩中間一條） */
#fullscreenModal .modal-dialog {
  height: 100svh !important;
  width: 100vw !important;
  margin: 0 !important;
  max-width: 100vw !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#fullscreenModal.modal {
  overflow: hidden !important;
}

/* direction=h 橫向遊戲 + 實體直屏鎖定：旋轉 fullscreenModal（比照 splash.rotate） */
#fullscreenModal.portrait-locked-landscape {
  overflow: hidden !important;
}

#fullscreenModal.portrait-locked-landscape .modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  /* iOS：用 small viewport，避免 100vh 膨脹導致內層 iframe 過寬、header 按鈕出界 */
  width: 100vh !important;
  width: 100svh !important;
  height: 100vw !important;
  height: 100svw !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: translate(-50%, -50%) rotate(90deg);
}

#fullscreenModal.portrait-locked-landscape .modal-content,
#fullscreenModal.portrait-locked-landscape .modal-body {
  width: 100%;
  height: 100%;
}

#fullscreenModal.portrait-locked-landscape #fullscreenIframe {
  width: 100%;
  height: 100%;
}

.loading-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background:url(./loader.c3a8b.gif) center center no-repeat;
  background-size: 4rem;
}

#wagersModal, #exampleModal {
  /* scrollbar-gutter: stable both-edges; */
}

#rotate-mobile {
  z-index: 2000;
  background: rgba(0, 0, 0, 0.8);
  position: absolute;
  width: 100vw;
  height: calc(100svh);
  top: 0;
  left: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#swipe-mobile {
  z-index: 2000;
  background: rgba(0, 0, 0, 0.8);
  position: absolute;
  width: 100vw;
  height: calc(100lvh + 100px);
  top: 0;
  left: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.bottom-div {
  height: 1px;
  position: absolute;
  bottom: 0;
  width: 100vw;
}


#rotate-mobile.is-visible,
#swipe-mobile.is-visible {
  display: flex;
}

#rotate-mobile .mobile-gif {
  width: 50%;
  height: 50%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  background-image: url(./rotateMobile.6bc3d.gif);
}

#swipe-mobile .mobile-gif {
  width: 20%;
  height: 50%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  background-image: url(./swipeMobile.bbbe5.png);
  /* 讓他有一個網上滑動的動畫 */
  animation: swipe 1.5s infinite;
}

@keyframes swipe {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50px);
  }
}

#mobile-text {
  color: white;
}

.div-spacer {
  height: 130px;
}