/* ============================================================================
   css/v2-honour.css — 每週榮譽榜 V2 全屏 Bento 視圖（PR-V2-06）
   #view-leaderboard 容器與 .open 切換喺 css/v2-shell.css；本檔只負責榜頁
   內部：虎哥頁頭、雙分頁、身份設定、榜單行、晉級章、同學碼與空狀態。
   晉級章漸變沿用 tokens 嘅技能卡金／銀／銅漸變語言。
   ============================================================================ */

.honour-head {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #FFFFFF 0%, var(--brand-mint-soft) 100%);
  border: 1px solid var(--border-soft); border-radius: var(--radius-card);
  box-shadow: var(--shadow-bento); padding: 18px 20px;
}
.honour-head-cat { width: 84px; height: 84px; object-fit: contain; flex-shrink: 0; }
.honour-head-txt p { font-size: 14px; color: var(--text-secondary); line-height: 1.55; }

.honour-card { display: flex; flex-direction: column; gap: 12px; }
.honour-h3 { font-size: 17px; font-weight: 900; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.honour-note { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }

.honour-tabs {
  display: flex; gap: 6px; padding: 5px;
  background: var(--surface-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius-btn); box-shadow: var(--shadow-bento);
}
.honour-tab {
  flex: 1; min-height: 44px; padding: 8px 12px;
  background: transparent; border: none; border-radius: var(--radius-btn);
  color: var(--text-secondary); font: inherit; font-size: 15px; font-weight: 800;
  cursor: pointer; white-space: nowrap;
}
.honour-tab.is-active { background: var(--brand-emerald); color: #fff; }

/* ---------- 身份設定 ---------- */
.honour-input {
  width: 100%; box-sizing: border-box;
  min-height: 48px; padding: 10px 14px;
  border: 1.5px solid var(--border-soft); border-radius: 14px;
  background: var(--surface-subtle); color: var(--text-primary);
  font: inherit; font-size: 16px; font-weight: 700;
}
.honour-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.honour-cat-pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; border: 1.5px solid var(--border-soft); border-radius: 16px;
  background: var(--surface-subtle); cursor: pointer; text-align: center;
  font-size: 13px; font-weight: 800; color: var(--text-primary);
}
.honour-cat-pick img { width: 56px; height: 56px; object-fit: contain; }
.honour-cat-pick input { position: absolute; opacity: 0; pointer-events: none; }
.honour-cat-pick:has(input:checked) { border-color: var(--brand-emerald); background: var(--brand-mint-soft); }

/* ---------- 榜單行 ---------- */
.honour-myrow {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 18px;
  background: var(--brand-mint-soft); border: 1px solid var(--border-soft);
}
.honour-myrow-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.honour-myrow-main strong { font-size: 16.5px; font-weight: 900; color: var(--text-primary); }
.honour-myrow-main span { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }

.honour-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.honour-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 16px;
  background: var(--surface-subtle); border: 1px solid var(--border-soft);
}
.honour-row.is-me { background: var(--brand-mint-soft); border-color: var(--brand-emerald); }
.honour-rank { font-size: 16px; font-weight: 900; color: var(--brand-emerald-dark); min-width: 26px; text-align: center; }
.honour-avatar { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.honour-row-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 800; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.honour-row-pts { font-size: 14.5px; font-weight: 900; color: var(--text-primary); white-space: nowrap; }

/* ---------- 晉級章 ---------- */
.honour-tier {
  font-size: 12px; font-weight: 900; white-space: nowrap;
  padding: 4px 10px; border-radius: 9999px; color: #4a3425;
  border: 1px solid rgba(24, 34, 43, 0.12);
}
.honour-tier.tier-0 { background: var(--card-bronze); }
.honour-tier.tier-1 { background: var(--card-silver); }
.honour-tier.tier-2 { background: var(--card-gold); }
.honour-tier.tier-3 {
  background: linear-gradient(145deg, #FFE9A8 0%, #F2C54C 45%, #FFF6C6 70%, #D9A92F 100%);
  color: #6b4e00; border-color: #D9A92F;
}

/* ---------- 同學私密榜 ---------- */
.honour-code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: 16px;
  background: var(--surface-subtle); border: 1.5px dashed var(--brand-emerald);
}
.honour-code-box span { font-size: 13px; font-weight: 800; color: var(--text-secondary); }
.honour-code-box strong { font-size: 26px; font-weight: 900; letter-spacing: 0.18em; color: var(--brand-emerald-dark); }
.honour-link-row { display: flex; gap: 8px; }
.honour-link-row .honour-input { flex: 1; }
.honour-link-row .btn-warm { white-space: nowrap; }

/* ---------- 空／關閉狀態 ---------- */
.honour-empty {
  text-align: center; padding: 22px 16px;
  border: 1.5px dashed var(--border-soft); border-radius: 16px;
  color: var(--text-primary); font-size: 14.5px; font-weight: 700; line-height: 1.6;
}
.honour-disabled { text-align: center; align-items: center; padding: 34px 24px; }

.honour-rules { margin: 0; padding-left: 20px; font-size: 13.5px; color: var(--text-secondary); line-height: 1.7; }

@media (max-width: 560px) {
  .honour-head-cat { width: 64px; height: 64px; }
  .honour-code-box strong { font-size: 22px; }
  .honour-tier { font-size: 11px; padding: 3px 8px; }
}

/* ============================================================================
   PR-UI-V2-Finish：手機頁頭讓位 68px、儲存掣翡翠膠囊、頭像格尾行置中
   ============================================================================ */
@media (max-width: 1023px) {
  body[data-route="leaderboard"] .v2-view-inner { padding-top: 68px; }
}
#honour-root .btn-warm {
  background: var(--brand-emerald); border: 1px solid var(--brand-emerald); color: #FFFFFF;
  border-radius: 9999px; box-shadow: none; font-weight: 900;
}
.honour-cat-grid { display: flex; flex-wrap: wrap; justify-content: center; }
.honour-cat-pick { flex: 0 1 96px; position: relative; }

/* ============================================================================
   PR-V2-W5-Honour-Polish：榮譽榜整頁封板
   雙分頁立體丸／iPad 真雙欄／金屬段位橫幅＋翡翠晉級帶／獎牌行＋自己行提示／
   本機個人衝分面板／右欄同學 6 位碼挑戰卡
   ============================================================================ */

/* ---------- 雙分頁：選中翡翠漸變、未選立體白丸 ---------- */
.honour-tabs {
  background: transparent; border: none; box-shadow: none; padding: 0; gap: 10px;
}
.honour-tab {
  background: #FFFFFF; color: var(--text-secondary);
  border: 1.5px solid #CBD5E1; border-radius: 9999px;
  box-shadow: 0 3px 0 #CBD5E1, 0 6px 14px rgba(15, 23, 42, 0.07);
  transition: transform 0.13s ease, box-shadow 0.13s ease;
}
.honour-tab:active { transform: translateY(2px); box-shadow: 0 1px 0 #CBD5E1; }
.honour-tab.is-active {
  background: linear-gradient(180deg, #11A37E 0%, #0B8A6A 100%);
  border-color: #0B8A6A; color: #FFFFFF;
  box-shadow: 0 3px 0 #07664E, 0 8px 16px rgba(11, 138, 106, 0.25);
}

/* ---------- 雙欄佈局 ---------- */
.honour-layout { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 820px) {
  .honour-layout {
    display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.85fr);
    gap: 20px; align-items: stretch;
  }
}
.honour-board-card { overflow: visible; }

/* ---------- 金屬段位橫幅 ---------- */
.honour-tier-banner {
  position: relative; display: flex; align-items: center; gap: 12px;
  border-radius: 16px; padding: 14px 104px 14px 16px; min-height: 64px;
  border: 1px solid rgba(24, 34, 43, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 6px 14px -8px rgba(15, 23, 42, 0.18);
  overflow: visible;
}
.honour-tier-banner.tier-0 { background: var(--card-bronze); }
.honour-tier-banner.tier-1 { background: var(--card-silver); }
.honour-tier-banner.tier-2 { background: var(--card-gold); }
.honour-tier-banner.tier-3 {
  background: linear-gradient(145deg, #FFE9A8 0%, #F2C54C 45%, #FFF6C6 70%, #D9A92F 100%);
}
.honour-tier-medal {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; color: #FFFFFF;
  background: radial-gradient(circle at 32% 30%, #FFE9A8 0%, #E9B949 55%, #B97F16 100%);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 3px 8px rgba(146, 100, 10, 0.35), inset 0 -3px 6px rgba(146, 100, 10, 0.35);
  text-shadow: 0 1px 2px rgba(120, 80, 0, 0.45);
}
.honour-tier-banner.tier-0 .honour-tier-medal { background: radial-gradient(circle at 32% 30%, #F6DFCE 0%, #D7A888 55%, #A9713F 100%); }
.honour-tier-banner.tier-1 .honour-tier-medal { background: radial-gradient(circle at 32% 30%, #FFFFFF 0%, #C7DCF2 55%, #8FA9C4 100%); color: #47617C; text-shadow: none; }
.honour-tier-txt { display: flex; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.honour-tier-txt strong { font-size: 19px; font-weight: 900; color: #3D2E1E; letter-spacing: 0.02em; }
.honour-tier-banner.tier-1 .honour-tier-txt strong { color: #2E4257; }
.honour-tier-banner.tier-3 .honour-tier-txt strong { color: #6B4E00; }
.honour-tier-txt span { font-size: 14px; font-weight: 800; color: rgba(61, 46, 30, 0.78); }
.honour-tier-banner.tier-1 .honour-tier-txt span { color: rgba(46, 66, 87, 0.78); }
.honour-tier-cat {
  position: absolute; right: 12px; top: -14px; width: 84px; height: 84px;
  object-fit: contain; pointer-events: none;
  filter: drop-shadow(0 3px 5px rgba(15, 23, 42, 0.18));
}
@media (max-width: 560px) {
  .honour-tier-banner { padding-right: 88px; }
  .honour-tier-cat { width: 70px; height: 70px; top: -10px; }
  .honour-tier-txt strong { font-size: 17px; }
}

/* ---------- 翡翠晉級橫帶 ---------- */
.honour-promo-band {
  background: linear-gradient(180deg, #11A37E 0%, #0B8A6A 100%);
  color: #FFFFFF; text-align: center;
  font-size: 15px; font-weight: 900; letter-spacing: 0.03em;
  border-radius: 12px; padding: 10px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 10px -4px rgba(11, 138, 106, 0.45);
}

/* ---------- 獎牌行＋自己行提示 ---------- */
.honour-medal {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14.5px; font-weight: 900; color: #FFFFFF;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 2px rgba(90, 60, 0, 0.4);
}
.honour-medal.medal-1 { background: radial-gradient(circle at 32% 30%, #FFE9A8 0%, #E9B949 55%, #B97F16 100%); box-shadow: 0 2px 6px rgba(146, 100, 10, 0.35); }
.honour-medal.medal-2 { background: radial-gradient(circle at 32% 30%, #FFFFFF 0%, #C7DCF2 55%, #8FA9C4 100%); color: #47617C; text-shadow: none; box-shadow: 0 2px 6px rgba(90, 110, 130, 0.3); }
.honour-medal.medal-3 { background: radial-gradient(circle at 32% 30%, #F6DFCE 0%, #D7A888 55%, #A9713F 100%); box-shadow: 0 2px 6px rgba(140, 90, 40, 0.32); }
.honour-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex: none; }
.honour-row-hint { font-size: 11.5px; font-weight: 900; color: var(--brand-emerald-dark); white-space: nowrap; }

/* ---------- 本機個人衝分面板 ---------- */
.honour-local-panel { display: flex; flex-direction: column; gap: 12px; }
.honour-cap-row { display: flex; flex-direction: column; gap: 5px; }
.honour-cap-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 800; color: var(--text-secondary); }
.honour-cap-head strong { font-size: 13.5px; font-weight: 900; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.honour-cap-track { height: 10px; border-radius: 999px; background: #E2E8F0; box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.13); overflow: hidden; }
.honour-cap-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #10B981, #0B8A6A); transition: width 0.4s ease; }
.honour-earn-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.honour-earn-card {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--surface-subtle); border: 1px solid var(--border-soft);
  border-radius: 14px; padding: 10px 6px 9px; text-align: center;
}
.honour-earn-card span { font-size: 12px; font-weight: 800; color: var(--text-secondary); line-height: 1.35; }
.honour-earn-card strong { font-size: 16px; font-weight: 900; color: var(--brand-emerald-dark); }
.honour-local-note { font-size: 12px; color: var(--text-secondary); line-height: 1.55; text-align: center; }

/* ---------- 右欄：同學 6 位碼挑戰卡 ---------- */
.honour-code-card { align-items: stretch; text-align: left; }
.honour-code-label { font-size: 13px; font-weight: 800; color: var(--text-secondary); }
.honour-code-big {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(26px, 3.4vw, 40px); font-weight: 900; letter-spacing: 0.14em; text-align: center;
  white-space: nowrap;
  color: var(--brand-emerald-dark);
  background: var(--surface-subtle); border: 1.5px dashed var(--brand-emerald);
  border-radius: 16px; padding: 12px 8px 10px; line-height: 1.15;
}
.honour-code-cats { display: flex; justify-content: center; gap: 10px; }
.honour-code-cat {
  width: 52px; height: 52px; border-radius: 50%; object-fit: contain;
  background: var(--brand-mint-soft); border: 2px solid #FFFFFF;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.13); padding: 3px; box-sizing: border-box;
}
.honour-code-card .v2-btn-primary { width: 100%; font-size: 15px; padding-left: 10px; padding-right: 10px; }
.honour-code-card .honour-link-row .w2-btn-white { white-space: nowrap; min-height: 48px; padding: 10px 16px; font-size: 14.5px; }
.honour-code-card .honour-input { padding-left: 8px; padding-right: 8px; font-size: 14.5px; }
@media (max-width: 560px) { .honour-code-big { font-size: 34px; } }

/* ---------- 複製 Toast ---------- */
.honour-toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 1300;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: #123B31; color: #FFFFFF; font-size: 14px; font-weight: 800;
  padding: 11px 18px; border-radius: 9999px; max-width: 88vw; text-align: center;
  box-shadow: 0 12px 28px rgba(10, 40, 32, 0.35);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.honour-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* PR-A（A-1）：榮譽榜雙欄齊底 — 右欄兌換卡撐滿欄高，備註以 margin-top:auto 貼底分佈 */
@media (min-width: 820px) {
  .honour-code-card .honour-note { margin-top: auto; }
}

/* ============================================================================
   方案 B：全寬「段位晉級路線」卡（雙欄下方 grid-column: 1 / -1）
   ＋右卡底部柔和提示行（取代狀態備註成為貼底元素，收細卡內底部留白）
   ============================================================================ */
.honour-route-card { grid-column: 1 / -1; }
.honour-route { display: flex; align-items: stretch; gap: 4px; }
.honour-route-step {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  text-align: center; padding: 14px 8px 12px;
  border-radius: 16px; border: 1.5px solid var(--border-soft);
  background: var(--surface-subtle);
}
.honour-route-medal {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #FFFFFF;
  background: radial-gradient(circle at 32% 30%, #FFE9A8 0%, #E9B949 55%, #B97F16 100%);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 3px 8px rgba(146, 100, 10, 0.3), inset 0 -3px 6px rgba(146, 100, 10, 0.3);
  text-shadow: 0 1px 2px rgba(120, 80, 0, 0.45);
}
.honour-route-step.tier-0 .honour-route-medal { background: radial-gradient(circle at 32% 30%, #F6DFCE 0%, #D7A888 55%, #A9713F 100%); }
.honour-route-step.tier-1 .honour-route-medal { background: radial-gradient(circle at 32% 30%, #FFFFFF 0%, #C7DCF2 55%, #8FA9C4 100%); color: #47617C; text-shadow: none; }
.honour-route-name { font-size: 15.5px; font-weight: 900; color: var(--text-primary); white-space: nowrap; }
.honour-route-state { font-size: 12px; font-weight: 800; color: var(--text-secondary); white-space: nowrap; }
/* 已達成：沿用段位金屬色調底 */
.honour-route-step.is-done.tier-0 { background: var(--card-bronze); }
.honour-route-step.is-done.tier-1 { background: var(--card-silver); }
.honour-route-step.is-done.tier-2 { background: var(--card-gold); }
.honour-route-step.is-done.tier-3 { background: linear-gradient(145deg, #FFE9A8 0%, #F2C54C 45%, #FFF6C6 70%, #D9A92F 100%); }
/* 目前：薄荷底＋翡翠框高亮 */
.honour-route-step.is-current {
  background: var(--brand-mint-soft); border: 2px solid var(--brand-emerald);
  box-shadow: 0 6px 16px -8px rgba(11, 138, 106, 0.45);
}
.honour-route-step.is-current .honour-route-state { color: var(--brand-emerald-dark); }
/* 未達成：淺灰＋徽章去色 */
.honour-route-step.is-locked { background: #EDF1F5; }
.honour-route-step.is-locked .honour-route-name { color: var(--text-secondary); }
.honour-route-step.is-locked .honour-route-medal { filter: grayscale(1); opacity: 0.5; box-shadow: none; }
.honour-route-arrow {
  flex: none; align-self: center;
  font-size: 22px; font-weight: 900; color: var(--text-secondary); line-height: 1;
}
/* 手機：2×2 緊湊格（4 段位），隱藏箭咀，零橫向溢出 */
@media (max-width: 560px) {
  .honour-route { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .honour-route-arrow { display: none; }
  .honour-route-name { font-size: 14.5px; }
  .honour-route-step { padding: 12px 6px 10px; }
}
/* 右卡底部提示：柔和置中；≥820px 由提示行貼底（狀態備註回到一般流排） */
.honour-code-hint { font-size: 12.5px; text-align: center; }
@media (min-width: 820px) {
  .honour-code-card #honour-link-msg { margin-top: 0; }
  .honour-code-card .honour-code-hint { margin-top: auto; }
}
