/* 克制干净 + 新素材接入 */

/* 屏背景 */
.screen-has-bg {
  position: relative;
}
.screen-bg-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
}
.screen-has-bg > .content-shell {
  position: relative;
  z-index: 1;
}
.map-bg {
  background-image:
    linear-gradient(180deg, rgba(7,9,13,0.72), rgba(7,9,13,0.88)),
    url('../assets/ui/map_bg.jpg');
}
.shop-bg {
  background-image:
    linear-gradient(180deg, rgba(7,9,13,0.75), rgba(7,9,13,0.9)),
    url('../assets/ui/shop_bg.jpg');
}
.result-bg {
  background-image:
    linear-gradient(180deg, rgba(7,9,13,0.7), rgba(7,9,13,0.92)),
    url('../assets/ui/result_bg.jpg');
}
.char-bg {
  background-image:
    linear-gradient(180deg, rgba(7,9,13,0.78), rgba(7,9,13,0.9)),
    url('../assets/ui/char_bg.jpg');
}
.mode-bg {
  background-image:
    linear-gradient(180deg, rgba(7,9,13,0.78), rgba(7,9,13,0.9)),
    url('../assets/ui/mode_bg.jpg');
}
.help-bg {
  background-image:
    linear-gradient(180deg, rgba(7,9,13,0.78), rgba(7,9,13,0.92)),
    url('../assets/ui/help_bg.jpg');
}
.codex-bg {
  background-image:
    linear-gradient(180deg, rgba(7,9,13,0.78), rgba(7,9,13,0.92)),
    url('../assets/ui/codex_bg.jpg');
}

/* ===== 奇牌图鉴 ===== */
.codex-shell {
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 0;
  padding-bottom: 16px !important;
}
.codex-head {
  flex-shrink: 0;
  margin-bottom: 12px !important;
}
.codex-toolbar {
  flex-shrink: 0;
  margin-bottom: 12px;
}
.codex-progress {
  margin: 0 0 10px;
}
.codex-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-bottom: 8px;
}
.codex-progress-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #3a6ea5, #d4af37);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.codex-rarity-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--muted, #9aa4b2);
}
.codex-stat {
  color: var(--rc, #a0aec0);
}
.codex-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.codex-tab {
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(12, 16, 24, 0.55);
  color: var(--muted, #9aa4b2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.codex-tab:hover {
  border-color: rgba(212, 175, 55, 0.55);
  color: var(--text, #e8ecf1);
}
.codex-tab.active {
  border-color: var(--gold, #d4af37);
  color: var(--gold-light, #f0d78c);
  background: rgba(212, 175, 55, 0.12);
}

/* 可滚动区域：保证网格完整可见 */
.codex-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 6px 20px 2px;
  margin-right: -4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.35) transparent;
}

/* 竖版卡面网格：完整显示框 + 文案 */
.codex-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)) !important;
  gap: 14px !important;
  overflow: visible !important;
  align-content: start;
  flex: none !important;
}

.codex-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0 !important;
  text-align: left;
  cursor: pointer;
  padding: 0 !important;
  overflow: visible !important;
  background: rgba(8, 10, 16, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  min-height: 0;
}
.codex-card:hover {
  border-color: rgba(212, 175, 55, 0.5) !important;
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.38);
}
.codex-card:focus-visible {
  outline: 2px solid rgba(212, 175, 55, 0.65);
  outline-offset: 2px;
}

/* 上半：完整卡框画幅 */
.codex-card-art {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  background: #0a0c12;
  flex-shrink: 0;
}
.codex-card-frame {
  position: absolute;
  inset: 0;
  width: 100% !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  background-size: cover;
  background-position: center;
  border: none !important;
  opacity: 0.95;
}
.codex-card-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 56% !important;
  height: auto !important;
  aspect-ratio: 1;
  max-width: 96px;
  max-height: 96px;
  border-radius: 14px !important;
  background-size: cover;
  background-position: center;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(212, 175, 55, 0.35);
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  z-index: 1;
}
.codex-rarity-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  font-size: 10px;
  letter-spacing: 1px;
  border: 1px solid;
  border-radius: 999px;
  padding: 2px 8px;
  backdrop-filter: blur(6px);
  font-weight: 700;
}
.codex-card.locked .codex-card-icon {
  filter: grayscale(0.85) brightness(0.65);
}
.codex-card.locked .codex-card-frame {
  filter: grayscale(0.5) brightness(0.75);
}
.codex-card.locked {
  opacity: 0.72 !important;
  filter: none !important;
}

/* 下半：文案完整可读 */
.codex-card-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 11px 12px;
}
.codex-card-name {
  font-family: var(--display, serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.25;
  word-break: break-word;
}
.codex-card-desc {
  font-size: 12px !important;
  color: var(--muted, #9aa4b2) !important;
  line-height: 1.5 !important;
  /* 显示多行完整摘要，不硬裁切到看不见 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  min-height: 4.5em;
  flex: 1;
}
.codex-card-foot {
  font-size: 11px;
  color: var(--gold-dim, #a68b2c);
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.codex-card.seen .codex-card-foot { color: #3dcf9a; }
.codex-card.rarity-legend { border-color: rgba(237, 137, 54, 0.4) !important; }
.codex-card.rarity-cursed { border-color: rgba(229, 62, 62, 0.4) !important; }
.codex-card.rarity-rare { border-color: rgba(66, 153, 225, 0.35) !important; }
.codex-card.rarity-common { border-color: rgba(160, 174, 192, 0.25) !important; }

/* 图鉴详情弹层 */
.codex-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 920;
  background: rgba(0, 0, 0, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
  padding: 20px;
}
.codex-detail-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.codex-detail-card {
  width: min(420px, 96vw);
  max-height: min(90vh, 720px);
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(14, 18, 26, 0.98), rgba(10, 12, 18, 0.99));
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 18px;
  padding: 22px 20px 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  text-align: center;
}
.codex-detail-visual {
  position: relative;
  width: min(200px, 56vw);
  aspect-ratio: 3 / 4;
  margin: 0 auto 16px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  background: #0a0c12;
}
.codex-detail-frame {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.codex-detail-art {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58%;
  aspect-ratio: 1;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  border: 2px solid rgba(212, 175, 55, 0.5);
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.2);
  margin: 0;
}
.codex-detail-art.locked {
  filter: grayscale(0.7) brightness(0.7);
}
.codex-detail-rarity {
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.codex-detail-name {
  font-family: var(--display, inherit);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--gold-light, #f0d78c);
  word-break: break-word;
}
.codex-detail-desc {
  font-size: 14px;
  color: var(--muted, #9aa4b2);
  line-height: 1.65;
  margin-bottom: 12px;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}
.codex-detail-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 12px;
  color: var(--gold-dim, #a68b2c);
  margin-bottom: 16px;
}

@media (max-width: 780px) {
  .codex-grid {
    grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)) !important;
    gap: 10px !important;
  }
  .codex-card-desc {
    -webkit-line-clamp: 3;
    line-clamp: 3;
    min-height: 3.4em;
  }
}

/* 选牌/构筑中的奇牌图标 */
.qipai-pick-icon {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  margin-bottom: 8px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.qipai-shop-thumb {
  border-radius: 10px !important;
  background-size: cover !important;
}
.build-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.build-qipai-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 1px solid rgba(212, 175, 55, 0.3);
}
.build-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.rank-bg {
  background-image:
    linear-gradient(180deg, rgba(7,9,13,0.78), rgba(7,9,13,0.92)),
    url('../assets/ui/rank_bg.jpg');
}
.meta-bg {
  background-image:
    linear-gradient(180deg, rgba(7,9,13,0.78), rgba(7,9,13,0.92)),
    url('../assets/ui/meta_bg.jpg');
}

/* ===== 阅历阁 ===== */
.meta-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden !important;
  padding-bottom: 16px !important;
}
.meta-head { flex-shrink: 0; margin-bottom: 12px !important; }
.meta-summary {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.meta-stat-card {
  padding: 12px 10px;
  border-radius: 12px;
  background: rgba(8, 10, 16, 0.62);
  border: 1px solid rgba(212, 175, 55, 0.16);
  text-align: center;
}
.meta-stat-card.is-main {
  border-color: rgba(212, 175, 55, 0.4);
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.12), rgba(8, 10, 16, 0.7));
}
.meta-stat-card .ms-label {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted, #8b93a7);
  margin-bottom: 4px;
}
.meta-stat-card .ms-value {
  font-family: var(--display, serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-light, #f0d78c);
  font-variant-numeric: tabular-nums;
}
.meta-insight {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.insight-chip {
  font-size: 12px;
  line-height: 1.4;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted, #9aa4b2);
}
.insight-chip b { color: var(--gold-light, #f0d78c); font-weight: 700; }
.insight-chip.is-good {
  border-color: rgba(61, 207, 154, 0.3);
  color: #9fe8c8;
}
.insight-chip.is-rec {
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.08);
  color: #e8d9a0;
}
.meta-tabs {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.meta-tab {
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(12, 16, 24, 0.55);
  color: var(--muted, #9aa4b2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.meta-tab:hover {
  border-color: rgba(212, 175, 55, 0.55);
  color: var(--text, #e8ecf1);
}
.meta-tab.active {
  border-color: var(--gold, #d4af37);
  color: var(--gold-light, #f0d78c);
  background: rgba(212, 175, 55, 0.12);
}
.meta-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
}
.meta-shop-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 20px;
}
.meta-group-title {
  font-size: 12px;
  letter-spacing: 3px;
  color: rgba(212, 175, 55, 0.7);
  margin: 6px 0 2px;
  padding-left: 2px;
}
.meta-item {
  display: flex;
  gap: 14px;
  align-items: stretch;
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: rgba(8, 10, 16, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.meta-item:hover {
  border-color: rgba(212, 175, 55, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.meta-item.is-rec {
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.12), 0 10px 24px rgba(0, 0, 0, 0.28);
}
.meta-item.is-maxed {
  opacity: 0.72;
}
.meta-item.is-short .meta-item-cost {
  color: #fc8181;
}
.meta-item-main {
  flex: 1;
  min-width: 0;
}
.meta-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 6px;
}
.meta-item-name {
  font-family: var(--display, serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--gold-light, #f0d78c);
}
.meta-item-cat {
  font-size: 10px;
  letter-spacing: 1px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted, #8b93a7);
}
.meta-rec-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f0d78c, #d4af37);
  color: #1a1208;
}
.meta-tip-tag {
  font-size: 10px;
  color: #9fd9c0;
  border: 1px solid rgba(61, 207, 154, 0.25);
  border-radius: 999px;
  padding: 1px 7px;
}
.meta-item-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: #c5cdd8;
  margin-bottom: 6px;
}
.meta-item-effect {
  font-size: 11.5px;
  color: rgba(212, 175, 55, 0.85);
  margin-bottom: 8px;
}
.meta-item-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  max-width: 280px;
}
.meta-item-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8a7340, #d4af37);
  transition: width 0.25s ease;
}
.meta-item-side {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  min-width: 100px;
}
.meta-item-cost {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold, #d4af37);
  font-variant-numeric: tabular-nums;
}
.meta-item-cost.maxed { color: #7dffa8; }
.meta-item-lv {
  font-size: 11px;
  color: var(--muted, #8b93a7);
}
.meta-buy-btn { min-width: 88px; }

@media (max-width: 900px) {
  .meta-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .meta-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .meta-item {
    flex-direction: column;
  }
  .meta-item-side {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
  }
}

/* 牌型图鉴 */
.hand-type-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.hand-type-item {
  background: rgba(12, 14, 20, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hand-type-pic {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 1px solid rgba(212, 175, 55, 0.25);
}
.hand-type-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
}
.hand-type-meta b {
  color: var(--gold-light);
  font-size: 13px;
  letter-spacing: 1px;
}

/* 出牌/过牌按钮图标 */
.btn-with-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-ico {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background-size: cover;
  background-position: center;
  display: inline-block;
  flex-shrink: 0;
}

/* 桌面牌型小标 */
.last-play-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hand-type-ico {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  display: inline-block;
  vertical-align: middle;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

@media (max-width: 900px) {
  .hand-type-gallery { grid-template-columns: repeat(2, 1fr); }
}

/* 音效按钮图标 */
.nav-sfx {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}
.nav-sfx-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  display: inline-block;
}

/* 天命花色小图标 */
.chip-suit {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}
.chip-mini-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  display: inline-block;
}

/* 成就勋章 */
.achieve-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.achieve-tab {
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(12, 16, 24, 0.55);
  color: var(--muted, #9aa4b2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.achieve-tab:hover {
  border-color: rgba(212, 175, 55, 0.55);
  color: var(--text, #e8ecf1);
}
.achieve-tab.active {
  border-color: var(--gold, #d4af37);
  color: var(--gold-light, #f0d78c);
  background: rgba(212, 175, 55, 0.12);
}
.achieve-card {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}
.achieve-badge {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 3px 12px rgba(0,0,0,0.35);
}
.achieve-card.tier-silver .achieve-badge { border-color: rgba(180, 200, 220, 0.55); }
.achieve-card.tier-gold .achieve-badge { border-color: rgba(212, 175, 55, 0.7); box-shadow: 0 0 12px rgba(212,175,55,0.2); }
.achieve-card.tier-diamond .achieve-badge { border-color: rgba(120, 210, 255, 0.7); box-shadow: 0 0 14px rgba(80,180,255,0.25); }
.achieve-card.locked .achieve-badge {
  filter: grayscale(0.9) brightness(0.65);
  opacity: 0.72;
}
.achieve-body { flex: 1; min-width: 0; }
.achieve-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.achieve-cat {
  font-size: 11px;
  color: var(--muted, #9aa4b2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}
.achieve-desc-line {
  font-size: 13px;
  color: var(--muted, #9aa4b2);
  line-height: 1.4;
}
.achieve-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.achieve-progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.achieve-progress-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #8a6a1a, #d4af37);
  border-radius: 999px;
}
.achieve-progress-text {
  font-size: 11px;
  color: var(--gold-light, #f0d78c);
  min-width: 52px;
  text-align: right;
}

/* 成就解锁弹层 */
.achieve-popup {
  position: fixed;
  top: 12%;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  z-index: 220;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s, transform 0.28s;
}
.achieve-popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.achieve-popup-card {
  min-width: 280px;
  max-width: min(420px, 92vw);
  padding: 18px 22px 16px;
  border-radius: 14px;
  background: rgba(14, 18, 26, 0.96);
  border: 1px solid rgba(212, 175, 55, 0.55);
  box-shadow: 0 16px 48px rgba(0,0,0,0.55), 0 0 28px rgba(212,175,55,0.18);
  text-align: center;
}
.achieve-popup-badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  border: 2px solid rgba(212, 175, 55, 0.65);
  box-shadow: 0 0 18px rgba(212,175,55,0.25);
}
.achieve-popup-label {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--gold, #d4af37);
  margin-bottom: 4px;
}
.achieve-popup-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-light, #f0d78c);
  margin-bottom: 6px;
}
.achieve-popup-desc {
  font-size: 13px;
  color: var(--muted, #9aa4b2);
  margin-bottom: 8px;
  line-height: 1.4;
}
.achieve-popup-reward {
  font-size: 14px;
  color: var(--gold, #d4af37);
  font-weight: 600;
}

/* 五宗徽记 */
.sect-icons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.sect-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.sect-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.sect-icon-item em {
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
}

/* 奇牌卡框 */
.qipai-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.2) !important;
  background-color: rgba(12, 14, 20, 0.92) !important;
  background-size: cover !important;
  background-position: center !important;
}
.qipai-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,10,16,0.55), rgba(8,10,16,0.88));
  pointer-events: none;
  z-index: 0;
}
.qipai-card > * {
  position: relative;
  z-index: 1;
}
.qipai-card.rarity-common { border-color: rgba(160,174,192,0.35) !important; }
.qipai-card.rarity-rare { border-color: rgba(66,153,225,0.45) !important; }
.qipai-card.rarity-legend { border-color: rgba(237,137,54,0.55) !important; }
.qipai-card.rarity-cursed { border-color: rgba(229,62,62,0.5) !important; }

/* 角色卡宗门小标 */
.char-sect-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(212,175,55,0.4);
  background-size: cover;
  background-position: center;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* 难度卡图标 */
.mode-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.mode-card-head h4 { margin: 0; }
.mode-diff-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(212, 175, 55, 0.35);
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

/* 机关/锦囊带图标 */
.jiguan-chip.has-icon,
.jinnang-chip.has-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
}
.chip-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.12);
}
.chip-label { line-height: 1.2; }

/* 藏经阁缩略图 */
.shop-item.has-thumb {
  gap: 10px;
}
.shop-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 1px solid rgba(212, 175, 55, 0.25);
}

/* 周常横幅 */
.weekly-banner {
  width: 100%;
  height: 120px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  margin-bottom: 16px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
}
.weekly-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.15), transparent 40%, rgba(0,0,0,0.25));
  pointer-events: none;
}

/* 破境演出底图 */
.fx-art {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.7)),
    url('../assets/fx/break_victory.jpg') center / cover no-repeat;
  opacity: 0.85;
  z-index: 0;
}
.fx-overlay .fx-title,
.fx-overlay .fx-sub,
.fx-overlay .fx-burst {
  position: relative;
  z-index: 1;
}

/* 克制干净的战斗/牌面 — 替代堆叠的 polish/feel 特效 */

/* 切屏轻微淡入即可 */
.screen.active.screen-enter {
  animation: clean-in 0.25s ease both;
}
@keyframes clean-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 手牌：适度重叠，悬停置顶，减少点错 */
.hand-cards {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 24px 20px 14px;
  min-height: calc(var(--card-h) + 40px);
  overflow-x: auto;
  overflow-y: visible;
}

.hand-cards .card {
  /* 扇形/抬起由 feel.css 控制；此处只保证可点与层级 */
  position: relative;
  filter: none;
  opacity: 1;
}
.hand-cards .card:first-child { margin-left: 0 !important; }

/* 选中牌左侧序号感：更易确认成组 */
.hand-cards .card.selected::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--gold);
  border-radius: 0 0 6px 6px;
  z-index: 2;
}

/* 手感细节由 feel.css 接管；此处不再粗暴关闭 */
.battle-phase {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  color: var(--gold-light, #f0d78c);
  letter-spacing: 0.5px;
  min-height: 1.2em;
  opacity: 0.92;
}
.chip.danger {
  color: #ff8a8a !important;
  border-color: rgba(229, 62, 62, 0.45) !important;
}
.bar-fill.player.near-clear {
  background: linear-gradient(90deg, #2f9e6b, #7dffa8) !important;
  box-shadow: 0 0 10px rgba(61, 207, 154, 0.45);
}
.bar-fill.enemy.threat-mid {
  background: linear-gradient(90deg, #c05621, #ed8936) !important;
}
.bar-fill.enemy.threat-high {
  background: linear-gradient(90deg, #c53030, #fc8181) !important;
  box-shadow: 0 0 10px rgba(229, 62, 62, 0.4);
}
.beat-tag, .chain-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}
.beat-tag {
  color: #7dffa8;
  border: 1px solid rgba(61, 207, 154, 0.5);
  background: rgba(61, 207, 154, 0.12);
}
.chain-tag {
  color: var(--gold-light, #f0d78c);
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.12);
}
.build-xinfa {
  font-size: 11px;
  color: var(--gold-dim, #a68b2c);
  margin-bottom: 8px;
  line-height: 1.4;
}
#btn-hint.pulse-hint {
  animation: hintPulse 1.2s ease-in-out infinite;
  border-color: rgba(61, 207, 154, 0.55) !important;
  color: #7dffa8 !important;
}
@keyframes hintPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61, 207, 154, 0.25); }
  50% { box-shadow: 0 0 0 4px rgba(61, 207, 154, 0.12); }
}
#btn-play.ready-play:not(:disabled) {
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35);
}
#btn-play.can-clear:not(:disabled),
#btn-play.need-action.can-clear {
  background: linear-gradient(180deg, #2f9e6b, #1d7a4f) !important;
  border-color: #3dcf9a !important;
  color: #fff !important;
  box-shadow: 0 0 16px rgba(61, 207, 154, 0.35);
}
.score-flash {
  position: fixed;
  top: 28%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 205;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.25s;
}
.score-flash.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.score-flash-main {
  font-size: 36px;
  font-weight: 800;
  color: var(--gold-light, #f0d78c);
  text-shadow: 0 4px 20px rgba(0,0,0,0.55), 0 0 18px rgba(212,175,55,0.35);
  letter-spacing: 1px;
}
.score-flash.big .score-flash-main {
  font-size: 48px;
  color: #7dffa8;
}
.score-flash-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted, #9aa4b2);
}
.hand-hint.can-clear {
  color: var(--green, #3dcf9a) !important;
  font-weight: 600;
}
.hand-hint.can-play,
.hand-hint.cannot-play {
  background: transparent !important;
  border-color: transparent !important;
  font-weight: 500;
}
.hand-hint {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

/* 干净牌面 */
.card {
  background: linear-gradient(180deg, #fffcf5, #f0e6d2);
  border: 1.5px solid #c4b48a;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.card-sheen,
.card-watermark {
  display: none !important;
}
.card-corner {
  padding: 4px 5px;
}
.card-corner .cr {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--display);
}
.card-corner .cs { font-size: 11px; }
.card-center.suit-lg {
  font-size: 28px;
  filter: none;
}
.card.table-card {
  width: 58px;
  height: 82px;
  margin-left: -14px;
  animation: none !important;
}
.card.table-card .card-center.suit-lg { font-size: 22px; }
.card.table-card:hover {
  transform: none !important;
}

/* 角色卡：去掉「出战」角标动画感过重 */
.char-card.selected::after {
  content: none !important;
}
.char-card:hover .char-portrait {
  transform: none;
}
.char-portrait {
  transition: none;
}

/* 按钮：去掉扫光 */
.btn-primary::before {
  display: none !important;
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* 标题统计卡别乱动 */
.title-stats .stat-card:hover {
  transform: none;
  box-shadow: none;
}
.sect-list li:hover {
  transform: none;
}

/* 地图脉冲关掉 */
.map-stage.current {
  animation: none !important;
}

/* 进度条高光简化 */
.bar-fill.player::after {
  display: none;
}

/* 出牌飞行保留但低调 */
.card.flying {
  position: fixed !important;
  z-index: 400 !important;
  pointer-events: none !important;
  margin: 0 !important;
  transition: left 0.22s ease, top 0.22s ease, opacity 0.2s ease !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4) !important;
  transform: none !important;
}