
*{box-sizing:border-box;margin:0;padding:0}

/* 全局優化 - 減少安卓設備閃爍 */
html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body,html{
width:100%;
height:100%;
overflow:hidden;
background:#2f0a3e;
font-family:-apple-system,sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-transform: translateZ(0);
transform: translateZ(0)
}

body.scrollable {
    overflow-y: auto;
}

.stage{
width:100%;
height:100vh;
position:relative;
overflow:hidden;
perspective: 800px;
background:url('../image/bg2.webp') no-repeat center top/cover
}

/* ============================= */
/* 背景循環動畫 */
/* ============================= */

.dynamic-background{
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
z-index:0;
transition:opacity 2s ease;
-webkit-transform: translateZ(0);
transform: translateZ(0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden
}

.slide{
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
opacity:0;
background:no-repeat center top/cover;
background-size:cover;

animation-duration:32s;
animation-iteration-count:infinite;
animation-timing-function:linear;

-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-perspective: 1000px
}

.slide:nth-child(1){background-image:url('../image/000.webp');animation-name:anim-1}
.slide:nth-child(2){background-image:url('../image/001.webp');animation-name:anim-2}
.slide:nth-child(3){background-image:url('../image/002.webp');animation-name:anim-3}
.slide:nth-child(4){background-image:url('../image/003.webp');animation-name:anim-4}
.slide:nth-child(5){background-image:url('../image/004.webp');animation-name:anim-5}
.slide:nth-child(6){background-image:url('../image/003.webp');animation-name:anim-6}
.slide:nth-child(7){background-image:url('../image/002.webp');animation-name:anim-7}
.slide:nth-child(8){background-image:url('../image/001.webp');animation-name:anim-8}

@keyframes anim-1{0%,7%{opacity:1}12.5%,93%{opacity:0}100%{opacity:1}}
@keyframes anim-2{0%,5.5%{opacity:0}12.5%,19.5%{opacity:1}25%,100%{opacity:0}}
@keyframes anim-3{0%,18%{opacity:0}25%,32%{opacity:1}37.5%,100%{opacity:0}}
@keyframes anim-4{0%,30.5%{opacity:0}37.5%,44.5%{opacity:1}50%,100%{opacity:0}}
@keyframes anim-5{0%,43%{opacity:0}50%,57%{opacity:1}62.5%,100%{opacity:0}}
@keyframes anim-6{0%,55.5%{opacity:0}62.5%,69.5%{opacity:1}75%,100%{opacity:0}}
@keyframes anim-7{0%,68%{opacity:0}75%,82%{opacity:1}87.5%,100%{opacity:0}}
@keyframes anim-8{0%,80.5%{opacity:0}87.5%,94.5%{opacity:1}100%{opacity:0}}
/* ============================= */
/* UI Overlay */
/* ============================= */

.ui-overlay{
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
z-index:10
}

/* ============================= */
/* STEP1 UI */
/* ============================= */

#step1-ui{
width:100%;
height:100%;
display:flex;
flex-direction:column;
justify-content:flex-end;
align-items:center;
padding-bottom:15vh;
transition:opacity 1.5s ease
}

.button-composite{
width:75vw;
max-width:300px;
display:flex;
flex-direction:column;
align-items:center;
gap:10px; /* 減少間距，使zi.webp往上提 */
position: relative;
}

.button-composite>img:first-child{
width:80%;
height:auto
}

.image-button-wrapper{
width:100%;
cursor:pointer;
position:relative;
overflow:hidden;
border-radius:50px;
animation:pulseScale 3s infinite ease-in-out
}

.image-button-wrapper::after{
content:"";
position:absolute;
top:0;
left:-150%;
width:100%;
height:100%;
background:linear-gradient(90deg,transparent,rgba(255,255,255,0.4),transparent);
transform:skewX(-25deg);
animation:sweep 3s infinite ease-in-out
}

/* 三個按鍵的等邊三角形佈局 */
.buttons-container {
    width: 100%;
    margin-top: 10px;
    position: relative;
    height: 180px; /* 增加容器高度，使btn1離上面更遠 */
}

.image-button {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: absolute;
    width: 40%; /* 確保三個按鈕大小相同 */
}

/* 等邊三角形佈局 */
#btn1 {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

#btn2 {
    top: 10%;
    left: 15%;
    transform: translateX(-50%);
}

#btn3 {
    top: 10%;
    right: 15%;
    transform: translateX(50%);
}

.image-button:hover {
    transform: translate(-50%, -2px); /* 保持水平居中，只改變垂直位置 */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.image-button:active {
    transform: translate(-50%, 0); /* 保持水平居中，恢復垂直位置 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 爲btn3單獨調整懸停效果，因爲它的transform是translateX(50%) */
#btn3:hover {
    transform: translate(50%, -2px);
}

#btn3:active {
    transform: translate(50%, 0);
}

.image-button img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================= */
/* STEP2 UI */
/* ============================= */

#step2-ui{
display:none;
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
opacity:0;
transition:opacity 1.5s ease
}

.smoke-text-container{
position:absolute;
top:25%;
left:50%;
transform:translate(-50%,-50%);
width:85%;
display:flex;
flex-direction:column;
align-items:center;
gap:12px;
z-index:20
}

/* 響應式調整：當屏幕高度小於600px時，文字容器上移 */
@media (max-height: 600px) {
    .smoke-text-container {
        top: 25%;
    }
}

/* 當屏幕高度小於500px時，文字容器進一步上移 */
@media (max-height: 500px) {
    .smoke-text-container {
        top: 20%;
    }
}

.smoke-line{
color:#ffffff;
font-size:1.2rem;
font-weight:bold;
letter-spacing:.15rem;
text-align:center;
text-shadow:0 0 10px rgba(191,149,255,.6);
opacity:0;
transform:translateY(10px);
transition:all 2.5s ease;
white-space:nowrap
}

body.en-lang .smoke-line {
    font-size: 1rem;
    letter-spacing: .05rem;
}

.line-active{
opacity:1;
transform:translateY(0)
}

.evolution-image{
position:absolute;
bottom:0;
left:50%;
transform:translateX(-50%);
width:100vw;
max-width:500px;
opacity:0;
transition:opacity 1s ease
}

.shimmer-btn{
position:absolute;
top:50%;
left:50%;
transform:translate(-50%,-50%) scale(.85);
padding:10px 45px;
min-width:240px;
font-size:.95rem;
font-weight:600;
color:#2f0a3e;
background:rgba(255,255,255,.95);
border:1px solid white;
border-radius:40px;
box-shadow:0 4px 15px rgba(255,255,255,.4);
cursor:pointer;
opacity:0;
visibility:hidden;
transition:all 1.2s ease;
z-index:150
}

.shimmer-btn.show{
opacity:1;
visibility:visible;
transform:translate(-50%,-50%) scale(1);
animation:softGlow 3s infinite alternate ease-in-out
}

/* ============================= */
/* STEP3 UI */
/* ============================= */

#step3-ui{
display:none;
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
opacity:0;
transition:opacity 2s ease
}

.universe-bg{
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
z-index:5;
overflow:hidden;
pointer-events:none
}

.nebula{
position:absolute;
width:200%;
height:200%;
top:-50%;
left:-50%;
background:radial-gradient(circle at 50% 50%, rgba(191,149,255,.15) 0%, transparent 60%);
filter:blur(60px);
animation:nebulaRotate 80s infinite linear
}

.stars{
position:absolute;
width:100%;
height:100%;
top:0;
left:0
}

.stars::before{
content:"";
position:absolute;
top:-150%;
left:-150%;
width:400%;
height:400%;
background-image:
radial-gradient(1px 1px at 10% 10%, #fff, transparent),
radial-gradient(1px 1px at 25% 45%, #fff, transparent),
radial-gradient(1px 1px at 55% 20%, rgba(255,255,255,.7), transparent);
background-size:70px 70px;
opacity:.8;
animation:nebulaRotate 150s infinite linear
}

.stars::after { 
content: ""; 
position: absolute; 
top: -150%; 
left: -150%; 
width: 400%; 
height: 400%; 
background-image: 
radial-gradient(1.8px 1.8px at 20% 30%, #fff, transparent), 
radial-gradient(2px 2px at 50% 50%, #fff, transparent), radial-gradient(1.5px 1.5px at 80% 20%, #fff, transparent), radial-gradient(1.8px 1.8px at 30% 80%, rgba(220, 200, 255, 0.8), transparent); background-size: 180px 180px; opacity: 0.6; animation: starPulse 15s infinite ease-in-out, nebulaRotate 100s infinite linear reverse; }

.stars-top { 
position: absolute; 
top: -150%; 
left: -150%; 
width: 400%; 
height: 400%; 
background-image: radial-gradient(2.5px 2.5px at 15% 25%, #fff, transparent), 
radial-gradient(2.5px 2.5px at 75% 65%, 
#fff, transparent), 
radial-gradient(3px 3px at 45% 85%,
 rgba(255, 255, 255, 0.8),
 transparent); background-size: 300px 300px; 
 animation: nebulaRotate 60s infinite linear; opacity: 0.4; }


@keyframes nebulaRotate{
0%{transform:rotate(0deg)}
100%{transform:rotate(360deg)}
}

 @keyframes starPulse { 
 0%, 100% { opacity: 0.9; transform: scale(1); } 50% { opacity: 0.7; transform: scale(1.05); } }

.card-container { 
position: absolute; 
top: 55%; 
left: 50%;
 transform: 
 translate(-50%, -50%); 
 width: 60px; 
 display: flex; 
 flex-direction: column; 
 align-items: center;
 opacity: 0; 
 transition: opacity 2s ease; 
 z-index: 30; }
        
.timer-svg-wrapper { 
position: absolute; 
top: 50%; left: 50%; 
transform: translate(-50%, -50%) rotate(-90deg);
 width: 360px; height: 360px; 
 pointer-events: none; z-index: 31; 
 opacity: 0; transition: opacity 2s ease; }
       
.timer-circle-bg { 
fill: none; 
stroke: rgba(255, 255, 255, 0.05); 
stroke-width: 2; }
        
.timer-circle-bar { 
fill: none; 
stroke: rgba(191, 149, 255, 0.6); 
stroke-width: 2; 
stroke-linecap: round; 
stroke-dasharray: 283; 
stroke-dashoffset: 283; 
filter: drop-shadow(0 0 5px rgba(191, 149, 255, 0.5)); }
        
.timer-run { 
animation: timerAnimate 10s linear forwards; }
        
@keyframes timerAnimate { to { stroke-dashoffset: 0; } }

.tarot-card { 
width: 100%;
height: auto; 
display: block; 
z-index: 32; 
animation: floatCard 4s infinite ease-in-out; }

.card-shadow { 
width: 40px; 
height: 8px; 
background: rgba(0, 0, 0, 1); 
border-radius: 50%; 
margin-top: 10px; 
filter: blur(4px); 
animation: shadowScale 4s infinite ease-in-out; }

@keyframes floatCard { 
0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
        
@keyframes shadowScale { 
0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(0.7); opacity: 0.4; } }

.fog-exit { 
animation: fogDissolve 2.5s forwards ease-out !important; }

@keyframes fogDissolve { 
0% { transform: translate(-50%, -50%) scale(1); 
opacity: 1; filter: blur(0px); 
} 100% { transform: translate(-50%, -50%) scale(2); 
opacity: 0; filter: blur(20px); } }


/* 【優化1】：添加 will-change 開啓卡牌和星星的硬件加速 */

.scatter-card {
touch-action: manipulation;
pointer-events: auto;
position: absolute;
width: 65px; 
height: auto;
z-index: 100;
pointer-events: none;
transition: all 4.5s cubic-bezier(0.2, 0, 0.2, 1), opacity 1.5s ease;
opacity: 0;
display: block;
transform-origin: 50% 30%;
transform-style: preserve-3d;
will-change: transform; 
}

.scatter-card::after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 50%, rgba(255,255,255,0.05) 100%);
box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
border-radius: 3px;
pointer-events: none;
z-index: -1;
}

.scatter-card.shuffling {
	transition: transform 0.4s cubic-bezier(0.1, 0.8, 0.3, 1), 
				left 0.4s cubic-bezier(0.1, 0.8, 0.3, 1), 
				top 0.4s cubic-bezier(0.1, 0.8, 0.3, 1) !important;
}

.no-float { 
animation: none !important; }

.no-shadow { 
display: none !important; 
opacity: 0 !important; }

.p1-dissolve { 
opacity: 0 !important; 
pointer-events: none; }

@keyframes sweep{
0%{left:-150%}
30%{left:150%}
100%{left:150%}
}

@keyframes pulseScale{
0%,100%{transform:scale(1)}
50%{transform:scale(1.04)}
}

@keyframes softGlow{
0%{box-shadow:0 4px 15px rgba(255,255,255,.4)}
100%{box-shadow:0 4px 20px rgba(255,255,255,.6)}
}

.shuffle-progress-container {
	position: absolute;
	left: 50%;
	bottom: 65%;
	transform: translateX(-50%);
	width: 60%;
	height: 4px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	overflow: hidden;
	backdrop-filter: blur(5px);
	border: 1px solid rgba(255, 255, 255, 0.05);
	opacity: 0;
	transition: opacity 1s ease, transform 1s ease;
	z-index: 200;
}

.progress-fade-out {
	opacity: 0 !important;
	transform: translateX(-50%) translateY(20px) !important;
	filter: blur(8px);
	pointer-events: none;
}

#shuffle-progress-bar {
	width: 0%;
	height: 100%;
	background: linear-gradient(90deg, rgba(191, 149, 255, 0.2), rgba(191, 149, 255, 0.8));
	box-shadow: 0 0 10px rgba(191, 149, 255, 0.5);
	transition: width 0.3s ease-out;
}

.fog-disperse {
	opacity: 0 !important;
	transform: translateY(-50px) scale(1.2) !important;
	filter: blur(10px);
	transition: all 1.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.card-stack-glow {
	animation: glowFadeIn 2.5s forwards ease-out !important;
}
@keyframes glowFadeIn {
	from { box-shadow: 0 0 0px rgba(191, 149, 255, 0); }
	to { box-shadow: 0 0 30px rgba(191, 149, 255, 0.4); }
}

.is-selected {
	box-shadow: 0 0 20px rgba(191, 149, 255, 0.6);
}

.magic-circle-container {
	position: absolute;
	top: 85%; 
	left: 50%;
	transform: translate(-50%, -50%) scale(1.2); 
	width: 600px; 
	height: 600px;
	pointer-events: none;
	z-index: 5;
	opacity: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	transition: opacity 3s ease;
}

.magic-layer {
	position: absolute;
	width: 100%;
	height: 100%;
	background-repeat: no-repeat;
	background-position: center;
	background-size: auto; 
	mix-blend-mode: screen;
	will-change: transform;
}
.layer-inner { background-image: url('../image/q1.webp'); z-index: 8; }
.layer-mid { background-image: url('../image/q2.webp'); animation: rotateCW 65s linear infinite; z-index: 7; }
.layer-outer { background-image: url('../image/q3.webp'); animation: rotateCCW 95s linear infinite; transform: scale(1.2); z-index: 6; }

@keyframes rotateCW { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes rotateCCW { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }

.select-tips-pos { position: absolute; width: 100%; text-align: center; z-index: 200; pointer-events: none; white-space: pre-line; }
.select-tips-pos.line-active { animation: smokeIn 1.2s ease-out forwards; }

#galaxy-bg{
	position:absolute;
	top:0;
	left:0;
	width:100%;
	height:100%;
	z-index:2;
	pointer-events:none;
}


#galaxy-dust{
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
z-index:3;
pointer-events:none;
}

#energy-core{
position:absolute;
left:50%;
top:50%;
width:260px;
height:260px;
transform:translate(-50%,-50%);
border-radius:50%;
background:radial-gradient(circle,
rgba(255,255,255,0.9) 0%,
rgba(255,230,180,0.7) 20%,
rgba(255,200,120,0.4) 40%,
rgba(255,180,80,0.15) 60%,
rgba(255,160,60,0.05) 70%,
transparent 80%);
filter:blur(2px);
z-index:4;
animation:corePulse 6s ease-in-out infinite;
pointer-events:none;
}

@keyframes corePulse{
0%,100%{transform:translate(-50%,-50%) scale(1);opacity:.9}
50%{transform:translate(-50%,-50%) scale(1.15);opacity:1}
}

@keyframes candleFlicker {
0%, 100% { filter: brightness(1) sepia(0.1); }
5% { filter: brightness(1.08) sepia(0.15); }
10% { filter: brightness(0.95) sepia(0.1); }
18% { filter: brightness(1.05) sepia(0.12); }
25% { filter: brightness(0.92) sepia(0.1); }
32% { filter: brightness(1.1) sepia(0.14); }
40% { filter: brightness(0.98) sepia(0.1); }
48% { filter: brightness(1.06) sepia(0.13); }
55% { filter: brightness(0.94) sepia(0.1); }
62% { filter: brightness(1.08) sepia(0.15); }
70% { filter: brightness(0.96) sepia(0.1); }
78% { filter: brightness(1.04) sepia(0.12); }
85% { filter: brightness(0.9) sepia(0.1); }
92% { filter: brightness(1.07) sepia(0.14); }
}

.candle-flicker {
    
animation: candleFlicker 11s ease-in-out infinite;
}

#star-sphere{
position:absolute;
left:50%;
top:50%;
width:320px;
height:320px;
transform:translate(-50%,-50%);
z-index:4;
pointer-events:none;
}

.focused-card-glow {
    position: absolute;
    /* 寬和高將由 JS 根據卡牌的真實尺寸動態設定 */
    border: 3px solid rgba(255, 215, 0, 0.9); /* 金色邊框 */
    border-radius: 6px; /* 小圓角，與卡牌邊緣匹配 */
    box-shadow: 
        0 0 5px 2px rgba(255, 215, 0, 0.3), /* 內部金色光 */
        0 0 2px 1px rgba(255, 165, 0, 0.2); /* 外部琥珀色散光 */
    will-change: opacity, transform;
    pointer-events: none;
    z-index: 5001; /* 確保在卡牌之上，魔法陣之下 */
    opacity: 0;
    transition: opacity 1.5s ease;
    /* 金色脈衝動畫 */
    animation: rectGlowPulse 3s infinite ease-in-out;
}

@keyframes rectGlowPulse {
    0%, 100% {
        filter: brightness(1) sepia(0.2); /* 增加一點暖色調 */
        opacity: 0.8;
    }
    50% {
        filter: brightness(1.4) sepia(0.4); /* 變亮並深化金色 */
        opacity: 1;
    }
}


/* 【優化15】：強制GPU渲染所有動畫元素 */
.scatter-card {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0); /* 強制GPU層 */
}

/* 【優化16】：減少不必要的樣式計算 */
.scatter-card.shuffling {
    transition: transform 0.4s cubic-bezier(0.1, 0.8, 0.3, 1), 
                opacity 0.4s ease !important;
}

/* 【優化19】：簡化魔法陣動畫 */
.magic-layer {
    will-change: transform;
    backface-visibility: hidden;
}

/* 頂部右側按鈕容器 */
.top-right-buttons {
    position: absolute;
    top: 2%;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 100;
}

/* 菜單按鈕 */
.menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 22px 0 0 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    position: relative;
    box-sizing: border-box;
    border-right: none;
}

.menu-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.menu-button span {
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    width: 100%;
}

.menu-button svg {
    vertical-align: middle;
    display: block;
    flex-shrink: 0;
}

/* 語言按鈕展開狀態 */
#lang-menu-btn.expanded {
    width: auto;
}

#lang-menu-btn.expanded .dropdown-menu {
    right: auto;
    left: 0;
}

#lang-menu-btn .lang-label {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
    opacity: 0;
    margin-left: 0;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
}

#lang-menu-btn.expanded .lang-label {
    max-width: 150px;
    opacity: 1;
    margin-left: 10px;
    position: relative;
    left: auto;
    top: auto;
    transform: none;
}

/* 下拉菜單 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    margin-top: 5px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px 0 0 10px;
    min-width: 120px;
    width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: scaleY(0);
    transition: all 0.3s ease;
    z-index: 200;
    transform-origin: top center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: scaleY(1);
}

.dropdown-item {
    padding: 10px 15px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 歷史記錄面板 */
.history-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    transition: right 0.3s ease;
    z-index: 200;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.history-panel.show {
    right: 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.history-header span {
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.history-header .close-btn {
    font-size: 20px;
    cursor: pointer;
    color: white;
}

.history-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-history {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 50px 0;
}

/* Footer */
.footer {
    width: 100%;
    padding: 50px 20px 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.footer-content {
    max-width: 500px;
    margin: 0 auto;
}

.footer-section {
    margin-bottom: 35px;
}

.footer-section:last-of-type {
    margin-bottom: 20px;
}

.footer-section h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 12px;
}

.social-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.social-links a:hover {
    color: #fff;
    opacity: 1;
    transform: translateY(-2px);
}

.about-info {
    font-size: 13px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.55);
}

.about-info a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.about-info a:hover {
    color: #fff;
}

.legal-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.legal-divider {
    display: none;
}

.legal-links a {
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.legal-links a:hover {
    color: rgba(255, 255, 255, 0.9);
}

.footer-divider {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    margin: 30px auto;
}

.copyright {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 1px;
    margin-top: 25px;
}

/* ============================= */
/* 協議彈窗樣式 */
/* ============================= */

.terms-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    overflow-y: auto;
}

.terms-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.terms-modal {
    background: linear-gradient(135deg, rgba(47, 10, 62, 0.95) 0%, rgba(20, 5, 40, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.terms-modal-overlay.show .terms-modal {
    transform: scale(1) translateY(0);
}

.terms-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terms-modal-header h2 {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

.terms-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.terms-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.terms-modal-content {
    padding: 25px;
    overflow-y: auto;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.8;
    flex: 1;
}

.terms-modal-content::-webkit-scrollbar {
    width: 6px;
}

.terms-modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.terms-modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.terms-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.terms-modal-content h3 {
    color: #fff;
    font-size: 16px;
    margin: 20px 0 10px 0;
    font-weight: 500;
}

.terms-modal-content h3:first-child {
    margin-top: 0;
}

.terms-modal-content p {
    margin-bottom: 12px;
}

.terms-modal-content .terms-section {
    margin-bottom: 15px;
}

.terms-modal-content .terms-section-title {
    color: #fff;
    font-weight: 500;
    margin-bottom: 8px;
}
