@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
    --cyber-pink: #FF1493;
    --cyber-pink-glow: rgba(255, 20, 147, 0.5);
    --sakura-light: #FFB6C1;
    --digital-white: #F8F9FA;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.4);
    --text-main: #2D3436;
    --text-muted: #636E72;
    --font-jp: 'Noto Sans JP', 'PingFang HK', 'PingFang SC', 'Microsoft YaHei', 'SimHei', sans-serif;
    --font-en: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; cursor: none !important; }

body {
    font-family: var(--font-jp);
    color: var(--text-main);
    background: linear-gradient(135deg, #e0eafc, #cfdef3, var(--sakura-light), #e0eafc);
    background-size: 300% 300%;
    animation: gradientMove 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

@keyframes gradientMove { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

#app-container {
    width: 100vw;
    max-width: 480px; 
    min-height: 100vh;
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.hidden { display: none !important; }

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 25px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

.glass-panel-top {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 15px;
    border-radius: 0 0 16px 16px;
    margin: -20px -20px 20px -20px;
}

.glass-panel-bottom {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: 15px;
    border-radius: 16px 16px 0 0;
    margin: 20px -20px -20px -20px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

h1 { font-size: 28px; font-weight: 800; line-height: 1.3; margin-bottom: 15px; }
.highlight { color: var(--cyber-pink); text-shadow: 0 0 10px var(--cyber-pink-glow); }
.subtitle { font-family: var(--font-en); font-size: 14px; font-weight: 600; color: var(--cyber-pink); letter-spacing: 2px; }
.description { font-size: 15px; line-height: 1.6; color: var(--text-muted); margin-bottom: 30px; }

.cyber-btn {
    width: 100%; padding: 15px; border: none; border-radius: 12px; background: var(--cyber-pink);
    color: white; font-size: 16px; font-weight: 700; letter-spacing: 1px;
    box-shadow: 0 4px 15px var(--cyber-pink-glow); transition: all 0.3s ease;
}
.cyber-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px var(--cyber-pink-glow); }
.cyber-btn:disabled { background: #ccc; box-shadow: none; transform: none; cursor: not-allowed !important; }
.nav-btn { flex: 1; padding: 12px; }

.pulse-glow { animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 20, 147, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(255, 20, 147, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 20, 147, 0); } }

.quiz-viewport { overflow: hidden; flex-grow: 1; width: 100%; position: relative; padding-top: 15px; }
.quiz-track { display: flex; transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); width: 600%; }
.quiz-page { width: 16.666%; flex-shrink: 0; padding: 5px; }

.question-item {
    background: rgba(255, 255, 255, 0.5); border-radius: 16px; padding: 20px 15px; margin-bottom: 20px;
    opacity: 0.3; transform: scale(0.98); transition: all 0.3s ease; pointer-events: none;
}
.question-item.active { opacity: 1; transform: scale(1); background: rgba(255, 255, 255, 0.9); box-shadow: 0 4px 15px rgba(255, 20, 147, 0.1); border: 1px solid var(--sakura-light); pointer-events: auto; }
.question-text { font-size: 16px; font-weight: 500; margin-bottom: 20px; line-height: 1.6; min-height: 3em; }

.slider-container { position: relative; padding: 10px 0; user-select: none; -webkit-user-select: none; }
.slider-ticks { position: absolute; top: 50%; left: 12px; right: 12px; display: flex; justify-content: space-between; transform: translateY(-50%); pointer-events: none; z-index: 1; }
.slider-ticks span { width: 6px; height: 6px; background: #ccc; border-radius: 50%; }
input[type=range].custom-range { -webkit-appearance: none; width: 100%; background: transparent; position: relative; z-index: 100; cursor: pointer; margin: 0; }
input[type=range].custom-range:focus { outline: none; }
input[type=range].custom-range::-webkit-slider-runnable-track { width: 100%; height: 4px; background: rgba(255, 20, 147, 0.15); border-radius: 2px; pointer-events: auto; }
input[type=range].custom-range::-webkit-slider-thumb { -webkit-appearance: none; height: 24px; width: 24px; border-radius: 50%; background: #dcdcdc; border: 3px solid white; box-shadow: 0 2px 6px rgba(0,0,0,0.2); margin-top: -10px; transition: all 0.2s ease; position: relative; z-index: 101; pointer-events: auto; }
input[type=range].custom-range.touched::-webkit-slider-thumb { background: var(--cyber-pink); border-color: white; transform: scale(1.2); box-shadow: 0 0 12px var(--cyber-pink-glow); }
.slider-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-top: 15px; font-weight: 500; }

.progress-text { font-family: var(--font-en); font-size: 12px; color: var(--cyber-pink); margin-bottom: 5px; text-align: right; font-weight: 600; }
.progress-bar-bg { width: 100%; height: 6px; background: rgba(255, 20, 147, 0.1); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0%; background: var(--cyber-pink); box-shadow: 0 0 10px var(--cyber-pink-glow); transition: width 0.3s ease; }

.dark-badge {
    background: #2D3436; color: white; padding: 6px 12px; border-radius: 6px;
    font-size: 13px; font-weight: bold; display: inline-block; margin-bottom: 10px;
}

#lang-switcher-container { 
    position: absolute; top: 20px; right: 20px; z-index: 1000;
    display: flex; align-items: center; gap: 8px;              
}

#music-toggle-btn { margin: 0 !important; white-space: nowrap; }

.glass-select { padding: 8px 12px; border-radius: 8px; border: 1px solid rgba(255,20,147,0.5); background: rgba(255,255,255,0.8); backdrop-filter: blur(5px); color: var(--cyber-pink); font-weight: bold; cursor: pointer; outline: none; }

#custom-cursor { transition: opacity 0.3s ease; }
#custom-cursor.hidden-cursor { opacity: 0 !important; }

/* 🌟 動畫特效 🌟 */
@keyframes pulse-glow { 0%, 80% { filter: drop-shadow(0 0 5px rgba(255, 20, 147, 0.3)); } 50% { filter: drop-shadow(0 0 15px rgba(255, 20, 147, 0.8)); } }
.pulse-glow { animation: pulse-glow 2.5s infinite ease-in-out; }
@keyframes pulse-border { 0%, 100% { box-shadow: 0 0 8px var(--cyber-pink), inset 0 0 4px var(--cyber-pink); } 50% { box-shadow: 0 0 20px var(--cyber-pink), inset 0 0 10px var(--cyber-pink); } }
.pulse-border { animation: pulse-border 2.5s infinite ease-in-out; border-radius: 50%; transition: all 0.5s; }
.thick-pulse-border { border: 2px solid var(--cyber-pink); animation: pulse-border 1.5s infinite ease-in-out; }
@keyframes pulse-text { 0%, 100% { text-shadow: 0 0 5px rgba(255, 20, 147, 0.4); } 50% { text-shadow: 0 0 15px rgba(255, 20, 147, 0.9); } }
.pulse-text { animation: pulse-text 2.5s infinite ease-in-out; }
@keyframes burst-light { 0% { filter: brightness(1) drop-shadow(0 0 0px #fff); transform: scale(1); } 50% { filter: brightness(1.5) drop-shadow(0 0 20px #FF1493); transform: scale(1.2); } 100% { filter: brightness(1) drop-shadow(0 0 5px #FF1493); transform: scale(1); } }
.burst-light-anim { animation: burst-light 0.8s ease-out forwards; display: inline-block; }

#giant-heart-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    display: flex; justify-content: center; align-items: center;
    z-index: 10005; pointer-events: none; opacity: 0; transition: opacity 0.5s;
}
.giant-heart {
    font-size: 380px; margin-top: 18vh; 
    filter: drop-shadow(0 0 20px rgba(255, 20, 147, 0.8));
    animation: giant-heartbeat 1.5s ease-in-out infinite;
}
@keyframes giant-heartbeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.3); } 30% { transform: scale(1.1); } 45% { transform: scale(1.3); } }

#loading-overlay {
    position: fixed; inset: 0; background: rgba(255,255,255,0.85);
    backdrop-filter: blur(5px); z-index: 10000;
    display: flex; justify-content: center; align-items: center;
    opacity: 1; transition: opacity 0.5s ease;
}
#loading-overlay.hidden { opacity: 0; pointer-events: none; display: none; }
.loader-container { display: flex; flex-direction: column; align-items: center; }
.loader-circle { width: 120px; height: 120px; transform: rotate(-90deg); margin-bottom: 20px; }
.loader-circle circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.loader-circle .bg { stroke: #eee; }
.loader-circle .progress {
    stroke: var(--cyber-pink); stroke-dasharray: 283; stroke-dashoffset: 283;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.loader-text { font-family: var(--font-jp); font-weight: bold; font-size: 1.2rem; color: var(--cyber-pink); letter-spacing: 2px; }

.result-avatar { position: relative; overflow: hidden; transform: translateZ(0); }
.result-avatar::after {
    content: ""; position: absolute; top: -50%; left: -150%; width: 80%; height: 200%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 20%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0.1) 80%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(30deg); opacity: 0; animation: shine-sweep 4.2s infinite; pointer-events: none; z-index: 2;
}
@keyframes shine-sweep { 0%, 70% { left: -150%; opacity: 0; } 71% { left: -150%; opacity: 1; } 100% { left: 150%; opacity: 1; } }

*, body, html { cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23FF69B4" stroke="black" stroke-width="1" d="M5.5 3.21V20.8c0 .45.54.67.85.35l4.86-4.86 3.73 8.35c.16.36.61.52.97.35l2.43-1.09c.36-.16.52-.61.35-.97l-3.72-8.33 6.01.55c.45.04.77-.47.49-.83L6.34 2.86c-.24-.31-.84-.13-.84.35z"/></svg>'), auto !important; }
a, button, input, select, .question-item, label, .slider-ticks span { cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23FF69B4" stroke="black" stroke-width="1" d="M5.5 3.21V20.8c0 .45.54.67.85.35l4.86-4.86 3.73 8.35c.16.36.61.52.97.35l2.43-1.09c.36-.16.52-.61.35-.97l-3.72-8.33 6.01.55c.45.04.77-.47.49-.83L6.34 2.86c-.24-.31-.84-.13-.84.35z"/></svg>'), pointer !important; }

.ripple-effect {
    position: fixed; border-radius: 50%; transform: scale(0); transform-origin: center center;
    width: 15px !important; height: 15px !important; 
    background-color: rgba(255, 105, 180, 0.4); pointer-events: none; z-index: 99999; 
    animation: ripple-anim 600ms ease-out forwards;
}
@keyframes ripple-anim { 0% { transform: scale(0); opacity: 1; } 100% { transform: scale(2.0); opacity: 0; } }

#radar-wrapper { position: relative; width: 100%; max-width: 380px; aspect-ratio: 1 / 1; margin: 0 auto 20px auto !important; display: flex; justify-content: center; align-items: center; }
#radarChart { width: 100% !important; height: 100% !important; margin: 0 auto !important; display: block !important; }

.export-only { display: none; }
#export-card .export-only { display: none; }
.html2canvas-container .web-only { display: none !important; }
.html2canvas-container .export-only { display: grid !important; }

.exporting-mode {
    padding-bottom: 30px !important; 
    width: 540px !important; height: 960px !important; position: absolute !important; top: 0 !important; left: 0 !important;
    z-index: -1 !important; overflow: hidden !important; background: #FFF5F8 !important;
    display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: flex-start !important;
    padding-top: -15px !important; 
}
.exporting-mode .chart-container, .exporting-mode #radar-wrapper { transform: scale(0.85); margin-top: -15px; margin-bottom: -15px; }
.exporting-mode .web-only { display: none !important; }
.exporting-mode .export-only { display: grid !important; margin-top: 0px !important; gap: 6px !important;}
.exporting-mode .deep-analysis-box { display: block !important; font-size: 0.85em; margin-top: 10px; line-height: 1.4; }
.exporting-mode .landing-header { width: 100% !important; text-align: center !important; margin-bottom: -25px !important; transform: scale(1.2); }
.exporting-mode .landing-header h2 { font-size: 46px !important; margin-top: -5px !important; }
.exporting-mode #radar-wrapper { width: 320px !important; margin-left: auto !important; margin-right: auto !important; margin-top: -25px !important; margin-bottom: -25px !important; display: block !important; }
.exporting-mode #radarChart { margin: 0 auto !important; }
.exporting-mode #main-display-section { width: 98% !important; margin-top: -25px !important; padding: 9px 15px 15px 15px !important; transform: scale(1.0); transform-origin: top center; border: 3px solid #ffb7c5 !important; }
.exporting-mode #deep-analysis-box { font-size: 12px !important; margin-top: 6px !important; padding: 8px !important; line-height: 1.4 !important; }
.exporting-mode .result-avatar { animation: none !important; box-shadow: none !important; border: 1px solid rgba(255, 105, 180, 0.2) !important; }
.exporting-mode .pulse-border, .exporting-mode .thick-pulse-border { animation: none !important; box-shadow: none !important; }

#oshi-select, #oshi-select option { font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif !important; }

.sakura-petal { position: fixed; top: -10%; z-index: 1; pointer-events: none; animation: fall linear infinite; background-color: rgba(255, 182, 193, 0.6); border-radius: 15px 0px 15px 0px; }
@keyframes fall { 0% { top: -10%; transform: translateX(0) rotate(0deg); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 110%; transform: translateX(100px) rotate(360deg); opacity: 0; } }

body > canvas { z-index: 999999 !important; pointer-events: none !important; }

.site-footer { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 30px; padding-top: 15px; border-top: 1px solid rgba(0,0,0,0.05); line-height: 1.5; opacity: 0.8; }

#footer-mv-wrap {
    width: 280px; 
    background: #000; 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    
    /* 🌟 修復關鍵：拿走 all，只針對位置和透明度做動畫，禁止寬度漸變 */
    transition: transform 0.4s ease, opacity 0.4s ease, bottom 0.4s ease, right 0.4s ease; 
    
    z-index: 999; 
}
#footer-mv-wrap.floating-mode { position: fixed; right: 20px; bottom: 80px; transform: scale(1); opacity: 1; }
#footer-mv-wrap.docked-mode { position: relative; right: 0; bottom: 0; margin: 20px auto; width: 100%; max-width: 560px; transform: scale(1); }
#footer-mv-wrap.hidden { opacity: 0; pointer-events: none; transform: translateY(20px) scale(0.8); display: block !important; }
#yt-player-container { width: 100%; aspect-ratio: 16 / 9; background: #000; }

/* ==================================
   修復版：成就勳章 (Badges) 樣式
   ================================== */
.badge-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px; /* 縮細間距 */
    margin: 8px 0 10px 0; /* 🌟 縮細上下 margin，爭取垂直空間 */
}

.achievement-badge {
    background: rgba(255, 20, 147, 0.1);
    color: var(--cyber-pink);
    border: 1px solid rgba(255, 20, 147, 0.3);
    
    /* 🌟 修復問題 2：勳章整體縮細 */
    padding: 4px 10px; /* 從 6px 12px 縮細 */
    font-size: 11px; /* 從 12px 縮細 */
    border-radius: 16px; /* 從 20px 縮細 */
    
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 20, 147, 0.05);
    animation: badge-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

/* 針對 Tier 5 (極端高分) 的特別閃亮樣式 */
.achievement-badge.legendary {
    background: linear-gradient(135deg, #FF1493, #FF69B4);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 20, 147, 0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.achievement-badge:nth-child(1) { animation-delay: 0.1s; }
.achievement-badge:nth-child(2) { animation-delay: 0.3s; }
.achievement-badge:nth-child(3) { animation-delay: 0.5s; }

@keyframes badge-pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* 🌟 修復問題 1：下載時強制清空所有動畫 🌟 */
.exporting-mode * {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* 📱 移動端微調 */
@media (max-width: 768px) {
    #lang-switcher-container { position: fixed; top: 10px; right: 10px; }
    .progress-container { top: 55px !important; } 
    #page-landing { justify-content: center; padding-top: 40px; min-height: 85vh; }
    #custom-cursor { display: none; } 
    .giant-heart { font-size: 250px; margin-top: 40vh; }
    #radar-wrapper { transform: translateX(-20px); }
    .quiz-viewport { padding-top: 35px; }
}

@media (max-width: 480px) {
    #footer-mv-wrap.floating-mode { width: 180px; right: 10px; bottom: 100px; }
}

