/* =========================================================
   麻將遊戲館 主選單樣式
   ========================================================= */

/* ---------- 上方列：返回首頁 + 語言切換 ---------- */
.home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.lang-toggle .globe { font-size: 16px; padding: 0 4px 0 6px; }
.lang-toggle .opt {
  min-width: 34px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  transition: background 0.2s, color 0.2s;
}
.lang-toggle .opt.on { background: var(--gold); color: #3a2a00; }
.lang-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* 切換語言時文字淡入淡出 */
.i18n-fade { transition: opacity 0.15s ease; }
body.switching .i18n-fade { opacity: 0; }

/* ---------- 標題區 ---------- */
.hero { text-align: center; padding-top: 4px; }
.hero-tiles {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 14px;
  --tile-w: 46px;
  --tile-h: 61px;
}
.hero-tiles .mj-tile { animation: tile-in 0.6s ease-out backwards; }
.hero-tiles .mj-tile:nth-child(odd) { transform: rotate(-4deg); }
.hero-tiles .mj-tile:nth-child(even) { transform: rotate(4deg) translateY(4px); }
@keyframes tile-in { from { opacity: 0; transform: translateY(-30px) rotate(0); } }
.hero h1 { font-size: 34px; letter-spacing: 4px; margin-bottom: 4px; }
html[lang="en"] .hero h1 { letter-spacing: 1px; }

/* ---------- 模式卡片 ---------- */
.mode-card {
  position: relative;
  overflow: hidden;
  padding: 20px 18px;
  border: 2px solid rgba(255, 255, 255, 0.15);
}
.mode-card.featured { border-color: rgba(244, 201, 93, 0.6); }
.mode-card .card-icon { width: 64px; height: 64px; font-size: 34px; }
.mode-card .num {
  position: absolute;
  right: 12px;
  top: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 800;
  letter-spacing: 1px;
}
.mode-card h2 { padding-right: 56px; }
.badge-classic { background: #2f6fc4; color: #fff; }
.badge-hot { background: #e0435c; color: #fff; }

/* ---------- 下方：遊戲玩法 ---------- */
.rules {
  margin-top: 34px;
}
.rules > h2 {
  margin: 0 0 4px;
  font-size: 22px;
  text-align: center;
}
.rules > .lead { text-align: center; margin-bottom: 16px; }
/* 折疊橫幅（手風琴）：和上方 MODE 卡片同樣的深綠半透明風格 */
.accordion { display: grid; gap: 12px; }
.acc-item {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--card);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.acc-item.open {
  border-color: rgba(244, 201, 93, 0.55);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.25), 0 0 18px rgba(244, 201, 93, 0.12);
}
.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.acc-head:hover { background: rgba(255, 255, 255, 0.04); }
.acc-head:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.acc-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 20px;
}
.acc-title { flex: 1; }
.acc-arrow {
  flex: none;
  font-size: 13px;
  color: var(--gold);
  transition: transform 0.3s ease;  /* ▼ 旋轉 180° 變成 ▲ */
}
.acc-item.open .acc-arrow { transform: rotate(180deg); }

/* 抽屜式展開：用 grid 列高從 0 變成內容高度，動畫才會流暢 */
.acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}
.acc-item.open .acc-panel { grid-template-rows: 1fr; }
.acc-inner { overflow: hidden; }
.acc-list {
  list-style: none;
  margin: 0;
  padding: 2px 20px 18px 68px;
  font-size: 14px;
  line-height: 1.65;
  color: #e0e0e0;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.acc-item.open .acc-list { opacity: 1; transform: none; transition-delay: 0.08s; }
.acc-list li { position: relative; padding-left: 16px; }
.acc-list li + li { margin-top: 6px; }
.acc-list li::before {           /* 金色小圓點項目符號 */
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}
.acc-list b { color: #ffffff; }
.acc-list .tip {
  display: inline-block;
  padding: 0 7px;
  border-radius: 6px;
  background: rgba(244, 201, 93, 0.18);
  color: var(--gold);
  font-weight: 700;
}
@media (max-width: 380px) {
  .acc-list { padding-left: 20px; }
}

.home-foot {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}
