/* ============================
   Reset & Base Styles
============================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #020617; /* 遵循優化：深色底墊 */
    color: #f8fafc;
    font-family: 'Noto Sans TC', sans-serif;
    overflow-x: hidden;
    user-select: none;
}

/* 雜訊質感（關鍵） */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("https://www.transparenttextures.com/patterns/noise.png");
    opacity: 0.05;
    pointer-events: none;
    z-index: 9999;
}

/* ============================
   Game Layer
============================ */
.game-layer {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: transparent; 
    overflow: hidden; cursor: crosshair; z-index: 10;
    transition: opacity 1.5s ease, visibility 1.5s;
}
.game-layer.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes cameraShake {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-8px, 5px); }
  40%  { transform: translate(6px, -6px); }
  60%  { transform: translate(-5px, 4px); }
  80%  { transform: translate(5px, -3px); }
  100% { transform: translate(0, 0); }
}

/* ============================
   Game -> News 轉場效果 (龜山島青藍色系與寫實浪花)
============================ */
.wave-transition {
    position: fixed;
    top: 100vh;
    left: 0;
    width: 100vw;
    height: 220vh;
    /* 擬真海洋深處色調：帶有光影變化的深淺層次漸層 */
    background: linear-gradient(165deg, #44778d 0%, #355461 40%, #223740 100%);
    z-index: 10000;
    pointer-events: none;
    visibility: hidden;
    transition: transform 2.0s cubic-bezier(0.19, 1, 0.22, 1), opacity 1.2s ease;
    transform: translate3d(0, 0, 0); 
    will-change: transform;
    opacity: 1;
}

/* 🏔️ 頂部浪潮：向上的弧度 (進場時的浪尖，帶有泡沫噴霧感) */
.wave-transition::before {
    content: '';
    position: absolute;
    top: -15vw;
    left: 0;
    width: 100vw;
    height: 15.5vw;
    /* 多重 SVG 背景：底層深色浪 + 頂層白色泡沫碎浪 */
    background: 
        url('data:image/svg+xml;utf8,<svg viewBox="0 0 1440 320" xmlns="http://www.w3.org/2000/svg"><path fill="%23f0f9ff" fill-opacity="0.6" d="M0,192L48,197.3C96,203,192,213,288,192C384,171,480,117,576,112C672,107,768,149,864,165.3C960,181,1056,171,1152,154.7C1248,139,1344,117,1392,106.7L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>'),
        url('data:image/svg+xml;utf8,<svg viewBox="0 0 1440 320" xmlns="http://www.w3.org/2000/svg"><path fill="%2344778d" d="M0,160L48,144C96,128,192,96,288,106.7C384,117,480,171,576,186.7C672,203,672,181,864,165.3C960,149,1056,139,1152,144C1248,149,1344,171,1392,181.3L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    z-index: 2;
    /* 增加一點點水霧的光暈 */
    filter: drop-shadow(0 -5px 15px rgba(255,255,255,0.2));
}

/* 🌊 底部浪潮：凹陷的弧度 (離場時的浪尾，深藍色銜接) */
.wave-transition::after {
    content: '';
    position: absolute;
    bottom: -12vw;
    left: 0;
    width: 100vw;
    height: 12.5vw;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1440 320" xmlns="http://www.w3.org/2000/svg"><path fill="%23223740" d="M0,192L60,213.3C120,224,240,245,360,234.7C480,224,600,181,720,170.7C840,160,960,181,1080,192C1200,203,1320,203,1380,203L1440,203L1440,0L1380,0C1320,0,1200,0,1080,0C960,0,840,0,720,0C600,0,480,0,360,0C240,0,120,0,60,0L0,0Z"></path></svg>');
    background-size: cover;
    z-index: 2;
}

/* 狀態切換：一氣呵成的掃入 */
.wave-transition.sweep-in {
    visibility: visible;
    transform: translate3d(0, -380vh, 0); 
}

/* 當掃到頂部時，給予一絲絲的淡出感，讓離開螢幕的動作更柔和 */
.wave-transition.sweep-out {
    opacity: 0;
}

.game-layer.screen-shake { 
  animation: cameraShake 0.6s ease; 
}

/* 🌊 寫實海洋背景 */
.ocean-background {
    position: absolute;
    inset: -20px; /* 留出邊界避免抖動時穿幫 */
    background:
        linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.85)),
        url("https://images.unsplash.com/photo-1505118380757-91f5f5632de0"); /* 純俯視、無天空的海浪紋理 */
    background-size: cover;
    background-position: center;
    z-index: 1; pointer-events: none;
    transition: background-position 3s ease-out, background-size 3s ease-out;
    transform: rotate(90deg) scale(3);
}
.ocean-background.playing {
    background-size: 150%;
    /* 配合 90度旋轉，操作 left/right 即代表畫面上的垂直方向移動 */
    background-position: left center;
}
/* 水面光影 */
.ocean-background::after {
    content: "";
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.15), transparent 40%),
        radial-gradient(circle at 80% 60%, rgba(255,255,255,0.1), transparent 50%);
    animation: waterLight 6s infinite alternate;
}

@keyframes waterLight {
    from { opacity: 0.6; }
    to   { opacity: 1; }
}


/* ============================
   UI（玻璃感）
============================ */
.start-ui {
    position: absolute; inset: 0; display: flex; justify-content: center; align-items: center;
    z-index: 20; transition: opacity 0.5s;
}
.ui-content {
    padding: 50px 40px; text-align: center;
    border-radius: 16px;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    color: white;
    width: 90%; max-width: 480px;
}
.start-ui.hide { opacity: 0; pointer-events: none; }

.news-tag {
    display: inline-block;
    background: rgba(255,255,255,0.1); color: #cbd5e1;
    font-size: 0.8rem; font-weight: 700;
    padding: 6px 14px; border-radius: 20px;
    margin-bottom: 20px; letter-spacing: 1px;
}

.start-title {
    font-family: 'Noto Serif TC', serif; font-weight: 600; font-size: 2.8rem; margin-bottom: 12px;
    color: #ffffff; line-height: 1.2;
}

.start-desc { font-size: 1.05rem; color: #cbd5e1; margin-bottom: 36px; line-height: 1.8; font-weight: 300; }

.start-btn {
    padding: 16px 45px; font-size: 1.2rem; font-weight: bold;
    border: none; border-radius: 999px;
    background: #0ea5e9; color: white;
    cursor: pointer; transition: 0.2s;
    font-family: 'Noto Sans TC', sans-serif;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
}
.start-btn:hover { transform: scale(1.05); background: #38bdf8; }

/* 遊戲中 UI */
.game-ui {
    position: absolute; top: 6%; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 500px; z-index: 5;
    pointer-events: none; transition: opacity 1s, transform 1s;
    display: flex; justify-content: center;
}
.game-ui .ui-content {
    padding: 24px; /* 遊戲進行中不需要開頭那麼大的 padding */
}
.game-ui.hide { opacity: 0; transform: translate(-50%, -20px); }

.game-title { font-family: 'Noto Serif TC', serif; font-weight: 600; font-size: 1.6rem; margin-bottom: 8px; color: #ffffff; }
.game-instruction { font-size: 0.9rem; color: #cbd5e1; margin-bottom: 16px; line-height: 1.5; font-weight: 300; }

.skip-btn {
    border: 1px solid rgba(255,255,255,0.4);
    background: transparent;
    color: rgba(255,255,255,0.8);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 15px;
    transition: 0.3s;
    font-family: inherit;
    pointer-events: auto; /* Ensure it is clickable despite game-ui pointer-events setting */
}
.skip-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* 進度條 */
.progress-container { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.progress-bar-wrap { flex-grow: 1; height: 10px; background: rgba(255,255,255,0.1); border-radius: 999px; overflow: hidden; position: relative; margin-right: 15px;}
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #38bdf8, #0ea5e9); transition: width 0.15s ease-out; }
.progress-text { font-size: 1.2rem; font-weight: 700; color: #ffffff; min-width: 80px; text-align: right;}
.progress-text span { font-size: 0.9rem; color: #cbd5e1; font-weight: 500;}

/* 危險提示 */
.surge-warning {
    position: absolute; inset: 0; display: flex; justify-content: center; align-items: center;
    z-index: 50; text-align: center; pointer-events: none;
    backdrop-filter: blur(4px);
    background: rgba(255,0,0,0.15);
    animation: fadeInOut 1.5s infinite;
}
.surge-warning h2 { font-family: 'Noto Sans TC', sans-serif; font-size: 2.2rem; font-weight: 700; color: #fff; text-shadow: 0 4px 10px rgba(0,0,0,0.5); }
@keyframes fadeInOut { 0% { opacity: 0.7; } 50% { opacity: 1; } 100% { opacity: 0.7; } }
.surge-warning.hide { display: none; }

/* ============================
   Beach Layer (寫實沙灘 在下方)
============================ */
.beach-layer {
    position: absolute;
    bottom: 0vh; left: 0; width: 100vw; height: 35vh; z-index: 3;
    pointer-events: none; transition: transform 3s cubic-bezier(0.5, 0, 0.2, 1), opacity 3s;
    background:
        linear-gradient(transparent, rgba(0,0,0,0.85) 80%),
        url("https://images.unsplash.com/photo-1473116763249-2faaef81ccda");
    background-size: cover;
    background-position: bottom;
    mask-image: linear-gradient(to top, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 50%, transparent 100%);
}
.beach-layer.recede { transform: translateY(40vh); opacity: 0; }


/* ============================
   角色重置與動畫
============================ */
.swimmer {
    position: absolute; bottom: -6vh; left: 50%; transform: translateX(-50%); z-index: 4;
    pointer-events: none; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.swimmer.intro-standby { bottom: 5vh; transform: translateX(-50%) scale(1.5); }
.swimmer.jump-in { animation: diveAnimation 2.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@keyframes diveAnimation {
    0% { bottom: 5vh; transform: translateX(-50%) scale(1.5) rotate(0deg); }
    15% { bottom: 5vh; transform: translateX(-50%) scale(1.5) rotate(-5deg); } 
    50% { bottom: 40vh; transform: translateX(-50%) scale(1.2) rotate(10deg); } 
    85% { bottom: -6vh; transform: translateX(-50%) scale(1) rotate(-3deg); } 
    100% { bottom: -6vh; transform: translateX(-50%) scale(1) rotate(0deg); }
}
.lifeguard-silhouette { 
    width: 160px; 
    display: block; 
    animation: float 3s ease-in-out infinite; 
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.6)); 
    margin: 0 auto;
}
@keyframes float { 
    0%   { transform: translate(0, 0px); }
    50%  { transform: translate(0, -6px); }
    100% { transform: translate(0, 0px); }
}

/* 動態自由式划水 (綁定 playing 狀態，動作更像真實游泳) */
.playing .swim-arm-left {
    transform-origin: 75px 65px;
    animation: realSwimCrawl 1.8s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
.playing .swim-arm-right {
    transform-origin: 125px 65px;
    animation: realSwimCrawl 1.8s infinite cubic-bezier(0.4, 0, 0.2, 1);
    animation-delay: 0.9s;
}
@keyframes realSwimCrawl {
    0%   { transform: rotate(15deg) scale(1); opacity: 1; filter: brightness(1); }
    20%  { transform: rotate(-80deg) scale(0.85); opacity: 0.5; filter: brightness(0.6); } /* 深入水中強勢推水 */
    50%  { transform: rotate(-70deg) scale(0.9); opacity: 0.8; filter: brightness(0.8); } /* 開始提臂出水 */
    80%  { transform: rotate(45deg) scale(1.05); opacity: 1; filter: brightness(1.1); } /* 露出水面往前大力伸展 */
    100% { transform: rotate(15deg) scale(1); opacity: 1; filter: brightness(1); }
}

/* 雙腿立體打水動畫 (透過 opacity & scale 模擬下踩踩水深度) */
.playing .swim-leg-left {
    animation: flutterKickLeft 0.8s infinite ease-in-out;
}
.playing .swim-leg-right {
    animation: flutterKickRight 0.8s infinite ease-in-out;
}
@keyframes flutterKickLeft {
    0%   { transform: rotate(-5deg) scaleY(1); opacity: 1; }
    50%  { transform: rotate(2deg) scaleY(0.85); opacity: 0.5; filter: brightness(0.7); }
    100% { transform: rotate(-5deg) scaleY(1); opacity: 1; }
}
@keyframes flutterKickRight {
    0%   { transform: rotate(5deg) scaleY(0.85); opacity: 0.5; filter: brightness(0.7); }
    50%  { transform: rotate(-2deg) scaleY(1); opacity: 1; }
    100% { transform: rotate(5deg) scaleY(0.85); opacity: 0.5; filter: brightness(0.7); }
}

/* 自然的水花波紋軌跡 (模擬雙腿打水與前進的泡沫) */
.water-wake {
    position: absolute;
    width: 140px;
    height: 150px;
    background: radial-gradient(ellipse at center 20%, rgba(200, 240, 255, 0.4) 0%, transparent 60%);
    bottom: -60px; left: 50%;
    transform: translateX(-50%);
    z-index: -2;
    filter: blur(6px);
    animation: wakePulse 1.6s infinite alternate ease-in-out;
}
@keyframes wakePulse {
    0%   { transform: translateX(-50%) scaleY(1) scaleX(0.85); opacity: 0.3; }
    100% { transform: translateX(-50%) scaleY(1.4) scaleX(1.15); opacity: 0.7; }
}

.mega-splash {
    position: absolute; bottom: 10vh; left: 50%; transform: translateX(-50%);
    width: 0; height: 0; background: #ffffff;
    border-radius: 50%; opacity: 0.8; z-index: 5; pointer-events: none; animation: megaSplashAnim 1s cubic-bezier(0.1, 0.9, 0.2, 1) forwards; filter: blur(6px);
}
@keyframes megaSplashAnim { 0% { width: 50px; height: 50px; opacity: 0.8; bottom: 5vh; } 100% { width: 500px; height: 180px; opacity: 0; bottom: 20vh; } }
.swimmer.dash { transform: translateX(-50%) translateY(-3vh); }
.swimmer.dash .water-wake { 
    filter: blur(4px) brightness(1.5);
    transition: filter 0.3s;
}

/* ============================
   浮標與特效 (寫實新聞版圓形浮標)
============================ */
.lifesaver {
    position: absolute; width: 100px; height: 100px; cursor: pointer; z-index: 6; transition: transform 0.2s;
    animation: floatUpSurface 6s linear infinite; pointer-events: auto;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.15));
}
@keyframes floatUpSurface { 0% { top: 110vh; rotate: -4deg; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { top: -20vh; rotate: 20deg; opacity: 0; } }

.floating-text { position: absolute; color: #ef4444; font-size: 1.5rem; font-weight: 700; font-family: 'Noto Sans TC', sans-serif; pointer-events: none; z-index: 100; animation: floatUpFade 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; text-shadow: 0 4px 10px rgba(0,0,0,0.1); background: #fff; padding: 6px 16px; border-radius: 20px;}
@keyframes floatUpFade { 0% { opacity: 0; transform: translate(-50%, 0) scale(0.5); } 20% { opacity: 1; transform: translate(-50%, -40px) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -80px) scale(0.9); } }
.ripple { position: absolute; border-radius: 50%; border: 3px solid rgba(255,255,255,0.6); transform: translate(-50%, -50%); animation: rippleExpand 0.6s ease-out forwards; pointer-events: none; z-index: 3; }
@keyframes rippleExpand { 0% { width: 0; height: 0; opacity: 1; } 100% { width: 120px; height: 120px; opacity: 0; } }

/* ============================
   News Layer (Light Ocean Theme)
============================ */
.news-layer { position: relative; background-color: #f0f9ff; color: #334155; min-height: 100vh; z-index: 1; user-select: text; }
.news-layer.hide { display: none; }
.news-layer.show { display: block; animation: fadeInNews 1.5s ease-out forwards; }
@keyframes fadeInNews { 0% { opacity: 0; transform: translateY(50px); } 100% { opacity: 1; transform: translateY(0); } }

.news-header { 
    height: 100vh;
    background: #cadde8 url('news_header_bg.jpg') center center / cover no-repeat; 
    position: relative; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 100%;
}
.news-header::before {
    content: '';
    position: absolute;
    inset: 0;
    /* 讓圖片更明顯：減少上方遮罩，只在底部做消散漸層 */
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.1) 60%, rgba(240, 249, 255, 1) 100%);
}
.header-overlay { 
    text-align: center; 
    color: #fff; 
    padding: 0 20px; 
    position: relative; 
    z-index: 2; 
}
.news-title { 
    font-family: 'Noto Serif TC', serif; 
    font-weight: 900; 
    font-size: clamp(2rem, 5vw, 3.2rem); 
    line-height: 1.3; 
    max-width: 900px; 
    margin: 0 auto; 
    text-shadow: 0 4px 25px rgba(0, 0, 0, 0.7);
    letter-spacing: 1px; 
    /* 強化標題文字陰影，確保在圖片背景上清晰可見 */
    text-shadow: 0 2px 15px rgba(0,0,0,0.6); 
}

.news-content { max-width: 800px; margin: 0 auto; padding: 0 24px; font-size: 1.15rem; line-height: 2; color: #334155; }
.news-section { min-height: 90vh; display: flex; flex-direction: column; justify-content: center; padding: 10vh 0; border-bottom: 1px solid #bae6fd; }
.news-section.intro-section { min-height: auto; padding: 10vh 0; border-bottom: 2px solid #38bdf8; }
.news-section:last-child { border-bottom: none; }

.news-section h2 { font-family: 'Noto Serif TC', serif; font-size: 2rem; color: #0369a1; margin-bottom: 2rem; }
.news-section p { margin-bottom: 1.5rem; text-align: justify; }
.news-section .reporter { font-weight: 700; color: #0284c7; margin-bottom: 2rem; }
.news-section .note { font-size: 0.95rem; color: #64748b; padding-left: 1rem; border-left: 3px solid #7dd3fc; margin-top: 2rem; margin-bottom: 3rem; background: #e0f2fe; padding: 12px 16px; border-radius: 4px; }

.replay-btn { background: #fff; color: #0284c7; border: 2px solid #0284c7; padding: 16px 40px; font-size: 1.1rem; font-weight: 700; border-radius: 30px; cursor: pointer; transition: transform 0.2s, background 0.2s; margin-top: 40px; }
.replay-btn:hover { background: #0284c7; color: #fff; transform: translateY(-2px); }

/* 📊 互動式圖表容器樣式 */
.news-chart {
    margin: 2rem auto;
    width: 100%;
    max-width: 1000px; /* 增加寬度限制，提升閱讀舒適度同時保持美感 */
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08); /* 稍微增加陰影厚度 */
}
@media (max-width: 768px) {
    .news-chart {
        padding: 15px;
        margin: 1rem auto;
    }
}

.scroll-hint {
    max-width: 900px;
    margin: 1.5rem auto;
    font-size: 0.95rem;
    color: #0369a1;
    text-align: left; /* 改回左側對齊 */
    padding: 0 20px;
    font-style: normal;
    font-weight: 600;
    box-sizing: border-box;
    animation: bounceDown 2s infinite;
}

@keyframes bounceDown {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-5px); }
}

/* 📊 互動式圖表容器樣式 (滿版自動對齊) */
.chart-interaction-section {
    background: linear-gradient(to bottom, #f0f9ff, #ffffff);
    min-height: 100vh; /* 改用 min-height 以免內容過多時卡到文字 */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* 改為 flex-start 確保內容從頂部開始 */
    align-items: center;
    scroll-snap-align: start; /* 改為 start 以確保頂部對齊 */
    padding: 2vh 0 5vh 0 !important; /* 加入適量頂部 padding */
    margin-top: 0 !important; /* 移除 margin 以免影響捕捉位置 */
    max-width: 100% !important;
}

/* 為了讓捕捉生效，需在 scrolling element (body/html) 設定 snap-type */
html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
}

.chart-interaction-section .news-chart {
    align-self: center;
    margin-top: 0 !important; /* 移除頂部間距以確保對齊 */
}

.news-section.tight-spacing {
    padding-bottom: 2vh; /* 大幅縮減下方間距 */
}

.news-section.tight-spacing + .news-section {
    padding-top: 2vh; /* 同時縮減下一個標題區塊的上間距 */
}

/* ============================
   🎯 CTA Section (啟動按鈕區)
============================ */
.cta-section {
    background: linear-gradient(rgba(240, 249, 255, 0.4), rgba(224, 242, 254, 0.4)), url('wave-bg.jpg') center/cover no-repeat;
    height: 100vh; /* 滿版高度 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    scroll-snap-align: start; /* 改為 start 確保對齊一致性 */
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
}
.cta-container {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 60px 40px;
    border-radius: 32px;
    text-align: center;
    box-shadow: 0 30px 70px rgba(0,0,0,0.08);
    max-width: 600px;
    width: 90%;
    border: 1px solid #bae6fd;
    position: relative; /* Add this for absolute positioning of children */
}
.cta-badge {
    display: inline-block;
    padding: 6px 16px;
    background: #0ea5e9;
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 99px;
    margin-bottom: 24px;
    letter-spacing: 2px;
}
.cta-container h2 {
    font-family: 'Noto Serif TC', serif;
    font-size: 2.2rem;
    color: #0369a1;
    margin-bottom: 16px;
}
.cta-container p {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 40px;
    text-align: center;
}
.cta-start-btn {
    background: #0369a1;
    color: white;
    padding: 18px 45px;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 25px rgba(3, 105, 161, 0.3);
}
.cta-start-btn:hover {
    transform: translateY(-5px) scale(1.02);
    background: #0284c7;
    box-shadow: 0 15px 35px rgba(3, 105, 161, 0.4);
}

/* ============================
   🎮 第二階段獨立層 (game-layer-2)
============================ */
.game-layer-2 {
    position: fixed;
    inset: 0;
    z-index: 50;
    background-color: #0c4a6e;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    box-sizing: border-box;
    font-family: 'Noto Sans TC', sans-serif;
    color: #f8fafc;
}
.game-layer-2.hide { display: none; }

.ocean-2 {
    position: absolute; bottom: 0; left: 0; width: 200%; height: 100%;
    overflow: hidden; z-index: 1; opacity: 0.5; pointer-events: none;
}
.ocean-2 svg { position: absolute; bottom: 0; width: 100%; height: 320px; }
.wave-2 { fill: rgba(56, 189, 248, 0.2); animation: waveMoveHor2 linear infinite; transition: opacity 0.8s ease; }
.wave1-2 { animation-duration: 18s; opacity: 0.5; filter: blur(1.2px); }
.wave2-2 { animation-duration: 13s; fill: rgba(56, 189, 248, 0.3); opacity: 0.7; filter: blur(0.6px); }
.wave3-2 { animation-duration: 9s; fill: rgba(14, 165, 233, 0.4); filter: blur(0); }

@keyframes waveMoveHor2 {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

#app-container-2 {
    width: 100%; max-width: 900px; height: 100%; max-height: 740px;
    background: linear-gradient(135deg, rgba(8, 47, 73, 0.6) 0%, rgba(12, 74, 110, 0.9) 100%), url('wave-bg.jpg') center bottom no-repeat;
    background-size: cover !important;
    backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 28px; padding: 25px 35px;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    position: relative; display: flex; flex-direction: column; z-index: 5;
    overflow: hidden;
}

.game-layer-2::after {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 40px 40px; opacity: 0.2;
    animation: drift-2 60s linear infinite; pointer-events: none; z-index: 2;
}

.game-layer-2::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(56, 189, 248, 0.2), transparent 60%),
                radial-gradient(circle at 70% 70%, rgba(45, 212, 191, 0.15), transparent 60%);
    filter: blur(100px); z-index: 1; animation: floatGlow-2 20s ease-in-out infinite alternate;
    box-shadow: inset 0 0 180px rgba(0,0,0,0.38);
}

@keyframes drift-2 {
    from { transform: translateY(0); }
    to { transform: translateY(-200px); }
}

@keyframes floatGlow-2 {
    from { transform: translate(0, 0); }
    to { transform: translate(60px, 40px); }
}

.screen-2 { display: none; flex: 1; flex-direction: column; height: 100%; animation: fadeInSmooth2 0.6s ease-out forwards; }
.screen-2.active { display: flex; }
.screen-2.centered-screen { align-items: center; justify-content: center; text-align: center; }
@keyframes fadeInSmooth2 { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* Ported styles with -2 suffix or scoped under .game-layer-2 */
.game-layer-2 .eng-title-2 { font-family: 'Playfair Display', serif; font-style: italic; color: #7dd3fc; font-size: 14px; text-align: center; letter-spacing: 4px; margin-bottom: 5px; opacity: 0.9; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.game-layer-2 h1 { font-family: 'Noto Serif TC', serif; text-align: center; margin: 0 0 20px 0; font-size: 32px; color: #fff; font-weight: 900; letter-spacing: 3px; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.8); }
.game-layer-2 .subtitle-2 { text-align: center; color: #e2e8f0; margin-bottom: 16px; font-size: 16px; font-weight: 400; line-height: 1.6; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); }

.action-btn-2 {
    display: block; width: 100%; background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
    color: #e2e8f0; border: 1px solid rgba(255, 255, 255, 0.15); border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding: 14px; font-size: 16px; font-weight: 500; letter-spacing: 2px; border-radius: 16px; cursor: pointer; margin-top: 15px;
    transition: all 0.4s;
}
.action-btn-2:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(56, 189, 248, 0.5); color: #fff; transform: translateY(-2px); box-shadow: 0 5px 25px rgba(14, 165, 233, 0.2); }
.start-btn-2 { 
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: #fff;
    border: 1px solid rgba(56, 189, 248, 0.3);
    animation: pulseGlow-2 2.5s infinite; 
}
.start-btn-2:hover {
    background: linear-gradient(135deg, #0284c7, #075985);
}
@keyframes pulseGlow-2 { 0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.3); } 70% { box-shadow: 0 0 0 15px rgba(56, 189, 248, 0); } 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); } }

.exit-game-btn-2 {
    position: absolute;
    top: 20px;
    right: 25px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    padding: 10px 20px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
}
.exit-game-btn-2:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.cover-panel-2 { background: rgba(8, 47, 73, 0.85); padding: 25px 30px; border-radius: 24px; margin: auto 0; border: 1px solid rgba(255, 255, 255, 0.15); }
.phase-item-2 { margin-bottom: 16px; display: flex; align-items: center; gap: 14px; }
.phase-badge-2 { padding: 4px 12px; border-radius: 99px; font-weight: 700; font-size: 11px; }
.badge-p1-2 { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.badge-p2-2 { background: rgba(45, 212, 191, 0.2); color: #5eead4; }

.timer-container-2 { width: 100%; height: 6px; background: rgba(0,0,0,0.5); border-radius: 99px; margin-bottom: 10px; overflow: hidden; }
#timer-bar-2 { height: 100%; width: 100%; background: linear-gradient(to left, #4ade80, #f59e0b, #ef4444); transform-origin: left; }

.dispenser-area-2 { height: 90px; display: flex; justify-content: center; align-items: center; margin-bottom: 12px; position: relative; perspective: 1200px; }
.sort-card-2 {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1); border-top: 1px solid #38bdf8; border-radius: 14px;
    padding: 14px 20px; font-size: 15px; color: #f8fafc; text-align: center; min-width: 240px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: absolute; z-index: 5;
}

.sorting-bins-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.bin-btn-2 { 
    background: rgba(0, 0, 0, 0.4) !important; 
    border: 2px solid rgba(255, 255, 255, 0.1) !important; 
    border-radius: 12px !important; 
    padding: 12px 8px !important; 
    color: #cbd5e1 !important; 
    cursor: pointer !important; 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    text-align: center;
    backdrop-filter: blur(10px);
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 700;
}
.btn-tw-2 { 
    border-color: rgba(7, 89, 133, 0.4) !important; 
    animation: binBreathing-tw-2 3s ease-in-out infinite !important; 
}
.btn-au-2 { 
    border-color: rgba(124, 45, 18, 0.4) !important; 
    animation: binBreathing-au-2 3s ease-in-out infinite !important; 
    animation-delay: 1.5s;
}
.bin-btn-2:hover { 
    background: rgba(255, 255, 255, 0.15) !important; 
    border-color: rgba(255,255,255,0.8) !important; 
    transform: translateY(-3px) !important; 
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

@keyframes binBreathing-tw-2 {
    0%, 100% { box-shadow: 0 0 5px rgba(3, 105, 161, 0.1); border-color: rgba(7, 89, 133, 0.3); transform: scale(1); }
    50% { box-shadow: 0 0 60px rgba(56, 189, 248, 0.8); border-color: rgba(56, 189, 248, 1); transform: scale(1.15); }
}

@keyframes binBreathing-au-2 {
    0%, 100% { box-shadow: 0 0 5px rgba(124, 45, 18, 0.1); border-color: rgba(124, 45, 18, 0.3); transform: scale(1); }
    50% { box-shadow: 0 0 60px rgba(245, 158, 11, 0.8); border-color: rgba(251, 191, 36, 1); transform: scale(1.15); }
}

.sorted-results-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; flex: 1; overflow: hidden; }
.result-box-2 { background: rgba(0,0,0,0.3); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; overflow: hidden; }
.res-title-2 { font-style: italic; font-size: 12px; color: #94a3b8; text-align: center; margin-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); flex-shrink: 0; }
#box-tw-2, #box-au-2 { display: flex; flex-wrap: wrap; gap: 5px; align-content: flex-start; overflow: hidden; }
.sorted-tag-2 { background: rgba(30, 41, 59, 0.5); padding: 5px 12px; border-radius: 999px; font-size: 13px; color: #e2e8f0; border: 1px solid rgba(255, 255, 255, 0.05); }
.au-tag-2 { border-left: 2px solid #f59e0b; }
.tw-tag-2 { border-left: 2px solid #38bdf8; }

.reveal-item-2 { padding: 8px 12px; margin-bottom: 6px; background: rgba(15, 23, 42, 0.85); border-left: 3px solid #34d399; border-radius: 4px; font-size: 13px; color: #34d399; animation: revealSlideIn-2 0.5s forwards; }
@keyframes revealSlideIn-2 { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }

.fly-tw-2 { transform: translateX(-150px) translateY(70px) scale(0.3) rotate(-10deg); opacity: 0; }
.fly-au-2 { transform: translateX(150px) translateY(70px) scale(0.3) rotate(10deg); opacity: 0; }
.shake-2 { animation: shake-2 0.4s both; border-color: #f43f5e !important; }
@keyframes shake-2 { 10%, 90% { transform: translate3d(-1px, 0, 0); } 20%, 80% { transform: translate3d(2px, 0, 0); } 30%, 50%, 70% { transform: translate3d(-4px, 0, 0); } 40%, 60% { transform: translate3d(4px, 0, 0); } }

/* Slider */
.slider-container-2 { margin: 5px 0 15px 0; padding: 15px 20px; background: rgba(0, 0, 0, 0.4); border-radius: 16px; }
.slider-header-2 { display: flex; justify-content: space-between; font-size: 11px; color: #475569; margin-bottom: 8px; }

.game-layer-2 input[type=range] { appearance: none; -webkit-appearance: none; width: 100%; background: transparent; }
.game-layer-2 input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 8px; background: linear-gradient(to right, #38bdf8, #f59e0b, #ef4444); }
.game-layer-2 input[type=range]::-webkit-slider-thumb { height: 18px; width: 18px; border-radius: 50%; background: #fff; cursor: grab; -webkit-appearance: none; margin-top: -7px; box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }

.threat-display-2 { text-align: center; margin-top: 15px; }
.threat-display-2 h2 { margin: 0; font-size: 18px; color: #f8fafc; font-weight: 300; }
.threat-tag-2 { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; margin-top: 5px; background: rgba(255, 255, 255, 0.05); color: #94a3b8; }

.comp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; flex: 1; overflow: hidden; }
.c-card-2 { background: rgba(15, 23, 42, 0.4); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 16px; padding: 15px; display: flex; flex-direction: column; overflow: hidden; }
.c-card-2 h3 { font-family: 'Playfair Display', serif; font-size: 19px; margin: 0 0 10px 0; font-style: italic; border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding-bottom: 8px; }
.status-text-2 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.c-card-2 ul { margin: 0; padding-left: 0; list-style: none; color: #f1f5f9; font-size: 13.5px; line-height: 1.6; flex: 1; overflow: hidden; }
.c-card-2 ul li { margin-bottom: 6px; padding-left: 14px; position: relative; }
.c-card-2 ul li::before { content: "—"; position: absolute; left: 0; color: #475569; font-size: 10px; }

.conclusion-panel-2 { background: rgba(15,23,42,0.6); padding: 25px 30px; border-radius: 18px; line-height: 1.8; border: 1px solid rgba(255, 255, 255, 0.1); text-align: center; }
.highlight-conclusion-2 { color: #38bdf8; font-weight: 700; margin-top: 15px; font-size: 1.1rem; }

#canvas-2 { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; opacity: 0; pointer-events: none; transition: opacity 0.8s ease; }

.cta-source-bottom {
    text-align: center;
    color: #475569;
    font-size: 1rem;
    margin-top: 1.5rem;
    font-weight: 500;
    opacity: 0.9;
}

