/**
 * HOYA8 - Typography Fix 
 * 修正文字排版問題
 */

/* ===============================
   中文排版修正
   =============================== */

/* 重置所有文字斷行規則 */
* {
  word-break: normal !important;
  word-wrap: normal !important;
}

/* 全域基本設定 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft JhengHei", "微軟正黑體", "PingFang TC", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.7;
  letter-spacing: 0.02em;
}

/* 標題不斷行 */
h1, h2, h3, h4, h5, h6,
.hero-title,
.hero-subtitle {
  word-break: keep-all !important;
  white-space: normal !important;
  line-height: 1.4 !important;
}

/* Hero 區塊修正 */
.hero-title {
  font-size: 2.5rem !important;
  font-weight: 700 !important;
  margin-bottom: 1rem !important;
}

.hero-subtitle {
  font-size: 1.25rem !important;
  font-weight: 400 !important;
  margin-bottom: 1.5rem !important;
  opacity: 0.9;
}

.hero-description {
  font-size: 1.1rem !important;
  line-height: 1.8 !important;
  margin-bottom: 2rem !important;
}

/* 品牌高亮修正 */
.brand-highlight {
  display: inline-block !important;
  white-space: nowrap !important;
}

/* 段落文字優化 */
p {
  word-break: break-word !important;
  line-height: 1.8 !important;
  margin-bottom: 1rem;
}

/* 按鈕文字不斷行 */
.btn,
.get-started-btn,
.btn-get-started,
.btn-learn-more,
button,
a[class*="btn"] {
  white-space: nowrap !important;
  word-break: keep-all !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.75rem 2rem !important;
}

/* 按鈕內文字 */
.btn span,
.get-started-btn span,
.btn-get-started span,
.btn-learn-more span {
  white-space: nowrap !important;
}

/* 導航選單不斷行 */
.nav-menu a,
.nav-menu span,
.nav-text {
  white-space: nowrap !important;
  word-break: keep-all !important;
}

/* 功能項目 */
.feature-item {
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

/* 卡片標題 */
.game-card h3,
.icon-box h4,
.card-title {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 內容區塊 */
.content h3 {
  font-size: 1.75rem !important;
  margin-bottom: 1.5rem !important;
  word-break: keep-all !important;
}

.content p {
  font-size: 1.05rem !important;
  line-height: 1.8 !important;
  text-align: justify !important;
  text-justify: inter-ideograph !important;
}

/* Icon Box 優化 */
.icon-box {
  padding: 2rem !important;
}

.icon-box h4 {
  font-size: 1.25rem !important;
  margin: 1rem 0 0.5rem !important;
  white-space: normal !important;
}

.icon-box p {
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
}

/* 頁尾連結 */
footer a {
  white-space: nowrap !important;
  word-break: keep-all !important;
}

/* ===============================
   響應式修正
   =============================== */

/* 平板 */
@media (max-width: 991px) {
  .hero-title {
    font-size: 2rem !important;
  }
  
  .hero-subtitle {
    font-size: 1.15rem !important;
  }
  
  .hero-description {
    font-size: 1rem !important;
  }
  
  .content h3 {
    font-size: 1.5rem !important;
  }
}

/* 手機 */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.75rem !important;
    text-align: center !important;
  }
  
  .hero-subtitle {
    font-size: 1.1rem !important;
    text-align: center !important;
  }
  
  .hero-description {
    font-size: 0.95rem !important;
    text-align: center !important;
  }
  
  /* 手機按鈕調整 */
  .btn,
  .get-started-btn,
  .btn-get-started,
  .btn-learn-more {
    padding: 0.65rem 1.5rem !important;
    font-size: 0.95rem !important;
  }
  
  /* 手機上允許某些長標題換行 */
  .content h3 {
    font-size: 1.35rem !important;
    white-space: normal !important;
    word-break: keep-all !important;
  }
  
  .icon-box h4 {
    font-size: 1.1rem !important;
  }
  
  /* 手機卡片 */
  .game-card {
    padding: 1.5rem !important;
  }
  
  .game-card h3 {
    font-size: 1.1rem !important;
  }
}

/* 小手機 */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.5rem !important;
  }
  
  .hero-subtitle {
    font-size: 1rem !important;
  }
  
  .hero-description {
    font-size: 0.9rem !important;
  }
  
  /* 小螢幕按鈕可以換行 */
  .hero-actions {
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
  }
  
  .btn,
  .get-started-btn,
  .btn-get-started,
  .btn-learn-more {
    width: 100% !important;
    max-width: 280px !important;
    justify-content: center !important;
  }
}

/* ===============================
   特殊修正
   =============================== */

/* 移除不必要的 br 標籤效果 */
@media (min-width: 769px) {
  .hero-title br,
  .hero-subtitle br,
  .hero-description br {
    display: none;
  }
}

/* 金額高亮 */
.highlight-amount {
  color: var(--accent-color, #ffc107);
  font-weight: 700;
  white-space: nowrap !important;
}

/* 遊戲區塊標題修正 */
section h2 {
  font-size: 2rem !important;
  margin-bottom: 1rem !important;
  word-break: keep-all !important;
}

section .description {
  max-width: 800px;
  margin: 0 auto 3rem;
  line-height: 1.8 !important;
}

/* 清除衝突的 text-wrap 類別 */
.chinese-text-wrap {
  word-break: normal !important;
  white-space: normal !important;
  text-wrap: unset !important;
}

/* 確保數字不斷開 */
.number,
.price,
.amount {
  white-space: nowrap !important;
}

/* 列表項目優化 */
ul li,
ol li {
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

/* 表格文字 */
table th,
table td {
  white-space: nowrap;
  padding: 0.75rem;
}

/* 強制修正過長的單字 */
.long-word {
  word-break: break-all !important;
}

/* 修正文字陰影 */
.hero-title,
.brand-highlight {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===============================
   動畫優化
   =============================== */

/* 減少動畫對排版的影響 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* 確保動畫不影響文字 */
[data-aos] {
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-font-smoothing: subpixel-antialiased;
}