html,
body {
    -webkit-text-size-adjust: none !important;
    text-size-adjust: none !important;
}

body {
    margin: 0;
    background: #000;
    overflow: hidden;
    font-family: 'Inter', 'Roboto', 'Arial Black', sans-serif;
    /* 1. 徹底禁止手機預設滑動 (你原本加的) */
    touch-action: none;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* 👇👇👇 新增的 3 道終極防護罩 👇👇👇 */
    /* 2. 禁止任何文字被反白選取 (PC/Mobile 通用) */
    -webkit-user-select: none;
    /* Safari, Chrome, Opera, iOS, Android */
    user-select: none;
    /* 標準語法 */
    /* 3. 禁止手機長按彈出「複製/查詢/翻譯」的黑色系統選單 (iOS/Android 必備) */
    -webkit-touch-callout: none;
    /* 4. 消除手機點擊按鈕時，系統預設閃爍的半透明灰色框框 */
    -webkit-tap-highlight-color: transparent;
}

canvas {
    display: block;
}

/* ============================================================
   ✅ 通用工具類別 (Utility Classes)
   ============================================================ */

/* 嚴格隱藏規則 (確保隱藏後不佔空間且不擋點擊) */

.hidden {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

/* 強制消失，不管手機怎麼轉都不會再出來 */

.force-hide-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    z-index: -1 !important;
    pointer-events: none !important;
}

/* ============================================================
   ✅ 核心遮罩與 UI 系統
   ============================================================ */

/* 徹底移除頂部黑條，並確保 Copyright 不擋點擊 */

.footer-copyright {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    pointer-events: none !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.2) !important;
}

/* 初始解碼大門 */

#shaky-decoder-gate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease;
    pointer-events: none;
    /* 防止擋住後方全螢幕按鈕 */
}

.decoder-content {
    position: relative;
    width: 300px;
    text-align: center;
}

.decoder-status {
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    letter-spacing: 5px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    opacity: 0.8;
}

/* 點點點動態 */

.dots {
    display: inline-block;
    width: 20px;
    text-align: left;
    animation: dotMove 1.5s infinite;
}

@keyframes dotMove {
    0% {
        content: '';
    }
    33% {
        content: '.';
    }
    66% {
        content: '..';
    }
    100% {
        content: '...';
    }
}

/* 低調的雷射掃描線 */

.decoder-scanner {
    position: absolute;
    top: -30px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00ffaa, transparent);
    box-shadow: 0 0 15px #00ffaa;
    animation: scanMove 2.2s infinite ease-in-out;
}

@keyframes scanMove {
    0% {
        top: -20px;
        opacity: 0;
    }
    40%,
    60% {
        opacity: 1;
    }
    100% {
        top: 40px;
        opacity: 0;
    }
}

/* 全息科技感開場大廳 */

#start-screen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000000;
    background: transparent !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.8s ease, visibility 0.8s;
}

#start-screen:not(.hidden) {
    z-index: 21000000 !important;
}

#start-screen.active-ui {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

#start-screen.fade-out {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    display: none !important;
}

#btn-start-game {
    margin-top: 200px !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 6000 !important;
}

.btn-heavy-start {
    background: rgba(0, 255, 255, 0.05);
    color: #00ffff;
    font-size: 18px;
    font-weight: bold;
    font-family: "Courier New", Courier, monospace;
    letter-spacing: 12px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    padding: 12px 35px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1), inset 0 0 10px rgba(0, 255, 255, 0.1);
    text-shadow: 0 0 8px #00ffff;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(3px);
    position: relative;
    text-transform: uppercase;
    transform-origin: center center;
    margin: 0 !important;
    pointer-events: auto !important;
    z-index: 20000010 !important;
}

.btn-heavy-start::before,
.btn-heavy-start::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #00ffff;
    transition: all 0.3s ease;
}

.btn-heavy-start::before {
    top: -4px;
    left: -4px;
    border-right: none;
    border-bottom: none;
}

.btn-heavy-start::after {
    bottom: -4px;
    right: -4px;
    border-left: none;
    border-top: none;
}

.btn-heavy-start:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.6), inset 0 0 20px rgba(0, 255, 255, 0.3);
    transform: scale(1.15);
    letter-spacing: 12px;
    border-color: rgba(0, 255, 255, 0.8);
}

.btn-heavy-start:active {
    transform: scale(0.9);
    box-shadow: 0 0 50px #00ffff;
    background: #00ffff;
    color: #000;
}

/* ============================================================
   ✅ 遊戲主畫面與 UI
   ============================================================ */

#game-ui {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 100;
    pointer-events: auto;
    transition: opacity 0.3s;
}

.timer-display {
    font-size: 36px;
    color: #0ff;
    font-family: "Courier New", Courier, monospace;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.9);
    letter-spacing: 2px;
}

.health-bar-wrapper {
    width: 400px;
    position: relative;
}

.health-bar-container {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #0ff;
    border-radius: 10px;
    box-shadow: 0 0 10px #0ff, inset 0 0 10px rgba(0, 255, 255, 0.5);
    overflow: hidden;
    position: relative;
}

#health-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #0055ff, #00aaff);
    transition: width 0.1s ease-out, background 0.3s ease;
}

/* 🔥 修正：拉高 z-index 到 2000，並加深背景與模糊度，完美覆蓋所有背景 UI */

#result-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    backdrop-filter: blur(10px);
}

#result-screen.show {
    opacity: 1;
    pointer-events: auto;
}

.result-box {
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.95), rgba(0, 40, 60, 0.95));
    border: 2px solid #0ff;
    box-shadow: 0 0 30px #0ff;
    padding: 40px 60px;
    border-radius: 15px;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#result-screen.show .result-box {
    transform: scale(1);
}

.text-win {
    color: #0f0;
    text-shadow: 0 0 15px #0f0;
    font-size: 42px;
    margin: 0 0 10px 0;
    font-family: "Arial Black", sans-serif;
}

.text-lose {
    color: #f00;
    text-shadow: 0 0 15px #f00;
    font-size: 42px;
    margin: 0 0 10px 0;
    font-family: "Arial Black", sans-serif;
}

#result-message {
    color: #fff;
    font-size: 20px;
    margin-bottom: 30px;
    line-height: 1.6;
    font-weight: bold;
}

#restart-btn {
    background: transparent;
    color: #0ff;
    font-size: 20px;
    font-weight: bold;
    padding: 12px 35px;
    border: 2px solid #0ff;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: "Arial Black", sans-serif;
}

#restart-btn:hover {
    background: #0ff;
    color: #000;
    box-shadow: 0 0 25px #0ff;
    transform: scale(1.05);
}

/* 主畫面按鈕 */

.btn-main-gacha {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 200;
    background: linear-gradient(45deg, #aa00ff, #ff00aa);
    color: white;
    font-size: 18px;
    font-weight: 900;
    font-family: "Arial Black", sans-serif;
    padding: 10px 20px;
    border: 3px solid #fff;
    border-radius: 40px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(170, 0, 255, 0.8);
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.btn-main-gacha:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.btn-main-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.btn-gallery {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 200;
    background: linear-gradient(45deg, #0044ff, #00aeff);
    color: white;
    font-size: 18px;
    font-weight: 900;
    font-family: "Arial Black", sans-serif;
    padding: 10px 20px;
    border: 3px solid #fff;
    border-radius: 40px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.8);
    transition: transform 0.2s, filter 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.btn-gallery:hover {
    transform: scale(1.05);
    filter: brightness(1.15);
    box-shadow: 0 0 30px rgba(0, 255, 255, 1);
}

/* 星際 DJ 廣播控制台 */

#dj-console {
    position: absolute;
    bottom: 25px;
    right: 25px;
    z-index: 2500;
    display: flex;
    gap: 15px;
    background: rgba(0, 20, 40, 0.85);
    padding: 12px 25px;
    border-radius: 40px;
    border: 2px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2), inset 0 0 10px rgba(0, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: auto;
}

.dj-btn {
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0.4;
    filter: grayscale(100%);
    outline: none;
    padding: 0;
    line-height: 1;
}

.dj-btn:hover {
    transform: scale(1.25) translateY(-3px);
    opacity: 0.8;
}

.dj-btn.active {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.15);
}

.dj-btn[data-channel="arcade"].active {
    filter: drop-shadow(0 0 12px #00ffff);
}

.dj-btn[data-channel="rock"].active {
    filter: drop-shadow(0 0 12px #ff3300);
}

.dj-btn[data-channel="shaky"].active {
    filter: drop-shadow(0 0 12px #ffcc00);
}

.dj-btn[data-channel="mute"].active {
    filter: drop-shadow(0 0 12px #ffffff);
}

/* ============================================================
   ✅ 轉蛋模式 UI
   ============================================================ */

#gacha-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#gacha-screen:not(.hidden) {
    pointer-events: auto;
}

@keyframes flashScreen {
    0% {
        background: rgba(255, 255, 255, 1);
    }
    100% {
        background: rgba(0, 0, 0, 0);
    }
}

#gacha-screen.flash {
    animation: flashScreen 0.5s ease-out;
}

.gacha-header {
    display: flex;
    justify-content: flex-start;
    padding: 25px 50px;
}

#btn-leave-gacha {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    border: 2px solid #fff;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: 0.2s;
    font-family: "Arial Black", sans-serif;
}

#btn-leave-gacha:hover {
    background: #fff;
    color: #000;
}

.gacha-footer {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding-bottom: 60px;
}

.btn-roll {
    background: linear-gradient(180deg, #00ffaa, #00aa66);
    color: #000;
    border: 4px solid #fff;
    border-radius: 30px;
    box-sizing: border-box;
    box-shadow: 0 0 30px #00ffaa;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 10px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 340px;
    line-height: 1.2;
    min-height: 120px;
    cursor: pointer;
}

.btn-roll:hover {
    transform: scale(1.05) translateY(-2px);
    filter: brightness(1.15);
    box-shadow: 0 5px 40px #00ffaa;
}

.btn-roll:active {
    transform: scale(0.95);
    filter: brightness(0.9);
    box-shadow: 0 0 15px #00ffaa;
}

.btn-roll:disabled {
    background: linear-gradient(180deg, #555, #222) !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    transform: scale(1) !important;
    filter: none !important;
    opacity: 0.5 !important;
}

.shard-btn-container {
    background: linear-gradient(180deg, #aa00ff, #5500aa);
    color: #fff;
    box-shadow: 0 0 30px #aa00ff;
    border-color: #fff;
    cursor: default;
}

.roll-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.roll-text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.roll-number {
    font-size: 48px;
    font-weight: 900;
    font-family: "Arial Black", sans-serif;
    line-height: 1;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.roll-text {
    font-size: 18px;
    font-weight: bold;
    margin-top: 5px;
}

.gacha-prize-text {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px;
    font-weight: 900;
    color: #fff;
    font-family: "Arial Black", sans-serif;
    text-align: center;
    text-shadow: 0 0 30px #fff, 0 0 10px #fff;
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1500;
}

@keyframes popIn {
    0% {
        transform: translate(-50%, -50px) scale(0.3);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, 0) scale(1);
        opacity: 1;
    }
}

/* ============================================================
   ✅ 圖鑑專屬 UI
   ============================================================ */

#gallery-ui {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999 !important;
    pointer-events: none;
    background: transparent;
    /* 整併確保背景透明 */
}

#gallery-ui>* {
    pointer-events: auto !important;
}

.gallery-header,
.gallery-filters,
#btn-party-mode,
#btn-shuffle-party {
    z-index: 10000 !important;
    position: relative;
    pointer-events: auto !important;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 50px;
    background: linear-gradient(180deg, rgba(0, 20, 40, 0.95), transparent);
}

.gallery-title {
    color: #00ffff;
    font-size: 40px;
    font-family: "Arial Black", sans-serif;
    text-shadow: 0 0 25px rgba(0, 255, 255, 0.8);
    margin: 0;
    letter-spacing: 2px;
}

#btn-leave-gallery {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    border: 2px solid #fff;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: 0.2s;
    font-family: "Arial Black", sans-serif;
}

#btn-leave-gallery:hover {
    background: #fff;
    color: #000;
}

.gallery-filters {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-btn {
    background: rgba(0, 20, 40, 0.8);
    color: #888;
    border: 2px solid #555;
    padding: 15px 35px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
    font-family: "Arial Black", sans-serif;
}

.filter-btn:hover {
    border-color: #0ff;
    color: #fff;
    transform: translateX(-5px);
}

.filter-btn.active {
    background: linear-gradient(90deg, #0055ff, #00aaff);
    color: #fff;
    border-color: #fff;
    box-shadow: 0 0 25px #00aaff;
    transform: translateX(-15px) scale(1.1);
}

.gallery-stats {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 26px;
    color: #fff;
    font-weight: bold;
    font-family: "Arial Black", sans-serif;
    text-shadow: 0 0 15px #ff00aa;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 40px;
    border-radius: 30px;
    border: 2px solid #ff00aa;
    box-shadow: 0 0 25px rgba(255, 0, 170, 0.6);
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 終極質感音樂按鈕 (螢光綠) */

#btn-party-mode {
    position: absolute;
    bottom: 110px;
    left: 30px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000 !important;
    background: rgba(0, 20, 5, 0.85);
    color: rgba(0, 255, 0, 0.4);
    border: 2px solid rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

#btn-party-mode svg {
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 3px currentColor);
}

#btn-party-mode:not(.active):hover {
    background: rgba(0, 40, 10, 0.9);
    color: #00ff00;
    border-color: #00ff00;
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.7), inset 0 0 10px rgba(0, 255, 0, 0.4) !important;
    transform: scale(1.1);
}

#btn-party-mode:not(.active):active {
    transform: scale(0.95) !important;
    transition: all 0.05s !important;
}

#btn-party-mode.active {
    background: rgba(0, 30, 5, 0.9) !important;
    color: #fff !important;
    border-color: #00ff00 !important;
    animation: greenHaloBreathing 2s infinite ease-in-out !important;
}

#btn-party-mode.active svg {
    filter: drop-shadow(0 0 5px #fff) drop-shadow(0 0 15px #00ff00);
}

@keyframes greenHaloBreathing {
    0% {
        box-shadow: 0 0 15px #00ff00, inset 0 0 10px rgba(0, 255, 0, 0.5) !important;
        transform: scale(1.05);
    }
    50% {
        box-shadow: 0 0 35px #00ff00, 0 0 15px #00cc00, inset 0 0 20px #00ff00 !important;
        transform: scale(1.18);
    }
    100% {
        box-shadow: 0 0 15px #00ff00, inset 0 0 10px rgba(0, 255, 0, 0.5) !important;
        transform: scale(1.05);
    }
}

/* 隨機洗牌群魔亂舞按鈕 (螢光粉紫) */

#btn-shuffle-party {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000 !important;
    background: rgba(40, 0, 30, 0.85);
    color: rgba(255, 0, 170, 0.4);
    border: 2px solid rgba(255, 0, 170, 0.2);
    box-shadow: 0 0 10px rgba(255, 0, 170, 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

#btn-shuffle-party svg {
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 3px currentColor);
}

#btn-shuffle-party:not(.active):hover {
    background: rgba(60, 0, 40, 0.9);
    color: #ff00aa;
    border-color: #ff00aa;
    box-shadow: 0 0 25px rgba(255, 0, 170, 0.7), inset 0 0 10px rgba(255, 0, 170, 0.4) !important;
    transform: scale(1.1);
}

#btn-shuffle-party:not(.active):active {
    transform: scale(0.95) !important;
    transition: all 0.05s !important;
}

#btn-shuffle-party.active {
    background: rgba(50, 0, 35, 0.9) !important;
    color: #fff !important;
    border-color: #ff00aa !important;
    animation: pinkHaloBreathing 2s infinite ease-in-out !important;
}

#btn-shuffle-party.active svg {
    filter: drop-shadow(0 0 5px #fff) drop-shadow(0 0 15px #ff00aa);
}

@keyframes pinkHaloBreathing {
    0% {
        box-shadow: 0 0 15px #ff00aa, inset 0 0 10px rgba(255, 0, 170, 0.5) !important;
        transform: scale(1.05);
    }
    50% {
        box-shadow: 0 0 35px #ff00aa, 0 0 15px #cc0088, inset 0 0 20px #ff00aa !important;
        transform: scale(1.18);
    }
    100% {
        box-shadow: 0 0 15px #ff00aa, inset 0 0 10px rgba(255, 0, 170, 0.5) !important;
        transform: scale(1.05);
    }
}

/* ============================================================
   ✅ 每日簽到系統 UI
   ============================================================ */

#daily-login-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    backdrop-filter: blur(10px);
}

#daily-login-screen.show {
    opacity: 1;
    pointer-events: auto;
}

.daily-box {
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.95), rgba(0, 40, 60, 0.95));
    border: 2px solid #0ff;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.4);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 650px;
}

#daily-login-screen.show .daily-box {
    transform: scale(1);
}

.daily-title {
    color: #00ffaa;
    text-shadow: 0 0 20px #00ffaa;
    font-size: 46px;
    margin: 0 0 15px 0;
    font-family: "Arial Black", sans-serif;
    letter-spacing: 2px;
}

#daily-message {
    color: #fff;
    font-size: 22px;
    margin-bottom: 30px;
    font-weight: 900;
    line-height: 1.6;
}

.streak-wrapper {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px 25px 25px 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.streak-tag {
    color: #ffcc00;
    font-size: 16px;
    font-weight: bold;
    font-family: sans-serif;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
    letter-spacing: 1px;
}

.streak-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.streak-day {
    flex: 1;
    aspect-ratio: 1/1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 900;
    font-family: "Arial Black", sans-serif;
    border: 2px solid #444;
    background: #1a1a1a;
    color: #666;
    transition: all 0.3s;
    text-align: center;
    line-height: 1.2;
    box-sizing: border-box;
}

.streak-day.claimed {
    background: rgba(0, 255, 170, 0.2);
    border-color: #00ffaa;
    color: #00ffaa;
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.4);
    font-size: 28px;
}

.streak-day.today {
    background: rgba(0, 255, 255, 0.3);
    border-color: #0ff;
    color: #fff;
    box-shadow: 0 0 20px #0ff, inset 0 0 10px rgba(0, 255, 255, 0.5);
    transform: scale(1.1);
    animation: dailyPulse 1.5s infinite;
}

.streak-day.locked {
    background: #111;
    border-color: #333;
    color: #555;
}

#day7-box.today {
    background: rgba(170, 0, 255, 0.4);
    border-color: #aa00ff;
    color: #fff;
    box-shadow: 0 0 35px #aa00ff, inset 0 0 15px rgba(170, 0, 255, 0.6);
    animation: dailyPulseBonus 1.5s infinite;
    transform: scale(1.15);
}

#btn-claim-daily {
    background: linear-gradient(180deg, #00ffaa, #00aa66);
    color: #002718;
    font-size: 26px;
    font-weight: 900;
    padding: 15px 70px;
    border: 3px solid #fff;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: "Arial Black", sans-serif;
    box-shadow: 0 0 25px #00ffaa;
}

#btn-claim-daily:hover {
    transform: scale(1.1);
    box-shadow: 0 0 40px #00ffaa, inset 0 0 15px rgba(255, 255, 255, 0.5);
}

#btn-claim-daily:active {
    transform: scale(0.95);
}

@keyframes dailyPulse {
    0% {
        box-shadow: 0 0 15px #0ff;
    }
    50% {
        box-shadow: 0 0 30px #0ff;
    }
    100% {
        box-shadow: 0 0 15px #0ff;
    }
}

@keyframes dailyPulseBonus {
    0% {
        box-shadow: 0 0 20px #aa00ff;
    }
    50% {
        box-shadow: 0 0 45px #aa00ff;
    }
    100% {
        box-shadow: 0 0 20px #aa00ff;
    }
}

/* 強化全螢幕按鈕在手機上的點擊範圍 */

#btn-fullscreen-trigger {
    padding: 30px 60px !important;
    position: relative !important;
    z-index: 20000005 !important;
    pointer-events: auto !important;
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid #00ffff;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
    cursor: pointer !important;
}

/* ============================================================
   ✅ 強制旋轉畫面與 RWD (Media Queries 乾淨統整版)
   ============================================================ */

/* 基礎樣式：預設隱藏 */

#rotate-device-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* 🔥 新增 right 和 bottom，強制四邊貼齊 */
    width: 100%;
    height: 100%;
    /* 🔥 捨棄 vw/vh，改用最穩定的 100% */
    background: #000;
    z-index: 20000000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    pointer-events: auto !important;
}

.rotate-icon {
    font-size: 100px;
    margin-bottom: 150px;
    animation: rotatePhone 2s infinite ease-in-out;
}

.rotate-text-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes rotatePhone {
    0% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(-90deg);
    }
    100% {
        transform: rotate(-90deg);
    }
}

/* 橫向全螢幕容器 (預設狀態) */

.landscape-only {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    /* 🔥 一樣捨棄 vw/vh，改用 100% */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* 🔥 新增 right 和 bottom */
}

/* --- RWD 斷點設定 --- */

/* 💻 筆電與平板 (1200px 以下) UI 微調 */

@media screen and (max-width: 1200px) {
    #dj-console {
        transform: scale(0.85);
        transform-origin: bottom right;
        bottom: 15px;
        right: 15px;
    }
    .btn-main-gacha {
        transform: scale(0.85);
        transform-origin: top left;
    }
    .btn-gallery {
        transform: scale(0.85);
        transform-origin: bottom left;
    }
}

/* 📱 裝置旋轉與顯示邏輯 (1024px 以下) */

@media screen and (max-width: 1200px) {
    #rotate-device-screen {
        opacity: 1;
        pointer-events: auto;
    }
}

/* 📱 直向模式 (Portrait) */

@media screen and (orientation: portrait) {
    .portrait-only {
        display: flex !important;
        flex-direction: column;
        align-items: center;
    }
    .landscape-only {
        display: none !important;
    }
}

/* 📱 直向 + 1024px 以下 (顯示旋轉提示，隱藏遊戲開場) */

@media screen and (max-width: 1200px) and (orientation: portrait) {
    #start-screen,
    #start-screen.active-ui {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    #rotate-device-screen {
        display: flex !important;
    }
}

/* 📱 橫向模式 (Landscape) */

@media screen and (orientation: landscape) {
    .portrait-only {
        display: none !important;
    }
    #rotate-device-screen {
        background: rgba(0, 0, 0, 0.95) !important;
        pointer-events: auto !important;
    }
    .landscape-only {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 20000001;
    }
}

/* 📱 橫向 + 1024px 以下 (顯示全螢幕按鈕) */

@media screen and (max-width: 1200px) and (orientation: landscape) {
    #rotate-device-screen:not(.force-hide-overlay) {
        display: flex !important;
    }
}

/* ============================================================
   ✅ 旋轉提示畫面：無差別強制鎖死大小 (暴力對抗 iOS 縮放 Bug)
   ============================================================ */

#rotate-device-screen .rotate-icon {
    font-size: 100px !important;
    margin-bottom: 30px !important;
    /* 🔥 終極置中魔法：給它一個完美的正方形實體空間 */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 130px !important;
    height: 130px !important;
    line-height: 1 !important;
    transform-origin: center center !important;
}

#rotate-device-screen .rotate-icon span {
    font-size: 100px !important;
    line-height: 1 !important;
}

#rotate-device-screen h2 {
    font-size: 32px !important;
    font-weight: 900 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

#rotate-device-screen p {
    font-size: 13px !important;
    margin-top: 15px !important;
    letter-spacing: 2px !important;
    line-height: 1.5 !important;
}

/* ============================================================
   ✅ 靈魂商店按鈕內部文字精緻化 (通用設定，PC 會變小，手機會跟著等比縮小)
   ============================================================ */

/* 調整上面的 SHAKY 等級名稱 (原本是巨大的 26px) */

.soul-shop-btn span:first-child {
    font-size: 22px !important;
}

/* 調整下面的 💎 SOUL SHARDS 標籤 (原本是 18px，外框太胖) */

.soul-shop-btn span:last-child {
    font-size: 14px !important;
    /* 🔥 字體縮小，變得更精緻 */
    padding: 4px 12px !important;
    /* 🔥 上下左右的框框也稍微壓扁 */
}

/* 📱 手機橫向模式 (高度低於 500px) UI 縮小，避免擋住遊戲視線 */

@media screen and (max-height: 500px) {
    /* ========================================= */
    /* ✅ 1. 頂部戰鬥 HUD (極限壓縮！0/50 [時間] 0/100 與血條同寬) */
    /* ========================================= */
    #game-ui {
        flex-direction: column !important;
        /* 恢復上下排列 */
        width: 340px !important;
        /* 🔥 總寬度鎖死，讓文字跟血條一樣寬 */
        justify-content: flex-start;
        align-items: center;
        gap: 0px !important;
        /* 消除大間距 */
        top: 5px;
        /* 緊貼螢幕邊緣 */
        transform: translateX(-50%) scale(0.85);
    }
    /* ⏳ 讓時間變成絕對置中，完美塞在 0/50 和 0/100 中間的空位 */
    .timer-display {
        position: absolute !important;
        top: -4px;
        /* 稍微往上微調對齊分數框 */
        left: 50%;
        transform: translateX(-50%);
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        font-size: 32px !important;
        font-weight: 900 !important;
        /* 🔥 加上這行：極致加粗！ */
        margin: 0 !important;
        padding: 0 !important;
        display: flex;
        align-items: center;
        z-index: 10;
    }
    #time-left {
        font-size: 32px !important;
        font-weight: 900 !important;
        color: #ffcc00 !important;
        text-shadow: 0 0 10px #ffaa00 !important;
        margin-left: 6px;
    }
    /* ❤️ 血條區塊：改為 column-reverse 讓「文字在上、血條在下」 */
    .health-bar-wrapper {
        display: flex;
        flex-direction: column-reverse !important;
        width: 100% !important;
        /* 跟隨 game-ui 的 340px */
        gap: 4px;
        /* 🔥 文字與血條的超小縫隙，極限壓扁 */
        margin-top: 0;
    }
    /* 左右護法：0/50 和 0/100 完美貼齊血條左右邊緣 */
    .health-text {
        position: static !important;
        /* 解除之前的絕對定位 */
        transform: none !important;
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        /* 🔥 魔法：強迫兩個分數貼齊最左與最右 */
        margin: 0 !important;
    }
    .health-text div {
        font-size: 16px !important;
        padding: 2px 10px !important;
        /* 把上下內距壓扁 */
        background: rgba(0, 0, 0, 0.6) !important;
        border-width: 2px !important;
        line-height: 1.2;
        border-radius: 6px;
    }
    /* 血條本體：變得超級細長 */
    .health-bar-container {
        width: 100%;
        height: 14px !important;
        /* 🔥 終極壓扁！厚度只剩 14px */
        border-width: 2px !important;
        border-radius: 8px;
        margin: 0;
    }
    /* ========================================= */
    /* ✅ 2. 轉蛋與圖鑑按鈕恢復原位 (留在左邊) */
    /* ========================================= */
    .btn-main-gacha {
        transform: scale(0.7);
        transform-origin: top left;
        top: 10px !important;
        bottom: auto !important;
        left: 10px;
    }
    .btn-gallery {
        transform: scale(0.7);
        transform-origin: bottom left;
        bottom: 10px;
        left: 10px;
    }
    /* ========================================= */
    /* ✅ 3. 其他按鈕區 (包含你自己調好的 DJ 0.8) */
    /* ========================================= */
    #dj-console {
        transform: scale(0.8);
        transform-origin: bottom right;
        bottom: 10px;
        right: 10px;
        padding: 8px 15px;
        gap: 10px;
    }
    /* 🔥 稍微把上方綠色按鈕往上推 5px (75px) 增加安全距離 */
    #btn-party-mode {
        transform: scale(0.7);
        bottom: 75px;
        left: 10px;
    }
    #btn-shuffle-party {
        transform: scale(0.7);
        bottom: 10px;
        left: 10px;
    }
    /* 🔥 防禦 Hover 瞬間變大的 Bug，強制鎖定在 0.75 */
    #btn-party-mode:not(.active):hover {
        transform: scale(0.75) !important;
    }
    #btn-shuffle-party:not(.active):hover {
        transform: scale(0.75) !important;
    }
    /* 🔥 套用手機版專屬的微縮呼吸動畫 */
    #btn-party-mode.active {
        animation: mobileGreenHalo 2s infinite ease-in-out !important;
    }
    #btn-shuffle-party.active {
        animation: mobilePinkHalo 2s infinite ease-in-out !important;
    }
    /* ========================================= */
    /* ✅ 4. 每日簽到 & 迎新大禮包 */
    /* ========================================= */
    .daily-box {
        transform: scale(0.8) !important;
        width: 70% !important;
        /* 🔥 從 85% 改小，讓左右不要那麼長 */
        max-width: 340px !important;
        /* 🔥 最大寬度從 400px 壓到 340px */
        max-height: 85vh !important;
        padding: 15px 0px !important;
        border-radius: 15px !important;
        overflow-y: auto !important;
    }
    #daily-login-screen.show .daily-box {
        transform: scale(1) !important;
    }
    /* 針對原本的簽到標題與文字 */
    .daily-title {
        font-size: 18px !important;
        margin-bottom: 5px !important;
    }
    #daily-message {
        font-size: 14px !important;
        margin-bottom: 10px !important;
        line-height: 1.2 !important;
    }
    /* 🔥 針對 JS 動態產生的「迎新禮包」超大字體與圖示進行強制微縮 */
    .daily-title span {
        font-size: 16px !important;
    }
    /* 縮小 NEW PLAYER GIFT 標題 */
    #daily-message img {
        width: 50px !important;
        margin-bottom: 5px !important;
    }
    /* 縮小 GACHA TOKEN 圖片 */
    #daily-message div {
        font-size: 45px !important;
        margin-top: 0px !important;
        margin-bottom: 5px !important;
    }
    /* 縮小 💎 巨大 Emoji */
    #daily-message span {
        font-size: 18px !important;
        letter-spacing: 0px !important;
    }
    /* 縮小 10 GACHA TOKENS 文字 */
    /* 原本的簽到天數格子微縮 */
    .streak-wrapper {
        padding: 10px;
        margin-bottom: 10px;
    }
    .streak-tag {
        font-size: 10px;
        margin-bottom: 5px;
    }
    .streak-container {
        gap: 5px;
    }
    .streak-day {
        font-size: 10px;
        border-width: 1px;
        padding: 4px;
        border-radius: 6px;
    }
    .streak-day.claimed {
        font-size: 16px;
    }
    #day7-box.today {
        transform: scale(1.1);
    }
    /* 縮小 CLAIM / START MISSION 按鈕 */
    #btn-claim-daily {
        padding: 6px 30px !important;
        font-size: 14px !important;
        border-width: 2px !important;
    }
    /* ========================================= */
    /* ✅ 5. 結算畫面 */
    /* ========================================= */
    .result-box {
        transform: scale(0.7) !important;
        width: 50%;
        max-width: 300px;
        max-height: 60vh;
        padding: 30px 10px;
        border-radius: 12px;
        overflow-y: auto;
    }
    #result-screen.show .result-box {
        transform: scale(1) !important;
    }
    .text-win,
    .text-lose {
        font-size: 22px !important;
        margin-bottom: 5px !important;
    }
    #result-message {
        font-size: 12px !important;
        margin-bottom: 12px !important;
    }
    #restart-btn {
        font-size: 14px !important;
        padding: 6px 25px !important;
        border-width: 2px !important;
    }
    /* ========================================= */
    /* ✅ 6. 轉蛋畫面 (Gacha Screen) 經典方形按鈕 0.7 倍微縮 */
    /* ========================================= */
    /* 縮小頂部返回按鈕，並緊貼左上角 */
    .gacha-header {
        padding: 10px 15px !important;
    }
    #btn-leave-gacha {
        transform: scale(0.7);
        transform-origin: top left;
        padding: 6px 20px !important;
    }
    /* 🔥 換成你要的 0.45 倍，保留霸氣方形與 50px 底部留白 */
    #gacha-screen .gacha-footer {
        transform: scale(0.45) !important;
        transform-origin: bottom center !important;
        padding-bottom: 50px !important;
        gap: 30px !important;
    }
    /* 抽中卡片時彈出的文字，避免字太大擋住卡片 */
    .gacha-prize-text {
        font-size: 16px !important;
        top: 10% !important;
    }
    /* ========================================= */
    /* ✅ 7. 靈魂碎片商店 (JS 動態生成) 手機版微縮 */
    /* ========================================= */
    /* 縮小頂部標題與底部間距 */
    #soul-shop-title {
        font-size: 24px !important;
        margin-bottom: 20px !important;
    }
    /* 🔥 終極魔法：把裝著 3 顆巨無霸按鈕的容器，整體縮小並拉近間距 */
    #soul-shop-buttons {
        transform: scale(0.6) !important;
        /* 0.5倍縮放，完美塞進螢幕 */
        gap: 30px !important;
        /* 讓 3 顆按鈕靠緊一點 */
    }
    /* 縮小最底部的返回按鈕，並拉近與上面的距離 */
    #btn-close-shop {
        margin-top: 20px !important;
        padding: 8px 30px !important;
        font-size: 16px !important;
    }
    /* ========================================= */
    /* ✅ 8. 抽中卡片的 OK 按鈕微調 (往下推 + 微縮) */
    /* ========================================= */
    #btn-ok-gacha {
        bottom: 15px !important;
        left: 50% !important;
        /* 🔥 加上這行：確保起點在畫面正中央 */
        transform: translateX(-50%) scale(0.7) !important;
        /* 🔥 往回拉 50% 達成完美水平置中，並縮小 */
        padding: 6px 60px !important;
    }
    /* ========================================= */
    /* ✅ 9. 圖鑑畫面 (Gallery) 0.8 全包覆上提置中版 */
    /* ========================================= */
    /* 1. 左上角「返回」按鈕 */
    .gallery-header {
        padding: 10px 15px !important;
    }
    #btn-leave-gallery {
        transform: scale(0.7) !important;
        transform-origin: top left !important;
        padding: 6px 20px !important;
        margin: 0 !important;
    }
    /* 2. 強力鎮壓底部 COLLECTION 8/71 進度條 */
    div.gallery-stats {
        transform: translateX(-50%) scale(0.6) !important;
        transform-origin: bottom center !important;
        bottom: 23px !important;
        padding: 8px 30px !important;
        margin: 0 !important;
    }
    /* 3. 分類按鈕統一大小 */
    .gallery-filters {
        right: 15px !important;
        gap: 8px !important;
    }
    .filter-btn {
        width: 100px !important;
        text-align: center !important;
        padding: 6px 0 !important;
        font-size: 11px !important;
        border-radius: 8px !important;
    }
    /* 4. 垂直置中基礎設定 */
    #shaky-html-gallery {
        align-items: center !important;
        padding-top: 0 !important;
    }
    /* 標題文字 */
    #shaky-html-gallery h1,
    #shaky-html-gallery h2 {
        font-size: 14px !important;
        margin-bottom: 6px !important;
        line-height: 1 !important;
    }
    #gallery-grid-track {
        grid-template-columns: repeat(5, 1fr) !important;
        grid-template-rows: repeat(3, 1fr) !important;
        gap: 6px !important;
        transform: none !important;
        width: 100% !important;
    }
    /* ========================================= */
    /* 🔥 5. 終極魔法：控制「箭頭+圖鑑」的最大外框 */
    /* ========================================= */
    #shaky-html-gallery>div {
        transform: scale(0.8) !important;
        /* 🔥 1. 整體一起縮放你抓好的 0.8 倍 */
        margin-top: -30px !important;
        /* 🔥 2. 把整個區塊往上垂直拉升 (覺得不夠高可改 -40px) */
        gap: 0px !important;
        /* 🔥 3. 消除原本 JS 的間距，讓左右箭頭極度靠近圖鑑！ */
    }
    /* 中間圖鑑本體容器 */
    #shaky-html-gallery>div>div:nth-child(2) {
        width: 100% !important;
        max-width: 500px !important;
        transform: none !important;
        /* 清除舊的獨立縮放，交給上面的外框處理 */
    }
    .gallery-item {
        padding: 4px !important;
        border-radius: 8px !important;
    }
    /* 6. 左右翻頁箭頭 */
    #gallery-prev-btn,
    #gallery-next-btn {
        font-size: 50px !important;
        /* 稍微放大一點點補償 0.8 的縮放 */
        padding: 0 10px !important;
        /* 讓它緊緊貼在卡片旁邊 */
    }
    /* ============================================================
   ✅ 旋轉提示畫面：全黑背景 + 活體呼吸 (螢光藍) + 突發故障 (螢光綠)
   ============================================================ */
    /* 1. 確保旋轉畫面的背景是絕對純黑，完全遮擋後方 LOGO，營造深邃感 */
    #rotate-device-screen {
        background: #000000 !important;
    }
    /* 2. ENTER 按鈕：恢復有機呼吸感，並在最高潮時爆發綠色雜訊 */
    /* 強化全螢幕按鈕在手機上的點擊範圍與視覺張力 */
    #btn-fullscreen-trigger {
        padding: 30px 60px !important;
        position: relative !important;
        z-index: 20000005 !important;
        pointer-events: auto !important;
        background: rgba(0, 255, 255, 0.1);
        border: 2px solid #00ffff;
        cursor: pointer !important;
        font-size: 28px !important;
        letter-spacing: 16px !important;
        /* 👇 就是這行！用首行縮排抵銷右邊多出來的字距 👇 */
        text-indent: 16px !important;
        animation: livingSystemGlitch 4s infinite linear !important;
    }
    @keyframes livingSystemGlitch {
        /* 0% ~ 80% (前 3.2 秒)：像活著一樣平滑地放大縮小呼吸 (螢光藍) */
        0% {
            transform: scale(0.98);
            color: #00ffff;
            border-color: #00ffff;
            text-shadow: 0 0 10px #00ffff;
            box-shadow: 0 0 15px rgba(0, 255, 255, 0.4), inset 0 0 10px rgba(0, 255, 255, 0.2);
        }
        40% {
            transform: scale(1.06);
            color: #00ffff;
            border-color: #00ffff;
            text-shadow: 0 0 20px #00ffff;
            box-shadow: 0 0 30px rgba(0, 255, 255, 0.8), inset 0 0 20px rgba(0, 255, 255, 0.5);
        }
        80% {
            transform: scale(0.98);
            color: #00ffff;
            border-color: #00ffff;
            text-shadow: 0 0 10px #00ffff;
            box-shadow: 0 0 15px rgba(0, 255, 255, 0.4), inset 0 0 10px rgba(0, 255, 255, 0.2);
        }
        /* 82% ~ 88% (約 0.25 秒)：呼吸到一半突然抽搐！螢光綠 (Neon Green) 暴力錯位 */
        82% {
            transform: scale(1.02) skew(-5deg);
            color: #00ffaa;
            border-color: #00ffaa;
            text-shadow: -3px 0 0 #00ffaa, 3px 0 0 #00ffff;
            box-shadow: -4px 0 15px rgba(0, 255, 170, 0.8), 4px 0 15px rgba(0, 255, 255, 0.8);
        }
        84% {
            transform: scale(0.98) skew(5deg);
            color: #00ffff;
            border-color: #00ffff;
            text-shadow: 3px 0 0 #00ffaa, -3px 0 0 #00ffff;
            box-shadow: 5px 0 15px rgba(0, 255, 170, 0.8), -5px 0 15px rgba(0, 255, 255, 0.8);
        }
        86% {
            transform: scale(1.04) skew(-2deg);
            color: #00ffaa;
            border-color: #00ffaa;
            text-shadow: -2px 0 0 #00ffaa, 2px 0 0 #00ffff;
            box-shadow: -2px 0 20px rgba(0, 255, 170, 0.9), 2px 0 20px rgba(0, 255, 255, 0.9);
        }
        88% {
            transform: scale(1.0);
            color: #00ffff;
            border-color: #00ffff;
            text-shadow: 0 0 15px #00ffff;
            box-shadow: 0 0 20px rgba(0, 255, 255, 0.6), inset 0 0 15px rgba(0, 255, 255, 0.3);
        }
        /* 88% ~ 100%：回歸平靜呼吸 */
        100% {
            transform: scale(0.98);
            color: #00ffff;
            border-color: #00ffff;
            text-shadow: 0 0 10px #00ffff;
            box-shadow: 0 0 15px rgba(0, 255, 255, 0.4), inset 0 0 10px rgba(0, 255, 255, 0.2);
        }
    }
    /* 3. 背景的 Glitch 雜訊層：純螢光藍掃描線，與按鈕同步偶發螢光綠閃爍 */
    .glitch-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        /* 基底是乾淨的螢光藍掃描線 */
        background: repeating-linear-gradient(0deg, rgba(0, 255, 255, 0.05) 0px, rgba(0, 255, 255, 0.05) 1px, transparent 1px, transparent 2px);
        z-index: 1;
        pointer-events: none;
        /* 加入第二個動畫，維持 4 秒循環與按鈕同步 */
        animation: glitchScan 4s infinite linear, greenNoiseFlicker 4s infinite linear;
        mix-blend-mode: screen;
    }
    @keyframes glitchScan {
        0% {
            background-position: 0 0;
        }
        100% {
            background-position: 0 100vh;
        }
    }
    @keyframes greenNoiseFlicker {
        /* 大部分時間維持螢光藍 */
        0%,
        80%,
        88%,
        100% {
            filter: hue-rotate(0deg) brightness(1);
            opacity: 0.6;
        }
        /* 在 82%~86% 之間瞬間色偏成螢光綠並閃爍亮度 */
        82% {
            filter: hue-rotate(-40deg) brightness(1.5);
            opacity: 0.9;
        }
        84% {
            opacity: 0.3;
        }
        86% {
            filter: hue-rotate(-40deg) brightness(1.8);
            opacity: 1;
        }
    }
    /* ============================================================
   ✅ 手機版專屬呼吸動畫 (鎖定在 0.7 比例，防止穿模)
   ============================================================ */
    @keyframes mobileGreenHalo {
        0% {
            box-shadow: 0 0 15px #00ff00, inset 0 0 10px rgba(0, 255, 0, 0.5) !important;
            transform: scale(0.7);
        }
        50% {
            box-shadow: 0 0 35px #00ff00, 0 0 15px #00cc00, inset 0 0 20px #00ff00 !important;
            transform: scale(0.78);
        }
        /* 最高潮只放大到 0.78 */
        100% {
            box-shadow: 0 0 15px #00ff00, inset 0 0 10px rgba(0, 255, 0, 0.5) !important;
            transform: scale(0.7);
        }
    }
    @keyframes mobilePinkHalo {
        0% {
            box-shadow: 0 0 15px #ff00aa, inset 0 0 10px rgba(255, 0, 170, 0.5) !important;
            transform: scale(0.7);
        }
        50% {
            box-shadow: 0 0 35px #ff00aa, 0 0 15px #cc0088, inset 0 0 20px #ff00aa !important;
            transform: scale(0.78);
        }
        /* 最高潮只放大到 0.78 */
        100% {
            box-shadow: 0 0 15px #ff00aa, inset 0 0 10px rgba(255, 0, 170, 0.5) !important;
            transform: scale(0.7);
        }
    }
    /* ✨ 轉蛋與圖鑑開啟時，全面沒收任何可能出現的 not-allowed 錯誤 */
    #gacha-screen,
    #gallery-ui,
    #soul-shop-modal {
        cursor: default !important;
    }
    /* 確保所有按鈕滑過去絕對是完美的手指 */
    .dj-btn,
    .btn-roll,
    .soul-shop-btn,
    #btn-ok-gacha,
    #restart-btn,
    #btn-claim-daily {
        cursor: pointer !important;
    }
    /* ============================================================
   🎯 終極游標狀態覆蓋：切換 UI 視窗時洗掉 3D 抓取手勢
   ============================================================ */
    /* 1. 當結算、轉蛋、簽到、保底商店遮罩浮現時，非按鈕空白區域強制恢復「標準箭頭」 */
    #result-screen,
    #gacha-screen,
    #daily-login-screen,
    #soul-shop-modal {
        cursor: default !important;
    }
    /* 2. 強制鎖死這些 UI 視窗內的所有互動按鈕，滑過去絕對是完美無瑕的「點擊手指」 */
    #restart-btn,
    #btn-leave-gacha,
    .btn-roll,
    #btn-ok-gacha,
    #btn-claim-daily,
    .soul-shop-btn,
    #btn-close-shop {
        cursor: pointer !important;
    }
}

/* 結束括號 */