:root {
  --bg-gradient: linear-gradient(135deg, #e2e9e5 0%, #f2edf0 100%);
  --panel-bg: rgba(255, 255, 255, 0.75);
  --text-main: #3a4750;
  --text-muted: #7e8b96;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-sm: 0 8px 32px 0 rgba(31, 38, 135, 0.04);
  --shadow-md: 0 12px 40px 0 rgba(31, 38, 135, 0.1);
  --btn-gradient-green: linear-gradient(135deg, #8fa499 0%, #768c81 100%); 
  
  /* 補上範例所需的優雅莫蘭迪核心變數 */
  --accent-color: #df7a5e;   /* 溫暖的北歐焦糖紅點綴色 */
  --line-color: #cbd5e1;     /* 優雅的箭頭與線條灰 */
  --font-serif: Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================================
 顏色衝突賽：綠色莫蘭迪背景 + 全元件防放大鎖定
 ========================================================================== */
html, body {
margin: 0; padding: 0; width: 100%; height: 100dvh;
overflow: hidden; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
background: linear-gradient(135deg, #f4f7f6 0%, #e2ebd9 100%) !important; /* 恢復衝突賽沉穩綠 */
-webkit-user-select: none; user-select: none;
-webkit-tap-highlight-color: transparent;
}

/* 核心關鍵：強制畫面上所有文字、格子、按鈕全部停用 iOS 縮放手勢 */
*, *::before, *::after {
box-sizing: border-box;
touch-action: none !important; /* 釘死每一個元件，徹底阻止 iPhone 雙擊放大 */
}

.container {
  width: 100%; height: 100dvh;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  box-sizing: border-box; padding: 16px;
}

/* 統一面板闊度 */
.game-dashboard {
  background: var(--panel-bg); backdrop-filter: blur(16px);
  padding: 25px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); width: 100%; max-width: 400px; 
  box-sizing: border-box; text-align: center;
}

.back-lobby-wrapper { text-align: left; margin-bottom: 12px; }
.back-lobby-btn {
  display: inline-block; text-decoration: none; font-size: 13px; font-weight: 600;
  color: var(--text-muted); background: rgba(0, 0, 0, 0.04);
  padding: 6px 14px; border-radius: 20px;
}

/* ==========================================================================
 頂部模式切換鈕（iOS 膠囊滑塊風格 - 完美綠化版）
 ========================================================================== */
.mode-selector {
  background: rgba(0, 0, 0, 0.05); /* 膠囊底色外框 */
  padding: 3px;
  border-radius: 30px;
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
}

.mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px 0;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.mode-btn.active {
  background: #768c81; /* 與開始按鈕一致的沉穩綠色 */
  color: white;        /* 白色字體 */
  box-shadow: 0 3px 8px rgba(118, 140, 129, 0.25);
}

.meta-header { display: flex; justify-content: space-between; margin-bottom: 14px; }
.stat-box {
  background: rgba(255, 255, 255, 0.6); padding: 10px;
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  flex: 1; margin: 0 5px; display: flex; flex-direction: column;
}
.stat-box .label { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.stat-box .value { font-size: 24px; font-weight: 700; color: var(--text-main); font-variant-numeric: tabular-nums; }

.progress-container { height: 6px; background: rgba(0, 0, 0, 0.04); border-radius: 3px; margin: 0 5px 24px 5px; overflow: hidden; }

.progress-bar { height: 100%; background: #8fa499; transition: width 0.1s linear; }
 
/* ==========================================================================
      出題與範例區：全面升級 Flexbox 佈局（防重疊、防跑版）
      ========================================================================== */
      .stroop-word-wrapper {
        height: 140px; /* 稍微拉高，給予提示與範例最舒適的呼吸空間 */
        display: flex;
        flex-direction: column; /* 改為垂直排列，文字在上、範例在下，絕對不重疊 */
        justify-content: center;
        align-items: center;
        gap: 12px; /* 提示字與範例之間的完美間距 */
        margin-bottom: 24px; 
        background: rgba(255, 255, 255, 0.4); 
        border-radius: var(--radius-md);
        padding: 12px;
        box-sizing: border-box;
      }
   
      #stroop-word { 
        font-size: 44px; 
        font-weight: 800;
        margin: 0; 
        transition: transform 0.1s ease; 
        line-height: 1.2;
      }
   
      /* 指示文字狀態（標準：不看字面... / 反轉：不看顏色...） */
      #stroop-word.ready-text { 
        font-size: 16px; /* 最適合閱讀的精緻大小 */
        color: var(--text-main);
        font-weight: 700;
        letter-spacing: 0.5px;
      }
      
  /* 範例外層容器：沒有了文字干擾，直接幾何置中 */
   .example-area {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
  }
  
  /* 範例核心 */
  .example-area-inner {
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 14px;
    font-family: var(--font-sans);
    font-size: 13px; 
    color: var(--text-muted);
  }

  /* 題目字樣 */
  .example-display {
    font-family: var(--font-serif);
    font-size: 26px; 
    font-weight: 800;
    line-height: 1;
  }

  .example-arrow { font-size: 16px; color: var(--line-color); font-weight: bold; }

  /* 按鈕預覽區 */
  .example-btn-preview-wrapper { 
    position: relative; 
    display: inline-block;
  }

  .example-btn-preview {
    border: none; 
    height: 32px; 
    padding: 0 14px;
    border-radius: 10px; 
    font-size: 13px; 
    font-weight: 700; 
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    display: flex; 
    align-items: center; 
    justify-content: center;
    white-space: nowrap;
  }

  /* 極簡光標：修正為優雅的深石板灰，並精準定位在按鈕右下角 */
  .pointer-icon {
    position: absolute;
    bottom: -12px; 
    right: -10px;
    width: 18px; 
    height: 18px;
    color: var(--text-main); /* 修正為冷調的深色，與網頁主文字顏色一致 */
    opacity: 0.85;
    animation: cursorClick 1.4s infinite ease-in-out;
    pointer-events: none;
  }

  /* 輕柔的微距點擊動態：往左上方輕推 */
  @keyframes cursorClick {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-3px, -3px) scale(0.92); }
  }

/* 下方四個顏色按鈕網格 */
.options-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 12px;
  height: 142px; 
}
.color-btn {
  border: none; height: 64px; border-radius: var(--radius-md);
  font-size: 17px; font-weight: 700; color: white;
  box-shadow: 0 6px 16px rgba(0,0,0,0.05); cursor: pointer;
  transition: transform 0.1s; -webkit-tap-highlight-color: transparent;
}
.color-btn:active { transform: scale(0.94); }

.start-action-block {
  height: 142px; display: flex; align-items: center; justify-content: center;
}
.premium-start-btn {
  background: var(--btn-gradient-green);
  color: white; border: none;
  height: 50px; width: 170px; 
  font-size: 15px; font-weight: 600; border-radius: 25px;
  cursor: pointer; box-shadow: 0 6px 16px rgba(118, 140, 129, 0.25);
  transition: transform 0.1s; -webkit-tap-highlight-color: transparent;
}

.premium-start-btn:active { transform: scale(0.96); }

.overlay {
position: fixed; 
top: 0; left: 0; right: 0; bottom: 0; 
background: rgba(58, 71, 80, 0.5); 
backdrop-filter: blur(15px); 
-webkit-backdrop-filter: blur(15px);
display: flex;
justify-content: center;
align-items: center;
z-index: 999999;
}

.modal {
background: white; 
padding: 26px 20px; 
border-radius: 24px;
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15); 
width: 82%; 
max-width: 280px; 
text-align: center; 
box-sizing: border-box;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.modal h2 { font-size: 18px; color: var(--text-main); margin: 6px 0 14px 0; font-weight: 700; }
.trophy-icon { font-size: 54px; margin-bottom: 10px; }
.score-relative-wrapper { position: relative; display: inline-block; width: 100%; }
.result-score-box { background: rgba(0, 0, 0, 0.03); padding: 12px 10px; border-radius: 16px; margin-bottom: 14px; }
.result-score-box p { margin: 0; font-size: 15px; color: var(--text-main); }
.result-score-box span { font-weight: 700; font-size: 20px; }

.new-badge {
  position: absolute; top: -15px; right: -2px;
  background: #ff4757 !important; color: white !important; font-weight: 800; font-size: 12px !important;
  padding: 1px 5px !important; border-radius: 4px; box-shadow: 0 2px 6px rgba(255, 71, 87, 0.2);
  white-space: nowrap; transform: rotate(12deg) scale(0.72) !important; transform-origin: center center; display: inline-block;
}
.best-record-line { font-size: 13px; color: #c48b00 !important; font-weight: 600; margin: 0 0 18px 0; display: flex; justify-content: center; align-items: center; gap: 4px; }
.restart-btn { background: #8fa499; color: white; border: none; padding: 11px 0; width: 100%; font-size: 15px; font-weight: 600; border-radius: 30px; cursor: pointer; }

.hidden { display: none !important; }