/* 1. 引入  Huninn */
@import url('https://fonts.googleapis.com/css2?family=Huninn:wght@400;700&display=swap');

/* 2. 定義字體家族 */
:root {
  --font-body: "Huninn", system-ui, -apple-system, "Segoe UI", Roboto, "Microsoft JhengHei", sans-serif;
  --font-code: Monaco, Consolas, "Courier New", monospace;
}

/* 3. 全域套用 */
body {
  font-family: var(--font-body);
  font-weight: 400;           /* 一般文字用 400 */
}

/* 標題可以加粗一點，視覺更有層次 */
h1, h2, h3, .title, .h1, .h2, .h3 {
  font-weight: 700;
}

/* 程式碼、輸入框、pre、code 強制用等寬 */
code, pre, .ace_editor, textarea, input[type="text"], input[type="password"],
kbd, samp, var, tt {
  font-family: var(--font-code);
  font-size: 1rem;              /* 程式碼區塊不要太小 */
  line-height: 1.5;
  letter-spacing: 0;            /* 等寬字不要加 letter-spacing */
}

/*  game.css 看起來有 */
.ace_editor, .ace_gutter {
  font-family: var(--font-code) !important;
}

/* =========================================
   穿山甲過場動畫 (首頁 <-> 關卡)
========================================= */
#page-transition {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #fff0f3; z-index: 99999;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease-out;
}
#page-transition.transition-active {
    opacity: 1; pointer-events: auto;
}
.loader-container {
    width: 80%; max-width: 400px; position: relative; text-align: center;
}
.loading-text {
    margin-top: 20px; color: #d81b60; font-weight: bold; font-size: 1.2rem; letter-spacing: 2px;
}

/* 👇 這裡改名了，避免跟樹苗衝突 👇 */
.transition-progress-wrapper {
    width: 100%; height: 20px; background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px); border-radius: 30px; padding: 5px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1), 0 5px 15px rgba(255, 183, 197, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.8); position: relative; overflow: hidden;
}

.transition-progress-fill {
    height: 100%; width: 0%; background: linear-gradient(90deg, #ffc3d0 0%, #ff8fa3 100%);
    border-radius: 20px; box-shadow: 0 0 10px rgba(255, 143, 163, 0.5);
    animation: fillBar 1.5s ease-in-out forwards; position: relative;
}

.transition-progress-fill::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: shimmer 1.5s infinite;
}
/* 👆 改名結束 👆 */

.pangolin-runner {
    position: absolute; bottom: 35px; width: 60px; font-size: 45px;
    left: 0; transform: translateX(-50%);
    animation: movePangolin 1.5s ease-in-out forwards, hopPangolin 0.3s ease-in-out infinite alternate;
}

/* 抵達新頁面時的狀態也要改名 */
#page-transition.fade-out-only .transition-progress-fill { width: 100%; animation: none; }
#page-transition.fade-out-only .pangolin-runner { left: 100%; animation: hopPangolin 0.3s ease-in-out infinite alternate; }

@keyframes fillBar { 0% { width: 0%; } 100% { width: 100%; } }
@keyframes shimmer { 100% { left: 200%; } }
@keyframes movePangolin { 0% { left: 0%; } 100% { left: 100%; } }
@keyframes hopPangolin { from { margin-bottom: 0px; } to { margin-bottom: 15px; } }