:root {
    --bg-gradient: linear-gradient(135deg, #f0eef5 0%, #e8eef5 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: linear-gradient(135deg, #9b8bbb 0%, #8272a4 100%); /* 專屬高級紫 */
  }
  
  /* ==========================================================================
   音樂記憶：紫色莫蘭迪背景 + 全元件防放大鎖定
   ========================================================================== */
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, #f6f5f8 0%, #ebd9eb 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;
    justify-content: center; align-items: center; padding: 16px; box-sizing: border-box;
  }
  
  /* 寬度完美與 Stroop 統一為 max-width: 400px */
  .game-dashboard {
    background: var(--panel-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5); 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: 16px; }
  .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 膠囊切換 */
  .segmented-control-wrapper { padding: 0 5px; margin-bottom: 20px; }
  .segmented-control { background: rgba(0, 0, 0, 0.05); padding: 3px; border-radius: 30px; display: flex; gap: 2px; }
  .segmented-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;
  }
  .segmented-btn.active { background: white; color: var(--text-main); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1); }
  
  .meta-header { display: flex; justify-content: space-between; margin-bottom: 14px; }
  .stat-box {
    background: rgba(255, 255, 255, 0.6); padding: 12px 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); }
  
  .instruction-wrapper {
    height: 80px; display: flex; justify-content: center; align-items: center; margin-bottom: 15px;
  }
  #msg-text { font-size: 20px; font-weight: 700; color: var(--text-main); margin: 0; }
  #msg-text.ready-text { font-size: 16px; color: var(--text-muted); font-weight: 600; }
  
  /* 音符按鈕網格 - 寬度與 Stroop 完美對齊 */
  .simon-grid { display: grid; gap: 14px; margin-bottom: 12px; height: 150px; }
  .simon-grid.grid-4 { grid-template-columns: repeat(2, 1fr); }
  .simon-grid.grid-6 { grid-template-columns: repeat(3, 1fr); }
  
  .simon-btn {
    border: none; border-radius: var(--radius-md); cursor: pointer;
    opacity: 0.4; transform: scale(1); transition: opacity 0.15s ease, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
  }
  .simon-btn.active-pad { opacity: 1; transform: scale(0.95); box-shadow: 0 0 15px rgba(255,255,255,0.6); }
  
  /* 莫蘭迪優雅音符色系 */
  .purple { background: #9b8bbb; }
  .blue   { background: #8ba3bb; }
  .pink   { background: #ca9cb0; }
  .teal   { background: #8bbbaf; }
  .yellow { background: #dbc095; }
  .orange { background: #dbaba5; }
  
  .hidden-pad { display: none; }
  
  /* 開始按鈕：精緻內斂尺寸，絕不肥大 */
  .start-action-block { height: 150px; display: flex; align-items: center; justify-content: center; }
  .premium-start-btn {
    background: var(--btn-gradient); 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(155, 139, 187, 0.25); transition: transform 0.1s;
    -webkit-tap-highlight-color: transparent;
  }
  .premium-start-btn:active { transform: scale(0.96); }
  
  .hidden { display: none !important; }