/* ============================================================
 * 《问道长生》· 轮回牌局独立样式
 * 边界：视觉规则均收在 #reincarnation-root / .rl-* 之下。
 * 气质：宣纸、深青、朱砂、金线；桌面与 375px 手机均可读。
 * 资源：仅项目内本地 WebP 与内联 SVG，不引用远程资源。
 * ============================================================ */

#reincarnation-root {
  --rl-paper: #f4eddd;
  --rl-paper-deep: #e7dbc1;
  --rl-paper-soft: #fbf7ec;
  --rl-ink: #243633;
  --rl-ink-soft: #4f5e56;
  --rl-muted: #776d5c;
  --rl-deep: #0d2629;
  --rl-deep-2: #143538;
  --rl-teal: #24504f;
  --rl-teal-2: #356966;
  --rl-teal-3: #4c7d77;
  --rl-cinnabar: #a73a2e;
  --rl-cinnabar-deep: #7f251d;
  --rl-gold: #a77f31;
  --rl-gold-soft: #d4b978;
  --rl-gold-line: rgba(184, 148, 78, 0.52);
  --rl-line: rgba(74, 80, 66, 0.22);
  --rl-danger: #9b3025;
  --rl-ok: #3d7251;
  --rl-shadow: 0 18px 50px rgba(6, 20, 22, 0.34);
  --rl-radius: 14px;
  --rl-serif: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
  --rl-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --rl-el-jin: #a9802f;
  --rl-el-shui: #3d6d8d;
  --rl-el-mu: #4c7748;
  --rl-el-huo: #a8422c;
  --rl-el-tu: #84633a;
  --rl-el-wu: #756c5e;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1200;
  display: block;
  overflow: hidden;
  background: var(--rl-deep);
  color: var(--rl-ink);
  font-family: var(--rl-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

#reincarnation-root *,
#reincarnation-root *::before,
#reincarnation-root *::after {
  box-sizing: border-box;
}

#reincarnation-root[hidden] {
  display: none !important;
}

#reincarnation-root [hidden] {
  display: none !important;
}

#reincarnation-root button,
#reincarnation-root input,
#reincarnation-root select,
#reincarnation-root textarea {
  font: inherit;
  color: inherit;
}

#reincarnation-root button {
  -webkit-tap-highlight-color: transparent;
}

#reincarnation-root h2,
#reincarnation-root h3,
#reincarnation-root p,
#reincarnation-root ul,
#reincarnation-root ol {
  margin: 0;
}

#reincarnation-root ul,
#reincarnation-root ol {
  padding: 0;
  list-style: none;
}

#reincarnation-root svg {
  display: block;
  width: 100%;
  height: 100%;
}

#reincarnation-root :focus-visible {
  outline: 3px solid var(--rl-gold-soft);
  outline-offset: 2px;
}

body.rl-open {
  overflow: hidden !important;
}

/* ---------- 背景山水 ---------- */
#reincarnation-root .rl-atmosphere {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 76% 12%, rgba(193, 171, 111, 0.16), transparent 24%),
    radial-gradient(circle at 12% 78%, rgba(84, 130, 119, 0.18), transparent 34%),
    linear-gradient(180deg, #16383b 0%, #102e31 43%, #0a2023 100%);
}

#reincarnation-root .rl-atmosphere::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0.34;
  background-image:
    repeating-linear-gradient(0deg, rgba(239, 228, 200, 0.035) 0, rgba(239, 228, 200, 0.035) 1px, transparent 1px, transparent 4px),
    repeating-linear-gradient(90deg, rgba(3, 14, 15, 0.08) 0, rgba(3, 14, 15, 0.08) 1px, transparent 1px, transparent 9px);
}

#reincarnation-root .rl-atmosphere::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(180deg, transparent 56%, rgba(4, 15, 16, 0.54) 100%);
}

#reincarnation-root .rl-atmosphere-moon {
  position: absolute;
  top: 64px;
  right: 7%;
  width: clamp(120px, 18vw, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.8;
  background:
    radial-gradient(circle at 38% 34%, rgba(255, 247, 217, 0.9), rgba(226, 205, 150, 0.36) 42%, rgba(203, 178, 116, 0.05) 70%);
  box-shadow: 0 0 70px rgba(218, 193, 126, 0.18);
}

#reincarnation-root .rl-mountain {
  position: absolute;
  bottom: -2%;
  height: 54%;
  opacity: 0.8;
  background: linear-gradient(160deg, rgba(39, 81, 80, 0.92), rgba(8, 26, 28, 0.98));
}

#reincarnation-root .rl-mountain-a {
  left: -12%;
  width: 73%;
  clip-path: polygon(0 100%, 0 67%, 9% 58%, 16% 65%, 26% 39%, 35% 54%, 44% 24%, 55% 51%, 65% 42%, 75% 63%, 88% 48%, 100% 70%, 100% 100%);
}

#reincarnation-root .rl-mountain-b {
  right: -18%;
  width: 80%;
  height: 45%;
  opacity: 0.62;
  clip-path: polygon(0 100%, 7% 73%, 19% 59%, 28% 68%, 38% 36%, 49% 58%, 60% 47%, 73% 64%, 82% 51%, 93% 66%, 100% 58%, 100% 100%);
}

#reincarnation-root .rl-mountain-c {
  left: 22%;
  width: 68%;
  height: 29%;
  opacity: 0.5;
  clip-path: polygon(0 100%, 9% 78%, 21% 66%, 34% 74%, 48% 52%, 63% 69%, 76% 58%, 89% 73%, 100% 65%, 100% 100%);
}

#reincarnation-root .rl-mist {
  position: absolute;
  border-radius: 50%;
  background: rgba(220, 232, 216, 0.11);
  filter: blur(28px);
}

#reincarnation-root .rl-mist-a {
  left: 3%;
  bottom: 19%;
  width: 54%;
  height: 9%;
}

#reincarnation-root .rl-mist-b {
  right: -6%;
  bottom: 31%;
  width: 48%;
  height: 7%;
}

/* ---------- 外壳 ---------- */
#reincarnation-root .rl-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
}

#reincarnation-root .rl-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(14px, 2.4vw, 28px) clamp(12px, 3vw, 30px) 56px;
  scrollbar-width: thin;
  scrollbar-color: rgba(184, 148, 78, 0.52) rgba(9, 30, 32, 0.24);
  overscroll-behavior: contain;
}

#reincarnation-root .rl-main::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

#reincarnation-root .rl-main::-webkit-scrollbar-track {
  background: rgba(9, 30, 32, 0.24);
}

#reincarnation-root .rl-main::-webkit-scrollbar-thumb {
  background: rgba(184, 148, 78, 0.52);
  border-radius: 999px;
}

/* ---------- 顶栏 ---------- */
#reincarnation-root .rl-topbar {
  position: relative;
  z-index: 8;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px clamp(12px, 2vw, 22px);
  padding: 9px clamp(12px, 2.6vw, 26px);
  color: var(--rl-paper);
  background:
    linear-gradient(180deg, rgba(8, 27, 29, 0.985), rgba(17, 49, 51, 0.96)),
    radial-gradient(circle at 20% 0%, rgba(167, 127, 49, 0.16), transparent 44%);
  border-bottom: 1px solid var(--rl-gold-line);
  box-shadow: 0 8px 24px rgba(2, 11, 12, 0.36);
}

#reincarnation-root .rl-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 2px 6px 2px 2px;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

#reincarnation-root .rl-brand-seal {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(244, 237, 221, 0.34);
  border-radius: 5px;
  color: #fff6e4;
  background: linear-gradient(160deg, var(--rl-cinnabar), var(--rl-cinnabar-deep));
  font-family: var(--rl-serif);
  font-size: 22px;
  line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(255, 245, 224, 0.13);
}

#reincarnation-root .rl-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

#reincarnation-root .rl-brand-text strong {
  font-family: var(--rl-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

#reincarnation-root .rl-brand-text small {
  margin-top: 3px;
  color: rgba(244, 237, 221, 0.68);
  font-size: 11px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

#reincarnation-root .rl-run-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 3px 2px;
  scrollbar-width: none;
}

#reincarnation-root .rl-run-strip::-webkit-scrollbar {
  display: none;
}

#reincarnation-root .rl-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

#reincarnation-root .rl-top-actions .rl-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

#reincarnation-root .rl-top-label-short {
  display: none;
}

#reincarnation-root .rl-save {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  padding: 5px 9px;
  border: 1px solid rgba(244, 237, 221, 0.18);
  border-radius: 999px;
  color: rgba(244, 237, 221, 0.78);
  font-size: 11.5px;
  line-height: 1.3;
  white-space: nowrap;
}

#reincarnation-root .rl-save .rl-ico {
  width: 14px;
  height: 14px;
}

#reincarnation-root .rl-save-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

#reincarnation-root .rl-save.is-ok {
  color: #dce9d4;
  border-color: rgba(148, 194, 146, 0.38);
}

#reincarnation-root .rl-save.is-warn {
  color: #ffd7ca;
  border-color: rgba(232, 151, 124, 0.5);
  background: rgba(122, 43, 33, 0.28);
}

#reincarnation-root .rl-save.is-muted {
  color: rgba(244, 237, 221, 0.62);
}

/* ---------- 按钮 ---------- */
#reincarnation-root .rl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--rl-paper);
  color: var(--rl-ink);
  font-family: var(--rl-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#reincarnation-root .rl-btn:hover:not(:disabled) {
  background: var(--rl-paper-soft);
}

#reincarnation-root .rl-btn:active:not(:disabled) {
  transform: translateY(1px);
}

#reincarnation-root .rl-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

#reincarnation-root .rl-btn .rl-ico {
  width: 17px;
  height: 17px;
}

#reincarnation-root .rl-btn-label {
  display: inline-block;
}

#reincarnation-root .rl-btn-primary {
  color: #fff8e9;
  background: linear-gradient(160deg, #b74837, #8f2c23);
  border-color: rgba(95, 20, 13, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 242, 218, 0.19), 0 5px 14px rgba(81, 24, 17, 0.2);
}

#reincarnation-root .rl-btn-primary:hover:not(:disabled) {
  background: linear-gradient(160deg, #c45441, #9c3328);
}

#reincarnation-root .rl-btn-ghost {
  color: var(--rl-teal);
  background: rgba(244, 237, 221, 0.12);
  border-color: rgba(36, 80, 79, 0.42);
}

#reincarnation-root .rl-btn-ghost:hover:not(:disabled) {
  background: rgba(244, 237, 221, 0.9);
}

#reincarnation-root .rl-btn-quiet {
  color: var(--rl-ink-soft);
  background: transparent;
  border-color: var(--rl-line);
  font-weight: 500;
}

#reincarnation-root .rl-btn-quiet:hover:not(:disabled) {
  background: rgba(36, 80, 79, 0.08);
  border-color: rgba(36, 80, 79, 0.35);
}

#reincarnation-root .rl-btn-danger {
  color: #fff5e7;
  background: linear-gradient(160deg, #a73a2e, #81261e);
  border-color: rgba(106, 25, 18, 0.48);
}

#reincarnation-root .rl-btn-warn {
  color: #ffe1d7;
  border-color: rgba(231, 151, 128, 0.46);
}

#reincarnation-root .rl-topbar .rl-btn-quiet,
#reincarnation-root .rl-combat-bar .rl-btn-quiet {
  color: rgba(244, 237, 221, 0.82);
  border-color: rgba(244, 237, 221, 0.24);
}

#reincarnation-root .rl-topbar .rl-btn-quiet:hover:not(:disabled),
#reincarnation-root .rl-combat-bar .rl-btn-quiet:hover:not(:disabled) {
  background: rgba(244, 237, 221, 0.12);
}

#reincarnation-root .rl-topbar .rl-btn-warn {
  color: #ffd5c8;
  border-color: rgba(235, 158, 136, 0.48);
}

#reincarnation-root .rl-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
}

#reincarnation-root .rl-action-row .rl-btn {
  flex: 0 1 auto;
}

#reincarnation-root .rl-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

#reincarnation-root .rl-ico svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 通用排版 ---------- */
#reincarnation-root .rl-screen {
  position: relative;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto 36px;
  padding: clamp(16px, 2.8vw, 30px);
  border: 1px solid rgba(94, 82, 57, 0.34);
  border-radius: var(--rl-radius);
  background:
    linear-gradient(180deg, rgba(251, 247, 236, 0.98), rgba(241, 232, 211, 0.98)),
    repeating-linear-gradient(0deg, rgba(86, 68, 38, 0.045) 0, rgba(86, 68, 38, 0.045) 1px, transparent 1px, transparent 5px);
  box-shadow: var(--rl-shadow), inset 0 0 0 1px rgba(255, 251, 240, 0.62);
}

#reincarnation-root .rl-title-screen,
#reincarnation-root .rl-combat-screen {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#reincarnation-root .rl-kicker {
  color: var(--rl-cinnabar);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-transform: uppercase;
}

#reincarnation-root .rl-screen-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

#reincarnation-root .rl-screen-head.has-scene {
  position: relative;
  justify-content: flex-end;
  min-height: 118px;
  padding: 15px 17px;
  overflow: hidden;
  border: 1px solid rgba(190, 155, 85, 0.36);
  border-radius: 11px;
  background:
    radial-gradient(circle at 100% 0, rgba(212, 185, 120, 0.14), transparent 40%),
    linear-gradient(150deg, #204a49, #0c292b);
  box-shadow: 0 10px 26px rgba(8, 28, 28, 0.16);
}

#reincarnation-root .rl-screen-head.has-scene::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  left: 6px;
  z-index: 2;
  border: 1px solid rgba(246, 236, 209, 0.12);
  border-radius: 6px;
  pointer-events: none;
}

#reincarnation-root .rl-scene-img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

#reincarnation-root .rl-scene-shade {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(7, 29, 31, 0.94) 0%, rgba(7, 29, 31, 0.78) 46%, rgba(7, 29, 31, 0.24) 100%),
    linear-gradient(0deg, rgba(7, 29, 31, 0.7), transparent 62%);
  pointer-events: none;
}

#reincarnation-root .rl-screen-copy {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#reincarnation-root .rl-screen-head.has-scene .rl-kicker {
  color: #e5c98f;
}

#reincarnation-root .rl-screen-head.has-scene .rl-section-title {
  color: #fff7e6;
  font-size: clamp(23px, 3vw, 31px);
  text-shadow: 0 2px 12px rgba(1, 12, 13, 0.42);
}

#reincarnation-root .rl-screen-head.has-scene .rl-section-note {
  color: rgba(247, 239, 221, 0.74);
  font-size: 12.5px;
  text-shadow: 0 1px 8px rgba(1, 12, 13, 0.4);
}

#reincarnation-root .rl-section-title {
  font-family: var(--rl-serif);
  font-size: clamp(25px, 3.2vw, 34px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.05em;
}

#reincarnation-root .rl-subtitle {
  font-family: var(--rl-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.04em;
}

#reincarnation-root .rl-section-note {
  max-width: 74ch;
  color: var(--rl-muted);
  font-size: 13px;
  line-height: 1.65;
}

#reincarnation-root .rl-section {
  margin-top: 24px;
}

#reincarnation-root .rl-section-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
}

#reincarnation-root .rl-empty-note {
  padding: 14px;
  border: 1px dashed var(--rl-line);
  border-radius: 9px;
  color: var(--rl-muted);
  font-size: 13px;
}

#reincarnation-root .rl-reason {
  color: var(--rl-cinnabar-deep);
  font-size: 12px;
  line-height: 1.5;
}

#reincarnation-root .rl-footnote {
  color: var(--rl-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

#reincarnation-root .rl-inline-warn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(155, 48, 37, 0.36);
  border-radius: 9px;
  background: rgba(167, 58, 46, 0.08);
  color: var(--rl-cinnabar-deep);
  font-size: 13px;
}

#reincarnation-root .rl-inline-warn .rl-ico {
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

#reincarnation-root .rl-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 9px;
  border: 1px solid var(--rl-line);
  border-radius: 999px;
  background: rgba(255, 251, 240, 0.58);
  color: var(--rl-ink-soft);
  font-size: 12.5px;
  line-height: 1.4;
  white-space: nowrap;
}

#reincarnation-root .rl-pill-label {
  color: var(--rl-muted);
  font-size: 12px;
}

#reincarnation-root .rl-pill-value {
  color: var(--rl-ink);
  font-size: 13px;
  font-weight: 700;
}

#reincarnation-root .rl-pill.is-gold {
  border-color: rgba(167, 127, 49, 0.42);
  background: rgba(218, 190, 125, 0.12);
}

#reincarnation-root .rl-pill.is-warn {
  border-color: rgba(167, 58, 46, 0.38);
  background: rgba(167, 58, 46, 0.07);
}

#reincarnation-root .rl-pill.is-warn .rl-pill-value {
  color: var(--rl-cinnabar-deep);
}

#reincarnation-root .rl-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(244, 237, 221, 0.18);
  border-radius: 999px;
  color: rgba(244, 237, 221, 0.78);
  font-size: 11.5px;
  line-height: 1.3;
  white-space: nowrap;
}

#reincarnation-root .rl-chip-ico {
  width: 13px;
  height: 13px;
  opacity: 0.78;
}

#reincarnation-root .rl-chip-arch {
  color: #f3dfb3;
  border-color: rgba(212, 185, 120, 0.4);
}

#reincarnation-root .rl-chip-gold {
  color: #f2dca5;
}

#reincarnation-root .rl-chip-danger {
  color: #ffc8ba;
  border-color: rgba(230, 151, 128, 0.46);
  background: rgba(138, 44, 33, 0.24);
}

#reincarnation-root .rl-chip-relic {
  color: #e8d9b7;
}

#reincarnation-root .rl-chip-result {
  color: #ffe4ad;
  border-color: rgba(212, 185, 120, 0.48);
}

#reincarnation-root .rl-chip-btn {
  color: inherit;
  background: transparent;
  cursor: pointer;
}

#reincarnation-root .rl-chip-btn:hover {
  background: rgba(244, 237, 221, 0.11);
}

/* ---------- 标题页 ---------- */
#reincarnation-root .rl-title-screen {
  margin-bottom: 48px;
}

#reincarnation-root .rl-title-hero {
  position: relative;
  overflow: hidden;
  min-height: 348px;
  padding: clamp(24px, 4.3vw, 52px);
  border: 1px solid rgba(196, 162, 98, 0.44);
  border-radius: 18px;
  color: var(--rl-paper);
  background-image:
    linear-gradient(100deg, rgba(8, 30, 31, 0.94) 0%, rgba(9, 31, 32, 0.83) 44%, rgba(9, 31, 32, 0.28) 76%, rgba(9, 31, 32, 0.42) 100%),
    url("../assets/art/immortal-valley.webp");
  background-position: center;
  background-size: cover;
  box-shadow: var(--rl-shadow);
}

#reincarnation-root .rl-title-hero::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  bottom: 9px;
  left: 9px;
  border: 1px solid rgba(212, 185, 120, 0.24);
  border-radius: 12px;
  pointer-events: none;
}

#reincarnation-root .rl-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  min-height: 250px;
}

#reincarnation-root .rl-hero-copy {
  max-width: 700px;
}

#reincarnation-root .rl-hero-title {
  margin-top: 4px;
  font-family: var(--rl-serif);
  font-size: clamp(43px, 7vw, 72px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.12em;
  text-shadow: 0 4px 22px rgba(2, 12, 13, 0.5);
}

#reincarnation-root .rl-hero-sub {
  max-width: 620px;
  margin-top: 13px;
  color: rgba(244, 237, 221, 0.8);
  font-size: 14px;
  line-height: 1.85;
}

#reincarnation-root .rl-hero-poem {
  flex: 0 0 auto;
  color: rgba(232, 211, 164, 0.64);
  font-family: var(--rl-serif);
  font-size: 16px;
  line-height: 2.1;
  letter-spacing: 0.34em;
  writing-mode: vertical-rl;
  white-space: pre-line;
}

#reincarnation-root .rl-rulebook {
  margin-top: 20px;
  padding: 14px 15px;
  border: 1px solid rgba(212, 185, 120, 0.3);
  border-radius: 11px;
  background: rgba(5, 19, 20, 0.38);
  backdrop-filter: blur(3px);
}

#reincarnation-root .rl-rule-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
}

#reincarnation-root .rl-rule-item {
  padding-left: 10px;
  border-left: 2px solid rgba(212, 185, 120, 0.48);
}

#reincarnation-root .rl-rule-item-title {
  display: block;
  color: #f2dca5;
  font-family: var(--rl-serif);
  font-size: 14px;
  letter-spacing: 0.08em;
}

#reincarnation-root .rl-rule-item-text {
  display: block;
  margin-top: 2px;
  color: rgba(244, 237, 221, 0.76);
  font-size: 12px;
  line-height: 1.58;
}

#reincarnation-root .rl-howto {
  margin-top: 11px;
  border-top: 1px solid rgba(212, 185, 120, 0.2);
  padding-top: 9px;
}

#reincarnation-root .rl-howto-summary {
  width: fit-content;
  color: rgba(244, 237, 221, 0.78);
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

#reincarnation-root .rl-howto-summary:hover {
  color: #f2dca5;
}

#reincarnation-root .rl-howto-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 2px 2px;
}

#reincarnation-root .rl-howto-text {
  color: rgba(244, 237, 221, 0.72);
  font-size: 12.5px;
  line-height: 1.7;
}

#reincarnation-root .rl-save-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 13px 16px;
  border: 1px solid rgba(64, 110, 82, 0.3);
  border-radius: 10px;
  background: rgba(251, 247, 236, 0.9);
  color: var(--rl-ink-soft);
}

#reincarnation-root .rl-save-note > .rl-ico {
  width: 22px;
  height: 22px;
  color: var(--rl-teal);
}

#reincarnation-root .rl-save-note.is-warn {
  border-color: rgba(167, 58, 46, 0.4);
  background: rgba(252, 240, 232, 0.94);
}

#reincarnation-root .rl-save-note.is-warn > .rl-ico {
  color: var(--rl-cinnabar);
}

#reincarnation-root .rl-save-note-body {
  min-width: 0;
}

#reincarnation-root .rl-save-note-title {
  display: block;
  font-size: 14px;
}

#reincarnation-root .rl-save-note-text {
  margin-top: 2px;
  color: var(--rl-muted);
  font-size: 12.5px;
  line-height: 1.65;
}

#reincarnation-root .rl-continue-card,
#reincarnation-root .rl-ended-banner {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(167, 127, 49, 0.44);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(251, 247, 236, 0.98), rgba(235, 222, 191, 0.96));
  box-shadow: 0 9px 25px rgba(15, 48, 49, 0.12);
}

#reincarnation-root .rl-continue-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

#reincarnation-root .rl-continue-main {
  min-width: 0;
}

#reincarnation-root .rl-continue-title {
  margin-top: 1px;
  font-family: var(--rl-serif);
  font-size: 23px;
  line-height: 1.3;
}

#reincarnation-root .rl-continue-text {
  margin-top: 5px;
  color: var(--rl-muted);
  font-size: 13px;
}

#reincarnation-root .rl-continue-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

#reincarnation-root .rl-ended-banner {
  display: flex;
  align-items: center;
  gap: 16px;
}

#reincarnation-root .rl-ended-seal {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 7px;
  font-family: var(--rl-serif);
  font-size: 30px;
  line-height: 1;
}

#reincarnation-root .rl-ended-seal.is-win {
  color: var(--rl-cinnabar);
}

#reincarnation-root .rl-ended-seal.is-loss {
  color: var(--rl-muted);
}

#reincarnation-root .rl-ended-body {
  flex: 1 1 auto;
  min-width: 0;
}

#reincarnation-root .rl-ended-title {
  font-family: var(--rl-serif);
  font-size: 22px;
}

#reincarnation-root .rl-ended-text {
  margin-top: 3px;
  color: var(--rl-muted);
  font-size: 13px;
}

#reincarnation-root .rl-meta-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

#reincarnation-root .rl-meta-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 15px;
  border: 1px solid rgba(94, 82, 57, 0.25);
  border-radius: 10px;
  background: rgba(251, 247, 236, 0.86);
}

#reincarnation-root .rl-meta-label {
  color: var(--rl-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

#reincarnation-root .rl-meta-value {
  margin-top: 1px;
  font-family: var(--rl-serif);
  font-size: 26px;
  line-height: 1.2;
}

#reincarnation-root .rl-meta-sub {
  color: var(--rl-muted);
  font-size: 12px;
}

#reincarnation-root .rl-archetype-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

#reincarnation-root .rl-archetype {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(94, 82, 57, 0.31);
  border-radius: 13px;
  background: var(--rl-paper-soft);
  box-shadow: 0 10px 28px rgba(19, 47, 46, 0.1);
}

#reincarnation-root .rl-archetype-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 126px;
  overflow: hidden;
  color: #f6ebd1;
  background:
    radial-gradient(circle at 50% 44%, rgba(237, 219, 176, 0.23), transparent 44%),
    linear-gradient(155deg, #1d4a49, #0e2f31);
}

#reincarnation-root .rl-archetype-art::before,
#reincarnation-root .rl-archetype-art::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(216, 188, 125, 0.28);
  border-radius: 50%;
}

#reincarnation-root .rl-archetype-art::before {
  width: 94px;
  height: 94px;
}

#reincarnation-root .rl-archetype-art::after {
  width: 116px;
  height: 116px;
  border-style: dashed;
  opacity: 0.7;
}

#reincarnation-root .rl-archetype-ring {
  position: absolute;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(216, 188, 125, 0.38);
  border-radius: 50%;
  background: rgba(7, 28, 29, 0.38);
}

#reincarnation-root .rl-archetype-glyph {
  position: relative;
  z-index: 1;
  font-family: var(--rl-serif);
  font-size: 44px;
  line-height: 1;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.3);
}

#reincarnation-root .rl-arch-sword .rl-archetype-art {
  background: radial-gradient(circle at 50% 44%, rgba(238, 220, 177, 0.2), transparent 44%), linear-gradient(155deg, #284f4e, #102f31);
}

#reincarnation-root .rl-arch-alchemy .rl-archetype-art {
  background: radial-gradient(circle at 50% 44%, rgba(238, 220, 177, 0.2), transparent 44%), linear-gradient(155deg, #5b4b2e, #2b2f28);
}

#reincarnation-root .rl-arch-blood .rl-archetype-art {
  background: radial-gradient(circle at 50% 44%, rgba(238, 220, 177, 0.16), transparent 44%), linear-gradient(155deg, #5d2d2b, #2d2022);
}

#reincarnation-root .rl-archetype-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 8px;
  padding: 15px;
}

#reincarnation-root .rl-archetype-name {
  font-family: var(--rl-serif);
  font-size: 24px;
  line-height: 1.2;
}

#reincarnation-root .rl-archetype-text {
  color: var(--rl-ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

#reincarnation-root .rl-archetype-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

#reincarnation-root .rl-archetype-relic {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(167, 127, 49, 0.31);
  border-radius: 8px;
  background: rgba(218, 190, 125, 0.09);
}

#reincarnation-root .rl-archetype-relic > .rl-ico {
  width: 19px;
  height: 19px;
  color: var(--rl-gold);
  margin-top: 1px;
}

#reincarnation-root .rl-relic-name {
  display: block;
  font-size: 13px;
}

#reincarnation-root .rl-relic-text {
  display: block;
  margin-top: 2px;
  color: var(--rl-muted);
  font-size: 12px;
  line-height: 1.6;
}

#reincarnation-root .rl-archetype-deck {
  color: var(--rl-muted);
  font-size: 12px;
  line-height: 1.6;
}

#reincarnation-root .rl-arch-details {
  border-top: 1px solid var(--rl-line);
  padding-top: 7px;
}

#reincarnation-root .rl-arch-details-summary {
  color: var(--rl-teal);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

#reincarnation-root .rl-arch-details-body {
  padding-top: 8px;
}

#reincarnation-root .rl-arch-relic-detail {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 7px;
  background: rgba(36, 80, 79, 0.06);
}

#reincarnation-root .rl-arch-relic-detail > .rl-ico {
  width: 18px;
  height: 18px;
  color: var(--rl-gold);
  flex: 0 0 auto;
}

#reincarnation-root .rl-arch-card-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 7px;
}

#reincarnation-root .rl-arch-card {
  padding: 7px 8px;
  border-left: 2px solid rgba(167, 127, 49, 0.35);
  background: rgba(255, 252, 244, 0.56);
}

#reincarnation-root .rl-arch-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
}

#reincarnation-root .rl-arch-card-name {
  font-size: 13px;
}

#reincarnation-root .rl-arch-card-meta,
#reincarnation-root .rl-arch-card-count {
  color: var(--rl-muted);
  font-size: 12px;
}

#reincarnation-root .rl-arch-card-text,
#reincarnation-root .rl-arch-card-upgrade {
  margin-top: 2px;
  color: var(--rl-ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

#reincarnation-root .rl-arch-card-upgrade {
  color: var(--rl-teal);
}

#reincarnation-root .rl-arch-details-empty {
  color: var(--rl-muted);
  font-size: 12px;
}

#reincarnation-root .rl-archetype-foot {
  margin-top: auto;
  padding-top: 4px;
}

#reincarnation-root .rl-archetype-foot .rl-btn {
  width: 100%;
}

#reincarnation-root .rl-unlock-section .rl-unlock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#reincarnation-root .rl-unlock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border: 1px solid rgba(64, 110, 82, 0.28);
  border-radius: 999px;
  background: rgba(61, 114, 81, 0.08);
  color: #315f45;
  font-size: 12px;
}

#reincarnation-root .rl-unlock.is-new {
  border-color: rgba(167, 127, 49, 0.46);
  background: rgba(218, 190, 125, 0.16);
  color: #7a5b1e;
}

#reincarnation-root .rl-unlock-relic .rl-ico {
  width: 13px;
  height: 13px;
}

#reincarnation-root .rl-unlock-details {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--rl-line);
}

#reincarnation-root .rl-unlock-summary {
  width: fit-content;
  color: var(--rl-teal);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

#reincarnation-root .rl-unlock-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

#reincarnation-root .rl-unlock-condition {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--rl-line);
  border-radius: 8px;
  background: rgba(255, 252, 244, 0.55);
}

#reincarnation-root .rl-unlock-condition.is-unlocked {
  border-color: rgba(167, 127, 49, 0.38);
  background: rgba(218, 190, 125, 0.1);
}

#reincarnation-root .rl-unlock-condition-main {
  min-width: 0;
}

#reincarnation-root .rl-unlock-condition-name {
  font-size: 13px;
}

#reincarnation-root .rl-unlock-condition-text {
  margin-top: 1px;
  color: var(--rl-muted);
  font-size: 12px;
  line-height: 1.55;
}

#reincarnation-root .rl-unlock-badge {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid var(--rl-line);
  border-radius: 999px;
  color: var(--rl-muted);
  font-size: 11.5px;
}

#reincarnation-root .rl-unlock-badge.is-got {
  color: #7a5b1e;
  border-color: rgba(167, 127, 49, 0.43);
  background: rgba(218, 190, 125, 0.16);
}

#reincarnation-root .rl-history {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid var(--rl-line);
}

#reincarnation-root .rl-history-summary {
  width: fit-content;
  color: var(--rl-teal);
  font-size: 13px;
  cursor: pointer;
}

#reincarnation-root .rl-history-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 7px;
}

#reincarnation-root .rl-history-row {
  color: var(--rl-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

#reincarnation-root .rl-title-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(94, 82, 57, 0.24);
}

#reincarnation-root .rl-title-foot .rl-action-row {
  margin-top: 0;
}

/* ---------- 分岔路线 ---------- */
#reincarnation-root .rl-map-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}

#reincarnation-root .rl-map-head > div:first-child {
  min-width: 0;
}

#reincarnation-root .rl-progress {
  flex: 0 0 216px;
  padding: 10px 12px;
  border: 1px solid var(--rl-line);
  border-radius: 10px;
  background: rgba(255, 252, 244, 0.6);
}

#reincarnation-root .rl-progress-text {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--rl-muted);
  font-size: 12px;
}

#reincarnation-root .rl-progress-text strong {
  color: var(--rl-ink);
  font-size: 14px;
}

#reincarnation-root .rl-progress-bar {
  position: relative;
  height: 7px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(36, 80, 79, 0.13);
}

#reincarnation-root .rl-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rl-teal-2), var(--rl-gold));
  transition: width 0.2s ease;
}

#reincarnation-root .rl-progress-sub {
  display: block;
  margin-top: 3px;
  color: var(--rl-muted);
  font-size: 11.5px;
}

#reincarnation-root .rl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
}

#reincarnation-root .rl-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--rl-muted);
  font-size: 12px;
}

#reincarnation-root .rl-legend-item .rl-ico {
  width: 14px;
  height: 14px;
  color: var(--rl-teal);
}

#reincarnation-root .rl-map-scroll {
  margin-top: 12px;
  overflow: auto;
  border: 1px solid rgba(67, 92, 83, 0.3);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(12, 43, 44, 0.9), rgba(5, 24, 26, 0.94)),
    url("../assets/art/immortal-valley.webp") center 32% / cover no-repeat,
    #0b2528;
  scrollbar-width: thin;
  scrollbar-color: rgba(184, 148, 78, 0.45) rgba(8, 26, 28, 0.3);
}

#reincarnation-root .rl-map-scroll::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

#reincarnation-root .rl-map-scroll::-webkit-scrollbar-thumb {
  background: rgba(184, 148, 78, 0.45);
  border-radius: 999px;
}

#reincarnation-root .rl-map-canvas {
  min-width: 620px;
  padding: 18px 28px 22px;
}

#reincarnation-root .rl-map-layers {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 34px;
}

#reincarnation-root .rl-map-lines {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

#reincarnation-root .rl-map-edge {
  fill: none;
  stroke: rgba(201, 190, 158, 0.26);
  stroke-width: 1.4;
  stroke-dasharray: 3 5;
}

#reincarnation-root .rl-map-edge.is-open {
  stroke: rgba(229, 197, 119, 0.8);
  stroke-width: 2;
  stroke-dasharray: none;
}

#reincarnation-root .rl-map-edge.is-traveled {
  stroke: rgba(126, 173, 156, 0.62);
  stroke-width: 1.8;
  stroke-dasharray: none;
}

#reincarnation-root .rl-map-edge.is-current {
  stroke: rgba(239, 214, 145, 0.95);
}

#reincarnation-root .rl-map-layer {
  position: relative;
  z-index: 1;
  height: 82px;
}

#reincarnation-root .rl-map-node {
  position: absolute;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 104px;
  min-height: 72px;
  padding: 7px 6px 6px;
  border: 1px solid rgba(78, 69, 49, 0.38);
  border-radius: 11px;
  color: var(--rl-ink);
  background:
    linear-gradient(180deg, #fbf7ec, #e7dbc1);
  box-shadow: 0 5px 14px rgba(1, 10, 11, 0.3);
  text-align: center;
  transform: translate(-50%, -50%);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

#reincarnation-root .rl-map-node:not(:disabled) {
  cursor: pointer;
}

#reincarnation-root .rl-map-node:not(:disabled):hover {
  border-color: var(--rl-gold);
  box-shadow: 0 0 0 2px rgba(212, 185, 120, 0.22), 0 8px 20px rgba(1, 10, 11, 0.35);
}

#reincarnation-root .rl-map-node.is-available {
  border-color: rgba(199, 160, 79, 0.82);
  box-shadow: 0 0 0 2px rgba(223, 193, 123, 0.14), 0 0 24px rgba(218, 179, 91, 0.24);
}

#reincarnation-root .rl-map-node.is-current {
  border-color: var(--rl-cinnabar);
  box-shadow: 0 0 0 2px rgba(167, 58, 46, 0.18), 0 0 20px rgba(167, 58, 46, 0.16);
}

#reincarnation-root .rl-map-node.is-visited {
  color: #3f6251;
  background: linear-gradient(180deg, #e9efe1, #d7e2cf);
  border-color: rgba(74, 124, 93, 0.44);
}

#reincarnation-root .rl-map-node.is-future {
  opacity: 0.58;
  background: linear-gradient(180deg, #d9d7c9, #c8c6b8);
}

#reincarnation-root .rl-map-node.is-locked.is-future {
  opacity: 0.58;
}

#reincarnation-root .rl-map-node.is-locked:not(.is-future) {
  opacity: 0.43;
}

#reincarnation-root .rl-map-node.is-visited:disabled,
#reincarnation-root .rl-map-node.is-current:disabled {
  opacity: 1;
}

#reincarnation-root .rl-node-ico {
  width: 20px;
  height: 20px;
  color: var(--rl-teal);
}

#reincarnation-root .rl-node-boss .rl-node-ico {
  color: var(--rl-cinnabar);
}

#reincarnation-root .rl-node-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-family: var(--rl-serif);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#reincarnation-root .rl-node-type {
  color: var(--rl-muted);
  font-size: 10.5px;
  line-height: 1.25;
}

#reincarnation-root .rl-node-mark {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 1px;
  color: var(--rl-muted);
  font-size: 10px;
  line-height: 1.2;
}

#reincarnation-root .rl-node-mark .rl-ico {
  width: 11px;
  height: 11px;
}

#reincarnation-root .rl-map-node.is-available .rl-node-mark {
  color: #745217;
}

#reincarnation-root .rl-map-node.is-current .rl-node-mark {
  color: var(--rl-cinnabar-deep);
}

#reincarnation-root .rl-map-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 15px;
}

#reincarnation-root .rl-map-foot .rl-action-row {
  margin-top: 0;
}

/* ---------- 卡牌 ---------- */
#reincarnation-root .rl-card {
  --rl-card-accent: var(--rl-el-wu);
  position: relative;
  display: flex;
  flex: 0 0 152px;
  flex-direction: column;
  width: 152px;
  overflow: hidden;
  border: 1px solid rgba(77, 68, 48, 0.42);
  border-radius: 11px;
  background:
    linear-gradient(180deg, #fdf9ef, #efe4cd),
    repeating-linear-gradient(0deg, rgba(83, 62, 27, 0.035) 0, rgba(83, 62, 27, 0.035) 1px, transparent 1px, transparent 5px);
  box-shadow: 0 7px 16px rgba(8, 29, 29, 0.18), inset 0 0 0 1px rgba(255, 252, 244, 0.7);
}

#reincarnation-root .rl-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--rl-card-accent);
  opacity: 0.9;
  pointer-events: none;
}

#reincarnation-root .rl-card.rl-el-jin { --rl-card-accent: var(--rl-el-jin); }
#reincarnation-root .rl-card.rl-el-shui { --rl-card-accent: var(--rl-el-shui); }
#reincarnation-root .rl-card.rl-el-mu { --rl-card-accent: var(--rl-el-mu); }
#reincarnation-root .rl-card.rl-el-huo { --rl-card-accent: var(--rl-el-huo); }
#reincarnation-root .rl-card.rl-el-tu { --rl-card-accent: var(--rl-el-tu); }
#reincarnation-root .rl-card.rl-el-wu { --rl-card-accent: var(--rl-el-wu); }

#reincarnation-root .rl-card.rl-rarity-basic {
  border-color: rgba(84, 72, 48, 0.35);
}

#reincarnation-root .rl-card.rl-rarity-rare,
#reincarnation-root .rl-card.rl-rarity-epic,
#reincarnation-root .rl-card.rl-rarity-legendary {
  border-color: rgba(167, 127, 49, 0.62);
  box-shadow: 0 7px 18px rgba(8, 29, 29, 0.2), 0 0 0 1px rgba(212, 185, 120, 0.2);
}

#reincarnation-root .rl-card-face {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px 10px 0 0;
  color: var(--rl-ink);
  background: transparent;
  text-align: left;
}

#reincarnation-root button.rl-card-face {
  cursor: pointer;
}

#reincarnation-root button.rl-card-face:hover {
  background: rgba(255, 252, 243, 0.34);
}

#reincarnation-root .rl-card-cost {
  position: absolute;
  z-index: 2;
  top: 7px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 238, 212, 0.4);
  border-radius: 50%;
  color: #fff8e9;
  background: linear-gradient(145deg, var(--rl-cinnabar), var(--rl-cinnabar-deep));
  box-shadow: 0 2px 7px rgba(77, 22, 16, 0.3);
  font-family: var(--rl-serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

#reincarnation-root .rl-card-element {
  position: absolute;
  z-index: 2;
  top: 9px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 5px;
  color: var(--rl-card-accent);
  background: rgba(251, 247, 236, 0.92);
  font-family: var(--rl-serif);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

#reincarnation-root .rl-card-art {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  height: 88px;
  overflow: hidden;
  background:
    radial-gradient(circle at 46% 48%, rgba(216, 190, 125, 0.14), transparent 52%),
    linear-gradient(160deg, #264f4e, #113335);
}

#reincarnation-root .rl-card-art svg {
  width: 100%;
  height: 100%;
}

#reincarnation-root .rl-card-image {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

#reincarnation-root .rl-card-art::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  border-bottom: 1px solid rgba(77, 68, 48, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 235, 0.08);
  pointer-events: none;
}

#reincarnation-root .rl-art-ink { fill: none; stroke: rgba(237, 227, 204, 0.78); stroke-width: 3; stroke-linecap: round; }
#reincarnation-root .rl-art-line { fill: none; stroke: rgba(237, 227, 204, 0.44); stroke-width: 1.5; stroke-linecap: round; }
#reincarnation-root .rl-art-gold { fill: none; stroke: rgba(219, 185, 105, 0.94); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#reincarnation-root .rl-art-faint { fill: none; stroke: rgba(237, 227, 204, 0.16); stroke-width: 1.4; }

#reincarnation-root .rl-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  padding: 7px 9px 6px;
}

#reincarnation-root .rl-card-name-line {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 3px 5px;
}

#reincarnation-root .rl-card-name {
  font-family: var(--rl-serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

#reincarnation-root .rl-card-upgraded {
  display: inline-block;
  padding: 1px 4px;
  border: 1px solid rgba(167, 127, 49, 0.46);
  border-radius: 4px;
  color: #79571b;
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
}

#reincarnation-root .rl-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  color: var(--rl-muted);
  font-size: 12px;
  line-height: 1.35;
}

#reincarnation-root .rl-card-type-ico {
  width: 13px;
  height: 13px;
  color: var(--rl-card-accent);
}

#reincarnation-root .rl-card-dot {
  opacity: 0.46;
}

#reincarnation-root .rl-card-rarity {
  color: #7f6a3e;
}

#reincarnation-root .rl-card-text {
  flex: 1 1 auto;
  color: #38443d;
  font-size: 12.2px;
  line-height: 1.52;
  overflow-wrap: anywhere;
}

#reincarnation-root .rl-card-resonance {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  padding: 4px 5px;
  border: 1px solid rgba(167, 127, 49, 0.34);
  border-radius: 5px;
  color: #6e4d13;
  background: rgba(218, 190, 125, 0.18);
  font-size: 12px;
  line-height: 1.4;
}

#reincarnation-root .rl-card-resonance .rl-ico {
  width: 12px;
  height: 12px;
  margin-top: 1px;
}

#reincarnation-root .rl-card-compare {
  margin-top: 3px;
  padding-top: 5px;
  border-top: 1px dashed rgba(94, 82, 57, 0.3);
}

#reincarnation-root .rl-card-compare-label {
  display: block;
  color: var(--rl-muted);
  font-size: 10.5px;
  line-height: 1.3;
}

#reincarnation-root .rl-card-compare-label.is-after {
  margin-top: 4px;
  color: var(--rl-teal);
}

#reincarnation-root .rl-card-compare-text {
  color: var(--rl-ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

#reincarnation-root .rl-card-compare-text.is-after {
  color: #315d4d;
}

#reincarnation-root .rl-card-foot {
  flex: 0 0 auto;
  padding: 5px 7px 7px;
  border-top: 1px solid rgba(94, 82, 57, 0.2);
  background: rgba(230, 219, 193, 0.45);
}

#reincarnation-root .rl-card-foot .rl-btn {
  width: 100%;
  min-height: 44px;
  padding: 7px 8px;
  font-size: 12.5px;
}

#reincarnation-root .rl-card-foot .rl-reason {
  margin-top: 3px;
  text-align: center;
  font-size: 10.5px;
}

#reincarnation-root .rl-card.is-unaffordable {
  border-color: rgba(155, 48, 37, 0.48);
}

#reincarnation-root .rl-card.is-unaffordable .rl-card-cost {
  background: linear-gradient(145deg, #8d5148, #6c3b34);
}

#reincarnation-root .rl-card.is-previewed {
  outline: 3px solid rgba(212, 185, 120, 0.82);
  outline-offset: 1px;
}

#reincarnation-root .rl-card.is-resonant {
  border-color: rgba(166, 126, 42, 0.78);
}

/* 静态卡（牌堆、奖励、坊市） */
#reincarnation-root .rl-pile-grid .rl-card,
#reincarnation-root .rl-reward-choice,
#reincarnation-root .rl-shop-card {
  width: 100%;
  max-width: 260px;
  flex: none;
}

#reincarnation-root .rl-shop-card {
  max-width: 100%;
}

#reincarnation-root .rl-pile-grid .rl-card-face,
#reincarnation-root .rl-reward-choice .rl-card-face,
#reincarnation-root .rl-shop-card .rl-card-face {
  cursor: default;
}

#reincarnation-root .rl-choice-foot {
  padding: 8px;
  border-top: 1px solid rgba(94, 82, 57, 0.22);
  background: rgba(230, 219, 193, 0.5);
}

#reincarnation-root .rl-choice-foot .rl-btn {
  width: 100%;
}

/* ---------- 战斗 ---------- */
#reincarnation-root .rl-combat-screen {
  max-width: 1180px;
  padding-bottom: 128px;
}

#reincarnation-root .rl-arena {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 1.04fr) minmax(0, 1fr);
  gap: clamp(10px, 1.8vw, 22px);
  padding: clamp(12px, 2.2vw, 22px);
  overflow: hidden;
  border: 1px solid rgba(190, 155, 85, 0.38);
  border-radius: 16px;
  color: var(--rl-paper);
  background:
    radial-gradient(circle at 50% 18%, rgba(90, 140, 129, 0.18), transparent 40%),
    radial-gradient(circle at 8% 90%, rgba(167, 58, 46, 0.12), transparent 36%),
    linear-gradient(180deg, #163a3c, #0b2528);
  box-shadow: 0 18px 45px rgba(2, 14, 15, 0.42), inset 0 0 0 1px rgba(236, 220, 181, 0.05);
}

#reincarnation-root .rl-arena::before {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  bottom: 7px;
  left: 7px;
  border: 1px solid rgba(212, 185, 120, 0.13);
  border-radius: 11px;
  pointer-events: none;
}

#reincarnation-root .rl-arena.is-boss {
  border-color: rgba(205, 165, 82, 0.55);
  background:
    radial-gradient(circle at 50% 10%, rgba(167, 58, 46, 0.22), transparent 44%),
    radial-gradient(circle at 82% 82%, rgba(167, 127, 49, 0.11), transparent 36%),
    linear-gradient(180deg, #183b3c, #0b2326);
}

#reincarnation-root .rl-fighter {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

#reincarnation-root .rl-portrait-frame {
  position: relative;
  display: grid;
  place-items: center;
  align-self: center;
  width: 100%;
  max-width: 186px;
  aspect-ratio: 0.84;
  overflow: hidden;
  border: 1px solid rgba(212, 185, 120, 0.4);
  border-radius: 9px;
  background:
    radial-gradient(circle at 50% 38%, rgba(212, 185, 120, 0.13), transparent 48%),
    linear-gradient(170deg, #285153, #0d2b2e);
  box-shadow: 0 10px 24px rgba(2, 12, 13, 0.36), inset 0 0 0 3px rgba(9, 31, 33, 0.65);
}

#reincarnation-root .rl-portrait-frame::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  bottom: 4px;
  left: 4px;
  border: 1px solid rgba(237, 225, 194, 0.12);
  border-radius: 5px;
  pointer-events: none;
}

#reincarnation-root .rl-enemy .rl-portrait-frame {
  border-color: rgba(196, 144, 105, 0.45);
  background:
    radial-gradient(circle at 50% 38%, rgba(167, 58, 46, 0.17), transparent 48%),
    linear-gradient(170deg, #3b3131, #1c2628);
}

#reincarnation-root .rl-enemy.is-boss .rl-portrait-frame {
  max-width: 200px;
  border-color: rgba(218, 177, 91, 0.62);
  box-shadow: 0 0 28px rgba(190, 147, 65, 0.2), 0 10px 24px rgba(2, 12, 13, 0.4);
}

#reincarnation-root .rl-portrait-img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

#reincarnation-root .rl-enemy .rl-portrait-img {
  object-position: center 24%;
}

#reincarnation-root .rl-portrait-fallback {
  color: rgba(237, 225, 194, 0.3);
  font-family: var(--rl-serif);
  font-size: 78px;
  line-height: 1;
}

#reincarnation-root .rl-portrait-frame.is-missing .rl-portrait-fallback {
  opacity: 1;
}

#reincarnation-root .rl-portrait-frame.is-image-fallback:not(.is-missing) > .rl-sigil {
  visibility: hidden;
}

#reincarnation-root .rl-sigil-frame {
  border-color: rgba(179, 139, 72, 0.4);
}

#reincarnation-root .rl-sigil {
  position: relative;
  display: grid;
  place-items: center;
  width: 78%;
  aspect-ratio: 1;
  border: 1px solid rgba(212, 185, 120, 0.32);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(167, 127, 49, 0.16), rgba(8, 28, 29, 0.28) 58%, transparent 59%);
}

#reincarnation-root .rl-sigil-ring {
  position: absolute;
  top: 9%;
  right: 9%;
  bottom: 9%;
  left: 9%;
  border: 1px dashed rgba(212, 185, 120, 0.36);
  border-radius: 50%;
}

#reincarnation-root .rl-sigil-ring-2 {
  top: 22%;
  right: 22%;
  bottom: 22%;
  left: 22%;
  border-style: solid;
  border-color: rgba(167, 58, 46, 0.44);
}

#reincarnation-root .rl-sigil-glyph {
  position: relative;
  z-index: 1;
  color: rgba(237, 225, 194, 0.8);
  font-family: var(--rl-serif);
  font-size: clamp(42px, 6vw, 64px);
  line-height: 1;
  text-shadow: 0 0 22px rgba(212, 185, 120, 0.26);
}

#reincarnation-root .rl-fighter-info {
  min-width: 0;
}

#reincarnation-root .rl-fighter-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 7px;
}

#reincarnation-root .rl-fighter-name {
  font-family: var(--rl-serif);
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.25;
  letter-spacing: 0.04em;
}

#reincarnation-root .rl-fighter-sub {
  color: rgba(244, 237, 221, 0.56);
  font-size: 11px;
  letter-spacing: 0.08em;
}

#reincarnation-root .rl-hp {
  margin-top: 5px;
}

#reincarnation-root .rl-hp-text {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: rgba(244, 237, 221, 0.66);
  font-size: 11.5px;
}

#reincarnation-root .rl-hp-number {
  color: var(--rl-paper);
  font-size: 13px;
}

#reincarnation-root .rl-hp-bar {
  position: relative;
  height: 8px;
  margin-top: 3px;
  overflow: hidden;
  border: 1px solid rgba(244, 237, 221, 0.14);
  border-radius: 999px;
  background: rgba(4, 17, 18, 0.5);
}

#reincarnation-root .rl-hp-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #46705f, #8daf81);
  transition: width 0.2s ease;
}

#reincarnation-root .rl-hp-fill.is-enemy {
  background: linear-gradient(90deg, #87362e, #c46850);
}

#reincarnation-root .rl-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

#reincarnation-root .rl-block-chip,
#reincarnation-root .rl-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border: 1px solid rgba(104, 160, 158, 0.42);
  border-radius: 999px;
  color: #cbe6e0;
  background: rgba(69, 128, 126, 0.2);
  font-size: 11.5px;
  line-height: 1.4;
}

#reincarnation-root .rl-block-chip .rl-ico {
  width: 12px;
  height: 12px;
}

#reincarnation-root .rl-badge-boss {
  color: #ffdf9e;
  border-color: rgba(212, 185, 120, 0.5);
  background: rgba(167, 58, 46, 0.2);
}

#reincarnation-root .rl-badge-up {
  color: #7a5b1e;
  border-color: rgba(167, 127, 49, 0.44);
  background: rgba(218, 190, 125, 0.16);
}

#reincarnation-root .rl-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

#reincarnation-root .rl-status-row-label {
  color: rgba(244, 237, 221, 0.45);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

#reincarnation-root .rl-status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border: 1px solid rgba(224, 199, 141, 0.26);
  border-radius: 5px;
  color: #ecd9ad;
  background: rgba(167, 127, 49, 0.1);
  font-size: 11px;
  line-height: 1.35;
}

#reincarnation-root .rl-status-ico {
  width: 11px;
  height: 11px;
  opacity: 0.75;
}

#reincarnation-root .rl-status-name {
  font-weight: 600;
}

#reincarnation-root .rl-status-value {
  font-size: 11px;
}

#reincarnation-root .rl-status-detail {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}

#reincarnation-root .rl-status-summary {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 22px;
  padding: 2px 6px;
  border: 1px solid rgba(224, 199, 141, 0.26);
  border-radius: 5px;
  color: #ecd9ad;
  background: rgba(167, 127, 49, 0.1);
  font-size: 11px;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}

#reincarnation-root .rl-status-summary::-webkit-details-marker {
  display: none;
}

#reincarnation-root .rl-status-summary::after {
  content: "?";
  display: inline-grid;
  place-items: center;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(236, 217, 173, 0.5);
  border-radius: 50%;
  font-size: 8px;
  line-height: 1;
}

#reincarnation-root .rl-status-explain {
  margin-top: 4px;
  padding: 5px 6px;
  border-left: 2px solid rgba(212, 185, 120, 0.4);
  color: rgba(244, 237, 221, 0.64);
  font-size: 10.5px;
  line-height: 1.55;
}

#reincarnation-root .rl-status-detail[open] {
  flex-basis: 100%;
}

#reincarnation-root .rl-intent {
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid rgba(221, 185, 114, 0.42);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(247, 238, 216, 0.13), rgba(247, 238, 216, 0.06));
  box-shadow: inset 0 0 0 1px rgba(255, 249, 232, 0.04);
}

#reincarnation-root .rl-intent-guard,
#reincarnation-root .rl-intent-cast {
  border-color: rgba(111, 172, 161, 0.42);
}

#reincarnation-root .rl-intent-heavy {
  border-color: rgba(218, 131, 91, 0.62);
  background: linear-gradient(180deg, rgba(167, 58, 46, 0.21), rgba(167, 58, 46, 0.07));
}

#reincarnation-root .rl-intent-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

#reincarnation-root .rl-intent-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid rgba(236, 217, 173, 0.38);
  border-radius: 6px;
  color: #f0d59d;
  background: rgba(167, 127, 49, 0.13);
}

#reincarnation-root .rl-intent-icon .rl-ico {
  width: 17px;
  height: 17px;
}

#reincarnation-root .rl-intent-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#reincarnation-root .rl-intent-label {
  color: #fff6e4;
  font-family: var(--rl-serif);
  font-size: 16px;
  line-height: 1.3;
}

#reincarnation-root .rl-intent-public {
  color: rgba(244, 237, 221, 0.5);
  font-size: 10px;
  letter-spacing: 0.09em;
}

#reincarnation-root .rl-intent-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}

#reincarnation-root .rl-intent-damage,
#reincarnation-root .rl-intent-block {
  font-size: 19px;
  line-height: 1.25;
}

#reincarnation-root .rl-intent-damage {
  color: #ffb6a5;
}

#reincarnation-root .rl-intent-block {
  color: #b8ddd4;
}

#reincarnation-root .rl-intent-variable {
  color: rgba(244, 237, 221, 0.65);
  font-size: 12px;
}

#reincarnation-root .rl-intent-text {
  margin-top: 3px;
  color: rgba(244, 237, 221, 0.74);
  font-size: 12px;
  line-height: 1.55;
}

#reincarnation-root .rl-intent-warning {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(235, 150, 120, 0.3);
  color: #ffc4b2;
  font-size: 11px;
  line-height: 1.5;
}

#reincarnation-root .rl-intent.is-unknown {
  border-style: dashed;
}

#reincarnation-root .rl-arena-center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  padding: 4px 2px;
}

#reincarnation-root .rl-turn-seal {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border: 1px solid rgba(212, 185, 120, 0.38);
  border-radius: 999px;
  background: rgba(8, 28, 29, 0.45);
}

#reincarnation-root .rl-turn-label {
  color: rgba(244, 237, 221, 0.55);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

#reincarnation-root .rl-turn-value {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #f6e4b9;
  background: rgba(167, 127, 49, 0.18);
  font-family: var(--rl-serif);
  font-size: 14px;
}

#reincarnation-root .rl-energy {
  padding: 8px 10px;
  border: 1px solid rgba(105, 168, 166, 0.32);
  border-radius: 8px;
  background: rgba(49, 113, 112, 0.12);
}

#reincarnation-root .rl-energy-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

#reincarnation-root .rl-energy-label {
  color: rgba(219, 237, 231, 0.7);
  font-size: 11.5px;
}

#reincarnation-root .rl-energy-value {
  color: #d9f0e8;
  font-size: 15px;
  line-height: 1.2;
}

#reincarnation-root .rl-energy-pips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}

#reincarnation-root .rl-energy-pip {
  width: 14px;
  height: 8px;
  border: 1px solid rgba(155, 205, 190, 0.3);
  border-radius: 999px;
  background: rgba(9, 34, 34, 0.5);
}

#reincarnation-root .rl-energy-pip.is-on {
  border-color: rgba(205, 231, 215, 0.52);
  background: linear-gradient(90deg, #79b7a3, #c1dfc9);
  box-shadow: 0 0 7px rgba(160, 210, 188, 0.2);
}

#reincarnation-root .rl-energy-pip.is-over {
  border-color: rgba(239, 207, 132, 0.64);
  background: linear-gradient(90deg, #c5a052, #efd28d);
  box-shadow: 0 0 8px rgba(223, 190, 112, 0.28);
}

#reincarnation-root .rl-energy-note {
  margin-top: 3px;
  color: #e8cba1;
  font-size: 10.5px;
  line-height: 1.45;
}

#reincarnation-root .rl-element-wrap {
  padding: 7px 9px;
  border: 1px solid rgba(212, 185, 120, 0.27);
  border-radius: 8px;
  background: rgba(8, 28, 29, 0.3);
}

#reincarnation-root .rl-element-chain {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
}

#reincarnation-root .rl-element-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 38px;
  border: 1px solid rgba(244, 237, 221, 0.16);
  border-radius: 5px;
  color: rgba(244, 237, 221, 0.68);
  background: rgba(255, 255, 255, 0.03);
  line-height: 1;
}

#reincarnation-root .rl-element-char {
  font-family: var(--rl-serif);
  font-size: 17px;
  font-weight: 700;
}

#reincarnation-root .rl-element-node.rl-el-jin { color: #e6c26f; }
#reincarnation-root .rl-element-node.rl-el-shui { color: #9fcbe0; }
#reincarnation-root .rl-element-node.rl-el-mu { color: #a9d29b; }
#reincarnation-root .rl-element-node.rl-el-huo { color: #ef9b7f; }
#reincarnation-root .rl-element-node.rl-el-tu { color: #d8bd8d; }

#reincarnation-root .rl-element-node.is-last {
  border-color: rgba(244, 237, 221, 0.62);
  background: rgba(244, 237, 221, 0.1);
  box-shadow: 0 0 0 1px rgba(244, 237, 221, 0.1);
}

#reincarnation-root .rl-element-node.is-next {
  border-color: rgba(221, 185, 114, 0.8);
  background: rgba(167, 127, 49, 0.16);
  box-shadow: 0 0 11px rgba(212, 185, 120, 0.16);
}

#reincarnation-root .rl-element-tag {
  margin-top: 2px;
  color: rgba(244, 237, 221, 0.6);
  font-size: 8px;
  line-height: 1.2;
  white-space: nowrap;
}

#reincarnation-root .rl-element-arrow {
  color: rgba(244, 237, 221, 0.28);
  font-size: 14px;
  line-height: 1;
}

#reincarnation-root .rl-chain-hint {
  margin-top: 5px;
  color: rgba(244, 237, 221, 0.71);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

#reincarnation-root .rl-chain-rule {
  color: rgba(244, 237, 221, 0.5);
  font-size: 10.5px;
  line-height: 1.5;
  text-align: center;
}

#reincarnation-root .rl-resonance {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 4px;
  color: #e3ca8f;
  font-size: 11px;
}

#reincarnation-root .rl-resonance .rl-ico {
  width: 12px;
  height: 12px;
}

#reincarnation-root .rl-battle-log {
  margin-top: 8px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(190, 155, 85, 0.3);
  border-radius: 9px;
  background: linear-gradient(180deg, #133537, #0b2629);
  color: var(--rl-paper);
  box-shadow: 0 8px 22px rgba(2, 14, 15, 0.28);
}

#reincarnation-root .rl-log-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 10px;
  cursor: pointer;
  list-style: none;
}

#reincarnation-root .rl-log-head::-webkit-details-marker {
  display: none;
}

#reincarnation-root .rl-log-head .rl-ico {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--rl-gold-soft);
}

#reincarnation-root .rl-log-title {
  flex: 0 0 auto;
  font-family: var(--rl-serif);
  font-size: 13.5px;
  line-height: 1.3;
}

#reincarnation-root .rl-log-peek {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: rgba(244, 237, 221, 0.6);
  font-size: 11.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#reincarnation-root .rl-battle-log[open] .rl-log-peek {
  color: rgba(244, 237, 221, 0.42);
}

#reincarnation-root .rl-log-sub {
  flex: 0 0 auto;
  margin-left: auto;
  color: rgba(224, 199, 141, 0.7);
  font-size: 10.5px;
}

#reincarnation-root .rl-log-sub::after {
  content: " ▾";
}

#reincarnation-root .rl-battle-log[open] .rl-log-sub::after {
  content: " ▴";
}

#reincarnation-root .rl-log-lines {
  max-height: 96px;
  overflow-y: auto;
  padding: 4px 10px 8px;
  border-top: 1px solid rgba(212, 185, 120, 0.16);
  scrollbar-width: thin;
}

#reincarnation-root .rl-log-line {
  color: rgba(244, 237, 221, 0.65);
  font-size: 11.5px;
  line-height: 1.5;
}

#reincarnation-root .rl-log-line.is-latest {
  color: #f2dfb2;
}

#reincarnation-root .rl-log-line.is-empty {
  color: rgba(244, 237, 221, 0.4);
}

#reincarnation-root .rl-preview {
  margin-top: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(84, 95, 73, 0.28);
  border-radius: 9px;
  background: rgba(251, 247, 236, 0.9);
  color: var(--rl-ink);
  box-shadow: 0 6px 16px rgba(7, 28, 28, 0.12);
}

#reincarnation-root .rl-preview.is-idle {
  padding: 6px 10px;
}

#reincarnation-root .rl-preview.is-idle .rl-preview-idle {
  align-items: center;
}

#reincarnation-root .rl-preview.is-idle .rl-preview-title {
  font-size: 13px;
}

#reincarnation-root .rl-preview.is-idle .rl-preview-text {
  margin-top: 1px;
  color: var(--rl-muted);
  font-size: 12px;
  line-height: 1.4;
}

#reincarnation-root .rl-preview.is-idle .rl-preview-hint {
  display: none;
}

#reincarnation-root .rl-preview.is-resonant {
  border-color: rgba(167, 127, 49, 0.55);
  background: linear-gradient(180deg, rgba(251, 247, 236, 0.96), rgba(237, 222, 185, 0.9));
}

#reincarnation-root .rl-preview-idle {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

#reincarnation-root .rl-preview-idle > .rl-ico {
  width: 21px;
  height: 21px;
  margin-top: 1px;
  color: var(--rl-gold);
}

#reincarnation-root .rl-preview-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
}

#reincarnation-root .rl-preview-element {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-family: var(--rl-serif);
  font-size: 12px;
  line-height: 1;
}

#reincarnation-root .rl-preview-element.rl-el-jin { color: var(--rl-el-jin); }
#reincarnation-root .rl-preview-element.rl-el-shui { color: var(--rl-el-shui); }
#reincarnation-root .rl-preview-element.rl-el-mu { color: var(--rl-el-mu); }
#reincarnation-root .rl-preview-element.rl-el-huo { color: var(--rl-el-huo); }
#reincarnation-root .rl-preview-element.rl-el-tu { color: var(--rl-el-tu); }
#reincarnation-root .rl-preview-element.rl-el-wu { color: var(--rl-el-wu); }

#reincarnation-root .rl-preview-title {
  font-family: var(--rl-serif);
  font-size: 15px;
  line-height: 1.3;
}

#reincarnation-root .rl-preview-resonance {
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid var(--rl-line);
  border-radius: 999px;
  color: var(--rl-muted);
  font-size: 11px;
  white-space: nowrap;
}

#reincarnation-root .rl-preview-resonance.is-on {
  color: #725319;
  border-color: rgba(167, 127, 49, 0.48);
  background: rgba(218, 190, 125, 0.18);
}

#reincarnation-root .rl-preview-text {
  margin-top: 4px;
  color: var(--rl-ink-soft);
  font-size: 12.5px;
  line-height: 1.6;
}

#reincarnation-root .rl-preview-hint {
  margin-top: 2px;
  color: var(--rl-muted);
  font-size: 12px;
  line-height: 1.55;
}

#reincarnation-root .rl-preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

#reincarnation-root .rl-preview-stats .rl-pill.is-damage {
  color: var(--rl-cinnabar-deep);
  border-color: rgba(167, 58, 46, 0.3);
  background: rgba(167, 58, 46, 0.07);
}

#reincarnation-root .rl-preview-stats .rl-pill.is-damage .rl-pill-value {
  color: var(--rl-cinnabar-deep);
}

#reincarnation-root .rl-preview-stats .rl-pill.is-block {
  color: var(--rl-teal);
}

#reincarnation-root .rl-preview-stats .rl-pill.is-block .rl-pill-value {
  color: var(--rl-teal);
}

#reincarnation-root .rl-preview-warning {
  margin-top: 5px;
  color: var(--rl-cinnabar-deep);
  font-size: 12px;
  line-height: 1.55;
}

/* ---------- 手牌与战斗底栏 ---------- */
#reincarnation-root .rl-hand-wrap {
  margin-top: 12px;
  padding: 10px 0 4px;
  border-top: 1px solid rgba(212, 185, 120, 0.2);
}

#reincarnation-root .rl-hand-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 7px;
  color: var(--rl-paper);
}

#reincarnation-root .rl-hand-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

#reincarnation-root .rl-hand-title h3 {
  font-family: var(--rl-serif);
  font-size: 17px;
  letter-spacing: 0.05em;
}

#reincarnation-root .rl-hand-count {
  color: rgba(244, 237, 221, 0.52);
  font-size: 11.5px;
}

#reincarnation-root .rl-hand-hint {
  color: rgba(244, 237, 221, 0.46);
  font-size: 10.5px;
  line-height: 1.4;
  text-align: right;
}

#reincarnation-root .rl-hand {
  display: flex;
  align-items: stretch;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px 2px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 185, 120, 0.46) rgba(5, 20, 21, 0.35);
  overscroll-behavior-x: contain;
}

#reincarnation-root .rl-hand::-webkit-scrollbar {
  height: 8px;
}

#reincarnation-root .rl-hand::-webkit-scrollbar-thumb {
  background: rgba(212, 185, 120, 0.46);
  border-radius: 999px;
}

#reincarnation-root .rl-hand .rl-card {
  scroll-snap-align: start;
}

#reincarnation-root .rl-hand-empty {
  padding: 22px 14px;
  border: 1px dashed rgba(244, 237, 221, 0.22);
  border-radius: 9px;
  color: rgba(244, 237, 221, 0.55);
  font-size: 12px;
}

#reincarnation-root .rl-combat-bar {
  position: fixed;
  z-index: 12;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 74px;
  padding: 9px max(12px, calc((100vw - 1180px) / 2)) calc(9px + env(safe-area-inset-bottom, 0px));
  color: var(--rl-paper);
  background:
    linear-gradient(180deg, rgba(12, 37, 39, 0.96), rgba(7, 25, 27, 0.99));
  border-top: 1px solid rgba(212, 185, 120, 0.34);
  box-shadow: 0 -10px 28px rgba(3, 14, 15, 0.38);
  backdrop-filter: blur(6px);
}

#reincarnation-root .rl-pile-buttons {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

#reincarnation-root .rl-pile-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 54px;
  min-height: 46px;
  padding: 3px 7px;
  border: 1px solid rgba(244, 237, 221, 0.2);
  border-radius: 7px;
  color: rgba(244, 237, 221, 0.72);
  background: rgba(244, 237, 221, 0.035);
  cursor: pointer;
}

#reincarnation-root .rl-pile-btn:hover {
  color: var(--rl-paper);
  border-color: rgba(212, 185, 120, 0.42);
  background: rgba(244, 237, 221, 0.08);
}

#reincarnation-root .rl-pile-btn .rl-ico {
  width: 15px;
  height: 15px;
}

#reincarnation-root .rl-pile-btn-label {
  font-size: 9.5px;
  line-height: 1.2;
}

#reincarnation-root .rl-pile-btn-count {
  color: #f0d799;
  font-size: 12px;
  line-height: 1.15;
}

#reincarnation-root .rl-end-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-left: auto;
}

#reincarnation-root .rl-end-turn {
  min-width: 154px;
  min-height: 48px;
  font-size: 15px;
  white-space: nowrap;
}

#reincarnation-root .rl-end-note {
  color: rgba(244, 237, 221, 0.42);
  font-size: 9.5px;
  line-height: 1.25;
  white-space: nowrap;
}

#reincarnation-root .rl-combat-abandon {
  min-height: 42px;
  padding: 6px 10px;
  font-size: 11.5px;
}

/* ---------- 道果小图 ---------- */
#reincarnation-root .rl-relic-thumb {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  overflow: hidden;
  border: 1px solid rgba(167, 127, 49, 0.36);
  border-radius: 4px;
  color: var(--rl-gold-deep);
  background:
    radial-gradient(circle, rgba(218, 190, 125, 0.2), transparent 68%),
    rgba(245, 237, 217, 0.7);
}

#reincarnation-root .rl-relic-thumb .rl-ico {
  width: 13px;
  height: 13px;
  opacity: 0.66;
}

#reincarnation-root .rl-relic-img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

#reincarnation-root .rl-chip-relic-thumb {
  width: 19px;
  height: 19px;
  margin-left: -2px;
  border-color: rgba(229, 197, 119, 0.32);
  background: rgba(255, 250, 236, 0.12);
}

#reincarnation-root .rl-chip-relic-thumb .rl-ico {
  color: #edd9a5;
}

#reincarnation-root .rl-archetype-relic-thumb {
  width: 46px;
  height: 46px;
  border-radius: 6px;
}

#reincarnation-root .rl-arch-relic-thumb {
  width: 58px;
  height: 58px;
  border-radius: 7px;
}

#reincarnation-root .rl-reward-relic-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
}

#reincarnation-root .rl-unlock-relic-thumb {
  width: 18px;
  height: 18px;
  border-radius: 3px;
}

#reincarnation-root .rl-shop-relic-thumb {
  width: 100%;
  height: 100%;
  min-height: 94px;
  border: 0;
  border-radius: 0;
  background: rgba(9, 31, 33, 0.7);
}

#reincarnation-root .rl-shop-relic-thumb .rl-ico {
  width: 40px;
  height: 40px;
  color: var(--rl-gold);
  opacity: 0.72;
}

/* ---------- 战利品 ---------- */
#reincarnation-root .rl-reward-screen .rl-reward-summary {
  margin-bottom: 14px;
}

#reincarnation-root .rl-reward-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--rl-line);
  border-radius: 11px;
  background: rgba(255, 252, 244, 0.68);
}

#reincarnation-root .rl-reward-gain,
#reincarnation-root .rl-reward-gold,
#reincarnation-root .rl-reward-relic,
#reincarnation-root .rl-relic-box {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

#reincarnation-root .rl-reward-gain > .rl-ico,
#reincarnation-root .rl-reward-gold > .rl-ico,
#reincarnation-root .rl-reward-relic > .rl-ico,
#reincarnation-root .rl-relic-box > .rl-ico {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  color: var(--rl-gold);
}

#reincarnation-root .rl-reward-gain-label,
#reincarnation-root .rl-reward-gold-text {
  color: var(--rl-muted);
  font-size: 12px;
}

#reincarnation-root .rl-reward-gain-value,
#reincarnation-root .rl-reward-gold-value {
  display: block;
  color: var(--rl-ink);
  font-family: var(--rl-serif);
  font-size: 19px;
  line-height: 1.25;
}

#reincarnation-root .rl-relic-name {
  display: block;
  color: var(--rl-ink);
  font-family: var(--rl-serif);
  font-size: 14px;
  line-height: 1.35;
}

#reincarnation-root .rl-relic-text {
  margin-top: 2px;
  color: var(--rl-muted);
  font-size: 12px;
  line-height: 1.5;
}

#reincarnation-root .rl-reward-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

#reincarnation-root .rl-reward-choice {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#reincarnation-root .rl-reward-choice .rl-card {
  flex: 1 1 auto;
  max-width: none;
}

#reincarnation-root .rl-reward-foot {
  justify-content: center;
}

/* ---------- 奇遇 ---------- */
#reincarnation-root .rl-event-scroll {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  overflow: hidden;
  border: 1px solid rgba(122, 96, 50, 0.38);
  border-radius: 11px;
  background:
    radial-gradient(circle at 100% 0, rgba(167, 58, 46, 0.07), transparent 35%),
    linear-gradient(180deg, #fbf6e9, #eadcc0);
  box-shadow: inset 0 0 28px rgba(122, 96, 50, 0.08);
}

#reincarnation-root .rl-event-scroll::after {
  content: "";
  position: absolute;
  top: 0;
  right: 16px;
  bottom: 0;
  width: 1px;
  background: rgba(122, 96, 50, 0.14);
}

#reincarnation-root .rl-event-seal {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(167, 58, 46, 0.6);
  border-radius: 4px;
  color: var(--rl-cinnabar);
  font-family: var(--rl-serif);
  font-size: 21px;
  line-height: 1;
}

#reincarnation-root .rl-event-body {
  min-width: 0;
}

#reincarnation-root .rl-event-text {
  color: #3b463f;
  font-family: var(--rl-serif);
  font-size: 15px;
  line-height: 1.95;
  white-space: pre-line;
}

#reincarnation-root .rl-event-options {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

#reincarnation-root .rl-event-option {
  display: block;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(74, 92, 80, 0.34);
  border-radius: 9px;
  color: var(--rl-ink);
  background: rgba(255, 252, 245, 0.75);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

#reincarnation-root .rl-event-option:hover:not(:disabled) {
  border-color: rgba(167, 127, 49, 0.62);
  background: #fffcf3;
}

#reincarnation-root .rl-event-option.is-disabled,
#reincarnation-root .rl-event-option:disabled {
  cursor: not-allowed;
  opacity: 0.64;
  background: rgba(230, 223, 207, 0.66);
}

#reincarnation-root .rl-event-option-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#reincarnation-root .rl-event-option-head .rl-ico {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--rl-gold);
}

#reincarnation-root .rl-event-option-label {
  font-family: var(--rl-serif);
  font-size: 16px;
  line-height: 1.4;
}

#reincarnation-root .rl-event-option-text {
  display: block;
  margin-top: 3px;
  color: var(--rl-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

#reincarnation-root .rl-event-option .rl-reason {
  margin-top: 4px;
}

#reincarnation-root .rl-event-foot {
  margin-top: 14px;
}

/* ---------- 坊市 ---------- */
#reincarnation-root .rl-shop-wallet {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 13px;
  padding: 6px 11px;
  border: 1px solid rgba(167, 127, 49, 0.32);
  border-radius: 999px;
  color: var(--rl-muted);
  background: rgba(218, 190, 125, 0.12);
  font-size: 12px;
}

#reincarnation-root .rl-shop-wallet .rl-ico {
  width: 16px;
  height: 16px;
  color: var(--rl-gold);
}

#reincarnation-root .rl-shop-wallet strong {
  color: var(--rl-ink);
  font-size: 17px;
}

#reincarnation-root .rl-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 11px;
  align-items: stretch;
}

#reincarnation-root .rl-shop-item {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(74, 87, 70, 0.28);
  border-radius: 10px;
  background: rgba(255, 252, 245, 0.74);
  box-shadow: 0 5px 14px rgba(15, 35, 32, 0.08);
}

#reincarnation-root .rl-shop-item.is-sold {
  opacity: 0.6;
}

#reincarnation-root .rl-shop-card {
  width: 100%;
  flex: 1 1 auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#reincarnation-root .rl-shop-card-label {
  padding: 4px 10px;
}

#reincarnation-root .rl-shop-relic-art {
  display: grid;
  place-items: center;
  min-height: 94px;
  color: var(--rl-gold);
  background:
    radial-gradient(circle, rgba(218, 190, 125, 0.18), transparent 55%),
    linear-gradient(160deg, #204a49, #0d2c2e);
}

#reincarnation-root .rl-shop-relic-art .rl-ico {
  width: 44px;
  height: 44px;
}

#reincarnation-root .rl-shop-body {
  padding: 8px 11px;
}

#reincarnation-root .rl-shop-kind {
  color: var(--rl-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

#reincarnation-root .rl-shop-name {
  margin-top: 2px;
  font-family: var(--rl-serif);
  font-size: 17px;
  line-height: 1.35;
}

#reincarnation-root .rl-shop-text {
  margin-top: 3px;
  color: var(--rl-ink-soft);
  font-size: 12.5px;
  line-height: 1.6;
}

#reincarnation-root .rl-shop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding: 8px 10px;
  border-top: 1px solid rgba(74, 87, 70, 0.18);
  background: rgba(231, 222, 200, 0.4);
}

#reincarnation-root .rl-shop-foot .rl-btn {
  min-height: 44px;
}

#reincarnation-root .rl-shop-foot .rl-reason {
  flex-basis: 100%;
  margin: 0;
}

#reincarnation-root .rl-shop-remove {
  margin-top: 15px;
  border: 1px solid rgba(74, 87, 70, 0.28);
  border-radius: 10px;
  background: rgba(255, 252, 245, 0.58);
}

#reincarnation-root .rl-shop-remove-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 9px 12px;
  color: var(--rl-ink);
  cursor: pointer;
  list-style: none;
}

#reincarnation-root .rl-shop-remove-summary::-webkit-details-marker {
  display: none;
}

#reincarnation-root .rl-shop-remove-summary .rl-ico {
  width: 18px;
  height: 18px;
  color: var(--rl-cinnabar);
}

#reincarnation-root .rl-shop-remove-title {
  font-family: var(--rl-serif);
  font-size: 15px;
}

#reincarnation-root .rl-shop-remove-cost {
  margin-left: auto;
  color: var(--rl-gold-deep);
  font-size: 12px;
}

#reincarnation-root .rl-shop-remove-summary::after {
  content: "+";
  color: var(--rl-muted);
  font-size: 17px;
  line-height: 1;
}

#reincarnation-root .rl-shop-remove[open] .rl-shop-remove-summary::after {
  content: "−";
}

#reincarnation-root .rl-shop-remove-body {
  padding: 0 12px 12px;
  border-top: 1px solid rgba(74, 87, 70, 0.16);
}

#reincarnation-root .rl-shop-remove-note {
  margin: 9px 0;
  color: var(--rl-muted);
  font-size: 12px;
  line-height: 1.55;
}

#reincarnation-root .rl-shop-foot:last-child {
  justify-content: flex-start;
}

/* ---------- 休整 / 丹炉 ---------- */
#reincarnation-root .rl-rest-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 13px;
  padding: 11px 13px;
  border: 1px solid var(--rl-line);
  border-radius: 10px;
  background: rgba(255, 252, 244, 0.65);
}

#reincarnation-root .rl-rest-hp {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 155px;
}

#reincarnation-root .rl-rest-hp > .rl-ico {
  width: 22px;
  height: 22px;
  color: var(--rl-cinnabar);
}

#reincarnation-root .rl-rest-hp-label {
  display: block;
  color: var(--rl-muted);
  font-size: 11.5px;
}

#reincarnation-root .rl-rest-hp-value {
  display: block;
  color: var(--rl-ink);
  font-family: var(--rl-serif);
  font-size: 19px;
  line-height: 1.3;
}

#reincarnation-root .rl-rest-status .rl-hp {
  flex: 1 1 220px;
  margin: 0;
}

#reincarnation-root .rl-rest-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}

#reincarnation-root .rl-rest-heal,
#reincarnation-root .rl-rest-upgrade {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(74, 92, 80, 0.32);
  border-radius: 10px;
  background:
    radial-gradient(circle at 0 0, rgba(218, 190, 125, 0.14), transparent 42%),
    rgba(255, 252, 245, 0.68);
}

#reincarnation-root .rl-rest-art {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 55px;
  height: 55px;
  border: 1px solid rgba(167, 127, 49, 0.34);
  border-radius: 50%;
  color: var(--rl-gold);
  background: rgba(218, 190, 125, 0.11);
}

#reincarnation-root .rl-rest-art .rl-ico {
  width: 28px;
  height: 28px;
}

#reincarnation-root .rl-rest-title {
  margin-top: 1px;
  color: var(--rl-ink);
  font-family: var(--rl-serif);
  font-size: 18px;
  line-height: 1.35;
}

#reincarnation-root .rl-rest-text {
  margin-top: 2px;
  color: var(--rl-muted);
  font-size: 12px;
  line-height: 1.55;
}

#reincarnation-root .rl-rest-warning {
  margin-top: 3px;
  color: var(--rl-cinnabar-deep);
  font-size: 11.5px;
  line-height: 1.5;
}

#reincarnation-root .rl-rest-heal .rl-btn {
  margin-top: 7px;
}

#reincarnation-root .rl-upgrade-list {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

#reincarnation-root .rl-upgrade-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 9px 11px;
  border: 1px solid rgba(74, 87, 70, 0.24);
  border-radius: 8px;
  background: rgba(255, 252, 245, 0.62);
}

#reincarnation-root .rl-upgrade-main {
  flex: 1 1 250px;
  min-width: 0;
}

#reincarnation-root .rl-upgrade-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
}

#reincarnation-root .rl-upgrade-name {
  font-family: var(--rl-serif);
  font-size: 15px;
  line-height: 1.35;
}

#reincarnation-root .rl-upgrade-meta {
  color: var(--rl-muted);
  font-size: 11.5px;
}

#reincarnation-root .rl-upgrade-text {
  margin-top: 2px;
  color: var(--rl-ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

#reincarnation-root .rl-upgrade-text.is-after {
  color: #315d4d;
}

#reincarnation-root .rl-upgrade-before-label,
#reincarnation-root .rl-upgrade-after-label {
  color: var(--rl-muted);
  font-size: 11px;
}

#reincarnation-root .rl-upgrade-after-label {
  color: var(--rl-teal);
}

#reincarnation-root .rl-upgrade-action {
  min-height: 44px;
  flex: 0 0 auto;
}

#reincarnation-root .rl-upgrade-row .rl-reason {
  flex-basis: 100%;
  margin: 0;
}

/* ---------- 结局 ---------- */
#reincarnation-root .rl-result-hero {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 30px);
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--rl-line);
  border-radius: 13px;
  background:
    radial-gradient(circle at 0 0, rgba(218, 190, 125, 0.2), transparent 40%),
    linear-gradient(135deg, rgba(255, 252, 244, 0.92), rgba(231, 219, 193, 0.76));
  box-shadow: 0 12px 30px rgba(24, 43, 38, 0.12);
}

#reincarnation-root .rl-result-screen.is-defeat .rl-result-hero {
  background:
    radial-gradient(circle at 0 0, rgba(167, 58, 46, 0.1), transparent 40%),
    linear-gradient(135deg, rgba(246, 237, 226, 0.94), rgba(225, 210, 197, 0.78));
}

#reincarnation-root .rl-result-seal {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: clamp(82px, 12vw, 116px);
  height: clamp(82px, 12vw, 116px);
  border: 2px solid rgba(167, 58, 46, 0.7);
  border-radius: 8px;
  color: var(--rl-cinnabar);
  background: rgba(167, 58, 46, 0.035);
  transform: rotate(-2deg);
}

#reincarnation-root .rl-result-seal.is-win {
  border-color: rgba(140, 105, 36, 0.72);
  color: #8a671e;
  background: rgba(181, 145, 60, 0.06);
}

#reincarnation-root .rl-result-seal-char {
  font-family: var(--rl-serif);
  font-size: clamp(46px, 8vw, 70px);
  line-height: 1;
}

#reincarnation-root .rl-result-seal-ring {
  position: absolute;
  top: 7px;
  right: 7px;
  bottom: 7px;
  left: 7px;
  border: 1px solid currentColor;
  border-radius: 3px;
  opacity: 0.44;
}

#reincarnation-root .rl-result-copy {
  min-width: 0;
}

#reincarnation-root .rl-result-title {
  margin-top: 2px;
  color: var(--rl-ink);
  font-family: var(--rl-serif);
  font-size: clamp(27px, 4.5vw, 42px);
  line-height: 1.2;
  letter-spacing: 0.04em;
}

#reincarnation-root .rl-result-text {
  margin-top: 5px;
  max-width: 660px;
  color: var(--rl-ink-soft);
  font-size: 13.5px;
  line-height: 1.8;
}

#reincarnation-root .rl-result-arch {
  margin-top: 8px;
  color: var(--rl-muted);
  font-size: 12.5px;
}

#reincarnation-root .rl-result-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

#reincarnation-root .rl-result-stat {
  padding: 10px 11px;
  border: 1px solid rgba(74, 87, 70, 0.22);
  border-radius: 8px;
  background: rgba(255, 252, 245, 0.56);
}

#reincarnation-root .rl-result-stat-label {
  display: block;
  color: var(--rl-muted);
  font-size: 11.5px;
  line-height: 1.4;
}

#reincarnation-root .rl-result-stat-value {
  display: block;
  margin-top: 2px;
  color: var(--rl-ink);
  font-family: var(--rl-serif);
  font-size: 22px;
  line-height: 1.25;
}

#reincarnation-root .rl-result-unlocks.is-muted {
  opacity: 0.82;
}

#reincarnation-root .rl-result-actions {
  margin-top: 17px;
}

/* ---------- 浮层：牌堆 / 二次确认 ---------- */
#reincarnation-root .rl-overlay-host {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}

#reincarnation-root .rl-overlay {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 3vw, 28px);
  pointer-events: none;
}

#reincarnation-root .rl-overlay-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(4, 18, 19, 0.68);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}

#reincarnation-root .rl-overlay-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  max-height: min(88vh, 860px);
  overflow: hidden;
  border: 1px solid rgba(212, 185, 120, 0.44);
  border-radius: 13px;
  color: var(--rl-ink);
  background:
    radial-gradient(circle at 100% 0, rgba(218, 190, 125, 0.15), transparent 34%),
    linear-gradient(180deg, #fbf6e9, #eee1c8);
  box-shadow: 0 26px 70px rgba(1, 10, 11, 0.48);
  pointer-events: auto;
}

#reincarnation-root .rl-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(74, 87, 70, 0.22);
}

#reincarnation-root .rl-overlay-title {
  font-family: var(--rl-serif);
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: 0.03em;
}

#reincarnation-root .rl-overlay-close {
  flex: 0 0 auto;
  min-height: 44px;
}

#reincarnation-root .rl-pile-note {
  flex: 0 0 auto;
  padding: 7px 14px 0;
  color: var(--rl-muted);
  font-size: 12px;
  line-height: 1.5;
}

#reincarnation-root .rl-pile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 0 0 auto;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(74, 87, 70, 0.18);
}

#reincarnation-root .rl-pile-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 42px;
  padding: 5px 10px;
  border: 1px solid rgba(74, 87, 70, 0.24);
  border-radius: 7px;
  color: var(--rl-muted);
  background: rgba(255, 252, 245, 0.55);
  font-size: 12.5px;
  cursor: pointer;
}

#reincarnation-root .rl-pile-tab.is-active {
  color: #fff9ec;
  border-color: var(--rl-teal);
  background: var(--rl-teal);
  box-shadow: inset 0 0 0 1px rgba(255, 249, 232, 0.12);
}

#reincarnation-root .rl-pile-tab-name {
  line-height: 1.3;
}

#reincarnation-root .rl-pile-tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(74, 87, 70, 0.14);
  font-size: 11px;
  line-height: 1;
}

#reincarnation-root .rl-pile-tab.is-active .rl-pile-tab-count {
  background: rgba(255, 249, 232, 0.2);
  color: #fff9ec;
}

#reincarnation-root .rl-pile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  overflow: auto;
  padding: 13px 14px 18px;
  scrollbar-width: thin;
}

#reincarnation-root .rl-pile-grid .rl-card {
  width: 100%;
  max-width: 280px;
  flex: none;
}

#reincarnation-root .rl-pile-empty,
#reincarnation-root .rl-empty-note {
  padding: 14px;
  border: 1px dashed rgba(74, 87, 70, 0.28);
  border-radius: 8px;
  color: var(--rl-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

#reincarnation-root .rl-confirm-panel {
  width: min(480px, 100%);
  padding: 0 0 14px;
}

#reincarnation-root .rl-confirm-text {
  padding: 14px 16px 0;
  color: var(--rl-ink-soft);
  font-size: 13.5px;
  line-height: 1.75;
}

#reincarnation-root .rl-confirm-warn {
  margin: 9px 16px 0;
  padding: 8px 10px;
  border-left: 3px solid var(--rl-cinnabar);
  color: var(--rl-cinnabar-deep);
  background: rgba(167, 58, 46, 0.06);
  font-size: 12px;
  line-height: 1.6;
}

#reincarnation-root .rl-confirm-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px 0;
}

/* ---------- 提示 ---------- */
#reincarnation-root .rl-toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: max(88px, calc(78px + env(safe-area-inset-bottom, 0px)));
  max-width: min(92vw, 560px);
  padding: 9px 15px;
  border: 1px solid rgba(212, 185, 120, 0.48);
  border-radius: 999px;
  color: #fff8e8;
  background: rgba(13, 47, 47, 0.96);
  box-shadow: 0 8px 24px rgba(2, 14, 15, 0.34);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

#reincarnation-root .rl-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

#reincarnation-root .rl-toast.is-warn {
  border-color: rgba(219, 137, 108, 0.56);
  background: rgba(92, 39, 33, 0.97);
}

/* ---------- 窄屏 ---------- */
/* ---------- 桌面斗法压缩：同屏看见意图、手牌、结束回合 ---------- */
@media (min-width: 1100px) {
  #reincarnation-root .rl-combat-screen {
    padding-bottom: 94px;
  }

  #reincarnation-root .rl-arena {
    gap: 16px;
    padding: 14px 16px;
  }

  #reincarnation-root .rl-fighter {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    align-items: start;
    gap: 9px 11px;
  }

  #reincarnation-root .rl-portrait-frame {
    max-width: 126px;
  }

  #reincarnation-root .rl-enemy.is-boss .rl-portrait-frame {
    max-width: 132px;
  }

  #reincarnation-root .rl-fighter-name {
    font-size: 19px;
  }

  #reincarnation-root .rl-intent {
    margin-top: 6px;
    padding: 7px 8px;
  }

  #reincarnation-root .rl-intent-icon {
    width: 24px;
    height: 24px;
  }

  #reincarnation-root .rl-intent-label {
    font-size: 14.5px;
  }

  #reincarnation-root .rl-intent-text {
    font-size: 11.5px;
    line-height: 1.48;
  }

  #reincarnation-root .rl-intent-warning {
    margin-top: 3px;
    padding-top: 3px;
  }

  #reincarnation-root .rl-arena-center {
    padding-top: 0;
  }

  #reincarnation-root .rl-element-wrap {
    padding: 6px 8px;
  }

  #reincarnation-root .rl-element-node {
    width: 30px;
    height: 35px;
  }

  #reincarnation-root .rl-chain-hint {
    margin-top: 3px;
    font-size: 10.5px;
  }

  #reincarnation-root .rl-chain-rule {
    font-size: 10px;
    line-height: 1.4;
  }

  #reincarnation-root .rl-hand-wrap {
    margin-top: 8px;
    padding-top: 7px;
  }

  #reincarnation-root .rl-hand-head {
    padding-bottom: 4px;
  }

  #reincarnation-root .rl-hand {
    padding-bottom: 5px;
  }

  #reincarnation-root .rl-hand .rl-card {
    flex-basis: 174px;
    width: 174px;
  }

  #reincarnation-root .rl-card-art {
    height: 96px;
  }

  #reincarnation-root .rl-card-body {
    gap: 3px;
    padding: 5px 8px;
  }

  #reincarnation-root .rl-card-name {
    font-size: 14.5px;
  }

  #reincarnation-root .rl-card-text {
    font-size: 12.1px;
    line-height: 1.45;
  }

  #reincarnation-root .rl-card-resonance {
    padding: 3px 4px;
    font-size: 12px;
    line-height: 1.36;
  }

  #reincarnation-root .rl-card-foot {
    padding: 4px 6px 6px;
  }

  #reincarnation-root .rl-card-foot .rl-btn {
    min-height: 42px;
    padding: 5px 6px;
    font-size: 12px;
  }
}

@media (max-width: 820px) {
  #reincarnation-root .rl-arena {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  }

  #reincarnation-root .rl-player {
    grid-column: 1;
    grid-row: 1;
  }

  #reincarnation-root .rl-enemy {
    grid-column: 2;
    grid-row: 1;
  }

  #reincarnation-root .rl-arena-center {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 8px 10px;
  }

  #reincarnation-root .rl-turn-seal {
    grid-column: 1 / -1;
    justify-self: start;
  }

  #reincarnation-root .rl-energy {
    grid-column: 1;
  }

  #reincarnation-root .rl-element-wrap {
    grid-column: 2;
    grid-row: 2 / span 2;
  }

  #reincarnation-root .rl-resonance {
    grid-column: 1;
    justify-self: start;
  }

  #reincarnation-root .rl-reward-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #reincarnation-root .rl-result-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #reincarnation-root .rl-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  #reincarnation-root .rl-combat-screen {
    display: flex;
    flex-direction: column;
  }

  #reincarnation-root .rl-arena {
    order: 1;
  }

  #reincarnation-root .rl-hand-wrap {
    order: 2;
  }

  #reincarnation-root .rl-battle-log {
    order: 3;
  }

  #reincarnation-root .rl-preview {
    order: 4;
  }

  #reincarnation-root .rl-screen-head.has-scene {
    min-height: 98px;
    padding: 12px 13px;
  }

  #reincarnation-root .rl-screen-head.has-scene .rl-section-title {
    font-size: 23px;
  }

  #reincarnation-root .rl-screen-head.has-scene .rl-section-note {
    font-size: 12px;
    line-height: 1.5;
  }

  #reincarnation-root .rl-topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 7px;
    padding-top: 9px;
    padding-bottom: 8px;
  }

  #reincarnation-root .rl-brand {
    flex: 1 1 100%;
  }

  #reincarnation-root .rl-brand-title {
    font-size: 20px;
  }

  #reincarnation-root .rl-top-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 5px;
  }

  #reincarnation-root .rl-top-actions .rl-save {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  #reincarnation-root .rl-top-actions .rl-save-text {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #reincarnation-root .rl-top-actions .rl-btn {
    min-width: 52px;
    padding-right: 9px;
    padding-left: 9px;
    font-size: 12.5px;
  }

  #reincarnation-root .rl-top-label-full {
    display: none;
  }

  #reincarnation-root .rl-top-label-short {
    display: inline;
  }

  #reincarnation-root .rl-run-strip {
    gap: 4px 6px;
  }

  #reincarnation-root .rl-save-status {
    margin-left: auto;
  }

  #reincarnation-root .rl-map-head {
    display: block;
  }

  #reincarnation-root .rl-progress {
    margin-top: 9px;
  }

  #reincarnation-root .rl-map-progress {
    max-width: none;
  }

  #reincarnation-root .rl-map-canvas {
    min-width: 570px;
    padding: 14px 20px 18px;
  }

  #reincarnation-root .rl-map-node {
    width: 94px;
    min-height: 68px;
  }

  #reincarnation-root .rl-arena {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 5px 8px;
    padding: 6px;
  }

  #reincarnation-root .rl-fighter {
    gap: 3px;
  }

  #reincarnation-root .rl-portrait-frame {
    max-width: 68px;
  }

  #reincarnation-root .rl-enemy.is-boss .rl-portrait-frame {
    max-width: 72px;
  }

  #reincarnation-root .rl-fighter-head {
    gap: 2px 4px;
  }

  #reincarnation-root .rl-fighter-name {
    font-size: 15.5px;
    line-height: 1.2;
  }

  #reincarnation-root .rl-fighter-sub {
    font-size: 10.5px;
    line-height: 1.2;
  }

  #reincarnation-root .rl-hp {
    margin-top: 3px;
  }

  #reincarnation-root .rl-hp-text {
    font-size: 11px;
    line-height: 1.25;
  }

  #reincarnation-root .rl-hp-number {
    font-size: 12px;
  }

  #reincarnation-root .rl-hp-bar {
    height: 5px;
    margin-top: 2px;
  }

  #reincarnation-root .rl-badge-row {
    gap: 3px;
    margin-top: 3px;
  }

  #reincarnation-root .rl-block-chip,
  #reincarnation-root .rl-badge {
    gap: 2px;
    padding: 1px 5px;
    font-size: 12px;
    line-height: 1.1;
  }

  #reincarnation-root .rl-block-chip .rl-ico {
    width: 10px;
    height: 10px;
  }

  #reincarnation-root .rl-status-row {
    gap: 3px;
    margin-top: 3px;
  }

  #reincarnation-root .rl-status-row-label {
    display: none;
  }

  #reincarnation-root .rl-status,
  #reincarnation-root .rl-status-summary {
    gap: 2px;
    min-height: 21px;
    padding: 1px 4px;
    font-size: 12px;
    line-height: 1.25;
  }

  #reincarnation-root .rl-status-ico {
    width: 10px;
    height: 10px;
  }

  #reincarnation-root .rl-status-value {
    font-size: 12px;
  }

  #reincarnation-root .rl-status-explain {
    font-size: 12px;
    line-height: 1.45;
  }

  #reincarnation-root .rl-sigil {
    width: 82%;
  }

  #reincarnation-root .rl-sigil-glyph {
    font-size: 38px;
  }

  #reincarnation-root .rl-intent {
    margin-top: 3px;
    padding: 3px 5px;
    border-radius: 6px;
  }

  #reincarnation-root .rl-intent-head {
    gap: 4px;
  }

  #reincarnation-root .rl-intent-icon {
    width: 19px;
    height: 19px;
  }

  #reincarnation-root .rl-intent-icon .rl-ico {
    width: 12px;
    height: 12px;
  }

  #reincarnation-root .rl-intent-title {
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 3px;
  }

  #reincarnation-root .rl-intent-label {
    font-size: 13px;
    line-height: 1.25;
  }

  #reincarnation-root .rl-intent-public {
    display: none;
  }

  #reincarnation-root .rl-intent-numbers {
    gap: 5px;
    margin-top: 2px;
  }

  #reincarnation-root .rl-intent-damage,
  #reincarnation-root .rl-intent-block {
    font-size: 16px;
    line-height: 1.2;
  }

  #reincarnation-root .rl-intent-variable {
    font-size: 12px;
  }

  #reincarnation-root .rl-intent-text {
    margin-top: 1px;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #reincarnation-root .rl-intent-warning {
    display: none;
  }

  #reincarnation-root .rl-arena-center {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 4px 6px;
    padding: 0;
  }

  #reincarnation-root .rl-turn-seal {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    justify-self: start;
    gap: 4px;
    padding: 2px 7px 2px 4px;
  }

  #reincarnation-root .rl-turn-label {
    font-size: 10.5px;
  }

  #reincarnation-root .rl-turn-value {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }

  #reincarnation-root .rl-energy {
    display: flex;
    align-items: center;
    grid-column: 2;
    grid-row: 1;
    gap: 5px;
    padding: 3px 6px;
  }

  #reincarnation-root .rl-energy-head {
    justify-content: flex-start;
    gap: 4px;
  }

  #reincarnation-root .rl-energy-label {
    font-size: 10.5px;
  }

  #reincarnation-root .rl-energy-value {
    font-size: 13px;
  }

  #reincarnation-root .rl-energy-pips {
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 0;
  }

  #reincarnation-root .rl-energy-pip {
    width: 8px;
    height: 6px;
  }

  #reincarnation-root .rl-energy-note {
    display: none;
  }

  #reincarnation-root .rl-resonance {
    align-self: center;
    justify-self: end;
    grid-column: 3;
    grid-row: 1;
    gap: 2px;
    font-size: 10.5px;
    white-space: nowrap;
  }

  #reincarnation-root .rl-resonance .rl-ico {
    width: 10px;
    height: 10px;
  }

  #reincarnation-root .rl-element-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 3px 5px;
  }

  #reincarnation-root .rl-element-chain {
    flex-wrap: nowrap;
    gap: 1px;
  }

  #reincarnation-root .rl-element-node {
    width: 24px;
    height: 26px;
  }

  #reincarnation-root .rl-element-char {
    font-size: 14px;
  }

  #reincarnation-root .rl-element-tag {
    display: none;
  }

  #reincarnation-root .rl-element-arrow {
    font-size: 10px;
  }

  #reincarnation-root .rl-chain-hint {
    margin-top: 2px;
    overflow: hidden;
    font-size: 11.5px;
    line-height: 1.3;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #reincarnation-root .rl-chain-rule {
    display: none;
  }

  #reincarnation-root .rl-battle-log {
    margin-top: 7px;
    padding: 0;
  }

  #reincarnation-root .rl-log-lines {
    max-height: 72px;
  }

  #reincarnation-root .rl-combat-screen {
    padding-bottom: 138px;
  }

  #reincarnation-root .rl-hand-wrap {
    margin-top: 6px;
    padding: 4px 0 2px;
  }

  #reincarnation-root .rl-hand-head {
    gap: 6px;
    padding: 0 2px 4px;
  }

  #reincarnation-root .rl-hand-title h3 {
    font-size: 16px;
  }

  #reincarnation-root .rl-hand-hint {
    max-width: 158px;
    font-size: 11.5px;
    line-height: 1.35;
  }

  #reincarnation-root .rl-hand {
    gap: 8px;
    padding: 2px 2px 8px;
  }

  #reincarnation-root .rl-hand .rl-card {
    flex-basis: 152px;
    width: 152px;
  }

  #reincarnation-root .rl-hand .rl-card-art {
    height: 68px;
  }

  #reincarnation-root .rl-hand .rl-card-body {
    gap: 3px;
    padding: 5px 7px 4px;
  }

  #reincarnation-root .rl-hand .rl-card-name {
    font-size: 14px;
  }

  #reincarnation-root .rl-hand .rl-card-meta {
    font-size: 12px;
    line-height: 1.25;
  }

  #reincarnation-root .rl-hand .rl-card-text {
    font-size: 12.2px;
    line-height: 1.42;
  }

  #reincarnation-root .rl-hand .rl-card-resonance {
    padding: 2px 4px;
    font-size: 12px;
    line-height: 1.3;
  }

  #reincarnation-root .rl-hand .rl-card-foot {
    padding: 3px 5px 5px;
  }

  #reincarnation-root .rl-hand .rl-card-foot .rl-btn {
    min-height: 42px;
    padding: 4px 5px;
    font-size: 12px;
  }

  #reincarnation-root .rl-hand .rl-card-upgraded {
    padding: 1px 3px;
    font-size: 12px;
    line-height: 1.2;
  }

  #reincarnation-root .rl-combat-bar {
    gap: 7px;
    min-height: 70px;
    padding: 7px 9px calc(7px + env(safe-area-inset-bottom, 0px));
  }

  #reincarnation-root .rl-pile-buttons {
    gap: 3px;
  }

  #reincarnation-root .rl-pile-btn {
    min-width: 43px;
    min-height: 44px;
    padding: 3px 5px;
  }

  #reincarnation-root .rl-pile-btn-label {
    font-size: 11px;
  }

  #reincarnation-root .rl-end-wrap {
    flex: 1 1 auto;
    min-width: 0;
  }

  #reincarnation-root .rl-end-note {
    display: none;
  }

  #reincarnation-root .rl-end-turn {
    width: 100%;
    min-width: 0;
    min-height: 47px;
    padding-right: 8px;
    padding-left: 8px;
    font-size: 14px;
  }

  #reincarnation-root .rl-combat-abandon {
    display: none;
  }

  #reincarnation-root .rl-reward-grid {
    grid-template-columns: 1fr;
  }

  #reincarnation-root .rl-reward-choice {
    max-width: 300px;
    margin: 0 auto;
  }

  #reincarnation-root .rl-rest-options {
    grid-template-columns: 1fr;
  }

  #reincarnation-root .rl-rest-heal,
  #reincarnation-root .rl-rest-upgrade {
    align-items: flex-start;
  }

  #reincarnation-root .rl-shop-grid {
    grid-template-columns: 1fr;
  }

  #reincarnation-root .rl-result-hero {
    display: block;
  }

  #reincarnation-root .rl-result-seal {
    float: left;
    width: 76px;
    height: 76px;
    margin: 0 14px 8px 0;
  }

  #reincarnation-root .rl-result-seal-char {
    font-size: 43px;
  }

  #reincarnation-root .rl-result-title {
    font-size: 27px;
  }

  #reincarnation-root .rl-result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #reincarnation-root .rl-result-stat-value {
    font-size: 20px;
  }

  #reincarnation-root .rl-pile-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 8px;
    padding: 10px;
  }

  #reincarnation-root .rl-pile-tab {
    flex: 1 1 auto;
    justify-content: center;
  }

  #reincarnation-root .rl-overlay {
    padding: 7px;
  }

  #reincarnation-root .rl-overlay-panel {
    max-height: 92vh;
  }

  #reincarnation-root .rl-overlay-head {
    padding: 8px 10px;
  }

  #reincarnation-root .rl-overlay-title {
    font-size: 17px;
  }

  #reincarnation-root .rl-confirm-actions {
    padding: 12px 12px 0;
  }

  #reincarnation-root .rl-toast {
    bottom: max(82px, calc(73px + env(safe-area-inset-bottom, 0px)));
    max-width: 94vw;
    font-size: 12px;
  }
}

@media (max-width: 400px) {
  #reincarnation-root .rl-shell {
    padding-right: 8px;
    padding-left: 8px;
  }

  #reincarnation-root .rl-hand-hint {
    display: none;
  }

  #reincarnation-root .rl-hand-head {
    justify-content: flex-start;
  }

  #reincarnation-root .rl-top-actions .rl-btn {
    padding-right: 7px;
    padding-left: 7px;
    font-size: 11.5px;
  }

  #reincarnation-root .rl-fighter-name {
    font-size: 16.5px;
  }

  #reincarnation-root .rl-hp-text {
    font-size: 11px;
  }

  #reincarnation-root .rl-hp-number {
    font-size: 12px;
  }

  #reincarnation-root .rl-intent-label {
    font-size: 14.5px;
  }

  #reincarnation-root .rl-intent-damage,
  #reincarnation-root .rl-intent-block {
    font-size: 17px;
  }

  #reincarnation-root .rl-turn-label {
    font-size: 9.5px;
  }

  #reincarnation-root .rl-pile-btn {
    min-width: 39px;
    padding: 2px 4px;
  }

  #reincarnation-root .rl-pile-btn .rl-ico {
    width: 14px;
    height: 14px;
  }

  #reincarnation-root .rl-end-note {
    font-size: 9px;
  }

  #reincarnation-root .rl-map-canvas {
    min-width: 550px;
  }

  #reincarnation-root .rl-reward-choice {
    max-width: 100%;
  }

  #reincarnation-root .rl-upgrade-row {
    padding: 8px 9px;
  }

  #reincarnation-root .rl-upgrade-action {
    width: 100%;
  }

  #reincarnation-root .rl-result-hero {
    padding: 13px;
  }

  #reincarnation-root .rl-result-seal {
    width: 66px;
    height: 66px;
    margin-right: 11px;
  }

  #reincarnation-root .rl-result-seal-char {
    font-size: 37px;
  }
}

/* ---------- 减动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  #reincarnation-root *,
  #reincarnation-root *::before,
  #reincarnation-root *::after {
    animation: none !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  #reincarnation-root .rl-toast {
    transition: none;
    transform: translate(-50%, 0);
  }
}

body.no-anim #reincarnation-root *,
body.no-anim #reincarnation-root *::before,
body.no-anim #reincarnation-root *::after {
  animation: none !important;
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  transition-delay: 0ms !important;
}


