* {
    -webkit-tap-highlight-color: transparent;
}
html,
body,
iframe {
    height: 100%;
    box-sizing: border-box;
}

/*
原本 html, body, iframe的overflow統一都是設為hidden
但為了解決進入全螢幕的問題，所以改成以下的設定
iframe / body : 保持 hidden
html : 
ios16以上的機種橫屏直屏都設為visible
ios16以下的機種橫屏時設為visible，直屏時設為hidden

這邊css為ios16以下的設定，後續不會在程式碼中變動
ios16以上的機種會在 ducky/fullscreen 的 handleOrientationchange() 中持續做設定
*/
iframe {
    overflow: hidden;
}

@media (orientation: landscape) {
    html {
        overflow: visible;
    }
}

@media (orientation: portrait) {
    html {
        overflow: hidden;
    }
}

html {
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}
body {
    font-family: Noto Sans, Segoe UI, Arial, sans-serif;
    font-weight: 400;
    color: #b59663;
    touch-action: pan-y;
    width: 100%;
    height: 100%;
    overscroll-behavior-y: contain;
    margin: 0 auto;
    overflow: hidden;
    background-color: #000 !important;
    position: relative;
    text-align: center;
}
canvas {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    transition: all 0.1s;
    opacity: 1;
    height: var(--game-vh);
    width: var(--game-vw);
    z-index: 5;
    min-height: 100%;
}
input,
textarea {
    font-size: 16px !important;
}
#root {
    height: 100%;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
}
/* IE11 */
@media screen and (-ms-high-contrast: none) {
    body {
        overflow-x: hidden;
    }
}
/* IE Edge */
@supports (-ms-ime-align: auto) {
    body {
        overflow-x: hidden;
    }
}
::-webkit-scrollbar {
    width: 0px;
}
::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px #342816;
    -webkit-border-radius: 4px;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    -webkit-border-radius: 4px;
    border-radius: 4px;
    background: #79623e;
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
}
.loading[orientation='portrait'] {
    transform: translateX(-50%) rotate(90deg);
    margin-left: 50% !important;
}
.loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 98;
    background-color: black;
    width: 100%;
    height: 100%;
    background-position: 50%;
    background-size: cover;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    visibility: hidden;
    touch-action: none;
}
.loading.nowebView::before {
    width: 200%;
    height: 200%;
    background-color: #000;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    content: '';
}
.loading-logo {
    background-size: contain;
    background-repeat: no-repeat;
    width: 32%;
    margin: 10% auto 0% auto;
}
.logo-image {
    position: relative;
    width: 32%;
    opacity: 1;
    animation: fade 2s linear;
    flex: 1;
    display: flex;
    align-items: flex-end;
}
.logo-image img {
    position: absolute;
    width: 100%;
    /* height: 100%; */
}
.loading__progress {
    transform-origin: center bottom;
    width: 860px;
    height: 20%;
    margin-top: 5%;
    margin-bottom: 1%;
    align-items: center;
}
.progress-text-container {
    width: 100%;
    display: flex;
    color: #fff;
    text-align: center;
    font-size: 22px;
    justify-content: center;
    align-items: center;
}
.loading-container {
    overflow: hidden;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: auto 100%;
    width: 100vw;
    height: 100vh;
}
@keyframes fade {
    0% {
        opacity: 0;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 1;
    }
}

/* stats */
#stats {
    position: fixed;
    left: 3rem;
    bottom: 10px;
    pointer-events: none;
    font-size: 2rem !important;
    user-select: none;
    z-index: 10000;
    color: #fff;
    line-height: 1.2em;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* scroll */
@media screen and (max-height: 450px) {
    .dialogue-iframe-container {
        -webkit-overflow-scrolling: touch;
        overflow-y: scroll;
        overflow-x: hidden;
    }
}

@keyframes popUpDialogue {
    0% {
        transform: scale(calc(0.1 * 1.1 * var(--ratio))) translate(-50%, -50%);
    }
    80% {
        transform: scale(calc(1.1 * 1.1 * var(--ratio))) translate(-50%, -50%);
    }
    100% {
        transform: scale(calc(1.1 * var(--ratio))) translate(-50%, -50%);
    }
}

@keyframes popUpDialogueMask {
    0% {
        opacity: 0;
    }
    40% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
.dialogue-outer-container {
    position: absolute;
    left: 0;
    margin: auto;
    height: var(--game-vh);
    width: 100%;
    z-index: -1;
    overflow: hidden;
    top: 0;
    touch-action: none;
    display: none;
    pointer-events: auto;
    min-height: 100%;     /* mantis-48861 手機轉向 canvas 重新計算比率、寬高變動後與 —game-vh 不一定，故設定最小高度為滿版 */
}

.dialogue-inner-container {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    visibility: hidden;
    touch-action: none;
    text-align: left;
}
.openDialogue {
    visibility: visible;
    animation: dialogueOpenAnimate 0.15s steps(9, end);
    animation-fill-mode: forwards;

}
.closeDialogue {
    visibility: visible;
    animation: dialogueCloseAnimate 0.15s steps(9, start);
    animation-fill-mode: forwards;
}
@keyframes dialogueOpenAnimate {
    from {
        top: var(--game-vh);  /* mantis-0048713 [h5][雙系統][中文][CNY][連環奪寶]第一次進多回合的投注詳情頁面，點擊「>」或下方輸贏金額會跑版 ，評估導致 iframe 的定位基準發生變化，從而影響其對位。故使用 top 達到原先功能*/
    }
    to {
        top: 0;
    }
}

@keyframes dialogueCloseAnimate {
    from {
        top: 0;  /* mantis-0048713 [h5][雙系統][中文][CNY][連環奪寶]第一次進多回合的投注詳情頁面，點擊「>」或下方輸贏金額會跑版 ，評估導致 iframe 的定位基準發生變化，從而影響其對位。故使用 top 達到原先功能*/
    }
    to {
        top: var(--game-vh);
    }
}

.fixServiceKeyboard {
    height: initial !important;
    overflow: initial !important;
}
.portrait-dialogue-outer {
    height: 100vw;
    width: 100vh;
    transform-origin: top left;
    top: 0;
    left: 100vw;
    transform: rotate(90deg);
    -webkit-transform: rotate(90deg);
    min-height: initial;     /* mantis-48861 portrait-dialogue-outer「幫助頁」只單獨設置轉向高為height: 100vw; 不需要再設定 min-height:100% */
}
.portrait-dialogue-outer.counter-clockwise {
    transform: translate(-50%, -50%) rotate(-90deg);
    -webkit-transform: translate(-50%, -50%) rotate(-90deg);
}

#blurBg {
    /* position 改為 fixed 避免點擊返回功能跑版，固定 blurBg 位置  */
    position: fixed; 
    top: 0;
    /* bottom: 0; */
    left: 0;
    /* right: 0; */
    justify-content: center;
    align-items: center;
    z-index: -1;
    margin: 0 auto;
    transform: initial;
    display: block;
    --myVar: none;
}

#blurBg::before {
    content: '';
    background-color: #888;
    position: absolute;
    z-index: -2;
    width: 100%;
    height: 100%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: none;
    display: var(--myVar);
}

#blurBg img {
    height: 100%;
    top: 0;
    transform: initial;
    margin: 0 auto;

    max-width: 100%;
    max-height: 100vh;
}

@media screen and (orientation: portrait) {
    #blurBg {
        transform: translate(-50%, -50%) rotate(90deg);
        height: 100vw !important;
        width: 100vh !important;
        margin: 0;
        top: 50%;
        left: 50%;
    }
    #blurBg img {
        width: initial;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
}
@media screen and (orientation: landscape) {
    #blurBg {
        transform: initial !important;
        top: 0 !important;
        left: 0 !important;
        /* width: var(--game-vw) !important;
        overflow: hidden; */
        width: var(--vw, 100vw) !important;
        height: 100vh;
    }
    #blurBg img {
        left: 50% !important;
        top: 0 !important;
        transform: translateX(-50%) !important;
        margin: 0 auto !important;
        position: absolute !important;
        /* width: var(--game-vw) !important;*/
    }
}
#blurBg[orientation='portrait'] {
    transform: translate(-50%, -50%) rotate(90deg);
    display: initial;
    top: 50%;
    left: 50%;
    height: 100vw;
    width: 100vh;
    overflow: hidden;
}
#blurBg[orientation='portrait'] img {
    width: initial;
    height: 100%;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
#blurBg[orientation='landscape'] {
    transform: initial !important;
    top: 0 !important;
    left: 0 !important;
    display: initial !important;
    /* width: var(--game-vw) !important; */
}
#blurBg[orientation='landscape'] img {
    left: 50% !important;
    top: 0 !important;
    transform: translateX(-50%) !important;
    margin: 0 auto !important;
    position: absolute !important;
}

/* loading page start */
#loadingPage {
    /* 添加 position 為 fixed 避免點擊返回功能跑版，固定 loadingPage 位置，放在最外層不影響 .scene  */
    display: none;
}

#loadingPage .scene {
    position: relative;
}

#loadingPage .rotate-layer {
    transform: rotate(0deg);
}

/* zindex blurBg < loadingPage 移除 background-color 不需要預設底色。在 loading-img 渲染完成前都是顯示 blurBg */
#loadingPage .loading-page-container {
    position: absolute;
    top: 0px;
    left: 0px;
    margin: auto;
    width: 1493px;
    height: 640px;
    transform-origin: top left;
}
#loadingPage .loading-img {
    width: 100%;
    height: auto;
    position: absolute;
    top: 0%;
    left: 0%;
}

#loadingPage .loading-bar {
    width: 600px;
    height: 10.75px;
    position: absolute;
    left: calc(50%);
    bottom: 142px;
    transform: translateX(-50%);
}
#loadingPage .loading-bar-bg {
    width: 100%;
    height: 100%;
    background-color: #010004;
}
#loadingPage .loading-bar-ing {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0px;
    left: 0px;
}
#loadingPage .loading-bar-ing-outer {
    width: 100%;
    height: 100%;
    padding: 1.37px 2px;
    box-sizing: border-box;
}
#loadingPage .loading-bar-ing-inner {
    width: 0%;
    height: 100%;
    background-color: #f2ff1b;
}

#loadingPage .loading-text {
    font-family: Arial;
    font-size: 22px;
    color: #fff;
    width: 100%;
    position: absolute;
    left: 50%;
    bottom: 111px;
    transform: translateX(-50%);
    font-weight: 500;
    text-shadow: 0 0 3px black, 0 0 3px black, 0 0 3px black, 0 0 3px black, 0 0 3px black, 0 0 3px black, 0 0 3px black,
        0 0 3px black;
}
#loadingPage .footer {
    width: 100%;
    height: 103px;
    position: absolute;
    right: 0;
    bottom: 0;
}
#loadingPage .footer-bg {
    width: 100%;
    height: 100%;
    background-color: #000;
    opacity: 0.7;
}
#loadingPage .wali-logo {
    position: absolute;
    left: calc(50% - 480px);
    top: 15px;
}
#loadingPage .slogan {
    width: 199px;
    height: 22px;
    position: absolute;
    left: calc(50% - 333px);
    top: 40px;
}
#loadingPage .seperate-line {
    width: 1px;
    height: 87px;
    background-color: #737373;
    position: absolute;
    left: calc(50% - 120px);
    top: 8px;
}
#loadingPage .title {
    font-family: Arial;
    font-size: 20px;
    color: #bebebe;
    position: absolute;
    left: calc(50% - 81px);
    top: 6px;
}
#loadingPage .subtitle {
    position: absolute;
    left: calc(50% - 81px);

    top: 32px;
}
#loadingPage .loading-sub-style {
    font-family: Arial;
    font-size: 16px;
    color: #bebebe;
}
#loadingPage .ga-img {
    position: absolute;
    left: calc(50% - 81px);
    top: 55px;
}
#loadingPage .ga-text {
    position: absolute;
    left: calc(50% - 32px);
    top: 66px;
}
#loadingPage .bmm-img {
    width: 123px;
    height: 27px;
    position: absolute;
    left: calc(50% + 50px);
    top: 64px;
}
#loadingPage .bmm-text {
    position: absolute;
    left: calc(50% + 178px);
    top: 66px;
}
#loadingPage .gli-img {
    position: absolute;
    left: calc(50% + 276px);
    top: 64px;
}
#loadingPage .gli-text {
    position: absolute;
    left: calc(50% + 341px);
    top: 66px;
}

/* 只針對直版手機添加 position 為 fixed 避免點擊返回功能跑版，固定 loadingPage 位置，放在最外層不影響  */
@media (orientation: portrait) {
    #loadingPage {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
    }
}
/* loading page end */

