#webpack-dev-server-client-overlay {
    display: none;
}

html, body, div {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font-size: 100%;
    vertical-align: baseline;
    -webkit-user-select: none; /* Safari 3.1+ */
    -moz-user-select: none; /* Firefox 2+ */
    -ms-user-select: none; /* IE 10+ */
    user-select: none; /* Standard syntax */
}

body {
    padding-top: constant(safe-area-inset-top);
    padding-right: constant(safe-area-inset-right);
    padding-bottom: constant(safe-area-inset-bottom);
    padding-left: constant(safe-area-inset-left);
    padding-top: env(safe-area-inset-top);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    background: #000;
}

.game {
    position: fixed;
    background-repeat: no-repeat;
    background-position-x: center;
    background-position-y: center;
    background-size: contain;
    margin: auto;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    -webkit-overflow-scrolling: touch;
}
.game canvas {
    margin: auto;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* 直式有大背景時候的陰影 */
.shadowDiv {
    filter: drop-shadow(2px 2px 10px rgba(0,0,0,0.5));
}

/* 轉向圖片 */
.landscape_h {
    display: none;
    /* width: 100%;
    height: 100%; */
    width: 100vw;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: rgba(0, 0, 0, 0.7) no-repeat;
    background-position: center 35%;
    background-size: 60%;
    overflow-x: hidden;
    overflow-y: hidden;
}
.landscape_v {
    display: none;
    /* width: 100%;
    height: 100%; */
    width: 100vw;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: rgba(0, 0, 0, 0.7) no-repeat;
    background-position: center 5%;
    background-size: 20%;
    overflow-x: hidden;
    overflow-y: hidden;
}

.orientationCloseBtn {
    position: fixed;
    top: 10px;
    right: 15vw;
    font-size: 50px;
    color: #fff;
}

/* 全螢幕 */
.fullscreen {
    visibility: hidden;
    width: 100vw;
    height: 250vh;
    position: absolute;
    left: 0;
    top: 0;
    background: rgba(0, 0, 0, 0.7) no-repeat;
    background-position: center 5%;
    background-size: 25%;
    overflow-x: hidden;
}
.fullscreen .fullscreenCloseBtn {
    position: fixed;
    top: 10px;
    right: 15vw;
    font-size: 50px;
    color: #fff;
}

.iframeHelpWrap iframe {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0.9;
    width: 100%;
    height: 100%;
    border: none;
}
.iframeHelpWrap .closeBtn {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* 禁用點擊高亮效果 */
    cursor: pointer;
    position: absolute;
    z-index: 9999;
    width: 55px;
    height: 55px;
    top: 10px;
    right: 30px;
    background-repeat: no-repeat;
    background-size: cover;
    background-image: url('../images/share/helpSystematization/m_btn_help_return.webp');
}
.iframeHelpWrap .verticalCloseBtn {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* 禁用點擊高亮效果 */
    cursor: pointer;
    position: absolute;
    z-index: 9999;
    width: 45px;
    height: 45px;
    top: 10px;
    right: 30px;
    background-repeat: no-repeat;
    background-size: cover;
    background-image: url('../images/share/helpSystematization/m_btn_help_return.webp');
}

.iframeMemberWrap iframe {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* 禁用點擊高亮效果 */
    position: absolute;
    right: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    border: none;
}
.iframeMemberWrap .closeBtn {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* 禁用點擊高亮效果 */
    cursor: pointer;
    position: absolute;
    z-index: 9999;
    width: 55px;
    height: 55px;
    top: 10px;
    right: 30px;
    background-repeat: no-repeat;
    background-size: cover;
    background-image: url('../images/share/operate/core/btn/close/v1/m_btn_close_up.webp');
}
.iframeMemberWrap .verticalCloseBtn {
    cursor: pointer;
    position: absolute;
    z-index: 9999;
    width: 45px;
    height: 45px;
    top: 10px;
    right: 10px;
    background-repeat: no-repeat;
    background-size: cover;
    background-image: url('../images/share/operate/core/btn/close/v1/m_btn_close_up.webp');
}

/* 載入完成前不顯示 iframe 內容（由 Iframe.js 在 onload 後移除 iframePending） */
iframe.iframePending {
    visibility: hidden;
}

.iframeLoading {
    position: absolute;
    top: 45%;
    left: 45%;
    width: 45px;
    height: 45px;
    display: inline-block;
    padding: 0px;
    border-radius: 100%;
    border: 5px solid;
    border-top-color: rgb(254, 209, 141);
    border-bottom-color: #000;
    border-left-color: #000;
    border-right-color: #000;
    opacity: 0; /* 初始設定為透明 */
    animation: loading-animation 1s linear infinite;
    animation-delay: 0.5s; /* 動畫延遲 0.5 秒開始 */
}

.vertical-background, .mobile-extend-background {
    margin: auto;
    width: 100%;
    height: 100%;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    touch-action: none;
    user-select: none;
    pointer-events: none;

    position: fixed;
    background-repeat: no-repeat;
    background-position-x: center;
    background-position-y: center;
    background-size: contain;
}

.mobile-extend-background {
    opacity: 0;
    animation: fadeInBackground 0.5s ease-in-out forwards;
}

@keyframes fadeInBackground {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.mobile .vertical-background {
    display: none;
}

@keyframes loading-animation {
    0% {
      transform: rotate(0deg);
      opacity: 1;
    }
    100% {
      transform: rotate(360deg);
      opacity: 1;
    }
}

/* 活動頁、排行榜（共用金色外框） */
.iframeActivityWrap,
.iframeRankWrap {
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 72%;

    /* 背景放在最外層 */
    background: #1a1a1a;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
}

.iframeActivityWrap {
    width: 76%;
}

/* 排行榜(直式) */
.iframeRankWrap {
    width: 85%;
    height: 72%;
    background: transparent;
}

/* 活動頁(手機直式)：與四神獸直式同尺寸 */
@media (orientation: portrait) {
    .iframeActivityWrap {
        width: 85%;
        height: 72%;
        background: transparent;
    }
}

/* 排行榜(橫式) */
@media (orientation: landscape) {
    .iframeRankWrap {
        width: 45%;
        height: 80%;
        background: transparent;
    }
}

/* 活動頁(手機橫式)：與四神獸橫式同尺寸；hover/pointer 用來避開桌機，桌機維持 76% */
@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
    .iframeActivityWrap {
        width: 45%;
        height: 80%;
        background: transparent;
    }
}

/* 金色外框 */
.iframeActivityWrap::before,
.iframeRankWrap::before {
    content: '';
    position: absolute;
    inset: -18px;
    background: #1a1a1a;
    border-radius: 28px;
    border: 2.5px solid rgb(214, 176, 119);
    pointer-events: none;

    box-shadow: 0 0 8px 1px #eccb93;
    border-radius: inherit;
}

.iframeRankWrap::before {
    background: #1a1a1aCC;
}

/* 活動頁手機版外框半透明，與四神獸一致（須寫在共用 ::before 之後才蓋得過） */
@media (orientation: portrait),
       (orientation: landscape) and (hover: none) and (pointer: coarse) {
    .iframeActivityWrap::before {
        background: #1a1a1aCC;
    }
}

/* 活動頁標題區域（包含標題文字和關閉按鈕） */
.activityTitle {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;  /* 左右分散對齊 */
    padding: 0 15px;  /* 左右留白 */
    flex-shrink: 0;
    pointer-events: none;
    margin-top: -8px;
}

/* 標題文字 */
.activityTitleText {
    /* 漸層文字 */
    background: linear-gradient(
        to bottom,
        #f5e6d3e7 0%,
        #E8C891 20%,
        #D4A574 50%,
        #B8885A 80%,
        #8B6441 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 27px;
    font-weight: 500;
    flex: 1;
    text-align: center;
}

/* 活動頁關閉按鈕 */
.activityCloseBtn {
    width: 40px;
    height: 40px;
    background: url('../images/share/operate/core/btn/close/v1/m_btn_close_up.webp') center/contain no-repeat;
    cursor: pointer;
    transition: transform 0.2s;
    pointer-events: auto;
    flex-shrink: 0;
    translate: -30% 0;
}

.activityCloseBtn:hover {
    transform: scale(1.2);
}

.activityCloseBtn:active {
    transform: scale(0.9);
}

/* 無標題列：關閉鈕浮在活動框右上角 */
.iframeActivityWrap .activityCloseBtn--frame,
.iframeRankWrap .activityCloseBtn--frame {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    pointer-events: auto;
    translate: none;
}

.iframeActivityWrap .activityCloseBtn--frame:hover,
.iframeRankWrap .activityCloseBtn--frame:hover {
    transform: scale(1.2);
}

.iframeActivityWrap .activityCloseBtn--frame:active,
.iframeRankWrap .activityCloseBtn--frame:active {
    transform: scale(0.9);
}

/* 排行榜無標題列：iframe 內容區下移，對齊活動頁 .activityTitle 占用高度（約 40px 列高） */
.iframeRankWrap .activityIframeContainer {
    padding-top: 5px;
}

/* 活動頁iframe 容器 */
.activityIframeContainer {
    position: relative;
    width: 100%;
    flex: 1;
    background-color: transparent;
}

/* 活動頁iframe */
.activityIframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 本機回放模式按鈕 */
.localSaveReplayWrapper {
    position: absolute;
    bottom: 0;
    left: 2%;
    margin: 0 auto 25px auto;
}

.localSaveReplayBtn {
    width: 100%;
    height: 30px;
    max-width: 120px;
    min-width: 70px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    color: #fff;
    border-radius: 20px;
    background: linear-gradient(45deg, #ff6b6b, #f06595, #845ef7);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    user-select: none;
}

.localSaveReplayBtn:hover,
.localSaveReplayBtn.is-active {
    transform: scale(1.1);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
    filter: brightness(1.2);
}

/* DevTool 啟動器：只補與 .localSaveReplayBtn 不同的結構／外觀 */
.devToolLauncher {
    position: fixed;
    left: 2%;
    bottom: 25px;
    z-index: 2147483647;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.devToolLauncher .localSaveReplayBtn {
    pointer-events: auto;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 0 14px;
}
.devToolLauncherMenu { display: none; flex-direction: column; gap: 8px; }
.devToolLauncher.is-open .devToolLauncherMenu { display: flex; }
.devToolLauncherToggle.localSaveReplayBtn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    font-size: 24px;
}
.devToolLauncherClear.localSaveReplayBtn {
    background: linear-gradient(45deg, #868e96, #495057);
}
