/* =========================================================================
   靈承錄 · 驚蟄堂 - 全局樣式表 (style.css)
   字體設定：完全復刻 v0.39 微軟繁隸書
   版塊佈局：PC 端強制 2x2 網格 (16:9 媒體比例)
   ========================================================================= */

/* 0. 盒模型保護 (防止邊框擠爆網格) */
*, *::before, *::after {
    box-sizing: border-box;
}

/* 1. 字體聲明 (復刻 v0.39) */
@font-face {
    font-family: "CyberLisu";
    src: url("../assets/fonts/MSLisu.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 2. 全局變量 (字體定義採用 v0.39 設定) */
:root {
    --doll-width: 480px;
    --doll-height: 620px;
    --shoe-width: 300px;
    
    --bg-deep: #0f0518;
    --card-bg: rgba(30, 20, 40, 0.7); 
    --accent-gold: #ffd700;   
    --accent-purple: #b026ff; 
    --accent-red: #ff3333;    
    --text-main: #e0e0e0;
    --text-dim: #b0a0c0;
    --dragon-blue: #3deaf0;
    --glowing-green: #7fff9e;
    --ancient-copper: #c8a773;
    --ghost-silver: #c8c8d0;
    --crimson-shadow: #6d2020;

    /* 字體變量完全回歸 v0.39 */
    --font-lisu: "CyberLisu", "LiSu", "SimLi", serif;
    --font-kaiti: "Kaiti SC", "KaiTi", "STKaiti", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--accent-purple); border-radius: 3px; }

/* 3. 全局 Body 默認字體 (v0.39 全局隸書風格) */
body {
    background-color: var(--bg-deep);
    background: radial-gradient(circle at 50% 50%, #2a1a4a 0%, #0f0518 100%);
    color: var(--text-main);
    font-family: var(--font-lisu);
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto; 
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.version-tag {
    position: fixed;
    top: 40px;
    right: 10px;
    z-index: 1000;
    background: rgba(20, 10, 30, 0.85);
    border: 1px solid var(--dragon-blue);
    color: var(--dragon-blue);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-family: monospace;
    box-shadow: 0 0 10px rgba(61, 234, 240, 0.3);
    pointer-events: none;
}

.bgm-toggle-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: rgba(30, 15, 45, 0.9);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    font-family: var(--font-sans);
}
.bgm-toggle-btn:hover {
    transform: scale(1.05);
    background: var(--accent-gold);
    color: #000;
}

body::before {
    content: ""; position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 20% 30%, rgba(176, 38, 255, 0.15), transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(255, 215, 0, 0.08), transparent 40%);
    animation: mistMove 20s infinite alternate; z-index: -1; pointer-events: none;
}
@keyframes mistMove {
    0% { transform: rotate(0deg) translate(0,0); }
    100% { transform: rotate(5deg) translate(-20px, -20px); }
}

#particles-js { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; }
.container { max-width: 1440px; margin: 0 auto; padding: 0 2rem; position: relative; z-index: 10; width: 100%; }

header { text-align: center; padding: 2.5rem 0 1.5rem; margin-bottom: 2rem; position: relative; }
.brand-banner { display: block; margin: 0 auto 10px; max-width: 400px; width: 80%; height: auto; filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.3)); animation: floatBanner 6s ease-in-out infinite; }
@keyframes floatBanner { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.brand-intro-box {
    max-width: 900px;
    margin: 15px auto 0;
    padding: 20px 25px;
    background: rgba(25, 15, 38, 0.7);
    border: 1px solid rgba(200, 167, 115, 0.4);
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(176, 38, 255, 0.15);
    text-align: justify;
    color: var(--ghost-silver);
    font-size: 0.95rem;
    line-height: 1.7;
    font-family: var(--font-kaiti);
    position: relative;
}
.brand-intro-box p {
    margin: 0 0 10px 0;
    text-indent: 2em;
}
.brand-intro-box p:last-child {
    margin-bottom: 0;
}

.culture-grid { 
    display: grid; 
    grid-template-columns: repeat(5, 1fr); 
    gap: 20px; 
    margin-bottom: 4rem; 
    font-family: var(--font-kaiti); 
}
.info-card { 
    background: rgba(30, 20, 40, 0.7); 
    border: 1px solid rgba(200, 167, 115, 0.3); 
    border-radius: 8px; text-align: center; 
    transition: all 0.5s ease; position: relative; overflow: hidden; 
    box-shadow: 0 5px 20px rgba(13, 25, 32, 0.8); padding: 0; 
}

.info-card::before { 
    content: ''; position: absolute; top: 0; left: -100%; right: 0; height: 3px; 
    width: 200%;
    background: linear-gradient(90deg, transparent, var(--glowing-green), var(--dragon-blue), var(--accent-purple), transparent); 
    opacity: 0.6; animation: borderFlow 4s linear infinite; z-index: 2; 
}
@keyframes borderFlow { 0% { transform: translateX(0); } 100% { transform: translateX(50%); } }

.info-card:hover, .info-card.active-glow { 
    transform: translateY(-8px) scale(1.02); 
    border-color: var(--ancient-copper); 
    box-shadow: 0 12px 30px rgba(61, 234, 240, 0.25), 0 0 25px rgba(127, 255, 158, 0.15); 
}
.info-card:hover::before, .info-card.active-glow::before { opacity: 1; height: 4px; }
.info-card:hover .card-image, .info-card.active-glow .card-image { transform: scale(1.1); filter: grayscale(0%) contrast(105%) sepia(0%); }

.card-image-container { width: 100%; height: 180px; overflow: hidden; position: relative; border-bottom: 1px solid rgba(200, 167, 115, 0.1); background: rgba(0,0,0,0.3); }
.card-image { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease-out, filter 0.5s ease-out; filter: grayscale(40%) contrast(110%) sepia(20%); }
.card-content { padding: 1.2rem; position: relative; z-index: 1; background: linear-gradient(to bottom, rgba(20, 10, 30, 0.9), rgba(25, 15, 35, 1)); }
.card-title { color: var(--ancient-copper); font-size: 1.1rem; font-weight: bold; margin-bottom: 8px; display: block; letter-spacing: 1px; font-family: var(--font-lisu); }
.card-desc { font-size: 0.85rem; color: var(--ghost-silver); opacity: 0.8; line-height: 1.5; text-align: justify; }

.ritual-section { margin-bottom: 6rem; position: relative; }
.section-header { text-align: center; font-size: 2.6rem; color: var(--accent-purple); margin-bottom: 30px; display: flex; align-items: center; justify-content: center; gap: 20px; text-shadow: 0 0 10px rgba(176, 38, 255, 0.5); font-family: var(--font-lisu); }
.section-header::before, .section-header::after { content: ""; display: block; width: 100px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent-purple), transparent); }

.ritual-interface { display: flex; width: 100%; height: 800px; border: 2px solid var(--accent-purple); border-radius: 8px; box-shadow: 0 0 50px rgba(15, 5, 24, 0.9), inset 0 0 20px rgba(176, 38, 255, 0.2); background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(10px); position: relative; overflow: hidden; }

.game-column { 
    flex: 1; width: 100%; 
    background: url('../assets/images/bg_altar.webp') no-repeat center center;
    background-size: cover;
    display: flex; flex-direction: column; align-items: center; padding: 20px; position: relative; cursor: crosshair; 
    transition: background 0.8s ease-in-out;
}

.game-column.active-hitting-bg {
    background: radial-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.7)), url('../assets/images/bg_hitting.webp') no-repeat center center;
    background-size: cover;
}

.game-column.active-tiger-bg {
    background: radial-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.6)), url('../assets/images/bg_tiger.webp') no-repeat center center;
    background-size: cover;
}

.game-column.active-poe-bg {
    background: radial-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.6)), url('../assets/images/bg_poe.webp') no-repeat center 85%;
    background-size: cover;
}

.game-column.active-huabao-bg {
    background: radial-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.3)), url('../assets/images/bg_huabao.webp') no-repeat center top;
    background-size: contain;
}

.wizard-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 5, 20, 0.55); z-index: 60;
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: none;
}
.wizard-card {
    background: rgba(25, 15, 35, 0.95);
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2), inset 0 0 15px rgba(176, 38, 255, 0.3);
    border-radius: 12px; padding: 35px 40px; width: 90%; max-width: 650px;
    text-align: center; color: var(--ghost-silver);
    animation: modalPop 0.3s ease-out;
    box-sizing: border-box;
}
@keyframes modalPop { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.wizard-title { font-size: 2rem; color: var(--ancient-copper); margin-bottom: 25px; letter-spacing: 2px; font-family: var(--font-lisu); font-weight: bold; }

.wizard-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 25px; }
.wizard-btn {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(200, 167, 115, 0.3);
    padding: 20px 10px; border-radius: 12px; cursor: pointer; transition: all 0.3s;
    color: var(--ghost-silver); font-size: 1.1rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-family: var(--font-lisu);
}
.wizard-btn:hover { background: rgba(61, 234, 240, 0.15); border-color: var(--dragon-blue); color: #fff; transform: translateY(-4px); }

.striker-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}
.striker-card-btn {
    background: rgba(20, 10, 30, 0.7);
    border: 1px solid rgba(200, 167, 115, 0.4);
    border-radius: 10px;
    padding: 18px 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}
.striker-card-btn:hover {
    border-color: var(--dragon-blue);
    background: rgba(61, 234, 240, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(61, 234, 240, 0.2);
}
.striker-name {
    font-size: 1.4rem;
    color: var(--accent-gold);
    font-weight: bold;
    font-family: var(--font-lisu);
}
.striker-desc {
    font-size: 0.95rem;
    color: var(--ghost-silver);
    margin-top: 8px;
    line-height: 1.4;
    font-family: var(--font-kaiti);
}

.gender-icon-wrapper {
    width: 95px; height: 95px;
    border-radius: 50%;
    border: 2px solid var(--dragon-blue);
    background: rgba(0, 0, 0, 0.5);
    display: flex; justify-content: center; align-items: center;
    margin-bottom: 12px;
    box-shadow: 0 0 15px rgba(61, 234, 240, 0.4), inset 0 0 10px rgba(61, 234, 240, 0.3);
    transition: all 0.3s;
    animation: iconPulse 3s infinite alternate;
    overflow: hidden;
}
@keyframes iconPulse {
    0% { box-shadow: 0 0 10px rgba(61, 234, 240, 0.3); }
    100% { box-shadow: 0 0 22px rgba(176, 38, 255, 0.6); border-color: var(--accent-purple); }
}

.gender-icon-img {
    width: 100%; height: 100%; 
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

.baijie-talisman-container {
    width: 100%;
    max-width: 420px;
    height: 260px;
    margin: 0 auto 20px;
    background: url('../assets/images/baijie_fu.webp') no-repeat center center;
    background-size: contain;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.3));
}

.transparent-input {
    width: 85%;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(200, 167, 115, 0.5);
    border-radius: 4px;
    color: #fff;
    text-align: center;
    font-size: 1.2rem;
    outline: none;
    font-family: var(--font-lisu);
    margin-bottom: 12px;
    backdrop-filter: blur(2px);
}
.transparent-input::placeholder { color: rgba(220, 220, 220, 0.6); }
.transparent-input:focus { border-color: var(--accent-gold); box-shadow: 0 0 8px var(--accent-gold); }

.wizard-action-btn {
    padding: 12px 35px; background: linear-gradient(90deg, var(--accent-purple), var(--accent-red));
    border: 1px solid var(--accent-gold); color: #fff; font-size: 1.2rem; font-weight: bold;
    border-radius: 30px; cursor: pointer; box-shadow: 0 0 15px var(--accent-purple); transition: 0.3s; margin: 5px; 
    font-family: var(--font-lisu);
    position: relative; z-index: 99999; pointer-events: auto; touch-action: auto;
}
.wizard-action-btn:hover { transform: scale(1.05); }
.wizard-action-btn.secondary { background: rgba(0,0,0,0.5); border-color: var(--ghost-silver); color: var(--ghost-silver); box-shadow: none; }

.tiger-stage-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 8, 25, 0.45); z-index: 100;
    display: none; flex-direction: column; justify-content: center; align-items: center;
    animation: fadeIn 0.4s;
}

.tiger-container {
    position: relative; width: 420px; height: 420px;
    margin-bottom: 15px;
}

.tiger-img {
    width: 100%; height: 100%; object-fit: contain;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.85));
    transition: transform 0.15s ease-out;
}

.tiger-head-shake {
    animation: headShake 2s ease-in-out forwards;
}
@keyframes headShake {
    0% { transform: rotate(0deg) scale(1.1); }
    20% { transform: rotate(-10deg) scale(1.15); }
    40% { transform: rotate(10deg) scale(1.15); }
    60% { transform: rotate(-6deg) scale(1.08); }
    80% { transform: rotate(4deg) scale(1.03); }
    100% { transform: rotate(0deg) scale(1); }
}

.pork-item {
    width: 220px; height: 220px;
    object-fit: contain;
    cursor: grab;
    filter: drop-shadow(0 10px 22px rgba(0,0,0,0.85));
    transition: transform 0.15s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.15s ease-out;
    position: relative; z-index: 120;
    touch-action: none;
}
.pork-item:active { 
    cursor: grabbing;
    transform: scale(1.1); 
}

.tiger-hint-title {
    font-size: 2.4rem; color: var(--accent-gold);
    margin-bottom: 5px; text-shadow: 0 0 15px var(--accent-gold);
    font-family: var(--font-lisu);
}
.tiger-hint-sub {
    font-size: 1.2rem; color: var(--ghost-silver); margin-bottom: 15px;
    font-family: var(--font-sans);
}

.pork-progress-text {
    color: var(--dragon-blue);
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 15px;
    background: rgba(0,0,0,0.6);
    padding: 4px 18px;
    border-radius: 20px;
    border: 1px solid var(--dragon-blue);
    box-shadow: 0 0 10px rgba(61, 234, 240, 0.3);
    font-family: var(--font-sans);
}

.rice-particle {
    position: absolute;
    pointer-events: none;
    z-index: 45;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255,255,255,0.6);
}

.huabao-stage-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 5, 20, 0.15); z-index: 55;
    display: none; justify-content: space-between; align-items: center;
    padding: 40px; box-sizing: border-box;
    animation: fadeIn 0.4s;
}

.huabao-incense-pot-area {
    position: absolute;
    top: 75%; left: 50%;
    transform: translate(-50%, -50%);
    width: 200px; height: 150px;
    pointer-events: none;
    display: flex; justify-content: center; align-items: flex-end;
}

.real-flame-img {
    width: 180px; height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 -10px 20px #ff4500);
    display: none;
}

.huabao-side-dock {
    display: flex; flex-direction: column; gap: 30px;
    background: rgba(20, 10, 30, 0.88); border: 2px solid var(--ancient-copper);
    padding: 20px 15px; border-radius: 25px;
    box-shadow: 0 0 25px rgba(200, 167, 115, 0.4);
    z-index: 60;
}
.huabao-side-dock.dock-left { position: absolute; left: 30px; top: 50%; transform: translateY(-50%); }
.huabao-side-dock.dock-right { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); }

.huabao-item-wrapper {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}

.huabao-paper-btn {
    width: 85px; height: 85px;
    object-fit: contain; cursor: pointer;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.8));
    transition: transform 0.3s ease, filter 0.3s ease;
}
.huabao-paper-btn.btn-tiger {
    width: 110px; height: 110px;
}
.huabao-paper-btn:hover {
    transform: scale(1.18);
    filter: drop-shadow(0 10px 20px var(--accent-gold));
}

.huabao-item-label {
    font-size: 0.95rem; color: var(--accent-gold); font-family: var(--font-lisu);
}

.poe-stage-frame {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 40; display: none; flex-direction: column; align-items: center; justify-content: space-between;
    padding: 30px; box-sizing: border-box; perspective: 1000px;
}

.poe-drop-zone {
    flex-grow: 1; width: 100%; position: relative;
    display: flex; justify-content: center; align-items: center; gap: 60px;
    transform-style: preserve-3d;
}

.poe-altar-mat {
    position: absolute;
    width: 520px; height: 320px;
    background: radial-gradient(ellipse at center, rgba(252, 250, 242, 0.22) 0%, rgba(200, 167, 115, 0.1) 50%, transparent 75%);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
    transform: rotateX(30deg);
}

.poe-block-wrapper {
    width: 140px; height: 180px;
    position: relative; transform-style: preserve-3d;
    filter: drop-shadow(8px 18px 12px rgba(0,0,0,0.85));
    transition: transform 5.5s cubic-bezier(0.1, 0.85, 0.25, 1);
    z-index: 20;
}

.poe-img {
    width: 100%; height: 100%; object-fit: contain;
    backface-visibility: hidden;
}

.poe-status-banner {
    background: rgba(0, 0, 0, 0.75); border: 2px solid var(--accent-gold);
    border-radius: 30px; padding: 10px 30px; color: #fff; text-align: center;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); z-index: 50; margin-bottom: 10px;
}
.poe-status-title { font-size: 1.8rem; color: var(--accent-gold); font-family: var(--font-lisu); font-weight: bold; }
.poe-status-desc { font-size: 1.1rem; color: var(--ghost-silver); margin-top: 4px; font-family: var(--font-sans); }

.poe-giant-banner {
    position: absolute;
    top: 42%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 100;
    padding: 22px 55px;
    border-radius: 50px;
    font-size: 3.2rem;
    font-weight: bold;
    font-family: var(--font-lisu);
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}
.poe-giant-banner.banner-show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}
.poe-giant-banner.banner-yin {
    background: rgba(109, 32, 32, 0.95);
    border: 3px solid var(--accent-red);
    color: #ff8888;
    box-shadow: 0 0 50px var(--accent-red);
}
.poe-giant-banner.banner-xiao {
    background: rgba(30, 20, 50, 0.95);
    border: 3px solid var(--dragon-blue);
    color: var(--dragon-blue);
    box-shadow: 0 0 50px var(--dragon-blue);
}
.poe-giant-banner.banner-sheng {
    background: rgba(50, 40, 10, 0.95);
    border: 3px solid var(--accent-gold);
    color: var(--accent-gold);
    box-shadow: 0 0 60px var(--accent-gold);
}

.center-pop-hint {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(1);
    z-index: 50;
    background: rgba(20, 10, 30, 0.92);
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    padding: 20px 40px;
    border-radius: 40px;
    color: var(--accent-gold);
    font-size: 1.5rem;
    font-family: var(--font-lisu);
    font-weight: bold;
    text-align: center;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.center-pop-hint.fade-out {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.game-stage-frame { flex-grow: 1; width: 100%; position: relative; display: flex; justify-content: center; align-items: center; padding: 40px; box-sizing: border-box; perspective: 800px; }

.hud-text-left { position: absolute; top: 15px; left: 15px; z-index: 10; font-family: var(--font-sans); font-size: 1.1rem; font-weight: bold; color: var(--glowing-green); text-shadow: 0 0 5px var(--glowing-green); }
.hud-text-right { position: absolute; top: 15px; right: 15px; z-index: 10; text-align: right; font-family: var(--font-sans); color: var(--glowing-green); max-width: 45%; }
.combo-num { color: var(--accent-red); font-weight: bold; font-size: 1.5rem; font-family: var(--font-sans); }
.sub-hint-text { color: var(--text-dim); font-size: 0.8rem; font-family: var(--font-sans); margin-top: 2px; display: block; white-space: nowrap; }

.villain-wrapper { 
    position: relative; width: var(--doll-width); height: var(--doll-height); 
    transition: transform 0.05s; z-index: 5; max-width: 100%; max-height: 90%; 
    display: flex; flex-direction: column; align-items: center;
    transform: rotateX(12deg) rotateZ(-2deg);
    filter: drop-shadow(10px 15px 12px rgba(0,0,0,0.85));
}
.idle-float { animation: idleFloat 2.5s ease-in-out infinite; }
@keyframes idleFloat { 0%, 100% { transform: rotateX(12deg) rotateZ(-2deg) translateY(0); } 50% { transform: rotateX(12deg) rotateZ(-2deg) translateY(-6px); } }

.villain-name-tag {
    width: 80%;
    text-align: center;
    font-size: 2.2rem;
    font-weight: bold;
    color: #3a2212;
    background: rgba(200, 167, 115, 0.9);
    border: 2px solid #2a1508;
    border-radius: 6px;
    padding: 4px 10px;
    margin-bottom: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.8);
    letter-spacing: 4px;
    font-family: var(--font-lisu);
    display: none;
}

.villain-img { width: 100%; height: 100%; object-fit: contain; transform: scale(0.95); mix-blend-mode: normal; }
/* 【直接将这行完全删除或注释掉】 */
/* .blend-multiply { mix-blend-mode: multiply; } */

.face-overlay { 
    position: absolute; 
    top: 18%; 
    left: 15%; 
    width: 26%; 
    aspect-ratio: 1/1; 
    border-radius: 50%; 
    object-fit: cover; 
    display: none; 
    mix-blend-mode: normal; 
    opacity: 0.9; 
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 10px rgba(0,0,0,0.8);
}

.weapon-wrapper { 
    position: absolute; 
    bottom: 25%; 
    right: -380px; 
    pointer-events: none; 
    z-index: 20; 
    transform-origin: bottom right; 
}

.weapon-wrapper.shoe-slipper { width: 400px; }
.weapon-wrapper.shoe-heels { width: 360px; }
.weapon-wrapper.shoe-cloth { width: 360px; }

.weapon-img { width: 100%; filter: drop-shadow(8px 8px 15px #000); }

.hit-anim { animation: strike 0.1s ease-out forwards; }
@keyframes strike { 0% { right: 5%; bottom: 40%; transform: rotate(45deg) scale(1.1); opacity: 1; } 50% { right: 25%; bottom: 35%; transform: rotate(0deg) scale(1); } 100% { right: 45%; bottom: 25%; transform: rotate(-45deg) scale(0.9); opacity: 0; } }

.shake-anim { animation: shake 0.2s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake { 
    0% { transform: rotateX(12deg) rotateZ(-2deg) translate(0, 0); } 
    20% { transform: rotateX(12deg) rotateZ(-2deg) translate(-15px, 15px); filter: brightness(2) sepia(1) hue-rotate(-50deg) saturate(5) drop-shadow(10px 15px 12px rgba(0,0,0,0.85)); }
    40% { transform: rotateX(12deg) rotateZ(-2deg) translate(15px, -15px); }
    60% { transform: rotateX(12deg) rotateZ(-2deg) translate(-10px, 10px); }
    80% { transform: rotateX(12deg) rotateZ(-2deg) translate(5px, -5px); }
    100% { transform: rotateX(12deg) rotateZ(-2deg) translate(0, 0); } 
}

.crit-text { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) scale(0); font-size: 5.5rem; color: var(--accent-red); font-weight: 900; text-shadow: 0 0 25px var(--accent-red); opacity: 0; z-index: 35; pointer-events: none; }
.crit-anim { animation: popText 0.6s ease-out; }
@keyframes popText { 0% { transform: translate(-50%, -50%) scale(0); opacity: 0; } 50% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(2); opacity: 0; } }

.tear-particle { position: absolute; width: 6px; height: 10px; background: #00BFFF; border-radius: 50%; opacity: 0.8; pointer-events: none; z-index: 25; box-shadow: 0 0 5px #00BFFF; }

.victory-overlay { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(13, 25, 32, 0.95); z-index: 99999; 
    display: none; flex-direction: column; justify-content: center; align-items: center; 
    padding: 20px; color: var(--ancient-copper); animation: fadeIn 0.2s; box-sizing: border-box;
    pointer-events: auto; touch-action: auto;
}
.victory-title { font-size: 3rem; color: var(--accent-red); margin-bottom: 20px; text-shadow: 0 0 20px var(--accent-red); font-family: var(--font-lisu); font-weight: bold; }
.victory-dialog { background: rgba(0,0,0,0.8); border: 2px solid var(--accent-gold); padding: 30px; border-radius: 8px; max-width: 600px; text-align: center; font-size: 1.3rem; line-height: 1.6; color: var(--ghost-silver); box-shadow: 0 0 30px rgba(255, 215, 0, 0.2); font-family: var(--font-sans); }
.restart-btn { margin-top: 20px; padding: 10px 30px; background: var(--accent-purple); color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 1.1rem; font-family: var(--font-lisu); z-index: 100000; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.particle { position: absolute; background: var(--dragon-blue); width: 8px; height: 8px; border-radius: 50%; pointer-events: none; z-index: 40; box-shadow: 0 0 10px var(--dragon-blue); }

.danmu-layer { position: absolute; top: 20px; left: 0; width: 100%; height: 260px; pointer-events: none; z-index: 25; overflow: hidden; }
.danmu-item { 
    position: absolute; white-space: nowrap; font-size: 2rem; font-weight: bold; 
    color: var(--accent-gold); text-shadow: 2px 2px 4px #000, 0 0 10px var(--accent-red); opacity: 0; 
    animation: flyLeft 6s linear forwards; font-family: var(--font-lisu);
}
@keyframes flyLeft { 0% { transform: translateX(100%); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateX(-100%); opacity: 0; } }

#init-icon-wrapper { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 30; display: flex; flex-direction: column; align-items: center; }
.magic-circle { width: 120px; height: 120px; border: 2px solid var(--accent-gold); border-radius: 50%; margin: 0 auto 20px; box-shadow: 0 0 20px var(--accent-purple), inset 0 0 20px var(--accent-purple); animation: spin 10s linear infinite; display: flex; justify-content: center; align-items: center; font-size: 3.5rem; color: var(--accent-gold); background: rgba(0,0,0,0.5); }
@keyframes spin { 100% { transform: rotate(360deg); } }

.loader-container { width: 200px; height: 10px; background: #333; border-radius: 5px; overflow: hidden; margin: 20px auto 0; display: none; }
.loader-bar { width: 0%; height: 100%; background: var(--glowing-green); transition: width 1s ease-out; }

/* =========================================================================
   驚蟄堂 2.0 商業生態矩陣樣式 (無縫滑軌輪播 + 視頻降級 + 局部隔離)
   ========================================================================= */

.business-matrix-section { 
    margin-bottom: 6rem; 
    position: relative; 
    z-index: 20; 
    width: 100%;
}

.matrix-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 24px 2%; /* 留出 2% 左右餘量，確保一行精準排 2 個卡片 */
    margin-top: 2rem;
    width: 100%;
}

.matrix-card { 
    box-sizing: border-box !important;
    width: 49% !important; /* 強制 2x2 並排 */
    background: rgba(30, 15, 40, 0.6); 
    border: 1px solid rgba(200, 167, 115, 0.3); 
    border-radius: 12px; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease; 
}

.matrix-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 15px 30px rgba(0,0,0,0.6), 0 0 20px rgba(176,38,255,0.3); 
    border-color: var(--ancient-copper); 
}

.matrix-card.highlight-card { 
    border-color: rgba(61, 234, 240, 0.5); 
    background: linear-gradient(180deg, rgba(20, 30, 50, 0.8) 0%, rgba(10, 10, 20, 0.9) 100%); 
}

.matrix-media { 
    box-sizing: border-box !important;
    width: 100%; 
    aspect-ratio: 16 / 9 !important; /* 強制 16:9 比例 */
    height: auto; 
    background: #0b0510;
    position: relative; 
    border-bottom: 2px solid var(--accent-purple); 
    overflow: hidden;
}

/* 視頻與降級海報適配 */
.video-container video { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    outline: none; 
    background: url('../assets/images/video_poster.webp') no-repeat center center / cover; /* 視頻未加載時的底圖降級 */
}

/* ---------------- 動態自適應無縫滑軌 ---------------- */
/* ---------------- 橫向平滑滑軌動畫 (完全保留原版邏輯) ---------------- */
.slider-container { 
    position: relative; 
    overflow: hidden; 
    width: 100%;
    height: 100%;
}

.slider-track {
    display: flex;
    height: 100%;
}

.slider-track img {
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}

/* 2 張圖片輪播 (新增：放 2 張圖時專用，絕不黑屏) */
.slider-track.count-2 {
    width: 200%;
    animation: slideTrack2 6s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}
.slider-track.count-2 img { width: 50%; }

@keyframes slideTrack2 {
    0%, 40% { transform: translateX(0%); }
    50%, 90% { transform: translateX(-50%); }
    100% { transform: translateX(0%); }
}

/* 3 張圖片無縫輪播 (版塊 3 & 4 - 完全原樣) */
.slider-track.count-3 {
    width: 300%;
    animation: slideTrack3 9s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}
.slider-track.count-3 img { width: 33.333%; }

@keyframes slideTrack3 {
    0%, 28% { transform: translateX(0%); }
    33%, 61% { transform: translateX(-33.333%); }
    66%, 94% { transform: translateX(-66.666%); }
    100% { transform: translateX(0%); }
}

/* 4 張圖片無縫輪播 (版塊 1 - 完全原樣) */
.slider-track.count-4 {
    width: 400%;
    animation: slideTrack4 12s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}
.slider-track.count-4 img { width: 25%; }

@keyframes slideTrack4 {
    0%, 20% { transform: translateX(0%); }
    25%, 45% { transform: translateX(-25%); }
    50%, 70% { transform: translateX(-50%); }
    75%, 95% { transform: translateX(-75%); }
    100% { transform: translateX(0%); }
}

/* 內容與按鈕排版 */
.matrix-content { 
    box-sizing: border-box !important;
    padding: 1.5rem; 
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
}

.matrix-content h3 { 
    margin: 0 0 12px 0; 
    color: var(--dragon-blue); 
    font-size: 1.4rem; 
    font-family: var(--font-lisu); 
}

.highlight-card .matrix-content h3 { 
    color: var(--glowing-green); 
}

.matrix-content p { 
    color: var(--ghost-silver); 
    font-size: 0.9rem; 
    line-height: 1.6; 
    margin-bottom: 20px; 
    flex-grow: 1; 
    text-align: justify; 
    font-family: var(--font-sans); 
}

.matrix-btn { 
    box-sizing: border-box !important;
    display: block; 
    text-align: center; 
    padding: 10px 0; 
    border: 1px solid var(--ancient-copper); 
    color: var(--ancient-copper); 
    text-decoration: none; 
    border-radius: 6px; 
    font-weight: bold; 
    transition: all 0.3s ease; 
    font-family: var(--font-lisu); 
}

.matrix-btn:hover { 
    background: var(--ancient-copper); 
    color: #000; 
    box-shadow: 0 0 15px rgba(200, 167, 115, 0.4); 
}

.matrix-btn.highlight { 
    background: rgba(176, 38, 255, 0.2); 
    border-color: var(--dragon-blue); 
    color: var(--dragon-blue); 
}

.matrix-btn.highlight:hover { 
    background: var(--dragon-blue); 
    color: #000; 
    box-shadow: 0 0 15px rgba(61, 234, 240, 0.6); 
}
/* ================= 全局五色米粒子爆散動畫 (PC/移動端通用) ================= */
.rice-particle {
    position: absolute !important;
    display: block !important;
    z-index: 999999 !important;
    pointer-events: none !important;
    will-change: transform, opacity;
    animation: riceBurstGlobal 0.5s cubic-bezier(0.15, 0.85, 0.35, 1.2) forwards !important;
}

@keyframes riceBurstGlobal {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx, 0px), var(--dy, 50px)) rotate(360deg) scale(0.4);
    }
}