/* /m/mode-page.css — mobile 模式專屬頁 layout
 * v60-fervent-shaw (2026-05-02)
 * 配合 /mode-page.js + /m/mode.html
 */

/* Back-to-home link inside hero (跟桌機 .mode-page-back 一致, anchor 左上角)
 * v60-fervent-shaw 2026-05-02: 從 topbar 移到 hero 內, 因 topbar 改成
 * 跟首頁同款 (logo + search + music + bell), 沒空間給返回鈕。 */
.dp-mode-back {
  position: absolute;
  top: 12px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  font-size: 13.2px;
  font-weight: 600;
  color: #74f5ff;
  text-decoration: none;
  background: rgba(15, 30, 68, 0.6);
  border: 1px solid rgba(116, 245, 255, 0.4);
  border-radius: 999px;
  transition: background 160ms ease, border-color 160ms ease;
  z-index: 2;
}
.dp-mode-back:hover,
.dp-mode-back:active {
  background: rgba(20, 40, 88, 0.85);
  border-color: rgba(116, 245, 255, 0.65);
}
.dp-mode-back > span:first-child {
  font-size: 16.5px;
  line-height: 1;
}

/* Mode hero header */
.dp-mode-hero {
  position: relative;            /* 給 .dp-mode-back absolute anchor */
  margin: 24px 12px 18px;
  padding: 36px 18px 18px;       /* top padding 加大讓返回鈕不擋 title */
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.18), rgba(15, 30, 68, 0.55));
  border: 1px solid rgba(116, 245, 255, 0.28);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(2, 8, 18, 0.4), inset 0 1px 0 rgba(165, 243, 252, 0.18);
  text-align: center;
}
.dp-mode-hero__title {
  margin: 0 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.dp-mode-hero__title-zh {
  font-size: 28.6px;
  font-weight: 900;
  color: #f0fdff;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6), 0 0 18px rgba(34, 211, 238, 0.45);
}
.dp-mode-hero__title-en {
  font-size: 12.1px;
  font-weight: 700;
  color: #74f5ff;
  letter-spacing: 0.32em;
  opacity: 0.85;
}
.dp-mode-hero__desc {
  margin: 8px 0 6px;
  font-size: 14.3px;
  font-weight: 500;
  color: rgba(240, 253, 255, 0.82);
  line-height: 1.55;
}
.dp-mode-hero__count {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 12px;
  font-size: 12.1px;
  font-weight: 700;
  color: #052e16;
  background: linear-gradient(135deg, #67e8f9 0%, #22d3ee 100%);
  border-radius: 999px;
  letter-spacing: 0.04em;
}

/* 進入遊戲 CTA (tower / rpg only) — mobile variant */
.dp-mode-hero__cta {
  margin-top: 14px;
}
.dp-mode-hero__cta .mode-game-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  font-size: 15.4px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #1b0f42;
  text-decoration: none;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #fbbf24 100%);
  background-size: 200% 100%;
  background-position: 0% 50%;
  border: 2px solid rgba(251, 191, 36, 0.85);
  border-radius: 999px;
  box-shadow:
    0 6px 18px rgba(251, 191, 36, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  transition: transform 200ms ease, background-position 380ms ease;
}
.dp-mode-hero__cta .mode-game-cta:active {
  transform: scale(0.97);
  background-position: 100% 50%;
}

/* Empty state */
.dp-mode-empty {
  margin: 32px 16px;
  padding: 32px 16px;
  text-align: center;
  font-size: 15.4px;
  color: rgba(240, 253, 255, 0.6);
  background: rgba(15, 30, 68, 0.4);
  border: 1px dashed rgba(116, 245, 255, 0.28);
  border-radius: 14px;
}

/* ============================================================
 * v60-fervent-shaw Phase 1 (2026-05-02): 4 mode tabs + chips only
 * 移除 mode-search (跟頂部 dp-search 重複混亂用戶)
 * 移除 7 orbs (語意混亂混了 mode 切換 + 離站連結)
 * ============================================================ */

/* Phase 5 (2026-05-04 mtab-cinemagraph-v3): mobile mode tabs 從方框 pill 改成
   跟首頁同款 cinemagraph orb (vertical orb + label)。
   - 4 顆 orb 全用 h5.home.mode.* slot 跟首頁共用
   - cinemagraph 動畫只給 .is-active (避免 4 顆都動 = noise + Android fps)
   - 沒有 pill 方框包住 (用戶 feedback「完全被方框包住的」修正) */
.dp-mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 0 12px;
  margin: 0 0 14px;
}
.dp-mode-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 2px 4px;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: rgba(240, 253, 255, 0.78);
  text-decoration: none;
  text-align: center;
  letter-spacing: 0.04em;
  transition: transform 200ms ease, color 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.dp-mode-tab__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: transparent;
  border: none;
  box-shadow: none;
  isolation: isolate;
}
.dp-mode-tab__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  clip-path: circle(50% at 50% 50%);
  -webkit-clip-path: circle(50% at 50% 50%);
  filter:
    drop-shadow(0 3px 6px rgba(2, 8, 18, 0.5))
    drop-shadow(0 0 6px rgba(34, 211, 238, 0.32));
  transition: filter 240ms ease;
}
.dp-mode-tab__name {
  display: block;
  font-size: 12.1px;
  font-weight: 700;
  line-height: 1.2;
}
.dp-mode-tab:active {
  transform: scale(0.95);
}
.dp-mode-tab.is-active {
  color: #f0fdff;
}
.dp-mode-tab.is-active .dp-mode-tab__name {
  color: #74f5ff;
  text-shadow: 0 0 8px rgba(116, 245, 255, 0.5);
}
.dp-mode-tab.is-active .dp-mode-tab__icon img {
  animation: dp-mode-tab-orb-life 5.2s ease-in-out infinite;
  will-change: transform, filter;
}
@keyframes dp-mode-tab-orb-life {
  0%, 100% {
    transform: rotate(-2deg) scale(1);
    filter:
      drop-shadow(0 4px 8px rgba(2, 8, 18, 0.5))
      drop-shadow(0 0 10px rgba(34, 211, 238, 0.55))
      saturate(1.05) brightness(1) hue-rotate(-6deg);
  }
  50% {
    transform: rotate(2deg) scale(1.05);
    filter:
      drop-shadow(0 6px 12px rgba(2, 8, 18, 0.55))
      drop-shadow(0 0 16px rgba(34, 211, 238, 0.78))
      drop-shadow(0 0 5px rgba(167, 139, 250, 0.32))
      saturate(1.12) brightness(1.06) hue-rotate(6deg);
  }
}
.dp-mode-tab.is-active .dp-mode-tab__icon::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(34, 211, 238, 0.28) 0%,
    rgba(34, 211, 238, 0.12) 38%,
    transparent 68%
  );
  filter: blur(4px);
  animation: dp-mode-tab-breathe 2.4s ease-in-out infinite;
  z-index: -1;
}
@keyframes dp-mode-tab-breathe {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50%      { transform: scale(1.12); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .dp-mode-tab.is-active .dp-mode-tab__icon img,
  .dp-mode-tab.is-active .dp-mode-tab__icon::before {
    animation: none !important;
  }
}

/* Filters (only chips now, no search input)
   v5b: owner mandate「分類 跟 全部 IP 這些東西啊 它們底下好像還有一層東西
   包住他們全部人的方框 隱藏看看」— 拿掉 wrapper bg/border/border-radius，
   讓 chips 直接落在 page bg，視覺乾淨無重疊。padding 留供 chips 不貼邊。 */
.dp-mode-filters {
  display: flex;
  padding: 6px 14px;
  margin: 8px 0;
}

/* Mobile chips: horizontal scroll (避免擠) */
.dp-mode-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px;
  margin: 0 -4px;
}
.dp-mode-chips::-webkit-scrollbar { display: none; }
/* tower/rpg 模式 chip ≤ 1 個時 JS 設 [hidden]; 必加 !important 壓過 display:flex */
.dp-mode-chips[hidden] { display: none !important; }

/* v7 (mtab-cinemagraph-v8): chip + group 套用管理員 iconKey → tone color
   --tone-stroke / --tone-soft / --tone-glow 由 mode-page.js 注入到 chip
   element 跟 group section element 上 (style attribute)。
   Owner mandate「完全依照管理員設置的顏色跟排序等級」 */
.mode-page-chip {
  /* v9 fix: 加粗 border + 提高 alpha + inset 微光，admin tone 更明顯 */
  --tone-stroke: #67e8f9;
  --tone-soft: rgba(103, 232, 249, 0.32);
  --tone-glow: rgba(103, 232, 249, 0.55);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 13.2px;
  font-weight: 700;
  color: rgba(240, 253, 255, 0.9);
  background: rgba(15, 30, 68, 0.6);
  border: 1.5px solid var(--tone-soft);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  cursor: pointer;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  -webkit-tap-highlight-color: transparent;
}
.mode-page-chip:hover,
.mode-page-chip:active {
  border-color: var(--tone-stroke);
}
.mode-page-chip em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  background: var(--tone-soft);
  color: var(--tone-stroke);
  border-radius: 999px;
  min-width: 16px;
  text-align: center;
}
.mode-page-chip.is-active {
  background: linear-gradient(135deg, var(--tone-stroke) 0%, color-mix(in srgb, var(--tone-stroke), #0b1223 25%) 100%);
  border-color: rgba(255, 255, 255, 0.78);
  color: #0b1223;
  box-shadow: 0 4px 14px var(--tone-glow);
}
.mode-page-chip.is-active em {
  background: rgba(11, 18, 35, 0.22);
  color: #0b1223;
}

/* Mobile group header */
.mode-page-group {
  --tone-stroke: #67e8f9;
  --tone-soft: rgba(103, 232, 249, 0.18);
  --tone-glow: rgba(103, 232, 249, 0.45);
  margin: 0 0 22px;
}
.mode-page-group__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--tone-soft);
}
.mode-page-group__head::before {
  content: '';
  flex-shrink: 0;
  display: inline-block;
  width: 3px;
  height: 18px;
  background: linear-gradient(180deg, var(--tone-stroke), color-mix(in srgb, var(--tone-stroke), #0b1223 35%));
  border-radius: 2px;
  box-shadow: 0 0 8px var(--tone-glow);
}
.mode-page-group__name {
  margin: 0;
  font-size: 17.6px;
  font-weight: 800;
  color: #f0fdff;
  letter-spacing: 0.02em;
  flex: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.mode-page-group__count {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  color: #0b1223;
  background: linear-gradient(135deg, var(--tone-stroke) 0%, color-mix(in srgb, var(--tone-stroke), #0b1223 25%) 100%);
  border-radius: 999px;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px var(--tone-glow);
}

/* ============================================================
 * Phase 2 (2026-05-02): mobile pool card 加血肉
 * ============================================================ */

/* Card badges (top-right stack) */
.dp-card__badges {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 2;
  pointer-events: none;
}
.dp-card__badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}
.dp-card__badge--new {
  background: linear-gradient(135deg, #67e8f9 0%, #06b6d4 100%);
  color: #052e16;
}
.dp-card__badge--hot {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #4a1a05;
}
.dp-card__badge--low {
  background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
  color: #fff;
}
/* v20b: 多箱系列 indicator — owner audit「我一番賞裡面不是有很多個箱子嗎」 */
.dp-card__badge--box {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* Sold out veil */
.dp-card__veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 8, 18, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 3;
}
.dp-card__veil-text {
  display: inline-block;
  padding: 6px 18px;
  font-size: 17.6px;
  font-weight: 900;
  color: #f0fdff;
  letter-spacing: 0.16em;
  background: rgba(220, 38, 38, 0.85);
  border: 2px solid rgba(254, 226, 226, 0.55);
  border-radius: 5px;
  transform: rotate(-8deg);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}

/* Meta row (stock + progress) */
.dp-card__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 2px 0 4px;
}
.dp-card__meta {
  font-size: 12.1px;
  font-weight: 600;
  color: rgba(240, 253, 255, 0.7);
}
.dp-card__progress {
  font-size: 11px;
  font-weight: 700;
  color: rgba(116, 245, 255, 0.9);
  white-space: nowrap;
}

/* v19 UX: 視覺化 progress bar — 取代純文字「已售 X%」加緊張感 */
.dp-card__bar {
  position: relative;
  display: block;
  width: 100%;
  height: 5px;
  margin: 4px 0 4px;
  background: linear-gradient(90deg, rgba(8, 18, 42, 0.85), rgba(15, 30, 68, 0.85));
  border: 1px solid rgba(116, 245, 255, 0.18);
  border-radius: 999px;
  overflow: hidden;
}
.dp-card__bar__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 0 6px currentColor, inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.dp-card__bar[data-tone="fresh"] .dp-card__bar__fill {
  background: linear-gradient(90deg, #22d3ee, #67e8f9);
  color: rgba(34, 211, 238, 0.4);
}
.dp-card__bar[data-tone="normal"] .dp-card__bar__fill {
  background: linear-gradient(90deg, #22d3ee, #a5f3fc);
  color: rgba(34, 211, 238, 0.55);
}
.dp-card__bar[data-tone="warm"] .dp-card__bar__fill {
  background: linear-gradient(90deg, #fbbf24, #fcd34d);
  color: rgba(251, 191, 36, 0.55);
}
.dp-card__bar[data-tone="critical"] .dp-card__bar__fill {
  background: linear-gradient(90deg, #f87171, #fb7185, #fbbf24);
  color: rgba(248, 113, 113, 0.65);
  animation: dp-card-bar-pulse 1.6s ease-in-out infinite;
}
@keyframes dp-card-bar-pulse {
  0%, 100% { box-shadow: 0 0 6px currentColor, inset 0 1px 0 rgba(255, 255, 255, 0.25); }
  50%      { box-shadow: 0 0 12px currentColor, inset 0 1px 0 rgba(255, 255, 255, 0.4); }
}
@media (prefers-reduced-motion: reduce) {
  .dp-card__bar__fill { transition: none; animation: none !important; }
}

/* Skeleton shimmer (mobile) */
.dp-card-skeleton {
  height: 200px;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    rgba(15, 30, 68, 0.5) 0%,
    rgba(34, 211, 238, 0.2) 50%,
    rgba(15, 30, 68, 0.5) 100%
  );
  background-size: 200% 100%;
  animation: dp-skeleton-shimmer 1.6s ease-in-out infinite;
  border: 1px solid rgba(116, 245, 255, 0.18);
}
@keyframes dp-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Error state with retry button (mobile, 沿用 desktop class .mode-page-error*
   讓 mode-page.js 不必分 mobile/desktop 兩套 markup) */
.dp-mode-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 24px 16px;
  padding: 28px 20px;
  text-align: center;
  font-size: 14.3px;
  color: rgba(240, 253, 255, 0.65);
  background: rgba(15, 30, 68, 0.45);
  border: 1px dashed rgba(116, 245, 255, 0.28);
  border-radius: 14px;
}
.dp-mode-empty .mode-page-error__icon {
  font-size: 33px;
  line-height: 1;
  display: block;
}
.dp-mode-empty .mode-page-error__text {
  margin: 0 0 4px;
  font-size: 14.3px;
  color: rgba(240, 253, 255, 0.8);
}
.dp-mode-empty .mode-page-retry {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 22px;
  font-size: 14.3px;
  font-weight: 800;
  color: #052e16;
  background: linear-gradient(135deg, #67e8f9 0%, #22d3ee 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.4);
  -webkit-tap-highlight-color: transparent;
}
.dp-mode-empty .mode-page-retry:active { transform: scale(0.96); }

/* ============================================================
 * Phase 3 (2026-05-02): polish — sticky chips + sort dropdown
 *  + empty state icon + prefers-reduced-motion 支援
 * ============================================================ */

/* Sticky filter bar (chips + sort) — top: 58px 因 mobile topbar (.dp-top) 也是
   sticky top:0 height ~58px, chips 必須 stick 在 topbar 下方避免遮擋
   v5 (mtab-cinemagraph-v5): owner feedback「分類分組好像有點檔到分爛的框框」
   chips overflow-x scroll 跟 sort dropdown 共用同一橫排，右邊 chips 滑出去
   會被 sort 視覺擋住。改成 column stack — chips 自己一排全寬，sort 第二排右靠。 */
.dp-mode-filters {
  position: sticky;
  top: 58px;
  z-index: 6;
  display: flex;
  /* v7 (mtab-cinemagraph-v7): owner mandate「分類分組 我希望出現在 全部 IP
     火影忍者這些分類的右上角 現在是在右下角」— column-reverse 把 sort 推到
     top, chips 在 bottom。視覺上 sort 出現在 chips 之上 (右上角)。
     另外拿掉 backdrop-filter:blur(8px)，「下方變成模糊我覺得也愧」修正。 */
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 6px;
  padding: 6px 0 4px;
}
.dp-mode-chips {
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
  /* v7: 右邊 fade-out mask 暗示 chips 還可以往右滑看到更多分類
     (owner: 「分類那邊 如果他可以繼續往右滑動 有一會看得到其他分類 提示一下」)
     mask 在最後 ~32px 漸層淡出, chips 不超出時 last chip 顯示完整、超出時
     最後一個 chip 邊緣自然 fade → user 視覺感知還有東西可以滑。 */
  mask-image: linear-gradient(to right, black calc(100% - 32px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 32px), transparent 100%);
}

/* Sort dropdown (native <select> 客製化) */
.dp-mode-sort {
  flex: 0 0 auto;
  align-self: flex-end;  /* v5: chips 改全寬一排，sort 第二排右側獨立放 */
  margin-left: auto;
  height: 32px;
  padding: 0 26px 0 12px;
  font-size: 13.2px;
  font-weight: 700;
  color: #f0fdff;
  background-color: rgba(10, 22, 51, 0.78);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%2374f5ff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='1 1 5 5 9 1'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  border: 1px solid rgba(116, 245, 255, 0.32);
  border-radius: 999px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  letter-spacing: 0.04em;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.dp-mode-sort:focus {
  border-color: rgba(116, 245, 255, 0.7);
}
.dp-mode-sort option {
  background: #0a1633;
  color: #f0fdff;
}

/* prefers-reduced-motion: 關掉 skeleton shimmer + 減 hover transform */
@media (prefers-reduced-motion: reduce) {
  .dp-card-skeleton {
    animation: none;
    background: rgba(15, 30, 68, 0.45);
  }
  .dp-card,
  .dp-mode-tab,
  .mode-page-retry {
    transition: none;
  }
}

/* Phase 3 hotfix (2026-05-02): .dp-mode-empty 預設 display:flex 蓋過 UA
 * [hidden]:display:none, 必加 !important 才能正確隱藏 */
.dp-mode-empty[hidden] { display: none !important; }

/* ============================================================
 * Phase 4 (2026-05-02): Tier 預覽 + Pull-to-refresh (mobile only)
 * ============================================================ */

/* Tier 預覽 (mobile compact 版) */
.dp-card__tiers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 4px;
  margin: 3px 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.dp-card__tiers__icon {
  font-size: 13.2px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}
/* v18 (2026-05-05 specificity-fix): fallback selector 加 :not([data-glow-color])
   讓它只套用沒設 glow 的 chip。原本 (0,3,1) 會贏 glow rule (0,2,1) 導致全 gold。 */
.dp-card__tiers > span:not(.dp-card__tiers__more):not(.dp-card__tiers__icon):not([data-glow-color]) {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  padding: 1px 6px;
  color: rgba(255, 215, 110, 0.95);
  background: rgba(15, 30, 68, 0.6);
  border: 1px solid rgba(255, 215, 110, 0.3);
  border-radius: 999px;
  white-space: nowrap;
}
/* v18: glow chip 共用 layout (沒被上面 fallback cover) */
.dp-card__tiers > span[data-glow-color] {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid;
}
.dp-card__tiers em {
  font-style: normal;
  color: rgba(116, 245, 255, 0.95);
  font-weight: 800;
}
.dp-card__tiers__more {
  font-size: 9.9px;
  color: rgba(240, 253, 255, 0.55);
  font-weight: 600;
}

/* v15 (2026-05-04 owner audit): mobile pool card tier chip glow color (admin) */
.dp-card__tiers > span[data-glow-color="gold"] {
  color: #fbbf24; border-color: rgba(251, 191, 36, 0.55); background: rgba(251, 191, 36, 0.1);
}
.dp-card__tiers > span[data-glow-color="red"] {
  color: #f87171; border-color: rgba(239, 68, 68, 0.55); background: rgba(239, 68, 68, 0.1);
}
.dp-card__tiers > span[data-glow-color="purple"] {
  color: #c4b0ff; border-color: rgba(168, 85, 247, 0.55); background: rgba(168, 85, 247, 0.1);
}
.dp-card__tiers > span[data-glow-color="blue"] {
  color: #93c5fd; border-color: rgba(59, 130, 246, 0.55); background: rgba(59, 130, 246, 0.1);
}
.dp-card__tiers > span[data-glow-color="white"] {
  color: #f3f4f6; border-color: rgba(230, 235, 255, 0.55); background: rgba(230, 235, 255, 0.06);
}
.dp-card__tiers > span[data-glow-color="pink"] {
  color: #f9a8d4; border-color: rgba(244, 114, 182, 0.55); background: rgba(244, 114, 182, 0.1);
}
.dp-card__tiers > span[data-glow-color="orange"] {
  color: #fdba74; border-color: rgba(249, 115, 22, 0.55); background: rgba(249, 115, 22, 0.1);
}
.dp-card__tiers > span[data-glow-color="cyan"] {
  color: #67e8f9; border-color: rgba(34, 211, 238, 0.55); background: rgba(34, 211, 238, 0.1);
}
.dp-card__tiers > span[data-glow-color="green"] {
  color: #86efac; border-color: rgba(34, 197, 94, 0.55); background: rgba(34, 197, 94, 0.1);
}
.dp-card__tiers > span[data-glow-color] em {
  color: inherit;
  opacity: 0.85;
}

/* Pull-to-refresh indicator */
.dp-mode-ptr {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, 0);
  margin-top: -50px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.95), rgba(15, 30, 68, 0.95));
  border: 1px solid rgba(116, 245, 255, 0.6);
  border-radius: 999px;
  color: #f0fdff;
  font-size: 13.2px;
  font-weight: 800;
  letter-spacing: 0.04em;
  pointer-events: none;
  opacity: 0;
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.3, 1), opacity 200ms ease;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.45);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.dp-mode-ptr__icon {
  display: inline-block;
  font-size: 15.4px;
  transition: transform 220ms ease;
}
.dp-mode-ptr[data-state="ready"] .dp-mode-ptr__icon {
  transform: rotate(180deg);
}
.dp-mode-ptr[data-state="refreshing"] .dp-mode-ptr__icon {
  animation: dp-mode-ptr-spin 0.8s linear infinite;
}
@keyframes dp-mode-ptr-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .dp-mode-ptr,
  .dp-mode-ptr__icon { transition: none; }
  .dp-mode-ptr[data-state="refreshing"] .dp-mode-ptr__icon { animation: none; }
}

/* ──────────────────────────────────────────────────────────
   v19 UX (2026-05-05): mobile MORE 介面深度優化
   - card :active touch lift (mobile 對應 desktop :hover)
   - 售完卡 diagonal stripe + grayscale + dim
   - filters 黏在 topbar 下 (sticky position)
   - tier overflow chip cursor:help + dashed underline
   ────────────────────────────────────────────────────────── */

/* Mobile :active 觸碰反饋 — 沒 hover 但有 tap */
.dp-card {
  transition: transform 200ms cubic-bezier(0.2, 0.9, 0.3, 1),
              box-shadow 200ms ease,
              border-color 200ms ease;
}
.dp-card:active:not(.dp-card--soldout) {
  transform: scale(0.98);
  border-color: rgba(116, 245, 255, 0.5);
  box-shadow: 0 4px 14px rgba(34, 211, 238, 0.32);
}
.dp-card:focus-visible {
  outline: 2px solid rgba(116, 245, 255, 0.85);
  outline-offset: 3px;
  border-radius: 12px;
}

/* Sold-out 強化 */
.dp-card--soldout {
  filter: grayscale(0.7) brightness(0.65);
  opacity: 0.78;
}
.dp-card--soldout:active { transform: none; }
.dp-card--soldout::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(248, 113, 113, 0.05),
    rgba(248, 113, 113, 0.05) 6px,
    rgba(248, 113, 113, 0.12) 6px,
    rgba(248, 113, 113, 0.12) 12px
  );
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}
.dp-card--soldout .dp-card__veil {
  background: linear-gradient(135deg, rgba(8, 18, 42, 0.78), rgba(248, 113, 113, 0.42));
  backdrop-filter: blur(2px);
}
.dp-card--soldout .dp-card__veil-text {
  letter-spacing: 0.16em;
  font-weight: 900;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

/* v19b BUG FIX: mobile filter bar 不蓋 Phase 7 既有 sticky (top:58px z:6) +
   不重新加 backdrop-filter blur (user 早期 reject「下方變成模糊我覺得也愧」)
   只在 .is-stuck 加微 shadow 提示已 sticky, 視覺對齊 Phase 7 設計 */
.dp-mode-filters.is-stuck {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.32);
}

/* Tier overflow "等 N 級" 提示可看更多 */
.dp-card__tiers__more {
  cursor: help;
  border-bottom: 1px dashed rgba(240, 253, 255, 0.35);
}

/* v19 UX: Back-to-top floating button (mobile variant) */
.dp-mode-totop {
  position: fixed;
  bottom: 96px;  /* 避開 mobile tabbar (~80px) */
  right: 14px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(116, 245, 255, 0.5);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.95), rgba(15, 30, 68, 0.95));
  color: #f0fdff;
  font-size: 19.8px;
  font-weight: 800;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 6px 18px rgba(34, 211, 238, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
  -webkit-tap-highlight-color: transparent;
}
.dp-mode-totop.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.dp-mode-totop:active {
  transform: scale(0.92);
}
.dp-mode-totop:focus-visible {
  outline: 2px solid rgba(116, 245, 255, 1);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .dp-mode-totop { transition: opacity 200ms ease; }
}

/* v20e: 多箱系列改用「整套剩 N / N」前綴 (取代「跨 N 箱」抽象 suffix)。
   .dp-card__meta-cross 不再使用, 保留 selector 防 SSR 殘留, 隱藏即可 */
.dp-card__meta-cross { display: none; }

/* v20h owner audit「之前不是有一版本要把 MORE 改成三個欄位一行 現在怎麼又
   變成兩個欄位了」: arcade.css line 794 的 3-col rule 沒生效原因不明 (可能
   被某 cascade 蓋掉), 這裡用 mode-page-group 子層 + !important 強制 3-col。
   只 affect mode page (group container), 不影響其他頁的 .dp-grid。 */
.mode-page-group .dp-grid,
.dp-section--marine #modeGroups .dp-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px;
}

/* v20k owner audit「首頁卡片不是會有玻璃閃光」: 把首頁 dp-ichi-hero__card 的
   對角 sweep 光效套到 MORE 頁卡片 (.dp-card / .mode-page-card)。
   - linear-gradient 對角白光
   - background-position 從 -120% → 220% 動畫
   - mix-blend-mode: screen 加亮不蓋黑
   - 只在 .dp-card__media 範圍內 sweep (商品圖那塊), 不蓋到 body 文字
   - reduced-motion 拿掉動畫
*/
.dp-card .dp-card__media::after {
  /* v20t: user「我要的不是他不再 而是他不該循環那麼快」— 重新打開 sweep,
     但用更慢 60s 間隔 + JS-sync 全卡同步。CSS 預設 animation:none 等
     body.is-card-sweeping 觸發。 */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: linear-gradient(
    115deg,
    transparent 28%,
    rgba(255, 255, 255, 0.08) 46%,
    rgba(180, 240, 255, 0.05) 49%,
    rgba(255, 255, 255, 0.08) 52%,
    transparent 70%
  );
  background-size: 220% 100%;
  background-position: -120% 0;
  mix-blend-mode: screen;
  /* v20o user audit「玻璃特效還是一直閃」: 之前 CSS infinite animation 每張
     卡有獨立 timeline (DOM render 時間不同 → 各卡 phase shift), 13 張卡
     在不同時刻 sweep 看起來「一直閃」。改成 JS-driven sync:
     - 預設 NO animation (gradient 停在 220% 看不到)
     - body.is-card-sweeping 時觸發單次 1.5s sweep
     - JS setInterval 每 20s 全頁 toggle class 一次 → 所有卡同時亮
     - 全部卡硬同步, 視覺平靜 */
  animation: none;
  background-position: 220% 0;
}
body.is-card-sweeping .dp-card .dp-card__media::after {
  /* v20r: 1.5s → 1.2s sweep, 配合 JS 30s interval 用戶幾乎感覺不到閃 */
  animation: dp-card-sweep 1.2s ease-in-out 1 forwards;
}
@keyframes dp-card-sweep {
  0%   { background-position: -120% 0; }
  100% { background-position: 220% 0; }
}
/* sold-out 不 sweep (對比效果遮住灰階卡反而干擾) */
.dp-card.dp-card--soldout .dp-card__media::after {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .dp-card .dp-card__media::after { animation: none; }
}

/* R501z Phase 2.2.3 recursing-edison (2026-05-27): admin tagBadges overlay on
   /m/mode?type=X 分類頁 cards. owner report「mode?type=lord 還是看不到標籤」.
   .dp-card__media 已有 position:relative (cards 預設), .pool-tag-list 直接 anchor.
   SENTINEL: r501z-mode-page-pool-tag-css-mobile */
.dp-card__media { position: relative; }
.dp-card__media .pool-tag-list {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  max-height: calc(100% - 16px);
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-content: flex-start;
  pointer-events: none;
  z-index: 3;
}
.dp-card__media .pool-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}
.dp-card__media .pool-tag-chip__icon { font-size: 11.5px; line-height: 1; }
.dp-card__media .pool-tag-chip__text { line-height: 1.2; }
